@maebgch/rcs-emulator 0.1.6 → 0.1.7
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/rcs-emulator.cjs.js +132 -132
- package/dist/rcs-emulator.cjs.js.map +1 -1
- package/dist/rcs-emulator.es.js +2189 -1781
- package/dist/rcs-emulator.es.js.map +1 -1
- package/package.json +1 -1
package/dist/rcs-emulator.es.js
CHANGED
|
@@ -1,128 +1,111 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return "reply" in c;
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as te, useContext as ne, useReducer as re, useRef as W, useEffect as S, useCallback as M, useState as z, memo as g, useMemo as V } from "react";
|
|
3
|
+
function q(r) {
|
|
4
|
+
return "reply" in r;
|
|
6
5
|
}
|
|
7
|
-
function
|
|
8
|
-
return "action" in
|
|
6
|
+
function $(r) {
|
|
7
|
+
return "action" in r;
|
|
9
8
|
}
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
const {
|
|
13
|
-
urlAction: t
|
|
14
|
-
} = c.action;
|
|
9
|
+
function Je(r) {
|
|
10
|
+
if (!$(r)) return !1;
|
|
11
|
+
const { urlAction: t } = r.action;
|
|
15
12
|
return t?.openUrl?.application === "WEBVIEW";
|
|
16
13
|
}
|
|
17
|
-
function
|
|
18
|
-
const {
|
|
19
|
-
urlAction: t
|
|
20
|
-
} = c.action;
|
|
14
|
+
function oe(r) {
|
|
15
|
+
const { urlAction: t } = r.action;
|
|
21
16
|
return t?.openUrl?.application === "WEBVIEW" ? t.openUrl : null;
|
|
22
17
|
}
|
|
23
|
-
const
|
|
18
|
+
const se = {
|
|
24
19
|
name: "Business",
|
|
25
20
|
verified: !1
|
|
26
|
-
},
|
|
21
|
+
}, ie = {
|
|
27
22
|
currentMessageId: null,
|
|
28
23
|
chatHistory: [],
|
|
29
24
|
isTyping: !1,
|
|
30
25
|
error: null
|
|
31
|
-
},
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
...
|
|
51
|
-
...
|
|
52
|
-
|
|
53
|
-
let b;
|
|
54
|
-
t[2] !== g ? (b = {
|
|
55
|
-
...je,
|
|
56
|
-
...g
|
|
57
|
-
}, t[2] = g, t[3] = b) : b = t[3];
|
|
58
|
-
let y;
|
|
59
|
-
t[4] !== m || t[5] !== l || t[6] !== i || t[7] !== h || t[8] !== f || t[9] !== u || t[10] !== r || t[11] !== p || t[12] !== b || t[13] !== s || t[14] !== a || t[15] !== d ? (y = {
|
|
60
|
-
theme: s,
|
|
61
|
-
device: l,
|
|
62
|
-
businessInfo: p,
|
|
63
|
-
state: b,
|
|
64
|
-
showSuggestions: r,
|
|
26
|
+
}, Q = te(null);
|
|
27
|
+
function X({
|
|
28
|
+
children: r,
|
|
29
|
+
theme: t,
|
|
30
|
+
device: n,
|
|
31
|
+
businessInfo: o,
|
|
32
|
+
state: s,
|
|
33
|
+
showSuggestions: a,
|
|
34
|
+
isProfileOpen: i,
|
|
35
|
+
toggleProfile: u,
|
|
36
|
+
onReply: c,
|
|
37
|
+
onAction: d,
|
|
38
|
+
webView: m,
|
|
39
|
+
openWebView: f,
|
|
40
|
+
closeWebView: v
|
|
41
|
+
}) {
|
|
42
|
+
const x = {
|
|
43
|
+
theme: t,
|
|
44
|
+
device: n,
|
|
45
|
+
businessInfo: { ...se, ...o },
|
|
46
|
+
state: { ...ie, ...s },
|
|
47
|
+
showSuggestions: a,
|
|
65
48
|
isProfileOpen: i,
|
|
66
|
-
toggleProfile:
|
|
67
|
-
handleReply:
|
|
68
|
-
handleAction:
|
|
69
|
-
webView:
|
|
70
|
-
openWebView:
|
|
71
|
-
closeWebView:
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let x;
|
|
75
|
-
return t[17] !== e || t[18] !== w ? (x = /* @__PURE__ */ n(Ce.Provider, { value: w, children: e }), t[17] = e, t[18] = w, t[19] = x) : x = t[19], x;
|
|
49
|
+
toggleProfile: u,
|
|
50
|
+
handleReply: c,
|
|
51
|
+
handleAction: d,
|
|
52
|
+
webView: m,
|
|
53
|
+
openWebView: f,
|
|
54
|
+
closeWebView: v
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ e(Q.Provider, { value: x, children: r });
|
|
76
57
|
}
|
|
77
|
-
function
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
58
|
+
function N() {
|
|
59
|
+
const r = ne(Q);
|
|
60
|
+
if (!r)
|
|
80
61
|
throw new Error("useEmulator must be used within an EmulatorProvider");
|
|
81
|
-
return
|
|
62
|
+
return r;
|
|
82
63
|
}
|
|
83
|
-
function
|
|
84
|
-
const t = Object.values(
|
|
85
|
-
return t.find((
|
|
64
|
+
function Z(r) {
|
|
65
|
+
const t = Object.values(r.messages);
|
|
66
|
+
return t.find((n) => n.is_first) || t[0] || null;
|
|
86
67
|
}
|
|
87
|
-
function
|
|
88
|
-
return
|
|
68
|
+
function R(r, t) {
|
|
69
|
+
return r.messages[t] || null;
|
|
89
70
|
}
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
return
|
|
71
|
+
function O(r, t) {
|
|
72
|
+
const n = r.responses?.keyword?.keyword_response?.choices;
|
|
73
|
+
return n && n[t]?.next_message || null;
|
|
93
74
|
}
|
|
94
|
-
function
|
|
95
|
-
const
|
|
75
|
+
function H(r, t) {
|
|
76
|
+
const n = r.parts, o = ae(n), s = ce(n);
|
|
96
77
|
return {
|
|
97
|
-
id: `${
|
|
78
|
+
id: `${r.id}-${t}-${Date.now()}`,
|
|
98
79
|
sender: "business",
|
|
99
|
-
content:
|
|
80
|
+
content: o,
|
|
100
81
|
timestamp: Date.now(),
|
|
101
|
-
suggestions:
|
|
82
|
+
suggestions: s
|
|
102
83
|
};
|
|
103
84
|
}
|
|
104
|
-
function
|
|
105
|
-
for (const t of
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
85
|
+
function ae(r) {
|
|
86
|
+
for (const t of r) {
|
|
87
|
+
const n = t.RCSMessage;
|
|
88
|
+
if (n.textMessage)
|
|
108
89
|
return {
|
|
109
90
|
type: "text",
|
|
110
|
-
text:
|
|
91
|
+
text: n.textMessage
|
|
111
92
|
};
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
93
|
+
const o = n.richcardMessage?.message?.generalPurposeCard;
|
|
94
|
+
if (o)
|
|
114
95
|
return {
|
|
115
96
|
type: "richcard",
|
|
116
|
-
card:
|
|
97
|
+
card: P(o.content, o.layout)
|
|
117
98
|
};
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
99
|
+
const s = n.richcardMessage?.message?.generalPurposeCardCarousel;
|
|
100
|
+
if (s)
|
|
120
101
|
return {
|
|
121
102
|
type: "carousel",
|
|
122
|
-
cards:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
103
|
+
cards: s.content.map(
|
|
104
|
+
(a) => P(a, {
|
|
105
|
+
cardOrientation: "VERTICAL",
|
|
106
|
+
cardWidth: s.layout.cardWidth
|
|
107
|
+
})
|
|
108
|
+
)
|
|
126
109
|
};
|
|
127
110
|
}
|
|
128
111
|
return {
|
|
@@ -130,27 +113,27 @@ function Re(c) {
|
|
|
130
113
|
text: "[Unsupported message type]"
|
|
131
114
|
};
|
|
132
115
|
}
|
|
133
|
-
function
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
137
|
-
if (
|
|
116
|
+
function P(r, t) {
|
|
117
|
+
const n = () => {
|
|
118
|
+
if (r.media) {
|
|
119
|
+
if (r.media.mediaUrl) return r.media.mediaUrl;
|
|
120
|
+
if (r.media.contentInfo?.fileUrl) return r.media.contentInfo.fileUrl;
|
|
138
121
|
}
|
|
139
|
-
},
|
|
140
|
-
if (
|
|
141
|
-
if (
|
|
142
|
-
if (
|
|
122
|
+
}, o = () => {
|
|
123
|
+
if (r.media) {
|
|
124
|
+
if (r.media.thumbnailUri) return r.media.thumbnailUri;
|
|
125
|
+
if (r.media.contentInfo?.thumbnailUrl) return r.media.contentInfo.thumbnailUrl;
|
|
143
126
|
}
|
|
144
|
-
},
|
|
127
|
+
}, s = n();
|
|
145
128
|
return {
|
|
146
|
-
title:
|
|
147
|
-
description:
|
|
148
|
-
media:
|
|
149
|
-
url:
|
|
150
|
-
height:
|
|
151
|
-
thumbnailUrl:
|
|
129
|
+
title: r.title,
|
|
130
|
+
description: r.description,
|
|
131
|
+
media: s ? {
|
|
132
|
+
url: s,
|
|
133
|
+
height: le(r.media?.height || "MEDIUM_HEIGHT"),
|
|
134
|
+
thumbnailUrl: o()
|
|
152
135
|
} : void 0,
|
|
153
|
-
suggestions:
|
|
136
|
+
suggestions: r.suggestions,
|
|
154
137
|
layout: {
|
|
155
138
|
orientation: t.cardOrientation === "HORIZONTAL" ? "horizontal" : "vertical",
|
|
156
139
|
width: t.cardWidth === "SMALL_WIDTH" ? "small" : "medium",
|
|
@@ -158,8 +141,8 @@ function xe(c, t) {
|
|
|
158
141
|
}
|
|
159
142
|
};
|
|
160
143
|
}
|
|
161
|
-
function
|
|
162
|
-
switch (
|
|
144
|
+
function le(r) {
|
|
145
|
+
switch (r) {
|
|
163
146
|
case "SHORT_HEIGHT":
|
|
164
147
|
return "short";
|
|
165
148
|
case "TALL_HEIGHT":
|
|
@@ -168,1886 +151,2311 @@ function Ee(c) {
|
|
|
168
151
|
return "medium";
|
|
169
152
|
}
|
|
170
153
|
}
|
|
171
|
-
function
|
|
154
|
+
function ce(r) {
|
|
172
155
|
const t = [];
|
|
173
|
-
for (const
|
|
174
|
-
const
|
|
175
|
-
|
|
156
|
+
for (const n of r) {
|
|
157
|
+
const o = n.RCSMessage;
|
|
158
|
+
o.suggestedChipList?.suggestions && t.push(...o.suggestedChipList.suggestions);
|
|
176
159
|
}
|
|
177
160
|
return t;
|
|
178
161
|
}
|
|
179
|
-
function
|
|
162
|
+
function de(r) {
|
|
180
163
|
return {
|
|
181
164
|
id: `user-${Date.now()}`,
|
|
182
165
|
sender: "user",
|
|
183
166
|
content: {
|
|
184
167
|
type: "userReply",
|
|
185
|
-
text:
|
|
168
|
+
text: r
|
|
186
169
|
},
|
|
187
170
|
timestamp: Date.now()
|
|
188
171
|
};
|
|
189
172
|
}
|
|
190
|
-
function
|
|
191
|
-
if (!
|
|
192
|
-
const t =
|
|
173
|
+
function ue(r) {
|
|
174
|
+
if (!r || typeof r != "object") return !1;
|
|
175
|
+
const t = r;
|
|
193
176
|
if (typeof t.name != "string" || !t.messages || typeof t.messages != "object") return !1;
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
for (const
|
|
197
|
-
if (!
|
|
198
|
-
const
|
|
199
|
-
if (typeof
|
|
177
|
+
const n = Object.values(t.messages);
|
|
178
|
+
if (n.length === 0) return !1;
|
|
179
|
+
for (const o of n) {
|
|
180
|
+
if (!o || typeof o != "object") return !1;
|
|
181
|
+
const s = o;
|
|
182
|
+
if (typeof s.id != "string" || !Array.isArray(s.parts)) return !1;
|
|
200
183
|
}
|
|
201
184
|
return !0;
|
|
202
185
|
}
|
|
203
|
-
function
|
|
204
|
-
const t =
|
|
186
|
+
function he(r) {
|
|
187
|
+
const t = Z(r);
|
|
205
188
|
if (!t || !t.parts.length) return "New message";
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
208
|
-
return
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
return
|
|
212
|
-
const
|
|
213
|
-
return
|
|
189
|
+
const o = t.parts[0].RCSMessage;
|
|
190
|
+
if (o.textMessage)
|
|
191
|
+
return o.textMessage.slice(0, 50) + (o.textMessage.length > 50 ? "..." : "");
|
|
192
|
+
const s = o.richcardMessage?.message?.generalPurposeCard;
|
|
193
|
+
if (s?.content.title)
|
|
194
|
+
return s.content.title;
|
|
195
|
+
const a = o.richcardMessage?.message?.generalPurposeCardCarousel;
|
|
196
|
+
return a?.content[0]?.title ? a.content[0].title : "New message";
|
|
214
197
|
}
|
|
215
|
-
const
|
|
198
|
+
const K = {
|
|
216
199
|
currentMessageId: null,
|
|
217
200
|
chatHistory: [],
|
|
218
201
|
isTyping: !1,
|
|
219
202
|
error: null
|
|
220
203
|
};
|
|
221
|
-
function
|
|
204
|
+
function me(r, t) {
|
|
222
205
|
switch (t.type) {
|
|
223
206
|
case "INIT":
|
|
224
207
|
return {
|
|
225
|
-
...
|
|
208
|
+
...r,
|
|
226
209
|
currentMessageId: t.messageId,
|
|
227
210
|
error: null
|
|
228
211
|
};
|
|
229
212
|
case "ADD_BUSINESS_MESSAGE":
|
|
230
213
|
return {
|
|
231
|
-
...
|
|
232
|
-
chatHistory: [...
|
|
214
|
+
...r,
|
|
215
|
+
chatHistory: [...r.chatHistory, t.message],
|
|
233
216
|
isTyping: !1
|
|
234
217
|
};
|
|
235
218
|
case "ADD_USER_REPLY": {
|
|
236
|
-
const
|
|
237
|
-
...
|
|
238
|
-
|
|
239
|
-
} : l);
|
|
219
|
+
const n = de(t.text), o = r.chatHistory.map(
|
|
220
|
+
(s, a) => a === r.chatHistory.length - 1 ? { ...s, suggestions: void 0 } : s
|
|
221
|
+
);
|
|
240
222
|
return {
|
|
241
|
-
...
|
|
242
|
-
chatHistory: [...
|
|
223
|
+
...r,
|
|
224
|
+
chatHistory: [...o, n]
|
|
243
225
|
};
|
|
244
226
|
}
|
|
245
227
|
case "SET_TYPING":
|
|
246
228
|
return {
|
|
247
|
-
...
|
|
229
|
+
...r,
|
|
248
230
|
isTyping: t.isTyping
|
|
249
231
|
};
|
|
250
232
|
case "NAVIGATE_TO":
|
|
251
233
|
return {
|
|
252
|
-
...
|
|
234
|
+
...r,
|
|
253
235
|
currentMessageId: t.messageId
|
|
254
236
|
};
|
|
255
237
|
case "SET_ERROR":
|
|
256
238
|
return {
|
|
257
|
-
...
|
|
239
|
+
...r,
|
|
258
240
|
error: t.error,
|
|
259
241
|
isTyping: !1
|
|
260
242
|
};
|
|
261
243
|
case "RESET":
|
|
262
|
-
return
|
|
244
|
+
return K;
|
|
263
245
|
default:
|
|
264
|
-
return
|
|
246
|
+
return r;
|
|
265
247
|
}
|
|
266
248
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (!x) {
|
|
280
|
-
r({
|
|
249
|
+
function fe({
|
|
250
|
+
flow: r,
|
|
251
|
+
onUserReply: t,
|
|
252
|
+
typingDelay: n = 800
|
|
253
|
+
}) {
|
|
254
|
+
const [o, s] = re(me, K), a = W(0), i = W(!1);
|
|
255
|
+
S(() => {
|
|
256
|
+
if (i.current) return;
|
|
257
|
+
i.current = !0;
|
|
258
|
+
const m = Z(r);
|
|
259
|
+
if (!m) {
|
|
260
|
+
s({
|
|
281
261
|
type: "SET_ERROR",
|
|
282
262
|
error: "No first message found in conversation flow"
|
|
283
263
|
});
|
|
284
264
|
return;
|
|
285
265
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
})
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
266
|
+
s({ type: "INIT", messageId: m.id });
|
|
267
|
+
const f = H(
|
|
268
|
+
m,
|
|
269
|
+
a.current++
|
|
270
|
+
);
|
|
271
|
+
s({ type: "ADD_BUSINESS_MESSAGE", message: f });
|
|
272
|
+
}, [r]);
|
|
273
|
+
const u = M(
|
|
274
|
+
(m) => {
|
|
275
|
+
if (!q(m)) return;
|
|
276
|
+
const { displayText: f, postback: v } = m.reply, x = v.data;
|
|
277
|
+
s({ type: "ADD_USER_REPLY", text: f, postbackData: x });
|
|
278
|
+
const L = {
|
|
279
|
+
type: "reply",
|
|
280
|
+
postbackData: x,
|
|
281
|
+
displayText: f,
|
|
282
|
+
timestamp: Date.now()
|
|
283
|
+
};
|
|
284
|
+
t(L);
|
|
285
|
+
const b = o.currentMessageId ? R(r, o.currentMessageId) : null;
|
|
286
|
+
if (!b) {
|
|
287
|
+
s({ type: "SET_ERROR", error: "Current message not found" });
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const p = O(b, x);
|
|
291
|
+
if (!p)
|
|
292
|
+
return;
|
|
293
|
+
const y = R(r, p);
|
|
294
|
+
if (!y) {
|
|
295
|
+
s({
|
|
296
|
+
type: "SET_ERROR",
|
|
297
|
+
error: `Next message "${p}" not found`
|
|
298
|
+
});
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
s({ type: "SET_TYPING", isTyping: !0 }), s({ type: "NAVIGATE_TO", messageId: p }), setTimeout(() => {
|
|
302
|
+
const h = H(
|
|
303
|
+
y,
|
|
304
|
+
a.current++
|
|
305
|
+
);
|
|
306
|
+
s({ type: "ADD_BUSINESS_MESSAGE", message: h });
|
|
307
|
+
}, n);
|
|
308
|
+
},
|
|
309
|
+
[r, o.currentMessageId, t, n]
|
|
310
|
+
), c = M(
|
|
311
|
+
(m) => {
|
|
312
|
+
if (!$(m)) return;
|
|
313
|
+
const {
|
|
314
|
+
displayText: f,
|
|
315
|
+
postback: v,
|
|
316
|
+
openUrlAction: x,
|
|
317
|
+
dialAction: L,
|
|
318
|
+
dialerAction: b,
|
|
319
|
+
mapAction: p,
|
|
320
|
+
viewLocationAction: y
|
|
321
|
+
} = m.action, h = v.data, w = L?.phoneNumber || b?.dialPhoneNumber?.phoneNumber, C = p?.showLocation?.location || y?.latLong;
|
|
322
|
+
let I;
|
|
323
|
+
x ? I = { type: "openUrl", url: x.url } : w ? I = { type: "dial", phoneNumber: w } : C && (I = {
|
|
324
|
+
type: "viewLocation",
|
|
325
|
+
latitude: C.latitude,
|
|
326
|
+
longitude: C.longitude,
|
|
327
|
+
query: y?.query
|
|
347
328
|
});
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
viewLocationAction: A
|
|
363
|
-
} = x.action, z = v.data, $ = L?.phoneNumber || M?.dialPhoneNumber?.phoneNumber, S = _?.showLocation?.location || A?.latLong;
|
|
364
|
-
let I;
|
|
365
|
-
N ? I = {
|
|
366
|
-
type: "openUrl",
|
|
367
|
-
url: N.url
|
|
368
|
-
} : $ ? I = {
|
|
369
|
-
type: "dial",
|
|
370
|
-
phoneNumber: $
|
|
371
|
-
} : S && (I = {
|
|
372
|
-
type: "viewLocation",
|
|
373
|
-
latitude: S.latitude,
|
|
374
|
-
longitude: S.longitude,
|
|
375
|
-
query: A?.query
|
|
376
|
-
});
|
|
377
|
-
const T = {
|
|
378
|
-
type: "action",
|
|
379
|
-
postbackData: z,
|
|
380
|
-
displayText: k,
|
|
381
|
-
timestamp: Date.now(),
|
|
382
|
-
actionData: I
|
|
383
|
-
};
|
|
384
|
-
if (s(T), N)
|
|
385
|
-
window.open(N.url, "_blank", "noopener,noreferrer");
|
|
386
|
-
else if ($)
|
|
387
|
-
window.location.href = `tel:${$}`;
|
|
388
|
-
else if (S) {
|
|
389
|
-
const j = _?.showLocation?.location?.label || A?.label || "", O = `https://www.google.com/maps/search/?api=1&query=${S.latitude},${S.longitude}${j ? `&query_place_id=${encodeURIComponent(j)}` : ""}`;
|
|
390
|
-
window.open(O, "_blank", "noopener,noreferrer");
|
|
391
|
-
}
|
|
392
|
-
const D = g.currentMessageId ? fe(e, g.currentMessageId) : null;
|
|
393
|
-
if (D) {
|
|
394
|
-
const j = be(D, z);
|
|
395
|
-
if (j) {
|
|
396
|
-
const O = fe(e, j);
|
|
397
|
-
O && (r({
|
|
398
|
-
type: "ADD_USER_REPLY",
|
|
399
|
-
text: k,
|
|
400
|
-
postbackData: z
|
|
401
|
-
}), r({
|
|
402
|
-
type: "SET_TYPING",
|
|
403
|
-
isTyping: !0
|
|
404
|
-
}), r({
|
|
405
|
-
type: "NAVIGATE_TO",
|
|
406
|
-
messageId: j
|
|
407
|
-
}), setTimeout(() => {
|
|
408
|
-
i.current = i.current + 1;
|
|
409
|
-
const J = ue(O, i.current);
|
|
410
|
-
r({
|
|
411
|
-
type: "ADD_BUSINESS_MESSAGE",
|
|
412
|
-
message: J
|
|
413
|
-
});
|
|
414
|
-
}, o));
|
|
329
|
+
const k = {
|
|
330
|
+
type: "action",
|
|
331
|
+
postbackData: h,
|
|
332
|
+
displayText: f,
|
|
333
|
+
timestamp: Date.now(),
|
|
334
|
+
actionData: I
|
|
335
|
+
};
|
|
336
|
+
if (t(k), x)
|
|
337
|
+
window.open(x.url, "_blank", "noopener,noreferrer");
|
|
338
|
+
else if (w)
|
|
339
|
+
window.location.href = `tel:${w}`;
|
|
340
|
+
else if (C) {
|
|
341
|
+
const T = p?.showLocation?.location?.label || y?.label || "", B = `https://www.google.com/maps/search/?api=1&query=${C.latitude},${C.longitude}${T ? `&query_place_id=${encodeURIComponent(T)}` : ""}`;
|
|
342
|
+
window.open(B, "_blank", "noopener,noreferrer");
|
|
415
343
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
344
|
+
const A = o.currentMessageId ? R(r, o.currentMessageId) : null;
|
|
345
|
+
if (A) {
|
|
346
|
+
const T = O(A, h);
|
|
347
|
+
if (T) {
|
|
348
|
+
const B = R(r, T);
|
|
349
|
+
B && (s({
|
|
350
|
+
type: "ADD_USER_REPLY",
|
|
351
|
+
text: f,
|
|
352
|
+
postbackData: h
|
|
353
|
+
}), s({ type: "SET_TYPING", isTyping: !0 }), s({ type: "NAVIGATE_TO", messageId: T }), setTimeout(() => {
|
|
354
|
+
const ee = H(
|
|
355
|
+
B,
|
|
356
|
+
a.current++
|
|
357
|
+
);
|
|
358
|
+
s({ type: "ADD_BUSINESS_MESSAGE", message: ee });
|
|
359
|
+
}, n));
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
[r, o.currentMessageId, t, n]
|
|
364
|
+
), d = M(() => {
|
|
365
|
+
i.current = !1, a.current = 0, s({ type: "RESET" });
|
|
366
|
+
}, []);
|
|
367
|
+
return {
|
|
368
|
+
state: o,
|
|
429
369
|
handleReply: u,
|
|
430
|
-
handleAction:
|
|
431
|
-
reset:
|
|
432
|
-
}
|
|
370
|
+
handleAction: c,
|
|
371
|
+
reset: d
|
|
372
|
+
};
|
|
433
373
|
}
|
|
434
|
-
function
|
|
435
|
-
const [t,
|
|
436
|
-
if (!
|
|
437
|
-
|
|
374
|
+
function ge(r) {
|
|
375
|
+
const [t, n] = z(null), [o, s] = z(!1), [a, i] = z(null), u = M(async () => {
|
|
376
|
+
if (!r) {
|
|
377
|
+
n(null), i(null);
|
|
438
378
|
return;
|
|
439
379
|
}
|
|
440
|
-
|
|
380
|
+
s(!0), i(null);
|
|
441
381
|
try {
|
|
442
|
-
const
|
|
382
|
+
const c = await fetch(r, {
|
|
443
383
|
method: "GET",
|
|
444
384
|
headers: {
|
|
445
385
|
Accept: "application/json"
|
|
446
386
|
}
|
|
447
387
|
});
|
|
448
|
-
if (!
|
|
449
|
-
throw new Error(`HTTP ${
|
|
450
|
-
const
|
|
451
|
-
if (!
|
|
388
|
+
if (!c.ok)
|
|
389
|
+
throw new Error(`HTTP ${c.status}: ${c.statusText}`);
|
|
390
|
+
const d = await c.json();
|
|
391
|
+
if (!d || typeof d != "object")
|
|
452
392
|
throw new Error("Invalid JSON: Expected an object");
|
|
453
|
-
if (!
|
|
393
|
+
if (!d.messages || typeof d.messages != "object")
|
|
454
394
|
throw new Error("Invalid RBM JSON: Missing 'messages' object");
|
|
455
|
-
|
|
456
|
-
} catch (
|
|
457
|
-
const
|
|
458
|
-
|
|
395
|
+
n(d);
|
|
396
|
+
} catch (c) {
|
|
397
|
+
const d = c instanceof Error ? c.message : "Failed to fetch JSON";
|
|
398
|
+
i(d), n(null);
|
|
459
399
|
} finally {
|
|
460
|
-
|
|
400
|
+
s(!1);
|
|
461
401
|
}
|
|
462
|
-
}, [
|
|
463
|
-
return
|
|
464
|
-
|
|
465
|
-
}, [
|
|
402
|
+
}, [r]);
|
|
403
|
+
return S(() => {
|
|
404
|
+
u();
|
|
405
|
+
}, [u]), {
|
|
466
406
|
data: t,
|
|
467
|
-
isLoading:
|
|
468
|
-
error:
|
|
469
|
-
refetch:
|
|
407
|
+
isLoading: o,
|
|
408
|
+
error: a,
|
|
409
|
+
refetch: u
|
|
470
410
|
};
|
|
471
411
|
}
|
|
472
|
-
function
|
|
473
|
-
const t =
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
top: e.current.scrollHeight,
|
|
412
|
+
function pe(r) {
|
|
413
|
+
const t = W(null);
|
|
414
|
+
return S(() => {
|
|
415
|
+
t.current && t.current.scrollTo({
|
|
416
|
+
top: t.current.scrollHeight,
|
|
478
417
|
behavior: "smooth"
|
|
479
418
|
});
|
|
480
|
-
},
|
|
481
|
-
let l;
|
|
482
|
-
return t[1] !== c ? (l = [c], t[1] = c, t[2] = l) : l = t[2], oe(s, l), e;
|
|
419
|
+
}, [r]), t;
|
|
483
420
|
}
|
|
484
|
-
const
|
|
485
|
-
const t =
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
421
|
+
const xe = g(function() {
|
|
422
|
+
const { theme: t, businessInfo: n, toggleProfile: o } = N(), s = t === "dark", a = n.brandColor || "#0084ff";
|
|
423
|
+
return /* @__PURE__ */ l(
|
|
424
|
+
"header",
|
|
425
|
+
{
|
|
426
|
+
className: `
|
|
490
427
|
flex items-center gap-3 px-3 py-2.5 border-b
|
|
491
|
-
${
|
|
492
|
-
`,
|
|
428
|
+
${s ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-100"}
|
|
429
|
+
`,
|
|
430
|
+
role: "banner",
|
|
431
|
+
"aria-label": `Chat with ${n.name}`,
|
|
432
|
+
children: [
|
|
433
|
+
/* @__PURE__ */ e(
|
|
434
|
+
"button",
|
|
435
|
+
{
|
|
436
|
+
type: "button",
|
|
437
|
+
className: `
|
|
493
438
|
p-1.5 -ml-1 rounded-full transition-colors
|
|
494
|
-
${
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
439
|
+
${s ? "hover:bg-zinc-800 text-white" : "hover:bg-gray-100 text-gray-700"}
|
|
440
|
+
`,
|
|
441
|
+
"aria-label": "Go back",
|
|
442
|
+
children: /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
443
|
+
}
|
|
444
|
+
),
|
|
445
|
+
/* @__PURE__ */ l(
|
|
446
|
+
"button",
|
|
447
|
+
{
|
|
448
|
+
onClick: o,
|
|
449
|
+
className: "flex items-center gap-2.5 flex-1 min-w-0 text-left",
|
|
450
|
+
"aria-label": "View business info",
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ e(
|
|
453
|
+
"div",
|
|
454
|
+
{
|
|
455
|
+
className: `
|
|
501
456
|
relative w-9 h-9 rounded-full overflow-hidden flex-shrink-0
|
|
502
|
-
${
|
|
503
|
-
`,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
457
|
+
${s ? "bg-zinc-800" : "bg-gray-100"}
|
|
458
|
+
`,
|
|
459
|
+
style: {
|
|
460
|
+
backgroundColor: n.logo ? void 0 : a
|
|
461
|
+
},
|
|
462
|
+
children: n.logo ? /* @__PURE__ */ e(
|
|
463
|
+
"img",
|
|
464
|
+
{
|
|
465
|
+
src: n.logo,
|
|
466
|
+
alt: `${n.name} logo`,
|
|
467
|
+
className: "w-full h-full object-cover"
|
|
468
|
+
}
|
|
469
|
+
) : /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center text-sm font-bold text-white", children: n.name.charAt(0).toUpperCase() })
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
/* @__PURE__ */ e(
|
|
473
|
+
"h1",
|
|
474
|
+
{
|
|
475
|
+
className: `
|
|
513
476
|
text-base font-medium truncate
|
|
514
|
-
${
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
477
|
+
${s ? "text-white" : "text-gray-900"}
|
|
478
|
+
`,
|
|
479
|
+
children: n.name
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
]
|
|
483
|
+
}
|
|
484
|
+
),
|
|
485
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", children: [
|
|
486
|
+
n.verified && /* @__PURE__ */ e(
|
|
487
|
+
"button",
|
|
488
|
+
{
|
|
489
|
+
type: "button",
|
|
490
|
+
className: `
|
|
525
491
|
p-2 rounded-full transition-colors
|
|
526
|
-
${
|
|
527
|
-
`,
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
492
|
+
${s ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
|
|
493
|
+
`,
|
|
494
|
+
"aria-label": "Verified business",
|
|
495
|
+
children: /* @__PURE__ */ l("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", children: [
|
|
496
|
+
/* @__PURE__ */ e(
|
|
497
|
+
"path",
|
|
498
|
+
{
|
|
499
|
+
d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",
|
|
500
|
+
stroke: s ? "#9ca3af" : "#6b7280",
|
|
501
|
+
strokeWidth: 2,
|
|
502
|
+
strokeLinecap: "round",
|
|
503
|
+
strokeLinejoin: "round"
|
|
504
|
+
}
|
|
505
|
+
),
|
|
506
|
+
/* @__PURE__ */ e(
|
|
507
|
+
"path",
|
|
508
|
+
{
|
|
509
|
+
d: "M9 12l2 2 4-4",
|
|
510
|
+
stroke: "#3b82f6",
|
|
511
|
+
strokeWidth: 2,
|
|
512
|
+
strokeLinecap: "round",
|
|
513
|
+
strokeLinejoin: "round"
|
|
514
|
+
}
|
|
515
|
+
)
|
|
516
|
+
] })
|
|
517
|
+
}
|
|
518
|
+
),
|
|
519
|
+
/* @__PURE__ */ e(
|
|
520
|
+
"button",
|
|
521
|
+
{
|
|
522
|
+
type: "button",
|
|
523
|
+
className: `
|
|
532
524
|
p-2 rounded-full transition-colors
|
|
533
|
-
${
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
return
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
const t = B(24), {
|
|
552
|
-
theme: e,
|
|
553
|
-
businessInfo: s
|
|
554
|
-
} = K(), l = e === "dark", o = s.brandColor || "#0084ff", g = `
|
|
525
|
+
${s ? "hover:bg-zinc-800 text-zinc-400" : "hover:bg-gray-100 text-gray-500"}
|
|
526
|
+
`,
|
|
527
|
+
"aria-label": "More options",
|
|
528
|
+
children: /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" }) })
|
|
529
|
+
}
|
|
530
|
+
)
|
|
531
|
+
] })
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
);
|
|
535
|
+
}), be = g(function() {
|
|
536
|
+
const { theme: t, businessInfo: n } = N(), o = t === "dark", s = n.brandColor || "#0084ff";
|
|
537
|
+
return /* @__PURE__ */ l("div", { className: "flex flex-col items-center py-4 px-4", children: [
|
|
538
|
+
/* @__PURE__ */ l("div", { className: "relative mb-3", children: [
|
|
539
|
+
/* @__PURE__ */ e(
|
|
540
|
+
"div",
|
|
541
|
+
{
|
|
542
|
+
className: `
|
|
555
543
|
w-16 h-16 rounded-full overflow-hidden
|
|
556
|
-
${
|
|
544
|
+
${o ? "bg-zinc-800" : "bg-gray-100"}
|
|
557
545
|
shadow-lg
|
|
558
|
-
`,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
546
|
+
`,
|
|
547
|
+
style: {
|
|
548
|
+
backgroundColor: n.logo ? void 0 : s
|
|
549
|
+
},
|
|
550
|
+
children: n.logo ? /* @__PURE__ */ e(
|
|
551
|
+
"img",
|
|
552
|
+
{
|
|
553
|
+
src: n.logo,
|
|
554
|
+
alt: `${n.name} logo`,
|
|
555
|
+
className: "w-full h-full object-cover"
|
|
556
|
+
}
|
|
557
|
+
) : /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center text-2xl font-bold text-white", children: n.name.charAt(0).toUpperCase() })
|
|
558
|
+
}
|
|
559
|
+
),
|
|
560
|
+
n.verified && /* @__PURE__ */ e(
|
|
561
|
+
"div",
|
|
562
|
+
{
|
|
563
|
+
className: "absolute -bottom-0.5 -right-0.5 w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center border-2 border-white shadow-sm",
|
|
564
|
+
children: /* @__PURE__ */ e(
|
|
565
|
+
"svg",
|
|
566
|
+
{
|
|
567
|
+
className: "w-3 h-3 text-white",
|
|
568
|
+
viewBox: "0 0 24 24",
|
|
569
|
+
fill: "currentColor",
|
|
570
|
+
children: /* @__PURE__ */ e("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" })
|
|
571
|
+
}
|
|
572
|
+
)
|
|
573
|
+
}
|
|
574
|
+
)
|
|
575
|
+
] }),
|
|
576
|
+
/* @__PURE__ */ e(
|
|
577
|
+
"h1",
|
|
578
|
+
{
|
|
579
|
+
className: `
|
|
575
580
|
text-lg font-semibold text-center
|
|
576
|
-
${
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
581
|
+
${o ? "text-white" : "text-gray-900"}
|
|
582
|
+
`,
|
|
583
|
+
children: n.name
|
|
584
|
+
}
|
|
585
|
+
),
|
|
586
|
+
n.description && /* @__PURE__ */ e(
|
|
587
|
+
"p",
|
|
588
|
+
{
|
|
589
|
+
className: `
|
|
582
590
|
text-sm text-center mt-0.5
|
|
583
|
-
${
|
|
584
|
-
`,
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
timestamp: o
|
|
596
|
-
} = t, {
|
|
597
|
-
theme: g,
|
|
598
|
-
businessInfo: r
|
|
599
|
-
} = K(), i = g === "dark", a = l === "business", f = r.brandColor || "#0084ff";
|
|
600
|
-
let h;
|
|
601
|
-
e[0] !== o ? (h = new Date(o).toLocaleTimeString([], {
|
|
591
|
+
${o ? "text-zinc-400" : "text-gray-500"}
|
|
592
|
+
`,
|
|
593
|
+
children: n.description
|
|
594
|
+
}
|
|
595
|
+
)
|
|
596
|
+
] });
|
|
597
|
+
}), ye = g(function({
|
|
598
|
+
text: t,
|
|
599
|
+
sender: n,
|
|
600
|
+
timestamp: o
|
|
601
|
+
}) {
|
|
602
|
+
const { theme: s, businessInfo: a } = N(), i = s === "dark", u = n === "business", c = a.brandColor || "#0084ff", d = new Date(o).toLocaleTimeString([], {
|
|
602
603
|
hour: "2-digit",
|
|
603
604
|
minute: "2-digit"
|
|
604
|
-
})
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
605
|
+
});
|
|
606
|
+
return u ? /* @__PURE__ */ l("div", { className: "max-w-[90%]", children: [
|
|
607
|
+
/* @__PURE__ */ e(
|
|
608
|
+
"div",
|
|
609
|
+
{
|
|
610
|
+
className: `
|
|
608
611
|
px-4 py-3 rounded-2xl text-sm leading-relaxed
|
|
609
612
|
${i ? "bg-zinc-800 text-white" : "bg-gray-100 text-gray-900"}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
})
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
} = K(), g = o.brandColor || "#0084ff";
|
|
650
|
-
let r;
|
|
651
|
-
e[0] !== l ? (r = new Date(l).toLocaleTimeString([], {
|
|
613
|
+
`,
|
|
614
|
+
children: t
|
|
615
|
+
}
|
|
616
|
+
),
|
|
617
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: d })
|
|
618
|
+
] }) : /* @__PURE__ */ l("div", { className: "flex items-end gap-1.5 max-w-[85%] ml-auto", children: [
|
|
619
|
+
/* @__PURE__ */ e(
|
|
620
|
+
"div",
|
|
621
|
+
{
|
|
622
|
+
className: "px-4 py-2.5 rounded-full text-white text-sm leading-relaxed",
|
|
623
|
+
style: { backgroundColor: c },
|
|
624
|
+
children: t
|
|
625
|
+
}
|
|
626
|
+
),
|
|
627
|
+
/* @__PURE__ */ e(
|
|
628
|
+
"div",
|
|
629
|
+
{
|
|
630
|
+
className: "w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",
|
|
631
|
+
style: { backgroundColor: c },
|
|
632
|
+
children: /* @__PURE__ */ e(
|
|
633
|
+
"svg",
|
|
634
|
+
{
|
|
635
|
+
className: "w-3 h-3 text-white",
|
|
636
|
+
viewBox: "0 0 24 24",
|
|
637
|
+
fill: "none",
|
|
638
|
+
stroke: "currentColor",
|
|
639
|
+
strokeWidth: 3,
|
|
640
|
+
children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
641
|
+
}
|
|
642
|
+
)
|
|
643
|
+
}
|
|
644
|
+
),
|
|
645
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: d })
|
|
646
|
+
] });
|
|
647
|
+
}), we = g(function({
|
|
648
|
+
text: t,
|
|
649
|
+
timestamp: n
|
|
650
|
+
}) {
|
|
651
|
+
const { businessInfo: o } = N(), s = o.brandColor || "#0084ff", a = new Date(n).toLocaleTimeString([], {
|
|
652
652
|
hour: "2-digit",
|
|
653
653
|
minute: "2-digit"
|
|
654
|
-
})
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
654
|
+
});
|
|
655
|
+
return /* @__PURE__ */ l("div", { className: "flex items-end gap-1.5 max-w-[85%] ml-auto", children: [
|
|
656
|
+
/* @__PURE__ */ e(
|
|
657
|
+
"div",
|
|
658
|
+
{
|
|
659
|
+
className: "px-4 py-2.5 rounded-full text-white text-sm leading-relaxed shadow-sm",
|
|
660
|
+
style: { backgroundColor: s },
|
|
661
|
+
children: t
|
|
662
|
+
}
|
|
663
|
+
),
|
|
664
|
+
/* @__PURE__ */ e(
|
|
665
|
+
"div",
|
|
666
|
+
{
|
|
667
|
+
className: "w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",
|
|
668
|
+
style: { backgroundColor: s },
|
|
669
|
+
children: /* @__PURE__ */ e(
|
|
670
|
+
"svg",
|
|
671
|
+
{
|
|
672
|
+
className: "w-3 h-3 text-white",
|
|
673
|
+
viewBox: "0 0 24 24",
|
|
674
|
+
fill: "none",
|
|
675
|
+
stroke: "currentColor",
|
|
676
|
+
strokeWidth: 3,
|
|
677
|
+
children: /* @__PURE__ */ e(
|
|
678
|
+
"path",
|
|
679
|
+
{
|
|
680
|
+
strokeLinecap: "round",
|
|
681
|
+
strokeLinejoin: "round",
|
|
682
|
+
d: "M5 13l4 4L19 7"
|
|
683
|
+
}
|
|
684
|
+
)
|
|
685
|
+
}
|
|
686
|
+
)
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: a })
|
|
690
|
+
] });
|
|
691
|
+
}), ve = g(function({
|
|
692
|
+
card: t,
|
|
693
|
+
timestamp: n
|
|
694
|
+
}) {
|
|
695
|
+
const { theme: o, handleReply: s, handleAction: a } = N(), i = o === "dark", u = new Date(n).toLocaleTimeString([], {
|
|
689
696
|
hour: "2-digit",
|
|
690
697
|
minute: "2-digit"
|
|
691
|
-
}),
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
e[2] !== r || e[3] !== g ? (h = (_) => {
|
|
695
|
-
"reply" in _ ? g(_) : r(_);
|
|
696
|
-
}, e[2] = r, e[3] = g, e[4] = h) : h = e[4];
|
|
697
|
-
const d = h;
|
|
698
|
-
let u;
|
|
699
|
-
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
698
|
+
}), c = (f) => {
|
|
699
|
+
"reply" in f ? s(f) : a(f);
|
|
700
|
+
}, d = {
|
|
700
701
|
short: "h-36",
|
|
701
702
|
medium: "h-44",
|
|
702
703
|
tall: "h-56"
|
|
703
|
-
}
|
|
704
|
-
|
|
704
|
+
};
|
|
705
|
+
return /* @__PURE__ */ l("div", { className: "w-full", children: [
|
|
706
|
+
/* @__PURE__ */ l(
|
|
707
|
+
"div",
|
|
708
|
+
{
|
|
709
|
+
className: `
|
|
705
710
|
overflow-hidden rounded-2xl w-full shadow-sm
|
|
706
711
|
${i ? "bg-zinc-800" : "bg-[#e8f5e9]"}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
712
|
+
`,
|
|
713
|
+
children: [
|
|
714
|
+
t.media && /* @__PURE__ */ e(
|
|
715
|
+
"div",
|
|
716
|
+
{
|
|
717
|
+
className: `
|
|
710
718
|
w-full overflow-hidden
|
|
711
|
-
${
|
|
712
|
-
`,
|
|
713
|
-
|
|
714
|
-
|
|
719
|
+
${d[t.media.height]}
|
|
720
|
+
`,
|
|
721
|
+
children: /* @__PURE__ */ e(
|
|
722
|
+
"img",
|
|
723
|
+
{
|
|
724
|
+
src: t.media.url,
|
|
725
|
+
alt: t.title || "Rich card media",
|
|
726
|
+
className: "w-full h-full object-cover",
|
|
727
|
+
loading: "lazy"
|
|
728
|
+
}
|
|
729
|
+
)
|
|
730
|
+
}
|
|
731
|
+
),
|
|
732
|
+
/* @__PURE__ */ l("div", { className: "p-4", children: [
|
|
733
|
+
t.title && /* @__PURE__ */ e(
|
|
734
|
+
"h3",
|
|
735
|
+
{
|
|
736
|
+
className: `
|
|
715
737
|
text-base font-semibold leading-snug
|
|
716
738
|
${i ? "text-white" : "text-gray-900"}
|
|
717
|
-
`,
|
|
718
|
-
|
|
719
|
-
|
|
739
|
+
`,
|
|
740
|
+
children: t.title
|
|
741
|
+
}
|
|
742
|
+
),
|
|
743
|
+
t.description && /* @__PURE__ */ e(
|
|
744
|
+
"p",
|
|
745
|
+
{
|
|
746
|
+
className: `
|
|
720
747
|
text-sm leading-relaxed mt-1.5
|
|
721
748
|
${i ? "text-zinc-300" : "text-gray-700"}
|
|
722
|
-
`,
|
|
723
|
-
|
|
724
|
-
|
|
749
|
+
`,
|
|
750
|
+
children: t.description
|
|
751
|
+
}
|
|
752
|
+
),
|
|
753
|
+
t.suggestions && t.suggestions.length > 0 && /* @__PURE__ */ e(
|
|
754
|
+
"div",
|
|
755
|
+
{
|
|
756
|
+
className: `
|
|
725
757
|
mt-4 rounded-xl overflow-hidden divide-y
|
|
726
758
|
${i ? "divide-zinc-700 bg-zinc-800" : "divide-gray-100 bg-white"}
|
|
727
|
-
`,
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
/* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
760
|
-
] }), c[0] = t) : t = c[0], t;
|
|
761
|
-
}, Ke = () => {
|
|
762
|
-
const c = B(1);
|
|
763
|
-
let t;
|
|
764
|
-
return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), c[0] = t) : t = c[0], t;
|
|
765
|
-
}, ye = () => {
|
|
766
|
-
const c = B(1);
|
|
767
|
-
let t;
|
|
768
|
-
return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), c[0] = t) : t = c[0], t;
|
|
769
|
-
}, et = F(function(t) {
|
|
770
|
-
const e = B(15), {
|
|
771
|
-
suggestion: s,
|
|
772
|
-
onClick: l,
|
|
773
|
-
isDark: o
|
|
774
|
-
} = t;
|
|
775
|
-
let g;
|
|
776
|
-
e[0] !== s ? (g = le(s), e[0] = s, e[1] = g) : g = e[1];
|
|
777
|
-
const r = g, i = r ? s.action.displayText : s.reply.displayText;
|
|
778
|
-
let a;
|
|
779
|
-
e[2] !== r || e[3] !== s ? (a = () => {
|
|
780
|
-
if (!r)
|
|
781
|
-
return /* @__PURE__ */ n(ye, {});
|
|
782
|
-
const {
|
|
783
|
-
action: b
|
|
784
|
-
} = s;
|
|
785
|
-
return b.urlAction || b.openUrlAction ? /* @__PURE__ */ n(Qe, {}) : b.dialerAction || b.dialAction ? /* @__PURE__ */ n(Xe, {}) : b.mapAction || b.viewLocationAction ? /* @__PURE__ */ n(Ze, {}) : b.calendarAction || b.createCalendarEventAction ? /* @__PURE__ */ n(Ke, {}) : /* @__PURE__ */ n(ye, {});
|
|
786
|
-
}, e[2] = r, e[3] = s, e[4] = a) : a = e[4];
|
|
787
|
-
const f = a, h = `
|
|
759
|
+
`,
|
|
760
|
+
children: t.suggestions.map((f, v) => /* @__PURE__ */ e(
|
|
761
|
+
Me,
|
|
762
|
+
{
|
|
763
|
+
suggestion: f,
|
|
764
|
+
onClick: () => c(f),
|
|
765
|
+
isDark: i
|
|
766
|
+
},
|
|
767
|
+
v
|
|
768
|
+
))
|
|
769
|
+
}
|
|
770
|
+
)
|
|
771
|
+
] })
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: u })
|
|
776
|
+
] });
|
|
777
|
+
}), E = "w-5 h-5 text-gray-400", ke = () => /* @__PURE__ */ e("svg", { className: E, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }), Ne = () => /* @__PURE__ */ e("svg", { className: E, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), Le = () => /* @__PURE__ */ l("svg", { className: E, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
|
|
778
|
+
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
|
|
779
|
+
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
780
|
+
] }), Ce = () => /* @__PURE__ */ e("svg", { className: E, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), G = () => /* @__PURE__ */ e("svg", { className: E, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), Me = g(function({
|
|
781
|
+
suggestion: t,
|
|
782
|
+
onClick: n,
|
|
783
|
+
isDark: o
|
|
784
|
+
}) {
|
|
785
|
+
const s = $(t), a = s ? t.action.displayText : t.reply.displayText;
|
|
786
|
+
return /* @__PURE__ */ l(
|
|
787
|
+
"button",
|
|
788
|
+
{
|
|
789
|
+
onClick: n,
|
|
790
|
+
className: `
|
|
788
791
|
w-full flex items-center gap-3 px-4 py-3 text-left transition-colors
|
|
789
792
|
${o ? "hover:bg-zinc-700" : "hover:bg-gray-50"}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
}),
|
|
802
|
-
const
|
|
803
|
-
cards: s,
|
|
804
|
-
timestamp: l
|
|
805
|
-
} = t, {
|
|
806
|
-
theme: o,
|
|
807
|
-
handleReply: g,
|
|
808
|
-
handleAction: r
|
|
809
|
-
} = K(), i = me(null), [a, f] = ne(!1), [h, d] = ne(s.length > 1), u = o === "dark";
|
|
810
|
-
let m;
|
|
811
|
-
e[0] !== l ? (m = new Date(l).toLocaleTimeString([], {
|
|
793
|
+
`,
|
|
794
|
+
children: [
|
|
795
|
+
/* @__PURE__ */ e("span", { className: "flex-shrink-0", children: (() => {
|
|
796
|
+
if (!s) return /* @__PURE__ */ e(G, {});
|
|
797
|
+
const { action: u } = t;
|
|
798
|
+
return u.urlAction || u.openUrlAction ? /* @__PURE__ */ e(ke, {}) : u.dialerAction || u.dialAction ? /* @__PURE__ */ e(Ne, {}) : u.mapAction || u.viewLocationAction ? /* @__PURE__ */ e(Le, {}) : u.calendarAction || u.createCalendarEventAction ? /* @__PURE__ */ e(Ce, {}) : /* @__PURE__ */ e(G, {});
|
|
799
|
+
})() }),
|
|
800
|
+
/* @__PURE__ */ e("span", { className: `text-sm ${o ? "text-white" : "text-gray-900"}`, children: a })
|
|
801
|
+
]
|
|
802
|
+
}
|
|
803
|
+
);
|
|
804
|
+
}), ze = g(function({ cards: t, timestamp: n }) {
|
|
805
|
+
const { theme: o, handleReply: s, handleAction: a } = N(), i = W(null), [u, c] = z(!1), [d, m] = z(t.length > 1), f = o === "dark", v = new Date(n).toLocaleTimeString([], {
|
|
812
806
|
hour: "2-digit",
|
|
813
807
|
minute: "2-digit"
|
|
814
|
-
}),
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
e[2] !== r || e[3] !== g ? (b = (I) => {
|
|
818
|
-
"reply" in I ? g(I) : r(I);
|
|
819
|
-
}, e[2] = r, e[3] = g, e[4] = b) : b = e[4];
|
|
820
|
-
const y = b;
|
|
821
|
-
let w;
|
|
822
|
-
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = () => {
|
|
808
|
+
}), x = (p) => {
|
|
809
|
+
"reply" in p ? s(p) : a(p);
|
|
810
|
+
}, L = M(() => {
|
|
823
811
|
if (i.current) {
|
|
824
|
-
const {
|
|
825
|
-
|
|
826
|
-
scrollWidth: T,
|
|
827
|
-
clientWidth: D
|
|
828
|
-
} = i.current;
|
|
829
|
-
f(I > 0), d(I < T - D - 10);
|
|
812
|
+
const { scrollLeft: p, scrollWidth: y, clientWidth: h } = i.current;
|
|
813
|
+
c(p > 0), m(p < y - h - 10);
|
|
830
814
|
}
|
|
831
|
-
},
|
|
832
|
-
const x = w;
|
|
833
|
-
let k;
|
|
834
|
-
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = (I) => {
|
|
815
|
+
}, []), b = (p) => {
|
|
835
816
|
i.current && i.current.scrollBy({
|
|
836
|
-
left:
|
|
817
|
+
left: p === "left" ? -200 : 200,
|
|
837
818
|
behavior: "smooth"
|
|
838
819
|
});
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
820
|
+
};
|
|
821
|
+
return /* @__PURE__ */ l("div", { className: "w-full -mx-3", children: [
|
|
822
|
+
/* @__PURE__ */ l("div", { className: "relative", children: [
|
|
823
|
+
u && /* @__PURE__ */ e(
|
|
824
|
+
"button",
|
|
825
|
+
{
|
|
826
|
+
onClick: () => b("left"),
|
|
827
|
+
className: `
|
|
843
828
|
absolute left-2 top-1/2 -translate-y-1/2 z-10
|
|
844
829
|
w-8 h-8 rounded-full flex items-center justify-center
|
|
845
830
|
shadow-lg transition-opacity
|
|
846
|
-
${
|
|
847
|
-
`,
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
831
|
+
${f ? "bg-zinc-700 text-white" : "bg-white text-gray-700"}
|
|
832
|
+
`,
|
|
833
|
+
"aria-label": "Scroll left",
|
|
834
|
+
children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
835
|
+
}
|
|
836
|
+
),
|
|
837
|
+
/* @__PURE__ */ e(
|
|
838
|
+
"div",
|
|
839
|
+
{
|
|
840
|
+
ref: i,
|
|
841
|
+
onScroll: L,
|
|
842
|
+
className: "flex gap-2.5 overflow-x-auto py-1 px-3 snap-x snap-mandatory",
|
|
843
|
+
style: { scrollbarWidth: "none", msOverflowStyle: "none" },
|
|
844
|
+
children: t.map((p, y) => /* @__PURE__ */ e(
|
|
845
|
+
Ae,
|
|
846
|
+
{
|
|
847
|
+
card: p,
|
|
848
|
+
isDark: f,
|
|
849
|
+
onSuggestionClick: x
|
|
850
|
+
},
|
|
851
|
+
y
|
|
852
|
+
))
|
|
853
|
+
}
|
|
854
|
+
),
|
|
855
|
+
d && /* @__PURE__ */ e(
|
|
856
|
+
"button",
|
|
857
|
+
{
|
|
858
|
+
onClick: () => b("right"),
|
|
859
|
+
className: `
|
|
863
860
|
absolute right-2 top-1/2 -translate-y-1/2 z-10
|
|
864
861
|
w-8 h-8 rounded-full flex items-center justify-center
|
|
865
862
|
shadow-lg transition-opacity
|
|
866
|
-
${
|
|
867
|
-
`,
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
card: s,
|
|
894
|
-
isDark: l,
|
|
895
|
-
onSuggestionClick: o
|
|
896
|
-
} = t, r = `
|
|
863
|
+
${f ? "bg-zinc-700 text-white" : "bg-white text-gray-700"}
|
|
864
|
+
`,
|
|
865
|
+
"aria-label": "Scroll right",
|
|
866
|
+
children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
867
|
+
}
|
|
868
|
+
)
|
|
869
|
+
] }),
|
|
870
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: v })
|
|
871
|
+
] });
|
|
872
|
+
}), j = "w-4 h-4 text-gray-400", $e = (r) => {
|
|
873
|
+
if (!$(r))
|
|
874
|
+
return /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) });
|
|
875
|
+
const { action: t } = r;
|
|
876
|
+
return t.urlAction || t.openUrlAction ? /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }) : t.dialerAction || t.dialAction ? /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }) : t.mapAction || t.viewLocationAction ? /* @__PURE__ */ l("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
|
|
877
|
+
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
|
|
878
|
+
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
879
|
+
] }) : t.calendarAction || t.createCalendarEventAction ? /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) : /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) });
|
|
880
|
+
}, Ae = g(function({
|
|
881
|
+
card: t,
|
|
882
|
+
isDark: n,
|
|
883
|
+
onSuggestionClick: o
|
|
884
|
+
}) {
|
|
885
|
+
const s = t.layout.width === "small" ? "w-44" : "w-52";
|
|
886
|
+
return /* @__PURE__ */ l(
|
|
887
|
+
"div",
|
|
888
|
+
{
|
|
889
|
+
className: `
|
|
897
890
|
flex-shrink-0 snap-start rounded-2xl overflow-hidden shadow-sm
|
|
898
|
-
${s
|
|
899
|
-
${
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
891
|
+
${s}
|
|
892
|
+
${n ? "bg-zinc-800" : "bg-[#e8f5e9]"}
|
|
893
|
+
`,
|
|
894
|
+
children: [
|
|
895
|
+
t.media && /* @__PURE__ */ e("div", { className: "w-full h-32 bg-gray-200 overflow-hidden", children: /* @__PURE__ */ e(
|
|
896
|
+
"img",
|
|
897
|
+
{
|
|
898
|
+
src: t.media.url,
|
|
899
|
+
alt: t.title || "Carousel card media",
|
|
900
|
+
className: "w-full h-full object-cover",
|
|
901
|
+
loading: "lazy"
|
|
902
|
+
}
|
|
903
|
+
) }),
|
|
904
|
+
/* @__PURE__ */ l("div", { className: "p-3", children: [
|
|
905
|
+
t.title && /* @__PURE__ */ e(
|
|
906
|
+
"h4",
|
|
907
|
+
{
|
|
908
|
+
className: `
|
|
905
909
|
text-sm font-semibold leading-tight mb-1 line-clamp-2
|
|
906
|
-
${
|
|
907
|
-
`,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
+
${n ? "text-white" : "text-gray-900"}
|
|
911
|
+
`,
|
|
912
|
+
children: t.title
|
|
913
|
+
}
|
|
914
|
+
),
|
|
915
|
+
t.description && /* @__PURE__ */ e(
|
|
916
|
+
"p",
|
|
917
|
+
{
|
|
918
|
+
className: `
|
|
910
919
|
text-xs leading-relaxed line-clamp-3
|
|
911
|
-
${
|
|
912
|
-
`,
|
|
913
|
-
|
|
914
|
-
|
|
920
|
+
${n ? "text-zinc-400" : "text-gray-700"}
|
|
921
|
+
`,
|
|
922
|
+
children: t.description
|
|
923
|
+
}
|
|
924
|
+
),
|
|
925
|
+
t.suggestions && t.suggestions.length > 0 && /* @__PURE__ */ e(
|
|
926
|
+
"div",
|
|
927
|
+
{
|
|
928
|
+
className: `
|
|
915
929
|
mt-3 rounded-lg overflow-hidden divide-y
|
|
916
|
-
${
|
|
917
|
-
`,
|
|
918
|
-
|
|
919
|
-
|
|
930
|
+
${n ? "divide-zinc-600 bg-zinc-700" : "divide-gray-100 bg-white"}
|
|
931
|
+
`,
|
|
932
|
+
children: t.suggestions.map((a, i) => {
|
|
933
|
+
const c = $(a) ? a.action.displayText : a.reply.displayText;
|
|
934
|
+
return /* @__PURE__ */ l(
|
|
935
|
+
"button",
|
|
936
|
+
{
|
|
937
|
+
onClick: () => o(a),
|
|
938
|
+
className: `
|
|
920
939
|
w-full flex items-center gap-2 px-3 py-2.5
|
|
921
940
|
text-xs transition-colors text-left
|
|
922
|
-
${
|
|
923
|
-
`,
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
941
|
+
${n ? "hover:bg-zinc-600 text-white" : "hover:bg-gray-50 text-gray-900"}
|
|
942
|
+
`,
|
|
943
|
+
children: [
|
|
944
|
+
/* @__PURE__ */ e("span", { className: "flex-shrink-0", children: $e(a) }),
|
|
945
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: c })
|
|
946
|
+
]
|
|
947
|
+
},
|
|
948
|
+
i
|
|
949
|
+
);
|
|
950
|
+
})
|
|
951
|
+
}
|
|
952
|
+
)
|
|
953
|
+
] })
|
|
954
|
+
]
|
|
955
|
+
}
|
|
956
|
+
);
|
|
957
|
+
}), Ie = {
|
|
958
|
+
text: ({ content: r, sender: t, timestamp: n }) => r.type !== "text" ? null : /* @__PURE__ */ e(ye, { text: r.text, sender: t, timestamp: n }),
|
|
959
|
+
userReply: ({ content: r, timestamp: t }) => r.type !== "userReply" ? null : /* @__PURE__ */ e(we, { text: r.text, timestamp: t }),
|
|
960
|
+
richcard: ({ content: r, timestamp: t }) => r.type !== "richcard" ? null : /* @__PURE__ */ e(ve, { card: r.card, timestamp: t }),
|
|
961
|
+
carousel: ({ content: r, timestamp: t }) => r.type !== "carousel" ? null : /* @__PURE__ */ e(ze, { cards: r.cards, timestamp: t })
|
|
962
|
+
}, Te = g(function({
|
|
963
|
+
message: t,
|
|
964
|
+
isLast: n
|
|
965
|
+
}) {
|
|
966
|
+
const { content: o, sender: s, timestamp: a } = t, i = Ie[o.type];
|
|
967
|
+
return i ? /* @__PURE__ */ e(
|
|
936
968
|
i,
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
}) => c.type !== "carousel" ? null : /* @__PURE__ */ n(tt, { cards: c.cards, timestamp: t })
|
|
957
|
-
}, rt = F(function(t) {
|
|
958
|
-
const e = B(7), {
|
|
959
|
-
message: s,
|
|
960
|
-
isLast: l
|
|
961
|
-
} = t, {
|
|
962
|
-
content: o,
|
|
963
|
-
sender: g,
|
|
964
|
-
timestamp: r
|
|
965
|
-
} = s, i = lt[o.type];
|
|
966
|
-
if (!i) {
|
|
967
|
-
console.warn(`Unknown message type: ${o.type}`);
|
|
968
|
-
let h;
|
|
969
|
-
return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ n("div", { className: "px-4 py-2 text-gray-500 text-sm italic", children: "[Unsupported message type]" }), e[0] = h) : h = e[0], h;
|
|
970
|
-
}
|
|
971
|
-
const a = l && g === "business";
|
|
972
|
-
let f;
|
|
973
|
-
return e[1] !== i || e[2] !== o || e[3] !== g || e[4] !== a || e[5] !== r ? (f = /* @__PURE__ */ n(i, { content: o, sender: g, timestamp: r, showSuggestions: a }), e[1] = i, e[2] = o, e[3] = g, e[4] = a, e[5] = r, e[6] = f) : f = e[6], f;
|
|
974
|
-
}), it = F(function() {
|
|
975
|
-
const t = B(11), {
|
|
976
|
-
theme: e
|
|
977
|
-
} = K(), s = e === "dark", l = `
|
|
969
|
+
{
|
|
970
|
+
content: o,
|
|
971
|
+
sender: s,
|
|
972
|
+
timestamp: a,
|
|
973
|
+
showSuggestions: n && s === "business"
|
|
974
|
+
}
|
|
975
|
+
) : (console.warn(`Unknown message type: ${o.type}`), /* @__PURE__ */ e("div", { className: "px-4 py-2 text-gray-500 text-sm italic", children: "[Unsupported message type]" }));
|
|
976
|
+
}), je = g(function() {
|
|
977
|
+
const { theme: t } = N(), n = t === "dark";
|
|
978
|
+
return /* @__PURE__ */ e(
|
|
979
|
+
"div",
|
|
980
|
+
{
|
|
981
|
+
className: "flex items-start gap-2 px-4 py-2",
|
|
982
|
+
role: "status",
|
|
983
|
+
"aria-label": "Business is typing",
|
|
984
|
+
children: /* @__PURE__ */ l(
|
|
985
|
+
"div",
|
|
986
|
+
{
|
|
987
|
+
className: `
|
|
978
988
|
inline-flex items-center gap-1 px-4 py-3 rounded-2xl rounded-bl-sm
|
|
979
|
-
${
|
|
980
|
-
`,
|
|
989
|
+
${n ? "bg-zinc-800" : "bg-gray-100"}
|
|
990
|
+
`,
|
|
991
|
+
children: [
|
|
992
|
+
/* @__PURE__ */ e(
|
|
993
|
+
"span",
|
|
994
|
+
{
|
|
995
|
+
className: `
|
|
981
996
|
rcs-typing-dot w-2 h-2 rounded-full
|
|
982
|
-
${
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
997
|
+
${n ? "bg-zinc-500" : "bg-gray-400"}
|
|
998
|
+
`
|
|
999
|
+
}
|
|
1000
|
+
),
|
|
1001
|
+
/* @__PURE__ */ e(
|
|
1002
|
+
"span",
|
|
1003
|
+
{
|
|
1004
|
+
className: `
|
|
987
1005
|
rcs-typing-dot w-2 h-2 rounded-full
|
|
988
|
-
${
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1006
|
+
${n ? "bg-zinc-500" : "bg-gray-400"}
|
|
1007
|
+
`
|
|
1008
|
+
}
|
|
1009
|
+
),
|
|
1010
|
+
/* @__PURE__ */ e(
|
|
1011
|
+
"span",
|
|
1012
|
+
{
|
|
1013
|
+
className: `
|
|
993
1014
|
rcs-typing-dot w-2 h-2 rounded-full
|
|
994
|
-
${
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1015
|
+
${n ? "bg-zinc-500" : "bg-gray-400"}
|
|
1016
|
+
`
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1019
|
+
]
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1022
|
+
}
|
|
1023
|
+
);
|
|
1024
|
+
}), Se = g(function() {
|
|
1025
|
+
const { theme: t, state: n } = N(), { chatHistory: o, isTyping: s } = n, a = t === "dark";
|
|
1026
|
+
return /* @__PURE__ */ l(
|
|
1027
|
+
"div",
|
|
1028
|
+
{
|
|
1029
|
+
className: "px-3 pb-3 space-y-3",
|
|
1030
|
+
role: "log",
|
|
1031
|
+
"aria-label": "Chat messages",
|
|
1032
|
+
"aria-live": "polite",
|
|
1033
|
+
children: [
|
|
1034
|
+
o.length > 0 && /* @__PURE__ */ e("div", { className: "flex justify-center py-2", children: /* @__PURE__ */ e(
|
|
1035
|
+
"span",
|
|
1036
|
+
{
|
|
1037
|
+
className: `
|
|
1014
1038
|
text-xs font-medium px-3 py-1
|
|
1015
|
-
${
|
|
1016
|
-
`,
|
|
1017
|
-
|
|
1039
|
+
${a ? "text-zinc-500" : "text-gray-500"}
|
|
1040
|
+
`,
|
|
1041
|
+
children: "Today"
|
|
1042
|
+
}
|
|
1043
|
+
) }),
|
|
1044
|
+
/* @__PURE__ */ l(
|
|
1045
|
+
"div",
|
|
1046
|
+
{
|
|
1047
|
+
className: `
|
|
1018
1048
|
rounded-3xl overflow-hidden
|
|
1019
|
-
${
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
}),
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
} =
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
let u;
|
|
1061
|
-
e[2] !== h || e[3] !== s ? (u = h ? ct(s) : null, e[2] = h, e[3] = s, e[4] = u) : u = e[4];
|
|
1062
|
-
const m = u, p = i.brandColor || "#0084ff";
|
|
1063
|
-
if (g === "bar") {
|
|
1064
|
-
const w = `
|
|
1049
|
+
${a ? "bg-zinc-900" : "bg-gray-50"}
|
|
1050
|
+
`,
|
|
1051
|
+
children: [
|
|
1052
|
+
o.length === 0 && !s && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e("p", { className: `text-sm ${a ? "text-zinc-500" : "text-gray-400"}`, children: "No messages yet" }) }),
|
|
1053
|
+
/* @__PURE__ */ l("div", { className: "p-3 space-y-3", children: [
|
|
1054
|
+
o.map((i, u) => /* @__PURE__ */ e(
|
|
1055
|
+
"div",
|
|
1056
|
+
{
|
|
1057
|
+
className: `
|
|
1058
|
+
${i.sender === "user" ? "flex justify-end" : "flex justify-start"}
|
|
1059
|
+
`,
|
|
1060
|
+
children: /* @__PURE__ */ e(
|
|
1061
|
+
Te,
|
|
1062
|
+
{
|
|
1063
|
+
message: i,
|
|
1064
|
+
isLast: u === o.length - 1 && !s
|
|
1065
|
+
}
|
|
1066
|
+
)
|
|
1067
|
+
},
|
|
1068
|
+
i.id
|
|
1069
|
+
)),
|
|
1070
|
+
s && /* @__PURE__ */ e(je, {})
|
|
1071
|
+
] })
|
|
1072
|
+
]
|
|
1073
|
+
}
|
|
1074
|
+
)
|
|
1075
|
+
]
|
|
1076
|
+
}
|
|
1077
|
+
);
|
|
1078
|
+
}), Ee = g(function({
|
|
1079
|
+
suggestion: t,
|
|
1080
|
+
onClick: n,
|
|
1081
|
+
variant: o = "bar"
|
|
1082
|
+
}) {
|
|
1083
|
+
const { theme: s, businessInfo: a } = N(), i = s === "dark", u = $(t), c = u ? t.action.displayText : t.reply.displayText, d = u ? Be(t) : null, m = a.brandColor || "#0084ff";
|
|
1084
|
+
return o === "bar" ? /* @__PURE__ */ l(
|
|
1085
|
+
"button",
|
|
1086
|
+
{
|
|
1087
|
+
type: "button",
|
|
1088
|
+
onClick: n,
|
|
1089
|
+
className: `
|
|
1065
1090
|
inline-flex items-center gap-2 px-4 py-2 rounded-full text-sm font-medium
|
|
1066
1091
|
whitespace-nowrap transition-colors flex-shrink-0
|
|
1067
1092
|
border
|
|
1068
|
-
${
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
] }), e[14] = l, e[15] = w, e[16] = x, e[17] = k, e[18] = v, e[19] = N) : N = e[19], N;
|
|
1083
|
-
}
|
|
1084
|
-
if (g === "card") {
|
|
1085
|
-
const w = `
|
|
1093
|
+
${i ? "bg-zinc-800 border-zinc-700 hover:bg-zinc-700 text-white" : "bg-white border-gray-300 hover:bg-gray-50 text-gray-900"}
|
|
1094
|
+
`,
|
|
1095
|
+
"aria-label": u ? `${Re(t)}: ${c}` : c,
|
|
1096
|
+
children: [
|
|
1097
|
+
d && /* @__PURE__ */ e("span", { style: { color: m }, children: /* @__PURE__ */ e(d, { className: "w-4 h-4" }) }),
|
|
1098
|
+
/* @__PURE__ */ e("span", { children: c })
|
|
1099
|
+
]
|
|
1100
|
+
}
|
|
1101
|
+
) : o === "card" ? /* @__PURE__ */ l(
|
|
1102
|
+
"button",
|
|
1103
|
+
{
|
|
1104
|
+
type: "button",
|
|
1105
|
+
onClick: n,
|
|
1106
|
+
className: `
|
|
1086
1107
|
w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors rounded-lg
|
|
1087
|
-
${
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1108
|
+
${i ? "hover:bg-zinc-700" : "hover:bg-gray-100"}
|
|
1109
|
+
`,
|
|
1110
|
+
children: [
|
|
1111
|
+
d && /* @__PURE__ */ e(
|
|
1112
|
+
"div",
|
|
1113
|
+
{
|
|
1114
|
+
className: "w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",
|
|
1115
|
+
style: { backgroundColor: `${m}15` },
|
|
1116
|
+
children: /* @__PURE__ */ e(d, { className: "w-4 h-4", style: { color: m } })
|
|
1117
|
+
}
|
|
1118
|
+
),
|
|
1119
|
+
/* @__PURE__ */ e(
|
|
1120
|
+
"span",
|
|
1121
|
+
{
|
|
1122
|
+
className: `text-sm font-medium ${i ? "text-white" : "text-gray-900"}`,
|
|
1123
|
+
children: c
|
|
1124
|
+
}
|
|
1125
|
+
)
|
|
1126
|
+
]
|
|
1127
|
+
}
|
|
1128
|
+
) : /* @__PURE__ */ e(
|
|
1129
|
+
"button",
|
|
1130
|
+
{
|
|
1131
|
+
type: "button",
|
|
1132
|
+
onClick: n,
|
|
1133
|
+
className: `
|
|
1105
1134
|
w-full px-3 py-2 rounded-lg text-xs font-medium text-center
|
|
1106
1135
|
border transition-colors
|
|
1107
|
-
${
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1136
|
+
${i ? "border-zinc-600 hover:bg-zinc-700 text-white" : "border-gray-300 hover:bg-gray-50 text-gray-900"}
|
|
1137
|
+
`,
|
|
1138
|
+
children: c
|
|
1139
|
+
}
|
|
1140
|
+
);
|
|
1111
1141
|
});
|
|
1112
|
-
function
|
|
1113
|
-
if (
|
|
1114
|
-
const {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
style: s
|
|
1123
|
-
}) => /* @__PURE__ */ n("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }) : t.shareLocationAction ? ({
|
|
1124
|
-
className: e,
|
|
1125
|
-
style: s
|
|
1126
|
-
}) => /* @__PURE__ */ C("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
|
|
1127
|
-
/* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
|
|
1128
|
-
/* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
1129
|
-
] }) : t.viewLocationAction ? ({
|
|
1130
|
-
className: e,
|
|
1131
|
-
style: s
|
|
1132
|
-
}) => /* @__PURE__ */ C("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
|
|
1133
|
-
/* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
|
|
1134
|
-
/* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
1135
|
-
] }) : t.createCalendarEventAction ? ({
|
|
1136
|
-
className: e,
|
|
1137
|
-
style: s
|
|
1138
|
-
}) => /* @__PURE__ */ n("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) : null;
|
|
1142
|
+
function Be(r) {
|
|
1143
|
+
if (!$(r)) return null;
|
|
1144
|
+
const { action: t } = r;
|
|
1145
|
+
return t.openUrlAction ? ({ className: n, style: o }) => /* @__PURE__ */ e("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }) : t.dialAction ? ({ className: n, style: o }) => /* @__PURE__ */ e("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }) : t.shareLocationAction ? ({ className: n, style: o }) => /* @__PURE__ */ l("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
|
|
1146
|
+
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
|
|
1147
|
+
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
1148
|
+
] }) : t.viewLocationAction ? ({ className: n, style: o }) => /* @__PURE__ */ l("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
|
|
1149
|
+
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
|
|
1150
|
+
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
1151
|
+
] }) : t.createCalendarEventAction ? ({ className: n, style: o }) => /* @__PURE__ */ e("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) : null;
|
|
1139
1152
|
}
|
|
1140
|
-
function
|
|
1141
|
-
if (
|
|
1142
|
-
const {
|
|
1143
|
-
action: t
|
|
1144
|
-
} = c;
|
|
1153
|
+
function Re(r) {
|
|
1154
|
+
if (!$(r)) return "Reply";
|
|
1155
|
+
const { action: t } = r;
|
|
1145
1156
|
return t.openUrlAction ? "Open link" : t.dialAction ? "Call" : t.shareLocationAction ? "Share location" : t.viewLocationAction ? "View location" : t.createCalendarEventAction ? "Add to calendar" : "Action";
|
|
1146
1157
|
}
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
} =
|
|
1151
|
-
|
|
1152
|
-
handleReply: o,
|
|
1153
|
-
handleAction: g
|
|
1154
|
-
} = K(), r = l === "dark";
|
|
1155
|
-
if (!s || s.length === 0)
|
|
1158
|
+
const We = g(function({
|
|
1159
|
+
suggestions: t
|
|
1160
|
+
}) {
|
|
1161
|
+
const { theme: n, handleReply: o, handleAction: s } = N(), a = n === "dark";
|
|
1162
|
+
if (!t || t.length === 0)
|
|
1156
1163
|
return null;
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1164
|
+
const i = (u) => {
|
|
1165
|
+
q(u) ? o(u) : $(u) && s(u);
|
|
1166
|
+
};
|
|
1167
|
+
return /* @__PURE__ */ e(
|
|
1168
|
+
"div",
|
|
1169
|
+
{
|
|
1170
|
+
className: `
|
|
1162
1171
|
px-3 py-2
|
|
1163
|
-
${
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1172
|
+
${a ? "bg-zinc-900" : "bg-white"}
|
|
1173
|
+
`,
|
|
1174
|
+
role: "group",
|
|
1175
|
+
"aria-label": "Quick replies",
|
|
1176
|
+
children: /* @__PURE__ */ e(
|
|
1177
|
+
"div",
|
|
1178
|
+
{
|
|
1179
|
+
className: "flex gap-2 overflow-x-auto pb-1 -mx-1 px-1",
|
|
1180
|
+
style: { scrollbarWidth: "none", msOverflowStyle: "none" },
|
|
1181
|
+
children: t.map((u, c) => /* @__PURE__ */ e(
|
|
1182
|
+
Ee,
|
|
1183
|
+
{
|
|
1184
|
+
suggestion: u,
|
|
1185
|
+
onClick: () => i(u),
|
|
1186
|
+
variant: "bar"
|
|
1187
|
+
},
|
|
1188
|
+
c
|
|
1189
|
+
))
|
|
1190
|
+
}
|
|
1191
|
+
)
|
|
1192
|
+
}
|
|
1193
|
+
);
|
|
1194
|
+
}), Ve = g(function() {
|
|
1195
|
+
const { theme: t, state: n, showSuggestions: o } = N(), { chatHistory: s, isTyping: a, error: i } = n, u = pe([
|
|
1196
|
+
s.length,
|
|
1197
|
+
a
|
|
1198
|
+
]), c = t === "dark", d = s[s.length - 1], m = o && d?.sender === "business" && !a ? d.suggestions : void 0;
|
|
1199
|
+
return /* @__PURE__ */ l(
|
|
1200
|
+
"div",
|
|
1201
|
+
{
|
|
1202
|
+
className: `
|
|
1193
1203
|
flex flex-col h-full w-full overflow-hidden
|
|
1194
|
-
${
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1204
|
+
${c ? "bg-zinc-950" : "bg-white"}
|
|
1205
|
+
`,
|
|
1206
|
+
children: [
|
|
1207
|
+
/* @__PURE__ */ e(xe, {}),
|
|
1208
|
+
i && /* @__PURE__ */ e(
|
|
1209
|
+
"div",
|
|
1210
|
+
{
|
|
1211
|
+
className: "px-4 py-2 bg-red-500/10 border-b border-red-500/20",
|
|
1212
|
+
role: "alert",
|
|
1213
|
+
children: /* @__PURE__ */ e("p", { className: "text-sm text-red-500", children: i })
|
|
1214
|
+
}
|
|
1215
|
+
),
|
|
1216
|
+
/* @__PURE__ */ l("div", { ref: u, className: "flex-1 overflow-y-auto rcs-scrollbar", children: [
|
|
1217
|
+
/* @__PURE__ */ e(be, {}),
|
|
1218
|
+
/* @__PURE__ */ e(Se, {})
|
|
1219
|
+
] }),
|
|
1220
|
+
m && m.length > 0 && /* @__PURE__ */ e(We, { suggestions: m }),
|
|
1221
|
+
/* @__PURE__ */ l(
|
|
1222
|
+
"div",
|
|
1223
|
+
{
|
|
1224
|
+
className: `
|
|
1210
1225
|
px-3 py-2 flex items-center gap-2
|
|
1211
|
-
${
|
|
1212
|
-
`,
|
|
1226
|
+
${c ? "bg-zinc-900" : "bg-white"}
|
|
1227
|
+
`,
|
|
1228
|
+
children: [
|
|
1229
|
+
/* @__PURE__ */ e(
|
|
1230
|
+
"button",
|
|
1231
|
+
{
|
|
1232
|
+
type: "button",
|
|
1233
|
+
className: `
|
|
1213
1234
|
w-9 h-9 flex items-center justify-center rounded-full flex-shrink-0
|
|
1214
1235
|
border transition-colors
|
|
1215
|
-
${
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1236
|
+
${c ? "border-zinc-700 text-zinc-400 hover:bg-zinc-800" : "border-gray-300 text-gray-500 hover:bg-gray-100"}
|
|
1237
|
+
`,
|
|
1238
|
+
"aria-label": "Add attachment",
|
|
1239
|
+
children: /* @__PURE__ */ e(
|
|
1240
|
+
"svg",
|
|
1241
|
+
{
|
|
1242
|
+
className: "w-5 h-5",
|
|
1243
|
+
fill: "none",
|
|
1244
|
+
viewBox: "0 0 24 24",
|
|
1245
|
+
stroke: "currentColor",
|
|
1246
|
+
children: /* @__PURE__ */ e(
|
|
1247
|
+
"path",
|
|
1248
|
+
{
|
|
1249
|
+
strokeLinecap: "round",
|
|
1250
|
+
strokeLinejoin: "round",
|
|
1251
|
+
strokeWidth: 2,
|
|
1252
|
+
d: "M12 4v16m8-8H4"
|
|
1253
|
+
}
|
|
1254
|
+
)
|
|
1255
|
+
}
|
|
1256
|
+
)
|
|
1257
|
+
}
|
|
1258
|
+
),
|
|
1259
|
+
/* @__PURE__ */ l(
|
|
1260
|
+
"div",
|
|
1261
|
+
{
|
|
1262
|
+
className: `
|
|
1222
1263
|
flex-1 flex items-center gap-2 px-4 py-2 rounded-full
|
|
1223
|
-
${
|
|
1224
|
-
`,
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1264
|
+
${c ? "bg-zinc-800" : "bg-gray-100"}
|
|
1265
|
+
`,
|
|
1266
|
+
children: [
|
|
1267
|
+
/* @__PURE__ */ e(
|
|
1268
|
+
"span",
|
|
1269
|
+
{
|
|
1270
|
+
className: `flex-1 text-sm ${c ? "text-zinc-500" : "text-gray-400"}`,
|
|
1271
|
+
children: "RCS message"
|
|
1272
|
+
}
|
|
1273
|
+
),
|
|
1274
|
+
/* @__PURE__ */ e(
|
|
1275
|
+
"button",
|
|
1276
|
+
{
|
|
1277
|
+
type: "button",
|
|
1278
|
+
className: `p-1 ${c ? "text-zinc-500" : "text-gray-400"}`,
|
|
1279
|
+
"aria-label": "Emoji",
|
|
1280
|
+
children: /* @__PURE__ */ e(
|
|
1281
|
+
"svg",
|
|
1282
|
+
{
|
|
1283
|
+
className: "w-5 h-5",
|
|
1284
|
+
fill: "none",
|
|
1285
|
+
viewBox: "0 0 24 24",
|
|
1286
|
+
stroke: "currentColor",
|
|
1287
|
+
children: /* @__PURE__ */ e(
|
|
1288
|
+
"path",
|
|
1289
|
+
{
|
|
1290
|
+
strokeLinecap: "round",
|
|
1291
|
+
strokeLinejoin: "round",
|
|
1292
|
+
strokeWidth: 2,
|
|
1293
|
+
d: "M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
1294
|
+
}
|
|
1295
|
+
)
|
|
1296
|
+
}
|
|
1297
|
+
)
|
|
1298
|
+
}
|
|
1299
|
+
),
|
|
1300
|
+
/* @__PURE__ */ e(
|
|
1301
|
+
"button",
|
|
1302
|
+
{
|
|
1303
|
+
type: "button",
|
|
1304
|
+
className: `p-1 ${c ? "text-zinc-500" : "text-gray-400"}`,
|
|
1305
|
+
"aria-label": "Attach image",
|
|
1306
|
+
children: /* @__PURE__ */ e(
|
|
1307
|
+
"svg",
|
|
1308
|
+
{
|
|
1309
|
+
className: "w-5 h-5",
|
|
1310
|
+
fill: "none",
|
|
1311
|
+
viewBox: "0 0 24 24",
|
|
1312
|
+
stroke: "currentColor",
|
|
1313
|
+
children: /* @__PURE__ */ e(
|
|
1314
|
+
"path",
|
|
1315
|
+
{
|
|
1316
|
+
strokeLinecap: "round",
|
|
1317
|
+
strokeLinejoin: "round",
|
|
1318
|
+
strokeWidth: 2,
|
|
1319
|
+
d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"
|
|
1320
|
+
}
|
|
1321
|
+
)
|
|
1322
|
+
}
|
|
1323
|
+
)
|
|
1324
|
+
}
|
|
1325
|
+
)
|
|
1326
|
+
]
|
|
1327
|
+
}
|
|
1328
|
+
),
|
|
1329
|
+
/* @__PURE__ */ e(
|
|
1330
|
+
"button",
|
|
1331
|
+
{
|
|
1332
|
+
type: "button",
|
|
1333
|
+
className: "w-10 h-10 flex items-center justify-center rounded-full bg-green-100 text-green-600 flex-shrink-0",
|
|
1334
|
+
"aria-label": "Voice message",
|
|
1335
|
+
children: /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { d: "M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm-1 1.93c-3.94-.49-7-3.85-7-7.93h2c0 3.31 2.69 6 6 6s6-2.69 6-6h2c0 4.08-3.06 7.44-7 7.93V20h4v2H8v-2h4v-4.07z" }) })
|
|
1336
|
+
}
|
|
1337
|
+
)
|
|
1338
|
+
]
|
|
1339
|
+
}
|
|
1340
|
+
)
|
|
1341
|
+
]
|
|
1342
|
+
}
|
|
1343
|
+
);
|
|
1344
|
+
}), He = g(function() {
|
|
1345
|
+
const { theme: t, businessInfo: n, toggleProfile: o } = N(), [s, a] = z("info"), i = t === "dark", u = n.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", c = n.brandColor || "#0084ff";
|
|
1346
|
+
return /* @__PURE__ */ l(
|
|
1347
|
+
"div",
|
|
1348
|
+
{
|
|
1349
|
+
className: `
|
|
1265
1350
|
absolute inset-0 z-50 flex flex-col
|
|
1266
|
-
${
|
|
1267
|
-
`,
|
|
1351
|
+
${i ? "bg-zinc-950" : "bg-white"}
|
|
1352
|
+
`,
|
|
1353
|
+
children: [
|
|
1354
|
+
/* @__PURE__ */ l(
|
|
1355
|
+
"header",
|
|
1356
|
+
{
|
|
1357
|
+
className: `
|
|
1268
1358
|
flex items-center gap-3 px-4 py-3 border-b
|
|
1269
|
-
${
|
|
1270
|
-
`,
|
|
1359
|
+
${i ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-200"}
|
|
1360
|
+
`,
|
|
1361
|
+
children: [
|
|
1362
|
+
/* @__PURE__ */ e(
|
|
1363
|
+
"button",
|
|
1364
|
+
{
|
|
1365
|
+
onClick: o,
|
|
1366
|
+
className: `
|
|
1271
1367
|
p-1.5 -ml-1.5 rounded-full transition-colors
|
|
1272
|
-
${
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1368
|
+
${i ? "hover:bg-zinc-800 text-white" : "hover:bg-gray-100 text-gray-900"}
|
|
1369
|
+
`,
|
|
1370
|
+
"aria-label": "Go back",
|
|
1371
|
+
children: /* @__PURE__ */ e(
|
|
1372
|
+
"svg",
|
|
1373
|
+
{
|
|
1374
|
+
className: "w-5 h-5",
|
|
1375
|
+
fill: "none",
|
|
1376
|
+
viewBox: "0 0 24 24",
|
|
1377
|
+
stroke: "currentColor",
|
|
1378
|
+
children: /* @__PURE__ */ e(
|
|
1379
|
+
"path",
|
|
1380
|
+
{
|
|
1381
|
+
strokeLinecap: "round",
|
|
1382
|
+
strokeLinejoin: "round",
|
|
1383
|
+
strokeWidth: 2,
|
|
1384
|
+
d: "M15 19l-7-7 7-7"
|
|
1385
|
+
}
|
|
1386
|
+
)
|
|
1387
|
+
}
|
|
1388
|
+
)
|
|
1389
|
+
}
|
|
1390
|
+
),
|
|
1391
|
+
/* @__PURE__ */ e(
|
|
1392
|
+
"span",
|
|
1393
|
+
{
|
|
1394
|
+
className: `text-base font-medium ${i ? "text-white" : "text-gray-900"}`,
|
|
1395
|
+
children: "Info & options"
|
|
1396
|
+
}
|
|
1397
|
+
)
|
|
1398
|
+
]
|
|
1399
|
+
}
|
|
1400
|
+
),
|
|
1401
|
+
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto", children: [
|
|
1402
|
+
/* @__PURE__ */ e("div", { className: "relative h-40 bg-gray-200", children: /* @__PURE__ */ e(
|
|
1403
|
+
"img",
|
|
1404
|
+
{
|
|
1405
|
+
src: u,
|
|
1406
|
+
alt: "Business banner",
|
|
1407
|
+
className: "w-full h-full object-cover"
|
|
1408
|
+
}
|
|
1409
|
+
) }),
|
|
1410
|
+
/* @__PURE__ */ e("div", { className: "relative px-4", children: /* @__PURE__ */ e(
|
|
1411
|
+
"div",
|
|
1412
|
+
{
|
|
1413
|
+
className: `
|
|
1289
1414
|
absolute -top-10 left-1/2 -translate-x-1/2
|
|
1290
1415
|
w-20 h-20 rounded-full overflow-hidden border-4
|
|
1291
|
-
${
|
|
1416
|
+
${i ? "border-zinc-950 bg-zinc-800" : "border-white bg-gray-100"}
|
|
1292
1417
|
shadow-lg
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1418
|
+
`,
|
|
1419
|
+
children: n.logo ? /* @__PURE__ */ e(
|
|
1420
|
+
"img",
|
|
1421
|
+
{
|
|
1422
|
+
src: n.logo,
|
|
1423
|
+
alt: `${n.name} logo`,
|
|
1424
|
+
className: "w-full h-full object-cover"
|
|
1425
|
+
}
|
|
1426
|
+
) : /* @__PURE__ */ e(
|
|
1427
|
+
"div",
|
|
1428
|
+
{
|
|
1429
|
+
className: "w-full h-full flex items-center justify-center text-2xl font-bold text-white",
|
|
1430
|
+
style: { backgroundColor: c },
|
|
1431
|
+
children: n.name.charAt(0).toUpperCase()
|
|
1432
|
+
}
|
|
1433
|
+
)
|
|
1434
|
+
}
|
|
1435
|
+
) }),
|
|
1436
|
+
/* @__PURE__ */ l("div", { className: "pt-12 pb-4 px-4 text-center", children: [
|
|
1437
|
+
/* @__PURE__ */ e(
|
|
1438
|
+
"h1",
|
|
1439
|
+
{
|
|
1440
|
+
className: `text-xl font-semibold ${i ? "text-white" : "text-gray-900"}`,
|
|
1441
|
+
children: n.name
|
|
1442
|
+
}
|
|
1443
|
+
),
|
|
1444
|
+
n.description && /* @__PURE__ */ e("p", { className: `text-sm mt-1 ${i ? "text-zinc-400" : "text-gray-500"}`, children: n.description })
|
|
1445
|
+
] }),
|
|
1446
|
+
/* @__PURE__ */ l("div", { className: "flex justify-center gap-4 px-4 pb-4", children: [
|
|
1447
|
+
n.phoneNumbers && n.phoneNumbers.length > 0 && /* @__PURE__ */ e(
|
|
1448
|
+
_,
|
|
1449
|
+
{
|
|
1450
|
+
icon: "phone",
|
|
1451
|
+
label: "Call",
|
|
1452
|
+
isDark: i,
|
|
1453
|
+
brandColor: c,
|
|
1454
|
+
onClick: () => {
|
|
1455
|
+
const d = n.phoneNumbers?.[0]?.number;
|
|
1456
|
+
d && (window.location.href = `tel:${d}`);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
),
|
|
1460
|
+
n.websites && n.websites.length > 0 && /* @__PURE__ */ e(
|
|
1461
|
+
_,
|
|
1462
|
+
{
|
|
1463
|
+
icon: "globe",
|
|
1464
|
+
label: "Website",
|
|
1465
|
+
isDark: i,
|
|
1466
|
+
brandColor: c,
|
|
1467
|
+
onClick: () => {
|
|
1468
|
+
const d = n.websites?.[0]?.url;
|
|
1469
|
+
d && window.open(d, "_blank", "noopener,noreferrer");
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
),
|
|
1473
|
+
n.emails && n.emails.length > 0 && /* @__PURE__ */ e(
|
|
1474
|
+
_,
|
|
1475
|
+
{
|
|
1476
|
+
icon: "mail",
|
|
1477
|
+
label: "Contact",
|
|
1478
|
+
isDark: i,
|
|
1479
|
+
brandColor: c,
|
|
1480
|
+
onClick: () => {
|
|
1481
|
+
const d = n.emails?.[0]?.email;
|
|
1482
|
+
d && (window.location.href = `mailto:${d}`);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
)
|
|
1486
|
+
] }),
|
|
1487
|
+
/* @__PURE__ */ l(
|
|
1488
|
+
"div",
|
|
1489
|
+
{
|
|
1490
|
+
className: `
|
|
1332
1491
|
flex mx-4 rounded-lg overflow-hidden border
|
|
1333
|
-
${
|
|
1334
|
-
`,
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
globe: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }),
|
|
1377
|
-
mail: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" })
|
|
1378
|
-
}, e[0] = i) : i = e[0];
|
|
1379
|
-
const a = i, f = `
|
|
1492
|
+
${i ? "border-zinc-700 bg-zinc-800" : "border-gray-200 bg-gray-100"}
|
|
1493
|
+
`,
|
|
1494
|
+
children: [
|
|
1495
|
+
/* @__PURE__ */ e(
|
|
1496
|
+
F,
|
|
1497
|
+
{
|
|
1498
|
+
active: s === "info",
|
|
1499
|
+
onClick: () => a("info"),
|
|
1500
|
+
isDark: i,
|
|
1501
|
+
brandColor: c,
|
|
1502
|
+
children: "Info"
|
|
1503
|
+
}
|
|
1504
|
+
),
|
|
1505
|
+
/* @__PURE__ */ e(
|
|
1506
|
+
F,
|
|
1507
|
+
{
|
|
1508
|
+
active: s === "options",
|
|
1509
|
+
onClick: () => a("options"),
|
|
1510
|
+
isDark: i,
|
|
1511
|
+
brandColor: c,
|
|
1512
|
+
children: "Options"
|
|
1513
|
+
}
|
|
1514
|
+
)
|
|
1515
|
+
]
|
|
1516
|
+
}
|
|
1517
|
+
),
|
|
1518
|
+
/* @__PURE__ */ e("div", { className: "p-4", children: s === "info" ? /* @__PURE__ */ e(_e, { isDark: i, brandColor: c }) : /* @__PURE__ */ e(Ue, { isDark: i }) })
|
|
1519
|
+
] })
|
|
1520
|
+
]
|
|
1521
|
+
}
|
|
1522
|
+
);
|
|
1523
|
+
}), _ = g(function({
|
|
1524
|
+
icon: t,
|
|
1525
|
+
label: n,
|
|
1526
|
+
isDark: o,
|
|
1527
|
+
brandColor: s,
|
|
1528
|
+
onClick: a
|
|
1529
|
+
}) {
|
|
1530
|
+
return /* @__PURE__ */ l(
|
|
1531
|
+
"button",
|
|
1532
|
+
{
|
|
1533
|
+
onClick: a,
|
|
1534
|
+
className: `
|
|
1380
1535
|
flex flex-col items-center gap-2 px-6 py-3 rounded-xl border transition-colors
|
|
1381
1536
|
${o ? "bg-zinc-800 border-zinc-700 hover:bg-zinc-700" : "bg-white border-gray-200 hover:bg-gray-50"}
|
|
1382
|
-
`,
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1537
|
+
`,
|
|
1538
|
+
children: [
|
|
1539
|
+
/* @__PURE__ */ e(
|
|
1540
|
+
"svg",
|
|
1541
|
+
{
|
|
1542
|
+
className: "w-6 h-6",
|
|
1543
|
+
fill: "none",
|
|
1544
|
+
viewBox: "0 0 24 24",
|
|
1545
|
+
stroke: s,
|
|
1546
|
+
children: {
|
|
1547
|
+
phone: /* @__PURE__ */ e(
|
|
1548
|
+
"path",
|
|
1549
|
+
{
|
|
1550
|
+
strokeLinecap: "round",
|
|
1551
|
+
strokeLinejoin: "round",
|
|
1552
|
+
strokeWidth: 2,
|
|
1553
|
+
d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
|
|
1554
|
+
}
|
|
1555
|
+
),
|
|
1556
|
+
globe: /* @__PURE__ */ e(
|
|
1557
|
+
"path",
|
|
1558
|
+
{
|
|
1559
|
+
strokeLinecap: "round",
|
|
1560
|
+
strokeLinejoin: "round",
|
|
1561
|
+
strokeWidth: 2,
|
|
1562
|
+
d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"
|
|
1563
|
+
}
|
|
1564
|
+
),
|
|
1565
|
+
mail: /* @__PURE__ */ e(
|
|
1566
|
+
"path",
|
|
1567
|
+
{
|
|
1568
|
+
strokeLinecap: "round",
|
|
1569
|
+
strokeLinejoin: "round",
|
|
1570
|
+
strokeWidth: 2,
|
|
1571
|
+
d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
1572
|
+
}
|
|
1573
|
+
)
|
|
1574
|
+
}[t]
|
|
1575
|
+
}
|
|
1576
|
+
),
|
|
1577
|
+
/* @__PURE__ */ e(
|
|
1578
|
+
"span",
|
|
1579
|
+
{
|
|
1580
|
+
className: `text-xs font-medium ${o ? "text-zinc-300" : "text-gray-600"}`,
|
|
1581
|
+
children: n
|
|
1582
|
+
}
|
|
1583
|
+
)
|
|
1584
|
+
]
|
|
1585
|
+
}
|
|
1586
|
+
);
|
|
1587
|
+
}), F = g(function({
|
|
1588
|
+
active: t,
|
|
1589
|
+
onClick: n,
|
|
1590
|
+
isDark: o,
|
|
1591
|
+
brandColor: s,
|
|
1592
|
+
children: a
|
|
1593
|
+
}) {
|
|
1594
|
+
return /* @__PURE__ */ e(
|
|
1595
|
+
"button",
|
|
1596
|
+
{
|
|
1597
|
+
onClick: n,
|
|
1598
|
+
className: `
|
|
1401
1599
|
flex-1 py-2.5 text-sm font-medium transition-colors rounded-lg
|
|
1402
|
-
${
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
} = t, {
|
|
1415
|
-
businessInfo: o
|
|
1416
|
-
} = K();
|
|
1417
|
-
if (!(o.phoneNumbers && o.phoneNumbers.length > 0 || o.websites && o.websites.length > 0 || o.emails && o.emails.length > 0)) {
|
|
1418
|
-
const d = `text-center py-8 ${s ? "text-zinc-500" : "text-gray-400"}`;
|
|
1419
|
-
let u;
|
|
1420
|
-
return e[0] !== d ? (u = /* @__PURE__ */ n("div", { className: d, children: "No contact information available" }), e[0] = d, e[1] = u) : u = e[1], u;
|
|
1421
|
-
}
|
|
1422
|
-
const r = `
|
|
1600
|
+
${t ? "text-white" : o ? "text-zinc-400 hover:text-zinc-200" : "text-gray-500 hover:text-gray-700"}
|
|
1601
|
+
`,
|
|
1602
|
+
style: t ? { backgroundColor: s } : void 0,
|
|
1603
|
+
children: a
|
|
1604
|
+
}
|
|
1605
|
+
);
|
|
1606
|
+
}), _e = g(function({ isDark: t, brandColor: n }) {
|
|
1607
|
+
const { businessInfo: o } = N();
|
|
1608
|
+
return o.phoneNumbers && o.phoneNumbers.length > 0 || o.websites && o.websites.length > 0 || o.emails && o.emails.length > 0 ? /* @__PURE__ */ l(
|
|
1609
|
+
"div",
|
|
1610
|
+
{
|
|
1611
|
+
className: `
|
|
1423
1612
|
rounded-xl overflow-hidden border divide-y
|
|
1424
|
-
${
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1613
|
+
${t ? "bg-zinc-900 border-zinc-800 divide-zinc-800" : "bg-gray-50 border-gray-200 divide-gray-200"}
|
|
1614
|
+
`,
|
|
1615
|
+
children: [
|
|
1616
|
+
o.phoneNumbers?.map((a, i) => /* @__PURE__ */ e(
|
|
1617
|
+
U,
|
|
1618
|
+
{
|
|
1619
|
+
icon: "phone",
|
|
1620
|
+
primary: a.number,
|
|
1621
|
+
secondary: a.label,
|
|
1622
|
+
isDark: t,
|
|
1623
|
+
brandColor: n,
|
|
1624
|
+
onClick: () => window.location.href = `tel:${a.number}`
|
|
1625
|
+
},
|
|
1626
|
+
`phone-${i}`
|
|
1627
|
+
)),
|
|
1628
|
+
o.websites?.map((a, i) => /* @__PURE__ */ e(
|
|
1629
|
+
U,
|
|
1630
|
+
{
|
|
1631
|
+
icon: "globe",
|
|
1632
|
+
primary: a.url.replace(/^https?:\/\//, ""),
|
|
1633
|
+
secondary: a.label || "Website",
|
|
1634
|
+
isDark: t,
|
|
1635
|
+
brandColor: n,
|
|
1636
|
+
onClick: () => window.open(a.url, "_blank", "noopener,noreferrer")
|
|
1637
|
+
},
|
|
1638
|
+
`web-${i}`
|
|
1639
|
+
)),
|
|
1640
|
+
o.emails?.map((a, i) => /* @__PURE__ */ e(
|
|
1641
|
+
U,
|
|
1642
|
+
{
|
|
1643
|
+
icon: "mail",
|
|
1644
|
+
primary: a.email,
|
|
1645
|
+
secondary: a.label || "Email",
|
|
1646
|
+
isDark: t,
|
|
1647
|
+
brandColor: n,
|
|
1648
|
+
onClick: () => window.location.href = `mailto:${a.email}`
|
|
1649
|
+
},
|
|
1650
|
+
`email-${i}`
|
|
1651
|
+
))
|
|
1652
|
+
]
|
|
1653
|
+
}
|
|
1654
|
+
) : /* @__PURE__ */ e(
|
|
1655
|
+
"div",
|
|
1656
|
+
{
|
|
1657
|
+
className: `text-center py-8 ${t ? "text-zinc-500" : "text-gray-400"}`,
|
|
1658
|
+
children: "No contact information available"
|
|
1659
|
+
}
|
|
1660
|
+
);
|
|
1661
|
+
}), U = g(function({
|
|
1662
|
+
icon: t,
|
|
1663
|
+
primary: n,
|
|
1664
|
+
secondary: o,
|
|
1665
|
+
isDark: s,
|
|
1666
|
+
onClick: a
|
|
1667
|
+
}) {
|
|
1668
|
+
return /* @__PURE__ */ l(
|
|
1669
|
+
"button",
|
|
1670
|
+
{
|
|
1671
|
+
onClick: a,
|
|
1672
|
+
className: `
|
|
1453
1673
|
w-full flex items-center gap-4 px-4 py-3.5 text-left transition-colors
|
|
1454
|
-
${
|
|
1455
|
-
`,
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1674
|
+
${s ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
|
|
1675
|
+
`,
|
|
1676
|
+
children: [
|
|
1677
|
+
/* @__PURE__ */ e(
|
|
1678
|
+
"svg",
|
|
1679
|
+
{
|
|
1680
|
+
className: `w-5 h-5 flex-shrink-0 ${s ? "text-zinc-500" : "text-gray-400"}`,
|
|
1681
|
+
fill: "none",
|
|
1682
|
+
viewBox: "0 0 24 24",
|
|
1683
|
+
stroke: "currentColor",
|
|
1684
|
+
children: /* @__PURE__ */ e(
|
|
1685
|
+
"path",
|
|
1686
|
+
{
|
|
1687
|
+
strokeLinecap: "round",
|
|
1688
|
+
strokeLinejoin: "round",
|
|
1689
|
+
strokeWidth: 2,
|
|
1690
|
+
d: {
|
|
1691
|
+
phone: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",
|
|
1692
|
+
globe: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",
|
|
1693
|
+
mail: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
1694
|
+
}[t]
|
|
1695
|
+
}
|
|
1696
|
+
)
|
|
1697
|
+
}
|
|
1698
|
+
),
|
|
1699
|
+
/* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children: [
|
|
1700
|
+
/* @__PURE__ */ e(
|
|
1701
|
+
"p",
|
|
1702
|
+
{
|
|
1703
|
+
className: `text-sm font-medium truncate ${s ? "text-white" : "text-gray-900"}`,
|
|
1704
|
+
children: n
|
|
1705
|
+
}
|
|
1706
|
+
),
|
|
1707
|
+
o && /* @__PURE__ */ e(
|
|
1708
|
+
"p",
|
|
1709
|
+
{
|
|
1710
|
+
className: `text-xs truncate ${s ? "text-zinc-500" : "text-gray-500"}`,
|
|
1711
|
+
children: o
|
|
1712
|
+
}
|
|
1713
|
+
)
|
|
1714
|
+
] })
|
|
1715
|
+
]
|
|
1716
|
+
}
|
|
1717
|
+
);
|
|
1718
|
+
}), Ue = g(function({ isDark: t }) {
|
|
1719
|
+
return /* @__PURE__ */ l(
|
|
1720
|
+
"div",
|
|
1721
|
+
{
|
|
1722
|
+
className: `
|
|
1479
1723
|
rounded-xl overflow-hidden border divide-y
|
|
1480
|
-
${
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1724
|
+
${t ? "bg-zinc-900 border-zinc-800 divide-zinc-800" : "bg-gray-50 border-gray-200 divide-gray-200"}
|
|
1725
|
+
`,
|
|
1726
|
+
children: [
|
|
1727
|
+
/* @__PURE__ */ e(
|
|
1728
|
+
D,
|
|
1729
|
+
{
|
|
1730
|
+
icon: "bell",
|
|
1731
|
+
label: "Notifications",
|
|
1732
|
+
isDark: t
|
|
1733
|
+
}
|
|
1734
|
+
),
|
|
1735
|
+
/* @__PURE__ */ e(
|
|
1736
|
+
D,
|
|
1737
|
+
{
|
|
1738
|
+
icon: "block",
|
|
1739
|
+
label: "Block & report spam",
|
|
1740
|
+
isDark: t
|
|
1741
|
+
}
|
|
1742
|
+
),
|
|
1743
|
+
/* @__PURE__ */ e(
|
|
1744
|
+
D,
|
|
1745
|
+
{
|
|
1746
|
+
icon: "info",
|
|
1747
|
+
label: "About RCS",
|
|
1748
|
+
isDark: t
|
|
1749
|
+
}
|
|
1750
|
+
)
|
|
1751
|
+
]
|
|
1752
|
+
}
|
|
1753
|
+
);
|
|
1754
|
+
}), D = g(function({
|
|
1755
|
+
icon: t,
|
|
1756
|
+
label: n,
|
|
1757
|
+
isDark: o
|
|
1758
|
+
}) {
|
|
1759
|
+
return /* @__PURE__ */ l(
|
|
1760
|
+
"button",
|
|
1761
|
+
{
|
|
1762
|
+
className: `
|
|
1503
1763
|
w-full flex items-center gap-4 px-4 py-3.5 text-left transition-colors
|
|
1504
1764
|
${o ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
|
|
1505
|
-
`,
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1765
|
+
`,
|
|
1766
|
+
children: [
|
|
1767
|
+
/* @__PURE__ */ e(
|
|
1768
|
+
"svg",
|
|
1769
|
+
{
|
|
1770
|
+
className: `w-5 h-5 flex-shrink-0 ${o ? "text-zinc-500" : "text-gray-400"}`,
|
|
1771
|
+
fill: "none",
|
|
1772
|
+
viewBox: "0 0 24 24",
|
|
1773
|
+
stroke: "currentColor",
|
|
1774
|
+
children: /* @__PURE__ */ e(
|
|
1775
|
+
"path",
|
|
1776
|
+
{
|
|
1777
|
+
strokeLinecap: "round",
|
|
1778
|
+
strokeLinejoin: "round",
|
|
1779
|
+
strokeWidth: 2,
|
|
1780
|
+
d: {
|
|
1781
|
+
bell: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",
|
|
1782
|
+
block: "M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",
|
|
1783
|
+
info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
1784
|
+
}[t]
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
}
|
|
1788
|
+
),
|
|
1789
|
+
/* @__PURE__ */ e(
|
|
1790
|
+
"span",
|
|
1791
|
+
{
|
|
1792
|
+
className: `text-sm font-medium ${o ? "text-white" : "text-gray-900"}`,
|
|
1793
|
+
children: n
|
|
1794
|
+
}
|
|
1795
|
+
)
|
|
1796
|
+
]
|
|
1797
|
+
}
|
|
1798
|
+
);
|
|
1799
|
+
}), J = {
|
|
1519
1800
|
FULL: "h-full",
|
|
1520
1801
|
TALL: "h-[80%]",
|
|
1521
1802
|
HALF: "h-[50%]"
|
|
1522
|
-
},
|
|
1523
|
-
const t =
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
},
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
}, t[5] = y) : y = t[5];
|
|
1545
|
-
const w = y, x = bt;
|
|
1546
|
-
if (!l || !l.isOpen)
|
|
1547
|
-
return null;
|
|
1548
|
-
const {
|
|
1549
|
-
url: k,
|
|
1550
|
-
viewMode: v,
|
|
1551
|
-
title: N,
|
|
1552
|
-
postbackData: L
|
|
1553
|
-
} = l;
|
|
1554
|
-
let M;
|
|
1555
|
-
t[6] !== N || t[7] !== k ? (M = N || x(k), t[6] = N, t[7] = k, t[8] = M) : M = t[8];
|
|
1556
|
-
const _ = M, A = v === "FULL", z = v === "TALL" || v === "HALF", $ = ve[v] || ve.TALL, S = `
|
|
1803
|
+
}, De = g(function() {
|
|
1804
|
+
const { theme: t, businessInfo: n, webView: o, closeWebView: s } = N(), [a, i] = z(!0), [u, c] = z(!1), d = t === "dark", m = n.brandColor || "#0084ff";
|
|
1805
|
+
S(() => {
|
|
1806
|
+
o?.url && (i(!0), c(!1));
|
|
1807
|
+
}, [o?.url]);
|
|
1808
|
+
const f = M(() => {
|
|
1809
|
+
i(!1);
|
|
1810
|
+
}, []), v = M(() => {
|
|
1811
|
+
i(!1), c(!0);
|
|
1812
|
+
}, []), x = (k) => {
|
|
1813
|
+
try {
|
|
1814
|
+
return new URL(k).hostname;
|
|
1815
|
+
} catch {
|
|
1816
|
+
return "Web Page";
|
|
1817
|
+
}
|
|
1818
|
+
};
|
|
1819
|
+
if (!o || !o.isOpen) return null;
|
|
1820
|
+
const { url: L, viewMode: b, title: p, postbackData: y } = o, h = p || x(L), w = b === "FULL", C = b === "TALL" || b === "HALF", I = J[b] || J.TALL;
|
|
1821
|
+
return /* @__PURE__ */ l(
|
|
1822
|
+
"div",
|
|
1823
|
+
{
|
|
1824
|
+
className: `
|
|
1557
1825
|
rcs-webview-overlay absolute inset-0 z-50 flex flex-col
|
|
1558
|
-
${
|
|
1559
|
-
${
|
|
1560
|
-
`,
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1826
|
+
${w ? "" : "justify-end"}
|
|
1827
|
+
${d ? "bg-black/60" : "bg-black/40"}
|
|
1828
|
+
`,
|
|
1829
|
+
role: "dialog",
|
|
1830
|
+
"aria-modal": "true",
|
|
1831
|
+
"aria-label": `WebView: ${h}`,
|
|
1832
|
+
"data-postback": y,
|
|
1833
|
+
"data-view-mode": b,
|
|
1834
|
+
children: [
|
|
1835
|
+
C && /* @__PURE__ */ e(
|
|
1836
|
+
"button",
|
|
1837
|
+
{
|
|
1838
|
+
type: "button",
|
|
1839
|
+
className: "absolute inset-0 w-full h-full cursor-default",
|
|
1840
|
+
onClick: s,
|
|
1841
|
+
"aria-label": "Close WebView"
|
|
1842
|
+
}
|
|
1843
|
+
),
|
|
1844
|
+
/* @__PURE__ */ l(
|
|
1845
|
+
"div",
|
|
1846
|
+
{
|
|
1847
|
+
className: `
|
|
1564
1848
|
rcs-webview-container relative flex flex-col overflow-hidden
|
|
1565
|
-
${
|
|
1566
|
-
${
|
|
1567
|
-
${
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1849
|
+
${d ? "bg-zinc-900" : "bg-white"}
|
|
1850
|
+
${I} w-full
|
|
1851
|
+
${C ? "rounded-t-2xl shadow-2xl" : ""}
|
|
1852
|
+
`,
|
|
1853
|
+
style: {
|
|
1854
|
+
// Ensure container is above backdrop
|
|
1855
|
+
position: "relative",
|
|
1856
|
+
zIndex: 1
|
|
1857
|
+
},
|
|
1858
|
+
children: [
|
|
1859
|
+
/* @__PURE__ */ l(
|
|
1860
|
+
"header",
|
|
1861
|
+
{
|
|
1862
|
+
className: `
|
|
1575
1863
|
rcs-webview-header flex items-center gap-3 px-2 py-2 flex-shrink-0
|
|
1576
1864
|
border-b
|
|
1577
|
-
${
|
|
1578
|
-
`,
|
|
1865
|
+
${d ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-200"}
|
|
1866
|
+
`,
|
|
1867
|
+
children: [
|
|
1868
|
+
/* @__PURE__ */ e(
|
|
1869
|
+
"button",
|
|
1870
|
+
{
|
|
1871
|
+
type: "button",
|
|
1872
|
+
onClick: s,
|
|
1873
|
+
className: `
|
|
1579
1874
|
rcs-webview-close w-10 h-10 rounded-full flex items-center justify-center
|
|
1580
1875
|
transition-colors
|
|
1581
|
-
${
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1876
|
+
${d ? "text-white hover:bg-zinc-800" : "text-gray-700 hover:bg-gray-100"}
|
|
1877
|
+
`,
|
|
1878
|
+
"aria-label": "Close WebView",
|
|
1879
|
+
children: /* @__PURE__ */ e(
|
|
1880
|
+
"svg",
|
|
1881
|
+
{
|
|
1882
|
+
className: "w-6 h-6",
|
|
1883
|
+
fill: "none",
|
|
1884
|
+
viewBox: "0 0 24 24",
|
|
1885
|
+
stroke: "currentColor",
|
|
1886
|
+
strokeWidth: 2,
|
|
1887
|
+
children: /* @__PURE__ */ e(
|
|
1888
|
+
"path",
|
|
1889
|
+
{
|
|
1890
|
+
strokeLinecap: "round",
|
|
1891
|
+
strokeLinejoin: "round",
|
|
1892
|
+
d: "M15 19l-7-7 7-7"
|
|
1893
|
+
}
|
|
1894
|
+
)
|
|
1895
|
+
}
|
|
1896
|
+
)
|
|
1897
|
+
}
|
|
1898
|
+
),
|
|
1899
|
+
/* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children: [
|
|
1900
|
+
/* @__PURE__ */ e(
|
|
1901
|
+
"h2",
|
|
1902
|
+
{
|
|
1903
|
+
className: `
|
|
1588
1904
|
rcs-webview-title text-base font-medium truncate
|
|
1589
|
-
${
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1905
|
+
${d ? "text-white" : "text-gray-900"}
|
|
1906
|
+
`,
|
|
1907
|
+
children: h
|
|
1908
|
+
}
|
|
1909
|
+
),
|
|
1910
|
+
/* @__PURE__ */ e(
|
|
1911
|
+
"p",
|
|
1912
|
+
{
|
|
1913
|
+
className: `
|
|
1594
1914
|
rcs-webview-url text-xs truncate
|
|
1595
|
-
${
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
const q = `
|
|
1915
|
+
${d ? "text-zinc-400" : "text-gray-500"}
|
|
1916
|
+
`,
|
|
1917
|
+
children: x(L)
|
|
1918
|
+
}
|
|
1919
|
+
)
|
|
1920
|
+
] }),
|
|
1921
|
+
/* @__PURE__ */ e(
|
|
1922
|
+
"button",
|
|
1923
|
+
{
|
|
1924
|
+
type: "button",
|
|
1925
|
+
className: `
|
|
1607
1926
|
w-10 h-10 rounded-full flex items-center justify-center
|
|
1608
|
-
${
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1927
|
+
${d ? "text-zinc-400 hover:bg-zinc-800" : "text-gray-500 hover:bg-gray-100"}
|
|
1928
|
+
`,
|
|
1929
|
+
"aria-label": "More options",
|
|
1930
|
+
children: /* @__PURE__ */ l(
|
|
1931
|
+
"svg",
|
|
1932
|
+
{
|
|
1933
|
+
className: "w-5 h-5",
|
|
1934
|
+
fill: "currentColor",
|
|
1935
|
+
viewBox: "0 0 24 24",
|
|
1936
|
+
children: [
|
|
1937
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "5", r: "2" }),
|
|
1938
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "2" }),
|
|
1939
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "19", r: "2" })
|
|
1940
|
+
]
|
|
1941
|
+
}
|
|
1942
|
+
)
|
|
1943
|
+
}
|
|
1944
|
+
)
|
|
1945
|
+
]
|
|
1946
|
+
}
|
|
1947
|
+
),
|
|
1948
|
+
a && /* @__PURE__ */ e(
|
|
1949
|
+
"div",
|
|
1950
|
+
{
|
|
1951
|
+
className: "rcs-webview-loading absolute top-14 left-0 right-0 h-1 overflow-hidden",
|
|
1952
|
+
style: { backgroundColor: `${m}20` },
|
|
1953
|
+
children: /* @__PURE__ */ e(
|
|
1954
|
+
"div",
|
|
1955
|
+
{
|
|
1956
|
+
className: "h-full animate-pulse",
|
|
1957
|
+
style: {
|
|
1958
|
+
backgroundColor: m,
|
|
1959
|
+
animation: "webview-loading 1.5s ease-in-out infinite",
|
|
1960
|
+
width: "30%"
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
)
|
|
1964
|
+
}
|
|
1965
|
+
),
|
|
1966
|
+
u && /* @__PURE__ */ l(
|
|
1967
|
+
"div",
|
|
1968
|
+
{
|
|
1969
|
+
className: `
|
|
1634
1970
|
rcs-webview-error flex-1 flex flex-col items-center justify-center p-6 text-center
|
|
1635
|
-
${
|
|
1636
|
-
`,
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1971
|
+
${d ? "text-zinc-400" : "text-gray-500"}
|
|
1972
|
+
`,
|
|
1973
|
+
children: [
|
|
1974
|
+
/* @__PURE__ */ e(
|
|
1975
|
+
"svg",
|
|
1976
|
+
{
|
|
1977
|
+
className: "w-16 h-16 mb-4 opacity-50",
|
|
1978
|
+
fill: "none",
|
|
1979
|
+
viewBox: "0 0 24 24",
|
|
1980
|
+
stroke: "currentColor",
|
|
1981
|
+
children: /* @__PURE__ */ e(
|
|
1982
|
+
"path",
|
|
1983
|
+
{
|
|
1984
|
+
strokeLinecap: "round",
|
|
1985
|
+
strokeLinejoin: "round",
|
|
1986
|
+
strokeWidth: 1.5,
|
|
1987
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
1988
|
+
}
|
|
1989
|
+
)
|
|
1990
|
+
}
|
|
1991
|
+
),
|
|
1992
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium mb-2", children: "Unable to load page" }),
|
|
1993
|
+
/* @__PURE__ */ e("p", { className: "text-xs opacity-75 mb-4", children: "This content cannot be displayed in the emulator" }),
|
|
1994
|
+
/* @__PURE__ */ e(
|
|
1995
|
+
"button",
|
|
1996
|
+
{
|
|
1997
|
+
type: "button",
|
|
1998
|
+
onClick: s,
|
|
1999
|
+
className: `
|
|
1641
2000
|
px-4 py-2 rounded-full text-sm font-medium
|
|
1642
|
-
${
|
|
1643
|
-
`,
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
2001
|
+
${d ? "bg-zinc-800 text-white hover:bg-zinc-700" : "bg-gray-100 text-gray-700 hover:bg-gray-200"}
|
|
2002
|
+
`,
|
|
2003
|
+
children: "Go Back"
|
|
2004
|
+
}
|
|
2005
|
+
)
|
|
2006
|
+
]
|
|
2007
|
+
}
|
|
2008
|
+
),
|
|
2009
|
+
!u && /* @__PURE__ */ e("div", { className: "rcs-webview-iframe-container flex-1 overflow-hidden", children: /* @__PURE__ */ e(
|
|
2010
|
+
"iframe",
|
|
2011
|
+
{
|
|
2012
|
+
src: L,
|
|
2013
|
+
title: h,
|
|
2014
|
+
className: "w-full h-full border-0",
|
|
2015
|
+
onLoad: f,
|
|
2016
|
+
onError: v,
|
|
2017
|
+
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups",
|
|
2018
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
2019
|
+
loading: "lazy"
|
|
2020
|
+
}
|
|
2021
|
+
) }),
|
|
2022
|
+
C && /* @__PURE__ */ e(
|
|
2023
|
+
"div",
|
|
2024
|
+
{
|
|
2025
|
+
className: `
|
|
1649
2026
|
rcs-webview-safe-area h-2 flex-shrink-0
|
|
1650
|
-
${
|
|
1651
|
-
`
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
se
|
|
1659
|
-
] }), t[50] = H, t[51] = X, t[52] = Z, t[53] = te, t[54] = se, t[55] = D, t[56] = re) : re = t[56];
|
|
1660
|
-
let ce;
|
|
1661
|
-
t[57] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = /* @__PURE__ */ n("style", { children: `
|
|
2027
|
+
${d ? "bg-zinc-900" : "bg-white"}
|
|
2028
|
+
`
|
|
2029
|
+
}
|
|
2030
|
+
)
|
|
2031
|
+
]
|
|
2032
|
+
}
|
|
2033
|
+
),
|
|
2034
|
+
/* @__PURE__ */ e("style", { children: `
|
|
1662
2035
|
@keyframes webview-loading {
|
|
1663
2036
|
0% { transform: translateX(-100%); }
|
|
1664
2037
|
50% { transform: translateX(200%); }
|
|
1665
2038
|
100% { transform: translateX(-100%); }
|
|
1666
2039
|
}
|
|
1667
|
-
` })
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
})
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
return "Web Page";
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
const xt = F(function(t) {
|
|
1683
|
-
const e = B(39), {
|
|
1684
|
-
onUnlock: s,
|
|
1685
|
-
messagePreview: l
|
|
1686
|
-
} = t, o = l === void 0 ? "New message" : l, {
|
|
1687
|
-
theme: g,
|
|
1688
|
-
businessInfo: r
|
|
1689
|
-
} = K();
|
|
1690
|
-
let i;
|
|
1691
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ new Date(), e[0] = i) : i = e[0];
|
|
1692
|
-
const [a, f] = ne(i), h = g === "dark";
|
|
1693
|
-
let d, u;
|
|
1694
|
-
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = () => {
|
|
1695
|
-
const J = setInterval(() => {
|
|
1696
|
-
f(/* @__PURE__ */ new Date());
|
|
2040
|
+
` })
|
|
2041
|
+
]
|
|
2042
|
+
}
|
|
2043
|
+
);
|
|
2044
|
+
}), Oe = g(function({
|
|
2045
|
+
onUnlock: t,
|
|
2046
|
+
messagePreview: n = "New message"
|
|
2047
|
+
}) {
|
|
2048
|
+
const { theme: o, businessInfo: s } = N(), [a, i] = z(/* @__PURE__ */ new Date()), u = o === "dark";
|
|
2049
|
+
S(() => {
|
|
2050
|
+
const f = setInterval(() => {
|
|
2051
|
+
i(/* @__PURE__ */ new Date());
|
|
1697
2052
|
}, 1e3);
|
|
1698
|
-
return () => clearInterval(
|
|
1699
|
-
},
|
|
1700
|
-
|
|
1701
|
-
e[3] !== a ? (m = a.toLocaleTimeString([], {
|
|
2053
|
+
return () => clearInterval(f);
|
|
2054
|
+
}, []);
|
|
2055
|
+
const c = a.toLocaleTimeString([], {
|
|
1702
2056
|
hour: "numeric",
|
|
1703
2057
|
minute: "2-digit",
|
|
1704
2058
|
hour12: !0
|
|
1705
|
-
}),
|
|
1706
|
-
const p = m;
|
|
1707
|
-
let b;
|
|
1708
|
-
e[5] !== a ? (b = a.toLocaleDateString([], {
|
|
2059
|
+
}), d = a.toLocaleDateString([], {
|
|
1709
2060
|
weekday: "short",
|
|
1710
2061
|
month: "long",
|
|
1711
2062
|
day: "numeric"
|
|
1712
|
-
})
|
|
1713
|
-
|
|
2063
|
+
});
|
|
2064
|
+
return /* @__PURE__ */ l(
|
|
2065
|
+
"div",
|
|
2066
|
+
{
|
|
2067
|
+
className: `
|
|
1714
2068
|
lock-screen flex flex-col h-full w-full select-none
|
|
1715
|
-
${
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
2069
|
+
${u ? "bg-zinc-900" : "bg-zinc-800"}
|
|
2070
|
+
`,
|
|
2071
|
+
children: [
|
|
2072
|
+
/* @__PURE__ */ e("div", { className: "h-6" }),
|
|
2073
|
+
/* @__PURE__ */ e("div", { className: "flex justify-center mt-4", children: /* @__PURE__ */ e("div", { className: "w-8 h-8 rounded-full bg-zinc-700 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
2074
|
+
"svg",
|
|
2075
|
+
{
|
|
2076
|
+
className: "w-4 h-4 text-zinc-400",
|
|
2077
|
+
fill: "currentColor",
|
|
2078
|
+
viewBox: "0 0 20 20",
|
|
2079
|
+
children: /* @__PURE__ */ e(
|
|
2080
|
+
"path",
|
|
2081
|
+
{
|
|
2082
|
+
fillRule: "evenodd",
|
|
2083
|
+
d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",
|
|
2084
|
+
clipRule: "evenodd"
|
|
2085
|
+
}
|
|
2086
|
+
)
|
|
2087
|
+
}
|
|
2088
|
+
) }) }),
|
|
2089
|
+
/* @__PURE__ */ e("div", { className: "mt-6 text-center", children: /* @__PURE__ */ e("h1", { className: "text-5xl font-light text-white tracking-tight", children: c }) }),
|
|
2090
|
+
/* @__PURE__ */ l("div", { className: "mt-2 text-center", children: [
|
|
2091
|
+
/* @__PURE__ */ e("p", { className: "text-zinc-400 text-sm", children: d }),
|
|
2092
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-center gap-1 mt-1 text-zinc-500 text-xs", children: [
|
|
2093
|
+
/* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e("path", { d: "M5.5 16a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 16h-8z" }) }),
|
|
2094
|
+
/* @__PURE__ */ e("span", { children: "19°C" })
|
|
2095
|
+
] })
|
|
2096
|
+
] }),
|
|
2097
|
+
/* @__PURE__ */ e("div", { className: "h-24" }),
|
|
2098
|
+
/* @__PURE__ */ e("div", { className: "px-4 pb-8", children: /* @__PURE__ */ l(
|
|
2099
|
+
"button",
|
|
2100
|
+
{
|
|
2101
|
+
onClick: t,
|
|
2102
|
+
className: `w-full bg-white rounded-2xl p-3 flex items-center gap-3 shadow-lg
|
|
2103
|
+
transition-transform active:scale-[0.98] hover:shadow-xl`,
|
|
2104
|
+
children: [
|
|
2105
|
+
/* @__PURE__ */ e("div", { className: "w-12 h-12 rounded-xl bg-zinc-900 flex items-center justify-center flex-shrink-0 overflow-hidden", children: s.logo ? /* @__PURE__ */ e(
|
|
2106
|
+
"img",
|
|
2107
|
+
{
|
|
2108
|
+
src: s.logo,
|
|
2109
|
+
alt: s.name,
|
|
2110
|
+
className: "w-full h-full object-cover"
|
|
2111
|
+
}
|
|
2112
|
+
) : /* @__PURE__ */ e("div", { className: "text-white", children: /* @__PURE__ */ l(
|
|
2113
|
+
"svg",
|
|
2114
|
+
{
|
|
2115
|
+
className: "w-7 h-7",
|
|
2116
|
+
viewBox: "0 0 24 24",
|
|
2117
|
+
fill: "currentColor",
|
|
2118
|
+
children: [
|
|
2119
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "1.5" }),
|
|
2120
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "6", r: "1" }),
|
|
2121
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "18", r: "1" }),
|
|
2122
|
+
/* @__PURE__ */ e("circle", { cx: "6", cy: "12", r: "1" }),
|
|
2123
|
+
/* @__PURE__ */ e("circle", { cx: "18", cy: "12", r: "1" }),
|
|
2124
|
+
/* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "0.8" }),
|
|
2125
|
+
/* @__PURE__ */ e("circle", { cx: "16", cy: "8", r: "0.8" }),
|
|
2126
|
+
/* @__PURE__ */ e("circle", { cx: "8", cy: "16", r: "0.8" }),
|
|
2127
|
+
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "0.8" }),
|
|
2128
|
+
/* @__PURE__ */ e("circle", { cx: "6", cy: "6", r: "0.5" }),
|
|
2129
|
+
/* @__PURE__ */ e("circle", { cx: "18", cy: "6", r: "0.5" }),
|
|
2130
|
+
/* @__PURE__ */ e("circle", { cx: "6", cy: "18", r: "0.5" }),
|
|
2131
|
+
/* @__PURE__ */ e("circle", { cx: "18", cy: "18", r: "0.5" })
|
|
2132
|
+
]
|
|
2133
|
+
}
|
|
2134
|
+
) }) }),
|
|
2135
|
+
/* @__PURE__ */ l("div", { className: "flex-1 text-left min-w-0", children: [
|
|
2136
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-gray-900 truncate", children: s.name }),
|
|
2137
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-gray-500 truncate", children: n })
|
|
2138
|
+
] }),
|
|
2139
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-gray-400 flex-shrink-0", children: "now" })
|
|
2140
|
+
]
|
|
2141
|
+
}
|
|
2142
|
+
) }),
|
|
2143
|
+
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
2144
|
+
/* @__PURE__ */ e("div", { className: "flex justify-center pb-2", children: /* @__PURE__ */ e("div", { className: "w-32 h-1 rounded-full bg-zinc-600" }) })
|
|
2145
|
+
]
|
|
2146
|
+
}
|
|
2147
|
+
);
|
|
2148
|
+
}), Y = {
|
|
1787
2149
|
name: "Business",
|
|
1788
2150
|
verified: !1
|
|
1789
|
-
},
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
} = t;
|
|
1798
|
-
let a;
|
|
1799
|
-
e[0] !== s || e[1] !== l ? (a = {
|
|
1800
|
-
flow: s,
|
|
1801
|
-
onUserReply: l,
|
|
1802
|
-
typingDelay: 800
|
|
1803
|
-
}, e[0] = s, e[1] = l, e[2] = a) : a = e[2];
|
|
2151
|
+
}, Pe = g(function({
|
|
2152
|
+
flow: t,
|
|
2153
|
+
onUserReply: n,
|
|
2154
|
+
theme: o,
|
|
2155
|
+
device: s,
|
|
2156
|
+
businessInfo: a,
|
|
2157
|
+
showSuggestions: i
|
|
2158
|
+
}) {
|
|
1804
2159
|
const {
|
|
1805
|
-
state:
|
|
1806
|
-
handleReply:
|
|
2160
|
+
state: u,
|
|
2161
|
+
handleReply: c,
|
|
1807
2162
|
handleAction: d
|
|
1808
|
-
} =
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
},
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
...S,
|
|
2163
|
+
} = fe({
|
|
2164
|
+
flow: t,
|
|
2165
|
+
onUserReply: n,
|
|
2166
|
+
typingDelay: 800
|
|
2167
|
+
}), [m, f] = z(!1), v = M(() => {
|
|
2168
|
+
f((h) => !h);
|
|
2169
|
+
}, []), [x, L] = z(null), b = M((h) => {
|
|
2170
|
+
L({
|
|
2171
|
+
...h,
|
|
1818
2172
|
isOpen: !0
|
|
1819
2173
|
});
|
|
1820
|
-
},
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
2174
|
+
}, []), p = M(() => {
|
|
2175
|
+
L(null);
|
|
2176
|
+
}, []), y = M(
|
|
2177
|
+
(h) => {
|
|
2178
|
+
if (!$(h)) return;
|
|
2179
|
+
const w = oe(h);
|
|
2180
|
+
if (w) {
|
|
2181
|
+
b({
|
|
2182
|
+
url: w.url,
|
|
2183
|
+
viewMode: w.webviewViewMode || "TALL",
|
|
2184
|
+
title: w.description || "",
|
|
2185
|
+
postbackData: h.action.postback.data
|
|
2186
|
+
}), n({
|
|
2187
|
+
type: "action",
|
|
2188
|
+
postbackData: h.action.postback.data,
|
|
2189
|
+
displayText: h.action.displayText,
|
|
2190
|
+
timestamp: Date.now(),
|
|
2191
|
+
actionData: {
|
|
2192
|
+
type: "webview",
|
|
2193
|
+
url: w.url,
|
|
2194
|
+
viewMode: w.webviewViewMode || "TALL",
|
|
2195
|
+
description: w.description
|
|
2196
|
+
}
|
|
2197
|
+
});
|
|
2198
|
+
return;
|
|
2199
|
+
}
|
|
2200
|
+
d(h);
|
|
2201
|
+
},
|
|
2202
|
+
[d, b, n]
|
|
2203
|
+
);
|
|
2204
|
+
return /* @__PURE__ */ l(
|
|
2205
|
+
X,
|
|
2206
|
+
{
|
|
2207
|
+
theme: o,
|
|
2208
|
+
device: s,
|
|
2209
|
+
businessInfo: a,
|
|
2210
|
+
state: u,
|
|
2211
|
+
showSuggestions: i,
|
|
2212
|
+
isProfileOpen: m,
|
|
2213
|
+
toggleProfile: v,
|
|
2214
|
+
onReply: c,
|
|
2215
|
+
onAction: y,
|
|
2216
|
+
webView: x,
|
|
2217
|
+
openWebView: b,
|
|
2218
|
+
closeWebView: p,
|
|
2219
|
+
children: [
|
|
2220
|
+
/* @__PURE__ */ e(Ve, {}),
|
|
2221
|
+
m && /* @__PURE__ */ e(He, {}),
|
|
2222
|
+
/* @__PURE__ */ e(De, {})
|
|
2223
|
+
]
|
|
1851
2224
|
}
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
let S;
|
|
1891
|
-
e[1] !== $ ? (S = $ ? We($) : !1, e[1] = $, e[2] = S) : S = e[2];
|
|
1892
|
-
const I = S;
|
|
1893
|
-
let T;
|
|
1894
|
-
e[3] !== i || e[4] !== $?.name ? (T = () => ({
|
|
1895
|
-
...ke,
|
|
1896
|
-
...i,
|
|
1897
|
-
name: i?.name || $?.name || ke.name
|
|
1898
|
-
}), e[3] = i, e[4] = $?.name, e[5] = T) : T = e[5], $?.name;
|
|
1899
|
-
let D;
|
|
1900
|
-
e[6] !== T ? (D = T(), e[6] = T, e[7] = D) : D = e[7];
|
|
1901
|
-
const j = D;
|
|
1902
|
-
let O;
|
|
1903
|
-
e[8] !== $ || e[9] !== I ? (O = $ && I ? Ve($) : "New message", e[8] = $, e[9] = I, e[10] = O) : O = e[10];
|
|
1904
|
-
const J = O, V = m === "dark";
|
|
1905
|
-
let Q;
|
|
1906
|
-
e[11] !== b || e[12] !== p || e[13] !== w || e[14] !== V || e[15] !== m || e[16] !== y ? (Q = (R) => {
|
|
1907
|
-
const {
|
|
1908
|
-
children: G
|
|
1909
|
-
} = R;
|
|
1910
|
-
return /* @__PURE__ */ n("div", { className: `
|
|
2225
|
+
);
|
|
2226
|
+
}), Ye = g(function({
|
|
2227
|
+
messages: t,
|
|
2228
|
+
jsonUrl: n,
|
|
2229
|
+
onUserReply: o,
|
|
2230
|
+
theme: s = "light",
|
|
2231
|
+
device: a = "android",
|
|
2232
|
+
businessInfo: i,
|
|
2233
|
+
className: u = "",
|
|
2234
|
+
width: c = 375,
|
|
2235
|
+
height: d = 667,
|
|
2236
|
+
showSuggestions: m = !0,
|
|
2237
|
+
showLockScreen: f = !1
|
|
2238
|
+
}) {
|
|
2239
|
+
const [v, x] = z(f), L = M(() => {
|
|
2240
|
+
x(!1);
|
|
2241
|
+
}, []), {
|
|
2242
|
+
data: b,
|
|
2243
|
+
isLoading: p,
|
|
2244
|
+
error: y
|
|
2245
|
+
} = ge(n), h = n ? b : t, w = V(
|
|
2246
|
+
() => h ? ue(h) : !1,
|
|
2247
|
+
[h]
|
|
2248
|
+
), C = V(
|
|
2249
|
+
() => ({
|
|
2250
|
+
...Y,
|
|
2251
|
+
...i,
|
|
2252
|
+
// Extract name from flow if not provided
|
|
2253
|
+
name: i?.name || h?.name || Y.name
|
|
2254
|
+
}),
|
|
2255
|
+
[i, h?.name]
|
|
2256
|
+
), I = V(
|
|
2257
|
+
() => h && w ? he(h) : "New message",
|
|
2258
|
+
[h, w]
|
|
2259
|
+
), k = s === "dark", A = ({ children: T }) => /* @__PURE__ */ e(
|
|
2260
|
+
"div",
|
|
2261
|
+
{
|
|
2262
|
+
className: `
|
|
1911
2263
|
rcs-emulator relative overflow-hidden
|
|
1912
2264
|
rounded-2xl shadow-2xl
|
|
1913
|
-
${
|
|
1914
|
-
${
|
|
1915
|
-
`,
|
|
1916
|
-
width:
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
2265
|
+
${k ? "bg-zinc-950" : "bg-white"}
|
|
2266
|
+
${u}
|
|
2267
|
+
`,
|
|
2268
|
+
style: { width: c, height: d },
|
|
2269
|
+
role: "application",
|
|
2270
|
+
"aria-label": "RCS Message Emulator",
|
|
2271
|
+
"data-theme": s,
|
|
2272
|
+
"data-device": a,
|
|
2273
|
+
children: T
|
|
2274
|
+
}
|
|
2275
|
+
);
|
|
2276
|
+
return n && p ? /* @__PURE__ */ e(A, { children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full p-6", children: [
|
|
2277
|
+
/* @__PURE__ */ e(
|
|
2278
|
+
"div",
|
|
2279
|
+
{
|
|
2280
|
+
className: `
|
|
1923
2281
|
w-10 h-10 border-3 border-t-transparent rounded-full animate-spin mb-4
|
|
1924
|
-
${
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2282
|
+
${k ? "border-zinc-600" : "border-gray-300"}
|
|
2283
|
+
`,
|
|
2284
|
+
style: { borderTopColor: "transparent" }
|
|
2285
|
+
}
|
|
2286
|
+
),
|
|
2287
|
+
/* @__PURE__ */ e(
|
|
2288
|
+
"p",
|
|
2289
|
+
{
|
|
2290
|
+
className: `text-sm ${k ? "text-zinc-400" : "text-gray-500"}`,
|
|
2291
|
+
children: "Loading conversation..."
|
|
2292
|
+
}
|
|
2293
|
+
)
|
|
2294
|
+
] }) }) : n && y ? /* @__PURE__ */ e(A, { children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
|
|
2295
|
+
/* @__PURE__ */ e(
|
|
2296
|
+
"svg",
|
|
2297
|
+
{
|
|
2298
|
+
className: "w-12 h-12 mx-auto mb-4 text-red-500",
|
|
2299
|
+
fill: "none",
|
|
2300
|
+
viewBox: "0 0 24 24",
|
|
2301
|
+
stroke: "currentColor",
|
|
2302
|
+
children: /* @__PURE__ */ e(
|
|
2303
|
+
"path",
|
|
2304
|
+
{
|
|
2305
|
+
strokeLinecap: "round",
|
|
2306
|
+
strokeLinejoin: "round",
|
|
2307
|
+
strokeWidth: 2,
|
|
2308
|
+
d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
2309
|
+
}
|
|
2310
|
+
)
|
|
2311
|
+
}
|
|
2312
|
+
),
|
|
2313
|
+
/* @__PURE__ */ e(
|
|
2314
|
+
"h3",
|
|
2315
|
+
{
|
|
2316
|
+
className: `text-lg font-medium mb-2 ${k ? "text-white" : "text-gray-900"}`,
|
|
2317
|
+
children: "Failed to Load"
|
|
2318
|
+
}
|
|
2319
|
+
),
|
|
2320
|
+
/* @__PURE__ */ e(
|
|
2321
|
+
"p",
|
|
2322
|
+
{
|
|
2323
|
+
className: `text-sm ${k ? "text-zinc-400" : "text-gray-500"}`,
|
|
2324
|
+
children: y
|
|
2325
|
+
}
|
|
2326
|
+
),
|
|
2327
|
+
/* @__PURE__ */ e(
|
|
2328
|
+
"p",
|
|
2329
|
+
{
|
|
2330
|
+
className: `text-xs mt-2 break-all max-w-full ${k ? "text-zinc-500" : "text-gray-400"}`,
|
|
2331
|
+
children: n
|
|
2332
|
+
}
|
|
2333
|
+
)
|
|
2334
|
+
] }) }) : h ? w ? /* @__PURE__ */ e(A, { children: v ? /* @__PURE__ */ e(
|
|
2335
|
+
X,
|
|
2336
|
+
{
|
|
2337
|
+
theme: s,
|
|
2338
|
+
device: a,
|
|
2339
|
+
businessInfo: C,
|
|
2340
|
+
state: {
|
|
2341
|
+
currentMessageId: null,
|
|
2342
|
+
chatHistory: [],
|
|
2343
|
+
isTyping: !1,
|
|
2344
|
+
error: null
|
|
2345
|
+
},
|
|
2346
|
+
showSuggestions: !1,
|
|
2347
|
+
isProfileOpen: !1,
|
|
2348
|
+
toggleProfile: () => {
|
|
2349
|
+
},
|
|
2350
|
+
onReply: () => {
|
|
2351
|
+
},
|
|
2352
|
+
onAction: () => {
|
|
2353
|
+
},
|
|
2354
|
+
webView: null,
|
|
2355
|
+
openWebView: () => {
|
|
2356
|
+
},
|
|
2357
|
+
closeWebView: () => {
|
|
2358
|
+
},
|
|
2359
|
+
children: /* @__PURE__ */ e(Oe, { onUnlock: L, messagePreview: I })
|
|
2360
|
+
}
|
|
2361
|
+
) : /* @__PURE__ */ e(
|
|
2362
|
+
Pe,
|
|
2363
|
+
{
|
|
2364
|
+
flow: h,
|
|
2365
|
+
onUserReply: o,
|
|
2366
|
+
theme: s,
|
|
2367
|
+
device: a,
|
|
2368
|
+
businessInfo: C,
|
|
2369
|
+
showSuggestions: m
|
|
2370
|
+
}
|
|
2371
|
+
) }) : /* @__PURE__ */ e(A, { children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
|
|
2372
|
+
/* @__PURE__ */ e(
|
|
2373
|
+
"svg",
|
|
2374
|
+
{
|
|
2375
|
+
className: "w-12 h-12 mx-auto mb-4 text-amber-500",
|
|
2376
|
+
fill: "none",
|
|
2377
|
+
viewBox: "0 0 24 24",
|
|
2378
|
+
stroke: "currentColor",
|
|
2379
|
+
children: /* @__PURE__ */ e(
|
|
2380
|
+
"path",
|
|
2381
|
+
{
|
|
2382
|
+
strokeLinecap: "round",
|
|
2383
|
+
strokeLinejoin: "round",
|
|
2384
|
+
strokeWidth: 2,
|
|
2385
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
2386
|
+
}
|
|
2387
|
+
)
|
|
2388
|
+
}
|
|
2389
|
+
),
|
|
2390
|
+
/* @__PURE__ */ e(
|
|
2391
|
+
"h3",
|
|
2392
|
+
{
|
|
2393
|
+
className: `text-lg font-medium mb-2 ${k ? "text-white" : "text-gray-900"}`,
|
|
2394
|
+
children: "Invalid RBM JSON"
|
|
2395
|
+
}
|
|
2396
|
+
),
|
|
2397
|
+
/* @__PURE__ */ e(
|
|
2398
|
+
"p",
|
|
2399
|
+
{
|
|
2400
|
+
className: `text-sm ${k ? "text-zinc-400" : "text-gray-500"}`,
|
|
2401
|
+
children: "The conversation flow structure is not valid"
|
|
2402
|
+
}
|
|
2403
|
+
)
|
|
2404
|
+
] }) }) : /* @__PURE__ */ e(A, { children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
|
|
2405
|
+
/* @__PURE__ */ e(
|
|
2406
|
+
"svg",
|
|
2407
|
+
{
|
|
2408
|
+
className: `w-12 h-12 mx-auto mb-4 ${k ? "text-zinc-600" : "text-gray-300"}`,
|
|
2409
|
+
fill: "none",
|
|
2410
|
+
viewBox: "0 0 24 24",
|
|
2411
|
+
stroke: "currentColor",
|
|
2412
|
+
children: /* @__PURE__ */ e(
|
|
2413
|
+
"path",
|
|
2414
|
+
{
|
|
2415
|
+
strokeLinecap: "round",
|
|
2416
|
+
strokeLinejoin: "round",
|
|
2417
|
+
strokeWidth: 2,
|
|
2418
|
+
d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
|
|
2419
|
+
}
|
|
2420
|
+
)
|
|
2421
|
+
}
|
|
2422
|
+
),
|
|
2423
|
+
/* @__PURE__ */ e(
|
|
2424
|
+
"h3",
|
|
2425
|
+
{
|
|
2426
|
+
className: `text-lg font-medium mb-2 ${k ? "text-white" : "text-gray-900"}`,
|
|
2427
|
+
children: "No Conversation Data"
|
|
2428
|
+
}
|
|
2429
|
+
),
|
|
2430
|
+
/* @__PURE__ */ l(
|
|
2431
|
+
"p",
|
|
2432
|
+
{
|
|
2433
|
+
className: `text-sm ${k ? "text-zinc-400" : "text-gray-500"}`,
|
|
2434
|
+
children: [
|
|
2435
|
+
"Provide either",
|
|
2436
|
+
" ",
|
|
2437
|
+
/* @__PURE__ */ e("code", { className: "px-1 py-0.5 rounded bg-gray-100 dark:bg-zinc-800", children: "messages" }),
|
|
2438
|
+
" ",
|
|
2439
|
+
"or",
|
|
2440
|
+
" ",
|
|
2441
|
+
/* @__PURE__ */ e("code", { className: "px-1 py-0.5 rounded bg-gray-100 dark:bg-zinc-800", children: "jsonUrl" }),
|
|
2442
|
+
" ",
|
|
2443
|
+
"prop"
|
|
2444
|
+
]
|
|
2445
|
+
}
|
|
2446
|
+
)
|
|
2447
|
+
] }) });
|
|
2027
2448
|
});
|
|
2028
|
-
function wt(c) {
|
|
2029
|
-
return !c;
|
|
2030
|
-
}
|
|
2031
|
-
function vt() {
|
|
2032
|
-
}
|
|
2033
|
-
function kt() {
|
|
2034
|
-
}
|
|
2035
|
-
function Nt() {
|
|
2036
|
-
}
|
|
2037
|
-
function Ct() {
|
|
2038
|
-
}
|
|
2039
|
-
function Lt() {
|
|
2040
|
-
}
|
|
2041
2449
|
export {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2450
|
+
Ye as RcsEmulator,
|
|
2451
|
+
De as WebViewRenderer,
|
|
2452
|
+
Ye as default,
|
|
2453
|
+
he as getFirstMessagePreview,
|
|
2454
|
+
oe as getWebViewConfig,
|
|
2455
|
+
$ as isSuggestedAction,
|
|
2456
|
+
q as isSuggestedReply,
|
|
2457
|
+
Je as isWebViewAction,
|
|
2458
|
+
ge as useJsonFetch,
|
|
2459
|
+
ue as validateConversationFlow
|
|
2052
2460
|
};
|
|
2053
2461
|
//# sourceMappingURL=rcs-emulator.es.js.map
|