your-ai-workflow-firebase-os 1.14.4 → 1.14.5
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/{ContactPopup-CC7yl4TP.js → ContactPopup-CBPID7tF.js} +318 -278
- package/dist/{ContactPopup-LwiKHyJl.cjs → ContactPopup-r92_Yl8O.cjs} +3 -3
- package/dist/{PhoneInputField-B4j7wwjH.js → PhoneInputField-T0ttIIIN.js} +1 -1
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.es.js +1 -1
- package/dist/your-ai-workflow-firebase-os.cjs.js +19 -19
- package/dist/your-ai-workflow-firebase-os.css +1 -1
- package/dist/your-ai-workflow-firebase-os.es.js +6237 -6159
- package/package.json +1 -1
- package/src/index.css +17 -0
|
@@ -124,7 +124,7 @@ function De({ config: e, children: t }) {
|
|
|
124
124
|
children: t
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
var Oe = () => d(Ee), ke = "1.14.
|
|
127
|
+
var Oe = () => d(Ee), ke = "1.14.5", Ae = typeof window < "u" ? h : f, je = o(void 0), Me = (e) => {
|
|
128
128
|
let t = e?.defaultTheme;
|
|
129
129
|
return t !== "light" && t !== "dark" || e?.showThemeToggle ? null : t;
|
|
130
130
|
};
|
|
@@ -45457,7 +45457,7 @@ var BW = t.forwardRef(({ className: e, label: t, error: n, currencySymbol: r, ty
|
|
|
45457
45457
|
children: t
|
|
45458
45458
|
}),
|
|
45459
45459
|
/* @__PURE__ */ x("div", {
|
|
45460
|
-
className: "relative flex items-center",
|
|
45460
|
+
className: "relative flex items-center lift-focus",
|
|
45461
45461
|
children: [s && r && /* @__PURE__ */ b("span", {
|
|
45462
45462
|
className: "absolute left-4 font-bold text-foreground/70 z-10 pointer-events-none text-[15px]",
|
|
45463
45463
|
children: r
|
|
@@ -45753,7 +45753,40 @@ function iG(e) {
|
|
|
45753
45753
|
return "Attached file";
|
|
45754
45754
|
}
|
|
45755
45755
|
}
|
|
45756
|
-
var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission to upload here." : e?.message || "That upload did not work. Try again.", oG =
|
|
45756
|
+
var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission to upload here." : e?.message || "That upload did not work. Try again.", oG = (e, t) => {
|
|
45757
|
+
let n = String(t || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
45758
|
+
if (!n.length) return !0;
|
|
45759
|
+
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
45760
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r === e);
|
|
45761
|
+
}, sG = (e) => Array.from(e.dataTransfer?.types || []).includes("Files");
|
|
45762
|
+
function cG({ onFiles: e, onReject: t, accept: n, multiple: r = !1, disabled: i = !1 }) {
|
|
45763
|
+
let [a, o] = v(!1), s = _(0);
|
|
45764
|
+
return {
|
|
45765
|
+
over: a && !i,
|
|
45766
|
+
dropProps: {
|
|
45767
|
+
onDragEnter: (e) => {
|
|
45768
|
+
i || !sG(e) || (e.preventDefault(), s.current += 1, o(!0));
|
|
45769
|
+
},
|
|
45770
|
+
onDragOver: (e) => {
|
|
45771
|
+
i || !sG(e) || e.preventDefault();
|
|
45772
|
+
},
|
|
45773
|
+
onDragLeave: (e) => {
|
|
45774
|
+
sG(e) && (s.current = Math.max(0, s.current - 1), s.current === 0 && o(!1));
|
|
45775
|
+
},
|
|
45776
|
+
onDrop: (a) => {
|
|
45777
|
+
if (s.current = 0, o(!1), i || !sG(a)) return;
|
|
45778
|
+
a.preventDefault();
|
|
45779
|
+
let c = Array.from(a.dataTransfer.files || []), l = c.filter((e) => oG(e, n)), u = c.filter((e) => !oG(e, n));
|
|
45780
|
+
u.length && t?.(u);
|
|
45781
|
+
let d = r ? l : l.slice(0, 1);
|
|
45782
|
+
d.length && e(d);
|
|
45783
|
+
}
|
|
45784
|
+
}
|
|
45785
|
+
};
|
|
45786
|
+
}
|
|
45787
|
+
//#endregion
|
|
45788
|
+
//#region src/lib/schedule.ts
|
|
45789
|
+
var lG = [
|
|
45757
45790
|
"mon",
|
|
45758
45791
|
"tue",
|
|
45759
45792
|
"wed",
|
|
@@ -45761,7 +45794,7 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45761
45794
|
"fri",
|
|
45762
45795
|
"sat",
|
|
45763
45796
|
"sun"
|
|
45764
|
-
],
|
|
45797
|
+
], uG = {
|
|
45765
45798
|
mon: "Monday",
|
|
45766
45799
|
tue: "Tuesday",
|
|
45767
45800
|
wed: "Wednesday",
|
|
@@ -45769,7 +45802,7 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45769
45802
|
fri: "Friday",
|
|
45770
45803
|
sat: "Saturday",
|
|
45771
45804
|
sun: "Sunday"
|
|
45772
|
-
},
|
|
45805
|
+
}, dG = {
|
|
45773
45806
|
mon: "Mon",
|
|
45774
45807
|
tue: "Tue",
|
|
45775
45808
|
wed: "Wed",
|
|
@@ -45777,7 +45810,7 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45777
45810
|
fri: "Fri",
|
|
45778
45811
|
sat: "Sat",
|
|
45779
45812
|
sun: "Sun"
|
|
45780
|
-
},
|
|
45813
|
+
}, fG = [
|
|
45781
45814
|
"sun",
|
|
45782
45815
|
"mon",
|
|
45783
45816
|
"tue",
|
|
@@ -45785,7 +45818,7 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45785
45818
|
"thu",
|
|
45786
45819
|
"fri",
|
|
45787
45820
|
"sat"
|
|
45788
|
-
],
|
|
45821
|
+
], pG = "sys_schedules", mG = "pub_bookings", hG = "mem_bookings", gG = [
|
|
45789
45822
|
{
|
|
45790
45823
|
value: "15",
|
|
45791
45824
|
label: "15 minutes"
|
|
@@ -45810,7 +45843,7 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45810
45843
|
value: "120",
|
|
45811
45844
|
label: "2 hours"
|
|
45812
45845
|
}
|
|
45813
|
-
],
|
|
45846
|
+
], _G = [
|
|
45814
45847
|
{
|
|
45815
45848
|
value: "7",
|
|
45816
45849
|
label: "A week ahead"
|
|
@@ -45831,7 +45864,7 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45831
45864
|
value: "90",
|
|
45832
45865
|
label: "Three months ahead"
|
|
45833
45866
|
}
|
|
45834
|
-
],
|
|
45867
|
+
], vG = [
|
|
45835
45868
|
{
|
|
45836
45869
|
value: "0",
|
|
45837
45870
|
label: "No notice needed"
|
|
@@ -45852,19 +45885,19 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45852
45885
|
value: "48",
|
|
45853
45886
|
label: "At least two days"
|
|
45854
45887
|
}
|
|
45855
|
-
],
|
|
45888
|
+
], yG = Array.from({ length: 48 }, (e, t) => {
|
|
45856
45889
|
let n = `${String(Math.floor(t / 2)).padStart(2, "0")}:${t % 2 ? "30" : "00"}`;
|
|
45857
45890
|
return {
|
|
45858
45891
|
value: n,
|
|
45859
45892
|
label: n
|
|
45860
45893
|
};
|
|
45861
|
-
}),
|
|
45894
|
+
}), bG = [...yG.slice(1), {
|
|
45862
45895
|
value: "24:00",
|
|
45863
45896
|
label: "Midnight"
|
|
45864
|
-
}],
|
|
45897
|
+
}], xG = {
|
|
45865
45898
|
from: "09:00",
|
|
45866
45899
|
to: "17:00"
|
|
45867
|
-
},
|
|
45900
|
+
}, SG = (e, t = e, n = "", r = OG()) => ({
|
|
45868
45901
|
id: e,
|
|
45869
45902
|
memberId: t,
|
|
45870
45903
|
memberName: n,
|
|
@@ -45877,30 +45910,30 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45877
45910
|
timeZone: r,
|
|
45878
45911
|
slotMinutes: 30,
|
|
45879
45912
|
days: {
|
|
45880
|
-
mon: [
|
|
45881
|
-
tue: [
|
|
45882
|
-
wed: [
|
|
45883
|
-
thu: [
|
|
45884
|
-
fri: [
|
|
45913
|
+
mon: [xG],
|
|
45914
|
+
tue: [xG],
|
|
45915
|
+
wed: [xG],
|
|
45916
|
+
thu: [xG],
|
|
45917
|
+
fri: [xG],
|
|
45885
45918
|
sat: [],
|
|
45886
45919
|
sun: []
|
|
45887
45920
|
},
|
|
45888
45921
|
horizonDays: 30,
|
|
45889
45922
|
noticeHours: 12
|
|
45890
|
-
}),
|
|
45923
|
+
}), CG = /^([01]\d|2[0-3]):[0-5]\d$/, wG = /^(([01]\d|2[0-3]):[0-5]\d|24:00)$/, TG = (e) => {
|
|
45891
45924
|
let t = String(e?.from || ""), n = String(e?.to || "");
|
|
45892
|
-
return
|
|
45925
|
+
return CG.test(t) && wG.test(n) ? {
|
|
45893
45926
|
from: t,
|
|
45894
45927
|
to: n
|
|
45895
45928
|
} : null;
|
|
45896
|
-
},
|
|
45929
|
+
}, EG = (e, t, n) => {
|
|
45897
45930
|
let r = typeof e == "number" ? e : Number(e);
|
|
45898
45931
|
return !Number.isFinite(r) || r < 0 || n && !n.includes(r) ? t : r;
|
|
45899
|
-
},
|
|
45900
|
-
let n = !String(t?.memberId || "").trim(), r = n ? e : String(t.memberId), i = String((n ? t?.name : t?.memberName) || ""), a =
|
|
45901
|
-
for (let e of
|
|
45932
|
+
}, DG = (e, t) => {
|
|
45933
|
+
let n = !String(t?.memberId || "").trim(), r = n ? e : String(t.memberId), i = String((n ? t?.name : t?.memberName) || ""), a = SG(e, r, i, "UTC"), o = { ...a.days };
|
|
45934
|
+
for (let e of lG) {
|
|
45902
45935
|
let n = t?.days?.[e];
|
|
45903
|
-
o[e] = Array.isArray(n) ? n.map(
|
|
45936
|
+
o[e] = Array.isArray(n) ? n.map(TG).filter((e) => !!e) : [];
|
|
45904
45937
|
}
|
|
45905
45938
|
let s = t?.days && typeof t.days == "object";
|
|
45906
45939
|
return {
|
|
@@ -45913,26 +45946,26 @@ var aG = (e) => e?.code === "storage/unauthorized" ? "You do not have permission
|
|
|
45913
45946
|
notifyOwner: t?.notifyOwner !== !1,
|
|
45914
45947
|
confirmBooker: t?.confirmBooker !== !1,
|
|
45915
45948
|
enabled: t?.enabled === !0,
|
|
45916
|
-
timeZone:
|
|
45917
|
-
slotMinutes:
|
|
45949
|
+
timeZone: AG(t?.timeZone) ? String(t.timeZone) : a.timeZone,
|
|
45950
|
+
slotMinutes: EG(t?.slotMinutes, 30, gG.map((e) => Number(e.value))),
|
|
45918
45951
|
days: s ? o : a.days,
|
|
45919
|
-
horizonDays:
|
|
45920
|
-
noticeHours:
|
|
45952
|
+
horizonDays: EG(t?.horizonDays, 30),
|
|
45953
|
+
noticeHours: EG(t?.noticeHours, 12),
|
|
45921
45954
|
createdAt: typeof t?.createdAt == "number" ? t.createdAt : void 0,
|
|
45922
45955
|
updatedAt: typeof t?.updatedAt == "number" ? t.updatedAt : void 0
|
|
45923
45956
|
};
|
|
45924
45957
|
};
|
|
45925
|
-
function
|
|
45958
|
+
function OG() {
|
|
45926
45959
|
try {
|
|
45927
45960
|
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
45928
45961
|
} catch {
|
|
45929
45962
|
return "UTC";
|
|
45930
45963
|
}
|
|
45931
45964
|
}
|
|
45932
|
-
var
|
|
45933
|
-
function
|
|
45965
|
+
var kG = /* @__PURE__ */ new Map();
|
|
45966
|
+
function AG(e) {
|
|
45934
45967
|
if (typeof e != "string" || !e.trim()) return !1;
|
|
45935
|
-
let t =
|
|
45968
|
+
let t = kG.get(e);
|
|
45936
45969
|
if (t !== void 0) return t;
|
|
45937
45970
|
let n = !1;
|
|
45938
45971
|
try {
|
|
@@ -45940,21 +45973,21 @@ function DG(e) {
|
|
|
45940
45973
|
} catch {
|
|
45941
45974
|
n = !1;
|
|
45942
45975
|
}
|
|
45943
|
-
return
|
|
45976
|
+
return kG.set(e, n), n;
|
|
45944
45977
|
}
|
|
45945
|
-
function
|
|
45978
|
+
function jG() {
|
|
45946
45979
|
try {
|
|
45947
45980
|
return Intl.supportedValuesOf ? Intl.supportedValuesOf("timeZone") : ["UTC"];
|
|
45948
45981
|
} catch {
|
|
45949
45982
|
return ["UTC"];
|
|
45950
45983
|
}
|
|
45951
45984
|
}
|
|
45952
|
-
function
|
|
45953
|
-
let n = e.trim().toLowerCase().replace(/\s+/g, "_"), r =
|
|
45985
|
+
function MG(e, t = 12) {
|
|
45986
|
+
let n = e.trim().toLowerCase().replace(/\s+/g, "_"), r = jG(), i = OG(), a = n ? r.filter((e) => e.toLowerCase().includes(n)) : r;
|
|
45954
45987
|
return (a.includes(i) ? [i, ...a.filter((e) => e !== i)] : a).slice(0, t);
|
|
45955
45988
|
}
|
|
45956
|
-
var
|
|
45957
|
-
let t =
|
|
45989
|
+
var NG = /* @__PURE__ */ new Map(), PG = (e) => {
|
|
45990
|
+
let t = NG.get(e);
|
|
45958
45991
|
return t || (t = new Intl.DateTimeFormat("en-US", {
|
|
45959
45992
|
timeZone: e,
|
|
45960
45993
|
hourCycle: "h23",
|
|
@@ -45965,11 +45998,11 @@ var AG = /* @__PURE__ */ new Map(), jG = (e) => {
|
|
|
45965
45998
|
hour: "2-digit",
|
|
45966
45999
|
minute: "2-digit",
|
|
45967
46000
|
second: "2-digit"
|
|
45968
|
-
}),
|
|
46001
|
+
}), NG.set(e, t)), t;
|
|
45969
46002
|
};
|
|
45970
|
-
function
|
|
46003
|
+
function FG(e, t) {
|
|
45971
46004
|
let n = {};
|
|
45972
|
-
for (let r of
|
|
46005
|
+
for (let r of PG(t).formatToParts(e)) n[r.type] = r.value;
|
|
45973
46006
|
let r = Number(n.year), i = Number(n.month), a = Number(n.day), o = Number(n.hour) % 24, s = Number(n.minute);
|
|
45974
46007
|
return {
|
|
45975
46008
|
year: r,
|
|
@@ -45983,23 +46016,23 @@ function MG(e, t) {
|
|
|
45983
46016
|
time: `${String(o).padStart(2, "0")}:${String(s).padStart(2, "0")}`
|
|
45984
46017
|
};
|
|
45985
46018
|
}
|
|
45986
|
-
function
|
|
45987
|
-
let n =
|
|
46019
|
+
function IG(e, t) {
|
|
46020
|
+
let n = FG(t, e), r = Date.UTC(n.year, n.month - 1, n.day, n.hour, n.minute, n.second);
|
|
45988
46021
|
return Math.round((r - t.getTime()) / 6e4);
|
|
45989
46022
|
}
|
|
45990
|
-
function
|
|
45991
|
-
let [r, i, a] = e.split("-").map(Number), [o, s] = t.split(":").map(Number), c = Date.UTC(r, i - 1, a, o, s), l =
|
|
45992
|
-
return d !== l && (u = c - d * 6e4,
|
|
46023
|
+
function LG(e, t, n) {
|
|
46024
|
+
let [r, i, a] = e.split("-").map(Number), [o, s] = t.split(":").map(Number), c = Date.UTC(r, i - 1, a, o, s), l = IG(n, new Date(c)), u = c - l * 6e4, d = IG(n, new Date(u));
|
|
46025
|
+
return d !== l && (u = c - d * 6e4, IG(n, new Date(u)) !== d && (u = c - Math.min(l, d) * 6e4)), new Date(u);
|
|
45993
46026
|
}
|
|
45994
|
-
function
|
|
46027
|
+
function RG(e, t) {
|
|
45995
46028
|
let [n, r, i] = e.split("-").map(Number), a = new Date(Date.UTC(n, r - 1, i + t));
|
|
45996
46029
|
return `${a.getUTCFullYear()}-${String(a.getUTCMonth() + 1).padStart(2, "0")}-${String(a.getUTCDate()).padStart(2, "0")}`;
|
|
45997
46030
|
}
|
|
45998
|
-
function
|
|
46031
|
+
function zG(e) {
|
|
45999
46032
|
let [t, n, r] = e.split("-").map(Number);
|
|
46000
|
-
return
|
|
46033
|
+
return fG[new Date(Date.UTC(t, n - 1, r)).getUTCDay()];
|
|
46001
46034
|
}
|
|
46002
|
-
function
|
|
46035
|
+
function BG(e, t) {
|
|
46003
46036
|
let [n, r] = e.split("-").map(Number);
|
|
46004
46037
|
return new Intl.DateTimeFormat(t, {
|
|
46005
46038
|
month: "long",
|
|
@@ -46007,21 +46040,21 @@ function LG(e, t) {
|
|
|
46007
46040
|
timeZone: "UTC"
|
|
46008
46041
|
}).format(new Date(Date.UTC(n, r - 1, 1)));
|
|
46009
46042
|
}
|
|
46010
|
-
function
|
|
46043
|
+
function VG(e, t) {
|
|
46011
46044
|
let [n, r] = e.split("-").map(Number), i = new Date(Date.UTC(n, r - 1 + t, 1));
|
|
46012
46045
|
return `${i.getUTCFullYear()}-${String(i.getUTCMonth() + 1).padStart(2, "0")}`;
|
|
46013
46046
|
}
|
|
46014
|
-
var
|
|
46047
|
+
var HG = (e, t) => e.start < t.end && t.start < e.end, UG = (e, t) => `${e}__${t.replace(/[-:]/g, "").slice(0, 15)}`, WG = (e) => {
|
|
46015
46048
|
let [t, n] = e.split(":").map(Number);
|
|
46016
46049
|
return t * 60 + n;
|
|
46017
46050
|
};
|
|
46018
|
-
function
|
|
46019
|
-
if (!
|
|
46020
|
-
let { now: n } = t, r = (t.taken || []).filter((t) => t.memberId === e.memberId), i = e.timeZone, a = e.slotMinutes * 6e4, o = n.getTime() + e.noticeHours * 36e5, s = Math.max(1, Math.min(t.days ?? e.horizonDays, e.horizonDays)), c =
|
|
46051
|
+
function GG(e, t) {
|
|
46052
|
+
if (!fK(e)) return [];
|
|
46053
|
+
let { now: n } = t, r = (t.taken || []).filter((t) => t.memberId === e.memberId), i = e.timeZone, a = e.slotMinutes * 6e4, o = n.getTime() + e.noticeHours * 36e5, s = Math.max(1, Math.min(t.days ?? e.horizonDays, e.horizonDays)), c = FG(n, i).dateKey, l = /* @__PURE__ */ new Map();
|
|
46021
46054
|
for (let t = 0; t < s; t++) {
|
|
46022
|
-
let n =
|
|
46055
|
+
let n = RG(c, t), s = (e.days[zG(n)] || []).filter((e) => WG(e.to) > WG(e.from)).sort((e, t) => WG(e.from) - WG(t.from));
|
|
46023
46056
|
for (let t of s) {
|
|
46024
|
-
let s =
|
|
46057
|
+
let s = LG(n, t.from, i).getTime(), c = LG(n, t.to, i).getTime();
|
|
46025
46058
|
for (let t = s; t + a <= c; t += a) {
|
|
46026
46059
|
if (t < o || l.has(t)) continue;
|
|
46027
46060
|
let n = {
|
|
@@ -46030,33 +46063,33 @@ function HG(e, t) {
|
|
|
46030
46063
|
memberId: e.memberId,
|
|
46031
46064
|
scheduleId: e.id
|
|
46032
46065
|
};
|
|
46033
|
-
r.some((e) =>
|
|
46066
|
+
r.some((e) => HG(e, n)) || l.set(t, n);
|
|
46034
46067
|
}
|
|
46035
46068
|
}
|
|
46036
46069
|
}
|
|
46037
46070
|
return [...l.keys()].sort((e, t) => e - t).map((e) => l.get(e));
|
|
46038
46071
|
}
|
|
46039
|
-
function
|
|
46040
|
-
return e.flatMap((e) =>
|
|
46072
|
+
function KG(e, t) {
|
|
46073
|
+
return e.flatMap((e) => GG(e, t)).sort((e, t) => e.start.localeCompare(t.start) || e.memberId.localeCompare(t.memberId) || e.scheduleId.localeCompare(t.scheduleId));
|
|
46041
46074
|
}
|
|
46042
|
-
var
|
|
46043
|
-
function
|
|
46075
|
+
var qG = (e, t) => e.filter((e) => e.memberId === t), JG = (e, t) => t.find((t) => t.id === e.scheduleId) || t.find((t) => t.memberId === e.memberId), YG = (e) => `/book/${e}`, XG = (e) => `/pay/${e}`;
|
|
46076
|
+
function ZG(e) {
|
|
46044
46077
|
let t = typeof window < "u" && window.location?.origin ? window.location.origin : "";
|
|
46045
46078
|
return t ? `${t}${e}` : e;
|
|
46046
46079
|
}
|
|
46047
|
-
function
|
|
46080
|
+
function QG(e, t, n) {
|
|
46048
46081
|
let r = /* @__PURE__ */ new Map();
|
|
46049
46082
|
for (let i of e) {
|
|
46050
|
-
let e = new Date(i.start), { dateKey: a } =
|
|
46083
|
+
let e = new Date(i.start), { dateKey: a } = FG(e, t), o = r.get(a);
|
|
46051
46084
|
o || (o = {
|
|
46052
46085
|
dateKey: a,
|
|
46053
|
-
label:
|
|
46086
|
+
label: $G(e, t, n),
|
|
46054
46087
|
slots: []
|
|
46055
46088
|
}, r.set(a, o)), o.slots.push(i);
|
|
46056
46089
|
}
|
|
46057
46090
|
return [...r.values()].sort((e, t) => e.dateKey.localeCompare(t.dateKey));
|
|
46058
46091
|
}
|
|
46059
|
-
function
|
|
46092
|
+
function $G(e, t, n) {
|
|
46060
46093
|
return new Intl.DateTimeFormat(n, {
|
|
46061
46094
|
timeZone: t,
|
|
46062
46095
|
weekday: "short",
|
|
@@ -46065,7 +46098,7 @@ function XG(e, t, n) {
|
|
|
46065
46098
|
year: "numeric"
|
|
46066
46099
|
}).format(e);
|
|
46067
46100
|
}
|
|
46068
|
-
function
|
|
46101
|
+
function eK(e, t, n) {
|
|
46069
46102
|
return new Intl.DateTimeFormat(n, {
|
|
46070
46103
|
timeZone: t,
|
|
46071
46104
|
hour: "numeric",
|
|
@@ -46081,17 +46114,17 @@ function ZG(e, t, n) {
|
|
|
46081
46114
|
hourCycle: "h23"
|
|
46082
46115
|
}).format(e);
|
|
46083
46116
|
}
|
|
46084
|
-
function
|
|
46117
|
+
function tK(e, t, n) {
|
|
46085
46118
|
let r = new Date(e.start), i = new Date(e.end);
|
|
46086
|
-
return `${
|
|
46119
|
+
return `${$G(r, t, n)}, ${eK(r, t, n)}–${eK(i, t, n)}`;
|
|
46087
46120
|
}
|
|
46088
|
-
var
|
|
46089
|
-
function
|
|
46121
|
+
var nK = (e) => e.replace(/_/g, " ").replace(/\//g, " / ");
|
|
46122
|
+
function rK(e, t, n, r) {
|
|
46090
46123
|
let i = t.trim();
|
|
46091
|
-
return `${
|
|
46124
|
+
return `${tK(e, n, r)} (${nK(n)})${i ? ` with ${i}` : ""}`;
|
|
46092
46125
|
}
|
|
46093
|
-
var
|
|
46094
|
-
function
|
|
46126
|
+
var iK = (e) => `${e.start}|${e.end}|${e.memberId}|${e.scheduleId}`;
|
|
46127
|
+
function aK(e) {
|
|
46095
46128
|
if (typeof e != "string") return null;
|
|
46096
46129
|
let [t, n, r, i] = e.split("|");
|
|
46097
46130
|
return !t || !n || !r || Number.isNaN(Date.parse(t)) || Number.isNaN(Date.parse(n)) ? null : {
|
|
@@ -46101,22 +46134,22 @@ function nK(e) {
|
|
|
46101
46134
|
scheduleId: i || ""
|
|
46102
46135
|
};
|
|
46103
46136
|
}
|
|
46104
|
-
function
|
|
46137
|
+
function oK(e, t, n, r, i) {
|
|
46105
46138
|
return {
|
|
46106
|
-
[e]:
|
|
46139
|
+
[e]: rK(t, n, r, i),
|
|
46107
46140
|
[`${e}Start`]: t.start,
|
|
46108
46141
|
[`${e}End`]: t.end,
|
|
46109
46142
|
[`${e}With`]: n,
|
|
46110
46143
|
[`${e}TimeZone`]: r
|
|
46111
46144
|
};
|
|
46112
46145
|
}
|
|
46113
|
-
var
|
|
46146
|
+
var sK = [
|
|
46114
46147
|
"Start",
|
|
46115
46148
|
"End",
|
|
46116
46149
|
"With",
|
|
46117
46150
|
"TimeZone"
|
|
46118
46151
|
];
|
|
46119
|
-
function
|
|
46152
|
+
function cK(e, t) {
|
|
46120
46153
|
let n = e[`${t}Start`], r = e[`${t}End`];
|
|
46121
46154
|
if (typeof n != "string" || typeof r != "string" || Number.isNaN(Date.parse(n)) || Number.isNaN(Date.parse(r))) return null;
|
|
46122
46155
|
let i = e[`${t}With`], a = e[`${t}TimeZone`];
|
|
@@ -46127,115 +46160,115 @@ function aK(e, t) {
|
|
|
46127
46160
|
timeZone: typeof a == "string" ? a : ""
|
|
46128
46161
|
};
|
|
46129
46162
|
}
|
|
46130
|
-
function
|
|
46131
|
-
return
|
|
46163
|
+
function lK(e, t) {
|
|
46164
|
+
return sK.some((n) => t.length > n.length && t.endsWith(n) && cK(e, t.slice(0, -n.length)) !== null);
|
|
46132
46165
|
}
|
|
46133
|
-
function
|
|
46134
|
-
if (!
|
|
46166
|
+
function uK(e, t, n) {
|
|
46167
|
+
if (!AG(t) || t === e.timeZone) return "";
|
|
46135
46168
|
let r = {
|
|
46136
46169
|
start: e.start,
|
|
46137
46170
|
end: e.end,
|
|
46138
46171
|
memberId: "",
|
|
46139
46172
|
scheduleId: ""
|
|
46140
|
-
}, i =
|
|
46141
|
-
return
|
|
46173
|
+
}, i = tK(r, t, n);
|
|
46174
|
+
return AG(e.timeZone) && i === tK(r, e.timeZone, n) ? "" : `${i} (${nK(t)})`;
|
|
46142
46175
|
}
|
|
46143
|
-
function
|
|
46176
|
+
function dK(e) {
|
|
46144
46177
|
if (!e.name.trim()) return "Give this schedule a name, like A 1-hour session.";
|
|
46145
46178
|
if (!e.memberName.trim()) return "Give the person the name visitors will see.";
|
|
46146
46179
|
if (!e.memberId.trim()) return "Say whose time this is.";
|
|
46147
|
-
if (!
|
|
46148
|
-
if (!
|
|
46180
|
+
if (!AG(e.timeZone)) return "Pick a time zone we know, like Europe/Rome.";
|
|
46181
|
+
if (!gG.some((t) => Number(t.value) === e.slotMinutes)) return "Say how long a booking lasts.";
|
|
46149
46182
|
let t = !1;
|
|
46150
|
-
for (let n of
|
|
46183
|
+
for (let n of lG) {
|
|
46151
46184
|
let r = e.days[n] || [];
|
|
46152
46185
|
for (let i of r) {
|
|
46153
|
-
if (t = !0,
|
|
46154
|
-
if (
|
|
46186
|
+
if (t = !0, WG(i.to) <= WG(i.from)) return `On ${uG[n]}, the end must come after the start.`;
|
|
46187
|
+
if (WG(i.to) - WG(i.from) < e.slotMinutes) return `On ${uG[n]}, the hours are shorter than one booking.`;
|
|
46155
46188
|
}
|
|
46156
|
-
let i = r.slice().sort((e, t) =>
|
|
46157
|
-
for (let e = 1; e < i.length; e++) if (
|
|
46189
|
+
let i = r.slice().sort((e, t) => WG(e.from) - WG(t.from));
|
|
46190
|
+
for (let e = 1; e < i.length; e++) if (WG(i[e].from) < WG(i[e - 1].to)) return `On ${uG[n]}, the two stretches of hours overlap.`;
|
|
46158
46191
|
}
|
|
46159
46192
|
return t ? "" : "Turn on at least one day.";
|
|
46160
46193
|
}
|
|
46161
|
-
var
|
|
46194
|
+
var fK = (e) => e.enabled && dK(e) === "", pK = (e) => {
|
|
46162
46195
|
let t = e.name.trim() || "A booking", n = e.memberName.trim();
|
|
46163
46196
|
return n ? `${t} with ${n}` : t;
|
|
46164
|
-
},
|
|
46165
|
-
function
|
|
46166
|
-
let t =
|
|
46197
|
+
}, mK = (e) => gG.find((t) => Number(t.value) === e)?.label || `${e} min`, hK = (e, t) => e.length === t.length && e.every((e, n) => e.from === t[n].from && e.to === t[n].to);
|
|
46198
|
+
function gK(e) {
|
|
46199
|
+
let t = lG.filter((t) => (e.days[t] || []).length), n = e.name.trim() || e.memberName.trim() ? pK(e) : "Unnamed";
|
|
46167
46200
|
if (!t.length) return `${n} — no hours yet`;
|
|
46168
|
-
let r = e.days[t[0]], i = t.every((t) =>
|
|
46169
|
-
return `${n} — ${a.every((e, t) => t === 0 || e === a[t - 1] + 1) && t.length > 2 ? `${
|
|
46201
|
+
let r = e.days[t[0]], i = t.every((t) => hK(e.days[t], r)), a = t.map((e) => lG.indexOf(e));
|
|
46202
|
+
return `${n} — ${a.every((e, t) => t === 0 || e === a[t - 1] + 1) && t.length > 2 ? `${dG[t[0]]}–${dG[t[t.length - 1]]}` : t.map((e) => dG[e]).join(", ")}${i ? ` ${r.map((e) => `${e.from}–${e.to}`).join(", ")}` : ", hours vary"} · ${mK(e.slotMinutes)} · ${nK(e.timeZone)}`;
|
|
46170
46203
|
}
|
|
46171
|
-
var
|
|
46172
|
-
|
|
46173
|
-
},
|
|
46204
|
+
var _K = [], vK = (e) => {
|
|
46205
|
+
_K = e;
|
|
46206
|
+
}, yK = () => _K, bK = [{
|
|
46174
46207
|
value: "calendar",
|
|
46175
46208
|
label: "A full calendar — the page is about booking"
|
|
46176
46209
|
}, {
|
|
46177
46210
|
value: "compact",
|
|
46178
46211
|
label: "A compact time picker — one question among others"
|
|
46179
|
-
}],
|
|
46180
|
-
function
|
|
46212
|
+
}], xK = (e) => (Array.isArray(e?.schedules) ? e.schedules : Array.isArray(e?.members) ? e.members : []).map(String).filter(Boolean);
|
|
46213
|
+
function SK(e) {
|
|
46181
46214
|
let t = e?.booking;
|
|
46182
46215
|
if (!t || typeof t != "object") return null;
|
|
46183
|
-
let n =
|
|
46216
|
+
let n = xK(t);
|
|
46184
46217
|
return n.length ? {
|
|
46185
46218
|
schedules: n,
|
|
46186
46219
|
how: String(t.how || "")
|
|
46187
46220
|
} : null;
|
|
46188
46221
|
}
|
|
46189
|
-
var
|
|
46190
|
-
function
|
|
46222
|
+
var CK = (e, t) => e.schedules.map((e) => t.find((t) => t.id === e)).filter((e) => !!e);
|
|
46223
|
+
function wK(e, t, n) {
|
|
46191
46224
|
if (e.includes(t)) return e.filter((e) => e !== t);
|
|
46192
46225
|
let r = n.find((e) => e.id === t)?.memberId;
|
|
46193
46226
|
return [...r ? e.filter((e) => n.find((t) => t.id === e)?.memberId !== r) : e, t];
|
|
46194
46227
|
}
|
|
46195
|
-
var
|
|
46228
|
+
var TK = (e) => {
|
|
46196
46229
|
let t = e.map((e) => e.memberName.trim() || "a team member");
|
|
46197
46230
|
return t.length <= 1 ? t.join("") : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
|
|
46198
|
-
},
|
|
46199
|
-
let t = e.map(
|
|
46231
|
+
}, EK = (e) => {
|
|
46232
|
+
let t = e.map(pK);
|
|
46200
46233
|
return t.length <= 1 ? t.join("") : `${t.slice(0, -1).join(", ")}, and ${t[t.length - 1]}`;
|
|
46201
46234
|
};
|
|
46202
|
-
function
|
|
46203
|
-
let n =
|
|
46235
|
+
function DK(e, t) {
|
|
46236
|
+
let n = SK(e);
|
|
46204
46237
|
if (!n) return "";
|
|
46205
|
-
let r =
|
|
46238
|
+
let r = CK(n, t);
|
|
46206
46239
|
if (!r.length) return "The schedules picked for booking no longer exist — pick one on the Schedule screen.";
|
|
46207
|
-
let i = r.find((e) => !
|
|
46208
|
-
return i ? `Finish ${
|
|
46240
|
+
let i = r.find((e) => !fK(e));
|
|
46241
|
+
return i ? `Finish ${pK(i)} on the Schedule screen first.` : n.how.trim() ? "" : "Say how booking should work on this page.";
|
|
46209
46242
|
}
|
|
46210
|
-
var
|
|
46211
|
-
function
|
|
46212
|
-
let r =
|
|
46243
|
+
var OK = "Booking goes through the app's own form system: the page's form gets ONE question of type 'schedule', and the built-in form draws the picker — never build a calendar, a time picker, a list of times or a bookings collection of your own. The app shows every visitor the free times in their own time zone, stops two people taking the same time, and lists every booking on my Schedule screen.", kK = (e, t = "time") => `{ name: '${t}', type: 'schedule', label: 'Pick a time', required: true, schedules: [${e.map((e) => `'${e}'`).join(", ")}] }`, AK = "Decide how the picker looks from my words and add a look to that question. look: 'calendar' when the page is about booking — the question draws a whole calendar with the free times under it, so show the form inline with <ContactPopup formId='…' isInline /> and give it the full width of the page, the other questions following once a time is picked. look: 'compact' when booking is one question among others — the question draws a compact picker of days and times and sits among the other questions like any of them, and the form shows inline with <ContactPopup formId='…' isInline /> like any form. If my words do not say, a page that is about nothing but booking gets the calendar and every other page gets the compact picker.", jK = "Read them with useBookings() from 'your-ai-workflow-firebase-os' — { loading, bookings, error }, each booking with id, start and end (ISO, UTC), memberId, memberName, name, email, answers and formId — the upcoming ones, soonest first; show error when it is set, format times in the reader's own zone, and cancel one with cancelBooking(id) from the same package. Never read mem_bookings or pub_bookings by hand, and never write to them.";
|
|
46244
|
+
function MK(e, t, n) {
|
|
46245
|
+
let r = SK(e);
|
|
46213
46246
|
if (!r) return [];
|
|
46214
|
-
let i =
|
|
46247
|
+
let i = CK(r, t).filter(fK);
|
|
46215
46248
|
if (!i.length) return [];
|
|
46216
|
-
let a =
|
|
46217
|
-
n ? o.push(`This page is where my team follows the times people book with ${a}. ${
|
|
46249
|
+
let a = TK(i), o = [];
|
|
46250
|
+
n ? o.push(`This page is where my team follows the times people book with ${a}. ${jK}`) : o.push(`People book ${EK(i)} on this page — how long a booking lasts is set by the schedule, so never state or ask for a length. ${OK}`, `Add exactly this question to the page's form, copied as it is: ${kK(i.map((e) => e.id))}`, AK);
|
|
46218
46251
|
let s = r.how.trim();
|
|
46219
46252
|
return s && o.push(`Here is how booking should work on this page: ${s}`), o;
|
|
46220
46253
|
}
|
|
46221
|
-
function
|
|
46222
|
-
let i =
|
|
46254
|
+
function NK(e, t, n, r) {
|
|
46255
|
+
let i = SK(t);
|
|
46223
46256
|
if (!i) return "";
|
|
46224
|
-
let a =
|
|
46257
|
+
let a = CK(i, n).filter(fK);
|
|
46225
46258
|
if (!a.length) return "";
|
|
46226
|
-
let o =
|
|
46227
|
-
return r ? `Times are booked with ${o} on the page at ${e}, which this page is linked to. Show those bookings here. ${
|
|
46259
|
+
let o = TK(a);
|
|
46260
|
+
return r ? `Times are booked with ${o} on the page at ${e}, which this page is linked to. Show those bookings here. ${jK}` : `Times are booked with ${o} on the page at ${e}, which this page is linked to — the booking itself happens there. Put no picker on this page unless I ask for one below.`;
|
|
46228
46261
|
}
|
|
46229
46262
|
//#endregion
|
|
46230
46263
|
//#region src/components/fields/Fields.tsx
|
|
46231
|
-
var
|
|
46232
|
-
function
|
|
46264
|
+
var PK = "rounded-2xl border border-[var(--panel-border)] bg-[var(--panel-bg)] transition-colors hover:border-accent/40", FK = "inline-flex items-center justify-center gap-1.5 h-8 px-2.5 sm:h-9 sm:px-3 shrink-0 whitespace-nowrap rounded-[var(--btn-radius,0.75rem)] text-[12.5px] font-semibold border border-[var(--panel-border)] bg-transparent text-foreground/60 hover:text-foreground hover:border-accent/40 hover:bg-foreground/[0.04] active:scale-[0.98] transition-all cursor-pointer disabled:opacity-40 disabled:pointer-events-none", IK = "w-full h-11 px-4 rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] text-[14px] text-foreground outline-none transition-all duration-300 placeholder:text-foreground/35 hover:border-accent/40 focus:border-accent disabled:opacity-50 disabled:cursor-not-allowed console-field", LK = "w-full h-11 flex items-center px-4 rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] transition-all duration-300 hover:border-accent/40 focus-within:border-accent console-field", RK = "flex-1 min-w-0 h-full bg-transparent border-none outline-none shadow-none text-[14px] text-foreground placeholder:text-foreground/35 disabled:cursor-not-allowed", zK = "text-[12.5px] sm:text-[13px] font-medium text-foreground/50 select-none", BK = "text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug";
|
|
46265
|
+
function VK({ children: e, tone: t = "quiet" }) {
|
|
46233
46266
|
return /* @__PURE__ */ b("p", {
|
|
46234
46267
|
className: `text-[12.5px] font-medium leading-relaxed px-1 ${t === "error" ? "text-red-500" : "text-foreground/50"}`,
|
|
46235
46268
|
children: e
|
|
46236
46269
|
});
|
|
46237
46270
|
}
|
|
46238
|
-
function
|
|
46271
|
+
function HK({ onClick: e, children: t }) {
|
|
46239
46272
|
return /* @__PURE__ */ b("button", {
|
|
46240
46273
|
type: "button",
|
|
46241
46274
|
onClick: e,
|
|
@@ -46243,26 +46276,26 @@ function zK({ onClick: e, children: t }) {
|
|
|
46243
46276
|
children: t
|
|
46244
46277
|
});
|
|
46245
46278
|
}
|
|
46246
|
-
function
|
|
46279
|
+
function UK({ state: e = "saved", label: t }) {
|
|
46247
46280
|
return /* @__PURE__ */ x("span", {
|
|
46248
46281
|
className: "inline-flex items-center gap-1.5 text-[11.5px] font-semibold text-foreground/50 whitespace-nowrap shrink-0",
|
|
46249
46282
|
children: [e === "saving" ? /* @__PURE__ */ b(R, { className: "w-3 h-3 animate-spin text-foreground/40 shrink-0" }) : /* @__PURE__ */ b("span", { className: `w-1.5 h-1.5 rounded-full shrink-0 ${e === "saved" ? "bg-emerald-500" : e === "error" ? "bg-red-500" : "bg-foreground/25"}` }), t]
|
|
46250
46283
|
});
|
|
46251
46284
|
}
|
|
46252
|
-
function
|
|
46285
|
+
function WK({ icon: e, children: t, onClick: n, disabled: r, busy: i, tone: a = "default", className: o = "", title: s, compact: c }) {
|
|
46253
46286
|
return /* @__PURE__ */ x("button", {
|
|
46254
46287
|
type: "button",
|
|
46255
46288
|
title: s,
|
|
46256
46289
|
onClick: n,
|
|
46257
46290
|
disabled: r || i,
|
|
46258
|
-
className: `${
|
|
46291
|
+
className: `${FK} ${a === "danger" ? "hover:text-red-500 hover:border-red-500/40 hover:bg-red-500/[0.06]" : ""} ${c ? "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]" : ""} ${o}`,
|
|
46259
46292
|
children: [i ? /* @__PURE__ */ b(R, { className: "w-3.5 h-3.5 animate-spin shrink-0" }) : e ? /* @__PURE__ */ b(e, { className: "w-3.5 h-3.5 shrink-0" }) : null, c ? /* @__PURE__ */ b("span", {
|
|
46260
46293
|
className: "max-sm:hidden sm:inline-flex items-center gap-1.5",
|
|
46261
46294
|
children: t
|
|
46262
46295
|
}) : t]
|
|
46263
46296
|
});
|
|
46264
46297
|
}
|
|
46265
|
-
function
|
|
46298
|
+
function GK({ icon: e, title: t, description: n, actions: r, children: i, defaultOpen: a = !0, collapsible: o = !0 }) {
|
|
46266
46299
|
let [s, c] = v(a), l = o ? s : !0;
|
|
46267
46300
|
return /* @__PURE__ */ x("div", {
|
|
46268
46301
|
className: "rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] overflow-hidden transition-all",
|
|
@@ -46318,7 +46351,7 @@ function HK({ icon: e, title: t, description: n, actions: r, children: i, defaul
|
|
|
46318
46351
|
})]
|
|
46319
46352
|
});
|
|
46320
46353
|
}
|
|
46321
|
-
function
|
|
46354
|
+
function KK({ icon: e, title: t, description: n, chip: r, enabled: i, onChange: a, label: o, children: s }) {
|
|
46322
46355
|
return /* @__PURE__ */ x("div", {
|
|
46323
46356
|
className: "rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] overflow-hidden",
|
|
46324
46357
|
children: [/* @__PURE__ */ x("div", {
|
|
@@ -46340,11 +46373,11 @@ function UK({ icon: e, title: t, description: n, chip: r, enabled: i, onChange:
|
|
|
46340
46373
|
className: "row-start-1 row-span-2 col-start-3 self-center justify-self-end flex items-center gap-2 sm:gap-3 shrink-0",
|
|
46341
46374
|
children: [r && /* @__PURE__ */ b("span", {
|
|
46342
46375
|
className: "max-sm:hidden",
|
|
46343
|
-
children: /* @__PURE__ */ b(
|
|
46376
|
+
children: /* @__PURE__ */ b(UK, {
|
|
46344
46377
|
state: r.state,
|
|
46345
46378
|
label: r.label
|
|
46346
46379
|
})
|
|
46347
|
-
}), i !== null && /* @__PURE__ */ b(
|
|
46380
|
+
}), i !== null && /* @__PURE__ */ b($K, {
|
|
46348
46381
|
enabled: i,
|
|
46349
46382
|
onChange: a,
|
|
46350
46383
|
label: o || t
|
|
@@ -46357,14 +46390,14 @@ function UK({ icon: e, title: t, description: n, chip: r, enabled: i, onChange:
|
|
|
46357
46390
|
})]
|
|
46358
46391
|
});
|
|
46359
46392
|
}
|
|
46360
|
-
function
|
|
46393
|
+
function qK({ label: e, hint: t, action: n, children: r, error: i }) {
|
|
46361
46394
|
return /* @__PURE__ */ x("div", {
|
|
46362
46395
|
className: "flex flex-col w-full",
|
|
46363
46396
|
children: [
|
|
46364
46397
|
/* @__PURE__ */ x("div", {
|
|
46365
46398
|
className: "flex items-center justify-between gap-3 mb-1 sm:mb-1.5 ml-1",
|
|
46366
46399
|
children: [/* @__PURE__ */ b("label", {
|
|
46367
|
-
className:
|
|
46400
|
+
className: zK,
|
|
46368
46401
|
children: e
|
|
46369
46402
|
}), n]
|
|
46370
46403
|
}),
|
|
@@ -46380,14 +46413,14 @@ function WK({ label: e, hint: t, action: n, children: r, error: i }) {
|
|
|
46380
46413
|
]
|
|
46381
46414
|
});
|
|
46382
46415
|
}
|
|
46383
|
-
function
|
|
46384
|
-
return /* @__PURE__ */ b(
|
|
46416
|
+
function JK({ label: e, hint: t, value: n, onChange: r, onBlur: i, placeholder: a, prefix: o, error: s, disabled: c, action: l }) {
|
|
46417
|
+
return /* @__PURE__ */ b(qK, {
|
|
46385
46418
|
label: e,
|
|
46386
46419
|
hint: t,
|
|
46387
46420
|
error: s,
|
|
46388
46421
|
action: l,
|
|
46389
46422
|
children: o ? /* @__PURE__ */ x("div", {
|
|
46390
|
-
className: `${
|
|
46423
|
+
className: `${LK} ${s ? "is-invalid border-red-500/60" : ""} ${c ? "opacity-50" : ""}`,
|
|
46391
46424
|
children: [/* @__PURE__ */ b("span", {
|
|
46392
46425
|
className: "mr-0.5 text-[14px] font-semibold text-foreground/40 select-none shrink-0",
|
|
46393
46426
|
children: o
|
|
@@ -46399,7 +46432,7 @@ function GK({ label: e, hint: t, value: n, onChange: r, onBlur: i, placeholder:
|
|
|
46399
46432
|
onChange: (e) => r(e.target.value),
|
|
46400
46433
|
onBlur: i,
|
|
46401
46434
|
"aria-label": e,
|
|
46402
|
-
className: `${
|
|
46435
|
+
className: `${RK} no-glow`
|
|
46403
46436
|
})]
|
|
46404
46437
|
}) : /* @__PURE__ */ b("input", {
|
|
46405
46438
|
type: "text",
|
|
@@ -46409,11 +46442,11 @@ function GK({ label: e, hint: t, value: n, onChange: r, onBlur: i, placeholder:
|
|
|
46409
46442
|
onChange: (e) => r(e.target.value),
|
|
46410
46443
|
onBlur: i,
|
|
46411
46444
|
"aria-label": e,
|
|
46412
|
-
className: `${
|
|
46445
|
+
className: `${IK} ${s ? "is-invalid border-red-500/60" : ""}`
|
|
46413
46446
|
})
|
|
46414
46447
|
});
|
|
46415
46448
|
}
|
|
46416
|
-
function
|
|
46449
|
+
function YK({ value: e, className: n = "", ...r }) {
|
|
46417
46450
|
let i = _(null), a = t.useCallback(() => {
|
|
46418
46451
|
let e = i.current;
|
|
46419
46452
|
e && (e.style.height = "auto", e.style.height = `${e.scrollHeight + (e.offsetHeight - e.clientHeight)}px`);
|
|
@@ -46432,28 +46465,28 @@ function KK({ value: e, className: n = "", ...r }) {
|
|
|
46432
46465
|
rows: r.rows || 1
|
|
46433
46466
|
});
|
|
46434
46467
|
}
|
|
46435
|
-
function
|
|
46436
|
-
return /* @__PURE__ */ b(
|
|
46468
|
+
function XK({ label: e, hint: t, value: n, onChange: r, onBlur: i, placeholder: a, rows: o, error: s }) {
|
|
46469
|
+
return /* @__PURE__ */ b(qK, {
|
|
46437
46470
|
label: e,
|
|
46438
46471
|
hint: t,
|
|
46439
46472
|
error: s,
|
|
46440
|
-
children: /* @__PURE__ */ b(
|
|
46473
|
+
children: /* @__PURE__ */ b(YK, {
|
|
46441
46474
|
value: n ?? "",
|
|
46442
46475
|
placeholder: a,
|
|
46443
46476
|
rows: o,
|
|
46444
46477
|
onChange: (e) => r(e.target.value),
|
|
46445
46478
|
onBlur: i,
|
|
46446
46479
|
"aria-label": e,
|
|
46447
|
-
className: `${
|
|
46480
|
+
className: `${IK.replace("h-11 ", "")} min-h-11 py-2.5 leading-5 ${s ? "is-invalid border-red-500/60" : ""}`
|
|
46448
46481
|
})
|
|
46449
46482
|
});
|
|
46450
46483
|
}
|
|
46451
|
-
function
|
|
46484
|
+
function ZK({ label: e, hint: t, value: n, onChange: r, options: i, placeholder: a = "None", allowEmpty: o = !0, disabled: s }) {
|
|
46452
46485
|
let c = [...o ? [{
|
|
46453
46486
|
value: "",
|
|
46454
46487
|
label: a
|
|
46455
46488
|
}] : [], ...i.filter((e) => e.value !== "")];
|
|
46456
|
-
return /* @__PURE__ */ b(
|
|
46489
|
+
return /* @__PURE__ */ b(qK, {
|
|
46457
46490
|
label: e,
|
|
46458
46491
|
hint: t,
|
|
46459
46492
|
children: /* @__PURE__ */ b(UW, {
|
|
@@ -46469,7 +46502,7 @@ function JK({ label: e, hint: t, value: n, onChange: r, options: i, placeholder:
|
|
|
46469
46502
|
})
|
|
46470
46503
|
});
|
|
46471
46504
|
}
|
|
46472
|
-
function
|
|
46505
|
+
function QK({ label: e, hint: t, enabled: n, onChange: r, disabled: i, hintWideOnly: a }) {
|
|
46473
46506
|
return /* @__PURE__ */ x("div", {
|
|
46474
46507
|
className: "flex items-center justify-between gap-4 w-full",
|
|
46475
46508
|
children: [/* @__PURE__ */ x("div", {
|
|
@@ -46481,7 +46514,7 @@ function YK({ label: e, hint: t, enabled: n, onChange: r, disabled: i, hintWideO
|
|
|
46481
46514
|
className: `text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug${a ? " max-sm:hidden" : ""}`,
|
|
46482
46515
|
children: t
|
|
46483
46516
|
})]
|
|
46484
|
-
}), /* @__PURE__ */ b(
|
|
46517
|
+
}), /* @__PURE__ */ b($K, {
|
|
46485
46518
|
enabled: n,
|
|
46486
46519
|
onChange: r,
|
|
46487
46520
|
disabled: i,
|
|
@@ -46489,7 +46522,7 @@ function YK({ label: e, hint: t, enabled: n, onChange: r, disabled: i, hintWideO
|
|
|
46489
46522
|
})]
|
|
46490
46523
|
});
|
|
46491
46524
|
}
|
|
46492
|
-
function
|
|
46525
|
+
function $K({ enabled: e, onChange: t, disabled: n, label: r }) {
|
|
46493
46526
|
return /* @__PURE__ */ b("button", {
|
|
46494
46527
|
type: "button",
|
|
46495
46528
|
role: "switch",
|
|
@@ -46503,29 +46536,29 @@ function XK({ enabled: e, onChange: t, disabled: n, label: r }) {
|
|
|
46503
46536
|
children: /* @__PURE__ */ b("span", { className: `absolute top-1 left-1 w-4 h-4 rounded-full bg-[var(--button-fg,#fff)] shadow transition-transform ${e ? "translate-x-4" : "translate-x-0"}` })
|
|
46504
46537
|
});
|
|
46505
46538
|
}
|
|
46506
|
-
function
|
|
46507
|
-
return e ? /* @__PURE__ */ b(
|
|
46539
|
+
function eq({ saving: e, savedAt: t }) {
|
|
46540
|
+
return e ? /* @__PURE__ */ b(UK, {
|
|
46508
46541
|
state: "saving",
|
|
46509
46542
|
label: "Saving"
|
|
46510
|
-
}) : t ? /* @__PURE__ */ b(
|
|
46543
|
+
}) : t ? /* @__PURE__ */ b(UK, {
|
|
46511
46544
|
state: "saved",
|
|
46512
46545
|
label: "Saved"
|
|
46513
46546
|
}) : null;
|
|
46514
46547
|
}
|
|
46515
46548
|
//#endregion
|
|
46516
46549
|
//#region src/components/fields/TimeZoneField.tsx
|
|
46517
|
-
function
|
|
46518
|
-
let [a, o] = v(""), s =
|
|
46550
|
+
function tq({ label: e = "Time zone", hint: t, value: n, onChange: r, compact: i }) {
|
|
46551
|
+
let [a, o] = v(""), s = OG(), c = (n || "").trim(), l = g(() => MG(a), [a]), u = a.trim().length > 0, d = t ?? (c === s ? "Detected from your browser." : `Your browser is in ${nK(s)}.`), f = /* @__PURE__ */ x("div", {
|
|
46519
46552
|
className: "flex flex-col gap-2",
|
|
46520
46553
|
children: [/* @__PURE__ */ x("div", {
|
|
46521
|
-
className:
|
|
46554
|
+
className: LK,
|
|
46522
46555
|
children: [c && !u ? /* @__PURE__ */ x("span", {
|
|
46523
46556
|
className: "inline-flex items-center gap-2 mr-2.5 shrink-0 min-w-0 text-accent",
|
|
46524
46557
|
children: [
|
|
46525
46558
|
/* @__PURE__ */ b(Wm, { className: "w-4 h-4 shrink-0" }),
|
|
46526
46559
|
/* @__PURE__ */ b("span", {
|
|
46527
46560
|
className: "text-[13px] font-semibold truncate",
|
|
46528
|
-
children:
|
|
46561
|
+
children: nK(c)
|
|
46529
46562
|
}),
|
|
46530
46563
|
/* @__PURE__ */ b(ns, { className: "w-3.5 h-3.5 shrink-0" })
|
|
46531
46564
|
]
|
|
@@ -46535,7 +46568,7 @@ function QK({ label: e = "Time zone", hint: t, value: n, onChange: r, compact: i
|
|
|
46535
46568
|
onChange: (e) => o(e.target.value),
|
|
46536
46569
|
placeholder: c ? "Type a city to change it" : "Type a city, e.g. Rome",
|
|
46537
46570
|
"aria-label": "Search time zones",
|
|
46538
|
-
className: `${
|
|
46571
|
+
className: `${RK} no-glow`
|
|
46539
46572
|
})]
|
|
46540
46573
|
}), u && /* @__PURE__ */ b("div", {
|
|
46541
46574
|
className: "rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] p-1.5 max-h-56 overflow-y-auto",
|
|
@@ -46548,7 +46581,7 @@ function QK({ label: e = "Time zone", hint: t, value: n, onChange: r, compact: i
|
|
|
46548
46581
|
r(e), o("");
|
|
46549
46582
|
},
|
|
46550
46583
|
className: `w-full text-left px-2.5 py-1.5 rounded-lg text-[13px] font-medium transition-colors cursor-pointer ${e === c ? "bg-accent text-[var(--button-fg,#fff)]" : "text-foreground/70 hover:text-foreground hover:bg-foreground/[0.06]"}`,
|
|
46551
|
-
children: [
|
|
46584
|
+
children: [nK(e), e === s ? " · detected" : ""]
|
|
46552
46585
|
}, e))
|
|
46553
46586
|
}) : /* @__PURE__ */ b("span", {
|
|
46554
46587
|
className: "block px-2 py-2 text-[12px] font-medium text-foreground/45",
|
|
@@ -46556,7 +46589,7 @@ function QK({ label: e = "Time zone", hint: t, value: n, onChange: r, compact: i
|
|
|
46556
46589
|
})
|
|
46557
46590
|
})]
|
|
46558
46591
|
});
|
|
46559
|
-
return i ? f : /* @__PURE__ */ b(
|
|
46592
|
+
return i ? f : /* @__PURE__ */ b(qK, {
|
|
46560
46593
|
label: e,
|
|
46561
46594
|
hint: d,
|
|
46562
46595
|
children: f
|
|
@@ -46564,7 +46597,7 @@ function QK({ label: e = "Time zone", hint: t, value: n, onChange: r, compact: i
|
|
|
46564
46597
|
}
|
|
46565
46598
|
//#endregion
|
|
46566
46599
|
//#region src/components/schedule/TimeChips.tsx
|
|
46567
|
-
function
|
|
46600
|
+
function nq({ timeZone: e, onTimeZone: t }) {
|
|
46568
46601
|
let [n, r] = v(!1);
|
|
46569
46602
|
return /* @__PURE__ */ x("div", {
|
|
46570
46603
|
className: "flex flex-col gap-2",
|
|
@@ -46572,7 +46605,7 @@ function $K({ timeZone: e, onTimeZone: t }) {
|
|
|
46572
46605
|
className: "text-[12px] font-medium text-foreground/50",
|
|
46573
46606
|
children: [
|
|
46574
46607
|
"Times in ",
|
|
46575
|
-
|
|
46608
|
+
nK(e),
|
|
46576
46609
|
" · ",
|
|
46577
46610
|
/* @__PURE__ */ b("button", {
|
|
46578
46611
|
type: "button",
|
|
@@ -46581,7 +46614,7 @@ function $K({ timeZone: e, onTimeZone: t }) {
|
|
|
46581
46614
|
children: n ? "Done" : "Change"
|
|
46582
46615
|
})
|
|
46583
46616
|
]
|
|
46584
|
-
}), n && /* @__PURE__ */ b(
|
|
46617
|
+
}), n && /* @__PURE__ */ b(tq, {
|
|
46585
46618
|
compact: !0,
|
|
46586
46619
|
value: e,
|
|
46587
46620
|
onChange: (e) => {
|
|
@@ -46590,15 +46623,15 @@ function $K({ timeZone: e, onTimeZone: t }) {
|
|
|
46590
46623
|
})]
|
|
46591
46624
|
});
|
|
46592
46625
|
}
|
|
46593
|
-
var
|
|
46594
|
-
function
|
|
46626
|
+
var rq = (e, t) => !!e && e.memberId === t.memberId && e.start === t.start && e.scheduleId === t.scheduleId;
|
|
46627
|
+
function iq({ slots: e, value: t, onChange: n, timeZone: r, members: i }) {
|
|
46595
46628
|
let a = new Set(i.map((e) => e.memberId)).size > 1, o = (e) => (i.find((t) => t.id === e.scheduleId) || i.find((t) => t.memberId === e.memberId))?.memberName.trim() || "";
|
|
46596
46629
|
return e.length ? /* @__PURE__ */ b("div", {
|
|
46597
46630
|
className: "flex flex-wrap gap-2",
|
|
46598
46631
|
role: "listbox",
|
|
46599
46632
|
"aria-label": "Free times",
|
|
46600
46633
|
children: e.map((e) => {
|
|
46601
|
-
let i =
|
|
46634
|
+
let i = rq(t, e), s = eK(new Date(e.start), r), c = a ? o(e) : "";
|
|
46602
46635
|
return /* @__PURE__ */ x("button", {
|
|
46603
46636
|
type: "button",
|
|
46604
46637
|
role: "option",
|
|
@@ -46614,15 +46647,15 @@ function tq({ slots: e, value: t, onChange: n, timeZone: r, members: i }) {
|
|
|
46614
46647
|
className: `text-[11px] font-medium leading-tight ${i ? "opacity-90" : "text-foreground/50"}`,
|
|
46615
46648
|
children: c
|
|
46616
46649
|
})]
|
|
46617
|
-
}, `${
|
|
46650
|
+
}, `${UG(e.memberId, e.start)}__${e.scheduleId}`);
|
|
46618
46651
|
})
|
|
46619
46652
|
}) : null;
|
|
46620
46653
|
}
|
|
46621
46654
|
//#endregion
|
|
46622
46655
|
//#region src/components/schedule/SlotPicker.tsx
|
|
46623
|
-
function
|
|
46656
|
+
function aq(e, t, n, r) {
|
|
46624
46657
|
return {
|
|
46625
|
-
days: g(() =>
|
|
46658
|
+
days: g(() => QG(KG(e, {
|
|
46626
46659
|
now: r ? r() : /* @__PURE__ */ new Date(),
|
|
46627
46660
|
taken: t
|
|
46628
46661
|
}), n), [
|
|
@@ -46634,21 +46667,21 @@ function nq(e, t, n, r) {
|
|
|
46634
46667
|
horizon: e.reduce((e, t) => Math.max(e, t.horizonDays), 0)
|
|
46635
46668
|
};
|
|
46636
46669
|
}
|
|
46637
|
-
var
|
|
46638
|
-
function
|
|
46670
|
+
var oq = (e, t) => e ? FG(new Date(e.start), t).dateKey : "";
|
|
46671
|
+
function sq({ horizon: e }) {
|
|
46639
46672
|
return /* @__PURE__ */ b("p", {
|
|
46640
46673
|
className: "text-[13px] font-medium text-foreground/50 py-2",
|
|
46641
46674
|
children: e ? `No free times in the next ${e} days.` : "No free times at the moment."
|
|
46642
46675
|
});
|
|
46643
46676
|
}
|
|
46644
|
-
function
|
|
46645
|
-
let { days: s, horizon: c } =
|
|
46677
|
+
function cq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZone: a, now: o }) {
|
|
46678
|
+
let { days: s, horizon: c } = aq(e, r, i, o), [l, u] = v({
|
|
46646
46679
|
tz: i,
|
|
46647
46680
|
day: ""
|
|
46648
|
-
}), d = l.tz === i ? l.day : "", f = (s.some((e) => e.dateKey === d) ? d : "") ||
|
|
46681
|
+
}), d = l.tz === i ? l.day : "", f = (s.some((e) => e.dateKey === d) ? d : "") || oq(t, i) || s[0]?.dateKey || "", p = s.find((e) => e.dateKey === f) || s[0];
|
|
46649
46682
|
return /* @__PURE__ */ x("div", {
|
|
46650
46683
|
className: "flex flex-col gap-3 w-full",
|
|
46651
|
-
children: [s.length === 0 ? /* @__PURE__ */ b(
|
|
46684
|
+
children: [s.length === 0 ? /* @__PURE__ */ b(sq, { horizon: c }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
|
|
46652
46685
|
className: "flex gap-2 overflow-x-auto no-scrollbar pb-1 -mx-1 px-1",
|
|
46653
46686
|
role: "tablist",
|
|
46654
46687
|
"aria-label": "Days with free times",
|
|
@@ -46667,13 +46700,13 @@ function aq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZo
|
|
|
46667
46700
|
children: e.label
|
|
46668
46701
|
}, e.dateKey);
|
|
46669
46702
|
})
|
|
46670
|
-
}), p && /* @__PURE__ */ b(
|
|
46703
|
+
}), p && /* @__PURE__ */ b(iq, {
|
|
46671
46704
|
slots: p.slots,
|
|
46672
46705
|
value: t,
|
|
46673
46706
|
onChange: n,
|
|
46674
46707
|
timeZone: i,
|
|
46675
46708
|
members: e
|
|
46676
|
-
})] }), /* @__PURE__ */ b(
|
|
46709
|
+
})] }), /* @__PURE__ */ b(nq, {
|
|
46677
46710
|
timeZone: i,
|
|
46678
46711
|
onTimeZone: a
|
|
46679
46712
|
})]
|
|
@@ -46681,7 +46714,7 @@ function aq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZo
|
|
|
46681
46714
|
}
|
|
46682
46715
|
//#endregion
|
|
46683
46716
|
//#region src/components/schedule/BookingCalendar.tsx
|
|
46684
|
-
var
|
|
46717
|
+
var lq = [
|
|
46685
46718
|
"M",
|
|
46686
46719
|
"T",
|
|
46687
46720
|
"W",
|
|
@@ -46689,22 +46722,22 @@ var oq = [
|
|
|
46689
46722
|
"F",
|
|
46690
46723
|
"S",
|
|
46691
46724
|
"S"
|
|
46692
|
-
],
|
|
46693
|
-
function
|
|
46694
|
-
let t = `${e}-01`, n =
|
|
46725
|
+
], uq = (e) => e.slice(0, 7);
|
|
46726
|
+
function dq(e) {
|
|
46727
|
+
let t = `${e}-01`, n = lG.indexOf(zG(t)), r = Array.from({ length: n }, () => null);
|
|
46695
46728
|
for (let n = 0;; n++) {
|
|
46696
|
-
let i =
|
|
46697
|
-
if (
|
|
46729
|
+
let i = RG(t, n);
|
|
46730
|
+
if (uq(i) !== e) break;
|
|
46698
46731
|
r.push(i);
|
|
46699
46732
|
}
|
|
46700
46733
|
return r;
|
|
46701
46734
|
}
|
|
46702
|
-
function
|
|
46703
|
-
let { days: s, horizon: c } =
|
|
46735
|
+
function fq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZone: a, now: o }) {
|
|
46736
|
+
let { days: s, horizon: c } = aq(e, r, i, o), l = FG(o ? o() : /* @__PURE__ */ new Date(), i).dateKey, u = new Map(s.map((e) => [e.dateKey, e])), d = oq(t, i), [f, p] = v(() => ({
|
|
46704
46737
|
tz: i,
|
|
46705
46738
|
day: d,
|
|
46706
|
-
month:
|
|
46707
|
-
})), m = f.tz === i, h = m ? f.day : d, g = m ? f.month :
|
|
46739
|
+
month: uq(d || s[0]?.dateKey || l)
|
|
46740
|
+
})), m = f.tz === i, h = m ? f.day : d, g = m ? f.month : uq(d || s[0]?.dateKey || l), _ = (e) => p({
|
|
46708
46741
|
tz: i,
|
|
46709
46742
|
day: h,
|
|
46710
46743
|
month: e(g)
|
|
@@ -46712,11 +46745,11 @@ function lq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZo
|
|
|
46712
46745
|
tz: i,
|
|
46713
46746
|
day: e,
|
|
46714
46747
|
month: g
|
|
46715
|
-
}), C = h ? u.get(h) : void 0, w =
|
|
46748
|
+
}), C = h ? u.get(h) : void 0, w = dq(g);
|
|
46716
46749
|
return /* @__PURE__ */ x("div", {
|
|
46717
46750
|
className: "flex flex-col gap-4 w-full",
|
|
46718
46751
|
children: [
|
|
46719
|
-
s.length === 0 && /* @__PURE__ */ b(
|
|
46752
|
+
s.length === 0 && /* @__PURE__ */ b(sq, { horizon: c }),
|
|
46720
46753
|
/* @__PURE__ */ x("div", {
|
|
46721
46754
|
className: "flex flex-col md:flex-row gap-4 md:gap-6 w-full",
|
|
46722
46755
|
children: [/* @__PURE__ */ x("div", {
|
|
@@ -46725,27 +46758,27 @@ function lq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZo
|
|
|
46725
46758
|
className: "flex items-center justify-between gap-2",
|
|
46726
46759
|
children: [/* @__PURE__ */ b("h4", {
|
|
46727
46760
|
className: "text-[15px] sm:text-[17px] font-bold text-foreground tracking-tight truncate",
|
|
46728
|
-
children:
|
|
46761
|
+
children: BG(g)
|
|
46729
46762
|
}), /* @__PURE__ */ x("div", {
|
|
46730
46763
|
className: "flex items-center gap-1 shrink-0",
|
|
46731
46764
|
children: [
|
|
46732
46765
|
/* @__PURE__ */ b("button", {
|
|
46733
46766
|
type: "button",
|
|
46734
|
-
onClick: () => _(() =>
|
|
46767
|
+
onClick: () => _(() => uq(l)),
|
|
46735
46768
|
className: "px-3 py-1.5 text-[12.5px] font-bold border border-[var(--panel-border)] rounded-xl mr-1 hover:bg-foreground/5 transition-colors cursor-pointer",
|
|
46736
46769
|
children: "Today"
|
|
46737
46770
|
}),
|
|
46738
46771
|
/* @__PURE__ */ b("button", {
|
|
46739
46772
|
type: "button",
|
|
46740
46773
|
"aria-label": "Previous month",
|
|
46741
|
-
onClick: () => _((e) =>
|
|
46774
|
+
onClick: () => _((e) => VG(e, -1)),
|
|
46742
46775
|
className: "p-1.5 rounded-xl text-foreground/50 hover:text-foreground hover:bg-foreground/5 transition-colors border border-transparent hover:border-[var(--panel-border)] cursor-pointer",
|
|
46743
46776
|
children: /* @__PURE__ */ b(ps, { className: "w-4 h-4" })
|
|
46744
46777
|
}),
|
|
46745
46778
|
/* @__PURE__ */ b("button", {
|
|
46746
46779
|
type: "button",
|
|
46747
46780
|
"aria-label": "Next month",
|
|
46748
|
-
onClick: () => _((e) =>
|
|
46781
|
+
onClick: () => _((e) => VG(e, 1)),
|
|
46749
46782
|
className: "p-1.5 rounded-xl text-foreground/50 hover:text-foreground hover:bg-foreground/5 transition-colors border border-transparent hover:border-[var(--panel-border)] cursor-pointer",
|
|
46750
46783
|
children: /* @__PURE__ */ b(ms, { className: "w-4 h-4" })
|
|
46751
46784
|
})
|
|
@@ -46754,8 +46787,8 @@ function lq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZo
|
|
|
46754
46787
|
}), /* @__PURE__ */ x("div", {
|
|
46755
46788
|
className: "grid grid-cols-7 gap-1",
|
|
46756
46789
|
role: "grid",
|
|
46757
|
-
"aria-label":
|
|
46758
|
-
children: [
|
|
46790
|
+
"aria-label": BG(g),
|
|
46791
|
+
children: [lq.map((e, t) => /* @__PURE__ */ b("div", {
|
|
46759
46792
|
className: "text-center text-[11px] font-bold uppercase tracking-wider text-foreground/40 py-1",
|
|
46760
46793
|
children: e
|
|
46761
46794
|
}, t)), w.map((e, t) => {
|
|
@@ -46782,7 +46815,7 @@ function lq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZo
|
|
|
46782
46815
|
children: C ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("p", {
|
|
46783
46816
|
className: "text-[13px] font-bold text-foreground",
|
|
46784
46817
|
children: C.label
|
|
46785
|
-
}), /* @__PURE__ */ b(
|
|
46818
|
+
}), /* @__PURE__ */ b(iq, {
|
|
46786
46819
|
slots: C.slots,
|
|
46787
46820
|
value: t,
|
|
46788
46821
|
onChange: n,
|
|
@@ -46794,7 +46827,7 @@ function lq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZo
|
|
|
46794
46827
|
}) : null
|
|
46795
46828
|
})]
|
|
46796
46829
|
}),
|
|
46797
|
-
/* @__PURE__ */ b(
|
|
46830
|
+
/* @__PURE__ */ b(nq, {
|
|
46798
46831
|
timeZone: i,
|
|
46799
46832
|
onTimeZone: a
|
|
46800
46833
|
})
|
|
@@ -46803,15 +46836,15 @@ function lq({ members: e, value: t, onChange: n, taken: r, timeZone: i, onTimeZo
|
|
|
46803
46836
|
}
|
|
46804
46837
|
//#endregion
|
|
46805
46838
|
//#region src/lib/scheduleData.ts
|
|
46806
|
-
function
|
|
46839
|
+
function pq() {
|
|
46807
46840
|
let [e, t] = v({
|
|
46808
46841
|
loading: !0,
|
|
46809
46842
|
schedules: []
|
|
46810
46843
|
});
|
|
46811
46844
|
return f(() => {
|
|
46812
|
-
let e = ie(D(I,
|
|
46845
|
+
let e = ie(D(I, pG), (e) => {
|
|
46813
46846
|
let n = [];
|
|
46814
|
-
e.forEach((e) => n.push(
|
|
46847
|
+
e.forEach((e) => n.push(DG(e.id, e.data()))), n.sort((e, t) => (e.createdAt || 0) - (t.createdAt || 0) || e.id.localeCompare(t.id)), vK(n), t({
|
|
46815
46848
|
loading: !1,
|
|
46816
46849
|
schedules: n
|
|
46817
46850
|
});
|
|
@@ -46822,21 +46855,21 @@ function uq() {
|
|
|
46822
46855
|
return () => e();
|
|
46823
46856
|
}, []), e;
|
|
46824
46857
|
}
|
|
46825
|
-
function
|
|
46826
|
-
let t =
|
|
46858
|
+
function mq(e) {
|
|
46859
|
+
let t = pq();
|
|
46827
46860
|
return e ? {
|
|
46828
46861
|
loading: t.loading,
|
|
46829
|
-
schedules:
|
|
46830
|
-
} :
|
|
46862
|
+
schedules: qG(t.schedules, e)
|
|
46863
|
+
} : hq;
|
|
46831
46864
|
}
|
|
46832
|
-
var
|
|
46865
|
+
var hq = {
|
|
46833
46866
|
loading: !1,
|
|
46834
46867
|
schedules: []
|
|
46835
46868
|
};
|
|
46836
|
-
async function
|
|
46869
|
+
async function gq(e) {
|
|
46837
46870
|
try {
|
|
46838
46871
|
let { id: t, ...n } = e;
|
|
46839
|
-
return await j(O(I,
|
|
46872
|
+
return await j(O(I, pG, t), {
|
|
46840
46873
|
...n,
|
|
46841
46874
|
updatedAt: Date.now()
|
|
46842
46875
|
}), null;
|
|
@@ -46844,14 +46877,14 @@ async function pq(e) {
|
|
|
46844
46877
|
return console.error("Could not save the schedule", e), "The hours could not be saved — make sure you are signed in as an admin and try again.";
|
|
46845
46878
|
}
|
|
46846
46879
|
}
|
|
46847
|
-
async function
|
|
46880
|
+
async function _q(e) {
|
|
46848
46881
|
try {
|
|
46849
|
-
return await te(O(I,
|
|
46882
|
+
return await te(O(I, pG, e)), null;
|
|
46850
46883
|
} catch (e) {
|
|
46851
46884
|
return console.error("Could not remove the schedule", e), "It could not be removed — make sure you are signed in as an admin and try again.";
|
|
46852
46885
|
}
|
|
46853
46886
|
}
|
|
46854
|
-
function
|
|
46887
|
+
function vq() {
|
|
46855
46888
|
let [e, t] = v({
|
|
46856
46889
|
loading: !0,
|
|
46857
46890
|
members: []
|
|
@@ -46878,11 +46911,11 @@ function hq() {
|
|
|
46878
46911
|
return () => e();
|
|
46879
46912
|
}, []), e;
|
|
46880
46913
|
}
|
|
46881
|
-
function
|
|
46914
|
+
function yq(e, t) {
|
|
46882
46915
|
let [n, r] = v([]), i = e.slice().sort().join(","), a = t.toISOString();
|
|
46883
46916
|
return f(() => {
|
|
46884
46917
|
if (!i) return;
|
|
46885
|
-
let e = new Set(i.split(",")), n = new Date(t.getTime() -
|
|
46918
|
+
let e = new Set(i.split(",")), n = new Date(t.getTime() - xq).toISOString(), o = ie(oe(D(I, mG), M("start", ">=", n)), (t) => {
|
|
46886
46919
|
let n = [];
|
|
46887
46920
|
t.forEach((t) => {
|
|
46888
46921
|
let r = t.data() || {}, i = String(r.memberId || "");
|
|
@@ -46896,29 +46929,29 @@ function gq(e, t) {
|
|
|
46896
46929
|
}), r(n);
|
|
46897
46930
|
}, () => r([]));
|
|
46898
46931
|
return () => o();
|
|
46899
|
-
}, [i, a]), i ? n :
|
|
46932
|
+
}, [i, a]), i ? n : bq;
|
|
46900
46933
|
}
|
|
46901
|
-
var
|
|
46902
|
-
function
|
|
46903
|
-
let t = Date.parse(e.start), n = Date.parse(e.end), r = Math.ceil((t -
|
|
46904
|
-
for (let t = r; t < n; t +=
|
|
46934
|
+
var bq = [], xq = 4 * 36e5, Sq = 15 * 6e4, Cq = "taken", wq = "That time was just taken — pick another.";
|
|
46935
|
+
function Tq(e) {
|
|
46936
|
+
let t = Date.parse(e.start), n = Date.parse(e.end), r = Math.ceil((t - xq) / Sq) * Sq, i = [];
|
|
46937
|
+
for (let t = r; t < n; t += Sq) i.push(UG(e.memberId, new Date(t).toISOString()));
|
|
46905
46938
|
return i;
|
|
46906
46939
|
}
|
|
46907
|
-
async function
|
|
46908
|
-
let t =
|
|
46940
|
+
async function Eq(e) {
|
|
46941
|
+
let t = UG(e.memberId, e.start);
|
|
46909
46942
|
try {
|
|
46910
46943
|
return await se(I, async (n) => {
|
|
46911
|
-
let r = O(I,
|
|
46912
|
-
if ((await n.get(r)).exists()) throw Error(
|
|
46913
|
-
for (let r of
|
|
46944
|
+
let r = O(I, mG, t);
|
|
46945
|
+
if ((await n.get(r)).exists()) throw Error(Cq);
|
|
46946
|
+
for (let r of Tq(e)) {
|
|
46914
46947
|
if (r === t) continue;
|
|
46915
|
-
let i = await n.get(O(I,
|
|
46948
|
+
let i = await n.get(O(I, mG, r));
|
|
46916
46949
|
if (!i.exists()) continue;
|
|
46917
46950
|
let a = i.data() || {};
|
|
46918
|
-
if (
|
|
46951
|
+
if (HG({
|
|
46919
46952
|
start: String(a.start || ""),
|
|
46920
46953
|
end: String(a.end || "")
|
|
46921
|
-
}, e)) throw Error(
|
|
46954
|
+
}, e)) throw Error(Cq);
|
|
46922
46955
|
}
|
|
46923
46956
|
n.set(r, {
|
|
46924
46957
|
memberId: e.memberId,
|
|
@@ -46928,17 +46961,17 @@ async function Cq(e) {
|
|
|
46928
46961
|
});
|
|
46929
46962
|
}), null;
|
|
46930
46963
|
} catch (e) {
|
|
46931
|
-
return e?.message ===
|
|
46964
|
+
return e?.message === Cq ? wq : (console.error("Could not claim the time", e), "The time could not be saved — check your connection and try again.");
|
|
46932
46965
|
}
|
|
46933
46966
|
}
|
|
46934
|
-
async function
|
|
46967
|
+
async function Dq(e) {
|
|
46935
46968
|
try {
|
|
46936
|
-
await te(O(I,
|
|
46969
|
+
await te(O(I, mG, UG(e.memberId, e.start)));
|
|
46937
46970
|
} catch {}
|
|
46938
46971
|
}
|
|
46939
|
-
async function
|
|
46972
|
+
async function Oq(e, t) {
|
|
46940
46973
|
try {
|
|
46941
|
-
return await j(O(I,
|
|
46974
|
+
return await j(O(I, hG, UG(e.memberId, e.start)), {
|
|
46942
46975
|
memberId: e.memberId,
|
|
46943
46976
|
memberName: t.memberName,
|
|
46944
46977
|
scheduleId: t.scheduleId,
|
|
@@ -46960,7 +46993,7 @@ async function Tq(e, t) {
|
|
|
46960
46993
|
return console.error("Could not write the booking for the team", e), "The booking was taken but its details could not be saved.";
|
|
46961
46994
|
}
|
|
46962
46995
|
}
|
|
46963
|
-
var
|
|
46996
|
+
var kq = (e, t) => ({
|
|
46964
46997
|
id: e,
|
|
46965
46998
|
memberId: String(t?.memberId || ""),
|
|
46966
46999
|
scheduleId: String(t?.scheduleId || ""),
|
|
@@ -46979,17 +47012,17 @@ var Eq = (e, t) => ({
|
|
|
46979
47012
|
uid: String(t?.uid || ""),
|
|
46980
47013
|
createdAt: typeof t?.createdAt == "number" ? t.createdAt : 0
|
|
46981
47014
|
});
|
|
46982
|
-
function
|
|
47015
|
+
function Aq(e = {}) {
|
|
46983
47016
|
let [t, n] = v({
|
|
46984
47017
|
loading: !0,
|
|
46985
47018
|
bookings: [],
|
|
46986
47019
|
error: null
|
|
46987
47020
|
}), r = (e.members || []).slice().sort().join(","), i = !!e.includePast, a = e.now;
|
|
46988
47021
|
return f(() => {
|
|
46989
|
-
let e = r ? new Set(r.split(",")) : null, t = ie(D(I,
|
|
47022
|
+
let e = r ? new Set(r.split(",")) : null, t = ie(D(I, hG), (t) => {
|
|
46990
47023
|
let r = (a ? a() : /* @__PURE__ */ new Date()).toISOString(), o = [];
|
|
46991
47024
|
t.forEach((t) => {
|
|
46992
|
-
let n =
|
|
47025
|
+
let n = kq(t.id, t.data());
|
|
46993
47026
|
e && !e.has(n.memberId) || o.push(n);
|
|
46994
47027
|
});
|
|
46995
47028
|
let s = o.filter((e) => e.end >= r).sort((e, t) => e.start.localeCompare(t.start)), c = i ? o.filter((e) => e.end < r).sort((e, t) => t.start.localeCompare(e.start)) : [];
|
|
@@ -47012,18 +47045,18 @@ function Dq(e = {}) {
|
|
|
47012
47045
|
a
|
|
47013
47046
|
]), t;
|
|
47014
47047
|
}
|
|
47015
|
-
async function
|
|
47048
|
+
async function jq(e) {
|
|
47016
47049
|
try {
|
|
47017
|
-
return await te(O(I,
|
|
47050
|
+
return await te(O(I, hG, e)), await te(O(I, mG, e)), null;
|
|
47018
47051
|
} catch (e) {
|
|
47019
47052
|
return console.error("Could not cancel the booking", e), "It could not be cancelled — make sure you are signed in as a team member and try again.";
|
|
47020
47053
|
}
|
|
47021
47054
|
}
|
|
47022
47055
|
//#endregion
|
|
47023
47056
|
//#region src/components/ContactPopup.tsx
|
|
47024
|
-
var
|
|
47025
|
-
function
|
|
47026
|
-
let { schedules: o } =
|
|
47057
|
+
var Mq = t.lazy(() => import("./PhoneInputField-T0ttIIIN.js").then((e) => e.n)), Nq = /^[^\s@,;]+@[^\s@,;.]+(\.[^\s@,;.]+)*\.[a-z]{2,}$/i;
|
|
47058
|
+
function Pq({ field: e, value: t, error: n, timeZone: r, onTimeZone: i, onChange: a }) {
|
|
47059
|
+
let { schedules: o } = pq(), s = xK(e), c = o.filter((e) => s.includes(e.id) && fK(e)), [l] = v(() => /* @__PURE__ */ new Date()), u = yq(c.map((e) => e.memberId), l), d = aK(t), f = e.look === "calendar" ? fq : cq;
|
|
47027
47060
|
return /* @__PURE__ */ x("div", {
|
|
47028
47061
|
className: "flex flex-col w-full",
|
|
47029
47062
|
children: [
|
|
@@ -47034,7 +47067,7 @@ function jq({ field: e, value: t, error: n, timeZone: r, onTimeZone: i, onChange
|
|
|
47034
47067
|
/* @__PURE__ */ b(f, {
|
|
47035
47068
|
members: c,
|
|
47036
47069
|
value: d,
|
|
47037
|
-
onChange: (e) => a(e ?
|
|
47070
|
+
onChange: (e) => a(e ? iK(e) : ""),
|
|
47038
47071
|
taken: u,
|
|
47039
47072
|
timeZone: r,
|
|
47040
47073
|
onTimeZone: i
|
|
@@ -47046,14 +47079,14 @@ function jq({ field: e, value: t, error: n, timeZone: r, onTimeZone: i, onChange
|
|
|
47046
47079
|
]
|
|
47047
47080
|
});
|
|
47048
47081
|
}
|
|
47049
|
-
var
|
|
47082
|
+
var Fq = (e, t) => {
|
|
47050
47083
|
let n = e.find((e) => e.type === "text" && /name/i.test(String(e.name || ""))) || e.find((e) => e.type === "text");
|
|
47051
47084
|
return String(n && t[n.name] || F.currentUser?.displayName || "").trim();
|
|
47052
|
-
},
|
|
47085
|
+
}, Iq = (e, t) => {
|
|
47053
47086
|
let n = e.find((e) => e.type === "email");
|
|
47054
47087
|
return String(n && t[n.name] || F.currentUser?.email || "").trim();
|
|
47055
|
-
},
|
|
47056
|
-
function
|
|
47088
|
+
}, Lq = (e, t) => Object.fromEntries(e.filter((e) => e.type !== "schedule" && e.name && t[e.name] !== void 0 && t[e.name] !== "").map((e) => [e.name, String(t[e.name])]));
|
|
47089
|
+
function Rq({ field: e, value: t, error: n, onChange: r }) {
|
|
47057
47090
|
let [i, a] = v(0), [o, s] = v(""), c = _(null), l = i > 0, u = nG(t), d = async (e) => {
|
|
47058
47091
|
let t = Array.from(e || []);
|
|
47059
47092
|
c.current && (c.current.value = ""), t.length && (s(""), a((e) => e + t.length), await Promise.all(t.map(async (e) => {
|
|
@@ -47068,7 +47101,13 @@ function Fq({ field: e, value: t, error: n, onChange: r }) {
|
|
|
47068
47101
|
})));
|
|
47069
47102
|
}, f = (e) => {
|
|
47070
47103
|
s(""), r((t) => rG(nG(t).filter((t) => t !== e)));
|
|
47071
|
-
}, p
|
|
47104
|
+
}, { over: p, dropProps: m } = cG({
|
|
47105
|
+
accept: e.accept,
|
|
47106
|
+
multiple: !0,
|
|
47107
|
+
disabled: l,
|
|
47108
|
+
onFiles: d,
|
|
47109
|
+
onReject: () => s("That kind of file is not accepted here.")
|
|
47110
|
+
}), h = n || o;
|
|
47072
47111
|
return /* @__PURE__ */ x("div", {
|
|
47073
47112
|
className: "flex flex-col w-full relative",
|
|
47074
47113
|
children: [
|
|
@@ -47099,13 +47138,14 @@ function Fq({ field: e, value: t, error: n, onChange: r }) {
|
|
|
47099
47138
|
}, e))
|
|
47100
47139
|
}),
|
|
47101
47140
|
/* @__PURE__ */ x("label", {
|
|
47102
|
-
|
|
47141
|
+
...m,
|
|
47142
|
+
className: `flex items-center gap-3 w-full rounded-xl px-4 py-3 glass-panel transition-all duration-300 cursor-pointer hover:border-accent ${l ? "opacity-60 pointer-events-none" : ""} ${p ? "!border-accent bg-accent/[0.05]" : ""}`,
|
|
47103
47143
|
style: { borderRadius: "var(--input-radius, 0.75rem)" },
|
|
47104
47144
|
children: [
|
|
47105
|
-
l ? /* @__PURE__ */ b(R, { className: "w-4 h-4 animate-spin text-accent shrink-0" }) : /* @__PURE__ */ b(yl, { className:
|
|
47145
|
+
l ? /* @__PURE__ */ b(R, { className: "w-4 h-4 animate-spin text-accent shrink-0" }) : /* @__PURE__ */ b(yl, { className: `w-4 h-4 shrink-0 ${p ? "text-accent" : "text-foreground/40"}` }),
|
|
47106
47146
|
/* @__PURE__ */ b("span", {
|
|
47107
|
-
className:
|
|
47108
|
-
children: l ? i > 1 ? `Uploading ${i} files...` : "Uploading..." : u.length ? "Add another file" : e.placeholder || "Attach files"
|
|
47147
|
+
className: `flex-1 min-w-0 truncate text-[15px] ${p ? "text-accent" : "text-foreground/40"}`,
|
|
47148
|
+
children: p ? "Drop to attach" : l ? i > 1 ? `Uploading ${i} files...` : "Uploading..." : u.length ? "Add another file" : e.placeholder || "Attach files, or drop them here"
|
|
47109
47149
|
}),
|
|
47110
47150
|
!l && /* @__PURE__ */ x("span", {
|
|
47111
47151
|
className: "inline-flex items-center gap-1.5 text-[12.5px] font-bold text-foreground/60 shrink-0",
|
|
@@ -47126,15 +47166,15 @@ function Fq({ field: e, value: t, error: n, onChange: r }) {
|
|
|
47126
47166
|
})
|
|
47127
47167
|
]
|
|
47128
47168
|
}),
|
|
47129
|
-
|
|
47169
|
+
h && /* @__PURE__ */ b("span", {
|
|
47130
47170
|
className: "text-xs text-red-500 font-medium mt-1.5 ml-1",
|
|
47131
|
-
children:
|
|
47171
|
+
children: h
|
|
47132
47172
|
})
|
|
47133
47173
|
]
|
|
47134
47174
|
});
|
|
47135
47175
|
}
|
|
47136
|
-
function
|
|
47137
|
-
let [o, s] = v({}), [c, l] = v("idle"), [u, d] = v(""), [p, m] = v({}), [h, g] = v(() =>
|
|
47176
|
+
function zq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i }) {
|
|
47177
|
+
let [o, s] = v({}), [c, l] = v("idle"), [u, d] = v(""), [p, m] = v({}), [h, g] = v(() => OG()), [S, C] = v(""), w = _(null), [T, E] = v(n || null), [te, k] = v(!n), re = de(), ie = Oe(), ae = (e) => {
|
|
47138
47178
|
let t = (typeof window < "u" ? window.__FBOS_FORMS__ : null) || {};
|
|
47139
47179
|
return ie?.defaultConfigs?.[e] || ie?.defaultConfigs?.[`${e}Form`] || t[e] || (e === "contact" ? Se : e === "support" ? we : null);
|
|
47140
47180
|
};
|
|
@@ -47207,12 +47247,12 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47207
47247
|
let a = (T?.fields || []).filter((e) => e.type === "email"), c = {}, u = {};
|
|
47208
47248
|
a.forEach((e) => {
|
|
47209
47249
|
let t = String(o[e.name] ?? "").trim();
|
|
47210
|
-
t && (u[e.name] = t,
|
|
47250
|
+
t && (u[e.name] = t, Nq.test(t) || (c[e.name] = "That does not look like an email address — check for a typo, e.g. jane@example.com"));
|
|
47211
47251
|
}), (T?.fields || []).filter((e) => e.type === "file" && e.required && !o[e.name]).forEach((e) => {
|
|
47212
47252
|
c[e.name] = "Please attach a file before sending.";
|
|
47213
47253
|
});
|
|
47214
47254
|
let f = (T?.fields || []).filter((e) => e.type === "schedule");
|
|
47215
|
-
if (f.filter((e) => e.required && !
|
|
47255
|
+
if (f.filter((e) => e.required && !aK(o[e.name])).forEach((e) => {
|
|
47216
47256
|
c[e.name] = "Pick a time before sending.";
|
|
47217
47257
|
}), Object.keys(c).length > 0) {
|
|
47218
47258
|
m(c);
|
|
@@ -47222,15 +47262,15 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47222
47262
|
try {
|
|
47223
47263
|
let r = pU(T), a = t || T?.systemName || T?.title || "unknown", c = [];
|
|
47224
47264
|
for (let e of f) {
|
|
47225
|
-
let t =
|
|
47265
|
+
let t = aK(o[e.name]);
|
|
47226
47266
|
if (!t) continue;
|
|
47227
|
-
let n = await
|
|
47267
|
+
let n = await Eq(t);
|
|
47228
47268
|
if (n) {
|
|
47229
|
-
for (let e of c) await
|
|
47269
|
+
for (let e of c) await Dq(e.slot);
|
|
47230
47270
|
m({ [e.name]: n }), l("idle");
|
|
47231
47271
|
return;
|
|
47232
47272
|
}
|
|
47233
|
-
let r =
|
|
47273
|
+
let r = JG(t, yK());
|
|
47234
47274
|
c.push({
|
|
47235
47275
|
field: e,
|
|
47236
47276
|
slot: t,
|
|
@@ -47243,7 +47283,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47243
47283
|
...o,
|
|
47244
47284
|
...u
|
|
47245
47285
|
};
|
|
47246
|
-
for (let e of c) delete d[e.field.name], Object.assign(d,
|
|
47286
|
+
for (let e of c) delete d[e.field.name], Object.assign(d, oK(e.field.name, e.slot, e.memberName, h));
|
|
47247
47287
|
let p = F.currentUser ? {
|
|
47248
47288
|
uid: F.currentUser.uid,
|
|
47249
47289
|
submitterName: F.currentUser.displayName || "",
|
|
@@ -47258,22 +47298,22 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47258
47298
|
submittedAt: ce()
|
|
47259
47299
|
});
|
|
47260
47300
|
} catch (e) {
|
|
47261
|
-
for (let e of c) await
|
|
47301
|
+
for (let e of c) await Dq(e.slot);
|
|
47262
47302
|
throw e;
|
|
47263
47303
|
}
|
|
47264
47304
|
let _ = T?.fields || [];
|
|
47265
|
-
for (let e of c) await
|
|
47305
|
+
for (let e of c) await Oq(e.slot, {
|
|
47266
47306
|
memberName: e.memberName,
|
|
47267
47307
|
scheduleId: e.scheduleId,
|
|
47268
47308
|
scheduleName: e.scheduleName,
|
|
47269
47309
|
timeZone: h,
|
|
47270
|
-
name:
|
|
47271
|
-
email:
|
|
47272
|
-
answers:
|
|
47310
|
+
name: Fq(_, d),
|
|
47311
|
+
email: Iq(_, d),
|
|
47312
|
+
answers: Lq(_, d),
|
|
47273
47313
|
formId: a,
|
|
47274
47314
|
entryId: g.id
|
|
47275
47315
|
});
|
|
47276
|
-
c.length && C(c.map((e) =>
|
|
47316
|
+
c.length && C(c.map((e) => rK(e.slot, e.memberName, h)).join("; ")), l("success");
|
|
47277
47317
|
try {
|
|
47278
47318
|
i?.(Object.fromEntries(Object.entries(d).map(([e, t]) => [e, String(t ?? "")])), {
|
|
47279
47319
|
collection: r,
|
|
@@ -47313,7 +47353,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47313
47353
|
})]
|
|
47314
47354
|
})
|
|
47315
47355
|
}), document.body) : null;
|
|
47316
|
-
let j = (T.fields || []).find((e) => e.type === "schedule" && e.look === "calendar"), M = j ?
|
|
47356
|
+
let j = (T.fields || []).find((e) => e.type === "schedule" && e.look === "calendar"), M = j ? aK(o[j.name]) : null, N = !!j && !M, le = j ? "max-w-[880px]" : "max-w-[500px]", ue = /* @__PURE__ */ b("div", {
|
|
47317
47357
|
className: "relative z-10 w-full",
|
|
47318
47358
|
children: c === "success" ? /* @__PURE__ */ x(fU.div, {
|
|
47319
47359
|
initial: {
|
|
@@ -47399,7 +47439,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47399
47439
|
style: { borderRadius: "var(--input-radius, 0.75rem)" },
|
|
47400
47440
|
children: [/* @__PURE__ */ b("span", {
|
|
47401
47441
|
className: "text-[14px] font-semibold text-foreground truncate",
|
|
47402
|
-
children:
|
|
47442
|
+
children: rK(M, JG(M, yK())?.memberName || "", h)
|
|
47403
47443
|
}), /* @__PURE__ */ b("button", {
|
|
47404
47444
|
type: "button",
|
|
47405
47445
|
onClick: () => s((e) => ({
|
|
@@ -47409,7 +47449,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47409
47449
|
className: "text-[12.5px] font-bold text-accent hover:underline shrink-0 cursor-pointer",
|
|
47410
47450
|
children: "Change"
|
|
47411
47451
|
})]
|
|
47412
|
-
}) : /* @__PURE__ */ b(
|
|
47452
|
+
}) : /* @__PURE__ */ b(Pq, {
|
|
47413
47453
|
field: j,
|
|
47414
47454
|
value: o[j.name] || "",
|
|
47415
47455
|
error: p[j.name],
|
|
@@ -47424,7 +47464,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47424
47464
|
let n = e.type === "checkbox", r = t.type === "checkbox";
|
|
47425
47465
|
return n && !r ? 1 : !n && r ? -1 : 0;
|
|
47426
47466
|
}).map((e, t) => {
|
|
47427
|
-
if (e.type === "schedule") return /* @__PURE__ */ b(
|
|
47467
|
+
if (e.type === "schedule") return /* @__PURE__ */ b(Pq, {
|
|
47428
47468
|
field: e,
|
|
47429
47469
|
value: o[e.name] || "",
|
|
47430
47470
|
error: p[e.name],
|
|
@@ -47442,7 +47482,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47442
47482
|
}, t);
|
|
47443
47483
|
if (e.type === "tel") return /* @__PURE__ */ b(a, {
|
|
47444
47484
|
fallback: /* @__PURE__ */ b("div", { className: "h-12 w-full glass-panel animate-pulse rounded-xl" }),
|
|
47445
|
-
children: /* @__PURE__ */ b(
|
|
47485
|
+
children: /* @__PURE__ */ b(Mq, {
|
|
47446
47486
|
field: e,
|
|
47447
47487
|
value: o[e.name] || "",
|
|
47448
47488
|
onChange: (t) => s((n) => ({
|
|
@@ -47451,7 +47491,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47451
47491
|
}))
|
|
47452
47492
|
})
|
|
47453
47493
|
}, t);
|
|
47454
|
-
if (e.type === "file") return /* @__PURE__ */ b(
|
|
47494
|
+
if (e.type === "file") return /* @__PURE__ */ b(Rq, {
|
|
47455
47495
|
field: e,
|
|
47456
47496
|
value: o[e.name] || "",
|
|
47457
47497
|
error: p[e.name],
|
|
@@ -47531,7 +47571,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47531
47571
|
className: "text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1",
|
|
47532
47572
|
children: e.label
|
|
47533
47573
|
}), /* @__PURE__ */ x("div", {
|
|
47534
|
-
className: "relative flex items-center",
|
|
47574
|
+
className: "relative flex items-center lift-focus",
|
|
47535
47575
|
children: [/* @__PURE__ */ b("input", {
|
|
47536
47576
|
type: "date",
|
|
47537
47577
|
required: e.required,
|
|
@@ -47574,7 +47614,7 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47574
47614
|
className: "text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1",
|
|
47575
47615
|
children: e.label
|
|
47576
47616
|
}), /* @__PURE__ */ x("div", {
|
|
47577
|
-
className: "relative flex items-center justify-center",
|
|
47617
|
+
className: "relative flex items-center justify-center lift-focus",
|
|
47578
47618
|
children: [/* @__PURE__ */ b("span", {
|
|
47579
47619
|
className: "absolute left-4 text-foreground/70 font-bold flex items-center h-full z-10 pointer-events-none text-[15px]",
|
|
47580
47620
|
children: e.currencySymbol || "$"
|
|
@@ -47675,4 +47715,4 @@ function Iq({ onClose: e, formId: t, formConfig: n, isInline: r, onSubmitted: i
|
|
|
47675
47715
|
}), document.body);
|
|
47676
47716
|
}
|
|
47677
47717
|
//#endregion
|
|
47678
|
-
export {
|
|
47718
|
+
export { rK as $, Rs as $n, fE as $t, JK as A, jg as An, we as Ar, BW as At, _G as B, Id as Bn, Tj as Bt, eq as C, T_ as Cn, Re as Cr, iG as Ct, UK as D, r_ as Dn, De as Dr, XW as Dt, ZK as E, o_ as En, Pe as Er, $W as Et, OK as F, Wm as Fn, wM as Ft, SG as G, du as Gn, DA as Gt, gG as H, wd as Hn, YA as Ht, lG as I, Gf as In, CM as It, oK as J, yl as Jn, Wk as Jt, fK as K, Ql as Kn, fA as Kt, uG as L, If as Ln, sM as Lt, QK as M, yg as Mn, Se as Mr, mU as Mt, bK as N, gg as Nn, xe as Nr, fU as Nt, KK as O, t_ as On, Oe as Or, UW as Ot, AK as P, bh as Pn, ve as Pr, gV as Pt, YG as Q, oc as Qn, pO as Qt, bG as R, rf as Rn, aM as Rt, HK as S, R as Sn, I as Sr, eG as St, VK as T, S_ as Tn, Ne as Tr, aG as Tt, jK as U, id as Un, qA as Ut, vG as V, Pd as Vn, uj as Vt, ZG as W, Tu as Wn, HA as Wt, uK as X, vc as Xn, PO as Xt, cK as Y, $c as Yn, Uk as Yt, MK as Z, dc as Zn, AO as Zt, qK as _, Wv as _n, wn as _r, mK as _t, _q as a, Uw as an, ns as ar, TK as at, IK as b, ev as bn, Zt as br, FG as bt, pq as c, _C as cn, to as cr, wK as ct, vq as d, kS as dn, Va as dr, gK as dt, TT as en, Os as er, OG as et, Oq as f, OS as fn, $r as fr, pK as ft, PK as g, Qy as gn, On as gr, tK as gt, tq as h, fx as hn, Pn as hr, UG as ht, Dq as i, Kw as in, ls as ir, NK as it, $K as j, Ag as jn, Ce as jr, zW as jt, XK as k, e_ as kn, Te as kr, VW as kt, mq as l, gC as ln, Wa as lr, dK as lt, dq as m, Fx as mn, Vn as mr, VG as mt, jq as n, uT as nn, ms as nr, lK as nt, gq as o, XC as on, oo as or, BG as ot, fq as p, Gx as pn, Un as pr, EK as pt, DK as q, Tl as qn, Qk as qt, Eq as r, tT as rn, ps as rr, yK as rt, Aq as s, UC as sn, ro as sr, XG as st, zq as t, xT as tn, hs as tr, eK as tt, yq as u, RS as un, Ha as ur, kK as ut, WK as v, mv as vn, bn as vr, xK as vt, GK as w, C_ as wn, Ie as wr, nG as wt, LK as x, $_ as xn, F as xr, cG as xt, BK as y, ov as yn, gn as yr, nK as yt, yG as z, Ld as zn, tM as zt };
|