@retinalabsllc/zairusjs 5.1.8 → 5.1.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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +79 -42
- package/dist/index.mjs +79 -42
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1035,7 +1035,7 @@ interface UniversalTransactionPageProps {
|
|
|
1035
1035
|
activeTypeFilter: string;
|
|
1036
1036
|
onTypeFilterChange: (type: string) => void;
|
|
1037
1037
|
onReportTransaction?: (tx: UniversalTransaction) => void;
|
|
1038
|
-
onGenerateReceipt?: (tx: UniversalTransaction) => void
|
|
1038
|
+
onGenerateReceipt?: (tx: UniversalTransaction) => void | Promise<void>;
|
|
1039
1039
|
}
|
|
1040
1040
|
declare const UniversalTransactionPage: React.FC<UniversalTransactionPageProps>;
|
|
1041
1041
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1035,7 +1035,7 @@ interface UniversalTransactionPageProps {
|
|
|
1035
1035
|
activeTypeFilter: string;
|
|
1036
1036
|
onTypeFilterChange: (type: string) => void;
|
|
1037
1037
|
onReportTransaction?: (tx: UniversalTransaction) => void;
|
|
1038
|
-
onGenerateReceipt?: (tx: UniversalTransaction) => void
|
|
1038
|
+
onGenerateReceipt?: (tx: UniversalTransaction) => void | Promise<void>;
|
|
1039
1039
|
}
|
|
1040
1040
|
declare const UniversalTransactionPage: React.FC<UniversalTransactionPageProps>;
|
|
1041
1041
|
|
package/dist/index.js
CHANGED
|
@@ -784,7 +784,7 @@ function AuthFormInner2({
|
|
|
784
784
|
className: "mt-0.5 w-4 h-4 bg-white border-neutral-300 rounded text-black focus:ring-black cursor-pointer",
|
|
785
785
|
required: true
|
|
786
786
|
}
|
|
787
|
-
), /* @__PURE__ */ import_react6.default.createElement("label", { htmlFor: "zairus-terms", className: "text-[11px] text-neutral-500 cursor-pointer leading-snug" }, "I agree to ", companyName, "'s ", /* @__PURE__ */ import_react6.default.createElement("a", { href: termsUrl, target: "_blank", rel: "noreferrer", className: "text-[#1f26d6]
|
|
787
|
+
), /* @__PURE__ */ import_react6.default.createElement("label", { htmlFor: "zairus-terms", className: "text-[11px] text-neutral-500 cursor-pointer leading-snug" }, "I agree to ", companyName, "'s ", /* @__PURE__ */ import_react6.default.createElement("a", { href: termsUrl, target: "_blank", rel: "noreferrer", className: "text-[#1f26d6] " }, "Terms of Service"), " and ", /* @__PURE__ */ import_react6.default.createElement("a", { href: privacyUrl, target: "_blank", rel: "noreferrer", className: "text-[#1f26d6] " }, "Privacy Policy"), "."))), /* @__PURE__ */ import_react6.default.createElement(
|
|
788
788
|
ThreeDActionButton,
|
|
789
789
|
{
|
|
790
790
|
type: "submit",
|
|
@@ -2444,7 +2444,7 @@ var UniversalOrganizationPage = ({
|
|
|
2444
2444
|
};
|
|
2445
2445
|
const hasChanges = web3Name !== initialOrgName || slug !== initialSlug || username !== initialSlug;
|
|
2446
2446
|
const isSaveDisabled = isSubmitting || isReadOnly || isCheckingSlug || !hasChanges || web3Name.length < 3 || slug.length < 3 || username.length < 3 || slug !== initialSlug && slugAvailable === false;
|
|
2447
|
-
return /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex flex-col gap-8 animate-in max-w-5xl rounded-2xl p-6 bg-white fade-in duration-300 " }, /* @__PURE__ */ import_react43.default.createElement(ManagedToaster, null), /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ import_react43.default.createElement("div", null, /* @__PURE__ */ import_react43.default.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, "
|
|
2447
|
+
return /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex flex-col gap-8 animate-in max-w-5xl rounded-2xl p-6 bg-white fade-in duration-300 " }, /* @__PURE__ */ import_react43.default.createElement(ManagedToaster, null), /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ import_react43.default.createElement("div", null, /* @__PURE__ */ import_react43.default.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, "Public Profile"), /* @__PURE__ */ import_react43.default.createElement("p", { className: "text-xs text-neutral-500" }, "Manage your financial payment handle identifiers and global public cryptographic signature identity details.")), isReadOnly && /* @__PURE__ */ import_react43.default.createElement("span", { className: "p-2 w-9 h-9 bg-neutral-50 text-neutral-500 rounded-full shrink-0" }, /* @__PURE__ */ import_react43.default.createElement(import_react44.HugeiconsIcon, { icon: import_core_free_icons11.CircleLock02Icon, size: 18, className: "text-current" }))), bannerProps && /* @__PURE__ */ import_react43.default.createElement(Banner, { ...bannerProps }), /* @__PURE__ */ import_react43.default.createElement("div", { className: "w-full max-w-5xl" }, /* @__PURE__ */ import_react43.default.createElement("form", { className: "flex flex-col gap-8", onSubmit: handleSave, autoComplete: "off" }, /* @__PURE__ */ import_react43.default.createElement(
|
|
2448
2448
|
TextInput,
|
|
2449
2449
|
{
|
|
2450
2450
|
label: "Display Name",
|
|
@@ -3918,6 +3918,7 @@ var UniversalTrashView = ({
|
|
|
3918
3918
|
// src/components/UniversalTransactionPage.tsx
|
|
3919
3919
|
var import_react72 = __toESM(require("react"));
|
|
3920
3920
|
var import_react73 = require("@hugeicons/react");
|
|
3921
|
+
var import_react_hot_toast10 = __toESM(require("react-hot-toast"));
|
|
3921
3922
|
var import_core_free_icons25 = require("@hugeicons/core-free-icons");
|
|
3922
3923
|
var PageSpinner6 = () => /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex justify-center items-center py-12" }, /* @__PURE__ */ import_react72.default.createElement(import_react73.HugeiconsIcon, { icon: import_core_free_icons25.Loading03Icon, size: 32, className: "animate-spin mb-4 text-black" }));
|
|
3923
3924
|
var formatDate3 = (dateInput) => {
|
|
@@ -3951,6 +3952,7 @@ var UniversalTransactionPage = ({
|
|
|
3951
3952
|
onGenerateReceipt
|
|
3952
3953
|
}) => {
|
|
3953
3954
|
const [selectedTransaction, setSelectedTransaction] = (0, import_react72.useState)(null);
|
|
3955
|
+
const [isGeneratingReceipt, setIsGeneratingReceipt] = (0, import_react72.useState)(false);
|
|
3954
3956
|
const [localSearchQuery, setLocalSearchQuery] = (0, import_react72.useState)(searchQuery);
|
|
3955
3957
|
const [isTyping, setIsTyping] = (0, import_react72.useState)(false);
|
|
3956
3958
|
const [isDirectionModalOpen, setIsDirectionModalOpen] = (0, import_react72.useState)(false);
|
|
@@ -3987,6 +3989,18 @@ var UniversalTransactionPage = ({
|
|
|
3987
3989
|
if (tx.metadata?.description) return tx.metadata.description;
|
|
3988
3990
|
return tx.type === "CARD_TRANSACTION" ? "Card Transaction" : "Wallet Transaction";
|
|
3989
3991
|
};
|
|
3992
|
+
const handleGenerateReceipt = async () => {
|
|
3993
|
+
if (!onGenerateReceipt || !selectedTransaction) return;
|
|
3994
|
+
setIsGeneratingReceipt(true);
|
|
3995
|
+
try {
|
|
3996
|
+
await onGenerateReceipt(selectedTransaction);
|
|
3997
|
+
import_react_hot_toast10.default.success("Receipt generated successfully.");
|
|
3998
|
+
} catch (error) {
|
|
3999
|
+
import_react_hot_toast10.default.error("Failed to generate receipt.");
|
|
4000
|
+
} finally {
|
|
4001
|
+
setIsGeneratingReceipt(false);
|
|
4002
|
+
}
|
|
4003
|
+
};
|
|
3990
4004
|
const isListLoading = isLoading || isTyping;
|
|
3991
4005
|
const primaryBaseShadow = `inset 0 1.5px 0 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 0 rgba(0, 0, 0, 0.5), 0 3px 0 0 #0c0c0c, 0 6px 10px rgba(0, 0, 0, 0.3)`;
|
|
3992
4006
|
const primaryHoverShadow = `inset 0 1.5px 0 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 0 rgba(0, 0, 0, 0.5), 0 4px 0 0 #0c0c0c, 0 8px 12px rgba(0, 0, 0, 0.35)`;
|
|
@@ -4041,37 +4055,59 @@ var UniversalTransactionPage = ({
|
|
|
4041
4055
|
className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black hover:border-black disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none"
|
|
4042
4056
|
},
|
|
4043
4057
|
/* @__PURE__ */ import_react72.default.createElement(import_react73.HugeiconsIcon, { icon: import_core_free_icons25.ArrowRight01Icon, size: 14 })
|
|
4044
|
-
)))))), selectedTransaction && /* @__PURE__ */ import_react72.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setSelectedTransaction(null) }), /* @__PURE__ */ import_react72.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 max-h-[90vh]" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ import_react72.default.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Details"), /* @__PURE__ */ import_react72.default.createElement("button", { onClick: () => setSelectedTransaction(null), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react72.default.createElement(import_react73.HugeiconsIcon, { icon: import_core_free_icons25.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex flex-col items-center justify-center mb-4" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: `w-12 h-12 rounded-full
|
|
4058
|
+
)))))), selectedTransaction && /* @__PURE__ */ import_react72.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setSelectedTransaction(null) }), /* @__PURE__ */ import_react72.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 max-h-[90vh]" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ import_react72.default.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Details"), /* @__PURE__ */ import_react72.default.createElement("button", { onClick: () => setSelectedTransaction(null), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react72.default.createElement(import_react73.HugeiconsIcon, { icon: import_core_free_icons25.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex flex-col items-center justify-center mb-4" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: `w-12 h-12 rounded-full flex items-center justify-center mb-4 ${selectedTransaction.direction === "CREDIT" ? "bg-neutral-100 text-neutral-6000" : "bg-neutral-100 text-neutral-600"}` }, /* @__PURE__ */ import_react72.default.createElement(import_react73.HugeiconsIcon, { icon: selectedTransaction.direction === "CREDIT" ? import_core_free_icons25.ArrowDownRight01Icon : import_core_free_icons25.ArrowUpRight01Icon, size: 20 })), /* @__PURE__ */ import_react72.default.createElement("h2", { className: `text-2xl text-black mb-2 transition-all duration-300 ${hideBalanceAmounts ? "blur-[6px] opacity-40 select-none" : ""}` }, selectedTransaction.direction === "CREDIT" ? "+" : "-", selectedTransaction.amount, " ", selectedTransaction.currency), /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[9px] tracking-widest text-neutral-500 px-4 py-1.5 rounded-full bg-neutral-50" }, selectedTransaction.status), selectedTransaction.type === "WALLET_TRANSACTION" && /* @__PURE__ */ import_react72.default.createElement(
|
|
4059
|
+
"a",
|
|
4060
|
+
{
|
|
4061
|
+
href: `https://basescan.org/tx/${selectedTransaction.reference}`,
|
|
4062
|
+
target: "_blank",
|
|
4063
|
+
rel: "noopener noreferrer",
|
|
4064
|
+
className: "text-[11px] text-[#1f26d6] mt-4 transition-colors tracking-wide"
|
|
4065
|
+
},
|
|
4066
|
+
"View in block explorer"
|
|
4067
|
+
)), /* @__PURE__ */ import_react72.default.createElement("div", { className: "grid grid-cols-1 gap-y-8 gap-x-4 mb-10 mt-6" }, /* @__PURE__ */ import_react72.default.createElement("div", null, /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Reference ID"), /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[13px] text-black break-all" }, selectedTransaction.reference)), /* @__PURE__ */ import_react72.default.createElement("div", null, /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Date & Time"), /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[13px] text-black" }, formatDate3(selectedTransaction.createdAt), " at ", formatTime(selectedTransaction.createdAt))), /* @__PURE__ */ import_react72.default.createElement("div", null, /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Transaction Type"), /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[13px] text-black capitalize" }, selectedTransaction.type.replace("_", " ").toLowerCase())), /* @__PURE__ */ import_react72.default.createElement("div", null, /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Flow Direction"), /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[13px] text-black capitalize" }, selectedTransaction.direction.toLowerCase())), selectedTransaction.metadata && Object.entries(selectedTransaction.metadata).map(([key, value]) => {
|
|
4068
|
+
if (value === null || value === void 0 || typeof value === "object") return null;
|
|
4069
|
+
const formattedKey = key.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
|
|
4070
|
+
return /* @__PURE__ */ import_react72.default.createElement("div", { key }, /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, formattedKey), /* @__PURE__ */ import_react72.default.createElement("span", { className: "text-[13px] text-black break-all" }, String(value)));
|
|
4071
|
+
})), /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ import_react72.default.createElement(
|
|
4045
4072
|
"button",
|
|
4046
4073
|
{
|
|
4047
|
-
onClick:
|
|
4048
|
-
|
|
4049
|
-
|
|
4074
|
+
onClick: handleGenerateReceipt,
|
|
4075
|
+
disabled: isGeneratingReceipt,
|
|
4076
|
+
className: "relative w-full flex items-center justify-center py-2 rounded-full bg-neutral-950 text-white transition-all duration-150 select-none outline-none disabled:opacity-70 disabled:cursor-not-allowed",
|
|
4077
|
+
style: !isGeneratingReceipt ? { boxShadow: primaryBaseShadow } : {},
|
|
4050
4078
|
onMouseEnter: (e) => {
|
|
4051
|
-
|
|
4052
|
-
|
|
4079
|
+
if (!isGeneratingReceipt) {
|
|
4080
|
+
e.currentTarget.style.boxShadow = primaryHoverShadow;
|
|
4081
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
4082
|
+
}
|
|
4053
4083
|
},
|
|
4054
4084
|
onMouseLeave: (e) => {
|
|
4055
|
-
|
|
4056
|
-
|
|
4085
|
+
if (!isGeneratingReceipt) {
|
|
4086
|
+
e.currentTarget.style.boxShadow = primaryBaseShadow;
|
|
4087
|
+
e.currentTarget.style.transform = "translateY(0px)";
|
|
4088
|
+
}
|
|
4057
4089
|
},
|
|
4058
4090
|
onMouseDown: (e) => {
|
|
4059
|
-
|
|
4060
|
-
|
|
4091
|
+
if (!isGeneratingReceipt) {
|
|
4092
|
+
e.currentTarget.style.boxShadow = primaryActiveShadow;
|
|
4093
|
+
e.currentTarget.style.transform = "translateY(2px)";
|
|
4094
|
+
}
|
|
4061
4095
|
},
|
|
4062
4096
|
onMouseUp: (e) => {
|
|
4063
|
-
|
|
4097
|
+
if (!isGeneratingReceipt) {
|
|
4098
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
4099
|
+
}
|
|
4064
4100
|
}
|
|
4065
4101
|
},
|
|
4066
4102
|
/* @__PURE__ */ import_react72.default.createElement("span", { className: "absolute inset-0 rounded-full bg-linear-to-b from-white/10 via-white/5 to-transparent pointer-events-none" }),
|
|
4067
|
-
/* @__PURE__ */ import_react72.default.createElement("span", { className: "relative z-10 text-[13px] tracking-wide" }, "
|
|
4103
|
+
/* @__PURE__ */ import_react72.default.createElement("span", { className: "relative z-10 flex items-center justify-center gap-2 text-[13px] tracking-wide" }, isGeneratingReceipt ? /* @__PURE__ */ import_react72.default.createElement(import_react73.HugeiconsIcon, { icon: import_core_free_icons25.Loading03Icon, size: 14, className: "animate-spin" }) : null, isGeneratingReceipt ? "Generating..." : "Generate Receipt")
|
|
4068
4104
|
), /* @__PURE__ */ import_react72.default.createElement(
|
|
4069
4105
|
"button",
|
|
4070
4106
|
{
|
|
4071
|
-
onClick: () =>
|
|
4072
|
-
className: "w-full flex items-center justify-center py-2 rounded-full
|
|
4107
|
+
onClick: () => onReportTransaction && onReportTransaction(selectedTransaction),
|
|
4108
|
+
className: "w-full flex items-center justify-center py-2 rounded-full border border-neutral-200 text-black hover:bg-neutral-50 transition-colors outline-none text-[13px] tracking-wide"
|
|
4073
4109
|
},
|
|
4074
|
-
"
|
|
4110
|
+
"Report Transaction"
|
|
4075
4111
|
))))), isDirectionModalOpen && /* @__PURE__ */ import_react72.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setIsDirectionModalOpen(false) }), /* @__PURE__ */ import_react72.default.createElement("div", { ref: directionDropdownRef, className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ import_react72.default.createElement("h3", { className: "text-[14px] text-black tracking-tight" }, "Payment Type")), /* @__PURE__ */ import_react72.default.createElement("div", { className: "w-full flex flex-col pl-2 pr-2" }, ["ALL", "CREDIT", "DEBIT"].map((option) => /* @__PURE__ */ import_react72.default.createElement(
|
|
4076
4112
|
"button",
|
|
4077
4113
|
{
|
|
@@ -4216,7 +4252,8 @@ var UniversalHomeView = ({
|
|
|
4216
4252
|
{
|
|
4217
4253
|
...transactionsProps,
|
|
4218
4254
|
hideControls: true,
|
|
4219
|
-
hideBalanceAmounts: isBalanceHidden
|
|
4255
|
+
hideBalanceAmounts: isBalanceHidden,
|
|
4256
|
+
hidePagination: true
|
|
4220
4257
|
}
|
|
4221
4258
|
)));
|
|
4222
4259
|
};
|
|
@@ -4439,7 +4476,7 @@ var Stagger = ({ steps, currentStep }) => {
|
|
|
4439
4476
|
|
|
4440
4477
|
// src/components/UniversalRegistrationFlow.tsx
|
|
4441
4478
|
var import_react88 = __toESM(require("react"));
|
|
4442
|
-
var
|
|
4479
|
+
var import_react_hot_toast11 = __toESM(require("react-hot-toast"));
|
|
4443
4480
|
var import_react89 = require("@hugeicons/react");
|
|
4444
4481
|
var import_core_free_icons32 = require("@hugeicons/core-free-icons");
|
|
4445
4482
|
var MACRO_STEPS = ["Details", "Documents", "Review", "Submit"];
|
|
@@ -4641,7 +4678,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4641
4678
|
if (data.appStatus === "QUEUED" || data.appStatus === "REJECTED") setMacroStep(0);
|
|
4642
4679
|
}
|
|
4643
4680
|
}).catch(() => {
|
|
4644
|
-
|
|
4681
|
+
import_react_hot_toast11.default.error("Uh oh! Something went wrong while loading.");
|
|
4645
4682
|
}).finally(() => setIsBooting(false));
|
|
4646
4683
|
}, [applicationId, type, apiEndpoint]);
|
|
4647
4684
|
const saveProgress = async (newFormData = formData, newFormState = formState, newMacro = macroStep) => {
|
|
@@ -4653,11 +4690,11 @@ var UniversalRegistrationFlow = ({
|
|
|
4653
4690
|
setIsAborting(true);
|
|
4654
4691
|
const data = await baseApi("abort");
|
|
4655
4692
|
if (data.success) {
|
|
4656
|
-
|
|
4693
|
+
import_react_hot_toast11.default.success("Application aborted.");
|
|
4657
4694
|
setAppStatus("DRAFT");
|
|
4658
4695
|
setMacroStep(0);
|
|
4659
4696
|
setIsAbortModalOpen(false);
|
|
4660
|
-
} else
|
|
4697
|
+
} else import_react_hot_toast11.default.error(data.error || "Uh oh! Something went wrong.");
|
|
4661
4698
|
setIsAborting(false);
|
|
4662
4699
|
};
|
|
4663
4700
|
const handleBack = () => {
|
|
@@ -4700,7 +4737,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4700
4737
|
setIsAnalyzingNature(true);
|
|
4701
4738
|
const data = await baseApi("analyze_nature", { description: formData.businessDesc });
|
|
4702
4739
|
if (data.success) setSuggestedNature(data.data);
|
|
4703
|
-
else
|
|
4740
|
+
else import_react_hot_toast11.default.error(data.error || "Uh oh! Something went wrong.");
|
|
4704
4741
|
setIsAnalyzingNature(false);
|
|
4705
4742
|
};
|
|
4706
4743
|
const pollNameCheckJob = async (jobId) => {
|
|
@@ -4709,7 +4746,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4709
4746
|
setNameCheckResult(poll.data.result);
|
|
4710
4747
|
setIsCheckingName(false);
|
|
4711
4748
|
} else if (poll.success && poll.data.status === "error") {
|
|
4712
|
-
|
|
4749
|
+
import_react_hot_toast11.default.error(poll.data.error || "Uh oh! Something went wrong.");
|
|
4713
4750
|
setIsCheckingName(false);
|
|
4714
4751
|
} else setTimeout(() => pollNameCheckJob(jobId), 3e3);
|
|
4715
4752
|
};
|
|
@@ -4727,7 +4764,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4727
4764
|
const data = await baseApi("check_name_start", { name: nameToCheck, lineOfBusiness: formData.natureOfBusiness?.specificLabel });
|
|
4728
4765
|
if (data.success && data.data.jobId) pollNameCheckJob(data.data.jobId);
|
|
4729
4766
|
else {
|
|
4730
|
-
|
|
4767
|
+
import_react_hot_toast11.default.error(data.error || "Uh oh! Something went wrong.");
|
|
4731
4768
|
setIsCheckingName(false);
|
|
4732
4769
|
}
|
|
4733
4770
|
};
|
|
@@ -4752,7 +4789,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4752
4789
|
throw new Error(data.error || "Failed to secure upload URL.");
|
|
4753
4790
|
}
|
|
4754
4791
|
} catch (error) {
|
|
4755
|
-
|
|
4792
|
+
import_react_hot_toast11.default.error(error.message);
|
|
4756
4793
|
} finally {
|
|
4757
4794
|
if (optType === "other1") {
|
|
4758
4795
|
setIsUploadingOther1(false);
|
|
@@ -4803,7 +4840,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4803
4840
|
const maxAllowed = Math.max(0, 100 - otherSharesSum);
|
|
4804
4841
|
if (numValue > maxAllowed) {
|
|
4805
4842
|
numValue = maxAllowed;
|
|
4806
|
-
|
|
4843
|
+
import_react_hot_toast11.default.error(`Total shares cannot exceed 100%. Remaining: ${maxAllowed}%`, { id: "share-limit" });
|
|
4807
4844
|
} else if (numValue < 0) numValue = 0;
|
|
4808
4845
|
updated[index] = { ...updated[index], [key]: numValue.toString() };
|
|
4809
4846
|
}
|
|
@@ -4834,7 +4871,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4834
4871
|
updatedMembers[memberIndex] = { ...updatedMembers[memberIndex], idExtractedData: data.data, idFileUrl: uploadData.data.fileUrl, idMetadata: { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size } };
|
|
4835
4872
|
setFormData({ ...formData, members: updatedMembers });
|
|
4836
4873
|
saveProgress({ ...formData, members: updatedMembers });
|
|
4837
|
-
} else
|
|
4874
|
+
} else import_react_hot_toast11.default.error(data.error || "Uh oh! Something went wrong.");
|
|
4838
4875
|
} else {
|
|
4839
4876
|
if (docType === "passport") setGlobalUploadingPassport(true);
|
|
4840
4877
|
else setGlobalUploadingSignature(true);
|
|
@@ -4851,10 +4888,10 @@ var UniversalRegistrationFlow = ({
|
|
|
4851
4888
|
}
|
|
4852
4889
|
setFormData({ ...formData, members: updatedMembers });
|
|
4853
4890
|
saveProgress({ ...formData, members: updatedMembers });
|
|
4854
|
-
} else
|
|
4891
|
+
} else import_react_hot_toast11.default.error(`Failed to secure upload URL for ${docType}.`);
|
|
4855
4892
|
}
|
|
4856
4893
|
} catch (error) {
|
|
4857
|
-
|
|
4894
|
+
import_react_hot_toast11.default.error(error.message);
|
|
4858
4895
|
} finally {
|
|
4859
4896
|
if (docType === "id") setGlobalExtractingId(false);
|
|
4860
4897
|
else if (docType === "passport") setGlobalUploadingPassport(false);
|
|
@@ -4903,7 +4940,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4903
4940
|
setFormData(updatedForm);
|
|
4904
4941
|
saveProgress(updatedForm);
|
|
4905
4942
|
} else {
|
|
4906
|
-
|
|
4943
|
+
import_react_hot_toast11.default.error(data.error || "Uh oh! Something went wrong.");
|
|
4907
4944
|
setAiTasks([{ id: "1", label: "Document Scanned", status: "success" }, { id: "2", label: "Extraction Failed", status: "error" }]);
|
|
4908
4945
|
}
|
|
4909
4946
|
} else {
|
|
@@ -4923,10 +4960,10 @@ var UniversalRegistrationFlow = ({
|
|
|
4923
4960
|
approveSection("signatureApproved", updatedForm);
|
|
4924
4961
|
}
|
|
4925
4962
|
setFormData(updatedForm);
|
|
4926
|
-
} else
|
|
4963
|
+
} else import_react_hot_toast11.default.error(data.error || `Failed to upload ${docType}.`);
|
|
4927
4964
|
}
|
|
4928
4965
|
} catch (error) {
|
|
4929
|
-
|
|
4966
|
+
import_react_hot_toast11.default.error(error.message);
|
|
4930
4967
|
} finally {
|
|
4931
4968
|
if (docType === "id") {
|
|
4932
4969
|
setGlobalExtractingId(false);
|
|
@@ -5009,10 +5046,10 @@ var UniversalRegistrationFlow = ({
|
|
|
5009
5046
|
}
|
|
5010
5047
|
const data = await baseApi("submit", finalJsonPayload);
|
|
5011
5048
|
if (data.success) {
|
|
5012
|
-
|
|
5049
|
+
import_react_hot_toast11.default.success("Application Submitted!");
|
|
5013
5050
|
onRedirectToApplication(applicationId);
|
|
5014
5051
|
} else {
|
|
5015
|
-
|
|
5052
|
+
import_react_hot_toast11.default.error(data.error || "Uh oh! Something went wrong.");
|
|
5016
5053
|
setIsSubmitting(false);
|
|
5017
5054
|
}
|
|
5018
5055
|
};
|
|
@@ -5061,7 +5098,7 @@ var UniversalRegistrationFlow = ({
|
|
|
5061
5098
|
|
|
5062
5099
|
// src/components/UniversalDeveloperSettings.tsx
|
|
5063
5100
|
var import_react90 = __toESM(require("react"));
|
|
5064
|
-
var
|
|
5101
|
+
var import_react_hot_toast12 = require("react-hot-toast");
|
|
5065
5102
|
var import_react91 = require("@hugeicons/react");
|
|
5066
5103
|
var import_core_free_icons33 = require("@hugeicons/core-free-icons");
|
|
5067
5104
|
var ButtonSpinner5 = () => /* @__PURE__ */ import_react90.default.createElement(import_react91.HugeiconsIcon, { icon: import_core_free_icons33.Loading03Icon, size: 16, className: "animate-spin text-current" });
|
|
@@ -5108,13 +5145,13 @@ SECRET_KEY="${secKey}"
|
|
|
5108
5145
|
if (res.success && res.data) {
|
|
5109
5146
|
setPublicKey(res.data.publicKey);
|
|
5110
5147
|
downloadEnvironmentFile(res.data.publicKey, res.data.secretKey);
|
|
5111
|
-
|
|
5148
|
+
import_react_hot_toast12.toast.success("Keys generated. Check your downloads folder.");
|
|
5112
5149
|
setIsRollModalOpen(false);
|
|
5113
5150
|
} else {
|
|
5114
|
-
|
|
5151
|
+
import_react_hot_toast12.toast.error(res.error || "Uh oh! Something went wrong.");
|
|
5115
5152
|
}
|
|
5116
5153
|
} catch (error) {
|
|
5117
|
-
|
|
5154
|
+
import_react_hot_toast12.toast.error("Uh oh! Something went wrong.");
|
|
5118
5155
|
} finally {
|
|
5119
5156
|
setIsGenerating(false);
|
|
5120
5157
|
}
|
|
@@ -5127,12 +5164,12 @@ SECRET_KEY="${secKey}"
|
|
|
5127
5164
|
const res = await onSaveWebhook(webhookUrl);
|
|
5128
5165
|
if (res.success && res.data) {
|
|
5129
5166
|
setWebhookUrl(res.data.webhookUrl || "");
|
|
5130
|
-
|
|
5167
|
+
import_react_hot_toast12.toast.success("Webhook URL updated.");
|
|
5131
5168
|
} else {
|
|
5132
|
-
|
|
5169
|
+
import_react_hot_toast12.toast.error(res.error || "Uh oh! Something went wrong.");
|
|
5133
5170
|
}
|
|
5134
5171
|
} catch (error) {
|
|
5135
|
-
|
|
5172
|
+
import_react_hot_toast12.toast.error("Uh oh! Something went wrong.");
|
|
5136
5173
|
} finally {
|
|
5137
5174
|
setIsSavingWebhook(false);
|
|
5138
5175
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -689,7 +689,7 @@ function AuthFormInner2({
|
|
|
689
689
|
className: "mt-0.5 w-4 h-4 bg-white border-neutral-300 rounded text-black focus:ring-black cursor-pointer",
|
|
690
690
|
required: true
|
|
691
691
|
}
|
|
692
|
-
), /* @__PURE__ */ React5.createElement("label", { htmlFor: "zairus-terms", className: "text-[11px] text-neutral-500 cursor-pointer leading-snug" }, "I agree to ", companyName, "'s ", /* @__PURE__ */ React5.createElement("a", { href: termsUrl, target: "_blank", rel: "noreferrer", className: "text-[#1f26d6]
|
|
692
|
+
), /* @__PURE__ */ React5.createElement("label", { htmlFor: "zairus-terms", className: "text-[11px] text-neutral-500 cursor-pointer leading-snug" }, "I agree to ", companyName, "'s ", /* @__PURE__ */ React5.createElement("a", { href: termsUrl, target: "_blank", rel: "noreferrer", className: "text-[#1f26d6] " }, "Terms of Service"), " and ", /* @__PURE__ */ React5.createElement("a", { href: privacyUrl, target: "_blank", rel: "noreferrer", className: "text-[#1f26d6] " }, "Privacy Policy"), "."))), /* @__PURE__ */ React5.createElement(
|
|
693
693
|
ThreeDActionButton,
|
|
694
694
|
{
|
|
695
695
|
type: "submit",
|
|
@@ -2363,7 +2363,7 @@ var UniversalOrganizationPage = ({
|
|
|
2363
2363
|
};
|
|
2364
2364
|
const hasChanges = web3Name !== initialOrgName || slug !== initialSlug || username !== initialSlug;
|
|
2365
2365
|
const isSaveDisabled = isSubmitting || isReadOnly || isCheckingSlug || !hasChanges || web3Name.length < 3 || slug.length < 3 || username.length < 3 || slug !== initialSlug && slugAvailable === false;
|
|
2366
|
-
return /* @__PURE__ */ React29.createElement("div", { className: "flex flex-col gap-8 animate-in max-w-5xl rounded-2xl p-6 bg-white fade-in duration-300 " }, /* @__PURE__ */ React29.createElement(ManagedToaster, null), /* @__PURE__ */ React29.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ React29.createElement("div", null, /* @__PURE__ */ React29.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, "
|
|
2366
|
+
return /* @__PURE__ */ React29.createElement("div", { className: "flex flex-col gap-8 animate-in max-w-5xl rounded-2xl p-6 bg-white fade-in duration-300 " }, /* @__PURE__ */ React29.createElement(ManagedToaster, null), /* @__PURE__ */ React29.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ React29.createElement("div", null, /* @__PURE__ */ React29.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, "Public Profile"), /* @__PURE__ */ React29.createElement("p", { className: "text-xs text-neutral-500" }, "Manage your financial payment handle identifiers and global public cryptographic signature identity details.")), isReadOnly && /* @__PURE__ */ React29.createElement("span", { className: "p-2 w-9 h-9 bg-neutral-50 text-neutral-500 rounded-full shrink-0" }, /* @__PURE__ */ React29.createElement(HugeiconsIcon15, { icon: CircleLock02Icon, size: 18, className: "text-current" }))), bannerProps && /* @__PURE__ */ React29.createElement(Banner, { ...bannerProps }), /* @__PURE__ */ React29.createElement("div", { className: "w-full max-w-5xl" }, /* @__PURE__ */ React29.createElement("form", { className: "flex flex-col gap-8", onSubmit: handleSave, autoComplete: "off" }, /* @__PURE__ */ React29.createElement(
|
|
2367
2367
|
TextInput,
|
|
2368
2368
|
{
|
|
2369
2369
|
label: "Display Name",
|
|
@@ -3901,6 +3901,7 @@ var UniversalTrashView = ({
|
|
|
3901
3901
|
// src/components/UniversalTransactionPage.tsx
|
|
3902
3902
|
import React44, { useState as useState28, useEffect as useEffect19, useRef as useRef12 } from "react";
|
|
3903
3903
|
import { HugeiconsIcon as HugeiconsIcon29 } from "@hugeicons/react";
|
|
3904
|
+
import toast9 from "react-hot-toast";
|
|
3904
3905
|
import {
|
|
3905
3906
|
ArrowLeft01Icon as ArrowLeft01Icon10,
|
|
3906
3907
|
ArrowRight01Icon as ArrowRight01Icon10,
|
|
@@ -3944,6 +3945,7 @@ var UniversalTransactionPage = ({
|
|
|
3944
3945
|
onGenerateReceipt
|
|
3945
3946
|
}) => {
|
|
3946
3947
|
const [selectedTransaction, setSelectedTransaction] = useState28(null);
|
|
3948
|
+
const [isGeneratingReceipt, setIsGeneratingReceipt] = useState28(false);
|
|
3947
3949
|
const [localSearchQuery, setLocalSearchQuery] = useState28(searchQuery);
|
|
3948
3950
|
const [isTyping, setIsTyping] = useState28(false);
|
|
3949
3951
|
const [isDirectionModalOpen, setIsDirectionModalOpen] = useState28(false);
|
|
@@ -3980,6 +3982,18 @@ var UniversalTransactionPage = ({
|
|
|
3980
3982
|
if (tx.metadata?.description) return tx.metadata.description;
|
|
3981
3983
|
return tx.type === "CARD_TRANSACTION" ? "Card Transaction" : "Wallet Transaction";
|
|
3982
3984
|
};
|
|
3985
|
+
const handleGenerateReceipt = async () => {
|
|
3986
|
+
if (!onGenerateReceipt || !selectedTransaction) return;
|
|
3987
|
+
setIsGeneratingReceipt(true);
|
|
3988
|
+
try {
|
|
3989
|
+
await onGenerateReceipt(selectedTransaction);
|
|
3990
|
+
toast9.success("Receipt generated successfully.");
|
|
3991
|
+
} catch (error) {
|
|
3992
|
+
toast9.error("Failed to generate receipt.");
|
|
3993
|
+
} finally {
|
|
3994
|
+
setIsGeneratingReceipt(false);
|
|
3995
|
+
}
|
|
3996
|
+
};
|
|
3983
3997
|
const isListLoading = isLoading || isTyping;
|
|
3984
3998
|
const primaryBaseShadow = `inset 0 1.5px 0 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 0 rgba(0, 0, 0, 0.5), 0 3px 0 0 #0c0c0c, 0 6px 10px rgba(0, 0, 0, 0.3)`;
|
|
3985
3999
|
const primaryHoverShadow = `inset 0 1.5px 0 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 0 rgba(0, 0, 0, 0.5), 0 4px 0 0 #0c0c0c, 0 8px 12px rgba(0, 0, 0, 0.35)`;
|
|
@@ -4034,37 +4048,59 @@ var UniversalTransactionPage = ({
|
|
|
4034
4048
|
className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black hover:border-black disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none"
|
|
4035
4049
|
},
|
|
4036
4050
|
/* @__PURE__ */ React44.createElement(HugeiconsIcon29, { icon: ArrowRight01Icon10, size: 14 })
|
|
4037
|
-
)))))), selectedTransaction && /* @__PURE__ */ React44.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React44.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setSelectedTransaction(null) }), /* @__PURE__ */ React44.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 max-h-[90vh]" }, /* @__PURE__ */ React44.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React44.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Details"), /* @__PURE__ */ React44.createElement("button", { onClick: () => setSelectedTransaction(null), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React44.createElement(HugeiconsIcon29, { icon: CancelCircleIcon2, size: 18 }))), /* @__PURE__ */ React44.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6" }, /* @__PURE__ */ React44.createElement("div", { className: "flex flex-col items-center justify-center mb-4" }, /* @__PURE__ */ React44.createElement("div", { className: `w-12 h-12 rounded-full
|
|
4051
|
+
)))))), selectedTransaction && /* @__PURE__ */ React44.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React44.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setSelectedTransaction(null) }), /* @__PURE__ */ React44.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 max-h-[90vh]" }, /* @__PURE__ */ React44.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React44.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Details"), /* @__PURE__ */ React44.createElement("button", { onClick: () => setSelectedTransaction(null), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React44.createElement(HugeiconsIcon29, { icon: CancelCircleIcon2, size: 18 }))), /* @__PURE__ */ React44.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6" }, /* @__PURE__ */ React44.createElement("div", { className: "flex flex-col items-center justify-center mb-4" }, /* @__PURE__ */ React44.createElement("div", { className: `w-12 h-12 rounded-full flex items-center justify-center mb-4 ${selectedTransaction.direction === "CREDIT" ? "bg-neutral-100 text-neutral-6000" : "bg-neutral-100 text-neutral-600"}` }, /* @__PURE__ */ React44.createElement(HugeiconsIcon29, { icon: selectedTransaction.direction === "CREDIT" ? ArrowDownRight01Icon : ArrowUpRight01Icon, size: 20 })), /* @__PURE__ */ React44.createElement("h2", { className: `text-2xl text-black mb-2 transition-all duration-300 ${hideBalanceAmounts ? "blur-[6px] opacity-40 select-none" : ""}` }, selectedTransaction.direction === "CREDIT" ? "+" : "-", selectedTransaction.amount, " ", selectedTransaction.currency), /* @__PURE__ */ React44.createElement("span", { className: "text-[9px] tracking-widest text-neutral-500 px-4 py-1.5 rounded-full bg-neutral-50" }, selectedTransaction.status), selectedTransaction.type === "WALLET_TRANSACTION" && /* @__PURE__ */ React44.createElement(
|
|
4052
|
+
"a",
|
|
4053
|
+
{
|
|
4054
|
+
href: `https://basescan.org/tx/${selectedTransaction.reference}`,
|
|
4055
|
+
target: "_blank",
|
|
4056
|
+
rel: "noopener noreferrer",
|
|
4057
|
+
className: "text-[11px] text-[#1f26d6] mt-4 transition-colors tracking-wide"
|
|
4058
|
+
},
|
|
4059
|
+
"View in block explorer"
|
|
4060
|
+
)), /* @__PURE__ */ React44.createElement("div", { className: "grid grid-cols-1 gap-y-8 gap-x-4 mb-10 mt-6" }, /* @__PURE__ */ React44.createElement("div", null, /* @__PURE__ */ React44.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Reference ID"), /* @__PURE__ */ React44.createElement("span", { className: "text-[13px] text-black break-all" }, selectedTransaction.reference)), /* @__PURE__ */ React44.createElement("div", null, /* @__PURE__ */ React44.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Date & Time"), /* @__PURE__ */ React44.createElement("span", { className: "text-[13px] text-black" }, formatDate3(selectedTransaction.createdAt), " at ", formatTime(selectedTransaction.createdAt))), /* @__PURE__ */ React44.createElement("div", null, /* @__PURE__ */ React44.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Transaction Type"), /* @__PURE__ */ React44.createElement("span", { className: "text-[13px] text-black capitalize" }, selectedTransaction.type.replace("_", " ").toLowerCase())), /* @__PURE__ */ React44.createElement("div", null, /* @__PURE__ */ React44.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Flow Direction"), /* @__PURE__ */ React44.createElement("span", { className: "text-[13px] text-black capitalize" }, selectedTransaction.direction.toLowerCase())), selectedTransaction.metadata && Object.entries(selectedTransaction.metadata).map(([key, value]) => {
|
|
4061
|
+
if (value === null || value === void 0 || typeof value === "object") return null;
|
|
4062
|
+
const formattedKey = key.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
|
|
4063
|
+
return /* @__PURE__ */ React44.createElement("div", { key }, /* @__PURE__ */ React44.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, formattedKey), /* @__PURE__ */ React44.createElement("span", { className: "text-[13px] text-black break-all" }, String(value)));
|
|
4064
|
+
})), /* @__PURE__ */ React44.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React44.createElement(
|
|
4038
4065
|
"button",
|
|
4039
4066
|
{
|
|
4040
|
-
onClick:
|
|
4041
|
-
|
|
4042
|
-
|
|
4067
|
+
onClick: handleGenerateReceipt,
|
|
4068
|
+
disabled: isGeneratingReceipt,
|
|
4069
|
+
className: "relative w-full flex items-center justify-center py-2 rounded-full bg-neutral-950 text-white transition-all duration-150 select-none outline-none disabled:opacity-70 disabled:cursor-not-allowed",
|
|
4070
|
+
style: !isGeneratingReceipt ? { boxShadow: primaryBaseShadow } : {},
|
|
4043
4071
|
onMouseEnter: (e) => {
|
|
4044
|
-
|
|
4045
|
-
|
|
4072
|
+
if (!isGeneratingReceipt) {
|
|
4073
|
+
e.currentTarget.style.boxShadow = primaryHoverShadow;
|
|
4074
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
4075
|
+
}
|
|
4046
4076
|
},
|
|
4047
4077
|
onMouseLeave: (e) => {
|
|
4048
|
-
|
|
4049
|
-
|
|
4078
|
+
if (!isGeneratingReceipt) {
|
|
4079
|
+
e.currentTarget.style.boxShadow = primaryBaseShadow;
|
|
4080
|
+
e.currentTarget.style.transform = "translateY(0px)";
|
|
4081
|
+
}
|
|
4050
4082
|
},
|
|
4051
4083
|
onMouseDown: (e) => {
|
|
4052
|
-
|
|
4053
|
-
|
|
4084
|
+
if (!isGeneratingReceipt) {
|
|
4085
|
+
e.currentTarget.style.boxShadow = primaryActiveShadow;
|
|
4086
|
+
e.currentTarget.style.transform = "translateY(2px)";
|
|
4087
|
+
}
|
|
4054
4088
|
},
|
|
4055
4089
|
onMouseUp: (e) => {
|
|
4056
|
-
|
|
4090
|
+
if (!isGeneratingReceipt) {
|
|
4091
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
4092
|
+
}
|
|
4057
4093
|
}
|
|
4058
4094
|
},
|
|
4059
4095
|
/* @__PURE__ */ React44.createElement("span", { className: "absolute inset-0 rounded-full bg-linear-to-b from-white/10 via-white/5 to-transparent pointer-events-none" }),
|
|
4060
|
-
/* @__PURE__ */ React44.createElement("span", { className: "relative z-10 text-[13px] tracking-wide" }, "
|
|
4096
|
+
/* @__PURE__ */ React44.createElement("span", { className: "relative z-10 flex items-center justify-center gap-2 text-[13px] tracking-wide" }, isGeneratingReceipt ? /* @__PURE__ */ React44.createElement(HugeiconsIcon29, { icon: Loading03Icon15, size: 14, className: "animate-spin" }) : null, isGeneratingReceipt ? "Generating..." : "Generate Receipt")
|
|
4061
4097
|
), /* @__PURE__ */ React44.createElement(
|
|
4062
4098
|
"button",
|
|
4063
4099
|
{
|
|
4064
|
-
onClick: () =>
|
|
4065
|
-
className: "w-full flex items-center justify-center py-2 rounded-full
|
|
4100
|
+
onClick: () => onReportTransaction && onReportTransaction(selectedTransaction),
|
|
4101
|
+
className: "w-full flex items-center justify-center py-2 rounded-full border border-neutral-200 text-black hover:bg-neutral-50 transition-colors outline-none text-[13px] tracking-wide"
|
|
4066
4102
|
},
|
|
4067
|
-
"
|
|
4103
|
+
"Report Transaction"
|
|
4068
4104
|
))))), isDirectionModalOpen && /* @__PURE__ */ React44.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React44.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setIsDirectionModalOpen(false) }), /* @__PURE__ */ React44.createElement("div", { ref: directionDropdownRef, className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React44.createElement("div", { className: "p-6 text-center w-full" }, /* @__PURE__ */ React44.createElement("h3", { className: "text-[14px] text-black tracking-tight" }, "Payment Type")), /* @__PURE__ */ React44.createElement("div", { className: "w-full flex flex-col pl-2 pr-2" }, ["ALL", "CREDIT", "DEBIT"].map((option) => /* @__PURE__ */ React44.createElement(
|
|
4069
4105
|
"button",
|
|
4070
4106
|
{
|
|
@@ -4209,7 +4245,8 @@ var UniversalHomeView = ({
|
|
|
4209
4245
|
{
|
|
4210
4246
|
...transactionsProps,
|
|
4211
4247
|
hideControls: true,
|
|
4212
|
-
hideBalanceAmounts: isBalanceHidden
|
|
4248
|
+
hideBalanceAmounts: isBalanceHidden,
|
|
4249
|
+
hidePagination: true
|
|
4213
4250
|
}
|
|
4214
4251
|
)));
|
|
4215
4252
|
};
|
|
@@ -4436,7 +4473,7 @@ var Stagger = ({ steps, currentStep }) => {
|
|
|
4436
4473
|
|
|
4437
4474
|
// src/components/UniversalRegistrationFlow.tsx
|
|
4438
4475
|
import React53, { useState as useState32, useEffect as useEffect21, useRef as useRef13 } from "react";
|
|
4439
|
-
import
|
|
4476
|
+
import toast10 from "react-hot-toast";
|
|
4440
4477
|
import { HugeiconsIcon as HugeiconsIcon36 } from "@hugeicons/react";
|
|
4441
4478
|
import { CheckmarkBadge01Icon as CheckmarkBadge01Icon2, Upload01Icon as Upload01Icon3, Loading03Icon as Loading03Icon18, PencilEdit01Icon as PencilEdit01Icon2, Delete02Icon as Delete02Icon3, SignatureIcon, IdentificationIcon, ArrowLeft01Icon as ArrowLeft01Icon11, HourglassIcon } from "@hugeicons/core-free-icons";
|
|
4442
4479
|
var MACRO_STEPS = ["Details", "Documents", "Review", "Submit"];
|
|
@@ -4638,7 +4675,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4638
4675
|
if (data.appStatus === "QUEUED" || data.appStatus === "REJECTED") setMacroStep(0);
|
|
4639
4676
|
}
|
|
4640
4677
|
}).catch(() => {
|
|
4641
|
-
|
|
4678
|
+
toast10.error("Uh oh! Something went wrong while loading.");
|
|
4642
4679
|
}).finally(() => setIsBooting(false));
|
|
4643
4680
|
}, [applicationId, type, apiEndpoint]);
|
|
4644
4681
|
const saveProgress = async (newFormData = formData, newFormState = formState, newMacro = macroStep) => {
|
|
@@ -4650,11 +4687,11 @@ var UniversalRegistrationFlow = ({
|
|
|
4650
4687
|
setIsAborting(true);
|
|
4651
4688
|
const data = await baseApi("abort");
|
|
4652
4689
|
if (data.success) {
|
|
4653
|
-
|
|
4690
|
+
toast10.success("Application aborted.");
|
|
4654
4691
|
setAppStatus("DRAFT");
|
|
4655
4692
|
setMacroStep(0);
|
|
4656
4693
|
setIsAbortModalOpen(false);
|
|
4657
|
-
} else
|
|
4694
|
+
} else toast10.error(data.error || "Uh oh! Something went wrong.");
|
|
4658
4695
|
setIsAborting(false);
|
|
4659
4696
|
};
|
|
4660
4697
|
const handleBack = () => {
|
|
@@ -4697,7 +4734,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4697
4734
|
setIsAnalyzingNature(true);
|
|
4698
4735
|
const data = await baseApi("analyze_nature", { description: formData.businessDesc });
|
|
4699
4736
|
if (data.success) setSuggestedNature(data.data);
|
|
4700
|
-
else
|
|
4737
|
+
else toast10.error(data.error || "Uh oh! Something went wrong.");
|
|
4701
4738
|
setIsAnalyzingNature(false);
|
|
4702
4739
|
};
|
|
4703
4740
|
const pollNameCheckJob = async (jobId) => {
|
|
@@ -4706,7 +4743,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4706
4743
|
setNameCheckResult(poll.data.result);
|
|
4707
4744
|
setIsCheckingName(false);
|
|
4708
4745
|
} else if (poll.success && poll.data.status === "error") {
|
|
4709
|
-
|
|
4746
|
+
toast10.error(poll.data.error || "Uh oh! Something went wrong.");
|
|
4710
4747
|
setIsCheckingName(false);
|
|
4711
4748
|
} else setTimeout(() => pollNameCheckJob(jobId), 3e3);
|
|
4712
4749
|
};
|
|
@@ -4724,7 +4761,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4724
4761
|
const data = await baseApi("check_name_start", { name: nameToCheck, lineOfBusiness: formData.natureOfBusiness?.specificLabel });
|
|
4725
4762
|
if (data.success && data.data.jobId) pollNameCheckJob(data.data.jobId);
|
|
4726
4763
|
else {
|
|
4727
|
-
|
|
4764
|
+
toast10.error(data.error || "Uh oh! Something went wrong.");
|
|
4728
4765
|
setIsCheckingName(false);
|
|
4729
4766
|
}
|
|
4730
4767
|
};
|
|
@@ -4749,7 +4786,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4749
4786
|
throw new Error(data.error || "Failed to secure upload URL.");
|
|
4750
4787
|
}
|
|
4751
4788
|
} catch (error) {
|
|
4752
|
-
|
|
4789
|
+
toast10.error(error.message);
|
|
4753
4790
|
} finally {
|
|
4754
4791
|
if (optType === "other1") {
|
|
4755
4792
|
setIsUploadingOther1(false);
|
|
@@ -4800,7 +4837,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4800
4837
|
const maxAllowed = Math.max(0, 100 - otherSharesSum);
|
|
4801
4838
|
if (numValue > maxAllowed) {
|
|
4802
4839
|
numValue = maxAllowed;
|
|
4803
|
-
|
|
4840
|
+
toast10.error(`Total shares cannot exceed 100%. Remaining: ${maxAllowed}%`, { id: "share-limit" });
|
|
4804
4841
|
} else if (numValue < 0) numValue = 0;
|
|
4805
4842
|
updated[index] = { ...updated[index], [key]: numValue.toString() };
|
|
4806
4843
|
}
|
|
@@ -4831,7 +4868,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4831
4868
|
updatedMembers[memberIndex] = { ...updatedMembers[memberIndex], idExtractedData: data.data, idFileUrl: uploadData.data.fileUrl, idMetadata: { fileName: file.name, contentType: file.type, fileSizeInBytes: file.size } };
|
|
4832
4869
|
setFormData({ ...formData, members: updatedMembers });
|
|
4833
4870
|
saveProgress({ ...formData, members: updatedMembers });
|
|
4834
|
-
} else
|
|
4871
|
+
} else toast10.error(data.error || "Uh oh! Something went wrong.");
|
|
4835
4872
|
} else {
|
|
4836
4873
|
if (docType === "passport") setGlobalUploadingPassport(true);
|
|
4837
4874
|
else setGlobalUploadingSignature(true);
|
|
@@ -4848,10 +4885,10 @@ var UniversalRegistrationFlow = ({
|
|
|
4848
4885
|
}
|
|
4849
4886
|
setFormData({ ...formData, members: updatedMembers });
|
|
4850
4887
|
saveProgress({ ...formData, members: updatedMembers });
|
|
4851
|
-
} else
|
|
4888
|
+
} else toast10.error(`Failed to secure upload URL for ${docType}.`);
|
|
4852
4889
|
}
|
|
4853
4890
|
} catch (error) {
|
|
4854
|
-
|
|
4891
|
+
toast10.error(error.message);
|
|
4855
4892
|
} finally {
|
|
4856
4893
|
if (docType === "id") setGlobalExtractingId(false);
|
|
4857
4894
|
else if (docType === "passport") setGlobalUploadingPassport(false);
|
|
@@ -4900,7 +4937,7 @@ var UniversalRegistrationFlow = ({
|
|
|
4900
4937
|
setFormData(updatedForm);
|
|
4901
4938
|
saveProgress(updatedForm);
|
|
4902
4939
|
} else {
|
|
4903
|
-
|
|
4940
|
+
toast10.error(data.error || "Uh oh! Something went wrong.");
|
|
4904
4941
|
setAiTasks([{ id: "1", label: "Document Scanned", status: "success" }, { id: "2", label: "Extraction Failed", status: "error" }]);
|
|
4905
4942
|
}
|
|
4906
4943
|
} else {
|
|
@@ -4920,10 +4957,10 @@ var UniversalRegistrationFlow = ({
|
|
|
4920
4957
|
approveSection("signatureApproved", updatedForm);
|
|
4921
4958
|
}
|
|
4922
4959
|
setFormData(updatedForm);
|
|
4923
|
-
} else
|
|
4960
|
+
} else toast10.error(data.error || `Failed to upload ${docType}.`);
|
|
4924
4961
|
}
|
|
4925
4962
|
} catch (error) {
|
|
4926
|
-
|
|
4963
|
+
toast10.error(error.message);
|
|
4927
4964
|
} finally {
|
|
4928
4965
|
if (docType === "id") {
|
|
4929
4966
|
setGlobalExtractingId(false);
|
|
@@ -5006,10 +5043,10 @@ var UniversalRegistrationFlow = ({
|
|
|
5006
5043
|
}
|
|
5007
5044
|
const data = await baseApi("submit", finalJsonPayload);
|
|
5008
5045
|
if (data.success) {
|
|
5009
|
-
|
|
5046
|
+
toast10.success("Application Submitted!");
|
|
5010
5047
|
onRedirectToApplication(applicationId);
|
|
5011
5048
|
} else {
|
|
5012
|
-
|
|
5049
|
+
toast10.error(data.error || "Uh oh! Something went wrong.");
|
|
5013
5050
|
setIsSubmitting(false);
|
|
5014
5051
|
}
|
|
5015
5052
|
};
|
|
@@ -5058,7 +5095,7 @@ var UniversalRegistrationFlow = ({
|
|
|
5058
5095
|
|
|
5059
5096
|
// src/components/UniversalDeveloperSettings.tsx
|
|
5060
5097
|
import React54, { useState as useState33, useEffect as useEffect22 } from "react";
|
|
5061
|
-
import { toast as
|
|
5098
|
+
import { toast as toast11 } from "react-hot-toast";
|
|
5062
5099
|
import { HugeiconsIcon as HugeiconsIcon37 } from "@hugeicons/react";
|
|
5063
5100
|
import { Loading03Icon as Loading03Icon19, CircleLock02Icon as CircleLock02Icon5 } from "@hugeicons/core-free-icons";
|
|
5064
5101
|
var ButtonSpinner5 = () => /* @__PURE__ */ React54.createElement(HugeiconsIcon37, { icon: Loading03Icon19, size: 16, className: "animate-spin text-current" });
|
|
@@ -5105,13 +5142,13 @@ SECRET_KEY="${secKey}"
|
|
|
5105
5142
|
if (res.success && res.data) {
|
|
5106
5143
|
setPublicKey(res.data.publicKey);
|
|
5107
5144
|
downloadEnvironmentFile(res.data.publicKey, res.data.secretKey);
|
|
5108
|
-
|
|
5145
|
+
toast11.success("Keys generated. Check your downloads folder.");
|
|
5109
5146
|
setIsRollModalOpen(false);
|
|
5110
5147
|
} else {
|
|
5111
|
-
|
|
5148
|
+
toast11.error(res.error || "Uh oh! Something went wrong.");
|
|
5112
5149
|
}
|
|
5113
5150
|
} catch (error) {
|
|
5114
|
-
|
|
5151
|
+
toast11.error("Uh oh! Something went wrong.");
|
|
5115
5152
|
} finally {
|
|
5116
5153
|
setIsGenerating(false);
|
|
5117
5154
|
}
|
|
@@ -5124,12 +5161,12 @@ SECRET_KEY="${secKey}"
|
|
|
5124
5161
|
const res = await onSaveWebhook(webhookUrl);
|
|
5125
5162
|
if (res.success && res.data) {
|
|
5126
5163
|
setWebhookUrl(res.data.webhookUrl || "");
|
|
5127
|
-
|
|
5164
|
+
toast11.success("Webhook URL updated.");
|
|
5128
5165
|
} else {
|
|
5129
|
-
|
|
5166
|
+
toast11.error(res.error || "Uh oh! Something went wrong.");
|
|
5130
5167
|
}
|
|
5131
5168
|
} catch (error) {
|
|
5132
|
-
|
|
5169
|
+
toast11.error("Uh oh! Something went wrong.");
|
|
5133
5170
|
} finally {
|
|
5134
5171
|
setIsSavingWebhook(false);
|
|
5135
5172
|
}
|