@maebgch/rcs-emulator 0.1.12 → 0.1.13
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 +1 -1
- package/dist/rcs-emulator.cjs.js.map +1 -1
- package/dist/rcs-emulator.es.js +484 -310
- package/dist/rcs-emulator.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/rcs-emulator.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as re, useContext as te, useReducer as se, useRef as W, useEffect as
|
|
2
|
+
import { createContext as re, useContext as te, useReducer as se, useRef as W, useEffect as j, useCallback as $, useState as A, memo as p, useMemo as V } from "react";
|
|
3
3
|
function Y(s) {
|
|
4
4
|
return "reply" in s;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function I(s) {
|
|
7
7
|
return "action" in s;
|
|
8
8
|
}
|
|
9
9
|
function qe(s) {
|
|
10
|
-
if (!
|
|
10
|
+
if (!I(s)) return !1;
|
|
11
11
|
const { urlAction: r } = s.action;
|
|
12
12
|
return r?.openUrl?.application === "WEBVIEW";
|
|
13
13
|
}
|
|
@@ -30,28 +30,28 @@ function Z({
|
|
|
30
30
|
device: t,
|
|
31
31
|
businessInfo: o,
|
|
32
32
|
state: a,
|
|
33
|
-
showSuggestions:
|
|
34
|
-
isProfileOpen:
|
|
33
|
+
showSuggestions: c,
|
|
34
|
+
isProfileOpen: l,
|
|
35
35
|
toggleProfile: u,
|
|
36
36
|
onReply: m,
|
|
37
37
|
onAction: i,
|
|
38
38
|
webView: h,
|
|
39
39
|
openWebView: f,
|
|
40
|
-
closeWebView:
|
|
40
|
+
closeWebView: v
|
|
41
41
|
}) {
|
|
42
42
|
const b = {
|
|
43
43
|
theme: r,
|
|
44
44
|
device: t,
|
|
45
45
|
businessInfo: { ...ae, ...o },
|
|
46
46
|
state: { ...le, ...a },
|
|
47
|
-
showSuggestions:
|
|
48
|
-
isProfileOpen:
|
|
47
|
+
showSuggestions: c,
|
|
48
|
+
isProfileOpen: l,
|
|
49
49
|
toggleProfile: u,
|
|
50
50
|
handleReply: m,
|
|
51
51
|
handleAction: i,
|
|
52
52
|
webView: h,
|
|
53
53
|
openWebView: f,
|
|
54
|
-
closeWebView:
|
|
54
|
+
closeWebView: v
|
|
55
55
|
};
|
|
56
56
|
return /* @__PURE__ */ e(Q.Provider, { value: b, children: s });
|
|
57
57
|
}
|
|
@@ -101,7 +101,7 @@ function ce(s) {
|
|
|
101
101
|
return {
|
|
102
102
|
type: "carousel",
|
|
103
103
|
cards: a.content.map(
|
|
104
|
-
(
|
|
104
|
+
(c) => P(c, {
|
|
105
105
|
cardOrientation: "VERTICAL",
|
|
106
106
|
cardWidth: a.layout.cardWidth
|
|
107
107
|
})
|
|
@@ -192,8 +192,8 @@ function de(s) {
|
|
|
192
192
|
const a = o.richcardMessage?.message?.generalPurposeCard;
|
|
193
193
|
if (a?.content.title)
|
|
194
194
|
return a.content.title;
|
|
195
|
-
const
|
|
196
|
-
return
|
|
195
|
+
const c = o.richcardMessage?.message?.generalPurposeCardCarousel;
|
|
196
|
+
return c?.content[0]?.title ? c.content[0].title : "New message";
|
|
197
197
|
}
|
|
198
198
|
const X = {
|
|
199
199
|
currentMessageId: null,
|
|
@@ -217,7 +217,7 @@ function he(s, r) {
|
|
|
217
217
|
};
|
|
218
218
|
case "ADD_USER_REPLY": {
|
|
219
219
|
const t = ue(r.text), o = s.chatHistory.map(
|
|
220
|
-
(a,
|
|
220
|
+
(a, c) => c === s.chatHistory.length - 1 ? { ...a, suggestions: void 0 } : a
|
|
221
221
|
);
|
|
222
222
|
return {
|
|
223
223
|
...s,
|
|
@@ -251,10 +251,10 @@ function fe({
|
|
|
251
251
|
onUserReply: r,
|
|
252
252
|
typingDelay: t = 800
|
|
253
253
|
}) {
|
|
254
|
-
const [o, a] = se(he, X),
|
|
255
|
-
|
|
256
|
-
if (
|
|
257
|
-
|
|
254
|
+
const [o, a] = se(he, X), c = W(0), l = W(!1);
|
|
255
|
+
j(() => {
|
|
256
|
+
if (l.current) return;
|
|
257
|
+
l.current = !0;
|
|
258
258
|
const h = K(s);
|
|
259
259
|
if (!h) {
|
|
260
260
|
a({
|
|
@@ -266,14 +266,14 @@ function fe({
|
|
|
266
266
|
a({ type: "INIT", messageId: h.id });
|
|
267
267
|
const f = H(
|
|
268
268
|
h,
|
|
269
|
-
|
|
269
|
+
c.current++
|
|
270
270
|
);
|
|
271
271
|
a({ type: "ADD_BUSINESS_MESSAGE", message: f });
|
|
272
272
|
}, [s]);
|
|
273
273
|
const u = $(
|
|
274
274
|
(h) => {
|
|
275
275
|
if (!Y(h)) return;
|
|
276
|
-
const { displayText: f, postback:
|
|
276
|
+
const { displayText: f, postback: v } = h.reply, b = v.data;
|
|
277
277
|
a({ type: "ADD_USER_REPLY", text: f, postbackData: b });
|
|
278
278
|
const N = {
|
|
279
279
|
type: "reply",
|
|
@@ -282,26 +282,26 @@ function fe({
|
|
|
282
282
|
timestamp: Date.now()
|
|
283
283
|
};
|
|
284
284
|
r(N);
|
|
285
|
-
const
|
|
286
|
-
if (!
|
|
285
|
+
const y = o.currentMessageId ? R(s, o.currentMessageId) : null;
|
|
286
|
+
if (!y) {
|
|
287
287
|
a({ type: "SET_ERROR", error: "Current message not found" });
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
|
-
const
|
|
291
|
-
if (!
|
|
290
|
+
const w = O(y, b);
|
|
291
|
+
if (!w)
|
|
292
292
|
return;
|
|
293
|
-
const g = R(s,
|
|
293
|
+
const g = R(s, w);
|
|
294
294
|
if (!g) {
|
|
295
295
|
a({
|
|
296
296
|
type: "SET_ERROR",
|
|
297
|
-
error: `Next message "${
|
|
297
|
+
error: `Next message "${w}" not found`
|
|
298
298
|
});
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId:
|
|
301
|
+
a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: w }), setTimeout(() => {
|
|
302
302
|
const d = H(
|
|
303
303
|
g,
|
|
304
|
-
|
|
304
|
+
c.current++
|
|
305
305
|
);
|
|
306
306
|
a({ type: "ADD_BUSINESS_MESSAGE", message: d });
|
|
307
307
|
}, t);
|
|
@@ -309,18 +309,18 @@ function fe({
|
|
|
309
309
|
[s, o.currentMessageId, r, t]
|
|
310
310
|
), m = $(
|
|
311
311
|
(h) => {
|
|
312
|
-
if (!
|
|
312
|
+
if (!I(h)) return;
|
|
313
313
|
const {
|
|
314
314
|
displayText: f,
|
|
315
|
-
postback:
|
|
315
|
+
postback: v,
|
|
316
316
|
openUrlAction: b,
|
|
317
317
|
dialAction: N,
|
|
318
|
-
dialerAction:
|
|
319
|
-
mapAction:
|
|
318
|
+
dialerAction: y,
|
|
319
|
+
mapAction: w,
|
|
320
320
|
viewLocationAction: g
|
|
321
|
-
} = h.action, d =
|
|
322
|
-
let
|
|
323
|
-
b ?
|
|
321
|
+
} = h.action, d = v.data, x = N?.phoneNumber || y?.dialPhoneNumber?.phoneNumber, L = w?.showLocation?.location || g?.latLong;
|
|
322
|
+
let z;
|
|
323
|
+
b ? z = { type: "openUrl", url: b.url } : x ? z = { type: "dial", phoneNumber: x } : L && (z = {
|
|
324
324
|
type: "viewLocation",
|
|
325
325
|
latitude: L.latitude,
|
|
326
326
|
longitude: L.longitude,
|
|
@@ -331,14 +331,14 @@ function fe({
|
|
|
331
331
|
postbackData: d,
|
|
332
332
|
displayText: f,
|
|
333
333
|
timestamp: Date.now(),
|
|
334
|
-
actionData:
|
|
334
|
+
actionData: z
|
|
335
335
|
};
|
|
336
336
|
if (r(C), b)
|
|
337
337
|
window.open(b.url, "_blank", "noopener,noreferrer");
|
|
338
338
|
else if (x)
|
|
339
339
|
window.location.href = `tel:${x}`;
|
|
340
340
|
else if (L) {
|
|
341
|
-
const M =
|
|
341
|
+
const M = w?.showLocation?.location?.label || g?.label || "", S = `https://www.google.com/maps/search/?api=1&query=${L.latitude},${L.longitude}${M ? `&query_place_id=${encodeURIComponent(M)}` : ""}`;
|
|
342
342
|
window.open(S, "_blank", "noopener,noreferrer");
|
|
343
343
|
}
|
|
344
344
|
const T = o.currentMessageId ? R(s, o.currentMessageId) : null;
|
|
@@ -353,7 +353,7 @@ function fe({
|
|
|
353
353
|
}), a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: M }), setTimeout(() => {
|
|
354
354
|
const ee = H(
|
|
355
355
|
S,
|
|
356
|
-
|
|
356
|
+
c.current++
|
|
357
357
|
);
|
|
358
358
|
a({ type: "ADD_BUSINESS_MESSAGE", message: ee });
|
|
359
359
|
}, t));
|
|
@@ -362,7 +362,7 @@ function fe({
|
|
|
362
362
|
},
|
|
363
363
|
[s, o.currentMessageId, r, t]
|
|
364
364
|
), i = $(() => {
|
|
365
|
-
|
|
365
|
+
l.current = !1, c.current = 0, a({ type: "RESET" });
|
|
366
366
|
}, []);
|
|
367
367
|
return {
|
|
368
368
|
state: o,
|
|
@@ -372,12 +372,12 @@ function fe({
|
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
374
|
function pe(s) {
|
|
375
|
-
const [r, t] = A(null), [o, a] = A(!1), [
|
|
375
|
+
const [r, t] = A(null), [o, a] = A(!1), [c, l] = A(null), u = $(async () => {
|
|
376
376
|
if (!s) {
|
|
377
|
-
t(null),
|
|
377
|
+
t(null), l(null);
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
380
|
-
a(!0),
|
|
380
|
+
a(!0), l(null);
|
|
381
381
|
try {
|
|
382
382
|
const m = await fetch(s, {
|
|
383
383
|
method: "GET",
|
|
@@ -395,23 +395,23 @@ function pe(s) {
|
|
|
395
395
|
t(i);
|
|
396
396
|
} catch (m) {
|
|
397
397
|
const i = m instanceof Error ? m.message : "Failed to fetch JSON";
|
|
398
|
-
|
|
398
|
+
l(i), t(null);
|
|
399
399
|
} finally {
|
|
400
400
|
a(!1);
|
|
401
401
|
}
|
|
402
402
|
}, [s]);
|
|
403
|
-
return
|
|
403
|
+
return j(() => {
|
|
404
404
|
u();
|
|
405
405
|
}, [u]), {
|
|
406
406
|
data: r,
|
|
407
407
|
isLoading: o,
|
|
408
|
-
error:
|
|
408
|
+
error: c,
|
|
409
409
|
refetch: u
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
412
|
function ge(s) {
|
|
413
413
|
const r = W(null);
|
|
414
|
-
return
|
|
414
|
+
return j(() => {
|
|
415
415
|
r.current && r.current.scrollTo({
|
|
416
416
|
top: r.current.scrollHeight,
|
|
417
417
|
behavior: "smooth"
|
|
@@ -419,11 +419,11 @@ function ge(s) {
|
|
|
419
419
|
}, [s]), r;
|
|
420
420
|
}
|
|
421
421
|
const xe = p(function() {
|
|
422
|
-
const { theme: r, businessInfo: t, toggleProfile: o } = k(), a = r === "dark",
|
|
422
|
+
const { theme: r, businessInfo: t, toggleProfile: o } = k(), a = r === "dark", c = a ? "rcs-emulator-dark" : "rcs-emulator-light", l = t.brandColor || "#1A73E8";
|
|
423
423
|
return /* @__PURE__ */ n(
|
|
424
424
|
"header",
|
|
425
425
|
{
|
|
426
|
-
className: `rcs-emulator-header ${
|
|
426
|
+
className: `rcs-emulator-header ${c}`,
|
|
427
427
|
role: "banner",
|
|
428
428
|
"aria-label": `Chat with ${t.name}`,
|
|
429
429
|
children: [
|
|
@@ -431,24 +431,42 @@ const xe = p(function() {
|
|
|
431
431
|
"button",
|
|
432
432
|
{
|
|
433
433
|
type: "button",
|
|
434
|
-
className: `rcs-emulator-icon-btn rcs-emulator-p-1-5 rcs-emulator--ml-1 ${
|
|
434
|
+
className: `rcs-emulator-icon-btn rcs-emulator-p-1-5 rcs-emulator--ml-1 ${c} ${a ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-700"}`,
|
|
435
435
|
"aria-label": "Go back",
|
|
436
|
-
children: /* @__PURE__ */ e(
|
|
436
|
+
children: /* @__PURE__ */ e(
|
|
437
|
+
"svg",
|
|
438
|
+
{
|
|
439
|
+
className: "rcs-emulator-w-5 rcs-emulator-h-5",
|
|
440
|
+
fill: "none",
|
|
441
|
+
viewBox: "0 0 24 24",
|
|
442
|
+
stroke: "currentColor",
|
|
443
|
+
children: /* @__PURE__ */ e(
|
|
444
|
+
"path",
|
|
445
|
+
{
|
|
446
|
+
strokeLinecap: "round",
|
|
447
|
+
strokeLinejoin: "round",
|
|
448
|
+
strokeWidth: 2,
|
|
449
|
+
d: "M15 19l-7-7 7-7"
|
|
450
|
+
}
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
)
|
|
437
454
|
}
|
|
438
455
|
),
|
|
439
456
|
/* @__PURE__ */ n(
|
|
440
457
|
"button",
|
|
441
458
|
{
|
|
442
459
|
onClick: o,
|
|
443
|
-
className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2-5 rcs-emulator-flex-1 rcs-emulator-min-w-0 rcs-emulator-text-left",
|
|
460
|
+
className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2-5 rcs-emulator-flex-1 rcs-emulator-min-w-0 rcs-emulator-text-left rcs-emulator-bg-transparent",
|
|
461
|
+
style: { background: "transparent" },
|
|
444
462
|
"aria-label": "View business info",
|
|
445
463
|
children: [
|
|
446
464
|
/* @__PURE__ */ e(
|
|
447
465
|
"div",
|
|
448
466
|
{
|
|
449
|
-
className: `rcs-emulator-logo-avatar rcs-emulator-w-9 rcs-emulator-h-9 ${
|
|
467
|
+
className: `rcs-emulator-logo-avatar rcs-emulator-w-9 rcs-emulator-h-9 ${c}`,
|
|
450
468
|
style: {
|
|
451
|
-
backgroundColor: t.logo ? void 0 :
|
|
469
|
+
backgroundColor: t.logo ? void 0 : l
|
|
452
470
|
},
|
|
453
471
|
children: t.logo ? /* @__PURE__ */ e(
|
|
454
472
|
"img",
|
|
@@ -475,39 +493,64 @@ const xe = p(function() {
|
|
|
475
493
|
"button",
|
|
476
494
|
{
|
|
477
495
|
type: "button",
|
|
478
|
-
className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${
|
|
496
|
+
className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${c}`,
|
|
479
497
|
"aria-label": "Verified business",
|
|
480
|
-
children: /* @__PURE__ */ n(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
498
|
+
children: /* @__PURE__ */ n(
|
|
499
|
+
"svg",
|
|
500
|
+
{
|
|
501
|
+
className: "rcs-emulator-w-5 rcs-emulator-h-5",
|
|
502
|
+
viewBox: "0 0 24 24",
|
|
503
|
+
fill: "none",
|
|
504
|
+
children: [
|
|
505
|
+
/* @__PURE__ */ e(
|
|
506
|
+
"path",
|
|
507
|
+
{
|
|
508
|
+
d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",
|
|
509
|
+
stroke: a ? "#9ca3af" : "#6b7280",
|
|
510
|
+
strokeWidth: 2,
|
|
511
|
+
strokeLinecap: "round",
|
|
512
|
+
strokeLinejoin: "round"
|
|
513
|
+
}
|
|
514
|
+
),
|
|
515
|
+
/* @__PURE__ */ e(
|
|
516
|
+
"path",
|
|
517
|
+
{
|
|
518
|
+
d: "M9 12l2 2 4-4",
|
|
519
|
+
stroke: "#3b82f6",
|
|
520
|
+
strokeWidth: 2,
|
|
521
|
+
strokeLinecap: "round",
|
|
522
|
+
strokeLinejoin: "round"
|
|
523
|
+
}
|
|
524
|
+
)
|
|
525
|
+
]
|
|
526
|
+
}
|
|
527
|
+
)
|
|
502
528
|
}
|
|
503
529
|
),
|
|
504
530
|
/* @__PURE__ */ e(
|
|
505
531
|
"button",
|
|
506
532
|
{
|
|
507
533
|
type: "button",
|
|
508
|
-
className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${
|
|
534
|
+
className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${c} ${a ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
|
|
509
535
|
"aria-label": "More options",
|
|
510
|
-
children: /* @__PURE__ */ e(
|
|
536
|
+
children: /* @__PURE__ */ e(
|
|
537
|
+
"svg",
|
|
538
|
+
{
|
|
539
|
+
className: "rcs-emulator-w-5 rcs-emulator-h-5",
|
|
540
|
+
fill: "none",
|
|
541
|
+
viewBox: "0 0 24 24",
|
|
542
|
+
stroke: "currentColor",
|
|
543
|
+
children: /* @__PURE__ */ e(
|
|
544
|
+
"path",
|
|
545
|
+
{
|
|
546
|
+
strokeLinecap: "round",
|
|
547
|
+
strokeLinejoin: "round",
|
|
548
|
+
strokeWidth: 2,
|
|
549
|
+
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"
|
|
550
|
+
}
|
|
551
|
+
)
|
|
552
|
+
}
|
|
553
|
+
)
|
|
511
554
|
}
|
|
512
555
|
)
|
|
513
556
|
] })
|
|
@@ -515,7 +558,7 @@ const xe = p(function() {
|
|
|
515
558
|
}
|
|
516
559
|
);
|
|
517
560
|
}), be = p(function() {
|
|
518
|
-
const { theme: r, businessInfo: t } = k(), o = r === "dark", a = o ? "rcs-emulator-dark" : "rcs-emulator-light",
|
|
561
|
+
const { theme: r, businessInfo: t } = k(), o = r === "dark", a = o ? "rcs-emulator-dark" : "rcs-emulator-light", c = t.brandColor || "#0084ff";
|
|
519
562
|
return /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-py-4 rcs-emulator-px-4", children: [
|
|
520
563
|
/* @__PURE__ */ n("div", { className: "rcs-emulator-relative rcs-emulator-mb-3", children: [
|
|
521
564
|
/* @__PURE__ */ e(
|
|
@@ -523,7 +566,7 @@ const xe = p(function() {
|
|
|
523
566
|
{
|
|
524
567
|
className: `rcs-emulator-logo-avatar rcs-emulator-w-16 rcs-emulator-h-16 rcs-emulator-shadow-lg ${a}`,
|
|
525
568
|
style: {
|
|
526
|
-
backgroundColor: t.logo ? void 0 :
|
|
569
|
+
backgroundColor: t.logo ? void 0 : c
|
|
527
570
|
},
|
|
528
571
|
children: t.logo ? /* @__PURE__ */ e(
|
|
529
572
|
"img",
|
|
@@ -565,11 +608,11 @@ const xe = p(function() {
|
|
|
565
608
|
sender: t,
|
|
566
609
|
timestamp: o
|
|
567
610
|
}) {
|
|
568
|
-
const { theme: a, businessInfo:
|
|
611
|
+
const { theme: a, businessInfo: c } = k(), u = a === "dark" ? "rcs-emulator-dark" : "rcs-emulator-light", m = t === "business", i = c.brandColor || "#1A73E8", h = new Date(o).toLocaleTimeString([], {
|
|
569
612
|
hour: "2-digit",
|
|
570
613
|
minute: "2-digit"
|
|
571
614
|
});
|
|
572
|
-
return m ? /* @__PURE__ */ n("div", { className: "rcs-emulator-max-w-90", children: [
|
|
615
|
+
return m ? /* @__PURE__ */ n("div", { className: "rcs-emulator-max-w-90 rcs-emulator-flex rcs-emulator-flex-col", children: [
|
|
573
616
|
/* @__PURE__ */ e(
|
|
574
617
|
"div",
|
|
575
618
|
{
|
|
@@ -607,11 +650,11 @@ const xe = p(function() {
|
|
|
607
650
|
),
|
|
608
651
|
/* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: h })
|
|
609
652
|
] });
|
|
610
|
-
}),
|
|
653
|
+
}), ye = p(function({
|
|
611
654
|
text: r,
|
|
612
655
|
timestamp: t
|
|
613
656
|
}) {
|
|
614
|
-
const { businessInfo: o } = k(), a = o.brandColor || "#
|
|
657
|
+
const { businessInfo: o } = k(), a = o.brandColor || "#1A73E8", c = new Date(t).toLocaleTimeString([], {
|
|
615
658
|
hour: "2-digit",
|
|
616
659
|
minute: "2-digit"
|
|
617
660
|
});
|
|
@@ -620,7 +663,7 @@ const xe = p(function() {
|
|
|
620
663
|
"div",
|
|
621
664
|
{
|
|
622
665
|
className: "rcs-emulator-message-bubble rcs-emulator-user rcs-emulator-shadow-sm",
|
|
623
|
-
style: { backgroundColor: a },
|
|
666
|
+
style: { backgroundColor: a, color: "white" },
|
|
624
667
|
children: r
|
|
625
668
|
}
|
|
626
669
|
),
|
|
@@ -649,17 +692,17 @@ const xe = p(function() {
|
|
|
649
692
|
)
|
|
650
693
|
}
|
|
651
694
|
),
|
|
652
|
-
/* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children:
|
|
695
|
+
/* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: c })
|
|
653
696
|
] });
|
|
654
|
-
}),
|
|
697
|
+
}), we = p(function({
|
|
655
698
|
card: r,
|
|
656
699
|
timestamp: t
|
|
657
700
|
}) {
|
|
658
|
-
const { theme: o, handleReply: a, handleAction:
|
|
701
|
+
const { theme: o, handleReply: a, handleAction: c } = k(), l = o === "dark", u = l ? "rcs-emulator-dark" : "rcs-emulator-light", m = new Date(t).toLocaleTimeString([], {
|
|
659
702
|
hour: "2-digit",
|
|
660
703
|
minute: "2-digit"
|
|
661
704
|
}), i = (f) => {
|
|
662
|
-
"reply" in f ? a(f) :
|
|
705
|
+
"reply" in f ? a(f) : c(f);
|
|
663
706
|
}, h = {
|
|
664
707
|
short: "rcs-emulator-h-36",
|
|
665
708
|
medium: "rcs-emulator-h-44",
|
|
@@ -674,14 +717,19 @@ const xe = p(function() {
|
|
|
674
717
|
r.media && /* @__PURE__ */ e(
|
|
675
718
|
"div",
|
|
676
719
|
{
|
|
677
|
-
className: `rcs-emulator-w-full rcs-emulator-overflow-hidden ${h[r.media.height]}`,
|
|
720
|
+
className: `rcs-emulator-w-full rcs-emulator-overflow-hidden rcs-emulator-media-placeholder ${h[r.media.height]} ${l ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
|
|
721
|
+
style: { borderRadius: "12px 12px 0 0" },
|
|
678
722
|
children: /* @__PURE__ */ e(
|
|
679
723
|
"img",
|
|
680
724
|
{
|
|
681
725
|
src: r.media.url,
|
|
682
726
|
alt: r.title || "Rich card media",
|
|
683
727
|
className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-object-cover",
|
|
684
|
-
loading: "lazy"
|
|
728
|
+
loading: "lazy",
|
|
729
|
+
onError: (f) => {
|
|
730
|
+
const v = f.target;
|
|
731
|
+
v.style.display = "none";
|
|
732
|
+
}
|
|
685
733
|
}
|
|
686
734
|
)
|
|
687
735
|
}
|
|
@@ -690,29 +738,29 @@ const xe = p(function() {
|
|
|
690
738
|
r.title && /* @__PURE__ */ e(
|
|
691
739
|
"h3",
|
|
692
740
|
{
|
|
693
|
-
className: `rcs-emulator-text-base rcs-emulator-font-semibold rcs-emulator-leading-snug ${
|
|
741
|
+
className: `rcs-emulator-text-base rcs-emulator-font-semibold rcs-emulator-leading-snug rcs-emulator-card-title ${l ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
|
|
694
742
|
children: r.title
|
|
695
743
|
}
|
|
696
744
|
),
|
|
697
745
|
r.description && /* @__PURE__ */ e(
|
|
698
746
|
"p",
|
|
699
747
|
{
|
|
700
|
-
className: `rcs-emulator-text-sm rcs-emulator-leading-relaxed rcs-emulator-mt-1-5 ${
|
|
748
|
+
className: `rcs-emulator-text-sm rcs-emulator-leading-relaxed rcs-emulator-mt-1-5 rcs-emulator-card-subtitle ${l ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
|
|
701
749
|
children: r.description
|
|
702
750
|
}
|
|
703
751
|
),
|
|
704
752
|
r.suggestions && r.suggestions.length > 0 && /* @__PURE__ */ e(
|
|
705
753
|
"div",
|
|
706
754
|
{
|
|
707
|
-
className: `rcs-emulator-card-actions rcs-emulator-mt-4 rcs-emulator-divide-y ${
|
|
708
|
-
children: r.suggestions.map((f,
|
|
755
|
+
className: `rcs-emulator-card-actions rcs-emulator-mt-4 rcs-emulator-divide-y ${l ? "rcs-emulator-divide-zinc-700" : "rcs-emulator-divide-gray-100"} ${u}`,
|
|
756
|
+
children: r.suggestions.map((f, v) => /* @__PURE__ */ e(
|
|
709
757
|
Me,
|
|
710
758
|
{
|
|
711
759
|
suggestion: f,
|
|
712
760
|
onClick: () => i(f),
|
|
713
|
-
isDark:
|
|
761
|
+
isDark: l
|
|
714
762
|
},
|
|
715
|
-
|
|
763
|
+
v
|
|
716
764
|
))
|
|
717
765
|
}
|
|
718
766
|
)
|
|
@@ -730,7 +778,7 @@ const xe = p(function() {
|
|
|
730
778
|
onClick: t,
|
|
731
779
|
isDark: o
|
|
732
780
|
}) {
|
|
733
|
-
const a =
|
|
781
|
+
const a = I(r), c = a ? r.action.displayText : r.reply.displayText;
|
|
734
782
|
return /* @__PURE__ */ n(
|
|
735
783
|
"button",
|
|
736
784
|
{
|
|
@@ -743,23 +791,26 @@ const xe = p(function() {
|
|
|
743
791
|
const { action: u } = r;
|
|
744
792
|
return u.urlAction || u.openUrlAction ? /* @__PURE__ */ e(ke, {}) : u.dialerAction || u.dialAction ? /* @__PURE__ */ e(Ne, {}) : u.mapAction || u.viewLocationAction ? /* @__PURE__ */ e(Ce, {}) : u.calendarAction || u.createCalendarEventAction ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(G, {});
|
|
745
793
|
})() }),
|
|
746
|
-
/* @__PURE__ */ e("span", { className: `rcs-emulator-text-sm ${o ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`, children:
|
|
794
|
+
/* @__PURE__ */ e("span", { className: `rcs-emulator-text-sm ${o ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`, children: c })
|
|
747
795
|
]
|
|
748
796
|
}
|
|
749
797
|
);
|
|
750
|
-
}), $e = p(function({
|
|
751
|
-
|
|
798
|
+
}), $e = p(function({
|
|
799
|
+
cards: r,
|
|
800
|
+
timestamp: t
|
|
801
|
+
}) {
|
|
802
|
+
const { theme: o, handleReply: a, handleAction: c } = k(), l = W(null), [u, m] = A(!1), [i, h] = A(r.length > 1), f = o === "dark", v = f ? "rcs-emulator-dark" : "rcs-emulator-light", b = new Date(t).toLocaleTimeString([], {
|
|
752
803
|
hour: "2-digit",
|
|
753
804
|
minute: "2-digit"
|
|
754
805
|
}), N = (g) => {
|
|
755
|
-
"reply" in g ? a(g) :
|
|
756
|
-
},
|
|
757
|
-
if (
|
|
758
|
-
const { scrollLeft: g, scrollWidth: d, clientWidth: x } =
|
|
806
|
+
"reply" in g ? a(g) : c(g);
|
|
807
|
+
}, y = $(() => {
|
|
808
|
+
if (l.current) {
|
|
809
|
+
const { scrollLeft: g, scrollWidth: d, clientWidth: x } = l.current;
|
|
759
810
|
m(g > 0), h(g < d - x - 10);
|
|
760
811
|
}
|
|
761
|
-
}, []),
|
|
762
|
-
|
|
812
|
+
}, []), w = (g) => {
|
|
813
|
+
l.current && l.current.scrollBy({
|
|
763
814
|
left: g === "left" ? -200 : 200,
|
|
764
815
|
behavior: "smooth"
|
|
765
816
|
});
|
|
@@ -769,20 +820,37 @@ const xe = p(function() {
|
|
|
769
820
|
u && /* @__PURE__ */ e(
|
|
770
821
|
"button",
|
|
771
822
|
{
|
|
772
|
-
onClick: () =>
|
|
773
|
-
className: `rcs-emulator-carousel-arrow rcs-emulator-left ${
|
|
823
|
+
onClick: () => w("left"),
|
|
824
|
+
className: `rcs-emulator-carousel-arrow rcs-emulator-left ${v}`,
|
|
774
825
|
"aria-label": "Scroll left",
|
|
775
|
-
children: /* @__PURE__ */ e(
|
|
826
|
+
children: /* @__PURE__ */ e(
|
|
827
|
+
"svg",
|
|
828
|
+
{
|
|
829
|
+
className: "rcs-emulator-w-4 rcs-emulator-h-4",
|
|
830
|
+
fill: "none",
|
|
831
|
+
viewBox: "0 0 24 24",
|
|
832
|
+
stroke: "currentColor",
|
|
833
|
+
children: /* @__PURE__ */ e(
|
|
834
|
+
"path",
|
|
835
|
+
{
|
|
836
|
+
strokeLinecap: "round",
|
|
837
|
+
strokeLinejoin: "round",
|
|
838
|
+
strokeWidth: 2,
|
|
839
|
+
d: "M15 19l-7-7 7-7"
|
|
840
|
+
}
|
|
841
|
+
)
|
|
842
|
+
}
|
|
843
|
+
)
|
|
776
844
|
}
|
|
777
845
|
),
|
|
778
846
|
/* @__PURE__ */ e(
|
|
779
847
|
"div",
|
|
780
848
|
{
|
|
781
|
-
ref:
|
|
782
|
-
onScroll:
|
|
849
|
+
ref: l,
|
|
850
|
+
onScroll: y,
|
|
783
851
|
className: "rcs-emulator-flex rcs-emulator-gap-2-5 rcs-emulator-overflow-x-auto rcs-emulator-py-1 rcs-emulator-px-3 rcs-emulator-snap-x rcs-emulator-scrollbar-hide",
|
|
784
852
|
children: r.map((g, d) => /* @__PURE__ */ e(
|
|
785
|
-
|
|
853
|
+
Ie,
|
|
786
854
|
{
|
|
787
855
|
card: g,
|
|
788
856
|
isDark: f,
|
|
@@ -795,99 +863,219 @@ const xe = p(function() {
|
|
|
795
863
|
i && /* @__PURE__ */ e(
|
|
796
864
|
"button",
|
|
797
865
|
{
|
|
798
|
-
onClick: () =>
|
|
799
|
-
className: `rcs-emulator-carousel-arrow rcs-emulator-right ${
|
|
866
|
+
onClick: () => w("right"),
|
|
867
|
+
className: `rcs-emulator-carousel-arrow rcs-emulator-right ${v}`,
|
|
800
868
|
"aria-label": "Scroll right",
|
|
801
|
-
children: /* @__PURE__ */ e(
|
|
869
|
+
children: /* @__PURE__ */ e(
|
|
870
|
+
"svg",
|
|
871
|
+
{
|
|
872
|
+
className: "rcs-emulator-w-4 rcs-emulator-h-4",
|
|
873
|
+
fill: "none",
|
|
874
|
+
viewBox: "0 0 24 24",
|
|
875
|
+
stroke: "currentColor",
|
|
876
|
+
children: /* @__PURE__ */ e(
|
|
877
|
+
"path",
|
|
878
|
+
{
|
|
879
|
+
strokeLinecap: "round",
|
|
880
|
+
strokeLinejoin: "round",
|
|
881
|
+
strokeWidth: 2,
|
|
882
|
+
d: "M9 5l7 7-7 7"
|
|
883
|
+
}
|
|
884
|
+
)
|
|
885
|
+
}
|
|
886
|
+
)
|
|
802
887
|
}
|
|
803
888
|
)
|
|
804
889
|
] }),
|
|
805
890
|
/* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: b })
|
|
806
891
|
] });
|
|
807
|
-
}),
|
|
808
|
-
if (!
|
|
809
|
-
return /* @__PURE__ */ e(
|
|
892
|
+
}), E = "rcs-emulator-w-4 rcs-emulator-h-4 rcs-emulator-text-gray-400", Ae = (s) => {
|
|
893
|
+
if (!I(s))
|
|
894
|
+
return /* @__PURE__ */ e(
|
|
895
|
+
"svg",
|
|
896
|
+
{
|
|
897
|
+
className: E,
|
|
898
|
+
fill: "none",
|
|
899
|
+
viewBox: "0 0 24 24",
|
|
900
|
+
stroke: "currentColor",
|
|
901
|
+
strokeWidth: 1.5,
|
|
902
|
+
children: /* @__PURE__ */ e(
|
|
903
|
+
"path",
|
|
904
|
+
{
|
|
905
|
+
strokeLinecap: "round",
|
|
906
|
+
strokeLinejoin: "round",
|
|
907
|
+
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"
|
|
908
|
+
}
|
|
909
|
+
)
|
|
910
|
+
}
|
|
911
|
+
);
|
|
810
912
|
const { action: r } = s;
|
|
811
|
-
return r.urlAction || r.openUrlAction ? /* @__PURE__ */ e(
|
|
812
|
-
|
|
813
|
-
/* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
814
|
-
] }) : r.calendarAction || r.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" }) });
|
|
815
|
-
}, ze = p(function({
|
|
816
|
-
card: r,
|
|
817
|
-
isDark: t,
|
|
818
|
-
onSuggestionClick: o
|
|
819
|
-
}) {
|
|
820
|
-
const a = r.layout.width === "small" ? "rcs-emulator-w-44" : "rcs-emulator-w-52", l = t ? "rcs-emulator-dark" : "rcs-emulator-light";
|
|
821
|
-
return /* @__PURE__ */ n(
|
|
822
|
-
"div",
|
|
913
|
+
return r.urlAction || r.openUrlAction ? /* @__PURE__ */ e(
|
|
914
|
+
"svg",
|
|
823
915
|
{
|
|
824
|
-
className:
|
|
916
|
+
className: E,
|
|
917
|
+
fill: "none",
|
|
918
|
+
viewBox: "0 0 24 24",
|
|
919
|
+
stroke: "currentColor",
|
|
920
|
+
strokeWidth: 1.5,
|
|
921
|
+
children: /* @__PURE__ */ e(
|
|
922
|
+
"path",
|
|
923
|
+
{
|
|
924
|
+
strokeLinecap: "round",
|
|
925
|
+
strokeLinejoin: "round",
|
|
926
|
+
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"
|
|
927
|
+
}
|
|
928
|
+
)
|
|
929
|
+
}
|
|
930
|
+
) : r.dialerAction || r.dialAction ? /* @__PURE__ */ e(
|
|
931
|
+
"svg",
|
|
932
|
+
{
|
|
933
|
+
className: E,
|
|
934
|
+
fill: "none",
|
|
935
|
+
viewBox: "0 0 24 24",
|
|
936
|
+
stroke: "currentColor",
|
|
937
|
+
strokeWidth: 1.5,
|
|
938
|
+
children: /* @__PURE__ */ e(
|
|
939
|
+
"path",
|
|
940
|
+
{
|
|
941
|
+
strokeLinecap: "round",
|
|
942
|
+
strokeLinejoin: "round",
|
|
943
|
+
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"
|
|
944
|
+
}
|
|
945
|
+
)
|
|
946
|
+
}
|
|
947
|
+
) : r.mapAction || r.viewLocationAction ? /* @__PURE__ */ n(
|
|
948
|
+
"svg",
|
|
949
|
+
{
|
|
950
|
+
className: E,
|
|
951
|
+
fill: "none",
|
|
952
|
+
viewBox: "0 0 24 24",
|
|
953
|
+
stroke: "currentColor",
|
|
954
|
+
strokeWidth: 1.5,
|
|
825
955
|
children: [
|
|
826
|
-
|
|
827
|
-
"
|
|
956
|
+
/* @__PURE__ */ e(
|
|
957
|
+
"path",
|
|
828
958
|
{
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
loading: "lazy"
|
|
959
|
+
strokeLinecap: "round",
|
|
960
|
+
strokeLinejoin: "round",
|
|
961
|
+
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"
|
|
833
962
|
}
|
|
834
|
-
)
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
r.description && /* @__PURE__ */ e(
|
|
844
|
-
"p",
|
|
845
|
-
{
|
|
846
|
-
className: `rcs-emulator-text-xs rcs-emulator-leading-relaxed rcs-emulator-line-clamp-3 ${t ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-700"}`,
|
|
847
|
-
children: r.description
|
|
848
|
-
}
|
|
849
|
-
),
|
|
850
|
-
r.suggestions && r.suggestions.length > 0 && /* @__PURE__ */ e(
|
|
851
|
-
"div",
|
|
852
|
-
{
|
|
853
|
-
className: `rcs-emulator-carousel-actions rcs-emulator-mt-3 rcs-emulator-divide-y ${t ? "rcs-emulator-divide-zinc-600" : "rcs-emulator-divide-gray-100"} ${l}`,
|
|
854
|
-
children: r.suggestions.map((c, u) => {
|
|
855
|
-
const i = z(c) ? c.action.displayText : c.reply.displayText;
|
|
856
|
-
return /* @__PURE__ */ n(
|
|
857
|
-
"button",
|
|
858
|
-
{
|
|
859
|
-
onClick: () => o(c),
|
|
860
|
-
className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-xs rcs-emulator-transition-colors rcs-emulator-text-left ${t ? "rcs-emulator-hover-bg-zinc-700 rcs-emulator-text-white" : "rcs-emulator-hover-bg-gray-50 rcs-emulator-text-gray-900"}`,
|
|
861
|
-
children: [
|
|
862
|
-
/* @__PURE__ */ e("span", { className: "rcs-emulator-flex-shrink-0", children: Ae(c) }),
|
|
863
|
-
/* @__PURE__ */ e("span", { className: "rcs-emulator-truncate", children: i })
|
|
864
|
-
]
|
|
865
|
-
},
|
|
866
|
-
u
|
|
867
|
-
);
|
|
868
|
-
})
|
|
869
|
-
}
|
|
870
|
-
)
|
|
871
|
-
] })
|
|
963
|
+
),
|
|
964
|
+
/* @__PURE__ */ e(
|
|
965
|
+
"path",
|
|
966
|
+
{
|
|
967
|
+
strokeLinecap: "round",
|
|
968
|
+
strokeLinejoin: "round",
|
|
969
|
+
d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
|
|
970
|
+
}
|
|
971
|
+
)
|
|
872
972
|
]
|
|
873
973
|
}
|
|
974
|
+
) : r.calendarAction || r.createCalendarEventAction ? /* @__PURE__ */ e(
|
|
975
|
+
"svg",
|
|
976
|
+
{
|
|
977
|
+
className: E,
|
|
978
|
+
fill: "none",
|
|
979
|
+
viewBox: "0 0 24 24",
|
|
980
|
+
stroke: "currentColor",
|
|
981
|
+
strokeWidth: 1.5,
|
|
982
|
+
children: /* @__PURE__ */ e(
|
|
983
|
+
"path",
|
|
984
|
+
{
|
|
985
|
+
strokeLinecap: "round",
|
|
986
|
+
strokeLinejoin: "round",
|
|
987
|
+
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"
|
|
988
|
+
}
|
|
989
|
+
)
|
|
990
|
+
}
|
|
991
|
+
) : /* @__PURE__ */ e(
|
|
992
|
+
"svg",
|
|
993
|
+
{
|
|
994
|
+
className: E,
|
|
995
|
+
fill: "none",
|
|
996
|
+
viewBox: "0 0 24 24",
|
|
997
|
+
stroke: "currentColor",
|
|
998
|
+
strokeWidth: 1.5,
|
|
999
|
+
children: /* @__PURE__ */ e(
|
|
1000
|
+
"path",
|
|
1001
|
+
{
|
|
1002
|
+
strokeLinecap: "round",
|
|
1003
|
+
strokeLinejoin: "round",
|
|
1004
|
+
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"
|
|
1005
|
+
}
|
|
1006
|
+
)
|
|
1007
|
+
}
|
|
874
1008
|
);
|
|
875
|
-
}
|
|
1009
|
+
}, Ie = p(function({
|
|
1010
|
+
card: r,
|
|
1011
|
+
isDark: t,
|
|
1012
|
+
onSuggestionClick: o
|
|
1013
|
+
}) {
|
|
1014
|
+
const a = r.layout.width === "small" ? "rcs-emulator-w-44" : "rcs-emulator-w-52", c = t ? "rcs-emulator-dark" : "rcs-emulator-light";
|
|
1015
|
+
return /* @__PURE__ */ n("div", { className: `rcs-emulator-carousel-card ${a} ${c}`, children: [
|
|
1016
|
+
r.media && /* @__PURE__ */ e("div", { className: "rcs-emulator-w-full rcs-emulator-h-32 rcs-emulator-bg-gray-200 rcs-emulator-overflow-hidden", children: /* @__PURE__ */ e(
|
|
1017
|
+
"img",
|
|
1018
|
+
{
|
|
1019
|
+
src: r.media.url,
|
|
1020
|
+
alt: r.title || "Carousel card media",
|
|
1021
|
+
className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-object-cover",
|
|
1022
|
+
loading: "lazy"
|
|
1023
|
+
}
|
|
1024
|
+
) }),
|
|
1025
|
+
/* @__PURE__ */ n("div", { className: "rcs-emulator-p-3", children: [
|
|
1026
|
+
r.title && /* @__PURE__ */ e(
|
|
1027
|
+
"h4",
|
|
1028
|
+
{
|
|
1029
|
+
className: `rcs-emulator-text-sm rcs-emulator-font-semibold rcs-emulator-leading-tight rcs-emulator-mb-1 rcs-emulator-line-clamp-2 ${t ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
|
|
1030
|
+
children: r.title
|
|
1031
|
+
}
|
|
1032
|
+
),
|
|
1033
|
+
r.description && /* @__PURE__ */ e(
|
|
1034
|
+
"p",
|
|
1035
|
+
{
|
|
1036
|
+
className: `rcs-emulator-text-xs rcs-emulator-leading-relaxed rcs-emulator-line-clamp-3 ${t ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-700"}`,
|
|
1037
|
+
children: r.description
|
|
1038
|
+
}
|
|
1039
|
+
),
|
|
1040
|
+
r.suggestions && r.suggestions.length > 0 && /* @__PURE__ */ e(
|
|
1041
|
+
"div",
|
|
1042
|
+
{
|
|
1043
|
+
className: `rcs-emulator-carousel-actions rcs-emulator-mt-3 rcs-emulator-divide-y ${t ? "rcs-emulator-divide-zinc-600" : "rcs-emulator-divide-gray-100"} ${c}`,
|
|
1044
|
+
children: r.suggestions.map((l, u) => {
|
|
1045
|
+
const i = I(l) ? l.action.displayText : l.reply.displayText;
|
|
1046
|
+
return /* @__PURE__ */ n(
|
|
1047
|
+
"button",
|
|
1048
|
+
{
|
|
1049
|
+
onClick: () => o(l),
|
|
1050
|
+
className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-xs rcs-emulator-transition-colors rcs-emulator-text-left rcs-emulator-border-none ${t ? "rcs-emulator-hover-bg-zinc-700 rcs-emulator-text-white" : "rcs-emulator-hover-bg-gray-50 rcs-emulator-text-gray-900"}`,
|
|
1051
|
+
children: [
|
|
1052
|
+
/* @__PURE__ */ e("span", { className: "rcs-emulator-flex-shrink-0", children: Ae(l) }),
|
|
1053
|
+
/* @__PURE__ */ e("span", { className: "rcs-emulator-truncate", children: i })
|
|
1054
|
+
]
|
|
1055
|
+
},
|
|
1056
|
+
u
|
|
1057
|
+
);
|
|
1058
|
+
})
|
|
1059
|
+
}
|
|
1060
|
+
)
|
|
1061
|
+
] })
|
|
1062
|
+
] });
|
|
1063
|
+
}), ze = {
|
|
876
1064
|
text: ({ content: s, sender: r, timestamp: t }) => s.type !== "text" ? null : /* @__PURE__ */ e(ve, { text: s.text, sender: r, timestamp: t }),
|
|
877
|
-
userReply: ({ content: s, timestamp: r }) => s.type !== "userReply" ? null : /* @__PURE__ */ e(
|
|
878
|
-
richcard: ({ content: s, timestamp: r }) => s.type !== "richcard" ? null : /* @__PURE__ */ e(
|
|
1065
|
+
userReply: ({ content: s, timestamp: r }) => s.type !== "userReply" ? null : /* @__PURE__ */ e(ye, { text: s.text, timestamp: r }),
|
|
1066
|
+
richcard: ({ content: s, timestamp: r }) => s.type !== "richcard" ? null : /* @__PURE__ */ e(we, { card: s.card, timestamp: r }),
|
|
879
1067
|
carousel: ({ content: s, timestamp: r }) => s.type !== "carousel" ? null : /* @__PURE__ */ e($e, { cards: s.cards, timestamp: r })
|
|
880
1068
|
}, Te = p(function({
|
|
881
1069
|
message: r,
|
|
882
1070
|
isLast: t
|
|
883
1071
|
}) {
|
|
884
|
-
const { content: o, sender: a, timestamp:
|
|
885
|
-
return
|
|
886
|
-
|
|
1072
|
+
const { content: o, sender: a, timestamp: c } = r, l = ze[o.type];
|
|
1073
|
+
return l ? /* @__PURE__ */ e(
|
|
1074
|
+
l,
|
|
887
1075
|
{
|
|
888
1076
|
content: o,
|
|
889
1077
|
sender: a,
|
|
890
|
-
timestamp:
|
|
1078
|
+
timestamp: c,
|
|
891
1079
|
showSuggestions: t && a === "business"
|
|
892
1080
|
}
|
|
893
1081
|
) : (console.warn(`Unknown message type: ${o.type}`), /* @__PURE__ */ e("div", { className: "rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-text-gray-500 rcs-emulator-text-sm rcs-emulator-italic", children: "[Unsupported message type]" }));
|
|
@@ -927,8 +1115,8 @@ const xe = p(function() {
|
|
|
927
1115
|
)
|
|
928
1116
|
}
|
|
929
1117
|
);
|
|
930
|
-
}),
|
|
931
|
-
const { theme: r, state: t } = k(), { chatHistory: o, isTyping: a } = t,
|
|
1118
|
+
}), Ee = p(function() {
|
|
1119
|
+
const { theme: r, state: t } = k(), { chatHistory: o, isTyping: a } = t, c = r === "dark", l = c ? "rcs-emulator-dark" : "rcs-emulator-light";
|
|
932
1120
|
return /* @__PURE__ */ n(
|
|
933
1121
|
"div",
|
|
934
1122
|
{
|
|
@@ -940,16 +1128,16 @@ const xe = p(function() {
|
|
|
940
1128
|
o.length > 0 && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-justify-center rcs-emulator-py-2", children: /* @__PURE__ */ e(
|
|
941
1129
|
"span",
|
|
942
1130
|
{
|
|
943
|
-
className: `rcs-emulator-text-xs rcs-emulator-font-medium rcs-emulator-px-3 rcs-emulator-py-1 ${
|
|
1131
|
+
className: `rcs-emulator-text-xs rcs-emulator-font-medium rcs-emulator-px-3 rcs-emulator-py-1 ${c ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-500"}`,
|
|
944
1132
|
children: "Today"
|
|
945
1133
|
}
|
|
946
1134
|
) }),
|
|
947
1135
|
/* @__PURE__ */ n(
|
|
948
1136
|
"div",
|
|
949
1137
|
{
|
|
950
|
-
className: `rcs-emulator-messages-container ${
|
|
1138
|
+
className: `rcs-emulator-messages-container ${l}`,
|
|
951
1139
|
children: [
|
|
952
|
-
o.length === 0 && !a && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-py-12", children: /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm ${
|
|
1140
|
+
o.length === 0 && !a && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-py-12", children: /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm ${c ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-400"}`, children: "No messages yet" }) }),
|
|
953
1141
|
/* @__PURE__ */ n("div", { className: "rcs-emulator-p-3 rcs-emulator-space-y-3", children: [
|
|
954
1142
|
o.map((u, m) => /* @__PURE__ */ e(
|
|
955
1143
|
"div",
|
|
@@ -973,12 +1161,12 @@ const xe = p(function() {
|
|
|
973
1161
|
]
|
|
974
1162
|
}
|
|
975
1163
|
);
|
|
976
|
-
}),
|
|
1164
|
+
}), je = p(function({
|
|
977
1165
|
suggestion: r,
|
|
978
1166
|
onClick: t,
|
|
979
1167
|
variant: o = "bar"
|
|
980
1168
|
}) {
|
|
981
|
-
const { theme: a, businessInfo:
|
|
1169
|
+
const { theme: a, businessInfo: c } = k(), l = a === "dark", u = I(r), m = u ? r.action.displayText : r.reply.displayText, i = u ? Be(r) : null, h = c.brandColor || "#1A73E8", f = l ? "rcs-emulator-dark" : "rcs-emulator-light";
|
|
982
1170
|
return o === "bar" ? /* @__PURE__ */ n(
|
|
983
1171
|
"button",
|
|
984
1172
|
{
|
|
@@ -996,7 +1184,7 @@ const xe = p(function() {
|
|
|
996
1184
|
{
|
|
997
1185
|
type: "button",
|
|
998
1186
|
onClick: t,
|
|
999
|
-
className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-left rcs-emulator-transition-colors rcs-emulator-rounded-lg rcs-emulator-list-item ${f}`,
|
|
1187
|
+
className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-left rcs-emulator-transition-colors rcs-emulator-rounded-lg rcs-emulator-list-item rcs-emulator-border-none ${f}`,
|
|
1000
1188
|
children: [
|
|
1001
1189
|
i && /* @__PURE__ */ e(
|
|
1002
1190
|
"div",
|
|
@@ -1015,7 +1203,7 @@ const xe = p(function() {
|
|
|
1015
1203
|
/* @__PURE__ */ e(
|
|
1016
1204
|
"span",
|
|
1017
1205
|
{
|
|
1018
|
-
className: `rcs-emulator-text-sm rcs-emulator-font-medium ${
|
|
1206
|
+
className: `rcs-emulator-text-sm rcs-emulator-font-medium ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
|
|
1019
1207
|
children: m
|
|
1020
1208
|
}
|
|
1021
1209
|
)
|
|
@@ -1026,13 +1214,13 @@ const xe = p(function() {
|
|
|
1026
1214
|
{
|
|
1027
1215
|
type: "button",
|
|
1028
1216
|
onClick: t,
|
|
1029
|
-
className: `rcs-emulator-w-full rcs-emulator-px-3 rcs-emulator-py-2 rcs-emulator-rounded-lg rcs-emulator-text-xs rcs-emulator-font-medium rcs-emulator-text-center rcs-emulator-border rcs-emulator-transition-colors ${
|
|
1217
|
+
className: `rcs-emulator-w-full rcs-emulator-px-3 rcs-emulator-py-2 rcs-emulator-rounded-lg rcs-emulator-text-xs rcs-emulator-font-medium rcs-emulator-text-center rcs-emulator-border rcs-emulator-transition-colors ${l ? "rcs-emulator-border-zinc-600 rcs-emulator-hover-bg-zinc-700 rcs-emulator-text-white" : "rcs-emulator-border-gray-300 rcs-emulator-hover-bg-gray-50 rcs-emulator-text-gray-900"}`,
|
|
1030
1218
|
children: m
|
|
1031
1219
|
}
|
|
1032
1220
|
);
|
|
1033
1221
|
});
|
|
1034
1222
|
function Be(s) {
|
|
1035
|
-
if (!
|
|
1223
|
+
if (!I(s)) return null;
|
|
1036
1224
|
const { action: r } = s;
|
|
1037
1225
|
return r.openUrlAction ? ({ className: t, style: o }) => /* @__PURE__ */ e(
|
|
1038
1226
|
"svg",
|
|
@@ -1147,23 +1335,23 @@ function Be(s) {
|
|
|
1147
1335
|
) : null;
|
|
1148
1336
|
}
|
|
1149
1337
|
function Re(s) {
|
|
1150
|
-
if (!
|
|
1338
|
+
if (!I(s)) return "Reply";
|
|
1151
1339
|
const { action: r } = s;
|
|
1152
1340
|
return r.openUrlAction ? "Open link" : r.dialAction ? "Call" : r.shareLocationAction ? "Share location" : r.viewLocationAction ? "View location" : r.createCalendarEventAction ? "Add to calendar" : "Action";
|
|
1153
1341
|
}
|
|
1154
1342
|
const We = p(function({
|
|
1155
1343
|
suggestions: r
|
|
1156
1344
|
}) {
|
|
1157
|
-
const { theme: t, handleReply: o, handleAction: a } = k(),
|
|
1345
|
+
const { theme: t, handleReply: o, handleAction: a } = k(), c = t === "dark";
|
|
1158
1346
|
if (!r || r.length === 0)
|
|
1159
1347
|
return null;
|
|
1160
|
-
const
|
|
1161
|
-
Y(u) ? o(u) :
|
|
1348
|
+
const l = (u) => {
|
|
1349
|
+
Y(u) ? o(u) : I(u) && a(u);
|
|
1162
1350
|
};
|
|
1163
1351
|
return /* @__PURE__ */ e(
|
|
1164
1352
|
"div",
|
|
1165
1353
|
{
|
|
1166
|
-
className: `rcs-emulator-suggestions-bar rcs-emulator-px-3 rcs-emulator-py-2 ${
|
|
1354
|
+
className: `rcs-emulator-suggestions-bar rcs-emulator-px-3 rcs-emulator-py-2 ${c ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
|
|
1167
1355
|
role: "group",
|
|
1168
1356
|
"aria-label": "Quick replies",
|
|
1169
1357
|
children: /* @__PURE__ */ e(
|
|
@@ -1171,10 +1359,10 @@ const We = p(function({
|
|
|
1171
1359
|
{
|
|
1172
1360
|
className: "rcs-emulator-flex rcs-emulator-gap-2 rcs-emulator-overflow-x-auto rcs-emulator-pb-1 rcs-emulator--mx-1 rcs-emulator-px-1 rcs-emulator-scrollbar-hide",
|
|
1173
1361
|
children: r.map((u, m) => /* @__PURE__ */ e(
|
|
1174
|
-
|
|
1362
|
+
je,
|
|
1175
1363
|
{
|
|
1176
1364
|
suggestion: u,
|
|
1177
|
-
onClick: () =>
|
|
1365
|
+
onClick: () => l(u),
|
|
1178
1366
|
variant: "bar"
|
|
1179
1367
|
},
|
|
1180
1368
|
m
|
|
@@ -1184,27 +1372,27 @@ const We = p(function({
|
|
|
1184
1372
|
}
|
|
1185
1373
|
);
|
|
1186
1374
|
}), Ve = p(function() {
|
|
1187
|
-
const { theme: r, state: t, showSuggestions: o } = k(), { chatHistory: a, isTyping:
|
|
1375
|
+
const { theme: r, state: t, showSuggestions: o } = k(), { chatHistory: a, isTyping: c, error: l } = t, u = ge([
|
|
1188
1376
|
a.length,
|
|
1189
|
-
|
|
1190
|
-
]), m = r === "dark", i = m ? "rcs-emulator-dark" : "rcs-emulator-light", h = a[a.length - 1], f = o && h?.sender === "business" && !
|
|
1377
|
+
c
|
|
1378
|
+
]), m = r === "dark", i = m ? "rcs-emulator-dark" : "rcs-emulator-light", h = a[a.length - 1], f = o && h?.sender === "business" && !c ? h.suggestions : void 0;
|
|
1191
1379
|
return /* @__PURE__ */ n(
|
|
1192
1380
|
"div",
|
|
1193
1381
|
{
|
|
1194
|
-
className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-overflow-hidden ${m ? "rcs-emulator-
|
|
1382
|
+
className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-overflow-hidden ${m ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
|
|
1195
1383
|
children: [
|
|
1196
1384
|
/* @__PURE__ */ e(xe, {}),
|
|
1197
|
-
|
|
1385
|
+
l && /* @__PURE__ */ e(
|
|
1198
1386
|
"div",
|
|
1199
1387
|
{
|
|
1200
1388
|
className: "rcs-emulator-error-alert",
|
|
1201
1389
|
role: "alert",
|
|
1202
|
-
children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-red-500", children:
|
|
1390
|
+
children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-red-500", children: l })
|
|
1203
1391
|
}
|
|
1204
1392
|
),
|
|
1205
1393
|
/* @__PURE__ */ n("div", { ref: u, className: "rcs-emulator-flex-1 rcs-emulator-overflow-y-auto rcs-emulator-scrollbar", children: [
|
|
1206
1394
|
/* @__PURE__ */ e(be, {}),
|
|
1207
|
-
/* @__PURE__ */ e(
|
|
1395
|
+
/* @__PURE__ */ e(Ee, {})
|
|
1208
1396
|
] }),
|
|
1209
1397
|
f && f.length > 0 && /* @__PURE__ */ e(We, { suggestions: f }),
|
|
1210
1398
|
/* @__PURE__ */ n(
|
|
@@ -1321,22 +1509,22 @@ const We = p(function({
|
|
|
1321
1509
|
}
|
|
1322
1510
|
);
|
|
1323
1511
|
}), He = p(function() {
|
|
1324
|
-
const { theme: r, businessInfo: t, toggleProfile: o } = k(), [a,
|
|
1512
|
+
const { theme: r, businessInfo: t, toggleProfile: o } = k(), [a, c] = A("info"), l = r === "dark", u = t.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", m = t.brandColor || "#0084ff";
|
|
1325
1513
|
return /* @__PURE__ */ n(
|
|
1326
1514
|
"div",
|
|
1327
1515
|
{
|
|
1328
|
-
className: `rcs-emulator-absolute rcs-emulator-inset-0 rcs-emulator-z-50 rcs-emulator-flex rcs-emulator-flex-col ${
|
|
1516
|
+
className: `rcs-emulator-absolute rcs-emulator-inset-0 rcs-emulator-z-50 rcs-emulator-flex rcs-emulator-flex-col ${l ? "rcs-emulator-bg-zinc-950" : "rcs-emulator-bg-white"}`,
|
|
1329
1517
|
children: [
|
|
1330
1518
|
/* @__PURE__ */ n(
|
|
1331
1519
|
"header",
|
|
1332
1520
|
{
|
|
1333
|
-
className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-4 rcs-emulator-py-3 rcs-emulator-border-b ${
|
|
1521
|
+
className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-4 rcs-emulator-py-3 rcs-emulator-border-b ${l ? "rcs-emulator-bg-zinc-900 rcs-emulator-border-zinc-800" : "rcs-emulator-bg-white rcs-emulator-border-gray-200"}`,
|
|
1334
1522
|
children: [
|
|
1335
1523
|
/* @__PURE__ */ e(
|
|
1336
1524
|
"button",
|
|
1337
1525
|
{
|
|
1338
1526
|
onClick: o,
|
|
1339
|
-
className: `rcs-emulator-p-1-5 rcs-emulator--ml-1-5 rcs-emulator-rounded-full rcs-emulator-transition-colors ${
|
|
1527
|
+
className: `rcs-emulator-p-1-5 rcs-emulator--ml-1-5 rcs-emulator-rounded-full rcs-emulator-transition-colors ${l ? "rcs-emulator-hover-bg-zinc-800 rcs-emulator-text-white" : "rcs-emulator-hover-bg-gray-100 rcs-emulator-text-gray-900"}`,
|
|
1340
1528
|
"aria-label": "Go back",
|
|
1341
1529
|
children: /* @__PURE__ */ e(
|
|
1342
1530
|
"svg",
|
|
@@ -1361,7 +1549,7 @@ const We = p(function({
|
|
|
1361
1549
|
/* @__PURE__ */ e(
|
|
1362
1550
|
"span",
|
|
1363
1551
|
{
|
|
1364
|
-
className: `rcs-emulator-text-base rcs-emulator-font-medium ${
|
|
1552
|
+
className: `rcs-emulator-text-base rcs-emulator-font-medium ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
|
|
1365
1553
|
children: "Info & options"
|
|
1366
1554
|
}
|
|
1367
1555
|
)
|
|
@@ -1380,7 +1568,7 @@ const We = p(function({
|
|
|
1380
1568
|
/* @__PURE__ */ e("div", { className: "rcs-emulator-relative rcs-emulator-px-4", children: /* @__PURE__ */ e(
|
|
1381
1569
|
"div",
|
|
1382
1570
|
{
|
|
1383
|
-
className: `rcs-emulator-absolute rcs-emulator--top-10 rcs-emulator-left-1-2 rcs-emulator--translate-x-1-2 rcs-emulator-w-20 rcs-emulator-h-20 rcs-emulator-rounded-full rcs-emulator-overflow-hidden rcs-emulator-border-4 ${
|
|
1571
|
+
className: `rcs-emulator-absolute rcs-emulator--top-10 rcs-emulator-left-1-2 rcs-emulator--translate-x-1-2 rcs-emulator-w-20 rcs-emulator-h-20 rcs-emulator-rounded-full rcs-emulator-overflow-hidden rcs-emulator-border-4 ${l ? "rcs-emulator-border-zinc-950 rcs-emulator-bg-zinc-800" : "rcs-emulator-border-white rcs-emulator-bg-gray-100"} rcs-emulator-shadow-lg`,
|
|
1384
1572
|
children: t.logo ? /* @__PURE__ */ e(
|
|
1385
1573
|
"img",
|
|
1386
1574
|
{
|
|
@@ -1402,11 +1590,11 @@ const We = p(function({
|
|
|
1402
1590
|
/* @__PURE__ */ e(
|
|
1403
1591
|
"h1",
|
|
1404
1592
|
{
|
|
1405
|
-
className: `rcs-emulator-text-xl rcs-emulator-font-semibold ${
|
|
1593
|
+
className: `rcs-emulator-text-xl rcs-emulator-font-semibold ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
|
|
1406
1594
|
children: t.name
|
|
1407
1595
|
}
|
|
1408
1596
|
),
|
|
1409
|
-
t.description && /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm rcs-emulator-mt-1 ${
|
|
1597
|
+
t.description && /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm rcs-emulator-mt-1 ${l ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`, children: t.description })
|
|
1410
1598
|
] }),
|
|
1411
1599
|
/* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-justify-center rcs-emulator-gap-4 rcs-emulator-px-4 rcs-emulator-pb-4", children: [
|
|
1412
1600
|
t.phoneNumbers && t.phoneNumbers.length > 0 && /* @__PURE__ */ e(
|
|
@@ -1414,7 +1602,7 @@ const We = p(function({
|
|
|
1414
1602
|
{
|
|
1415
1603
|
icon: "phone",
|
|
1416
1604
|
label: "Call",
|
|
1417
|
-
isDark:
|
|
1605
|
+
isDark: l,
|
|
1418
1606
|
brandColor: m,
|
|
1419
1607
|
onClick: () => {
|
|
1420
1608
|
const i = t.phoneNumbers?.[0]?.number;
|
|
@@ -1427,7 +1615,7 @@ const We = p(function({
|
|
|
1427
1615
|
{
|
|
1428
1616
|
icon: "globe",
|
|
1429
1617
|
label: "Website",
|
|
1430
|
-
isDark:
|
|
1618
|
+
isDark: l,
|
|
1431
1619
|
brandColor: m,
|
|
1432
1620
|
onClick: () => {
|
|
1433
1621
|
const i = t.websites?.[0]?.url;
|
|
@@ -1440,7 +1628,7 @@ const We = p(function({
|
|
|
1440
1628
|
{
|
|
1441
1629
|
icon: "mail",
|
|
1442
1630
|
label: "Contact",
|
|
1443
|
-
isDark:
|
|
1631
|
+
isDark: l,
|
|
1444
1632
|
brandColor: m,
|
|
1445
1633
|
onClick: () => {
|
|
1446
1634
|
const i = t.emails?.[0]?.email;
|
|
@@ -1452,14 +1640,14 @@ const We = p(function({
|
|
|
1452
1640
|
/* @__PURE__ */ n(
|
|
1453
1641
|
"div",
|
|
1454
1642
|
{
|
|
1455
|
-
className: `rcs-emulator-tabs-container rcs-emulator-flex rcs-emulator-mx-4 rcs-emulator-rounded-lg rcs-emulator-overflow-hidden rcs-emulator-border ${
|
|
1643
|
+
className: `rcs-emulator-tabs-container rcs-emulator-flex rcs-emulator-mx-4 rcs-emulator-rounded-lg rcs-emulator-overflow-hidden rcs-emulator-border ${l ? "rcs-emulator-border-zinc-700 rcs-emulator-bg-zinc-800" : "rcs-emulator-border-gray-200 rcs-emulator-bg-gray-100"}`,
|
|
1456
1644
|
children: [
|
|
1457
1645
|
/* @__PURE__ */ e(
|
|
1458
1646
|
F,
|
|
1459
1647
|
{
|
|
1460
1648
|
active: a === "info",
|
|
1461
|
-
onClick: () =>
|
|
1462
|
-
isDark:
|
|
1649
|
+
onClick: () => c("info"),
|
|
1650
|
+
isDark: l,
|
|
1463
1651
|
brandColor: m,
|
|
1464
1652
|
children: "Info"
|
|
1465
1653
|
}
|
|
@@ -1468,8 +1656,8 @@ const We = p(function({
|
|
|
1468
1656
|
F,
|
|
1469
1657
|
{
|
|
1470
1658
|
active: a === "options",
|
|
1471
|
-
onClick: () =>
|
|
1472
|
-
isDark:
|
|
1659
|
+
onClick: () => c("options"),
|
|
1660
|
+
isDark: l,
|
|
1473
1661
|
brandColor: m,
|
|
1474
1662
|
children: "Options"
|
|
1475
1663
|
}
|
|
@@ -1477,7 +1665,7 @@ const We = p(function({
|
|
|
1477
1665
|
]
|
|
1478
1666
|
}
|
|
1479
1667
|
),
|
|
1480
|
-
/* @__PURE__ */ e("div", { className: "rcs-emulator-p-4", children: a === "info" ? /* @__PURE__ */ e(_e, { isDark:
|
|
1668
|
+
/* @__PURE__ */ e("div", { className: "rcs-emulator-p-4", children: a === "info" ? /* @__PURE__ */ e(_e, { isDark: l, brandColor: m }) : /* @__PURE__ */ e(Ue, { isDark: l }) })
|
|
1481
1669
|
] })
|
|
1482
1670
|
]
|
|
1483
1671
|
}
|
|
@@ -1487,12 +1675,12 @@ const We = p(function({
|
|
|
1487
1675
|
label: t,
|
|
1488
1676
|
isDark: o,
|
|
1489
1677
|
brandColor: a,
|
|
1490
|
-
onClick:
|
|
1678
|
+
onClick: c
|
|
1491
1679
|
}) {
|
|
1492
1680
|
return /* @__PURE__ */ n(
|
|
1493
1681
|
"button",
|
|
1494
1682
|
{
|
|
1495
|
-
onClick:
|
|
1683
|
+
onClick: c,
|
|
1496
1684
|
className: `rcs-emulator-quick-action-btn rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-6 rcs-emulator-py-3 rcs-emulator-rounded-xl rcs-emulator-border rcs-emulator-transition-colors ${o ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
|
|
1497
1685
|
children: [
|
|
1498
1686
|
/* @__PURE__ */ e(
|
|
@@ -1548,7 +1736,7 @@ const We = p(function({
|
|
|
1548
1736
|
onClick: t,
|
|
1549
1737
|
isDark: o,
|
|
1550
1738
|
brandColor: a,
|
|
1551
|
-
children:
|
|
1739
|
+
children: c
|
|
1552
1740
|
}) {
|
|
1553
1741
|
return /* @__PURE__ */ e(
|
|
1554
1742
|
"button",
|
|
@@ -1556,7 +1744,7 @@ const We = p(function({
|
|
|
1556
1744
|
onClick: t,
|
|
1557
1745
|
className: `rcs-emulator-tab-btn rcs-emulator-flex-1 rcs-emulator-py-2-5 rcs-emulator-text-sm rcs-emulator-font-medium rcs-emulator-transition-colors rcs-emulator-rounded-lg ${r ? "rcs-emulator-active" : `rcs-emulator-inactive ${o ? "rcs-emulator-dark" : "rcs-emulator-light"}`}`,
|
|
1558
1746
|
style: r ? { backgroundColor: a } : void 0,
|
|
1559
|
-
children:
|
|
1747
|
+
children: c
|
|
1560
1748
|
}
|
|
1561
1749
|
);
|
|
1562
1750
|
}), _e = p(function({ isDark: r, brandColor: t }) {
|
|
@@ -1566,41 +1754,41 @@ const We = p(function({
|
|
|
1566
1754
|
{
|
|
1567
1755
|
className: `rcs-emulator-profile-section rcs-emulator-rounded-xl rcs-emulator-overflow-hidden rcs-emulator-border rcs-emulator-divide-y ${r ? "rcs-emulator-dark rcs-emulator-divide-zinc-800" : "rcs-emulator-light rcs-emulator-divide-gray-200"}`,
|
|
1568
1756
|
children: [
|
|
1569
|
-
o.phoneNumbers?.map((
|
|
1757
|
+
o.phoneNumbers?.map((c, l) => /* @__PURE__ */ e(
|
|
1570
1758
|
U,
|
|
1571
1759
|
{
|
|
1572
1760
|
icon: "phone",
|
|
1573
|
-
primary:
|
|
1574
|
-
secondary:
|
|
1761
|
+
primary: c.number,
|
|
1762
|
+
secondary: c.label,
|
|
1575
1763
|
isDark: r,
|
|
1576
1764
|
brandColor: t,
|
|
1577
|
-
onClick: () => window.location.href = `tel:${
|
|
1765
|
+
onClick: () => window.location.href = `tel:${c.number}`
|
|
1578
1766
|
},
|
|
1579
|
-
`phone-${
|
|
1767
|
+
`phone-${l}`
|
|
1580
1768
|
)),
|
|
1581
|
-
o.websites?.map((
|
|
1769
|
+
o.websites?.map((c, l) => /* @__PURE__ */ e(
|
|
1582
1770
|
U,
|
|
1583
1771
|
{
|
|
1584
1772
|
icon: "globe",
|
|
1585
|
-
primary:
|
|
1586
|
-
secondary:
|
|
1773
|
+
primary: c.url.replace(/^https?:\/\//, ""),
|
|
1774
|
+
secondary: c.label || "Website",
|
|
1587
1775
|
isDark: r,
|
|
1588
1776
|
brandColor: t,
|
|
1589
|
-
onClick: () => window.open(
|
|
1777
|
+
onClick: () => window.open(c.url, "_blank", "noopener,noreferrer")
|
|
1590
1778
|
},
|
|
1591
|
-
`web-${
|
|
1779
|
+
`web-${l}`
|
|
1592
1780
|
)),
|
|
1593
|
-
o.emails?.map((
|
|
1781
|
+
o.emails?.map((c, l) => /* @__PURE__ */ e(
|
|
1594
1782
|
U,
|
|
1595
1783
|
{
|
|
1596
1784
|
icon: "mail",
|
|
1597
|
-
primary:
|
|
1598
|
-
secondary:
|
|
1785
|
+
primary: c.email,
|
|
1786
|
+
secondary: c.label || "Email",
|
|
1599
1787
|
isDark: r,
|
|
1600
1788
|
brandColor: t,
|
|
1601
|
-
onClick: () => window.location.href = `mailto:${
|
|
1789
|
+
onClick: () => window.location.href = `mailto:${c.email}`
|
|
1602
1790
|
},
|
|
1603
|
-
`email-${
|
|
1791
|
+
`email-${l}`
|
|
1604
1792
|
))
|
|
1605
1793
|
]
|
|
1606
1794
|
}
|
|
@@ -1616,12 +1804,12 @@ const We = p(function({
|
|
|
1616
1804
|
primary: t,
|
|
1617
1805
|
secondary: o,
|
|
1618
1806
|
isDark: a,
|
|
1619
|
-
onClick:
|
|
1807
|
+
onClick: c
|
|
1620
1808
|
}) {
|
|
1621
1809
|
return /* @__PURE__ */ n(
|
|
1622
1810
|
"button",
|
|
1623
1811
|
{
|
|
1624
|
-
onClick:
|
|
1812
|
+
onClick: c,
|
|
1625
1813
|
className: `rcs-emulator-list-item rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-4 rcs-emulator-px-4 rcs-emulator-py-3-5 rcs-emulator-text-left rcs-emulator-transition-colors ${a ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
|
|
1626
1814
|
children: [
|
|
1627
1815
|
/* @__PURE__ */ e(
|
|
@@ -1745,14 +1933,14 @@ const We = p(function({
|
|
|
1745
1933
|
TALL: "rcs-emulator-webview-tall",
|
|
1746
1934
|
HALF: "rcs-emulator-webview-half"
|
|
1747
1935
|
}, De = p(function() {
|
|
1748
|
-
const { theme: r, businessInfo: t, webView: o, closeWebView: a } = k(), [
|
|
1749
|
-
|
|
1750
|
-
o?.url && (
|
|
1936
|
+
const { theme: r, businessInfo: t, webView: o, closeWebView: a } = k(), [c, l] = A(!0), [u, m] = A(!1), i = r === "dark", h = t.brandColor || "#0084ff";
|
|
1937
|
+
j(() => {
|
|
1938
|
+
o?.url && (l(!0), m(!1));
|
|
1751
1939
|
}, [o?.url]);
|
|
1752
1940
|
const f = $(() => {
|
|
1753
|
-
|
|
1754
|
-
}, []),
|
|
1755
|
-
|
|
1941
|
+
l(!1);
|
|
1942
|
+
}, []), v = $(() => {
|
|
1943
|
+
l(!1), m(!0);
|
|
1756
1944
|
}, []), b = (C) => {
|
|
1757
1945
|
try {
|
|
1758
1946
|
return new URL(C).hostname;
|
|
@@ -1761,7 +1949,7 @@ const We = p(function({
|
|
|
1761
1949
|
}
|
|
1762
1950
|
};
|
|
1763
1951
|
if (!o || !o.isOpen) return null;
|
|
1764
|
-
const { url: N, viewMode:
|
|
1952
|
+
const { url: N, viewMode: y, title: w, postbackData: g } = o, d = w || b(N), x = y === "FULL", L = y === "TALL" || y === "HALF", z = q[y] || q.TALL;
|
|
1765
1953
|
return /* @__PURE__ */ n(
|
|
1766
1954
|
"div",
|
|
1767
1955
|
{
|
|
@@ -1770,7 +1958,7 @@ const We = p(function({
|
|
|
1770
1958
|
"aria-modal": "true",
|
|
1771
1959
|
"aria-label": `WebView: ${d}`,
|
|
1772
1960
|
"data-postback": g,
|
|
1773
|
-
"data-view-mode":
|
|
1961
|
+
"data-view-mode": y,
|
|
1774
1962
|
children: [
|
|
1775
1963
|
L && /* @__PURE__ */ e(
|
|
1776
1964
|
"button",
|
|
@@ -1784,7 +1972,7 @@ const We = p(function({
|
|
|
1784
1972
|
/* @__PURE__ */ n(
|
|
1785
1973
|
"div",
|
|
1786
1974
|
{
|
|
1787
|
-
className: `rcs-emulator-relative rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-overflow-hidden ${i ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"} ${
|
|
1975
|
+
className: `rcs-emulator-relative rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-overflow-hidden ${i ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"} ${z} rcs-emulator-w-full ${L ? "rcs-emulator-rounded-t-2xl rcs-emulator-shadow-2xl" : ""}`,
|
|
1788
1976
|
style: {
|
|
1789
1977
|
// Ensure container is above backdrop
|
|
1790
1978
|
position: "relative",
|
|
@@ -1863,7 +2051,7 @@ const We = p(function({
|
|
|
1863
2051
|
]
|
|
1864
2052
|
}
|
|
1865
2053
|
),
|
|
1866
|
-
|
|
2054
|
+
c && /* @__PURE__ */ e(
|
|
1867
2055
|
"div",
|
|
1868
2056
|
{
|
|
1869
2057
|
className: "rcs-emulator-absolute rcs-emulator-top-14 rcs-emulator-left-0 rcs-emulator-right-0 rcs-emulator-h-1 rcs-emulator-overflow-hidden",
|
|
@@ -1924,7 +2112,7 @@ const We = p(function({
|
|
|
1924
2112
|
title: d,
|
|
1925
2113
|
className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-border-0",
|
|
1926
2114
|
onLoad: f,
|
|
1927
|
-
onError:
|
|
2115
|
+
onError: v,
|
|
1928
2116
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups",
|
|
1929
2117
|
referrerPolicy: "no-referrer-when-downgrade",
|
|
1930
2118
|
loading: "lazy"
|
|
@@ -1946,18 +2134,18 @@ const We = p(function({
|
|
|
1946
2134
|
onUnlock: r,
|
|
1947
2135
|
messagePreview: t = "New message"
|
|
1948
2136
|
}) {
|
|
1949
|
-
const { theme: o, businessInfo: a } = k(), [
|
|
1950
|
-
|
|
1951
|
-
const
|
|
1952
|
-
|
|
2137
|
+
const { theme: o, businessInfo: a } = k(), [c, l] = A(/* @__PURE__ */ new Date()), u = o === "dark";
|
|
2138
|
+
j(() => {
|
|
2139
|
+
const h = setInterval(() => {
|
|
2140
|
+
l(/* @__PURE__ */ new Date());
|
|
1953
2141
|
}, 1e3);
|
|
1954
|
-
return () => clearInterval(
|
|
2142
|
+
return () => clearInterval(h);
|
|
1955
2143
|
}, []);
|
|
1956
|
-
const m =
|
|
2144
|
+
const m = c.toLocaleTimeString([], {
|
|
1957
2145
|
hour: "numeric",
|
|
1958
2146
|
minute: "2-digit",
|
|
1959
2147
|
hour12: !0
|
|
1960
|
-
}), i =
|
|
2148
|
+
}), i = c.toLocaleDateString([], {
|
|
1961
2149
|
weekday: "short",
|
|
1962
2150
|
month: "long",
|
|
1963
2151
|
day: "numeric"
|
|
@@ -1985,21 +2173,7 @@ const We = p(function({
|
|
|
1985
2173
|
}
|
|
1986
2174
|
) }) }),
|
|
1987
2175
|
/* @__PURE__ */ e("div", { className: "rcs-emulator-mt-6 rcs-emulator-text-center", children: /* @__PURE__ */ e("h1", { className: "rcs-emulator-text-5xl rcs-emulator-font-light rcs-emulator-text-white rcs-emulator-tracking-tight", children: m }) }),
|
|
1988
|
-
/* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */ e("p", { className: "rcs-emulator-text-zinc-400 rcs-emulator-text-sm", children: i }),
|
|
1990
|
-
/* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-gap-1 rcs-emulator-mt-1 rcs-emulator-text-zinc-500 rcs-emulator-text-xs", children: [
|
|
1991
|
-
/* @__PURE__ */ e(
|
|
1992
|
-
"svg",
|
|
1993
|
-
{
|
|
1994
|
-
className: "rcs-emulator-w-3-5 rcs-emulator-h-3-5",
|
|
1995
|
-
fill: "currentColor",
|
|
1996
|
-
viewBox: "0 0 20 20",
|
|
1997
|
-
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" })
|
|
1998
|
-
}
|
|
1999
|
-
),
|
|
2000
|
-
/* @__PURE__ */ e("span", { className: "rcs-emulator-text-zinc-500", children: "19°C" })
|
|
2001
|
-
] })
|
|
2002
|
-
] }),
|
|
2176
|
+
/* @__PURE__ */ e("div", { className: "rcs-emulator-mt-2 rcs-emulator-text-center", children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-zinc-400 rcs-emulator-text-sm", children: i }) }),
|
|
2003
2177
|
/* @__PURE__ */ e("div", { className: "rcs-emulator-h-24" }),
|
|
2004
2178
|
/* @__PURE__ */ e("div", { className: "rcs-emulator-px-4 rcs-emulator-pb-8", children: /* @__PURE__ */ n(
|
|
2005
2179
|
"button",
|
|
@@ -2038,8 +2212,8 @@ const We = p(function({
|
|
|
2038
2212
|
}
|
|
2039
2213
|
) }) }),
|
|
2040
2214
|
/* @__PURE__ */ n("div", { className: "rcs-emulator-flex-1 rcs-emulator-text-left rcs-emulator-min-w-0", children: [
|
|
2041
|
-
/* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-font-semibold rcs-emulator-text-gray-900 rcs-emulator-truncate", children: a.name }),
|
|
2042
|
-
/* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-gray-500 rcs-emulator-truncate", children: t })
|
|
2215
|
+
/* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-font-semibold rcs-emulator-text-gray-900 rcs-emulator-truncate rcs-emulator-mb-1", children: a.name }),
|
|
2216
|
+
/* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-gray-500 rcs-emulator-truncate rcs-emulator-line-clamp-2 rcs-emulator-mb-1", children: t })
|
|
2043
2217
|
] }),
|
|
2044
2218
|
/* @__PURE__ */ e("span", { className: "rcs-emulator-text-xs rcs-emulator-text-gray-400 rcs-emulator-flex-shrink-0", children: "now" })
|
|
2045
2219
|
]
|
|
@@ -2058,8 +2232,8 @@ const We = p(function({
|
|
|
2058
2232
|
onUserReply: t,
|
|
2059
2233
|
theme: o,
|
|
2060
2234
|
device: a,
|
|
2061
|
-
businessInfo:
|
|
2062
|
-
showSuggestions:
|
|
2235
|
+
businessInfo: c,
|
|
2236
|
+
showSuggestions: l
|
|
2063
2237
|
}) {
|
|
2064
2238
|
const {
|
|
2065
2239
|
state: u,
|
|
@@ -2069,21 +2243,21 @@ const We = p(function({
|
|
|
2069
2243
|
flow: r,
|
|
2070
2244
|
onUserReply: t,
|
|
2071
2245
|
typingDelay: 800
|
|
2072
|
-
}), [h, f] = A(!1),
|
|
2246
|
+
}), [h, f] = A(!1), v = $(() => {
|
|
2073
2247
|
f((d) => !d);
|
|
2074
|
-
}, []), [b, N] = A(null),
|
|
2248
|
+
}, []), [b, N] = A(null), y = $((d) => {
|
|
2075
2249
|
N({
|
|
2076
2250
|
...d,
|
|
2077
2251
|
isOpen: !0
|
|
2078
2252
|
});
|
|
2079
|
-
}, []),
|
|
2253
|
+
}, []), w = $(() => {
|
|
2080
2254
|
N(null);
|
|
2081
2255
|
}, []), g = $(
|
|
2082
2256
|
(d) => {
|
|
2083
|
-
if (!
|
|
2257
|
+
if (!I(d)) return;
|
|
2084
2258
|
const x = oe(d);
|
|
2085
2259
|
if (x) {
|
|
2086
|
-
|
|
2260
|
+
y({
|
|
2087
2261
|
url: x.url,
|
|
2088
2262
|
viewMode: x.webviewViewMode || "TALL",
|
|
2089
2263
|
title: x.description || "",
|
|
@@ -2104,23 +2278,23 @@ const We = p(function({
|
|
|
2104
2278
|
}
|
|
2105
2279
|
i(d);
|
|
2106
2280
|
},
|
|
2107
|
-
[i,
|
|
2281
|
+
[i, y, t]
|
|
2108
2282
|
);
|
|
2109
2283
|
return /* @__PURE__ */ n(
|
|
2110
2284
|
Z,
|
|
2111
2285
|
{
|
|
2112
2286
|
theme: o,
|
|
2113
2287
|
device: a,
|
|
2114
|
-
businessInfo:
|
|
2288
|
+
businessInfo: c,
|
|
2115
2289
|
state: u,
|
|
2116
|
-
showSuggestions:
|
|
2290
|
+
showSuggestions: l,
|
|
2117
2291
|
isProfileOpen: h,
|
|
2118
|
-
toggleProfile:
|
|
2292
|
+
toggleProfile: v,
|
|
2119
2293
|
onReply: m,
|
|
2120
2294
|
onAction: g,
|
|
2121
2295
|
webView: b,
|
|
2122
|
-
openWebView:
|
|
2123
|
-
closeWebView:
|
|
2296
|
+
openWebView: y,
|
|
2297
|
+
closeWebView: w,
|
|
2124
2298
|
children: [
|
|
2125
2299
|
/* @__PURE__ */ e(Ve, {}),
|
|
2126
2300
|
h && /* @__PURE__ */ e(He, {}),
|
|
@@ -2133,32 +2307,32 @@ const We = p(function({
|
|
|
2133
2307
|
jsonUrl: t,
|
|
2134
2308
|
onUserReply: o,
|
|
2135
2309
|
theme: a = "light",
|
|
2136
|
-
device:
|
|
2137
|
-
businessInfo:
|
|
2310
|
+
device: c = "android",
|
|
2311
|
+
businessInfo: l,
|
|
2138
2312
|
className: u = "",
|
|
2139
2313
|
width: m = 375,
|
|
2140
2314
|
height: i = 667,
|
|
2141
2315
|
showSuggestions: h = !0,
|
|
2142
2316
|
showLockScreen: f = !1
|
|
2143
2317
|
}) {
|
|
2144
|
-
const [
|
|
2318
|
+
const [v, b] = A(f), N = $(() => {
|
|
2145
2319
|
b(!1);
|
|
2146
2320
|
}, []), {
|
|
2147
|
-
data:
|
|
2148
|
-
isLoading:
|
|
2321
|
+
data: y,
|
|
2322
|
+
isLoading: w,
|
|
2149
2323
|
error: g
|
|
2150
|
-
} = pe(t), d = t ?
|
|
2324
|
+
} = pe(t), d = t ? y : r, x = V(
|
|
2151
2325
|
() => d ? me(d) : !1,
|
|
2152
2326
|
[d]
|
|
2153
2327
|
), L = V(
|
|
2154
2328
|
() => ({
|
|
2155
2329
|
...J,
|
|
2156
|
-
...
|
|
2330
|
+
...l,
|
|
2157
2331
|
// Extract name from flow if not provided
|
|
2158
|
-
name:
|
|
2332
|
+
name: l?.name || d?.name || J.name
|
|
2159
2333
|
}),
|
|
2160
|
-
[
|
|
2161
|
-
),
|
|
2334
|
+
[l, d?.name]
|
|
2335
|
+
), z = V(
|
|
2162
2336
|
() => d && x ? de(d) : "New message",
|
|
2163
2337
|
[d, x]
|
|
2164
2338
|
), C = a === "dark", T = C ? "rcs-emulator-dark" : "rcs-emulator-light", M = ({ children: S }) => /* @__PURE__ */ e(
|
|
@@ -2169,11 +2343,11 @@ const We = p(function({
|
|
|
2169
2343
|
role: "application",
|
|
2170
2344
|
"aria-label": "RCS Message Emulator",
|
|
2171
2345
|
"data-theme": a,
|
|
2172
|
-
"data-device":
|
|
2346
|
+
"data-device": c,
|
|
2173
2347
|
children: S
|
|
2174
2348
|
}
|
|
2175
2349
|
);
|
|
2176
|
-
return t &&
|
|
2350
|
+
return t && w ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6", children: [
|
|
2177
2351
|
/* @__PURE__ */ e(
|
|
2178
2352
|
"div",
|
|
2179
2353
|
{
|
|
@@ -2228,11 +2402,11 @@ const We = p(function({
|
|
|
2228
2402
|
children: t
|
|
2229
2403
|
}
|
|
2230
2404
|
)
|
|
2231
|
-
] }) }) : d ? x ? /* @__PURE__ */ e(M, { children:
|
|
2405
|
+
] }) }) : d ? x ? /* @__PURE__ */ e(M, { children: v ? /* @__PURE__ */ e(
|
|
2232
2406
|
Z,
|
|
2233
2407
|
{
|
|
2234
2408
|
theme: a,
|
|
2235
|
-
device:
|
|
2409
|
+
device: c,
|
|
2236
2410
|
businessInfo: L,
|
|
2237
2411
|
state: {
|
|
2238
2412
|
currentMessageId: null,
|
|
@@ -2253,7 +2427,7 @@ const We = p(function({
|
|
|
2253
2427
|
},
|
|
2254
2428
|
closeWebView: () => {
|
|
2255
2429
|
},
|
|
2256
|
-
children: /* @__PURE__ */ e(Oe, { onUnlock: N, messagePreview:
|
|
2430
|
+
children: /* @__PURE__ */ e(Oe, { onUnlock: N, messagePreview: z })
|
|
2257
2431
|
}
|
|
2258
2432
|
) : /* @__PURE__ */ e(
|
|
2259
2433
|
Pe,
|
|
@@ -2261,7 +2435,7 @@ const We = p(function({
|
|
|
2261
2435
|
flow: d,
|
|
2262
2436
|
onUserReply: o,
|
|
2263
2437
|
theme: a,
|
|
2264
|
-
device:
|
|
2438
|
+
device: c,
|
|
2265
2439
|
businessInfo: L,
|
|
2266
2440
|
showSuggestions: h
|
|
2267
2441
|
}
|
|
@@ -2350,7 +2524,7 @@ export {
|
|
|
2350
2524
|
Je as default,
|
|
2351
2525
|
de as getFirstMessagePreview,
|
|
2352
2526
|
oe as getWebViewConfig,
|
|
2353
|
-
|
|
2527
|
+
I as isSuggestedAction,
|
|
2354
2528
|
Y as isSuggestedReply,
|
|
2355
2529
|
qe as isWebViewAction,
|
|
2356
2530
|
pe as useJsonFetch,
|