@gropulse/booking-widget 0.1.2 → 0.1.4
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/hooks/useBookingChat.d.ts +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +255 -164
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ interface UseBookingChatResult {
|
|
|
13
13
|
sendMessage: (text: string) => Promise<void>;
|
|
14
14
|
pickSlot: (slot: Slot) => Promise<void>;
|
|
15
15
|
start: () => Promise<void>;
|
|
16
|
+
reset: () => void;
|
|
16
17
|
}
|
|
17
18
|
export declare function useBookingChat(opts: UseBookingChatOptions): UseBookingChatResult;
|
|
18
19
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
2
|
-
`).flatMap((o,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),R=60*24*60*60*1e3;function S(t){return`gbw_booking_${t}`}function T(t){try{const o=localStorage.getItem(S(t));if(!o)return null;const s=JSON.parse(o);return Date.now()-s.savedAt>R?(localStorage.removeItem(S(t)),null):{id:s.id,start:s.start,attendeeEmail:s.attendeeEmail}}catch{return null}}function M(t,o){try{localStorage.setItem(S(t),JSON.stringify({...o,savedAt:Date.now()}))}catch{}}function _(t){try{localStorage.removeItem(S(t))}catch{}}function C(t){const{apiBaseUrl:o,context:s,onBookingConfirmed:n}=t,[r,l]=i.useState([]),[c,g]=i.useState(null),[j,b]=i.useState(()=>T(s.shopDomain)),[d,m]=i.useState(!1),[k,x]=i.useState(null),p=i.useCallback(async a=>{const u={...s,timezone:s.timezone??Intl.DateTimeFormat().resolvedOptions().timeZone},w=await fetch(`${o}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:a,context:u})});if(!w.ok){const h=await w.text();throw new Error(`Chat API error ${w.status}: ${h}`)}return await w.json()},[o,s]),f=i.useCallback(a=>{l(u=>[...u,{role:"assistant",content:a.message}]),a.action==="show_slots"&&a.slots&&g(a.slots),a.action==="booking_confirmed"&&a.booking&&(b(a.booking),g(null),M(s.shopDomain,a.booking),n==null||n(a.booking))},[n,s.shopDomain]),y=i.useRef(!1),v=i.useRef(0),N=i.useCallback(async()=>{if(y.current)return;y.current=!0;const a=v.current;m(!0),x(null);try{const w=await p([{role:"user",content:"__START__"}]);if(a!==v.current)return;l([{role:"assistant",content:w.message}]),w.action==="show_slots"&&w.slots&&g(w.slots),w.action==="booking_confirmed"&&w.booking&&(b(w.booking),n==null||n(w.booking))}catch(u){a===v.current&&x(u.message)}finally{a===v.current&&(m(!1),y.current=!1)}},[p,n]),L=i.useCallback(()=>r.length>0||d?Promise.resolve():N(),[r.length,d,N]),B=i.useCallback(async a=>{const u=a.trim();if(!u||d)return;const w=[...r,{role:"user",content:u}];l(w),m(!0),x(null);try{const h=await p(w);f(h)}catch(h){x(h.message)}finally{m(!1)}},[r,d,p,f]),D=i.useCallback(async a=>{if(d)return;const u=new Date(a.time).toLocaleString(void 0,{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}),w=[...r,{role:"user",content:`I'll take ${u} (${a.time})`}];l(w),g(null),m(!0),x(null);try{const h=await p(w);f(h)}catch(h){x(h.message)}finally{m(!1)}},[r,d,p,f]),$=i.useCallback(()=>{v.current+=1,_(s.shopDomain),y.current=!1,l([]),g(null),b(null),x(null),m(!1),N()},[s.shopDomain,N]);return{messages:r,slots:c,booking:j,isLoading:d,error:k,sendMessage:B,pickSlot:D,start:L,reset:$}}function I(t){return t.split(`
|
|
2
|
+
`).flatMap((o,s,n)=>{const r=[],l=o.split(/(\*\*[^*]+\*\*|\*[^*]+\*)/g);for(let c=0;c<l.length;c++){const g=l[c];g.startsWith("**")&&g.endsWith("**")?r.push(e.jsx("strong",{children:g.slice(2,-2)},`${s}-${c}`)):g.startsWith("*")&&g.endsWith("*")?r.push(e.jsx("em",{children:g.slice(1,-1)},`${s}-${c}`)):r.push(g)}return s<n.length-1&&r.push(e.jsx("br",{},`br-${s}`)),r})}function O({message:t}){const o=t.role==="user";return e.jsx("div",{className:`gbw-flex ${o?"gbw-justify-end":"gbw-justify-start"} gbw-mb-2`,children:e.jsx("div",{className:o?"gbw-max-w-[80%] gbw-rounded-2xl gbw-rounded-br-sm gbw-bg-gropulse-navy gbw-px-3.5 gbw-py-2 gbw-text-sm gbw-text-white":"gbw-max-w-[80%] gbw-rounded-2xl gbw-rounded-bl-sm gbw-bg-gropulse-bg gbw-px-3.5 gbw-py-2 gbw-text-sm gbw-text-gropulse-text gbw-border gbw-border-gropulse-border",children:o?t.content:I(t.content)})})}function W({messages:t,isLoading:o}){const s=i.useRef(null);return i.useEffect(()=>{var n;(n=s.current)==null||n.scrollIntoView({behavior:"smooth",block:"end"})},[t,o]),e.jsxs("div",{className:"gbw-flex-1 gbw-overflow-y-auto gbw-px-4 gbw-py-3",children:[t.map((n,r)=>e.jsx(O,{message:n},r)),o?e.jsx(E,{}):null,e.jsx("div",{ref:s})]})}function E(){return e.jsx("div",{className:"gbw-flex gbw-justify-start gbw-mb-2",children:e.jsx("div",{className:"gbw-rounded-2xl gbw-rounded-bl-sm gbw-bg-gropulse-bg gbw-border gbw-border-gropulse-border gbw-px-3.5 gbw-py-2.5",children:e.jsxs("div",{className:"gbw-flex gbw-gap-1",children:[e.jsx("span",{className:"gbw-typing-dot gbw-h-1.5 gbw-w-1.5 gbw-rounded-full gbw-bg-gropulse-muted gbw-inline-block"}),e.jsx("span",{className:"gbw-typing-dot gbw-h-1.5 gbw-w-1.5 gbw-rounded-full gbw-bg-gropulse-muted gbw-inline-block"}),e.jsx("span",{className:"gbw-typing-dot gbw-h-1.5 gbw-w-1.5 gbw-rounded-full gbw-bg-gropulse-muted gbw-inline-block"})]})})})}function P({onSend:t,disabled:o,placeholder:s}){const[n,r]=i.useState(""),l=()=>{const g=n.trim();!g||o||(t(g),r(""))},c=g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),l())};return e.jsx("div",{className:"gbw-border-t gbw-border-gropulse-border gbw-bg-white gbw-p-3",children:e.jsxs("div",{className:"gbw-flex gbw-items-end gbw-gap-2",children:[e.jsx("textarea",{value:n,onChange:g=>r(g.target.value),onKeyDown:c,disabled:o,rows:1,placeholder:s??"Type a message…",className:"gbw-flex-1 gbw-resize-none gbw-rounded-xl gbw-border gbw-border-gropulse-border gbw-bg-white gbw-px-3 gbw-py-2 gbw-text-sm gbw-outline-none focus:gbw-border-gropulse-navy focus:gbw-ring-2 focus:gbw-ring-gropulse-navy/10 disabled:gbw-bg-gropulse-bg disabled:gbw-text-gropulse-muted",style:{maxHeight:120}}),e.jsx("button",{type:"button",onClick:l,disabled:o||!n.trim(),className:"gbw-shrink-0 gbw-rounded-xl gbw-bg-gropulse-navy gbw-px-4 gbw-py-2 gbw-text-sm gbw-font-medium gbw-text-white gbw-transition hover:gbw-bg-gropulse-navyHover disabled:gbw-opacity-40",children:"Send"})]})})}function z({slots:t,onPick:o,disabled:s}){const n=i.useMemo(()=>A(t),[t]);return t.length===0?e.jsx("div",{className:"gbw-mx-4 gbw-mb-3 gbw-rounded-xl gbw-border gbw-border-gropulse-border gbw-bg-gropulse-bg gbw-px-3 gbw-py-2 gbw-text-sm gbw-text-gropulse-muted",children:"No slots available right now — try again in a moment."}):e.jsxs("div",{className:"gbw-mx-4 gbw-mb-3 gbw-rounded-xl gbw-border gbw-border-gropulse-border gbw-bg-white gbw-p-3",children:[e.jsx("div",{className:"gbw-mb-2 gbw-text-xs gbw-font-medium gbw-uppercase gbw-tracking-wide gbw-text-gropulse-muted",children:"Pick a time that works"}),e.jsx("div",{className:"gbw-flex gbw-flex-col gbw-gap-3 gbw-max-h-60 gbw-overflow-y-auto",children:n.map(r=>e.jsxs("div",{children:[e.jsx("div",{className:"gbw-mb-1.5 gbw-text-xs gbw-font-semibold gbw-text-gropulse-text",children:r.dayLabel}),e.jsx("div",{className:"gbw-grid gbw-grid-cols-3 gbw-gap-1.5",children:r.slots.map(l=>e.jsx("button",{type:"button",disabled:s,onClick:()=>o(l),className:"gbw-rounded-lg gbw-border gbw-border-gropulse-border gbw-bg-white gbw-px-2 gbw-py-1.5 gbw-text-xs gbw-font-medium gbw-text-gropulse-text gbw-transition hover:gbw-border-gropulse-navy hover:gbw-bg-gropulse-navy hover:gbw-text-white disabled:gbw-opacity-40",children:H(l.time)},l.time))})]},r.dayLabel))})]})}function A(t){const o=new Map;for(const n of t){const l=new Date(n.time).toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric"}),c=o.get(l);c?c.push(n):o.set(l,[n])}const s=new Date().toLocaleTimeString(void 0,{timeZoneName:"short"}).split(" ").pop()??"";return Array.from(o.entries()).map(([n,r])=>({dayLabel:`${n} · ${s}`,slots:r}))}function H(t){return new Date(t).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function K(t){const{apiBaseUrl:o,context:s,trigger:n="button",buttonLabel:r="Book Free Strategy Call",onBookingConfirmed:l,className:c}=t,[g,j]=i.useState(n==="auto"),b=C({apiBaseUrl:o,context:s,onBookingConfirmed:l}),d=b.booking!==null&&b.messages.length===0,{start:m,messages:k,isLoading:x,booking:p,error:f}=b,y=i.useRef(m);return y.current=m,i.useEffect(()=>{g&&!d&&k.length===0&&!x&&p===null&&!f&&y.current()},[g,d,k.length,x,p,f]),e.jsxs("div",{className:`gbw-root ${c??""}`,children:[n==="button"?e.jsxs("button",{type:"button",onClick:()=>j(v=>!v),className:"gbw-inline-flex gbw-items-center gbw-gap-2 gbw-rounded-xl gbw-bg-gropulse-navy gbw-px-4 gbw-py-2.5 gbw-text-sm gbw-font-medium gbw-text-white gbw-shadow-sm gbw-transition hover:gbw-bg-gropulse-navyHover",children:[e.jsx("span",{className:"gbw-h-2 gbw-w-2 gbw-rounded-full gbw-bg-gropulse-accent"}),d?"View Your Booking":r]}):null,g?e.jsxs("div",{className:"gbw-fixed gbw-inset-0 gbw-z-[9999] gbw-flex gbw-items-end gbw-justify-end gbw-p-0 sm:gbw-p-4",children:[e.jsx("div",{className:"gbw-absolute gbw-inset-0 gbw-bg-black/20",onClick:()=>j(!1)}),e.jsxs("div",{className:"gbw-relative gbw-flex gbw-h-full gbw-w-full gbw-flex-col gbw-overflow-hidden gbw-bg-white gbw-shadow-panel sm:gbw-h-[620px] sm:gbw-w-[400px] sm:gbw-rounded-2xl",children:[e.jsx(F,{ownerName:s.ownerName,onClose:()=>j(!1)}),d?e.jsx(G,{booking:b.booking,ownerName:s.ownerName,onReset:b.reset}):e.jsxs(e.Fragment,{children:[e.jsx(W,{messages:b.messages,isLoading:b.isLoading}),b.slots&&!b.booking?e.jsx(z,{slots:b.slots,onPick:b.pickSlot,disabled:b.isLoading}):null,b.error?e.jsx("div",{className:"gbw-mx-4 gbw-mb-2 gbw-rounded-lg gbw-border gbw-border-red-200 gbw-bg-red-50 gbw-px-3 gbw-py-2 gbw-text-xs gbw-text-red-700",children:b.error}):null,b.booking?e.jsx(V,{}):e.jsx(P,{onSend:b.sendMessage,disabled:b.isLoading,placeholder:"Reply…"})]})]})]}):null]})}function F({ownerName:t,onClose:o}){return e.jsxs("div",{className:"gbw-flex gbw-items-center gbw-justify-between gbw-border-b gbw-border-gropulse-border gbw-bg-gropulse-navy gbw-px-4 gbw-py-3 gbw-text-white",children:[e.jsxs("div",{children:[e.jsx("div",{className:"gbw-text-sm gbw-font-semibold",children:"Gropulse Growth Strategy"}),e.jsxs("div",{className:"gbw-text-xs gbw-text-white/70",children:["Hey ",t.split(" ")[0]," — let’s find a time."]})]}),e.jsx("button",{type:"button",onClick:o,"aria-label":"Close",className:"gbw-cursor-pointer gbw-rounded-md gbw-border-0 gbw-bg-transparent gbw-p-1 gbw-text-white/70 gbw-transition hover:gbw-bg-white/15 hover:gbw-text-white",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})})]})}function V(){return e.jsx("div",{className:"gbw-border-t gbw-border-gropulse-border gbw-bg-gropulse-bg gbw-px-4 gbw-py-3 gbw-text-center gbw-text-xs gbw-text-gropulse-muted",children:"Calendar invite on its way. You can close this window."})}function G({booking:t,ownerName:o,onReset:s}){const n=new Date(t.start).toLocaleString(void 0,{weekday:"long",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"});return e.jsxs("div",{className:"gbw-flex gbw-flex-1 gbw-flex-col gbw-items-center gbw-justify-center gbw-gap-4 gbw-p-6 gbw-text-center",children:[e.jsx("div",{className:"gbw-flex gbw-h-14 gbw-w-14 gbw-items-center gbw-justify-center gbw-rounded-full gbw-bg-green-100",children:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#16a34a",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}),e.jsxs("div",{children:[e.jsxs("div",{className:"gbw-text-base gbw-font-semibold gbw-text-gropulse-text",children:["You’re all booked, ",o.split(" ")[0],"!"]}),e.jsx("div",{className:"gbw-mt-1 gbw-text-sm gbw-text-gropulse-muted",children:n}),e.jsxs("div",{className:"gbw-mt-0.5 gbw-text-xs gbw-text-gropulse-muted",children:["Invite sent to ",t.attendeeEmail]})]}),e.jsx("button",{type:"button",onClick:s,className:"gbw-mt-4 gbw-inline-flex gbw-items-center gbw-gap-1.5 gbw-rounded-lg gbw-border gbw-border-gropulse-border gbw-px-4 gbw-py-2 gbw-text-xs gbw-font-medium gbw-text-gropulse-muted gbw-transition-colors hover:gbw-border-gropulse-accent hover:gbw-text-gropulse-accent active:gbw-scale-95",children:"Book another call"})]})}exports.BookingWidget=K;exports.useBookingChat=C;
|
package/dist/index.js
CHANGED
|
@@ -1,142 +1,174 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx as e, jsxs as w, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, useCallback as k, useRef as D, useEffect as $, useMemo as R } from "react";
|
|
3
|
+
const O = 60 * 24 * 60 * 60 * 1e3;
|
|
4
|
+
function C(t) {
|
|
5
|
+
return `gbw_booking_${t}`;
|
|
6
|
+
}
|
|
7
|
+
function W(t) {
|
|
8
|
+
try {
|
|
9
|
+
const r = localStorage.getItem(C(t));
|
|
10
|
+
if (!r) return null;
|
|
11
|
+
const o = JSON.parse(r);
|
|
12
|
+
return Date.now() - o.savedAt > O ? (localStorage.removeItem(C(t)), null) : { id: o.id, start: o.start, attendeeEmail: o.attendeeEmail };
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function E(t, r) {
|
|
18
|
+
try {
|
|
19
|
+
localStorage.setItem(
|
|
20
|
+
C(t),
|
|
21
|
+
JSON.stringify({ ...r, savedAt: Date.now() })
|
|
22
|
+
);
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function z(t) {
|
|
27
|
+
try {
|
|
28
|
+
localStorage.removeItem(C(t));
|
|
29
|
+
} catch {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function A(t) {
|
|
33
|
+
const { apiBaseUrl: r, context: o, onBookingConfirmed: n } = t, [s, i] = N([]), [c, g] = N(null), [S, b] = N(
|
|
34
|
+
() => W(o.shopDomain)
|
|
35
|
+
), [d, m] = N(!1), [L, p] = N(null), h = k(
|
|
5
36
|
async (l) => {
|
|
6
|
-
const
|
|
7
|
-
...
|
|
8
|
-
timezone:
|
|
9
|
-
},
|
|
37
|
+
const u = {
|
|
38
|
+
...o,
|
|
39
|
+
timezone: o.timezone ?? Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
40
|
+
}, a = await fetch(`${r}/api/chat`, {
|
|
10
41
|
method: "POST",
|
|
11
42
|
headers: { "Content-Type": "application/json" },
|
|
12
|
-
body: JSON.stringify({ messages: l, context:
|
|
43
|
+
body: JSON.stringify({ messages: l, context: u })
|
|
13
44
|
});
|
|
14
|
-
if (!
|
|
15
|
-
const
|
|
16
|
-
throw new Error(`Chat API error ${
|
|
45
|
+
if (!a.ok) {
|
|
46
|
+
const f = await a.text();
|
|
47
|
+
throw new Error(`Chat API error ${a.status}: ${f}`);
|
|
17
48
|
}
|
|
18
|
-
return await
|
|
49
|
+
return await a.json();
|
|
19
50
|
},
|
|
20
|
-
[
|
|
21
|
-
),
|
|
51
|
+
[r, o]
|
|
52
|
+
), x = k(
|
|
22
53
|
(l) => {
|
|
23
|
-
|
|
54
|
+
i((u) => [...u, { role: "assistant", content: l.message }]), l.action === "show_slots" && l.slots && g(l.slots), l.action === "booking_confirmed" && l.booking && (b(l.booking), g(null), E(o.shopDomain, l.booking), n == null || n(l.booking));
|
|
24
55
|
},
|
|
25
|
-
[
|
|
26
|
-
),
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
56
|
+
[n, o.shopDomain]
|
|
57
|
+
), y = D(!1), v = D(0), B = k(async () => {
|
|
58
|
+
if (y.current) return;
|
|
59
|
+
y.current = !0;
|
|
60
|
+
const l = v.current;
|
|
61
|
+
m(!0), p(null);
|
|
62
|
+
try {
|
|
63
|
+
const a = await h([{ role: "user", content: "__START__" }]);
|
|
64
|
+
if (l !== v.current) return;
|
|
65
|
+
i([{ role: "assistant", content: a.message }]), a.action === "show_slots" && a.slots && g(a.slots), a.action === "booking_confirmed" && a.booking && (b(a.booking), n == null || n(a.booking));
|
|
66
|
+
} catch (u) {
|
|
67
|
+
l === v.current && p(u.message);
|
|
68
|
+
} finally {
|
|
69
|
+
l === v.current && (m(!1), y.current = !1);
|
|
40
70
|
}
|
|
41
|
-
}, [
|
|
71
|
+
}, [h, n]), j = k(() => s.length > 0 || d ? Promise.resolve() : B(), [s.length, d, B]), T = k(
|
|
42
72
|
async (l) => {
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
45
|
-
const
|
|
46
|
-
|
|
73
|
+
const u = l.trim();
|
|
74
|
+
if (!u || d) return;
|
|
75
|
+
const a = [...s, { role: "user", content: u }];
|
|
76
|
+
i(a), m(!0), p(null);
|
|
47
77
|
try {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
} catch (
|
|
51
|
-
f
|
|
78
|
+
const f = await h(a);
|
|
79
|
+
x(f);
|
|
80
|
+
} catch (f) {
|
|
81
|
+
p(f.message);
|
|
52
82
|
} finally {
|
|
53
|
-
|
|
83
|
+
m(!1);
|
|
54
84
|
}
|
|
55
85
|
},
|
|
56
|
-
[
|
|
57
|
-
),
|
|
86
|
+
[s, d, h, x]
|
|
87
|
+
), _ = k(
|
|
58
88
|
async (l) => {
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
89
|
+
if (d) return;
|
|
90
|
+
const u = new Date(l.time).toLocaleString(void 0, {
|
|
61
91
|
weekday: "short",
|
|
62
92
|
month: "short",
|
|
63
93
|
day: "numeric",
|
|
64
94
|
hour: "numeric",
|
|
65
95
|
minute: "2-digit"
|
|
66
|
-
}),
|
|
67
|
-
...
|
|
68
|
-
{ role: "user", content: `I'll take ${
|
|
96
|
+
}), a = [
|
|
97
|
+
...s,
|
|
98
|
+
{ role: "user", content: `I'll take ${u} (${l.time})` }
|
|
69
99
|
];
|
|
70
|
-
|
|
100
|
+
i(a), g(null), m(!0), p(null);
|
|
71
101
|
try {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
} catch (
|
|
75
|
-
f
|
|
102
|
+
const f = await h(a);
|
|
103
|
+
x(f);
|
|
104
|
+
} catch (f) {
|
|
105
|
+
p(f.message);
|
|
76
106
|
} finally {
|
|
77
|
-
|
|
107
|
+
m(!1);
|
|
78
108
|
}
|
|
79
109
|
},
|
|
80
|
-
[
|
|
81
|
-
)
|
|
82
|
-
|
|
110
|
+
[s, d, h, x]
|
|
111
|
+
), M = k(() => {
|
|
112
|
+
v.current += 1, z(o.shopDomain), y.current = !1, i([]), g(null), b(null), p(null), m(!1), B();
|
|
113
|
+
}, [o.shopDomain, B]);
|
|
114
|
+
return { messages: s, slots: c, booking: S, isLoading: d, error: L, sendMessage: T, pickSlot: _, start: j, reset: M };
|
|
83
115
|
}
|
|
84
|
-
function
|
|
85
|
-
return
|
|
86
|
-
`).flatMap((
|
|
87
|
-
const
|
|
88
|
-
for (let
|
|
89
|
-
const
|
|
90
|
-
|
|
116
|
+
function K(t) {
|
|
117
|
+
return t.split(`
|
|
118
|
+
`).flatMap((r, o, n) => {
|
|
119
|
+
const s = [], i = r.split(/(\*\*[^*]+\*\*|\*[^*]+\*)/g);
|
|
120
|
+
for (let c = 0; c < i.length; c++) {
|
|
121
|
+
const g = i[c];
|
|
122
|
+
g.startsWith("**") && g.endsWith("**") ? s.push(/* @__PURE__ */ e("strong", { children: g.slice(2, -2) }, `${o}-${c}`)) : g.startsWith("*") && g.endsWith("*") ? s.push(/* @__PURE__ */ e("em", { children: g.slice(1, -1) }, `${o}-${c}`)) : s.push(g);
|
|
91
123
|
}
|
|
92
|
-
return
|
|
124
|
+
return o < n.length - 1 && s.push(/* @__PURE__ */ e("br", {}, `br-${o}`)), s;
|
|
93
125
|
});
|
|
94
126
|
}
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
return /* @__PURE__ */ e("div", { className: `gbw-flex ${
|
|
127
|
+
function P({ message: t }) {
|
|
128
|
+
const r = t.role === "user";
|
|
129
|
+
return /* @__PURE__ */ e("div", { className: `gbw-flex ${r ? "gbw-justify-end" : "gbw-justify-start"} gbw-mb-2`, children: /* @__PURE__ */ e(
|
|
98
130
|
"div",
|
|
99
131
|
{
|
|
100
|
-
className:
|
|
101
|
-
children:
|
|
132
|
+
className: r ? "gbw-max-w-[80%] gbw-rounded-2xl gbw-rounded-br-sm gbw-bg-gropulse-navy gbw-px-3.5 gbw-py-2 gbw-text-sm gbw-text-white" : "gbw-max-w-[80%] gbw-rounded-2xl gbw-rounded-bl-sm gbw-bg-gropulse-bg gbw-px-3.5 gbw-py-2 gbw-text-sm gbw-text-gropulse-text gbw-border gbw-border-gropulse-border",
|
|
133
|
+
children: r ? t.content : K(t.content)
|
|
102
134
|
}
|
|
103
135
|
) });
|
|
104
136
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
return
|
|
108
|
-
var
|
|
109
|
-
(
|
|
110
|
-
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/* @__PURE__ */ e("div", { ref:
|
|
137
|
+
function H({ messages: t, isLoading: r }) {
|
|
138
|
+
const o = D(null);
|
|
139
|
+
return $(() => {
|
|
140
|
+
var n;
|
|
141
|
+
(n = o.current) == null || n.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
142
|
+
}, [t, r]), /* @__PURE__ */ w("div", { className: "gbw-flex-1 gbw-overflow-y-auto gbw-px-4 gbw-py-3", children: [
|
|
143
|
+
t.map((n, s) => /* @__PURE__ */ e(P, { message: n }, s)),
|
|
144
|
+
r ? /* @__PURE__ */ e(F, {}) : null,
|
|
145
|
+
/* @__PURE__ */ e("div", { ref: o })
|
|
114
146
|
] });
|
|
115
147
|
}
|
|
116
|
-
function
|
|
117
|
-
return /* @__PURE__ */ e("div", { className: "gbw-flex gbw-justify-start gbw-mb-2", children: /* @__PURE__ */ e("div", { className: "gbw-rounded-2xl gbw-rounded-bl-sm gbw-bg-gropulse-bg gbw-border gbw-border-gropulse-border gbw-px-3.5 gbw-py-2.5", children: /* @__PURE__ */
|
|
148
|
+
function F() {
|
|
149
|
+
return /* @__PURE__ */ e("div", { className: "gbw-flex gbw-justify-start gbw-mb-2", children: /* @__PURE__ */ e("div", { className: "gbw-rounded-2xl gbw-rounded-bl-sm gbw-bg-gropulse-bg gbw-border gbw-border-gropulse-border gbw-px-3.5 gbw-py-2.5", children: /* @__PURE__ */ w("div", { className: "gbw-flex gbw-gap-1", children: [
|
|
118
150
|
/* @__PURE__ */ e("span", { className: "gbw-typing-dot gbw-h-1.5 gbw-w-1.5 gbw-rounded-full gbw-bg-gropulse-muted gbw-inline-block" }),
|
|
119
151
|
/* @__PURE__ */ e("span", { className: "gbw-typing-dot gbw-h-1.5 gbw-w-1.5 gbw-rounded-full gbw-bg-gropulse-muted gbw-inline-block" }),
|
|
120
152
|
/* @__PURE__ */ e("span", { className: "gbw-typing-dot gbw-h-1.5 gbw-w-1.5 gbw-rounded-full gbw-bg-gropulse-muted gbw-inline-block" })
|
|
121
153
|
] }) }) });
|
|
122
154
|
}
|
|
123
|
-
function
|
|
124
|
-
const [
|
|
125
|
-
const
|
|
126
|
-
!
|
|
155
|
+
function V({ onSend: t, disabled: r, placeholder: o }) {
|
|
156
|
+
const [n, s] = N(""), i = () => {
|
|
157
|
+
const g = n.trim();
|
|
158
|
+
!g || r || (t(g), s(""));
|
|
127
159
|
};
|
|
128
|
-
return /* @__PURE__ */ e("div", { className: "gbw-border-t gbw-border-gropulse-border gbw-bg-white gbw-p-3", children: /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ e("div", { className: "gbw-border-t gbw-border-gropulse-border gbw-bg-white gbw-p-3", children: /* @__PURE__ */ w("div", { className: "gbw-flex gbw-items-end gbw-gap-2", children: [
|
|
129
161
|
/* @__PURE__ */ e(
|
|
130
162
|
"textarea",
|
|
131
163
|
{
|
|
132
|
-
value:
|
|
133
|
-
onChange: (
|
|
134
|
-
onKeyDown: (
|
|
135
|
-
|
|
164
|
+
value: n,
|
|
165
|
+
onChange: (g) => s(g.target.value),
|
|
166
|
+
onKeyDown: (g) => {
|
|
167
|
+
g.key === "Enter" && !g.shiftKey && (g.preventDefault(), i());
|
|
136
168
|
},
|
|
137
|
-
disabled:
|
|
169
|
+
disabled: r,
|
|
138
170
|
rows: 1,
|
|
139
|
-
placeholder:
|
|
171
|
+
placeholder: o ?? "Type a message…",
|
|
140
172
|
className: "gbw-flex-1 gbw-resize-none gbw-rounded-xl gbw-border gbw-border-gropulse-border gbw-bg-white gbw-px-3 gbw-py-2 gbw-text-sm gbw-outline-none focus:gbw-border-gropulse-navy focus:gbw-ring-2 focus:gbw-ring-gropulse-navy/10 disabled:gbw-bg-gropulse-bg disabled:gbw-text-gropulse-muted",
|
|
141
173
|
style: { maxHeight: 120 }
|
|
142
174
|
}
|
|
@@ -145,125 +177,134 @@ function z({ onSend: g, disabled: s, placeholder: r }) {
|
|
|
145
177
|
"button",
|
|
146
178
|
{
|
|
147
179
|
type: "button",
|
|
148
|
-
onClick:
|
|
149
|
-
disabled:
|
|
180
|
+
onClick: i,
|
|
181
|
+
disabled: r || !n.trim(),
|
|
150
182
|
className: "gbw-shrink-0 gbw-rounded-xl gbw-bg-gropulse-navy gbw-px-4 gbw-py-2 gbw-text-sm gbw-font-medium gbw-text-white gbw-transition hover:gbw-bg-gropulse-navyHover disabled:gbw-opacity-40",
|
|
151
183
|
children: "Send"
|
|
152
184
|
}
|
|
153
185
|
)
|
|
154
186
|
] }) });
|
|
155
187
|
}
|
|
156
|
-
function
|
|
157
|
-
const
|
|
158
|
-
return
|
|
188
|
+
function G({ slots: t, onPick: r, disabled: o }) {
|
|
189
|
+
const n = R(() => J(t), [t]);
|
|
190
|
+
return t.length === 0 ? /* @__PURE__ */ e("div", { className: "gbw-mx-4 gbw-mb-3 gbw-rounded-xl gbw-border gbw-border-gropulse-border gbw-bg-gropulse-bg gbw-px-3 gbw-py-2 gbw-text-sm gbw-text-gropulse-muted", children: "No slots available right now — try again in a moment." }) : /* @__PURE__ */ w("div", { className: "gbw-mx-4 gbw-mb-3 gbw-rounded-xl gbw-border gbw-border-gropulse-border gbw-bg-white gbw-p-3", children: [
|
|
159
191
|
/* @__PURE__ */ e("div", { className: "gbw-mb-2 gbw-text-xs gbw-font-medium gbw-uppercase gbw-tracking-wide gbw-text-gropulse-muted", children: "Pick a time that works" }),
|
|
160
|
-
/* @__PURE__ */ e("div", { className: "gbw-flex gbw-flex-col gbw-gap-3 gbw-max-h-60 gbw-overflow-y-auto", children:
|
|
161
|
-
/* @__PURE__ */ e("div", { className: "gbw-mb-1.5 gbw-text-xs gbw-font-semibold gbw-text-gropulse-text", children:
|
|
162
|
-
/* @__PURE__ */ e("div", { className: "gbw-grid gbw-grid-cols-3 gbw-gap-1.5", children:
|
|
192
|
+
/* @__PURE__ */ e("div", { className: "gbw-flex gbw-flex-col gbw-gap-3 gbw-max-h-60 gbw-overflow-y-auto", children: n.map((s) => /* @__PURE__ */ w("div", { children: [
|
|
193
|
+
/* @__PURE__ */ e("div", { className: "gbw-mb-1.5 gbw-text-xs gbw-font-semibold gbw-text-gropulse-text", children: s.dayLabel }),
|
|
194
|
+
/* @__PURE__ */ e("div", { className: "gbw-grid gbw-grid-cols-3 gbw-gap-1.5", children: s.slots.map((i) => /* @__PURE__ */ e(
|
|
163
195
|
"button",
|
|
164
196
|
{
|
|
165
197
|
type: "button",
|
|
166
|
-
disabled:
|
|
167
|
-
onClick: () =>
|
|
198
|
+
disabled: o,
|
|
199
|
+
onClick: () => r(i),
|
|
168
200
|
className: "gbw-rounded-lg gbw-border gbw-border-gropulse-border gbw-bg-white gbw-px-2 gbw-py-1.5 gbw-text-xs gbw-font-medium gbw-text-gropulse-text gbw-transition hover:gbw-border-gropulse-navy hover:gbw-bg-gropulse-navy hover:gbw-text-white disabled:gbw-opacity-40",
|
|
169
|
-
children:
|
|
201
|
+
children: U(i.time)
|
|
170
202
|
},
|
|
171
|
-
|
|
203
|
+
i.time
|
|
172
204
|
)) })
|
|
173
|
-
] },
|
|
205
|
+
] }, s.dayLabel)) })
|
|
174
206
|
] });
|
|
175
207
|
}
|
|
176
|
-
function
|
|
177
|
-
const
|
|
178
|
-
for (const
|
|
179
|
-
const
|
|
208
|
+
function J(t) {
|
|
209
|
+
const r = /* @__PURE__ */ new Map();
|
|
210
|
+
for (const n of t) {
|
|
211
|
+
const i = new Date(n.time).toLocaleDateString(void 0, {
|
|
180
212
|
weekday: "long",
|
|
181
213
|
month: "short",
|
|
182
214
|
day: "numeric"
|
|
183
|
-
}),
|
|
184
|
-
|
|
215
|
+
}), c = r.get(i);
|
|
216
|
+
c ? c.push(n) : r.set(i, [n]);
|
|
185
217
|
}
|
|
186
|
-
const
|
|
187
|
-
return Array.from(
|
|
188
|
-
dayLabel: `${
|
|
189
|
-
slots:
|
|
218
|
+
const o = (/* @__PURE__ */ new Date()).toLocaleTimeString(void 0, { timeZoneName: "short" }).split(" ").pop() ?? "";
|
|
219
|
+
return Array.from(r.entries()).map(([n, s]) => ({
|
|
220
|
+
dayLabel: `${n} · ${o}`,
|
|
221
|
+
slots: s
|
|
190
222
|
}));
|
|
191
223
|
}
|
|
192
|
-
function
|
|
193
|
-
return new Date(
|
|
224
|
+
function U(t) {
|
|
225
|
+
return new Date(t).toLocaleTimeString(void 0, {
|
|
194
226
|
hour: "numeric",
|
|
195
227
|
minute: "2-digit"
|
|
196
228
|
});
|
|
197
229
|
}
|
|
198
|
-
function
|
|
230
|
+
function ee(t) {
|
|
199
231
|
const {
|
|
200
|
-
apiBaseUrl:
|
|
201
|
-
context:
|
|
202
|
-
trigger:
|
|
203
|
-
buttonLabel:
|
|
204
|
-
onBookingConfirmed:
|
|
205
|
-
className:
|
|
206
|
-
} =
|
|
207
|
-
return
|
|
208
|
-
|
|
209
|
-
}, [
|
|
210
|
-
|
|
232
|
+
apiBaseUrl: r,
|
|
233
|
+
context: o,
|
|
234
|
+
trigger: n = "button",
|
|
235
|
+
buttonLabel: s = "Book Free Strategy Call",
|
|
236
|
+
onBookingConfirmed: i,
|
|
237
|
+
className: c
|
|
238
|
+
} = t, [g, S] = N(n === "auto"), b = A({ apiBaseUrl: r, context: o, onBookingConfirmed: i }), d = b.booking !== null && b.messages.length === 0, { start: m, messages: L, isLoading: p, booking: h, error: x } = b, y = D(m);
|
|
239
|
+
return y.current = m, $(() => {
|
|
240
|
+
g && !d && L.length === 0 && !p && h === null && !x && y.current();
|
|
241
|
+
}, [g, d, L.length, p, h, x]), /* @__PURE__ */ w("div", { className: `gbw-root ${c ?? ""}`, children: [
|
|
242
|
+
n === "button" ? /* @__PURE__ */ w(
|
|
211
243
|
"button",
|
|
212
244
|
{
|
|
213
245
|
type: "button",
|
|
214
|
-
onClick: () =>
|
|
246
|
+
onClick: () => S((v) => !v),
|
|
215
247
|
className: "gbw-inline-flex gbw-items-center gbw-gap-2 gbw-rounded-xl gbw-bg-gropulse-navy gbw-px-4 gbw-py-2.5 gbw-text-sm gbw-font-medium gbw-text-white gbw-shadow-sm gbw-transition hover:gbw-bg-gropulse-navyHover",
|
|
216
248
|
children: [
|
|
217
249
|
/* @__PURE__ */ e("span", { className: "gbw-h-2 gbw-w-2 gbw-rounded-full gbw-bg-gropulse-accent" }),
|
|
218
|
-
|
|
250
|
+
d ? "View Your Booking" : s
|
|
219
251
|
]
|
|
220
252
|
}
|
|
221
253
|
) : null,
|
|
222
|
-
|
|
254
|
+
g ? /* @__PURE__ */ w("div", { className: "gbw-fixed gbw-inset-0 gbw-z-[9999] gbw-flex gbw-items-end gbw-justify-end gbw-p-0 sm:gbw-p-4", children: [
|
|
223
255
|
/* @__PURE__ */ e(
|
|
224
256
|
"div",
|
|
225
257
|
{
|
|
226
258
|
className: "gbw-absolute gbw-inset-0 gbw-bg-black/20",
|
|
227
|
-
onClick: () =>
|
|
259
|
+
onClick: () => S(!1)
|
|
228
260
|
}
|
|
229
261
|
),
|
|
230
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ w("div", { className: "gbw-relative gbw-flex gbw-h-full gbw-w-full gbw-flex-col gbw-overflow-hidden gbw-bg-white gbw-shadow-panel sm:gbw-h-[620px] sm:gbw-w-[400px] sm:gbw-rounded-2xl", children: [
|
|
231
263
|
/* @__PURE__ */ e(
|
|
232
|
-
|
|
264
|
+
Y,
|
|
233
265
|
{
|
|
234
|
-
ownerName:
|
|
235
|
-
onClose: () =>
|
|
266
|
+
ownerName: o.ownerName,
|
|
267
|
+
onClose: () => S(!1)
|
|
236
268
|
}
|
|
237
269
|
),
|
|
238
|
-
/* @__PURE__ */ e(
|
|
239
|
-
|
|
240
|
-
H,
|
|
270
|
+
d ? /* @__PURE__ */ e(
|
|
271
|
+
q,
|
|
241
272
|
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
273
|
+
booking: b.booking,
|
|
274
|
+
ownerName: o.ownerName,
|
|
275
|
+
onReset: b.reset
|
|
245
276
|
}
|
|
246
|
-
) :
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
277
|
+
) : /* @__PURE__ */ w(I, { children: [
|
|
278
|
+
/* @__PURE__ */ e(H, { messages: b.messages, isLoading: b.isLoading }),
|
|
279
|
+
b.slots && !b.booking ? /* @__PURE__ */ e(
|
|
280
|
+
G,
|
|
281
|
+
{
|
|
282
|
+
slots: b.slots,
|
|
283
|
+
onPick: b.pickSlot,
|
|
284
|
+
disabled: b.isLoading
|
|
285
|
+
}
|
|
286
|
+
) : null,
|
|
287
|
+
b.error ? /* @__PURE__ */ e("div", { className: "gbw-mx-4 gbw-mb-2 gbw-rounded-lg gbw-border gbw-border-red-200 gbw-bg-red-50 gbw-px-3 gbw-py-2 gbw-text-xs gbw-text-red-700", children: b.error }) : null,
|
|
288
|
+
b.booking ? /* @__PURE__ */ e(Z, {}) : /* @__PURE__ */ e(
|
|
289
|
+
V,
|
|
290
|
+
{
|
|
291
|
+
onSend: b.sendMessage,
|
|
292
|
+
disabled: b.isLoading,
|
|
293
|
+
placeholder: "Reply…"
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
] })
|
|
256
297
|
] })
|
|
257
298
|
] }) : null
|
|
258
299
|
] });
|
|
259
300
|
}
|
|
260
|
-
function
|
|
261
|
-
return /* @__PURE__ */
|
|
262
|
-
/* @__PURE__ */
|
|
301
|
+
function Y({ ownerName: t, onClose: r }) {
|
|
302
|
+
return /* @__PURE__ */ w("div", { className: "gbw-flex gbw-items-center gbw-justify-between gbw-border-b gbw-border-gropulse-border gbw-bg-gropulse-navy gbw-px-4 gbw-py-3 gbw-text-white", children: [
|
|
303
|
+
/* @__PURE__ */ w("div", { children: [
|
|
263
304
|
/* @__PURE__ */ e("div", { className: "gbw-text-sm gbw-font-semibold", children: "Gropulse Growth Strategy" }),
|
|
264
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ w("div", { className: "gbw-text-xs gbw-text-white/70", children: [
|
|
265
306
|
"Hey ",
|
|
266
|
-
|
|
307
|
+
t.split(" ")[0],
|
|
267
308
|
" — let’s find a time."
|
|
268
309
|
] })
|
|
269
310
|
] }),
|
|
@@ -271,10 +312,10 @@ function E({ ownerName: g, onClose: s }) {
|
|
|
271
312
|
"button",
|
|
272
313
|
{
|
|
273
314
|
type: "button",
|
|
274
|
-
onClick:
|
|
315
|
+
onClick: r,
|
|
275
316
|
"aria-label": "Close",
|
|
276
|
-
className: "gbw-rounded-md gbw-p-1 gbw-text-white/
|
|
277
|
-
children: /* @__PURE__ */
|
|
317
|
+
className: "gbw-cursor-pointer gbw-rounded-md gbw-border-0 gbw-bg-transparent gbw-p-1 gbw-text-white/70 gbw-transition hover:gbw-bg-white/15 hover:gbw-text-white",
|
|
318
|
+
children: /* @__PURE__ */ w(
|
|
278
319
|
"svg",
|
|
279
320
|
{
|
|
280
321
|
width: "18",
|
|
@@ -295,10 +336,60 @@ function E({ ownerName: g, onClose: s }) {
|
|
|
295
336
|
)
|
|
296
337
|
] });
|
|
297
338
|
}
|
|
298
|
-
function
|
|
339
|
+
function Z() {
|
|
299
340
|
return /* @__PURE__ */ e("div", { className: "gbw-border-t gbw-border-gropulse-border gbw-bg-gropulse-bg gbw-px-4 gbw-py-3 gbw-text-center gbw-text-xs gbw-text-gropulse-muted", children: "Calendar invite on its way. You can close this window." });
|
|
300
341
|
}
|
|
342
|
+
function q({
|
|
343
|
+
booking: t,
|
|
344
|
+
ownerName: r,
|
|
345
|
+
onReset: o
|
|
346
|
+
}) {
|
|
347
|
+
const n = new Date(t.start).toLocaleString(void 0, {
|
|
348
|
+
weekday: "long",
|
|
349
|
+
month: "long",
|
|
350
|
+
day: "numeric",
|
|
351
|
+
hour: "numeric",
|
|
352
|
+
minute: "2-digit"
|
|
353
|
+
});
|
|
354
|
+
return /* @__PURE__ */ w("div", { className: "gbw-flex gbw-flex-1 gbw-flex-col gbw-items-center gbw-justify-center gbw-gap-4 gbw-p-6 gbw-text-center", children: [
|
|
355
|
+
/* @__PURE__ */ e("div", { className: "gbw-flex gbw-h-14 gbw-w-14 gbw-items-center gbw-justify-center gbw-rounded-full gbw-bg-green-100", children: /* @__PURE__ */ e(
|
|
356
|
+
"svg",
|
|
357
|
+
{
|
|
358
|
+
width: "28",
|
|
359
|
+
height: "28",
|
|
360
|
+
viewBox: "0 0 24 24",
|
|
361
|
+
fill: "none",
|
|
362
|
+
stroke: "#16a34a",
|
|
363
|
+
strokeWidth: "2.5",
|
|
364
|
+
strokeLinecap: "round",
|
|
365
|
+
strokeLinejoin: "round",
|
|
366
|
+
children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" })
|
|
367
|
+
}
|
|
368
|
+
) }),
|
|
369
|
+
/* @__PURE__ */ w("div", { children: [
|
|
370
|
+
/* @__PURE__ */ w("div", { className: "gbw-text-base gbw-font-semibold gbw-text-gropulse-text", children: [
|
|
371
|
+
"You’re all booked, ",
|
|
372
|
+
r.split(" ")[0],
|
|
373
|
+
"!"
|
|
374
|
+
] }),
|
|
375
|
+
/* @__PURE__ */ e("div", { className: "gbw-mt-1 gbw-text-sm gbw-text-gropulse-muted", children: n }),
|
|
376
|
+
/* @__PURE__ */ w("div", { className: "gbw-mt-0.5 gbw-text-xs gbw-text-gropulse-muted", children: [
|
|
377
|
+
"Invite sent to ",
|
|
378
|
+
t.attendeeEmail
|
|
379
|
+
] })
|
|
380
|
+
] }),
|
|
381
|
+
/* @__PURE__ */ e(
|
|
382
|
+
"button",
|
|
383
|
+
{
|
|
384
|
+
type: "button",
|
|
385
|
+
onClick: o,
|
|
386
|
+
className: "gbw-mt-4 gbw-inline-flex gbw-items-center gbw-gap-1.5 gbw-rounded-lg gbw-border gbw-border-gropulse-border gbw-px-4 gbw-py-2 gbw-text-xs gbw-font-medium gbw-text-gropulse-muted gbw-transition-colors hover:gbw-border-gropulse-accent hover:gbw-text-gropulse-accent active:gbw-scale-95",
|
|
387
|
+
children: "Book another call"
|
|
388
|
+
}
|
|
389
|
+
)
|
|
390
|
+
] });
|
|
391
|
+
}
|
|
301
392
|
export {
|
|
302
|
-
|
|
303
|
-
|
|
393
|
+
ee as BookingWidget,
|
|
394
|
+
A as useBookingChat
|
|
304
395
|
};
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.gbw-root{font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;color:#0f172a}.gbw-typing-dot{animation:gbw-typing 1.4s infinite ease-in-out both}.gbw-typing-dot:nth-child(2){animation-delay:.15s}.gbw-typing-dot:nth-child(3){animation-delay:.3s}.gbw-fixed{position:fixed}.gbw-absolute{position:absolute}.gbw-relative{position:relative}.gbw-inset-0{top:0;right:0;bottom:0;left:0}.gbw-z-\[9999\]{z-index:9999}.gbw-mx-4{margin-left:1rem;margin-right:1rem}.gbw-mb-1\.5{margin-bottom:.375rem}.gbw-mb-2{margin-bottom:.5rem}.gbw-mb-3{margin-bottom:.75rem}.gbw-inline-block{display:inline-block}.gbw-flex{display:flex}.gbw-inline-flex{display:inline-flex}.gbw-grid{display:grid}.gbw-h-1\.5{height:.375rem}.gbw-h-2{height:.5rem}.gbw-h-full{height:100%}.gbw-max-h-60{max-height:15rem}.gbw-w-1\.5{width:.375rem}.gbw-w-2{width:.5rem}.gbw-w-full{width:100%}.gbw-max-w-\[80\%\]{max-width:80%}.gbw-flex-1{flex:1 1 0%}.gbw-shrink-0{flex-shrink:0}.gbw-resize-none{resize:none}.gbw-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.gbw-flex-col{flex-direction:column}.gbw-items-end{align-items:flex-end}.gbw-items-center{align-items:center}.gbw-justify-start{justify-content:flex-start}.gbw-justify-end{justify-content:flex-end}.gbw-justify-between{justify-content:space-between}.gbw-gap-1{gap:.25rem}.gbw-gap-1\.5{gap:.375rem}.gbw-gap-2{gap:.5rem}.gbw-gap-3{gap:.75rem}.gbw-overflow-hidden{overflow:hidden}.gbw-overflow-y-auto{overflow-y:auto}.gbw-rounded-2xl{border-radius:1rem}.gbw-rounded-full{border-radius:9999px}.gbw-rounded-lg{border-radius:.5rem}.gbw-rounded-md{border-radius:.375rem}.gbw-rounded-xl{border-radius:.75rem}.gbw-rounded-bl-sm{border-bottom-left-radius:.125rem}.gbw-rounded-br-sm{border-bottom-right-radius:.125rem}.gbw-border{border-width:1px}.gbw-border-b{border-bottom-width:1px}.gbw-border-t{border-top-width:1px}.gbw-border-gropulse-border{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.gbw-border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.gbw-bg-black\/20{background-color:#0003}.gbw-bg-gropulse-accent{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.gbw-bg-gropulse-bg{--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity, 1))}.gbw-bg-gropulse-muted{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.gbw-bg-gropulse-navy{--tw-bg-opacity: 1;background-color:rgb(15 29 58 / var(--tw-bg-opacity, 1))}.gbw-bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.gbw-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.gbw-p-0{padding:0}.gbw-p-1{padding:.25rem}.gbw-p-3{padding:.75rem}.gbw-px-2{padding-left:.5rem;padding-right:.5rem}.gbw-px-3{padding-left:.75rem;padding-right:.75rem}.gbw-px-3\.5{padding-left:.875rem;padding-right:.875rem}.gbw-px-4{padding-left:1rem;padding-right:1rem}.gbw-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.gbw-py-2{padding-top:.5rem;padding-bottom:.5rem}.gbw-py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.gbw-py-3{padding-top:.75rem;padding-bottom:.75rem}.gbw-text-center{text-align:center}.gbw-text-sm{font-size:.875rem;line-height:1.25rem}.gbw-text-xs{font-size:.75rem;line-height:1rem}.gbw-font-medium{font-weight:500}.gbw-font-semibold{font-weight:600}.gbw-uppercase{text-transform:uppercase}.gbw-tracking-wide{letter-spacing:.025em}.gbw-text-gropulse-muted{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.gbw-text-gropulse-text{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.gbw-text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.gbw-text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.gbw-text-white\/70{color:#ffffffb3}.gbw-
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.gbw-root{font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;color:#0f172a}.gbw-typing-dot{animation:gbw-typing 1.4s infinite ease-in-out both}.gbw-typing-dot:nth-child(2){animation-delay:.15s}.gbw-typing-dot:nth-child(3){animation-delay:.3s}.gbw-fixed{position:fixed}.gbw-absolute{position:absolute}.gbw-relative{position:relative}.gbw-inset-0{top:0;right:0;bottom:0;left:0}.gbw-z-\[9999\]{z-index:9999}.gbw-mx-4{margin-left:1rem;margin-right:1rem}.gbw-mb-1\.5{margin-bottom:.375rem}.gbw-mb-2{margin-bottom:.5rem}.gbw-mb-3{margin-bottom:.75rem}.gbw-mt-0\.5{margin-top:.125rem}.gbw-mt-1{margin-top:.25rem}.gbw-mt-4{margin-top:1rem}.gbw-inline-block{display:inline-block}.gbw-flex{display:flex}.gbw-inline-flex{display:inline-flex}.gbw-grid{display:grid}.gbw-h-1\.5{height:.375rem}.gbw-h-14{height:3.5rem}.gbw-h-2{height:.5rem}.gbw-h-full{height:100%}.gbw-max-h-60{max-height:15rem}.gbw-w-1\.5{width:.375rem}.gbw-w-14{width:3.5rem}.gbw-w-2{width:.5rem}.gbw-w-full{width:100%}.gbw-max-w-\[80\%\]{max-width:80%}.gbw-flex-1{flex:1 1 0%}.gbw-shrink-0{flex-shrink:0}.gbw-cursor-pointer{cursor:pointer}.gbw-resize-none{resize:none}.gbw-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.gbw-flex-col{flex-direction:column}.gbw-items-end{align-items:flex-end}.gbw-items-center{align-items:center}.gbw-justify-start{justify-content:flex-start}.gbw-justify-end{justify-content:flex-end}.gbw-justify-center{justify-content:center}.gbw-justify-between{justify-content:space-between}.gbw-gap-1{gap:.25rem}.gbw-gap-1\.5{gap:.375rem}.gbw-gap-2{gap:.5rem}.gbw-gap-3{gap:.75rem}.gbw-gap-4{gap:1rem}.gbw-overflow-hidden{overflow:hidden}.gbw-overflow-y-auto{overflow-y:auto}.gbw-rounded-2xl{border-radius:1rem}.gbw-rounded-full{border-radius:9999px}.gbw-rounded-lg{border-radius:.5rem}.gbw-rounded-md{border-radius:.375rem}.gbw-rounded-xl{border-radius:.75rem}.gbw-rounded-bl-sm{border-bottom-left-radius:.125rem}.gbw-rounded-br-sm{border-bottom-right-radius:.125rem}.gbw-border{border-width:1px}.gbw-border-0{border-width:0px}.gbw-border-b{border-bottom-width:1px}.gbw-border-t{border-top-width:1px}.gbw-border-gropulse-border{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.gbw-border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.gbw-bg-black\/20{background-color:#0003}.gbw-bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.gbw-bg-gropulse-accent{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.gbw-bg-gropulse-bg{--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity, 1))}.gbw-bg-gropulse-muted{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.gbw-bg-gropulse-navy{--tw-bg-opacity: 1;background-color:rgb(15 29 58 / var(--tw-bg-opacity, 1))}.gbw-bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.gbw-bg-transparent{background-color:transparent}.gbw-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.gbw-p-0{padding:0}.gbw-p-1{padding:.25rem}.gbw-p-3{padding:.75rem}.gbw-p-6{padding:1.5rem}.gbw-px-2{padding-left:.5rem;padding-right:.5rem}.gbw-px-3{padding-left:.75rem;padding-right:.75rem}.gbw-px-3\.5{padding-left:.875rem;padding-right:.875rem}.gbw-px-4{padding-left:1rem;padding-right:1rem}.gbw-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.gbw-py-2{padding-top:.5rem;padding-bottom:.5rem}.gbw-py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.gbw-py-3{padding-top:.75rem;padding-bottom:.75rem}.gbw-text-center{text-align:center}.gbw-text-base{font-size:1rem;line-height:1.5rem}.gbw-text-sm{font-size:.875rem;line-height:1.25rem}.gbw-text-xs{font-size:.75rem;line-height:1rem}.gbw-font-medium{font-weight:500}.gbw-font-semibold{font-weight:600}.gbw-uppercase{text-transform:uppercase}.gbw-tracking-wide{letter-spacing:.025em}.gbw-text-gropulse-muted{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.gbw-text-gropulse-text{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.gbw-text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.gbw-text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.gbw-text-white\/70{color:#ffffffb3}.gbw-shadow-panel{--tw-shadow: 0 20px 60px -10px rgba(15, 29, 58, .25);--tw-shadow-colored: 0 20px 60px -10px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.gbw-shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.gbw-outline-none{outline:2px solid transparent;outline-offset:2px}.gbw-transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.gbw-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@keyframes gbw-typing{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}.hover\:gbw-border-gropulse-accent:hover{--tw-border-opacity: 1;border-color:rgb(16 185 129 / var(--tw-border-opacity, 1))}.hover\:gbw-border-gropulse-navy:hover{--tw-border-opacity: 1;border-color:rgb(15 29 58 / var(--tw-border-opacity, 1))}.hover\:gbw-bg-gropulse-navy:hover{--tw-bg-opacity: 1;background-color:rgb(15 29 58 / var(--tw-bg-opacity, 1))}.hover\:gbw-bg-gropulse-navyHover:hover{--tw-bg-opacity: 1;background-color:rgb(20 42 82 / var(--tw-bg-opacity, 1))}.hover\:gbw-bg-white\/15:hover{background-color:#ffffff26}.hover\:gbw-text-gropulse-accent:hover{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.hover\:gbw-text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:gbw-border-gropulse-navy:focus{--tw-border-opacity: 1;border-color:rgb(15 29 58 / var(--tw-border-opacity, 1))}.focus\:gbw-ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:gbw-ring-gropulse-navy\/10:focus{--tw-ring-color: rgb(15 29 58 / .1)}.active\:gbw-scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:gbw-bg-gropulse-bg:disabled{--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity, 1))}.disabled\:gbw-text-gropulse-muted:disabled{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.disabled\:gbw-opacity-40:disabled{opacity:.4}@media (min-width: 640px){.sm\:gbw-h-\[620px\]{height:620px}.sm\:gbw-w-\[400px\]{width:400px}.sm\:gbw-rounded-2xl{border-radius:1rem}.sm\:gbw-p-4{padding:1rem}}
|
package/package.json
CHANGED