@paymanai/payman-ask-sdk 1.2.8 → 1.2.10
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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.js +285 -124
- package/dist/index.native.js.map +1 -1
- package/package.json +9 -8
package/dist/index.native.js
CHANGED
|
@@ -576,6 +576,16 @@ function ThinkingBlock({ text }) {
|
|
|
576
576
|
isOpen && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: ts.thinkingContent, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: ts.thinkingContentText, children: text }) })
|
|
577
577
|
] });
|
|
578
578
|
}
|
|
579
|
+
var WORKFLOW_FAILED = "WORKFLOW_FAILED";
|
|
580
|
+
var STREAM_NOT_STARTED = "STREAM_NOT_STARTED";
|
|
581
|
+
function isFriendlyError(errorDetails) {
|
|
582
|
+
if (!errorDetails) return false;
|
|
583
|
+
return errorDetails === WORKFLOW_FAILED || errorDetails === STREAM_NOT_STARTED || errorDetails.includes(WORKFLOW_FAILED);
|
|
584
|
+
}
|
|
585
|
+
function looksLikeRawError(text) {
|
|
586
|
+
if (!text || text.length < 10) return false;
|
|
587
|
+
return text.includes("errorType=") || /failed:\s*\{/.test(text);
|
|
588
|
+
}
|
|
579
589
|
function AgentMessage({
|
|
580
590
|
message,
|
|
581
591
|
animated = false,
|
|
@@ -593,7 +603,6 @@ function AgentMessage({
|
|
|
593
603
|
const isStreaming = message.isStreaming ?? false;
|
|
594
604
|
const hasSteps = !!message.steps && message.steps.length > 0;
|
|
595
605
|
const hasTraceData = !!(message.tracingData || message.executionId) && !isStreaming;
|
|
596
|
-
const isError = message.isError ?? (message.streamProgress === "error" || !!message.errorDetails);
|
|
597
606
|
const isCancelled = message.isCancelled ?? false;
|
|
598
607
|
const currentExecutingStepId = message.currentExecutingStepId;
|
|
599
608
|
const [isStepsExpanded, setIsStepsExpanded] = React.useState(
|
|
@@ -609,6 +618,9 @@ function AgentMessage({
|
|
|
609
618
|
const currentMessage = message.currentMessage;
|
|
610
619
|
const rawContent = message.streamingContent || message.content || "";
|
|
611
620
|
const content = rawContent.replace(/\\n/g, "\n");
|
|
621
|
+
const hasMeaningfulContent = content.length > 0 && !looksLikeRawError(content);
|
|
622
|
+
const completedWithNoContent = !isStreaming && !isCancelled && content.length === 0 && (message.streamProgress === "completed" || message.streamProgress === "error");
|
|
623
|
+
const isError = (isFriendlyError(message.errorDetails) || looksLikeRawError(content)) && !hasMeaningfulContent || completedWithNoContent;
|
|
612
624
|
const activeThinkingText = message.activeThinkingText;
|
|
613
625
|
const allThinkingText = message.allThinkingText;
|
|
614
626
|
const currentStep = React.useMemo(
|
|
@@ -816,8 +828,9 @@ var s2 = reactNative.StyleSheet.create({
|
|
|
816
828
|
alignItems: "center"
|
|
817
829
|
},
|
|
818
830
|
// Bubble column
|
|
819
|
-
|
|
820
|
-
|
|
831
|
+
// Bubble column — flex: 1 so it fills available width on mobile (still capped by maxWidth)
|
|
832
|
+
bubbleCol: { flex: 1, minWidth: 0, maxWidth: "92%", flexShrink: 1 },
|
|
833
|
+
bubbleColCentered: { maxWidth: "95%" },
|
|
821
834
|
// Badge
|
|
822
835
|
badgeWrap: { marginBottom: 6 },
|
|
823
836
|
badge: {
|
|
@@ -1409,21 +1422,27 @@ function OtpInput({ value, onChange, maxLength, disabled = false }) {
|
|
|
1409
1422
|
i
|
|
1410
1423
|
)) });
|
|
1411
1424
|
}
|
|
1425
|
+
var PAYMAN_OTP = {
|
|
1426
|
+
bg: "#FFFFFF",
|
|
1427
|
+
border: "rgba(0,0,0,0.1)",
|
|
1428
|
+
fg: "#18181b",
|
|
1429
|
+
disabledBg: "rgba(0,0,0,0.03)"
|
|
1430
|
+
};
|
|
1412
1431
|
var s6 = reactNative.StyleSheet.create({
|
|
1413
|
-
container: { flexDirection: "row", gap:
|
|
1432
|
+
container: { flexDirection: "row", gap: 6, justifyContent: "center" },
|
|
1414
1433
|
input: {
|
|
1415
|
-
width:
|
|
1416
|
-
height:
|
|
1434
|
+
width: 40,
|
|
1435
|
+
height: 44,
|
|
1417
1436
|
textAlign: "center",
|
|
1418
|
-
fontSize:
|
|
1437
|
+
fontSize: 18,
|
|
1419
1438
|
fontWeight: "600",
|
|
1420
1439
|
borderWidth: 1,
|
|
1421
|
-
borderColor:
|
|
1440
|
+
borderColor: PAYMAN_OTP.border,
|
|
1422
1441
|
borderRadius: 10,
|
|
1423
|
-
color:
|
|
1424
|
-
backgroundColor:
|
|
1442
|
+
color: PAYMAN_OTP.fg,
|
|
1443
|
+
backgroundColor: PAYMAN_OTP.bg
|
|
1425
1444
|
},
|
|
1426
|
-
inputDisabled: { backgroundColor:
|
|
1445
|
+
inputDisabled: { backgroundColor: PAYMAN_OTP.disabledBg, opacity: 0.5 }
|
|
1427
1446
|
});
|
|
1428
1447
|
|
|
1429
1448
|
// src/components/UserActionModal/constants.ts
|
|
@@ -1459,6 +1478,32 @@ function getOtpSchemaFromRequest(schema) {
|
|
|
1459
1478
|
maxLength: clampedMaxLength
|
|
1460
1479
|
};
|
|
1461
1480
|
}
|
|
1481
|
+
var PAYMAN = {
|
|
1482
|
+
// Keep primary aligned with native user bubble color in UserMessage.
|
|
1483
|
+
primary: "#00858d",
|
|
1484
|
+
foreground: "#18181b",
|
|
1485
|
+
mutedForeground: "#71717a",
|
|
1486
|
+
border: "#e4e4e7",
|
|
1487
|
+
card: "#ffffff",
|
|
1488
|
+
modalBackdrop: "rgba(0,0,0,0.4)",
|
|
1489
|
+
modalIconBg: "rgba(0,133,141,0.12)",
|
|
1490
|
+
modalIconBorder: "rgba(0,133,141,0.28)",
|
|
1491
|
+
// payman-modal-btn-reject: visible light red bg + red text
|
|
1492
|
+
rejectBtnBg: "#fef2f2",
|
|
1493
|
+
rejectBtnFg: "#dc2626",
|
|
1494
|
+
rejectBtnBorder: "#fecaca",
|
|
1495
|
+
// payman-modal-btn-approve: solid dark bg + white text
|
|
1496
|
+
approveBtnBg: "#00858d",
|
|
1497
|
+
approveBtnFg: "#ffffff",
|
|
1498
|
+
// payman-modal-btn-resend: bordered with primary tint
|
|
1499
|
+
resendBtnBg: "#f0f9f9",
|
|
1500
|
+
resendBorder: "rgba(0,133,141,0.35)",
|
|
1501
|
+
resendFg: "#00858d"
|
|
1502
|
+
};
|
|
1503
|
+
var { width: SCREEN_WIDTH } = reactNative.Dimensions.get("window");
|
|
1504
|
+
var DIALOG_MAX_WIDTH = Math.min(400, SCREEN_WIDTH * 0.9);
|
|
1505
|
+
var DIALOG_PADDING = 20;
|
|
1506
|
+
var BUTTON_MIN_HEIGHT = 44;
|
|
1462
1507
|
function UserActionModal({
|
|
1463
1508
|
isOpen,
|
|
1464
1509
|
userActionRequest,
|
|
@@ -1471,7 +1516,22 @@ function UserActionModal({
|
|
|
1471
1516
|
const [actionType, setActionType] = React.useState(null);
|
|
1472
1517
|
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
1473
1518
|
const [resendCooldownRemaining, setResendCooldownRemaining] = React.useState(0);
|
|
1519
|
+
const [keyboardVisible, setKeyboardVisible] = React.useState(false);
|
|
1474
1520
|
const schema = getOtpSchemaFromRequest(userActionRequest?.requestedSchema);
|
|
1521
|
+
React.useEffect(() => {
|
|
1522
|
+
const show = reactNative.Keyboard.addListener(
|
|
1523
|
+
reactNative.Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow",
|
|
1524
|
+
() => setKeyboardVisible(true)
|
|
1525
|
+
);
|
|
1526
|
+
const hide = reactNative.Keyboard.addListener(
|
|
1527
|
+
reactNative.Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide",
|
|
1528
|
+
() => setKeyboardVisible(false)
|
|
1529
|
+
);
|
|
1530
|
+
return () => {
|
|
1531
|
+
show.remove();
|
|
1532
|
+
hide.remove();
|
|
1533
|
+
};
|
|
1534
|
+
}, []);
|
|
1475
1535
|
const resetActionState = React.useCallback(() => {
|
|
1476
1536
|
setIsSubmitting(false);
|
|
1477
1537
|
setActionType(null);
|
|
@@ -1548,6 +1608,7 @@ function UserActionModal({
|
|
|
1548
1608
|
return `${MODAL_CONTENT.RESEND_AVAILABLE_IN} ${resendCooldownRemaining}s`;
|
|
1549
1609
|
return BUTTON_LABELS.RESEND;
|
|
1550
1610
|
};
|
|
1611
|
+
const modalPosition = keyboardVisible ? "flex-end" : "center";
|
|
1551
1612
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1552
1613
|
reactNative.Modal,
|
|
1553
1614
|
{
|
|
@@ -1556,154 +1617,254 @@ function UserActionModal({
|
|
|
1556
1617
|
animationType: "fade",
|
|
1557
1618
|
onRequestClose: () => {
|
|
1558
1619
|
},
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
disabled: isSubmitting
|
|
1569
|
-
}
|
|
1570
|
-
) }),
|
|
1571
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s7.buttonsCol, children: [
|
|
1572
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s7.primaryRow, children: [
|
|
1573
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1574
|
-
reactNative.Pressable,
|
|
1575
|
-
{
|
|
1576
|
-
onPress: handleReject,
|
|
1577
|
-
disabled: isSubmitting,
|
|
1578
|
-
style: ({ pressed }) => [
|
|
1579
|
-
s7.rejectBtn,
|
|
1580
|
-
isSubmitting && s7.btnDisabled,
|
|
1581
|
-
pressed && { opacity: 0.7 }
|
|
1582
|
-
],
|
|
1583
|
-
children: [
|
|
1584
|
-
actionType === "reject" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1585
|
-
reactNative.ActivityIndicator,
|
|
1586
|
-
{
|
|
1587
|
-
size: "small",
|
|
1588
|
-
color: "#DC2626",
|
|
1589
|
-
style: s7.spinner
|
|
1590
|
-
}
|
|
1591
|
-
),
|
|
1592
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s7.rejectBtnText, children: actionType === "reject" ? MODAL_CONTENT.LOADING_REJECT : BUTTON_LABELS.REJECT })
|
|
1593
|
-
]
|
|
1594
|
-
}
|
|
1595
|
-
),
|
|
1596
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1597
|
-
reactNative.Pressable,
|
|
1598
|
-
{
|
|
1599
|
-
onPress: handleApprove,
|
|
1600
|
-
disabled: !isOtpValid || isSubmitting,
|
|
1601
|
-
style: ({ pressed }) => [
|
|
1602
|
-
s7.approveBtn,
|
|
1603
|
-
(!isOtpValid || isSubmitting) && s7.btnDisabled,
|
|
1604
|
-
pressed && { opacity: 0.85 }
|
|
1605
|
-
],
|
|
1606
|
-
children: [
|
|
1607
|
-
actionType === "approve" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1608
|
-
reactNative.ActivityIndicator,
|
|
1609
|
-
{
|
|
1610
|
-
size: "small",
|
|
1611
|
-
color: "#FFF",
|
|
1612
|
-
style: s7.spinner
|
|
1613
|
-
}
|
|
1614
|
-
),
|
|
1615
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s7.approveBtnText, children: actionType === "approve" ? MODAL_CONTENT.LOADING_APPROVE : BUTTON_LABELS.APPROVE })
|
|
1616
|
-
]
|
|
1617
|
-
}
|
|
1618
|
-
)
|
|
1619
|
-
] }),
|
|
1620
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1621
|
-
reactNative.Pressable,
|
|
1620
|
+
statusBarTranslucent: reactNative.Platform.OS === "android",
|
|
1621
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1622
|
+
reactNative.KeyboardAvoidingView,
|
|
1623
|
+
{
|
|
1624
|
+
style: [s7.keyboardAvoid, { justifyContent: modalPosition }],
|
|
1625
|
+
behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
|
|
1626
|
+
keyboardVerticalOffset: reactNative.Platform.OS === "ios" ? 0 : 20,
|
|
1627
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [s7.modalOverlay, { justifyContent: modalPosition }], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1628
|
+
reactNative.ScrollView,
|
|
1622
1629
|
{
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
s7.resendBtn,
|
|
1627
|
-
(isSubmitting || resendCooldownRemaining > 0) && s7.btnDisabled,
|
|
1628
|
-
pressed && { opacity: 0.7 }
|
|
1630
|
+
contentContainerStyle: [
|
|
1631
|
+
s7.scrollContent,
|
|
1632
|
+
{ justifyContent: modalPosition }
|
|
1629
1633
|
],
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1634
|
+
showsVerticalScrollIndicator: false,
|
|
1635
|
+
keyboardShouldPersistTaps: "handled",
|
|
1636
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [s7.dialog, { width: DIALOG_MAX_WIDTH }], children: [
|
|
1637
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s7.titleWrap, children: [
|
|
1638
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s7.iconWrap, accessibilityLabel: "payman-modal-icon-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1639
|
+
lucideReactNative.ShieldCheck,
|
|
1640
|
+
{
|
|
1641
|
+
size: 22,
|
|
1642
|
+
color: PAYMAN.primary,
|
|
1643
|
+
strokeWidth: 2
|
|
1644
|
+
}
|
|
1645
|
+
) }),
|
|
1646
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s7.title, accessibilityLabel: "payman-modal-title", children: MODAL_CONTENT.TITLE })
|
|
1647
|
+
] }),
|
|
1648
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s7.description, accessibilityLabel: "payman-modal-desc", children: userActionRequest.message }),
|
|
1649
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s7.otpWrap, accessibilityLabel: "payman-otp-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1650
|
+
OtpInput,
|
|
1633
1651
|
{
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1652
|
+
value: otp,
|
|
1653
|
+
onChange: setOtp,
|
|
1654
|
+
maxLength: schema.maxLength,
|
|
1655
|
+
disabled: isSubmitting
|
|
1637
1656
|
}
|
|
1638
|
-
),
|
|
1639
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1640
|
-
|
|
1657
|
+
) }),
|
|
1658
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s7.buttonsCol, children: [
|
|
1659
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s7.primaryRow, children: [
|
|
1660
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1661
|
+
reactNative.Pressable,
|
|
1662
|
+
{
|
|
1663
|
+
onPress: handleReject,
|
|
1664
|
+
disabled: isSubmitting,
|
|
1665
|
+
accessibilityLabel: "payman-modal-btn-reject",
|
|
1666
|
+
testID: "payman-modal-btn-reject",
|
|
1667
|
+
style: [
|
|
1668
|
+
s7.rejectBtn,
|
|
1669
|
+
isSubmitting && s7.btnDisabled
|
|
1670
|
+
],
|
|
1671
|
+
children: [
|
|
1672
|
+
actionType === "reject" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1673
|
+
reactNative.ActivityIndicator,
|
|
1674
|
+
{
|
|
1675
|
+
size: "small",
|
|
1676
|
+
color: PAYMAN.rejectBtnFg,
|
|
1677
|
+
style: s7.spinner
|
|
1678
|
+
}
|
|
1679
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.X, { size: 16, color: PAYMAN.rejectBtnFg, strokeWidth: 2.5, style: s7.btnIcon }),
|
|
1680
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s7.rejectBtnText, children: actionType === "reject" ? MODAL_CONTENT.LOADING_REJECT : BUTTON_LABELS.REJECT })
|
|
1681
|
+
]
|
|
1682
|
+
}
|
|
1683
|
+
),
|
|
1684
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1685
|
+
reactNative.Pressable,
|
|
1686
|
+
{
|
|
1687
|
+
onPress: handleApprove,
|
|
1688
|
+
disabled: !isOtpValid || isSubmitting,
|
|
1689
|
+
accessibilityLabel: "payman-modal-btn-approve",
|
|
1690
|
+
testID: "payman-modal-btn-approve",
|
|
1691
|
+
style: [
|
|
1692
|
+
s7.approveBtn,
|
|
1693
|
+
(!isOtpValid || isSubmitting) && s7.btnDisabled
|
|
1694
|
+
],
|
|
1695
|
+
children: [
|
|
1696
|
+
actionType === "approve" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1697
|
+
reactNative.ActivityIndicator,
|
|
1698
|
+
{
|
|
1699
|
+
size: "small",
|
|
1700
|
+
color: PAYMAN.approveBtnFg,
|
|
1701
|
+
style: s7.spinner
|
|
1702
|
+
}
|
|
1703
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.Check, { size: 16, color: PAYMAN.approveBtnFg, strokeWidth: 2.5, style: s7.btnIcon }),
|
|
1704
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s7.approveBtnText, children: actionType === "approve" ? MODAL_CONTENT.LOADING_APPROVE : BUTTON_LABELS.APPROVE })
|
|
1705
|
+
]
|
|
1706
|
+
}
|
|
1707
|
+
)
|
|
1708
|
+
] }),
|
|
1709
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1710
|
+
reactNative.Pressable,
|
|
1711
|
+
{
|
|
1712
|
+
onPress: handleResend,
|
|
1713
|
+
disabled: isSubmitting || resendCooldownRemaining > 0,
|
|
1714
|
+
accessibilityLabel: "payman-modal-btn-resend",
|
|
1715
|
+
testID: "payman-modal-btn-resend",
|
|
1716
|
+
style: [
|
|
1717
|
+
s7.resendBtn,
|
|
1718
|
+
(isSubmitting || resendCooldownRemaining > 0) && s7.btnDisabled
|
|
1719
|
+
],
|
|
1720
|
+
children: [
|
|
1721
|
+
actionType === "resend" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1722
|
+
reactNative.ActivityIndicator,
|
|
1723
|
+
{
|
|
1724
|
+
size: "small",
|
|
1725
|
+
color: PAYMAN.resendFg,
|
|
1726
|
+
style: s7.spinner
|
|
1727
|
+
}
|
|
1728
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.RefreshCw, { size: 16, color: PAYMAN.resendFg, strokeWidth: 2.5, style: s7.btnIcon }),
|
|
1729
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s7.resendBtnText, children: getResendLabel() })
|
|
1730
|
+
]
|
|
1731
|
+
}
|
|
1732
|
+
)
|
|
1733
|
+
] })
|
|
1734
|
+
] })
|
|
1641
1735
|
}
|
|
1642
|
-
)
|
|
1643
|
-
|
|
1644
|
-
|
|
1736
|
+
) })
|
|
1737
|
+
}
|
|
1738
|
+
)
|
|
1645
1739
|
}
|
|
1646
1740
|
);
|
|
1647
1741
|
}
|
|
1648
1742
|
var s7 = reactNative.StyleSheet.create({
|
|
1649
|
-
|
|
1743
|
+
keyboardAvoid: {
|
|
1650
1744
|
flex: 1,
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1745
|
+
width: "100%"
|
|
1746
|
+
},
|
|
1747
|
+
modalOverlay: {
|
|
1748
|
+
flex: 1,
|
|
1749
|
+
width: "100%",
|
|
1750
|
+
backgroundColor: PAYMAN.modalBackdrop,
|
|
1751
|
+
alignItems: "center",
|
|
1752
|
+
paddingHorizontal: 16,
|
|
1753
|
+
paddingBottom: 24
|
|
1754
|
+
},
|
|
1755
|
+
scrollContent: {
|
|
1756
|
+
flexGrow: 1,
|
|
1757
|
+
width: "100%",
|
|
1758
|
+
alignItems: "center",
|
|
1759
|
+
paddingBottom: 8
|
|
1654
1760
|
},
|
|
1655
1761
|
dialog: {
|
|
1656
|
-
backgroundColor:
|
|
1762
|
+
backgroundColor: PAYMAN.card,
|
|
1657
1763
|
borderRadius: 20,
|
|
1658
|
-
padding:
|
|
1659
|
-
|
|
1660
|
-
|
|
1764
|
+
padding: DIALOG_PADDING,
|
|
1765
|
+
borderWidth: 1,
|
|
1766
|
+
borderColor: PAYMAN.border
|
|
1767
|
+
},
|
|
1768
|
+
titleWrap: {
|
|
1769
|
+
alignItems: "center",
|
|
1770
|
+
marginBottom: 12
|
|
1771
|
+
},
|
|
1772
|
+
iconWrap: {
|
|
1773
|
+
width: 44,
|
|
1774
|
+
height: 44,
|
|
1775
|
+
borderRadius: 14,
|
|
1776
|
+
backgroundColor: PAYMAN.modalIconBg,
|
|
1777
|
+
borderWidth: 1,
|
|
1778
|
+
borderColor: PAYMAN.modalIconBorder,
|
|
1779
|
+
alignItems: "center",
|
|
1780
|
+
justifyContent: "center",
|
|
1781
|
+
marginBottom: 10
|
|
1782
|
+
},
|
|
1783
|
+
title: {
|
|
1784
|
+
fontSize: 17,
|
|
1785
|
+
fontWeight: "600",
|
|
1786
|
+
color: PAYMAN.foreground
|
|
1661
1787
|
},
|
|
1662
|
-
titleWrap: { alignItems: "center", marginBottom: 14 },
|
|
1663
|
-
title: { fontSize: 16, fontWeight: "600", color: "#1F2937" },
|
|
1664
1788
|
description: {
|
|
1665
1789
|
fontSize: 14,
|
|
1666
|
-
lineHeight:
|
|
1667
|
-
color:
|
|
1790
|
+
lineHeight: 20,
|
|
1791
|
+
color: PAYMAN.mutedForeground,
|
|
1668
1792
|
textAlign: "center",
|
|
1669
|
-
marginBottom:
|
|
1793
|
+
marginBottom: 16
|
|
1794
|
+
},
|
|
1795
|
+
otpWrap: {
|
|
1796
|
+
marginBottom: 16
|
|
1797
|
+
},
|
|
1798
|
+
buttonsCol: {
|
|
1799
|
+
gap: 10
|
|
1800
|
+
},
|
|
1801
|
+
primaryRow: {
|
|
1802
|
+
flexDirection: "row",
|
|
1803
|
+
gap: 8
|
|
1670
1804
|
},
|
|
1671
|
-
otpWrap: { marginBottom: 24 },
|
|
1672
|
-
buttonsCol: { gap: 10 },
|
|
1673
|
-
primaryRow: { flexDirection: "row", gap: 8 },
|
|
1674
1805
|
rejectBtn: {
|
|
1675
1806
|
flex: 1,
|
|
1807
|
+
minHeight: BUTTON_MIN_HEIGHT,
|
|
1676
1808
|
borderRadius: 12,
|
|
1677
|
-
paddingVertical:
|
|
1678
|
-
paddingHorizontal:
|
|
1679
|
-
backgroundColor:
|
|
1809
|
+
paddingVertical: 14,
|
|
1810
|
+
paddingHorizontal: 18,
|
|
1811
|
+
backgroundColor: PAYMAN.rejectBtnBg,
|
|
1812
|
+
borderWidth: 1.5,
|
|
1813
|
+
borderColor: PAYMAN.rejectBtnBorder,
|
|
1680
1814
|
flexDirection: "row",
|
|
1681
1815
|
alignItems: "center",
|
|
1682
1816
|
justifyContent: "center"
|
|
1683
1817
|
},
|
|
1684
|
-
rejectBtnText: {
|
|
1818
|
+
rejectBtnText: {
|
|
1819
|
+
color: PAYMAN.rejectBtnFg,
|
|
1820
|
+
fontSize: 15,
|
|
1821
|
+
fontWeight: "600"
|
|
1822
|
+
},
|
|
1685
1823
|
approveBtn: {
|
|
1686
1824
|
flex: 1,
|
|
1825
|
+
minHeight: BUTTON_MIN_HEIGHT,
|
|
1687
1826
|
borderRadius: 12,
|
|
1688
|
-
paddingVertical:
|
|
1689
|
-
paddingHorizontal:
|
|
1690
|
-
backgroundColor:
|
|
1827
|
+
paddingVertical: 14,
|
|
1828
|
+
paddingHorizontal: 18,
|
|
1829
|
+
backgroundColor: PAYMAN.approveBtnBg,
|
|
1830
|
+
borderWidth: 1.5,
|
|
1831
|
+
borderColor: PAYMAN.approveBtnBg,
|
|
1691
1832
|
flexDirection: "row",
|
|
1692
1833
|
alignItems: "center",
|
|
1693
1834
|
justifyContent: "center"
|
|
1694
1835
|
},
|
|
1695
|
-
approveBtnText: {
|
|
1836
|
+
approveBtnText: {
|
|
1837
|
+
color: PAYMAN.approveBtnFg,
|
|
1838
|
+
fontSize: 15,
|
|
1839
|
+
fontWeight: "600"
|
|
1840
|
+
},
|
|
1696
1841
|
resendBtn: {
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1842
|
+
minHeight: BUTTON_MIN_HEIGHT,
|
|
1843
|
+
borderRadius: 12,
|
|
1844
|
+
paddingVertical: 14,
|
|
1845
|
+
paddingHorizontal: 18,
|
|
1846
|
+
borderWidth: 1.5,
|
|
1847
|
+
borderColor: PAYMAN.resendBorder,
|
|
1848
|
+
backgroundColor: PAYMAN.resendBtnBg,
|
|
1700
1849
|
flexDirection: "row",
|
|
1701
1850
|
alignItems: "center",
|
|
1702
1851
|
justifyContent: "center"
|
|
1703
1852
|
},
|
|
1704
|
-
resendBtnText: {
|
|
1705
|
-
|
|
1706
|
-
|
|
1853
|
+
resendBtnText: {
|
|
1854
|
+
color: PAYMAN.resendFg,
|
|
1855
|
+
fontSize: 15,
|
|
1856
|
+
lineHeight: 22,
|
|
1857
|
+
fontWeight: "500"
|
|
1858
|
+
},
|
|
1859
|
+
btnDisabled: {
|
|
1860
|
+
opacity: 0.4
|
|
1861
|
+
},
|
|
1862
|
+
spinner: {
|
|
1863
|
+
marginRight: 8
|
|
1864
|
+
},
|
|
1865
|
+
btnIcon: {
|
|
1866
|
+
marginRight: 8
|
|
1867
|
+
}
|
|
1707
1868
|
});
|
|
1708
1869
|
var DEFAULT_USER_ACTION_STATE = {
|
|
1709
1870
|
request: null,
|
|
@@ -1738,7 +1899,7 @@ function PaymanChat({
|
|
|
1738
1899
|
const approveUserAction = chat.approveUserAction ?? NOOP_ASYNC;
|
|
1739
1900
|
const rejectUserAction = chat.rejectUserAction ?? NOOP_ASYNC;
|
|
1740
1901
|
const resendOtp = chat.resendOtp ?? NOOP_ASYNC;
|
|
1741
|
-
|
|
1902
|
+
typeof chat.approveUserAction === "function" && typeof chat.rejectUserAction === "function" && typeof chat.resendOtp === "function";
|
|
1742
1903
|
const {
|
|
1743
1904
|
voiceState,
|
|
1744
1905
|
transcribedText,
|
|
@@ -1937,7 +2098,7 @@ function PaymanChat({
|
|
|
1937
2098
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1938
2099
|
UserActionModal,
|
|
1939
2100
|
{
|
|
1940
|
-
isOpen:
|
|
2101
|
+
isOpen: true,
|
|
1941
2102
|
userActionRequest: userActionState.request,
|
|
1942
2103
|
onApprove: approveUserAction,
|
|
1943
2104
|
onReject: rejectUserAction,
|