@unifold/connect-react 0.1.8 → 0.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 +1200 -1120
- package/dist/index.mjs +1160 -1080
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1159,7 +1159,7 @@ __export(index_exports, {
|
|
|
1159
1159
|
module.exports = __toCommonJS(index_exports);
|
|
1160
1160
|
|
|
1161
1161
|
// src/provider.tsx
|
|
1162
|
-
var
|
|
1162
|
+
var import_react15 = __toESM(require("react"));
|
|
1163
1163
|
|
|
1164
1164
|
// ../react-provider/dist/index.mjs
|
|
1165
1165
|
var import_react = require("react");
|
|
@@ -1269,25 +1269,12 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
1269
1269
|
return Component;
|
|
1270
1270
|
};
|
|
1271
1271
|
|
|
1272
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-down-circle.js
|
|
1273
|
-
var ArrowDownCircle = createLucideIcon("ArrowDownCircle", [
|
|
1274
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1275
|
-
["path", { d: "M12 8v8", key: "napkw2" }],
|
|
1276
|
-
["path", { d: "m8 12 4 4 4-4", key: "k98ssh" }]
|
|
1277
|
-
]);
|
|
1278
|
-
|
|
1279
1272
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-left.js
|
|
1280
1273
|
var ArrowLeft = createLucideIcon("ArrowLeft", [
|
|
1281
1274
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
1282
1275
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
1283
1276
|
]);
|
|
1284
1277
|
|
|
1285
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check-circle.js
|
|
1286
|
-
var CheckCircle = createLucideIcon("CheckCircle", [
|
|
1287
|
-
["path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14", key: "g774vq" }],
|
|
1288
|
-
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
1289
|
-
]);
|
|
1290
|
-
|
|
1291
1278
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js
|
|
1292
1279
|
var Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
1293
1280
|
|
|
@@ -1310,12 +1297,6 @@ var Clock = createLucideIcon("Clock", [
|
|
|
1310
1297
|
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
1311
1298
|
]);
|
|
1312
1299
|
|
|
1313
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js
|
|
1314
|
-
var Copy = createLucideIcon("Copy", [
|
|
1315
|
-
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
1316
|
-
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
1317
|
-
]);
|
|
1318
|
-
|
|
1319
1300
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/credit-card.js
|
|
1320
1301
|
var CreditCard = createLucideIcon("CreditCard", [
|
|
1321
1302
|
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
|
|
@@ -5967,9 +5948,227 @@ var import_qr_code_styling = __toESM(require_qr_code_styling(), 1);
|
|
|
5967
5948
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
5968
5949
|
var import_react10 = require("react");
|
|
5969
5950
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
5951
|
+
|
|
5952
|
+
// ../core/dist/index.mjs
|
|
5953
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
5954
|
+
var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
|
|
5955
|
+
var DEFAULT_PUBLISHABLE_KEY = "pk_test_123";
|
|
5956
|
+
var DEFAULT_CONFIG = {};
|
|
5957
|
+
function validatePublishableKey(key) {
|
|
5958
|
+
if (!key || key.trim() === "") {
|
|
5959
|
+
throw new Error(
|
|
5960
|
+
"Unifold SDK: No publishable key configured. Please provide a valid publishable key via setApiConfig() or pass it directly to the API function."
|
|
5961
|
+
);
|
|
5962
|
+
}
|
|
5963
|
+
if (key === "pk_test_123") {
|
|
5964
|
+
console.warn(
|
|
5965
|
+
'Unifold SDK: Using default test key "pk_test_123". This should only be used for local development. Please use a real publishable key in production.'
|
|
5966
|
+
);
|
|
5967
|
+
}
|
|
5968
|
+
}
|
|
5969
|
+
function getIconUrl(iconPath) {
|
|
5970
|
+
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
5971
|
+
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
5972
|
+
}
|
|
5973
|
+
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
5974
|
+
if (!assetCdnUrl) {
|
|
5975
|
+
return getIconUrl(iconPath);
|
|
5976
|
+
}
|
|
5977
|
+
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
5978
|
+
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
5979
|
+
return `${baseUrl}/api/public${normalizedPath}`;
|
|
5980
|
+
}
|
|
5981
|
+
async function createDepositAddress(overrides, publishableKey) {
|
|
5982
|
+
if (!overrides?.external_user_id) {
|
|
5983
|
+
throw new Error("external_user_id is required");
|
|
5984
|
+
}
|
|
5985
|
+
const payload = {
|
|
5986
|
+
external_user_id: overrides.external_user_id,
|
|
5987
|
+
destination_chain_type: overrides?.destination_chain_type || "ethereum",
|
|
5988
|
+
destination_chain_id: overrides?.destination_chain_id || DEFAULT_CONFIG.destinationChainId || "8453",
|
|
5989
|
+
destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
5990
|
+
recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
|
|
5991
|
+
client_metadata: overrides?.client_metadata || {}
|
|
5992
|
+
};
|
|
5993
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
5994
|
+
validatePublishableKey(pk);
|
|
5995
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/deposit_addresses`, {
|
|
5996
|
+
method: "POST",
|
|
5997
|
+
headers: {
|
|
5998
|
+
accept: "application/json",
|
|
5999
|
+
"x-publishable-key": pk,
|
|
6000
|
+
"Content-Type": "application/json"
|
|
6001
|
+
},
|
|
6002
|
+
body: JSON.stringify(payload)
|
|
6003
|
+
});
|
|
6004
|
+
if (!response.ok) {
|
|
6005
|
+
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
6006
|
+
}
|
|
6007
|
+
return response.json();
|
|
6008
|
+
}
|
|
6009
|
+
function getWalletByChainType(wallets, chainType) {
|
|
6010
|
+
return wallets.find((wallet) => wallet.chain_type === chainType);
|
|
6011
|
+
}
|
|
6012
|
+
var ExecutionStatus = /* @__PURE__ */ ((ExecutionStatus2) => {
|
|
6013
|
+
ExecutionStatus2["DELAYED"] = "delayed";
|
|
6014
|
+
ExecutionStatus2["FAILED"] = "failed";
|
|
6015
|
+
ExecutionStatus2["PENDING"] = "pending";
|
|
6016
|
+
ExecutionStatus2["REFUNDED"] = "refunded";
|
|
6017
|
+
ExecutionStatus2["SUCCEEDED"] = "succeeded";
|
|
6018
|
+
ExecutionStatus2["WAITING"] = "waiting";
|
|
6019
|
+
return ExecutionStatus2;
|
|
6020
|
+
})(ExecutionStatus || {});
|
|
6021
|
+
async function queryExecutions(externalUserId, publishableKey) {
|
|
6022
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6023
|
+
validatePublishableKey(pk);
|
|
6024
|
+
const response = await fetch(
|
|
6025
|
+
`${API_BASE_URL}/v1/public/direct_executions/query`,
|
|
6026
|
+
{
|
|
6027
|
+
method: "POST",
|
|
6028
|
+
headers: {
|
|
6029
|
+
accept: "application/json",
|
|
6030
|
+
"x-publishable-key": pk,
|
|
6031
|
+
"Content-Type": "application/json"
|
|
6032
|
+
},
|
|
6033
|
+
body: JSON.stringify({
|
|
6034
|
+
external_user_id: externalUserId
|
|
6035
|
+
})
|
|
6036
|
+
}
|
|
6037
|
+
);
|
|
6038
|
+
if (!response.ok) {
|
|
6039
|
+
throw new Error(`Failed to query executions: ${response.statusText}`);
|
|
6040
|
+
}
|
|
6041
|
+
return response.json();
|
|
6042
|
+
}
|
|
6043
|
+
async function getSupportedDepositTokens(publishableKey) {
|
|
6044
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6045
|
+
validatePublishableKey(pk);
|
|
6046
|
+
const response = await fetch(
|
|
6047
|
+
`${API_BASE_URL}/v1/public/tokens/supported_deposit_tokens`,
|
|
6048
|
+
{
|
|
6049
|
+
method: "GET",
|
|
6050
|
+
headers: {
|
|
6051
|
+
accept: "application/json",
|
|
6052
|
+
"x-publishable-key": pk
|
|
6053
|
+
}
|
|
6054
|
+
}
|
|
6055
|
+
);
|
|
6056
|
+
if (!response.ok) {
|
|
6057
|
+
throw new Error(
|
|
6058
|
+
`Failed to fetch supported deposit tokens: ${response.statusText}`
|
|
6059
|
+
);
|
|
6060
|
+
}
|
|
6061
|
+
return response.json();
|
|
6062
|
+
}
|
|
6063
|
+
async function getMeldQuotes(request, publishableKey) {
|
|
6064
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6065
|
+
validatePublishableKey(pk);
|
|
6066
|
+
const response = await fetch(
|
|
6067
|
+
`${API_BASE_URL}/v1/public/onramps/meld/quotes`,
|
|
6068
|
+
{
|
|
6069
|
+
method: "POST",
|
|
6070
|
+
headers: {
|
|
6071
|
+
accept: "application/json",
|
|
6072
|
+
"x-publishable-key": pk,
|
|
6073
|
+
"Content-Type": "application/json"
|
|
6074
|
+
},
|
|
6075
|
+
body: JSON.stringify(request)
|
|
6076
|
+
}
|
|
6077
|
+
);
|
|
6078
|
+
if (!response.ok) {
|
|
6079
|
+
throw new Error(`Failed to fetch Meld quotes: ${response.statusText}`);
|
|
6080
|
+
}
|
|
6081
|
+
return response.json();
|
|
6082
|
+
}
|
|
6083
|
+
async function createMeldSession(request, publishableKey) {
|
|
6084
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6085
|
+
validatePublishableKey(pk);
|
|
6086
|
+
const response = await fetch(
|
|
6087
|
+
`${API_BASE_URL}/v1/public/onramps/meld/sessions`,
|
|
6088
|
+
{
|
|
6089
|
+
method: "POST",
|
|
6090
|
+
headers: {
|
|
6091
|
+
accept: "application/json",
|
|
6092
|
+
"x-publishable-key": pk,
|
|
6093
|
+
"Content-Type": "application/json"
|
|
6094
|
+
},
|
|
6095
|
+
body: JSON.stringify(request)
|
|
6096
|
+
}
|
|
6097
|
+
);
|
|
6098
|
+
if (!response.ok) {
|
|
6099
|
+
throw new Error(`Failed to create Meld session: ${response.statusText}`);
|
|
6100
|
+
}
|
|
6101
|
+
return response.json();
|
|
6102
|
+
}
|
|
6103
|
+
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
6104
|
+
if (!iconUrls || iconUrls.length === 0) {
|
|
6105
|
+
return void 0;
|
|
6106
|
+
}
|
|
6107
|
+
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
6108
|
+
if (preferred) {
|
|
6109
|
+
return preferred.url;
|
|
6110
|
+
}
|
|
6111
|
+
return iconUrls[0]?.url;
|
|
6112
|
+
}
|
|
6113
|
+
async function getFiatCurrencies(publishableKey) {
|
|
6114
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6115
|
+
validatePublishableKey(pk);
|
|
6116
|
+
const response = await fetch(
|
|
6117
|
+
`${API_BASE_URL}/v1/public/onramps/fiat_currencies`,
|
|
6118
|
+
{
|
|
6119
|
+
method: "GET",
|
|
6120
|
+
headers: {
|
|
6121
|
+
accept: "application/json",
|
|
6122
|
+
"x-publishable-key": pk
|
|
6123
|
+
}
|
|
6124
|
+
}
|
|
6125
|
+
);
|
|
6126
|
+
if (!response.ok) {
|
|
6127
|
+
throw new Error(`Failed to fetch fiat currencies: ${response.statusText}`);
|
|
6128
|
+
}
|
|
6129
|
+
return response.json();
|
|
6130
|
+
}
|
|
6131
|
+
async function getTokenChains() {
|
|
6132
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/tokens/chains`, {
|
|
6133
|
+
method: "GET",
|
|
6134
|
+
headers: {
|
|
6135
|
+
accept: "application/json"
|
|
6136
|
+
}
|
|
6137
|
+
});
|
|
6138
|
+
if (!response.ok) {
|
|
6139
|
+
throw new Error(`Failed to fetch token chains: ${response.statusText}`);
|
|
6140
|
+
}
|
|
6141
|
+
return response.json();
|
|
6142
|
+
}
|
|
6143
|
+
function getChainName(chains, chainType, chainId) {
|
|
6144
|
+
const byId = chains.find((c) => c.chain_id === chainId);
|
|
6145
|
+
if (byId) return byId.chain_name;
|
|
6146
|
+
const byType = chains.find((c) => c.chain_type === chainType);
|
|
6147
|
+
if (byType) return byType.chain_name;
|
|
6148
|
+
return chainType.charAt(0).toUpperCase() + chainType.slice(1);
|
|
6149
|
+
}
|
|
6150
|
+
async function getProjectConfig(publishableKey) {
|
|
6151
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6152
|
+
validatePublishableKey(pk);
|
|
6153
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
6154
|
+
method: "GET",
|
|
6155
|
+
headers: {
|
|
6156
|
+
accept: "application/json",
|
|
6157
|
+
"x-publishable-key": pk
|
|
6158
|
+
}
|
|
6159
|
+
});
|
|
6160
|
+
if (!response.ok) {
|
|
6161
|
+
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
6162
|
+
}
|
|
6163
|
+
return response.json();
|
|
6164
|
+
}
|
|
6165
|
+
|
|
6166
|
+
// ../ui-react/dist/index.mjs
|
|
5970
6167
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
6168
|
+
var import_react11 = require("react");
|
|
5971
6169
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
5972
6170
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
6171
|
+
var import_react12 = require("react");
|
|
5973
6172
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
5974
6173
|
var React38 = __toESM(require("react"), 1);
|
|
5975
6174
|
|
|
@@ -9465,202 +9664,55 @@ var Separator = SelectSeparator;
|
|
|
9465
9664
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9466
9665
|
var React42 = __toESM(require("react"), 1);
|
|
9467
9666
|
|
|
9468
|
-
// ../../node_modules/.pnpm/@radix-ui+react-
|
|
9667
|
+
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3_hd4qp76o7ebwsrfrhqb6isuuvy/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
9469
9668
|
var React35 = __toESM(require("react"), 1);
|
|
9470
9669
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
9471
|
-
var
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
if (children.type !== React35.Fragment) {
|
|
9518
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
9519
|
-
}
|
|
9520
|
-
return React35.cloneElement(children, props2);
|
|
9521
|
-
}
|
|
9522
|
-
return React35.Children.count(children) > 1 ? React35.Children.only(null) : null;
|
|
9523
|
-
});
|
|
9524
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
9525
|
-
return SlotClone;
|
|
9526
|
-
}
|
|
9527
|
-
var SLOTTABLE_IDENTIFIER2 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
9528
|
-
function isSlottable2(child) {
|
|
9529
|
-
return React35.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
9530
|
-
}
|
|
9531
|
-
function mergeProps2(slotProps, childProps) {
|
|
9532
|
-
const overrideProps = { ...childProps };
|
|
9533
|
-
for (const propName in childProps) {
|
|
9534
|
-
const slotPropValue = slotProps[propName];
|
|
9535
|
-
const childPropValue = childProps[propName];
|
|
9536
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
9537
|
-
if (isHandler) {
|
|
9538
|
-
if (slotPropValue && childPropValue) {
|
|
9539
|
-
overrideProps[propName] = (...args) => {
|
|
9540
|
-
const result = childPropValue(...args);
|
|
9541
|
-
slotPropValue(...args);
|
|
9542
|
-
return result;
|
|
9543
|
-
};
|
|
9544
|
-
} else if (slotPropValue) {
|
|
9545
|
-
overrideProps[propName] = slotPropValue;
|
|
9546
|
-
}
|
|
9547
|
-
} else if (propName === "style") {
|
|
9548
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
9549
|
-
} else if (propName === "className") {
|
|
9550
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
9551
|
-
}
|
|
9552
|
-
}
|
|
9553
|
-
return { ...slotProps, ...overrideProps };
|
|
9554
|
-
}
|
|
9555
|
-
function getElementRef3(element) {
|
|
9556
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
9557
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9558
|
-
if (mayWarn) {
|
|
9559
|
-
return element.ref;
|
|
9560
|
-
}
|
|
9561
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
9562
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9563
|
-
if (mayWarn) {
|
|
9564
|
-
return element.props.ref;
|
|
9565
|
-
}
|
|
9566
|
-
return element.props.ref || element.ref;
|
|
9567
|
-
}
|
|
9568
|
-
|
|
9569
|
-
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
9570
|
-
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
9571
|
-
var cx = clsx;
|
|
9572
|
-
var cva = (base, config) => (props) => {
|
|
9573
|
-
var _config_compoundVariants;
|
|
9574
|
-
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9575
|
-
const { variants, defaultVariants } = config;
|
|
9576
|
-
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
9577
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
9578
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
9579
|
-
if (variantProp === null) return null;
|
|
9580
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
9581
|
-
return variants[variant][variantKey];
|
|
9582
|
-
});
|
|
9583
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
9584
|
-
let [key, value] = param;
|
|
9585
|
-
if (value === void 0) {
|
|
9586
|
-
return acc;
|
|
9587
|
-
}
|
|
9588
|
-
acc[key] = value;
|
|
9589
|
-
return acc;
|
|
9590
|
-
}, {});
|
|
9591
|
-
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
9592
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
9593
|
-
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
9594
|
-
let [key, value] = param2;
|
|
9595
|
-
return Array.isArray(value) ? value.includes({
|
|
9596
|
-
...defaultVariants,
|
|
9597
|
-
...propsWithoutUndefined
|
|
9598
|
-
}[key]) : {
|
|
9599
|
-
...defaultVariants,
|
|
9600
|
-
...propsWithoutUndefined
|
|
9601
|
-
}[key] === value;
|
|
9602
|
-
}) ? [
|
|
9603
|
-
...acc,
|
|
9604
|
-
cvClass,
|
|
9605
|
-
cvClassName
|
|
9606
|
-
] : acc;
|
|
9607
|
-
}, []);
|
|
9608
|
-
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9609
|
-
};
|
|
9610
|
-
|
|
9611
|
-
// ../ui-react/dist/index.mjs
|
|
9612
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
9613
|
-
var React52 = __toESM(require("react"), 1);
|
|
9614
|
-
|
|
9615
|
-
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3_hd4qp76o7ebwsrfrhqb6isuuvy/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
9616
|
-
var React36 = __toESM(require("react"), 1);
|
|
9617
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
9618
|
-
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
9619
|
-
createPopperScope
|
|
9620
|
-
]);
|
|
9621
|
-
var usePopperScope2 = createPopperScope();
|
|
9622
|
-
var PROVIDER_NAME = "TooltipProvider";
|
|
9623
|
-
var DEFAULT_DELAY_DURATION = 700;
|
|
9624
|
-
var TOOLTIP_OPEN = "tooltip.open";
|
|
9625
|
-
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
|
9626
|
-
var TooltipProvider = (props) => {
|
|
9627
|
-
const {
|
|
9628
|
-
__scopeTooltip,
|
|
9629
|
-
delayDuration = DEFAULT_DELAY_DURATION,
|
|
9630
|
-
skipDelayDuration = 300,
|
|
9631
|
-
disableHoverableContent = false,
|
|
9632
|
-
children
|
|
9633
|
-
} = props;
|
|
9634
|
-
const isOpenDelayedRef = React36.useRef(true);
|
|
9635
|
-
const isPointerInTransitRef = React36.useRef(false);
|
|
9636
|
-
const skipDelayTimerRef = React36.useRef(0);
|
|
9637
|
-
React36.useEffect(() => {
|
|
9638
|
-
const skipDelayTimer = skipDelayTimerRef.current;
|
|
9639
|
-
return () => window.clearTimeout(skipDelayTimer);
|
|
9640
|
-
}, []);
|
|
9641
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9642
|
-
TooltipProviderContextProvider,
|
|
9643
|
-
{
|
|
9644
|
-
scope: __scopeTooltip,
|
|
9645
|
-
isOpenDelayedRef,
|
|
9646
|
-
delayDuration,
|
|
9647
|
-
onOpen: React36.useCallback(() => {
|
|
9648
|
-
window.clearTimeout(skipDelayTimerRef.current);
|
|
9649
|
-
isOpenDelayedRef.current = false;
|
|
9650
|
-
}, []),
|
|
9651
|
-
onClose: React36.useCallback(() => {
|
|
9652
|
-
window.clearTimeout(skipDelayTimerRef.current);
|
|
9653
|
-
skipDelayTimerRef.current = window.setTimeout(
|
|
9654
|
-
() => isOpenDelayedRef.current = true,
|
|
9655
|
-
skipDelayDuration
|
|
9656
|
-
);
|
|
9657
|
-
}, [skipDelayDuration]),
|
|
9658
|
-
isPointerInTransitRef,
|
|
9659
|
-
onPointerInTransitChange: React36.useCallback((inTransit) => {
|
|
9660
|
-
isPointerInTransitRef.current = inTransit;
|
|
9661
|
-
}, []),
|
|
9662
|
-
disableHoverableContent,
|
|
9663
|
-
children
|
|
9670
|
+
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
9671
|
+
createPopperScope
|
|
9672
|
+
]);
|
|
9673
|
+
var usePopperScope2 = createPopperScope();
|
|
9674
|
+
var PROVIDER_NAME = "TooltipProvider";
|
|
9675
|
+
var DEFAULT_DELAY_DURATION = 700;
|
|
9676
|
+
var TOOLTIP_OPEN = "tooltip.open";
|
|
9677
|
+
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
|
9678
|
+
var TooltipProvider = (props) => {
|
|
9679
|
+
const {
|
|
9680
|
+
__scopeTooltip,
|
|
9681
|
+
delayDuration = DEFAULT_DELAY_DURATION,
|
|
9682
|
+
skipDelayDuration = 300,
|
|
9683
|
+
disableHoverableContent = false,
|
|
9684
|
+
children
|
|
9685
|
+
} = props;
|
|
9686
|
+
const isOpenDelayedRef = React35.useRef(true);
|
|
9687
|
+
const isPointerInTransitRef = React35.useRef(false);
|
|
9688
|
+
const skipDelayTimerRef = React35.useRef(0);
|
|
9689
|
+
React35.useEffect(() => {
|
|
9690
|
+
const skipDelayTimer = skipDelayTimerRef.current;
|
|
9691
|
+
return () => window.clearTimeout(skipDelayTimer);
|
|
9692
|
+
}, []);
|
|
9693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9694
|
+
TooltipProviderContextProvider,
|
|
9695
|
+
{
|
|
9696
|
+
scope: __scopeTooltip,
|
|
9697
|
+
isOpenDelayedRef,
|
|
9698
|
+
delayDuration,
|
|
9699
|
+
onOpen: React35.useCallback(() => {
|
|
9700
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
9701
|
+
isOpenDelayedRef.current = false;
|
|
9702
|
+
}, []),
|
|
9703
|
+
onClose: React35.useCallback(() => {
|
|
9704
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
9705
|
+
skipDelayTimerRef.current = window.setTimeout(
|
|
9706
|
+
() => isOpenDelayedRef.current = true,
|
|
9707
|
+
skipDelayDuration
|
|
9708
|
+
);
|
|
9709
|
+
}, [skipDelayDuration]),
|
|
9710
|
+
isPointerInTransitRef,
|
|
9711
|
+
onPointerInTransitChange: React35.useCallback((inTransit) => {
|
|
9712
|
+
isPointerInTransitRef.current = inTransit;
|
|
9713
|
+
}, []),
|
|
9714
|
+
disableHoverableContent,
|
|
9715
|
+
children
|
|
9664
9716
|
}
|
|
9665
9717
|
);
|
|
9666
9718
|
};
|
|
@@ -9679,12 +9731,12 @@ var Tooltip = (props) => {
|
|
|
9679
9731
|
} = props;
|
|
9680
9732
|
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
|
9681
9733
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9682
|
-
const [trigger, setTrigger] =
|
|
9734
|
+
const [trigger, setTrigger] = React35.useState(null);
|
|
9683
9735
|
const contentId = useId();
|
|
9684
|
-
const openTimerRef =
|
|
9736
|
+
const openTimerRef = React35.useRef(0);
|
|
9685
9737
|
const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
|
|
9686
9738
|
const delayDuration = delayDurationProp ?? providerContext.delayDuration;
|
|
9687
|
-
const wasOpenDelayedRef =
|
|
9739
|
+
const wasOpenDelayedRef = React35.useRef(false);
|
|
9688
9740
|
const [open, setOpen] = useControllableState({
|
|
9689
9741
|
prop: openProp,
|
|
9690
9742
|
defaultProp: defaultOpen ?? false,
|
|
@@ -9699,21 +9751,21 @@ var Tooltip = (props) => {
|
|
|
9699
9751
|
},
|
|
9700
9752
|
caller: TOOLTIP_NAME
|
|
9701
9753
|
});
|
|
9702
|
-
const stateAttribute =
|
|
9754
|
+
const stateAttribute = React35.useMemo(() => {
|
|
9703
9755
|
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
9704
9756
|
}, [open]);
|
|
9705
|
-
const handleOpen =
|
|
9757
|
+
const handleOpen = React35.useCallback(() => {
|
|
9706
9758
|
window.clearTimeout(openTimerRef.current);
|
|
9707
9759
|
openTimerRef.current = 0;
|
|
9708
9760
|
wasOpenDelayedRef.current = false;
|
|
9709
9761
|
setOpen(true);
|
|
9710
9762
|
}, [setOpen]);
|
|
9711
|
-
const handleClose =
|
|
9763
|
+
const handleClose = React35.useCallback(() => {
|
|
9712
9764
|
window.clearTimeout(openTimerRef.current);
|
|
9713
9765
|
openTimerRef.current = 0;
|
|
9714
9766
|
setOpen(false);
|
|
9715
9767
|
}, [setOpen]);
|
|
9716
|
-
const handleDelayedOpen =
|
|
9768
|
+
const handleDelayedOpen = React35.useCallback(() => {
|
|
9717
9769
|
window.clearTimeout(openTimerRef.current);
|
|
9718
9770
|
openTimerRef.current = window.setTimeout(() => {
|
|
9719
9771
|
wasOpenDelayedRef.current = true;
|
|
@@ -9721,7 +9773,7 @@ var Tooltip = (props) => {
|
|
|
9721
9773
|
openTimerRef.current = 0;
|
|
9722
9774
|
}, delayDuration);
|
|
9723
9775
|
}, [delayDuration, setOpen]);
|
|
9724
|
-
|
|
9776
|
+
React35.useEffect(() => {
|
|
9725
9777
|
return () => {
|
|
9726
9778
|
if (openTimerRef.current) {
|
|
9727
9779
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -9729,7 +9781,7 @@ var Tooltip = (props) => {
|
|
|
9729
9781
|
}
|
|
9730
9782
|
};
|
|
9731
9783
|
}, []);
|
|
9732
|
-
return /* @__PURE__ */ (0,
|
|
9784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Root22, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9733
9785
|
TooltipContextProvider,
|
|
9734
9786
|
{
|
|
9735
9787
|
scope: __scopeTooltip,
|
|
@@ -9738,11 +9790,11 @@ var Tooltip = (props) => {
|
|
|
9738
9790
|
stateAttribute,
|
|
9739
9791
|
trigger,
|
|
9740
9792
|
onTriggerChange: setTrigger,
|
|
9741
|
-
onTriggerEnter:
|
|
9793
|
+
onTriggerEnter: React35.useCallback(() => {
|
|
9742
9794
|
if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
|
|
9743
9795
|
else handleOpen();
|
|
9744
9796
|
}, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
|
|
9745
|
-
onTriggerLeave:
|
|
9797
|
+
onTriggerLeave: React35.useCallback(() => {
|
|
9746
9798
|
if (disableHoverableContent) {
|
|
9747
9799
|
handleClose();
|
|
9748
9800
|
} else {
|
|
@@ -9759,21 +9811,21 @@ var Tooltip = (props) => {
|
|
|
9759
9811
|
};
|
|
9760
9812
|
Tooltip.displayName = TOOLTIP_NAME;
|
|
9761
9813
|
var TRIGGER_NAME3 = "TooltipTrigger";
|
|
9762
|
-
var TooltipTrigger =
|
|
9814
|
+
var TooltipTrigger = React35.forwardRef(
|
|
9763
9815
|
(props, forwardedRef) => {
|
|
9764
9816
|
const { __scopeTooltip, ...triggerProps } = props;
|
|
9765
9817
|
const context = useTooltipContext(TRIGGER_NAME3, __scopeTooltip);
|
|
9766
9818
|
const providerContext = useTooltipProviderContext(TRIGGER_NAME3, __scopeTooltip);
|
|
9767
9819
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9768
|
-
const ref =
|
|
9820
|
+
const ref = React35.useRef(null);
|
|
9769
9821
|
const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);
|
|
9770
|
-
const isPointerDownRef =
|
|
9771
|
-
const hasPointerMoveOpenedRef =
|
|
9772
|
-
const handlePointerUp =
|
|
9773
|
-
|
|
9822
|
+
const isPointerDownRef = React35.useRef(false);
|
|
9823
|
+
const hasPointerMoveOpenedRef = React35.useRef(false);
|
|
9824
|
+
const handlePointerUp = React35.useCallback(() => isPointerDownRef.current = false, []);
|
|
9825
|
+
React35.useEffect(() => {
|
|
9774
9826
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
9775
9827
|
}, [handlePointerUp]);
|
|
9776
|
-
return /* @__PURE__ */ (0,
|
|
9828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9777
9829
|
Primitive.button,
|
|
9778
9830
|
{
|
|
9779
9831
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
@@ -9815,32 +9867,32 @@ var [PortalProvider2, usePortalContext2] = createTooltipContext(PORTAL_NAME4, {
|
|
|
9815
9867
|
var TooltipPortal = (props) => {
|
|
9816
9868
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
9817
9869
|
const context = useTooltipContext(PORTAL_NAME4, __scopeTooltip);
|
|
9818
|
-
return /* @__PURE__ */ (0,
|
|
9870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PortalProvider2, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Portal, { asChild: true, container, children }) }) });
|
|
9819
9871
|
};
|
|
9820
9872
|
TooltipPortal.displayName = PORTAL_NAME4;
|
|
9821
9873
|
var CONTENT_NAME4 = "TooltipContent";
|
|
9822
|
-
var TooltipContent =
|
|
9874
|
+
var TooltipContent = React35.forwardRef(
|
|
9823
9875
|
(props, forwardedRef) => {
|
|
9824
9876
|
const portalContext = usePortalContext2(CONTENT_NAME4, props.__scopeTooltip);
|
|
9825
9877
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
9826
9878
|
const context = useTooltipContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9827
|
-
return /* @__PURE__ */ (0,
|
|
9879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
9828
9880
|
}
|
|
9829
9881
|
);
|
|
9830
|
-
var TooltipContentHoverable =
|
|
9882
|
+
var TooltipContentHoverable = React35.forwardRef((props, forwardedRef) => {
|
|
9831
9883
|
const context = useTooltipContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9832
9884
|
const providerContext = useTooltipProviderContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9833
|
-
const ref =
|
|
9885
|
+
const ref = React35.useRef(null);
|
|
9834
9886
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
9835
|
-
const [pointerGraceArea, setPointerGraceArea] =
|
|
9887
|
+
const [pointerGraceArea, setPointerGraceArea] = React35.useState(null);
|
|
9836
9888
|
const { trigger, onClose } = context;
|
|
9837
9889
|
const content = ref.current;
|
|
9838
9890
|
const { onPointerInTransitChange } = providerContext;
|
|
9839
|
-
const handleRemoveGraceArea =
|
|
9891
|
+
const handleRemoveGraceArea = React35.useCallback(() => {
|
|
9840
9892
|
setPointerGraceArea(null);
|
|
9841
9893
|
onPointerInTransitChange(false);
|
|
9842
9894
|
}, [onPointerInTransitChange]);
|
|
9843
|
-
const handleCreateGraceArea =
|
|
9895
|
+
const handleCreateGraceArea = React35.useCallback(
|
|
9844
9896
|
(event, hoverTarget) => {
|
|
9845
9897
|
const currentTarget = event.currentTarget;
|
|
9846
9898
|
const exitPoint = { x: event.clientX, y: event.clientY };
|
|
@@ -9853,10 +9905,10 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9853
9905
|
},
|
|
9854
9906
|
[onPointerInTransitChange]
|
|
9855
9907
|
);
|
|
9856
|
-
|
|
9908
|
+
React35.useEffect(() => {
|
|
9857
9909
|
return () => handleRemoveGraceArea();
|
|
9858
9910
|
}, [handleRemoveGraceArea]);
|
|
9859
|
-
|
|
9911
|
+
React35.useEffect(() => {
|
|
9860
9912
|
if (trigger && content) {
|
|
9861
9913
|
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
|
9862
9914
|
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
|
@@ -9868,7 +9920,7 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9868
9920
|
};
|
|
9869
9921
|
}
|
|
9870
9922
|
}, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);
|
|
9871
|
-
|
|
9923
|
+
React35.useEffect(() => {
|
|
9872
9924
|
if (pointerGraceArea) {
|
|
9873
9925
|
const handleTrackPointerGrace = (event) => {
|
|
9874
9926
|
const target = event.target;
|
|
@@ -9886,11 +9938,11 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9886
9938
|
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
9887
9939
|
}
|
|
9888
9940
|
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
|
9889
|
-
return /* @__PURE__ */ (0,
|
|
9941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
9890
9942
|
});
|
|
9891
9943
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
9892
9944
|
var Slottable = createSlottable("TooltipContent");
|
|
9893
|
-
var TooltipContentImpl =
|
|
9945
|
+
var TooltipContentImpl = React35.forwardRef(
|
|
9894
9946
|
(props, forwardedRef) => {
|
|
9895
9947
|
const {
|
|
9896
9948
|
__scopeTooltip,
|
|
@@ -9903,11 +9955,11 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9903
9955
|
const context = useTooltipContext(CONTENT_NAME4, __scopeTooltip);
|
|
9904
9956
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9905
9957
|
const { onClose } = context;
|
|
9906
|
-
|
|
9958
|
+
React35.useEffect(() => {
|
|
9907
9959
|
document.addEventListener(TOOLTIP_OPEN, onClose);
|
|
9908
9960
|
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
|
9909
9961
|
}, [onClose]);
|
|
9910
|
-
|
|
9962
|
+
React35.useEffect(() => {
|
|
9911
9963
|
if (context.trigger) {
|
|
9912
9964
|
const handleScroll2 = (event) => {
|
|
9913
9965
|
const target = event.target;
|
|
@@ -9917,7 +9969,7 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9917
9969
|
return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
|
|
9918
9970
|
}
|
|
9919
9971
|
}, [context.trigger, onClose]);
|
|
9920
|
-
return /* @__PURE__ */ (0,
|
|
9972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9921
9973
|
DismissableLayer,
|
|
9922
9974
|
{
|
|
9923
9975
|
asChild: true,
|
|
@@ -9926,7 +9978,7 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9926
9978
|
onPointerDownOutside,
|
|
9927
9979
|
onFocusOutside: (event) => event.preventDefault(),
|
|
9928
9980
|
onDismiss: onClose,
|
|
9929
|
-
children: /* @__PURE__ */ (0,
|
|
9981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
9930
9982
|
Content2,
|
|
9931
9983
|
{
|
|
9932
9984
|
"data-state": context.stateAttribute,
|
|
@@ -9945,8 +9997,8 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9945
9997
|
}
|
|
9946
9998
|
},
|
|
9947
9999
|
children: [
|
|
9948
|
-
/* @__PURE__ */ (0,
|
|
9949
|
-
/* @__PURE__ */ (0,
|
|
10000
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Slottable, { children }),
|
|
10001
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Root3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
9950
10002
|
]
|
|
9951
10003
|
}
|
|
9952
10004
|
)
|
|
@@ -9956,7 +10008,7 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9956
10008
|
);
|
|
9957
10009
|
TooltipContent.displayName = CONTENT_NAME4;
|
|
9958
10010
|
var ARROW_NAME3 = "TooltipArrow";
|
|
9959
|
-
var TooltipArrow =
|
|
10011
|
+
var TooltipArrow = React35.forwardRef(
|
|
9960
10012
|
(props, forwardedRef) => {
|
|
9961
10013
|
const { __scopeTooltip, ...arrowProps } = props;
|
|
9962
10014
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
@@ -9964,7 +10016,7 @@ var TooltipArrow = React36.forwardRef(
|
|
|
9964
10016
|
ARROW_NAME3,
|
|
9965
10017
|
__scopeTooltip
|
|
9966
10018
|
);
|
|
9967
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ (0,
|
|
10019
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
9968
10020
|
}
|
|
9969
10021
|
);
|
|
9970
10022
|
TooltipArrow.displayName = ARROW_NAME3;
|
|
@@ -10090,93 +10142,240 @@ var Portal4 = TooltipPortal;
|
|
|
10090
10142
|
var Content23 = TooltipContent;
|
|
10091
10143
|
|
|
10092
10144
|
// ../ui-react/dist/index.mjs
|
|
10145
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
10093
10146
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
10094
10147
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10148
|
+
var import_react13 = require("react");
|
|
10149
|
+
var import_react14 = require("react");
|
|
10095
10150
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10096
|
-
var import_react11 = require("react");
|
|
10097
|
-
var import_react12 = require("react");
|
|
10098
10151
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10099
10152
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
10153
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
10100
10154
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
10101
|
-
var import_react_query2 = require("@tanstack/react-query");
|
|
10102
10155
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
10103
10156
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
10104
10157
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
10105
10158
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10106
10159
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
10107
|
-
var
|
|
10108
|
-
|
|
10109
|
-
|
|
10160
|
+
var React52 = __toESM(require("react"), 1);
|
|
10161
|
+
|
|
10162
|
+
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@18.3.27_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
10163
|
+
var React36 = __toESM(require("react"), 1);
|
|
10164
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
10165
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
10166
|
+
var use = React36[" use ".trim().toString()];
|
|
10167
|
+
function isPromiseLike(value) {
|
|
10168
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
10110
10169
|
}
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
children,
|
|
10114
|
-
themeClass
|
|
10115
|
-
}) {
|
|
10116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ThemeContext.Provider, { value: { themeClass }, children });
|
|
10170
|
+
function isLazyComponent(element) {
|
|
10171
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
10117
10172
|
}
|
|
10118
|
-
|
|
10119
|
-
|
|
10173
|
+
// @__NO_SIDE_EFFECTS__
|
|
10174
|
+
function createSlot2(ownerName) {
|
|
10175
|
+
const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
10176
|
+
const Slot22 = React36.forwardRef((props, forwardedRef) => {
|
|
10177
|
+
let { children, ...slotProps } = props;
|
|
10178
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
10179
|
+
children = use(children._payload);
|
|
10180
|
+
}
|
|
10181
|
+
const childrenArray = React36.Children.toArray(children);
|
|
10182
|
+
const slottable = childrenArray.find(isSlottable2);
|
|
10183
|
+
if (slottable) {
|
|
10184
|
+
const newElement = slottable.props.children;
|
|
10185
|
+
const newChildren = childrenArray.map((child) => {
|
|
10186
|
+
if (child === slottable) {
|
|
10187
|
+
if (React36.Children.count(newElement) > 1) return React36.Children.only(null);
|
|
10188
|
+
return React36.isValidElement(newElement) ? newElement.props.children : null;
|
|
10189
|
+
} else {
|
|
10190
|
+
return child;
|
|
10191
|
+
}
|
|
10192
|
+
});
|
|
10193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React36.isValidElement(newElement) ? React36.cloneElement(newElement, void 0, newChildren) : null });
|
|
10194
|
+
}
|
|
10195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
10196
|
+
});
|
|
10197
|
+
Slot22.displayName = `${ownerName}.Slot`;
|
|
10198
|
+
return Slot22;
|
|
10120
10199
|
}
|
|
10121
|
-
var
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
const
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
ref,
|
|
10129
|
-
className: cn(
|
|
10130
|
-
themeClass,
|
|
10131
|
-
"uf-fixed uf-inset-0 uf-z-50 uf-bg-black/40 data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10132
|
-
className
|
|
10133
|
-
),
|
|
10134
|
-
...props
|
|
10200
|
+
var Slot3 = /* @__PURE__ */ createSlot2("Slot");
|
|
10201
|
+
// @__NO_SIDE_EFFECTS__
|
|
10202
|
+
function createSlotClone2(ownerName) {
|
|
10203
|
+
const SlotClone = React36.forwardRef((props, forwardedRef) => {
|
|
10204
|
+
let { children, ...slotProps } = props;
|
|
10205
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
10206
|
+
children = use(children._payload);
|
|
10135
10207
|
}
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
{
|
|
10144
|
-
ref,
|
|
10145
|
-
className: cn(
|
|
10146
|
-
// Mobile: bottom-aligned, full-width
|
|
10147
|
-
"uf-fixed uf-bottom-0 uf-left-0 uf-right-0 uf-z-50 uf-grid uf-w-full uf-max-w-full",
|
|
10148
|
-
// Mobile: rounded top corners only
|
|
10149
|
-
"uf-rounded-t-3xl",
|
|
10150
|
-
// Desktop: centered modal (no default max-width, let parent specify)
|
|
10151
|
-
"sm:uf-left-[50%] sm:uf-top-[50%] sm:uf-bottom-auto sm:uf-right-auto sm:uf-translate-x-[-50%] sm:uf-translate-y-[-50%]",
|
|
10152
|
-
// Desktop: rounded all corners
|
|
10153
|
-
"sm:uf-rounded-3xl",
|
|
10154
|
-
// Common styles
|
|
10155
|
-
"uf-gap-4 uf-border uf-bg-background uf-p-6 uf-shadow-lg uf-duration-200",
|
|
10156
|
-
// Animations - mobile slides from bottom
|
|
10157
|
-
"data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out",
|
|
10158
|
-
"data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10159
|
-
"data-[state=closed]:uf-slide-out-to-bottom data-[state=open]:uf-slide-in-from-bottom",
|
|
10160
|
-
// Desktop animations - center zoom
|
|
10161
|
-
"sm:data-[state=closed]:uf-zoom-out-95 sm:data-[state=open]:uf-zoom-in-95",
|
|
10162
|
-
"sm:data-[state=closed]:uf-slide-out-to-left-1/2 sm:data-[state=closed]:uf-slide-out-to-top-[48%]",
|
|
10163
|
-
"sm:data-[state=open]:uf-slide-in-from-left-1/2 sm:data-[state=open]:uf-slide-in-from-top-[48%]",
|
|
10164
|
-
className
|
|
10165
|
-
),
|
|
10166
|
-
...props,
|
|
10167
|
-
children: [
|
|
10168
|
-
children,
|
|
10169
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Close, { className: "uf-absolute uf-right-6 uf-top-6 uf-rounded-sm uf-opacity-70 uf-ring-offset-background uf-transition-opacity hover:uf-opacity-100 focus:uf-outline-none focus:uf-ring-2 focus:uf-ring-ring focus:uf-ring-offset-2 disabled:uf-pointer-events-none data-[state=open]:uf-bg-accent data-[state=open]:uf-text-muted-foreground", children: [
|
|
10170
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(X, { className: "uf-h-6 uf-w-6" }),
|
|
10171
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uf-sr-only", children: "Close" })
|
|
10172
|
-
] })
|
|
10173
|
-
]
|
|
10208
|
+
if (React36.isValidElement(children)) {
|
|
10209
|
+
const childrenRef = getElementRef3(children);
|
|
10210
|
+
const props2 = mergeProps2(slotProps, children.props);
|
|
10211
|
+
if (children.type !== React36.Fragment) {
|
|
10212
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
10213
|
+
}
|
|
10214
|
+
return React36.cloneElement(children, props2);
|
|
10174
10215
|
}
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10216
|
+
return React36.Children.count(children) > 1 ? React36.Children.only(null) : null;
|
|
10217
|
+
});
|
|
10218
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
10219
|
+
return SlotClone;
|
|
10220
|
+
}
|
|
10221
|
+
var SLOTTABLE_IDENTIFIER2 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
10222
|
+
function isSlottable2(child) {
|
|
10223
|
+
return React36.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
10224
|
+
}
|
|
10225
|
+
function mergeProps2(slotProps, childProps) {
|
|
10226
|
+
const overrideProps = { ...childProps };
|
|
10227
|
+
for (const propName in childProps) {
|
|
10228
|
+
const slotPropValue = slotProps[propName];
|
|
10229
|
+
const childPropValue = childProps[propName];
|
|
10230
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
10231
|
+
if (isHandler) {
|
|
10232
|
+
if (slotPropValue && childPropValue) {
|
|
10233
|
+
overrideProps[propName] = (...args) => {
|
|
10234
|
+
const result = childPropValue(...args);
|
|
10235
|
+
slotPropValue(...args);
|
|
10236
|
+
return result;
|
|
10237
|
+
};
|
|
10238
|
+
} else if (slotPropValue) {
|
|
10239
|
+
overrideProps[propName] = slotPropValue;
|
|
10240
|
+
}
|
|
10241
|
+
} else if (propName === "style") {
|
|
10242
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
10243
|
+
} else if (propName === "className") {
|
|
10244
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
10245
|
+
}
|
|
10246
|
+
}
|
|
10247
|
+
return { ...slotProps, ...overrideProps };
|
|
10248
|
+
}
|
|
10249
|
+
function getElementRef3(element) {
|
|
10250
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
10251
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10252
|
+
if (mayWarn) {
|
|
10253
|
+
return element.ref;
|
|
10254
|
+
}
|
|
10255
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
10256
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10257
|
+
if (mayWarn) {
|
|
10258
|
+
return element.props.ref;
|
|
10259
|
+
}
|
|
10260
|
+
return element.props.ref || element.ref;
|
|
10261
|
+
}
|
|
10262
|
+
|
|
10263
|
+
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
10264
|
+
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
10265
|
+
var cx = clsx;
|
|
10266
|
+
var cva = (base, config) => (props) => {
|
|
10267
|
+
var _config_compoundVariants;
|
|
10268
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
10269
|
+
const { variants, defaultVariants } = config;
|
|
10270
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
10271
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
10272
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
10273
|
+
if (variantProp === null) return null;
|
|
10274
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
10275
|
+
return variants[variant][variantKey];
|
|
10276
|
+
});
|
|
10277
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
10278
|
+
let [key, value] = param;
|
|
10279
|
+
if (value === void 0) {
|
|
10280
|
+
return acc;
|
|
10281
|
+
}
|
|
10282
|
+
acc[key] = value;
|
|
10283
|
+
return acc;
|
|
10284
|
+
}, {});
|
|
10285
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
10286
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
10287
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
10288
|
+
let [key, value] = param2;
|
|
10289
|
+
return Array.isArray(value) ? value.includes({
|
|
10290
|
+
...defaultVariants,
|
|
10291
|
+
...propsWithoutUndefined
|
|
10292
|
+
}[key]) : {
|
|
10293
|
+
...defaultVariants,
|
|
10294
|
+
...propsWithoutUndefined
|
|
10295
|
+
}[key] === value;
|
|
10296
|
+
}) ? [
|
|
10297
|
+
...acc,
|
|
10298
|
+
cvClass,
|
|
10299
|
+
cvClassName
|
|
10300
|
+
] : acc;
|
|
10301
|
+
}, []);
|
|
10302
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
10303
|
+
};
|
|
10304
|
+
|
|
10305
|
+
// ../ui-react/dist/index.mjs
|
|
10306
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10307
|
+
function cn(...inputs) {
|
|
10308
|
+
return twMerge(clsx(inputs));
|
|
10309
|
+
}
|
|
10310
|
+
var ThemeContext = React37.createContext({ themeClass: "" });
|
|
10311
|
+
function ThemeProvider({
|
|
10312
|
+
children,
|
|
10313
|
+
themeClass
|
|
10314
|
+
}) {
|
|
10315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ThemeContext.Provider, { value: { themeClass }, children });
|
|
10316
|
+
}
|
|
10317
|
+
function useTheme() {
|
|
10318
|
+
return React37.useContext(ThemeContext);
|
|
10319
|
+
}
|
|
10320
|
+
var Dialog2 = Root;
|
|
10321
|
+
var DialogPortal2 = Portal2;
|
|
10322
|
+
var DialogOverlay2 = React210.forwardRef(({ className, ...props }, ref) => {
|
|
10323
|
+
const { themeClass } = useTheme();
|
|
10324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
10325
|
+
Overlay,
|
|
10326
|
+
{
|
|
10327
|
+
ref,
|
|
10328
|
+
className: cn(
|
|
10329
|
+
themeClass,
|
|
10330
|
+
"uf-fixed uf-inset-0 uf-z-50 uf-bg-black/40 data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10331
|
+
className
|
|
10332
|
+
),
|
|
10333
|
+
...props
|
|
10334
|
+
}
|
|
10335
|
+
);
|
|
10336
|
+
});
|
|
10337
|
+
DialogOverlay2.displayName = Overlay.displayName;
|
|
10338
|
+
var DialogContent2 = React210.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogPortal2, { children: [
|
|
10339
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogOverlay2, {}),
|
|
10340
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
10341
|
+
Content,
|
|
10342
|
+
{
|
|
10343
|
+
ref,
|
|
10344
|
+
className: cn(
|
|
10345
|
+
// Mobile: bottom-aligned, full-width
|
|
10346
|
+
"uf-fixed uf-bottom-0 uf-left-0 uf-right-0 uf-z-50 uf-grid uf-w-full uf-max-w-full",
|
|
10347
|
+
// Mobile: rounded top corners only
|
|
10348
|
+
"uf-rounded-t-3xl",
|
|
10349
|
+
// Desktop: centered modal (no default max-width, let parent specify)
|
|
10350
|
+
"sm:uf-left-[50%] sm:uf-top-[50%] sm:uf-bottom-auto sm:uf-right-auto sm:uf-translate-x-[-50%] sm:uf-translate-y-[-50%]",
|
|
10351
|
+
// Desktop: rounded all corners
|
|
10352
|
+
"sm:uf-rounded-3xl",
|
|
10353
|
+
// Common styles
|
|
10354
|
+
"uf-gap-4 uf-border uf-bg-background uf-p-6 uf-shadow-lg uf-duration-200",
|
|
10355
|
+
// Animations - mobile slides from bottom
|
|
10356
|
+
"data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out",
|
|
10357
|
+
"data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10358
|
+
"data-[state=closed]:uf-slide-out-to-bottom data-[state=open]:uf-slide-in-from-bottom",
|
|
10359
|
+
// Desktop animations - center zoom
|
|
10360
|
+
"sm:data-[state=closed]:uf-zoom-out-95 sm:data-[state=open]:uf-zoom-in-95",
|
|
10361
|
+
"sm:data-[state=closed]:uf-slide-out-to-left-1/2 sm:data-[state=closed]:uf-slide-out-to-top-[48%]",
|
|
10362
|
+
"sm:data-[state=open]:uf-slide-in-from-left-1/2 sm:data-[state=open]:uf-slide-in-from-top-[48%]",
|
|
10363
|
+
className
|
|
10364
|
+
),
|
|
10365
|
+
...props,
|
|
10366
|
+
children: [
|
|
10367
|
+
children,
|
|
10368
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Close, { className: "uf-absolute uf-right-6 uf-top-6 uf-rounded-sm uf-opacity-70 uf-ring-offset-background uf-transition-opacity hover:uf-opacity-100 focus:uf-outline-none focus:uf-ring-2 focus:uf-ring-ring focus:uf-ring-offset-2 disabled:uf-pointer-events-none data-[state=open]:uf-bg-accent data-[state=open]:uf-text-muted-foreground", children: [
|
|
10369
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(X, { className: "uf-h-6 uf-w-6" }),
|
|
10370
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uf-sr-only", children: "Close" })
|
|
10371
|
+
] })
|
|
10372
|
+
]
|
|
10373
|
+
}
|
|
10374
|
+
)
|
|
10375
|
+
] }));
|
|
10376
|
+
DialogContent2.displayName = Content.displayName;
|
|
10377
|
+
var DialogHeader = ({
|
|
10378
|
+
className,
|
|
10180
10379
|
...props
|
|
10181
10380
|
}) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
10182
10381
|
"div",
|
|
@@ -10343,175 +10542,11 @@ function DepositHeader({
|
|
|
10343
10542
|
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-w-5 uf-h-5 uf-invisible" })
|
|
10344
10543
|
] });
|
|
10345
10544
|
}
|
|
10346
|
-
var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
|
|
10347
|
-
var DEFAULT_PUBLISHABLE_KEY = "pk_test_123";
|
|
10348
|
-
var DEFAULT_CONFIG = {};
|
|
10349
|
-
function getIconUrl(iconPath) {
|
|
10350
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
10351
|
-
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
10352
|
-
}
|
|
10353
|
-
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
10354
|
-
if (!assetCdnUrl) {
|
|
10355
|
-
return getIconUrl(iconPath);
|
|
10356
|
-
}
|
|
10357
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
10358
|
-
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
10359
|
-
return `${baseUrl}/api/public${normalizedPath}`;
|
|
10360
|
-
}
|
|
10361
|
-
async function createEOA(overrides, publishableKey) {
|
|
10362
|
-
if (!overrides?.user_id) {
|
|
10363
|
-
throw new Error("user_id is required");
|
|
10364
|
-
}
|
|
10365
|
-
const payload = {
|
|
10366
|
-
user_id: overrides.user_id,
|
|
10367
|
-
destination_chain_type: overrides?.destination_chain_type || "ethereum",
|
|
10368
|
-
destination_chain_id: overrides?.destination_chain_id || DEFAULT_CONFIG.destinationChainId || "8453",
|
|
10369
|
-
destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
10370
|
-
recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
|
|
10371
|
-
client_metadata: overrides?.client_metadata || {}
|
|
10372
|
-
};
|
|
10373
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10374
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/deposit_addresses`, {
|
|
10375
|
-
method: "POST",
|
|
10376
|
-
headers: {
|
|
10377
|
-
accept: "application/json",
|
|
10378
|
-
"x-publishable-key": pk,
|
|
10379
|
-
"Content-Type": "application/json"
|
|
10380
|
-
},
|
|
10381
|
-
body: JSON.stringify(payload)
|
|
10382
|
-
});
|
|
10383
|
-
if (!response.ok) {
|
|
10384
|
-
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
10385
|
-
}
|
|
10386
|
-
return response.json();
|
|
10387
|
-
}
|
|
10388
|
-
function getWalletByChainType(wallets, chainType) {
|
|
10389
|
-
return wallets.find((wallet) => wallet.chain_type === chainType);
|
|
10390
|
-
}
|
|
10391
|
-
async function queryExecutions(externalUserId, publishableKey) {
|
|
10392
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10393
|
-
const response = await fetch(
|
|
10394
|
-
`${API_BASE_URL}/v1/public/direct_executions/query`,
|
|
10395
|
-
{
|
|
10396
|
-
method: "POST",
|
|
10397
|
-
headers: {
|
|
10398
|
-
accept: "application/json",
|
|
10399
|
-
"x-publishable-key": pk,
|
|
10400
|
-
"Content-Type": "application/json"
|
|
10401
|
-
},
|
|
10402
|
-
body: JSON.stringify({
|
|
10403
|
-
external_user_id: externalUserId
|
|
10404
|
-
})
|
|
10405
|
-
}
|
|
10406
|
-
);
|
|
10407
|
-
if (!response.ok) {
|
|
10408
|
-
throw new Error(`Failed to query executions: ${response.statusText}`);
|
|
10409
|
-
}
|
|
10410
|
-
return response.json();
|
|
10411
|
-
}
|
|
10412
|
-
async function getSupportedDepositTokens(publishableKey) {
|
|
10413
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10414
|
-
const response = await fetch(
|
|
10415
|
-
`${API_BASE_URL}/v1/public/tokens/supported_deposit_tokens`,
|
|
10416
|
-
{
|
|
10417
|
-
method: "GET",
|
|
10418
|
-
headers: {
|
|
10419
|
-
accept: "application/json",
|
|
10420
|
-
"x-publishable-key": pk
|
|
10421
|
-
}
|
|
10422
|
-
}
|
|
10423
|
-
);
|
|
10424
|
-
if (!response.ok) {
|
|
10425
|
-
throw new Error(
|
|
10426
|
-
`Failed to fetch supported deposit tokens: ${response.statusText}`
|
|
10427
|
-
);
|
|
10428
|
-
}
|
|
10429
|
-
return response.json();
|
|
10430
|
-
}
|
|
10431
|
-
async function getMeldQuotes(request, publishableKey) {
|
|
10432
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10433
|
-
const response = await fetch(
|
|
10434
|
-
`${API_BASE_URL}/v1/public/onramps/meld/quotes`,
|
|
10435
|
-
{
|
|
10436
|
-
method: "POST",
|
|
10437
|
-
headers: {
|
|
10438
|
-
accept: "application/json",
|
|
10439
|
-
"x-publishable-key": pk,
|
|
10440
|
-
"Content-Type": "application/json"
|
|
10441
|
-
},
|
|
10442
|
-
body: JSON.stringify(request)
|
|
10443
|
-
}
|
|
10444
|
-
);
|
|
10445
|
-
if (!response.ok) {
|
|
10446
|
-
throw new Error(`Failed to fetch Meld quotes: ${response.statusText}`);
|
|
10447
|
-
}
|
|
10448
|
-
return response.json();
|
|
10449
|
-
}
|
|
10450
|
-
async function createMeldSession(request, publishableKey) {
|
|
10451
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10452
|
-
const response = await fetch(
|
|
10453
|
-
`${API_BASE_URL}/v1/public/onramps/meld/sessions`,
|
|
10454
|
-
{
|
|
10455
|
-
method: "POST",
|
|
10456
|
-
headers: {
|
|
10457
|
-
accept: "application/json",
|
|
10458
|
-
"x-publishable-key": pk,
|
|
10459
|
-
"Content-Type": "application/json"
|
|
10460
|
-
},
|
|
10461
|
-
body: JSON.stringify(request)
|
|
10462
|
-
}
|
|
10463
|
-
);
|
|
10464
|
-
if (!response.ok) {
|
|
10465
|
-
throw new Error(`Failed to create Meld session: ${response.statusText}`);
|
|
10466
|
-
}
|
|
10467
|
-
return response.json();
|
|
10468
|
-
}
|
|
10469
|
-
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
10470
|
-
if (!iconUrls || iconUrls.length === 0) {
|
|
10471
|
-
return void 0;
|
|
10472
|
-
}
|
|
10473
|
-
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
10474
|
-
if (preferred) {
|
|
10475
|
-
return preferred.url;
|
|
10476
|
-
}
|
|
10477
|
-
return iconUrls[0]?.url;
|
|
10478
|
-
}
|
|
10479
|
-
async function getFiatCurrencies(publishableKey) {
|
|
10480
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10481
|
-
const response = await fetch(
|
|
10482
|
-
`${API_BASE_URL}/v1/public/onramps/fiat_currencies`,
|
|
10483
|
-
{
|
|
10484
|
-
method: "GET",
|
|
10485
|
-
headers: {
|
|
10486
|
-
accept: "application/json",
|
|
10487
|
-
"x-publishable-key": pk
|
|
10488
|
-
}
|
|
10489
|
-
}
|
|
10490
|
-
);
|
|
10491
|
-
if (!response.ok) {
|
|
10492
|
-
throw new Error(`Failed to fetch fiat currencies: ${response.statusText}`);
|
|
10493
|
-
}
|
|
10494
|
-
return response.json();
|
|
10495
|
-
}
|
|
10496
|
-
async function getProjectConfig(publishableKey) {
|
|
10497
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10498
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
10499
|
-
method: "GET",
|
|
10500
|
-
headers: {
|
|
10501
|
-
accept: "application/json",
|
|
10502
|
-
"x-publishable-key": pk
|
|
10503
|
-
}
|
|
10504
|
-
});
|
|
10505
|
-
if (!response.ok) {
|
|
10506
|
-
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
10507
|
-
}
|
|
10508
|
-
return response.json();
|
|
10509
|
-
}
|
|
10510
10545
|
function DepositExecutionItem({
|
|
10511
10546
|
execution,
|
|
10512
10547
|
onClick
|
|
10513
10548
|
}) {
|
|
10514
|
-
const isPending = execution.status ===
|
|
10549
|
+
const isPending = execution.status === ExecutionStatus.PENDING || execution.status === ExecutionStatus.WAITING || execution.status === ExecutionStatus.DELAYED;
|
|
10515
10550
|
const formatDateTime = (timestamp) => {
|
|
10516
10551
|
try {
|
|
10517
10552
|
const date = new Date(timestamp);
|
|
@@ -10553,7 +10588,7 @@ function DepositExecutionItem({
|
|
|
10553
10588
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10554
10589
|
"img",
|
|
10555
10590
|
{
|
|
10556
|
-
src: execution.
|
|
10591
|
+
src: execution.destination_token_metadata?.icon_url || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
10557
10592
|
alt: "Token",
|
|
10558
10593
|
width: 36,
|
|
10559
10594
|
height: 36,
|
|
@@ -10578,7 +10613,7 @@ function DepositExecutionItem({
|
|
|
10578
10613
|
}
|
|
10579
10614
|
)
|
|
10580
10615
|
}
|
|
10581
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-
|
|
10616
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", className: "uf-block", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10582
10617
|
"path",
|
|
10583
10618
|
{
|
|
10584
10619
|
d: "M10 3L4.5 8.5L2 6",
|
|
@@ -10590,7 +10625,7 @@ function DepositExecutionItem({
|
|
|
10590
10625
|
) }) })
|
|
10591
10626
|
] }),
|
|
10592
10627
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
10593
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit
|
|
10628
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
10594
10629
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "uf-text-muted-foreground uf-text-xs uf-leading-tight", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10595
10630
|
] }),
|
|
10596
10631
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(execution.source_amount_base_unit) }),
|
|
@@ -10599,27 +10634,16 @@ function DepositExecutionItem({
|
|
|
10599
10634
|
}
|
|
10600
10635
|
);
|
|
10601
10636
|
}
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
bitcoin: "Bitcoin",
|
|
10613
|
-
mainnet: "Mainnet"
|
|
10614
|
-
};
|
|
10615
|
-
function DepositDetailModal({
|
|
10616
|
-
open,
|
|
10617
|
-
onOpenChange,
|
|
10618
|
-
execution,
|
|
10619
|
-
themeClass = ""
|
|
10620
|
-
}) {
|
|
10621
|
-
if (!execution) return null;
|
|
10622
|
-
const isPending = execution.status === "pending" || execution.status === "waiting" || execution.status === "delayed";
|
|
10637
|
+
function DepositDetailContent({ execution }) {
|
|
10638
|
+
const [chains, setChains] = (0, import_react11.useState)([]);
|
|
10639
|
+
const [showNetworkDetails, setShowNetworkDetails] = (0, import_react11.useState)(false);
|
|
10640
|
+
(0, import_react11.useEffect)(() => {
|
|
10641
|
+
getTokenChains().then((response) => setChains(response.data)).catch((err) => console.error("Failed to fetch chains:", err));
|
|
10642
|
+
}, []);
|
|
10643
|
+
(0, import_react11.useEffect)(() => {
|
|
10644
|
+
setShowNetworkDetails(false);
|
|
10645
|
+
}, [execution?.id]);
|
|
10646
|
+
const isPending = execution.status === ExecutionStatus.PENDING || execution.status === ExecutionStatus.WAITING || execution.status === ExecutionStatus.DELAYED;
|
|
10623
10647
|
const formatDateTime = (timestamp) => {
|
|
10624
10648
|
try {
|
|
10625
10649
|
const date = new Date(timestamp);
|
|
@@ -10674,161 +10698,153 @@ function DepositDetailModal({
|
|
|
10674
10698
|
return "$0.00";
|
|
10675
10699
|
};
|
|
10676
10700
|
const getNetworkName = (chainType, chainId) => {
|
|
10677
|
-
return
|
|
10678
|
-
};
|
|
10679
|
-
const getSourceTokenSymbol = () => {
|
|
10680
|
-
return "USDC";
|
|
10681
|
-
};
|
|
10682
|
-
const getDestinationTokenSymbol = () => {
|
|
10683
|
-
return "USDC";
|
|
10701
|
+
return getChainName(chains, chainType, chainId);
|
|
10684
10702
|
};
|
|
10685
|
-
const
|
|
10686
|
-
|
|
10703
|
+
const formatTransactionHash = (hash) => {
|
|
10704
|
+
if (!hash || hash.length < 12) return hash;
|
|
10705
|
+
return `${hash.slice(0, 12)}...${hash.slice(-4)}`;
|
|
10687
10706
|
};
|
|
10688
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
height: "16",
|
|
10712
|
-
viewBox: "0 0 12 12",
|
|
10713
|
-
fill: "none",
|
|
10714
|
-
className: "uf-animate-spin uf-block",
|
|
10715
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10716
|
-
"path",
|
|
10717
|
-
{
|
|
10718
|
-
d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
|
|
10719
|
-
stroke: "white",
|
|
10720
|
-
strokeWidth: "2",
|
|
10721
|
-
strokeLinecap: "round"
|
|
10722
|
-
}
|
|
10723
|
-
)
|
|
10724
|
-
}
|
|
10725
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-blue-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10726
|
-
"svg",
|
|
10727
|
-
{
|
|
10728
|
-
width: "16",
|
|
10729
|
-
height: "16",
|
|
10730
|
-
viewBox: "0 0 12 12",
|
|
10731
|
-
fill: "none",
|
|
10732
|
-
className: "uf-block",
|
|
10733
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10734
|
-
"path",
|
|
10735
|
-
{
|
|
10736
|
-
d: "M10 3L4.5 8.5L2 6",
|
|
10737
|
-
stroke: "white",
|
|
10738
|
-
strokeWidth: "2",
|
|
10739
|
-
strokeLinecap: "round",
|
|
10740
|
-
strokeLinejoin: "round"
|
|
10741
|
-
}
|
|
10742
|
-
)
|
|
10743
|
-
}
|
|
10744
|
-
) })
|
|
10745
|
-
] }),
|
|
10746
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
10747
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10748
|
-
"div",
|
|
10749
|
-
{
|
|
10750
|
-
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
10751
|
-
}
|
|
10752
|
-
),
|
|
10753
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Pending" : "Completed" })
|
|
10754
|
-
] }),
|
|
10755
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10756
|
-
] }),
|
|
10757
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
10758
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10759
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
10760
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10761
|
-
formatAmount(execution.source_amount_base_unit),
|
|
10762
|
-
" ",
|
|
10763
|
-
getSourceTokenSymbol()
|
|
10764
|
-
] })
|
|
10765
|
-
] }),
|
|
10766
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10767
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
10768
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10769
|
-
formatAmount(execution.destination_amount_base_unit),
|
|
10770
|
-
" ",
|
|
10771
|
-
getDestinationTokenSymbol()
|
|
10772
|
-
] })
|
|
10773
|
-
] }),
|
|
10774
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10775
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
10776
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
10777
|
-
] })
|
|
10778
|
-
] }),
|
|
10779
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
10780
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10781
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
10782
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
10783
|
-
] }),
|
|
10784
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10785
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
10786
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
10787
|
-
] })
|
|
10788
|
-
] }),
|
|
10789
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
10790
|
-
execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10791
|
-
"a",
|
|
10707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-px-2", children: [
|
|
10708
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-py-6", children: [
|
|
10709
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-relative uf-mb-3", children: [
|
|
10710
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10711
|
+
"img",
|
|
10712
|
+
{
|
|
10713
|
+
src: execution.destination_token_metadata?.icon_url || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
10714
|
+
alt: "Token",
|
|
10715
|
+
width: 64,
|
|
10716
|
+
height: 64,
|
|
10717
|
+
className: "uf-rounded-full"
|
|
10718
|
+
}
|
|
10719
|
+
),
|
|
10720
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-yellow-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10721
|
+
"svg",
|
|
10722
|
+
{
|
|
10723
|
+
width: "16",
|
|
10724
|
+
height: "16",
|
|
10725
|
+
viewBox: "0 0 24 24",
|
|
10726
|
+
fill: "none",
|
|
10727
|
+
className: "uf-animate-spin uf-block",
|
|
10728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10729
|
+
"path",
|
|
10792
10730
|
{
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
children: [
|
|
10798
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
10799
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArrowDownCircle, { className: "uf-w-5 uf-h-5" }),
|
|
10800
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-font-medium", children: "View Deposit Transaction" })
|
|
10801
|
-
] }),
|
|
10802
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
10803
|
-
]
|
|
10731
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
10732
|
+
stroke: "white",
|
|
10733
|
+
strokeWidth: "3",
|
|
10734
|
+
strokeLinecap: "round"
|
|
10804
10735
|
}
|
|
10805
|
-
)
|
|
10806
|
-
|
|
10807
|
-
|
|
10736
|
+
)
|
|
10737
|
+
}
|
|
10738
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-green-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10739
|
+
"svg",
|
|
10740
|
+
{
|
|
10741
|
+
width: "16",
|
|
10742
|
+
height: "16",
|
|
10743
|
+
viewBox: "0 0 12 12",
|
|
10744
|
+
fill: "none",
|
|
10745
|
+
className: "uf-block",
|
|
10746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10747
|
+
"path",
|
|
10808
10748
|
{
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
10815
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CheckCircle, { className: "uf-w-5 uf-h-5" }),
|
|
10816
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-font-medium", children: "View Completion Transaction" })
|
|
10817
|
-
] }),
|
|
10818
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
10819
|
-
]
|
|
10749
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
10750
|
+
stroke: "white",
|
|
10751
|
+
strokeWidth: "2",
|
|
10752
|
+
strokeLinecap: "round",
|
|
10753
|
+
strokeLinejoin: "round"
|
|
10820
10754
|
}
|
|
10821
10755
|
)
|
|
10822
|
-
|
|
10823
|
-
|
|
10756
|
+
}
|
|
10757
|
+
) })
|
|
10758
|
+
] }),
|
|
10759
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
10760
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10761
|
+
"div",
|
|
10762
|
+
{
|
|
10763
|
+
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
10764
|
+
}
|
|
10765
|
+
),
|
|
10766
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Processing" : "Completed" })
|
|
10767
|
+
] }),
|
|
10768
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10769
|
+
] }),
|
|
10770
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
10771
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10772
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
10773
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10774
|
+
formatAmount(execution.source_amount_base_unit),
|
|
10775
|
+
" ",
|
|
10776
|
+
execution.source_currency?.toUpperCase()
|
|
10824
10777
|
] })
|
|
10825
|
-
]
|
|
10826
|
-
|
|
10827
|
-
|
|
10778
|
+
] }),
|
|
10779
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10780
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
10781
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10782
|
+
formatAmount(execution.destination_amount_base_unit),
|
|
10783
|
+
" ",
|
|
10784
|
+
execution.destination_currency?.toUpperCase()
|
|
10785
|
+
] })
|
|
10786
|
+
] }),
|
|
10787
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10788
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
10789
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
10790
|
+
] }),
|
|
10791
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10792
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
10793
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
10794
|
+
] }),
|
|
10795
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10796
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
10797
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
10798
|
+
] })
|
|
10799
|
+
] }),
|
|
10800
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10801
|
+
"button",
|
|
10802
|
+
{
|
|
10803
|
+
type: "button",
|
|
10804
|
+
onClick: () => setShowNetworkDetails(!showNetworkDetails),
|
|
10805
|
+
className: "uf-flex uf-justify-between uf-items-center uf-w-full uf-px-3 uf-pb-3 uf-text-muted-foreground uf-text-sm hover:uf-text-foreground uf-transition-colors",
|
|
10806
|
+
children: [
|
|
10807
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: showNetworkDetails ? "See less" : "See more details" }),
|
|
10808
|
+
showNetworkDetails ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronUp, { className: "uf-w-4 uf-h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronDown, { className: "uf-w-4 uf-h-4" })
|
|
10809
|
+
]
|
|
10810
|
+
}
|
|
10811
|
+
),
|
|
10812
|
+
showNetworkDetails && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
10813
|
+
execution.transaction_hash && execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10814
|
+
"a",
|
|
10815
|
+
{
|
|
10816
|
+
href: execution.explorer_url,
|
|
10817
|
+
target: "_blank",
|
|
10818
|
+
rel: "noopener noreferrer",
|
|
10819
|
+
className: "uf-grid uf-grid-cols-[auto_1fr_auto] uf-items-center uf-gap-2 uf-px-4 uf-py-3 uf-border-b uf-border-border/50 hover:uf-bg-card/50 uf-transition-colors",
|
|
10820
|
+
children: [
|
|
10821
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Deposit Tx" }),
|
|
10822
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.transaction_hash) }),
|
|
10823
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
10824
|
+
]
|
|
10825
|
+
}
|
|
10826
|
+
),
|
|
10827
|
+
!isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10828
|
+
"a",
|
|
10829
|
+
{
|
|
10830
|
+
href: execution.destination_explorer_url,
|
|
10831
|
+
target: "_blank",
|
|
10832
|
+
rel: "noopener noreferrer",
|
|
10833
|
+
className: "uf-grid uf-grid-cols-[auto_1fr_auto] uf-items-center uf-gap-2 uf-px-4 uf-py-3 hover:uf-bg-card/50 uf-transition-colors",
|
|
10834
|
+
children: [
|
|
10835
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Completion Tx" }),
|
|
10836
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.destination_transaction_hashes[0]) }),
|
|
10837
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
10838
|
+
]
|
|
10839
|
+
}
|
|
10840
|
+
)
|
|
10841
|
+
] })
|
|
10842
|
+
] });
|
|
10828
10843
|
}
|
|
10829
10844
|
function DepositsModal({
|
|
10830
10845
|
open,
|
|
10831
10846
|
onOpenChange,
|
|
10847
|
+
onCloseAll,
|
|
10832
10848
|
executions: sessionExecutions,
|
|
10833
10849
|
userId,
|
|
10834
10850
|
publishableKey,
|
|
@@ -10836,7 +10852,6 @@ function DepositsModal({
|
|
|
10836
10852
|
}) {
|
|
10837
10853
|
const [allExecutions, setAllExecutions] = (0, import_react10.useState)(sessionExecutions);
|
|
10838
10854
|
const [selectedExecution, setSelectedExecution] = (0, import_react10.useState)(null);
|
|
10839
|
-
const [detailModalOpen, setDetailModalOpen] = (0, import_react10.useState)(false);
|
|
10840
10855
|
(0, import_react10.useEffect)(() => {
|
|
10841
10856
|
if (!open || !userId) return;
|
|
10842
10857
|
const fetchExecutions = async () => {
|
|
@@ -10859,35 +10874,55 @@ function DepositsModal({
|
|
|
10859
10874
|
clearInterval(pollInterval);
|
|
10860
10875
|
};
|
|
10861
10876
|
}, [open, userId, publishableKey, sessionExecutions]);
|
|
10877
|
+
(0, import_react10.useEffect)(() => {
|
|
10878
|
+
if (!open) {
|
|
10879
|
+
setSelectedExecution(null);
|
|
10880
|
+
}
|
|
10881
|
+
}, [open]);
|
|
10882
|
+
const handleBack = () => {
|
|
10883
|
+
if (selectedExecution) {
|
|
10884
|
+
setSelectedExecution(null);
|
|
10885
|
+
} else {
|
|
10886
|
+
onOpenChange(false);
|
|
10887
|
+
}
|
|
10888
|
+
};
|
|
10862
10889
|
const handleClose = () => {
|
|
10863
10890
|
onOpenChange(false);
|
|
10891
|
+
onCloseAll?.();
|
|
10864
10892
|
};
|
|
10865
10893
|
const handleExecutionClick = (execution) => {
|
|
10866
10894
|
setSelectedExecution(execution);
|
|
10867
|
-
setDetailModalOpen(true);
|
|
10868
10895
|
};
|
|
10869
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
10870
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: selectedExecution ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
10897
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10898
|
+
DepositHeader,
|
|
10899
|
+
{
|
|
10900
|
+
title: "Deposit Details",
|
|
10901
|
+
showBack: true,
|
|
10902
|
+
onBack: () => setSelectedExecution(null),
|
|
10903
|
+
onClose: handleClose
|
|
10904
|
+
}
|
|
10905
|
+
),
|
|
10906
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DepositDetailContent, { execution: selectedExecution })
|
|
10907
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
10881
10908
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10882
|
-
|
|
10909
|
+
DepositHeader,
|
|
10883
10910
|
{
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10911
|
+
title: "Deposit Tracker",
|
|
10912
|
+
showBack: true,
|
|
10913
|
+
onBack: handleBack,
|
|
10914
|
+
onClose: handleClose
|
|
10888
10915
|
}
|
|
10889
|
-
)
|
|
10890
|
-
|
|
10916
|
+
),
|
|
10917
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-max-h-[400px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10918
|
+
DepositExecutionItem,
|
|
10919
|
+
{
|
|
10920
|
+
execution,
|
|
10921
|
+
onClick: () => handleExecutionClick(execution)
|
|
10922
|
+
},
|
|
10923
|
+
execution.id
|
|
10924
|
+
)) }) }) })
|
|
10925
|
+
] }) }) });
|
|
10891
10926
|
}
|
|
10892
10927
|
function DepositSuccessToast({
|
|
10893
10928
|
depositTx,
|
|
@@ -10895,9 +10930,12 @@ function DepositSuccessToast({
|
|
|
10895
10930
|
status,
|
|
10896
10931
|
tokenIconUrl,
|
|
10897
10932
|
sourceAmountBaseUnit = "0",
|
|
10898
|
-
onClose
|
|
10933
|
+
onClose,
|
|
10934
|
+
execution
|
|
10899
10935
|
}) {
|
|
10900
|
-
const
|
|
10936
|
+
const [detailModalOpen, setDetailModalOpen] = (0, import_react12.useState)(false);
|
|
10937
|
+
const { themeClass } = useTheme();
|
|
10938
|
+
const isPending = status === ExecutionStatus.PENDING || status === ExecutionStatus.WAITING || status === ExecutionStatus.DELAYED;
|
|
10901
10939
|
const formatDateTime = (timestamp) => {
|
|
10902
10940
|
try {
|
|
10903
10941
|
const date = new Date(timestamp);
|
|
@@ -10929,61 +10967,124 @@ function DepositSuccessToast({
|
|
|
10929
10967
|
return "$0.00";
|
|
10930
10968
|
}
|
|
10931
10969
|
};
|
|
10932
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.
|
|
10933
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
className: "uf-rounded-full"
|
|
10942
|
-
}
|
|
10943
|
-
),
|
|
10944
|
-
isPending ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
10971
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("style", { children: `
|
|
10972
|
+
@keyframes border-travel {
|
|
10973
|
+
from { stroke-dashoffset: 0; }
|
|
10974
|
+
to { stroke-dashoffset: -1000; }
|
|
10975
|
+
}
|
|
10976
|
+
` }),
|
|
10977
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-w-full uf-animate-in uf-slide-in-from-bottom-2 uf-duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-relative uf-rounded-xl", children: [
|
|
10978
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10945
10979
|
"svg",
|
|
10946
10980
|
{
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
viewBox: "0 0 12 12",
|
|
10950
|
-
fill: "none",
|
|
10951
|
-
className: "uf-animate-spin",
|
|
10981
|
+
className: "uf-absolute uf-inset-0 uf-w-full uf-h-full uf-pointer-events-none uf-z-[1]",
|
|
10982
|
+
style: { overflow: "visible" },
|
|
10952
10983
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10953
|
-
"
|
|
10984
|
+
"rect",
|
|
10954
10985
|
{
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10986
|
+
x: "5",
|
|
10987
|
+
y: "2",
|
|
10988
|
+
rx: "10",
|
|
10989
|
+
ry: "10",
|
|
10990
|
+
fill: "none",
|
|
10991
|
+
stroke: "#ecc94b",
|
|
10992
|
+
strokeWidth: "3",
|
|
10993
|
+
strokeDasharray: "120 880",
|
|
10994
|
+
strokeLinecap: "round",
|
|
10995
|
+
pathLength: "1000",
|
|
10996
|
+
style: {
|
|
10997
|
+
width: "calc(100% - 10px)",
|
|
10998
|
+
height: "calc(100% - 4px)",
|
|
10999
|
+
animation: "border-travel 2.5s linear infinite"
|
|
11000
|
+
}
|
|
10959
11001
|
}
|
|
10960
11002
|
)
|
|
10961
11003
|
}
|
|
10962
|
-
)
|
|
10963
|
-
|
|
11004
|
+
),
|
|
11005
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
11006
|
+
"div",
|
|
10964
11007
|
{
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
11008
|
+
onClick: () => execution && setDetailModalOpen(true),
|
|
11009
|
+
className: `uf-relative uf-bg-white dark:uf-bg-black hover:uf-opacity-90 uf-rounded-xl uf-p-3 uf-mx-1 uf-flex uf-items-center uf-gap-3 uf-transition-all uf-cursor-pointer ${isPending ? "" : "uf-border uf-border-zinc-300 dark:uf-border-zinc-700"}`,
|
|
11010
|
+
children: [
|
|
11011
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
11012
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11013
|
+
"img",
|
|
11014
|
+
{
|
|
11015
|
+
src: tokenIconUrl || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
11016
|
+
alt: "Token",
|
|
11017
|
+
width: 36,
|
|
11018
|
+
height: 36,
|
|
11019
|
+
className: "uf-rounded-full"
|
|
11020
|
+
}
|
|
11021
|
+
),
|
|
11022
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11023
|
+
"svg",
|
|
11024
|
+
{
|
|
11025
|
+
width: "10",
|
|
11026
|
+
height: "10",
|
|
11027
|
+
viewBox: "0 0 24 24",
|
|
11028
|
+
fill: "none",
|
|
11029
|
+
className: "uf-animate-spin",
|
|
11030
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11031
|
+
"path",
|
|
11032
|
+
{
|
|
11033
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
11034
|
+
stroke: "white",
|
|
11035
|
+
strokeWidth: "3",
|
|
11036
|
+
strokeLinecap: "round"
|
|
11037
|
+
}
|
|
11038
|
+
)
|
|
11039
|
+
}
|
|
11040
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11041
|
+
"path",
|
|
11042
|
+
{
|
|
11043
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
11044
|
+
stroke: "white",
|
|
11045
|
+
strokeWidth: "2",
|
|
11046
|
+
strokeLinecap: "round",
|
|
11047
|
+
strokeLinejoin: "round"
|
|
11048
|
+
}
|
|
11049
|
+
) }) })
|
|
11050
|
+
] }),
|
|
11051
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
11052
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
11053
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "uf-text-zinc-600 dark:uf-text-zinc-400 uf-text-xs", children: formatDateTime(orderSubmittedAt) })
|
|
11054
|
+
] }),
|
|
11055
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(sourceAmountBaseUnit) }),
|
|
11056
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11057
|
+
"button",
|
|
11058
|
+
{
|
|
11059
|
+
onClick: (e) => {
|
|
11060
|
+
e.stopPropagation();
|
|
11061
|
+
onClose();
|
|
11062
|
+
},
|
|
11063
|
+
className: "uf-text-zinc-600 dark:uf-text-zinc-400 hover:uf-text-black dark:hover:uf-text-white uf-transition-colors uf-p-0.5 uf-flex-shrink-0",
|
|
11064
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(X, { className: "uf-w-4 uf-h-4" })
|
|
11065
|
+
}
|
|
11066
|
+
)
|
|
11067
|
+
]
|
|
10970
11068
|
}
|
|
10971
|
-
)
|
|
10972
|
-
] }),
|
|
10973
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
10974
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
11069
|
+
)
|
|
11070
|
+
] }) }),
|
|
11071
|
+
execution && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Dialog2, { open: detailModalOpen, onOpenChange: setDetailModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-mt-8 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
11072
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-px-4", children: [
|
|
11073
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-w-8" }),
|
|
11074
|
+
" ",
|
|
11075
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "uf-text-lg uf-font-semibold uf-text-foreground", children: "Deposit Details" }),
|
|
11076
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11077
|
+
"button",
|
|
11078
|
+
{
|
|
11079
|
+
onClick: () => setDetailModalOpen(false),
|
|
11080
|
+
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-w-8 uf-flex uf-justify-end",
|
|
11081
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(X, { className: "uf-w-5 uf-h-5" })
|
|
11082
|
+
}
|
|
11083
|
+
)
|
|
11084
|
+
] }),
|
|
11085
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DepositDetailContent, { execution })
|
|
11086
|
+
] }) })
|
|
11087
|
+
] });
|
|
10987
11088
|
}
|
|
10988
11089
|
var Select2 = Root23;
|
|
10989
11090
|
var SelectValue2 = Value;
|
|
@@ -11095,51 +11196,12 @@ var SelectSeparator2 = React38.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
11095
11196
|
}
|
|
11096
11197
|
));
|
|
11097
11198
|
SelectSeparator2.displayName = Separator.displayName;
|
|
11098
|
-
var buttonVariants = cva(
|
|
11099
|
-
"uf-inline-flex uf-items-center uf-justify-center uf-whitespace-nowrap uf-rounded-md uf-text-sm uf-font-medium uf-ring-offset-background uf-transition-colors focus-visible:uf-outline-none focus-visible:uf-ring-2 focus-visible:uf-ring-ring focus-visible:uf-ring-offset-2 disabled:uf-pointer-events-none disabled:uf-opacity-50",
|
|
11100
|
-
{
|
|
11101
|
-
variants: {
|
|
11102
|
-
variant: {
|
|
11103
|
-
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
11104
|
-
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
11105
|
-
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
11106
|
-
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
11107
|
-
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
11108
|
-
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
11109
|
-
},
|
|
11110
|
-
size: {
|
|
11111
|
-
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
11112
|
-
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
11113
|
-
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
11114
|
-
icon: "uf-h-10 uf-w-10"
|
|
11115
|
-
}
|
|
11116
|
-
},
|
|
11117
|
-
defaultVariants: {
|
|
11118
|
-
variant: "default",
|
|
11119
|
-
size: "default"
|
|
11120
|
-
}
|
|
11121
|
-
}
|
|
11122
|
-
);
|
|
11123
|
-
var Button = React42.forwardRef(
|
|
11124
|
-
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
11125
|
-
const Comp = asChild ? Slot3 : "button";
|
|
11126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
11127
|
-
Comp,
|
|
11128
|
-
{
|
|
11129
|
-
className: cn(buttonVariants({ variant, size: size4, className })),
|
|
11130
|
-
ref,
|
|
11131
|
-
...props
|
|
11132
|
-
}
|
|
11133
|
-
);
|
|
11134
|
-
}
|
|
11135
|
-
);
|
|
11136
|
-
Button.displayName = "Button";
|
|
11137
11199
|
var TooltipProvider2 = Provider;
|
|
11138
11200
|
var Tooltip2 = Root32;
|
|
11139
11201
|
var TooltipTrigger2 = Trigger2;
|
|
11140
|
-
var TooltipContent2 =
|
|
11202
|
+
var TooltipContent2 = React42.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
11141
11203
|
const { themeClass } = useTheme();
|
|
11142
|
-
return /* @__PURE__ */ (0,
|
|
11204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Portal4, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
11143
11205
|
Content23,
|
|
11144
11206
|
{
|
|
11145
11207
|
ref,
|
|
@@ -11218,8 +11280,8 @@ var en_default = {
|
|
|
11218
11280
|
}
|
|
11219
11281
|
}
|
|
11220
11282
|
};
|
|
11221
|
-
var
|
|
11222
|
-
var t =
|
|
11283
|
+
var i18n2 = en_default;
|
|
11284
|
+
var t = i18n2.transferCrypto;
|
|
11223
11285
|
var getChainKey = (chainId, chainType) => {
|
|
11224
11286
|
return `${chainType}:${chainId}`;
|
|
11225
11287
|
};
|
|
@@ -11234,7 +11296,6 @@ function TransferCryptoBase({
|
|
|
11234
11296
|
destinationChainType,
|
|
11235
11297
|
destinationChainId,
|
|
11236
11298
|
destinationTokenAddress,
|
|
11237
|
-
copyButtonMode = "compact",
|
|
11238
11299
|
layoutVariant = "horizontal",
|
|
11239
11300
|
showDetailedDropdowns = false,
|
|
11240
11301
|
onExecutionsChange,
|
|
@@ -11323,9 +11384,9 @@ function TransferCryptoBase({
|
|
|
11323
11384
|
if (isCancelled) return;
|
|
11324
11385
|
setLoading(true);
|
|
11325
11386
|
try {
|
|
11326
|
-
const response = await
|
|
11387
|
+
const response = await createDepositAddress(
|
|
11327
11388
|
{
|
|
11328
|
-
|
|
11389
|
+
external_user_id: userId,
|
|
11329
11390
|
recipient_address: recipientAddress,
|
|
11330
11391
|
destination_chain_type: destinationChainType,
|
|
11331
11392
|
destination_chain_id: destinationChainId,
|
|
@@ -11394,12 +11455,11 @@ function TransferCryptoBase({
|
|
|
11394
11455
|
break;
|
|
11395
11456
|
}
|
|
11396
11457
|
const inProgressStatuses = [
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
/* DELAYED */
|
|
11458
|
+
ExecutionStatus.PENDING,
|
|
11459
|
+
ExecutionStatus.WAITING,
|
|
11460
|
+
ExecutionStatus.DELAYED
|
|
11401
11461
|
];
|
|
11402
|
-
if (inProgressStatuses.includes(trackedStatus) && execution.status ===
|
|
11462
|
+
if (inProgressStatuses.includes(trackedStatus) && execution.status === ExecutionStatus.SUCCEEDED) {
|
|
11403
11463
|
executionToShow = execution;
|
|
11404
11464
|
break;
|
|
11405
11465
|
}
|
|
@@ -11422,7 +11482,7 @@ function TransferCryptoBase({
|
|
|
11422
11482
|
return updated;
|
|
11423
11483
|
});
|
|
11424
11484
|
if (onDepositSuccess) {
|
|
11425
|
-
const isCompleted = execution.status ===
|
|
11485
|
+
const isCompleted = execution.status === ExecutionStatus.SUCCEEDED;
|
|
11426
11486
|
if (isCompleted) {
|
|
11427
11487
|
onDepositSuccess({
|
|
11428
11488
|
message: "Deposit completed successfully",
|
|
@@ -11485,8 +11545,8 @@ function TransferCryptoBase({
|
|
|
11485
11545
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
11486
11546
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
11487
11547
|
const renderTokenItem = (tokenData) => {
|
|
11488
|
-
return /* @__PURE__ */ (0,
|
|
11489
|
-
/* @__PURE__ */ (0,
|
|
11548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11549
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11490
11550
|
"img",
|
|
11491
11551
|
{
|
|
11492
11552
|
src: tokenData.icon_url,
|
|
@@ -11496,13 +11556,13 @@ function TransferCryptoBase({
|
|
|
11496
11556
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
11497
11557
|
}
|
|
11498
11558
|
),
|
|
11499
|
-
/* @__PURE__ */ (0,
|
|
11500
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
11559
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
|
|
11560
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
|
|
11501
11561
|
] });
|
|
11502
11562
|
};
|
|
11503
11563
|
const renderChainItem = (chainData) => {
|
|
11504
|
-
return /* @__PURE__ */ (0,
|
|
11505
|
-
/* @__PURE__ */ (0,
|
|
11564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11565
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11506
11566
|
"img",
|
|
11507
11567
|
{
|
|
11508
11568
|
src: chainData.icon_url,
|
|
@@ -11512,24 +11572,24 @@ function TransferCryptoBase({
|
|
|
11512
11572
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
11513
11573
|
}
|
|
11514
11574
|
),
|
|
11515
|
-
/* @__PURE__ */ (0,
|
|
11516
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
11575
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
|
|
11576
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
|
|
11517
11577
|
] });
|
|
11518
11578
|
};
|
|
11519
11579
|
const selectContainerClass = layoutVariant === "horizontal" ? "uf-grid uf-grid-cols-2 uf-gap-2.5" : "uf-space-y-3";
|
|
11520
|
-
return /* @__PURE__ */ (0,
|
|
11521
|
-
/* @__PURE__ */ (0,
|
|
11522
|
-
/* @__PURE__ */ (0,
|
|
11523
|
-
/* @__PURE__ */ (0,
|
|
11524
|
-
/* @__PURE__ */ (0,
|
|
11580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipProvider2, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-space-y-3", children: [
|
|
11581
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: selectContainerClass, children: [
|
|
11582
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
11583
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t.supportedToken }),
|
|
11584
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11525
11585
|
Select2,
|
|
11526
11586
|
{
|
|
11527
11587
|
value: token,
|
|
11528
11588
|
onValueChange: setToken,
|
|
11529
11589
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
11530
11590
|
children: [
|
|
11531
|
-
/* @__PURE__ */ (0,
|
|
11532
|
-
/* @__PURE__ */ (0,
|
|
11591
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectTrigger2, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
|
|
11592
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectContent2, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11533
11593
|
SelectItem2,
|
|
11534
11594
|
{
|
|
11535
11595
|
value: tokenData.symbol,
|
|
@@ -11542,51 +11602,51 @@ function TransferCryptoBase({
|
|
|
11542
11602
|
}
|
|
11543
11603
|
)
|
|
11544
11604
|
] }),
|
|
11545
|
-
/* @__PURE__ */ (0,
|
|
11546
|
-
/* @__PURE__ */ (0,
|
|
11605
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
11606
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
11547
11607
|
t.supportedChain,
|
|
11548
|
-
/* @__PURE__ */ (0,
|
|
11608
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-[10px]", children: [
|
|
11549
11609
|
"$",
|
|
11550
11610
|
minDepositUsd,
|
|
11551
11611
|
" ",
|
|
11552
11612
|
t.minDeposit.label
|
|
11553
11613
|
] }),
|
|
11554
|
-
/* @__PURE__ */ (0,
|
|
11555
|
-
/* @__PURE__ */ (0,
|
|
11614
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip2, { children: [
|
|
11615
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11556
11616
|
"span",
|
|
11557
11617
|
{
|
|
11558
11618
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
11559
11619
|
tabIndex: 0,
|
|
11560
11620
|
role: "button",
|
|
11561
11621
|
"aria-label": "Minimum deposit information",
|
|
11562
|
-
children: /* @__PURE__ */ (0,
|
|
11622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11563
11623
|
}
|
|
11564
11624
|
) }),
|
|
11565
|
-
/* @__PURE__ */ (0,
|
|
11625
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11566
11626
|
TooltipContent2,
|
|
11567
11627
|
{
|
|
11568
11628
|
side: "left",
|
|
11569
11629
|
align: "center",
|
|
11570
11630
|
className: "uf-max-w-[200px]",
|
|
11571
|
-
children: /* @__PURE__ */ (0,
|
|
11631
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: t.minDeposit.tooltip })
|
|
11572
11632
|
}
|
|
11573
11633
|
)
|
|
11574
11634
|
] })
|
|
11575
11635
|
] }),
|
|
11576
|
-
/* @__PURE__ */ (0,
|
|
11636
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11577
11637
|
Select2,
|
|
11578
11638
|
{
|
|
11579
11639
|
value: chain,
|
|
11580
11640
|
onValueChange: setChain,
|
|
11581
11641
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
11582
11642
|
children: [
|
|
11583
|
-
/* @__PURE__ */ (0,
|
|
11584
|
-
/* @__PURE__ */ (0,
|
|
11643
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectTrigger2, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
11644
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectContent2, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: availableChainsForToken.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
|
|
11585
11645
|
const chainKey = getChainKey(
|
|
11586
11646
|
chainData.chain_id,
|
|
11587
11647
|
chainData.chain_type
|
|
11588
11648
|
);
|
|
11589
|
-
return /* @__PURE__ */ (0,
|
|
11649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11590
11650
|
SelectItem2,
|
|
11591
11651
|
{
|
|
11592
11652
|
value: chainKey,
|
|
@@ -11601,14 +11661,14 @@ function TransferCryptoBase({
|
|
|
11601
11661
|
)
|
|
11602
11662
|
] })
|
|
11603
11663
|
] }),
|
|
11604
|
-
/* @__PURE__ */ (0,
|
|
11664
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-justify-center uf-py-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-p-4 uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11605
11665
|
"div",
|
|
11606
11666
|
{
|
|
11607
11667
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
11608
11668
|
style: { width: 180, height: 180 },
|
|
11609
|
-
children: /* @__PURE__ */ (0,
|
|
11669
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
|
|
11610
11670
|
}
|
|
11611
|
-
) : depositAddress ? /* @__PURE__ */ (0,
|
|
11671
|
+
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11612
11672
|
StyledQRCode,
|
|
11613
11673
|
{
|
|
11614
11674
|
value: depositAddress,
|
|
@@ -11618,93 +11678,75 @@ function TransferCryptoBase({
|
|
|
11618
11678
|
darkMode: isDarkMode
|
|
11619
11679
|
},
|
|
11620
11680
|
`qr-${depositAddress}-${chain}`
|
|
11621
|
-
) : /* @__PURE__ */ (0,
|
|
11681
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11622
11682
|
"div",
|
|
11623
11683
|
{
|
|
11624
11684
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
11625
11685
|
style: { width: 180, height: 180 },
|
|
11626
|
-
children: /* @__PURE__ */ (0,
|
|
11686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
|
|
11627
11687
|
}
|
|
11628
11688
|
) }) }),
|
|
11629
|
-
/* @__PURE__ */ (0,
|
|
11630
|
-
/* @__PURE__ */ (0,
|
|
11631
|
-
/* @__PURE__ */ (0,
|
|
11689
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
11690
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-justify-between", children: [
|
|
11691
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
|
|
11632
11692
|
t.depositAddress.label,
|
|
11633
|
-
/* @__PURE__ */ (0,
|
|
11634
|
-
/* @__PURE__ */ (0,
|
|
11693
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip2, { children: [
|
|
11694
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11635
11695
|
"span",
|
|
11636
11696
|
{
|
|
11637
11697
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
11638
11698
|
tabIndex: 0,
|
|
11639
11699
|
role: "button",
|
|
11640
11700
|
"aria-label": "Deposit address information",
|
|
11641
|
-
children: /* @__PURE__ */ (0,
|
|
11701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11642
11702
|
}
|
|
11643
11703
|
) }),
|
|
11644
|
-
/* @__PURE__ */ (0,
|
|
11704
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11645
11705
|
TooltipContent2,
|
|
11646
11706
|
{
|
|
11647
11707
|
side: "top",
|
|
11648
11708
|
align: "center",
|
|
11649
11709
|
className: "uf-max-w-[240px]",
|
|
11650
|
-
children: /* @__PURE__ */ (0,
|
|
11710
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
|
|
11651
11711
|
}
|
|
11652
11712
|
)
|
|
11653
11713
|
] })
|
|
11654
11714
|
] }),
|
|
11655
|
-
|
|
11656
|
-
"
|
|
11657
|
-
{
|
|
11658
|
-
onClick: handleCopyAddress,
|
|
11659
|
-
disabled: loading || !depositAddress,
|
|
11660
|
-
className: "uf-flex uf-items-center uf-gap-1 uf-text-xs uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11661
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11662
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Check, { className: "uf-w-3 uf-h-3" }),
|
|
11663
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: t.copied })
|
|
11664
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11665
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Copy, { className: "uf-w-3 uf-h-3" }),
|
|
11666
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: t.copyAddress })
|
|
11667
|
-
] })
|
|
11668
|
-
}
|
|
11669
|
-
)
|
|
11670
|
-
] }),
|
|
11671
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all", children: depositAddress || t.noAddressAvailable })
|
|
11672
|
-
] }),
|
|
11673
|
-
copyButtonMode === "fullWidth" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11674
|
-
Button,
|
|
11675
|
-
{
|
|
11676
|
-
onClick: handleCopyAddress,
|
|
11677
|
-
disabled: loading || !depositAddress,
|
|
11678
|
-
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-text-foreground uf-rounded-lg uf-h-9 uf-text-sm uf-font-medium disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11679
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11680
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Check, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
11715
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: `uf-flex uf-items-center uf-gap-1 uf-text-green-500 uf-transition-opacity uf-duration-200 ${copied ? "uf-opacity-100" : "uf-opacity-0"}`, children: [
|
|
11716
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Check, { className: "uf-w-3 uf-h-3" }),
|
|
11681
11717
|
t.copied
|
|
11682
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11683
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Copy, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
11684
|
-
t.copyAddress
|
|
11685
11718
|
] })
|
|
11686
|
-
}
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11719
|
+
] }),
|
|
11720
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11721
|
+
"button",
|
|
11722
|
+
{
|
|
11723
|
+
onClick: handleCopyAddress,
|
|
11724
|
+
disabled: !depositAddress,
|
|
11725
|
+
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all uf-text-left uf-transition-colors uf-cursor-pointer disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11726
|
+
children: depositAddress || t.noAddressAvailable
|
|
11727
|
+
}
|
|
11728
|
+
)
|
|
11729
|
+
] }),
|
|
11730
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-3", children: [
|
|
11731
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11690
11732
|
"button",
|
|
11691
11733
|
{
|
|
11692
11734
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
11693
11735
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
11694
11736
|
children: [
|
|
11695
|
-
/* @__PURE__ */ (0,
|
|
11696
|
-
/* @__PURE__ */ (0,
|
|
11697
|
-
/* @__PURE__ */ (0,
|
|
11737
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11738
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
11739
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11698
11740
|
t.priceImpact.label,
|
|
11699
11741
|
":",
|
|
11700
11742
|
" ",
|
|
11701
|
-
/* @__PURE__ */ (0,
|
|
11743
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
11702
11744
|
priceImpact.toFixed(2),
|
|
11703
11745
|
"%"
|
|
11704
11746
|
] })
|
|
11705
11747
|
] }),
|
|
11706
|
-
/* @__PURE__ */ (0,
|
|
11707
|
-
/* @__PURE__ */ (0,
|
|
11748
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip2, { children: [
|
|
11749
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11708
11750
|
"span",
|
|
11709
11751
|
{
|
|
11710
11752
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
@@ -11717,75 +11759,75 @@ function TransferCryptoBase({
|
|
|
11717
11759
|
tabIndex: 0,
|
|
11718
11760
|
role: "button",
|
|
11719
11761
|
"aria-label": "Price impact information",
|
|
11720
|
-
children: /* @__PURE__ */ (0,
|
|
11762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11721
11763
|
}
|
|
11722
11764
|
) }),
|
|
11723
|
-
/* @__PURE__ */ (0,
|
|
11765
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11724
11766
|
TooltipContent2,
|
|
11725
11767
|
{
|
|
11726
11768
|
side: "top",
|
|
11727
11769
|
align: "center",
|
|
11728
11770
|
className: "uf-max-w-[240px]",
|
|
11729
|
-
children: /* @__PURE__ */ (0,
|
|
11771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: t.priceImpact.tooltip })
|
|
11730
11772
|
}
|
|
11731
11773
|
)
|
|
11732
11774
|
] })
|
|
11733
11775
|
] }),
|
|
11734
|
-
detailsExpanded ? /* @__PURE__ */ (0,
|
|
11776
|
+
detailsExpanded ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronUp, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronDown, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
11735
11777
|
]
|
|
11736
11778
|
}
|
|
11737
11779
|
),
|
|
11738
|
-
detailsExpanded && /* @__PURE__ */ (0,
|
|
11739
|
-
/* @__PURE__ */ (0,
|
|
11740
|
-
/* @__PURE__ */ (0,
|
|
11741
|
-
/* @__PURE__ */ (0,
|
|
11780
|
+
detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
11781
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11782
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
11783
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11742
11784
|
t.slippage.label,
|
|
11743
11785
|
":",
|
|
11744
11786
|
" ",
|
|
11745
|
-
/* @__PURE__ */ (0,
|
|
11787
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
11746
11788
|
t.slippage.auto,
|
|
11747
11789
|
" \u2022 ",
|
|
11748
11790
|
maxSlippage.toFixed(2),
|
|
11749
11791
|
"%"
|
|
11750
11792
|
] })
|
|
11751
11793
|
] }),
|
|
11752
|
-
/* @__PURE__ */ (0,
|
|
11753
|
-
/* @__PURE__ */ (0,
|
|
11794
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip2, { children: [
|
|
11795
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11754
11796
|
"span",
|
|
11755
11797
|
{
|
|
11756
11798
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
11757
11799
|
tabIndex: 0,
|
|
11758
11800
|
role: "button",
|
|
11759
11801
|
"aria-label": "Slippage information",
|
|
11760
|
-
children: /* @__PURE__ */ (0,
|
|
11802
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11761
11803
|
}
|
|
11762
11804
|
) }),
|
|
11763
|
-
/* @__PURE__ */ (0,
|
|
11805
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11764
11806
|
TooltipContent2,
|
|
11765
11807
|
{
|
|
11766
11808
|
side: "top",
|
|
11767
11809
|
align: "center",
|
|
11768
11810
|
className: "uf-max-w-[240px]",
|
|
11769
|
-
children: /* @__PURE__ */ (0,
|
|
11811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: t.slippage.tooltip })
|
|
11770
11812
|
}
|
|
11771
11813
|
)
|
|
11772
11814
|
] })
|
|
11773
11815
|
] }),
|
|
11774
|
-
/* @__PURE__ */ (0,
|
|
11775
|
-
/* @__PURE__ */ (0,
|
|
11776
|
-
/* @__PURE__ */ (0,
|
|
11816
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11817
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Clock, { className: "uf-w-3 uf-h-3" }) }),
|
|
11818
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11777
11819
|
t.processingTime.label,
|
|
11778
11820
|
":",
|
|
11779
11821
|
" ",
|
|
11780
|
-
/* @__PURE__ */ (0,
|
|
11822
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
11781
11823
|
] })
|
|
11782
11824
|
] }),
|
|
11783
|
-
/* @__PURE__ */ (0,
|
|
11784
|
-
/* @__PURE__ */ (0,
|
|
11785
|
-
/* @__PURE__ */ (0,
|
|
11825
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11826
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FileText, { className: "uf-w-3 uf-h-3" }) }),
|
|
11827
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11786
11828
|
t.help.needHelp,
|
|
11787
11829
|
" ",
|
|
11788
|
-
/* @__PURE__ */ (0,
|
|
11830
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11789
11831
|
"a",
|
|
11790
11832
|
{
|
|
11791
11833
|
href: "#",
|
|
@@ -11795,34 +11837,34 @@ function TransferCryptoBase({
|
|
|
11795
11837
|
)
|
|
11796
11838
|
] })
|
|
11797
11839
|
] })
|
|
11798
|
-
] }),
|
|
11799
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
11800
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11801
|
-
"a",
|
|
11802
|
-
{
|
|
11803
|
-
href: "https://unifold.io/terms",
|
|
11804
|
-
className: "uf-text-muted-foreground uf-underline hover:uf-text-foreground uf-transition-colors",
|
|
11805
|
-
target: "_blank",
|
|
11806
|
-
children: t.terms.termsApply
|
|
11807
|
-
}
|
|
11808
|
-
),
|
|
11809
|
-
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
11810
|
-
"button",
|
|
11811
|
-
{
|
|
11812
|
-
onClick: () => setDepositsModalOpen(true),
|
|
11813
|
-
className: "uf-flex uf-items-center uf-gap-1 uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-animate-in uf-fade-in uf-slide-in-from-right-8 uf-duration-1000",
|
|
11814
|
-
children: [
|
|
11815
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
11816
|
-
"Track deposits (",
|
|
11817
|
-
depositExecutions.length,
|
|
11818
|
-
")",
|
|
11819
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
11820
|
-
]
|
|
11821
|
-
}
|
|
11822
|
-
)
|
|
11823
11840
|
] })
|
|
11824
11841
|
] }),
|
|
11825
|
-
|
|
11842
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
11843
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11844
|
+
"a",
|
|
11845
|
+
{
|
|
11846
|
+
href: "https://unifold.io/terms",
|
|
11847
|
+
className: "uf-text-muted-foreground uf-underline hover:uf-text-foreground uf-transition-colors",
|
|
11848
|
+
target: "_blank",
|
|
11849
|
+
children: t.terms.termsApply
|
|
11850
|
+
}
|
|
11851
|
+
),
|
|
11852
|
+
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11853
|
+
"button",
|
|
11854
|
+
{
|
|
11855
|
+
onClick: () => setDepositsModalOpen(true),
|
|
11856
|
+
className: "uf-flex uf-items-center uf-gap-1 uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-animate-in uf-fade-in uf-slide-in-from-right-8 uf-duration-1000",
|
|
11857
|
+
children: [
|
|
11858
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
11859
|
+
"Track deposits (",
|
|
11860
|
+
depositExecutions.length,
|
|
11861
|
+
")",
|
|
11862
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
11863
|
+
]
|
|
11864
|
+
}
|
|
11865
|
+
)
|
|
11866
|
+
] }),
|
|
11867
|
+
depositExecutions.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-fixed uf-bottom-4 uf-left-1/2 uf--translate-x-1/2 uf-w-[360px] uf-max-w-[calc(100vw-2rem)] uf-z-[100]", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11826
11868
|
DepositSuccessToast,
|
|
11827
11869
|
{
|
|
11828
11870
|
depositTx: depositExecutions[0].transaction_hash,
|
|
@@ -11830,13 +11872,14 @@ function TransferCryptoBase({
|
|
|
11830
11872
|
orderFilledAt: depositExecutions[0].updated_at || (/* @__PURE__ */ new Date()).toISOString(),
|
|
11831
11873
|
explorerUrl: depositExecutions[0].explorer_url,
|
|
11832
11874
|
status: depositExecutions[0].status,
|
|
11833
|
-
tokenIconUrl: depositExecutions[0].
|
|
11875
|
+
tokenIconUrl: depositExecutions[0].destination_token_metadata?.icon_url,
|
|
11834
11876
|
sourceAmountBaseUnit: depositExecutions[0].source_amount_base_unit,
|
|
11835
|
-
onClose: () => setDepositExecutions([])
|
|
11877
|
+
onClose: () => setDepositExecutions([]),
|
|
11878
|
+
execution: depositExecutions[0]
|
|
11836
11879
|
},
|
|
11837
11880
|
depositExecutions[0].id
|
|
11838
11881
|
) }),
|
|
11839
|
-
/* @__PURE__ */ (0,
|
|
11882
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11840
11883
|
DepositsModal,
|
|
11841
11884
|
{
|
|
11842
11885
|
open: depositsModalOpen,
|
|
@@ -11850,7 +11893,7 @@ function TransferCryptoBase({
|
|
|
11850
11893
|
] }) });
|
|
11851
11894
|
}
|
|
11852
11895
|
function TransferCrypto(props) {
|
|
11853
|
-
return /* @__PURE__ */ (0,
|
|
11896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11854
11897
|
TransferCryptoBase,
|
|
11855
11898
|
{
|
|
11856
11899
|
...props,
|
|
@@ -11865,14 +11908,14 @@ function CurrencyListItem({
|
|
|
11865
11908
|
onSelect
|
|
11866
11909
|
}) {
|
|
11867
11910
|
const iconUrl = getPreferredIconUrl(currency.icon_urls, "png") || currency.icon_url;
|
|
11868
|
-
return /* @__PURE__ */ (0,
|
|
11911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
11869
11912
|
"button",
|
|
11870
11913
|
{
|
|
11871
11914
|
onClick: () => onSelect(currency.currency_code),
|
|
11872
11915
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
11873
11916
|
children: [
|
|
11874
|
-
/* @__PURE__ */ (0,
|
|
11875
|
-
/* @__PURE__ */ (0,
|
|
11917
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
11918
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11876
11919
|
"img",
|
|
11877
11920
|
{
|
|
11878
11921
|
src: iconUrl,
|
|
@@ -11880,12 +11923,12 @@ function CurrencyListItem({
|
|
|
11880
11923
|
className: "uf-w-10 uf-h-10 uf-flex-shrink-0"
|
|
11881
11924
|
}
|
|
11882
11925
|
),
|
|
11883
|
-
/* @__PURE__ */ (0,
|
|
11884
|
-
/* @__PURE__ */ (0,
|
|
11885
|
-
/* @__PURE__ */ (0,
|
|
11926
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "uf-text-left", children: [
|
|
11927
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
|
|
11928
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
|
|
11886
11929
|
] })
|
|
11887
11930
|
] }),
|
|
11888
|
-
isSelected && /* @__PURE__ */ (0,
|
|
11931
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Check, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
|
|
11889
11932
|
]
|
|
11890
11933
|
}
|
|
11891
11934
|
);
|
|
@@ -11897,9 +11940,9 @@ function CurrencyListSection({
|
|
|
11897
11940
|
onSelect
|
|
11898
11941
|
}) {
|
|
11899
11942
|
if (currencies.length === 0) return null;
|
|
11900
|
-
return /* @__PURE__ */ (0,
|
|
11901
|
-
/* @__PURE__ */ (0,
|
|
11902
|
-
currencies.map((currency) => /* @__PURE__ */ (0,
|
|
11943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
11944
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "uf-px-1 uf-pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h3", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: title }) }),
|
|
11945
|
+
currencies.map((currency) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
11903
11946
|
CurrencyListItem,
|
|
11904
11947
|
{
|
|
11905
11948
|
currency,
|
|
@@ -11919,7 +11962,7 @@ function CurrencyModal({
|
|
|
11919
11962
|
onSelectCurrency,
|
|
11920
11963
|
themeClass = ""
|
|
11921
11964
|
}) {
|
|
11922
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
11965
|
+
const [searchQuery, setSearchQuery] = (0, import_react14.useState)("");
|
|
11923
11966
|
const preferredCurrencies = preferredCurrencyCodes.map(
|
|
11924
11967
|
(code) => currencies.find(
|
|
11925
11968
|
(currency) => currency.currency_code.toLowerCase() === code.toLowerCase()
|
|
@@ -11946,8 +11989,8 @@ function CurrencyModal({
|
|
|
11946
11989
|
onOpenChange(false);
|
|
11947
11990
|
setSearchQuery("");
|
|
11948
11991
|
};
|
|
11949
|
-
return /* @__PURE__ */ (0,
|
|
11950
|
-
/* @__PURE__ */ (0,
|
|
11992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
11993
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11951
11994
|
DepositHeader,
|
|
11952
11995
|
{
|
|
11953
11996
|
title: "Currency",
|
|
@@ -11956,9 +11999,9 @@ function CurrencyModal({
|
|
|
11956
11999
|
onClose: handleClose
|
|
11957
12000
|
}
|
|
11958
12001
|
),
|
|
11959
|
-
/* @__PURE__ */ (0,
|
|
11960
|
-
/* @__PURE__ */ (0,
|
|
11961
|
-
/* @__PURE__ */ (0,
|
|
12002
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "uf-relative", children: [
|
|
12003
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Search, { className: "uf-absolute uf-left-4 uf-top-1/2 uf--translate-y-1/2 uf-w-4 uf-h-4 uf-text-muted-foreground" }),
|
|
12004
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11962
12005
|
"input",
|
|
11963
12006
|
{
|
|
11964
12007
|
type: "text",
|
|
@@ -11969,8 +12012,8 @@ function CurrencyModal({
|
|
|
11969
12012
|
}
|
|
11970
12013
|
)
|
|
11971
12014
|
] }) }),
|
|
11972
|
-
/* @__PURE__ */ (0,
|
|
11973
|
-
/* @__PURE__ */ (0,
|
|
12015
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
12016
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11974
12017
|
CurrencyListSection,
|
|
11975
12018
|
{
|
|
11976
12019
|
title: "Popular currencies",
|
|
@@ -11979,8 +12022,8 @@ function CurrencyModal({
|
|
|
11979
12022
|
onSelect: handleSelect
|
|
11980
12023
|
}
|
|
11981
12024
|
),
|
|
11982
|
-
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0,
|
|
11983
|
-
/* @__PURE__ */ (0,
|
|
12025
|
+
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-h-2" }),
|
|
12026
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11984
12027
|
CurrencyListSection,
|
|
11985
12028
|
{
|
|
11986
12029
|
title: "All currencies",
|
|
@@ -11989,7 +12032,7 @@ function CurrencyModal({
|
|
|
11989
12032
|
onSelect: handleSelect
|
|
11990
12033
|
}
|
|
11991
12034
|
),
|
|
11992
|
-
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0,
|
|
12035
|
+
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
|
|
11993
12036
|
] }) })
|
|
11994
12037
|
] }) });
|
|
11995
12038
|
}
|
|
@@ -12005,12 +12048,12 @@ async function getIpViaIpApi() {
|
|
|
12005
12048
|
state: data.region_code?.toLowerCase()
|
|
12006
12049
|
};
|
|
12007
12050
|
}
|
|
12008
|
-
function
|
|
12051
|
+
function useUserIp2() {
|
|
12009
12052
|
const {
|
|
12010
12053
|
data: userIpInfo,
|
|
12011
12054
|
isLoading,
|
|
12012
12055
|
error
|
|
12013
|
-
} = (0,
|
|
12056
|
+
} = (0, import_react_query3.useQuery)({
|
|
12014
12057
|
queryKey: ["getUserIpInfo"],
|
|
12015
12058
|
queryFn: async () => {
|
|
12016
12059
|
try {
|
|
@@ -12038,7 +12081,7 @@ function useUserIp() {
|
|
|
12038
12081
|
error
|
|
12039
12082
|
};
|
|
12040
12083
|
}
|
|
12041
|
-
var t2 =
|
|
12084
|
+
var t2 = i18n2.buyWithCard;
|
|
12042
12085
|
var QUICK_AMOUNTS = [100, 500, 1e3];
|
|
12043
12086
|
function getCurrencySymbol(currencyCode) {
|
|
12044
12087
|
try {
|
|
@@ -12068,21 +12111,21 @@ function BuyWithCard({
|
|
|
12068
12111
|
wallets: externalWallets,
|
|
12069
12112
|
assetCdnUrl
|
|
12070
12113
|
}) {
|
|
12071
|
-
const [amount, setAmount] = (0,
|
|
12072
|
-
const [currency, setCurrency] = (0,
|
|
12073
|
-
const [showCurrencyModal, setShowCurrencyModal] = (0,
|
|
12074
|
-
const [quotes, setQuotes] = (0,
|
|
12075
|
-
const [quotesLoading, setQuotesLoading] = (0,
|
|
12076
|
-
const [quotesError, setQuotesError] = (0,
|
|
12077
|
-
const [internalView, setInternalView] = (0,
|
|
12078
|
-
const { userIpInfo, isLoading: isLoadingIp } =
|
|
12079
|
-
const [onrampSession, setOnrampSession] = (0,
|
|
12114
|
+
const [amount, setAmount] = (0, import_react13.useState)("500.00");
|
|
12115
|
+
const [currency, setCurrency] = (0, import_react13.useState)("usd");
|
|
12116
|
+
const [showCurrencyModal, setShowCurrencyModal] = (0, import_react13.useState)(false);
|
|
12117
|
+
const [quotes, setQuotes] = (0, import_react13.useState)([]);
|
|
12118
|
+
const [quotesLoading, setQuotesLoading] = (0, import_react13.useState)(false);
|
|
12119
|
+
const [quotesError, setQuotesError] = (0, import_react13.useState)(null);
|
|
12120
|
+
const [internalView, setInternalView] = (0, import_react13.useState)("amount");
|
|
12121
|
+
const { userIpInfo, isLoading: isLoadingIp } = useUserIp2();
|
|
12122
|
+
const [onrampSession, setOnrampSession] = (0, import_react13.useState)(
|
|
12080
12123
|
null
|
|
12081
12124
|
);
|
|
12082
12125
|
const currentView = externalView ?? internalView;
|
|
12083
12126
|
const showQuotesView = currentView === "quotes";
|
|
12084
12127
|
const showOnrampView = currentView === "onramp";
|
|
12085
|
-
(0,
|
|
12128
|
+
(0, import_react13.useEffect)(() => {
|
|
12086
12129
|
if (externalView) {
|
|
12087
12130
|
setInternalView(externalView);
|
|
12088
12131
|
}
|
|
@@ -12095,20 +12138,20 @@ function BuyWithCard({
|
|
|
12095
12138
|
onViewChange?.(newView);
|
|
12096
12139
|
}
|
|
12097
12140
|
};
|
|
12098
|
-
const [selectedProvider, setSelectedProvider] = (0,
|
|
12141
|
+
const [selectedProvider, setSelectedProvider] = (0, import_react13.useState)(
|
|
12099
12142
|
null
|
|
12100
12143
|
);
|
|
12101
|
-
const [isAutoSelected, setIsAutoSelected] = (0,
|
|
12102
|
-
const [autoSelectedProvider, setAutoSelectedProvider] = (0,
|
|
12103
|
-
const [hasManualSelection, setHasManualSelection] = (0,
|
|
12104
|
-
const [internalWallets, setInternalWallets] = (0,
|
|
12105
|
-
const [walletsLoading, setWalletsLoading] = (0,
|
|
12144
|
+
const [isAutoSelected, setIsAutoSelected] = (0, import_react13.useState)(true);
|
|
12145
|
+
const [autoSelectedProvider, setAutoSelectedProvider] = (0, import_react13.useState)(null);
|
|
12146
|
+
const [hasManualSelection, setHasManualSelection] = (0, import_react13.useState)(false);
|
|
12147
|
+
const [internalWallets, setInternalWallets] = (0, import_react13.useState)([]);
|
|
12148
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react13.useState)(!externalWallets?.length);
|
|
12106
12149
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
12107
|
-
const [countdown, setCountdown] = (0,
|
|
12108
|
-
const [fiatCurrencies, setFiatCurrencies] = (0,
|
|
12109
|
-
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0,
|
|
12110
|
-
const [currenciesLoading, setCurrenciesLoading] = (0,
|
|
12111
|
-
const [supportedTokens, setSupportedTokens] = (0,
|
|
12150
|
+
const [countdown, setCountdown] = (0, import_react13.useState)(60);
|
|
12151
|
+
const [fiatCurrencies, setFiatCurrencies] = (0, import_react13.useState)([]);
|
|
12152
|
+
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0, import_react13.useState)([]);
|
|
12153
|
+
const [currenciesLoading, setCurrenciesLoading] = (0, import_react13.useState)(true);
|
|
12154
|
+
const [supportedTokens, setSupportedTokens] = (0, import_react13.useState)([]);
|
|
12112
12155
|
const destinationWallet = getWalletByChainType(wallets, "ethereum");
|
|
12113
12156
|
const walletDestinationChainId = destinationWallet?.destination_chain_id;
|
|
12114
12157
|
const resolvedDestinationChainId = destinationChainId || walletDestinationChainId;
|
|
@@ -12117,7 +12160,7 @@ function BuyWithCard({
|
|
|
12117
12160
|
const destinationChain = destinationToken?.chains.find(
|
|
12118
12161
|
(c) => c.chain_id === resolvedDestinationChainId
|
|
12119
12162
|
);
|
|
12120
|
-
(0,
|
|
12163
|
+
(0, import_react13.useEffect)(() => {
|
|
12121
12164
|
async function fetchFiatCurrencies() {
|
|
12122
12165
|
try {
|
|
12123
12166
|
const response = await getFiatCurrencies(publishableKey);
|
|
@@ -12131,7 +12174,7 @@ function BuyWithCard({
|
|
|
12131
12174
|
}
|
|
12132
12175
|
fetchFiatCurrencies();
|
|
12133
12176
|
}, [publishableKey]);
|
|
12134
|
-
(0,
|
|
12177
|
+
(0, import_react13.useEffect)(() => {
|
|
12135
12178
|
if (externalWallets?.length) {
|
|
12136
12179
|
setWalletsLoading(false);
|
|
12137
12180
|
return;
|
|
@@ -12142,9 +12185,9 @@ function BuyWithCard({
|
|
|
12142
12185
|
if (isCancelled) return;
|
|
12143
12186
|
setWalletsLoading(true);
|
|
12144
12187
|
try {
|
|
12145
|
-
const response = await
|
|
12188
|
+
const response = await createDepositAddress(
|
|
12146
12189
|
{
|
|
12147
|
-
|
|
12190
|
+
external_user_id: userId,
|
|
12148
12191
|
recipient_address: recipientAddress,
|
|
12149
12192
|
destination_chain_type: destinationChainType,
|
|
12150
12193
|
destination_chain_id: destinationChainId,
|
|
@@ -12172,7 +12215,7 @@ function BuyWithCard({
|
|
|
12172
12215
|
}
|
|
12173
12216
|
};
|
|
12174
12217
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
|
|
12175
|
-
(0,
|
|
12218
|
+
(0, import_react13.useEffect)(() => {
|
|
12176
12219
|
async function fetchSupportedTokens() {
|
|
12177
12220
|
try {
|
|
12178
12221
|
const response = await getSupportedDepositTokens(publishableKey);
|
|
@@ -12183,7 +12226,7 @@ function BuyWithCard({
|
|
|
12183
12226
|
}
|
|
12184
12227
|
fetchSupportedTokens();
|
|
12185
12228
|
}, [publishableKey]);
|
|
12186
|
-
(0,
|
|
12229
|
+
(0, import_react13.useEffect)(() => {
|
|
12187
12230
|
const amountNum = parseFloat(amount);
|
|
12188
12231
|
if (isNaN(amountNum) || amountNum <= 0) {
|
|
12189
12232
|
setQuotes([]);
|
|
@@ -12263,7 +12306,7 @@ function BuyWithCard({
|
|
|
12263
12306
|
setQuotesLoading(false);
|
|
12264
12307
|
}
|
|
12265
12308
|
};
|
|
12266
|
-
(0,
|
|
12309
|
+
(0, import_react13.useEffect)(() => {
|
|
12267
12310
|
if (quotes.length === 0) return;
|
|
12268
12311
|
const timer = setInterval(() => {
|
|
12269
12312
|
setCountdown((prev) => {
|
|
@@ -12338,21 +12381,21 @@ function BuyWithCard({
|
|
|
12338
12381
|
(a, b) => b.destination_amount - a.destination_amount
|
|
12339
12382
|
);
|
|
12340
12383
|
const currencySymbol = getCurrencySymbol(currency);
|
|
12341
|
-
return /* @__PURE__ */ (0,
|
|
12342
|
-
/* @__PURE__ */ (0,
|
|
12384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-pb-1 uf-relative uf-overflow-hidden", children: [
|
|
12385
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12343
12386
|
"div",
|
|
12344
12387
|
{
|
|
12345
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
12388
|
+
className: `uf-transition-all uf-duration-300 uf-min-h-[420px] ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
12346
12389
|
children: [
|
|
12347
|
-
/* @__PURE__ */ (0,
|
|
12348
|
-
/* @__PURE__ */ (0,
|
|
12390
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-mb-6 uf-pt-4", children: [
|
|
12391
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12349
12392
|
"button",
|
|
12350
12393
|
{
|
|
12351
12394
|
onClick: () => setShowCurrencyModal(true),
|
|
12352
12395
|
disabled: currenciesLoading,
|
|
12353
12396
|
className: "uf-flex uf-items-center uf-gap-1.5 uf-px-3 uf-py-1.5 uf-rounded-lg uf-bg-secondary hover:uf-bg-accent uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
12354
12397
|
children: [
|
|
12355
|
-
selectedCurrencyData && /* @__PURE__ */ (0,
|
|
12398
|
+
selectedCurrencyData && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12356
12399
|
"img",
|
|
12357
12400
|
{
|
|
12358
12401
|
src: getPreferredIconUrl(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
@@ -12360,14 +12403,14 @@ function BuyWithCard({
|
|
|
12360
12403
|
className: "uf-w-4 uf-h-4"
|
|
12361
12404
|
}
|
|
12362
12405
|
),
|
|
12363
|
-
/* @__PURE__ */ (0,
|
|
12364
|
-
/* @__PURE__ */ (0,
|
|
12406
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
|
|
12407
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronDown, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
|
|
12365
12408
|
]
|
|
12366
12409
|
}
|
|
12367
12410
|
) }),
|
|
12368
|
-
/* @__PURE__ */ (0,
|
|
12369
|
-
/* @__PURE__ */ (0,
|
|
12370
|
-
/* @__PURE__ */ (0,
|
|
12411
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-center uf-mb-4", children: [
|
|
12412
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-flex uf-items-center uf-justify-center uf-mb-2 uf-px-8", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-max-w-full", children: [
|
|
12413
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12371
12414
|
"span",
|
|
12372
12415
|
{
|
|
12373
12416
|
className: "uf-font-normal uf-text-foreground uf-flex-shrink-0 uf-mr-1",
|
|
@@ -12377,7 +12420,7 @@ function BuyWithCard({
|
|
|
12377
12420
|
children: currencySymbol
|
|
12378
12421
|
}
|
|
12379
12422
|
),
|
|
12380
|
-
/* @__PURE__ */ (0,
|
|
12423
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12381
12424
|
"input",
|
|
12382
12425
|
{
|
|
12383
12426
|
type: "text",
|
|
@@ -12393,12 +12436,12 @@ function BuyWithCard({
|
|
|
12393
12436
|
}
|
|
12394
12437
|
)
|
|
12395
12438
|
] }) }),
|
|
12396
|
-
quotesLoading ? /* @__PURE__ */ (0,
|
|
12439
|
+
quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-flex uf-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-40 uf-animate-pulse" }) }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-sm uf-text-muted-foreground uf-font-normal", children: [
|
|
12397
12440
|
calculateUSDC(),
|
|
12398
12441
|
" USDC (Perps)"
|
|
12399
12442
|
] })
|
|
12400
12443
|
] }),
|
|
12401
|
-
/* @__PURE__ */ (0,
|
|
12444
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-flex uf-gap-3 uf-justify-center", children: QUICK_AMOUNTS.map((quickAmount) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12402
12445
|
"button",
|
|
12403
12446
|
{
|
|
12404
12447
|
onClick: () => handleQuickAmount(quickAmount),
|
|
@@ -12411,31 +12454,31 @@ function BuyWithCard({
|
|
|
12411
12454
|
quickAmount
|
|
12412
12455
|
)) })
|
|
12413
12456
|
] }),
|
|
12414
|
-
/* @__PURE__ */ (0,
|
|
12415
|
-
/* @__PURE__ */ (0,
|
|
12416
|
-
/* @__PURE__ */ (0,
|
|
12417
|
-
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0,
|
|
12457
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-mb-6", children: [
|
|
12458
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-font-medium uf-mb-2 uf-px-1", children: [
|
|
12459
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-foreground", children: "Provider" }),
|
|
12460
|
+
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
|
|
12418
12461
|
"Refreshing in ",
|
|
12419
12462
|
countdown,
|
|
12420
12463
|
"s"
|
|
12421
12464
|
] })
|
|
12422
12465
|
] }),
|
|
12423
|
-
/* @__PURE__ */ (0,
|
|
12466
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12424
12467
|
"button",
|
|
12425
12468
|
{
|
|
12426
12469
|
onClick: () => handleViewChange("quotes"),
|
|
12427
12470
|
disabled: quotesLoading || quotes.length === 0,
|
|
12428
12471
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-4 uf-group disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
12429
|
-
children: quotesLoading ? /* @__PURE__ */ (0,
|
|
12430
|
-
/* @__PURE__ */ (0,
|
|
12431
|
-
/* @__PURE__ */ (0,
|
|
12432
|
-
/* @__PURE__ */ (0,
|
|
12433
|
-
/* @__PURE__ */ (0,
|
|
12472
|
+
children: quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
|
|
12473
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
|
|
12474
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12475
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
|
|
12476
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
|
|
12434
12477
|
] })
|
|
12435
|
-
] }) : /* @__PURE__ */ (0,
|
|
12436
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
12437
|
-
selectedProvider && /* @__PURE__ */ (0,
|
|
12438
|
-
/* @__PURE__ */ (0,
|
|
12478
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-w-full uf-text-left", children: [
|
|
12479
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal uf-mb-2", children: "Auto-picked for you" }),
|
|
12480
|
+
selectedProvider && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12481
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12439
12482
|
"img",
|
|
12440
12483
|
{
|
|
12441
12484
|
src: selectedProvider.icon_url,
|
|
@@ -12445,22 +12488,22 @@ function BuyWithCard({
|
|
|
12445
12488
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
12446
12489
|
}
|
|
12447
12490
|
),
|
|
12448
|
-
/* @__PURE__ */ (0,
|
|
12449
|
-
/* @__PURE__ */ (0,
|
|
12450
|
-
/* @__PURE__ */ (0,
|
|
12451
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
12452
|
-
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0,
|
|
12453
|
-
selectedProvider.low_kyc === false && /* @__PURE__ */ (0,
|
|
12491
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
12492
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
|
|
12493
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
12494
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
|
|
12495
|
+
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
12496
|
+
selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
12454
12497
|
] })
|
|
12455
12498
|
] }),
|
|
12456
|
-
quotes.length > 0 && /* @__PURE__ */ (0,
|
|
12499
|
+
quotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors uf-flex-shrink-0" })
|
|
12457
12500
|
] })
|
|
12458
12501
|
] })
|
|
12459
12502
|
}
|
|
12460
12503
|
),
|
|
12461
|
-
quotesError && /* @__PURE__ */ (0,
|
|
12504
|
+
quotesError && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-xs uf-text-red-400 uf-mt-2 uf-px-1", children: quotesError })
|
|
12462
12505
|
] }),
|
|
12463
|
-
/* @__PURE__ */ (0,
|
|
12506
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12464
12507
|
"button",
|
|
12465
12508
|
{
|
|
12466
12509
|
onClick: handleContinue,
|
|
@@ -12475,15 +12518,15 @@ function BuyWithCard({
|
|
|
12475
12518
|
]
|
|
12476
12519
|
}
|
|
12477
12520
|
),
|
|
12478
|
-
/* @__PURE__ */ (0,
|
|
12521
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12479
12522
|
"div",
|
|
12480
12523
|
{
|
|
12481
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12482
|
-
children: /* @__PURE__ */ (0,
|
|
12524
|
+
className: `uf-transition-all uf-duration-300 uf-min-h-[420px] ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index2) => {
|
|
12483
12526
|
const badges = getProviderBadges(quote, sortedQuotes);
|
|
12484
12527
|
const displayName = quote.service_provider_display_name;
|
|
12485
12528
|
const isSelected = selectedProvider?.service_provider === quote.service_provider;
|
|
12486
|
-
return /* @__PURE__ */ (0,
|
|
12529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12487
12530
|
"button",
|
|
12488
12531
|
{
|
|
12489
12532
|
onClick: () => {
|
|
@@ -12496,8 +12539,8 @@ function BuyWithCard({
|
|
|
12496
12539
|
},
|
|
12497
12540
|
className: `uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group ${isSelected ? "uf-ring-2 uf-ring-inset uf-ring-primary" : ""}`,
|
|
12498
12541
|
children: [
|
|
12499
|
-
/* @__PURE__ */ (0,
|
|
12500
|
-
/* @__PURE__ */ (0,
|
|
12542
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12543
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12501
12544
|
"img",
|
|
12502
12545
|
{
|
|
12503
12546
|
src: quote.icon_url,
|
|
@@ -12507,10 +12550,10 @@ function BuyWithCard({
|
|
|
12507
12550
|
className: "uf-rounded-full"
|
|
12508
12551
|
}
|
|
12509
12552
|
) }),
|
|
12510
|
-
/* @__PURE__ */ (0,
|
|
12511
|
-
/* @__PURE__ */ (0,
|
|
12512
|
-
/* @__PURE__ */ (0,
|
|
12513
|
-
badges.map((badge, i) => /* @__PURE__ */ (0,
|
|
12553
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-left", children: [
|
|
12554
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
|
|
12555
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
12556
|
+
badges.map((badge, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12514
12557
|
"span",
|
|
12515
12558
|
{
|
|
12516
12559
|
className: "uf-text-[10px] uf-text-green-400 uf-font-normal",
|
|
@@ -12521,17 +12564,17 @@ function BuyWithCard({
|
|
|
12521
12564
|
},
|
|
12522
12565
|
i
|
|
12523
12566
|
)),
|
|
12524
|
-
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0,
|
|
12525
|
-
quote.low_kyc === false && /* @__PURE__ */ (0,
|
|
12567
|
+
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
12568
|
+
quote.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
12526
12569
|
] })
|
|
12527
12570
|
] })
|
|
12528
12571
|
] }),
|
|
12529
|
-
/* @__PURE__ */ (0,
|
|
12530
|
-
/* @__PURE__ */ (0,
|
|
12572
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-right", children: [
|
|
12573
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: [
|
|
12531
12574
|
quote.destination_amount.toFixed(2),
|
|
12532
12575
|
" USDC"
|
|
12533
12576
|
] }),
|
|
12534
|
-
/* @__PURE__ */ (0,
|
|
12577
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal", children: [
|
|
12535
12578
|
currencySymbol,
|
|
12536
12579
|
" ",
|
|
12537
12580
|
amount
|
|
@@ -12544,12 +12587,12 @@ function BuyWithCard({
|
|
|
12544
12587
|
}) })
|
|
12545
12588
|
}
|
|
12546
12589
|
),
|
|
12547
|
-
/* @__PURE__ */ (0,
|
|
12590
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12548
12591
|
"div",
|
|
12549
12592
|
{
|
|
12550
12593
|
className: `uf-transition-all uf-duration-300 ${showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12551
|
-
children: onrampSession && /* @__PURE__ */ (0,
|
|
12552
|
-
/* @__PURE__ */ (0,
|
|
12594
|
+
children: onrampSession && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-6 uf-pb-4 uf-px-2", children: [
|
|
12595
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12553
12596
|
"img",
|
|
12554
12597
|
{
|
|
12555
12598
|
src: onrampSession.provider.icon_url,
|
|
@@ -12559,62 +12602,62 @@ function BuyWithCard({
|
|
|
12559
12602
|
className: "uf-rounded-2xl"
|
|
12560
12603
|
}
|
|
12561
12604
|
) }),
|
|
12562
|
-
/* @__PURE__ */ (0,
|
|
12605
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h2", { className: "uf-text-xl uf-font-medium uf-text-foreground uf-mb-2", children: t2.onramp.completeTransaction.replace(
|
|
12563
12606
|
"{{provider}}",
|
|
12564
12607
|
onrampSession.provider.service_provider_display_name
|
|
12565
12608
|
) }),
|
|
12566
|
-
/* @__PURE__ */ (0,
|
|
12567
|
-
/* @__PURE__ */ (0,
|
|
12568
|
-
/* @__PURE__ */ (0,
|
|
12569
|
-
/* @__PURE__ */ (0,
|
|
12609
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
|
|
12610
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4 uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-center", children: [
|
|
12611
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12612
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12570
12613
|
"img",
|
|
12571
12614
|
{
|
|
12572
12615
|
src: getIconUrlWithCdn(
|
|
12573
|
-
`/icons/currencies/
|
|
12616
|
+
`/icons/currencies/png/${onrampSession.sourceCurrency.toLowerCase()}.png`,
|
|
12574
12617
|
assetCdnUrl
|
|
12575
12618
|
),
|
|
12576
12619
|
alt: onrampSession.sourceCurrency.toUpperCase(),
|
|
12577
12620
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12578
12621
|
}
|
|
12579
12622
|
) }),
|
|
12580
|
-
/* @__PURE__ */ (0,
|
|
12581
|
-
/* @__PURE__ */ (0,
|
|
12623
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youUse }),
|
|
12624
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: onrampSession.sourceCurrency.toUpperCase() })
|
|
12582
12625
|
] }),
|
|
12583
|
-
/* @__PURE__ */ (0,
|
|
12584
|
-
/* @__PURE__ */ (0,
|
|
12585
|
-
/* @__PURE__ */ (0,
|
|
12586
|
-
/* @__PURE__ */ (0,
|
|
12626
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
12627
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12628
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-relative", children: [
|
|
12629
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12587
12630
|
"img",
|
|
12588
12631
|
{
|
|
12589
|
-
src: getIconUrlWithCdn("/icons/tokens/
|
|
12632
|
+
src: getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
12590
12633
|
alt: "USDC",
|
|
12591
12634
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12592
12635
|
}
|
|
12593
12636
|
),
|
|
12594
|
-
/* @__PURE__ */ (0,
|
|
12637
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12595
12638
|
"img",
|
|
12596
12639
|
{
|
|
12597
|
-
src: getIconUrlWithCdn("/icons/networks/
|
|
12640
|
+
src: getIconUrlWithCdn("/icons/networks/png/polygon.png", assetCdnUrl),
|
|
12598
12641
|
alt: "Polygon",
|
|
12599
12642
|
className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
|
|
12600
12643
|
}
|
|
12601
12644
|
)
|
|
12602
12645
|
] }) }),
|
|
12603
|
-
/* @__PURE__ */ (0,
|
|
12604
|
-
/* @__PURE__ */ (0,
|
|
12646
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youBuy }),
|
|
12647
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: "USDC" })
|
|
12605
12648
|
] }),
|
|
12606
|
-
/* @__PURE__ */ (0,
|
|
12607
|
-
/* @__PURE__ */ (0,
|
|
12608
|
-
/* @__PURE__ */ (0,
|
|
12609
|
-
/* @__PURE__ */ (0,
|
|
12649
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
12650
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12651
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-relative", children: [
|
|
12652
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12610
12653
|
"img",
|
|
12611
12654
|
{
|
|
12612
|
-
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/
|
|
12655
|
+
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
12613
12656
|
alt: displayTokenSymbol,
|
|
12614
12657
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12615
12658
|
}
|
|
12616
12659
|
),
|
|
12617
|
-
destinationChain?.icon_url && /* @__PURE__ */ (0,
|
|
12660
|
+
destinationChain?.icon_url && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12618
12661
|
"img",
|
|
12619
12662
|
{
|
|
12620
12663
|
src: destinationChain.icon_url,
|
|
@@ -12623,15 +12666,15 @@ function BuyWithCard({
|
|
|
12623
12666
|
}
|
|
12624
12667
|
)
|
|
12625
12668
|
] }) }),
|
|
12626
|
-
/* @__PURE__ */ (0,
|
|
12627
|
-
/* @__PURE__ */ (0,
|
|
12669
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youReceive }),
|
|
12670
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: displayTokenSymbol })
|
|
12628
12671
|
] })
|
|
12629
12672
|
] }) }),
|
|
12630
|
-
/* @__PURE__ */ (0,
|
|
12673
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.onramp.intentAddressNote }) })
|
|
12631
12674
|
] })
|
|
12632
12675
|
}
|
|
12633
12676
|
),
|
|
12634
|
-
/* @__PURE__ */ (0,
|
|
12677
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12635
12678
|
CurrencyModal,
|
|
12636
12679
|
{
|
|
12637
12680
|
open: showCurrencyModal,
|
|
@@ -12654,23 +12697,23 @@ function TransferCryptoButton({
|
|
|
12654
12697
|
featuredTokens
|
|
12655
12698
|
}) {
|
|
12656
12699
|
const sortedTokens = featuredTokens ? [...featuredTokens].sort((a, b) => a.position - b.position) : [];
|
|
12657
|
-
return /* @__PURE__ */ (0,
|
|
12700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
12658
12701
|
"button",
|
|
12659
12702
|
{
|
|
12660
12703
|
onClick,
|
|
12661
12704
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
12662
12705
|
children: [
|
|
12663
|
-
/* @__PURE__ */ (0,
|
|
12664
|
-
/* @__PURE__ */ (0,
|
|
12665
|
-
/* @__PURE__ */ (0,
|
|
12666
|
-
/* @__PURE__ */ (0,
|
|
12667
|
-
/* @__PURE__ */ (0,
|
|
12706
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12707
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Zap, { className: "uf-w-5 uf-h-5" }) }),
|
|
12708
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-left", children: [
|
|
12709
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12710
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12668
12711
|
] })
|
|
12669
12712
|
] }),
|
|
12670
|
-
/* @__PURE__ */ (0,
|
|
12671
|
-
/* @__PURE__ */ (0,
|
|
12713
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12714
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
|
|
12672
12715
|
const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
|
|
12673
|
-
return /* @__PURE__ */ (0,
|
|
12716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12674
12717
|
"img",
|
|
12675
12718
|
{
|
|
12676
12719
|
src: iconUrl,
|
|
@@ -12682,7 +12725,7 @@ function TransferCryptoButton({
|
|
|
12682
12725
|
token.name
|
|
12683
12726
|
);
|
|
12684
12727
|
}) }),
|
|
12685
|
-
/* @__PURE__ */ (0,
|
|
12728
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12686
12729
|
] })
|
|
12687
12730
|
]
|
|
12688
12731
|
}
|
|
@@ -12694,23 +12737,23 @@ function DepositWithCardButton({
|
|
|
12694
12737
|
subtitle,
|
|
12695
12738
|
paymentNetworks
|
|
12696
12739
|
}) {
|
|
12697
|
-
return /* @__PURE__ */ (0,
|
|
12740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
12698
12741
|
"button",
|
|
12699
12742
|
{
|
|
12700
12743
|
onClick,
|
|
12701
12744
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
12702
12745
|
children: [
|
|
12703
|
-
/* @__PURE__ */ (0,
|
|
12704
|
-
/* @__PURE__ */ (0,
|
|
12705
|
-
/* @__PURE__ */ (0,
|
|
12706
|
-
/* @__PURE__ */ (0,
|
|
12707
|
-
/* @__PURE__ */ (0,
|
|
12746
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12747
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CreditCard, { className: "uf-w-5 uf-h-5" }) }),
|
|
12748
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-text-left", children: [
|
|
12749
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12750
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12708
12751
|
] })
|
|
12709
12752
|
] }),
|
|
12710
|
-
/* @__PURE__ */ (0,
|
|
12711
|
-
/* @__PURE__ */ (0,
|
|
12753
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12754
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
|
|
12712
12755
|
const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
|
|
12713
|
-
return /* @__PURE__ */ (0,
|
|
12756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
12714
12757
|
"img",
|
|
12715
12758
|
{
|
|
12716
12759
|
src: iconUrl,
|
|
@@ -12722,7 +12765,7 @@ function DepositWithCardButton({
|
|
|
12722
12765
|
network.name
|
|
12723
12766
|
);
|
|
12724
12767
|
}) }),
|
|
12725
|
-
/* @__PURE__ */ (0,
|
|
12768
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12726
12769
|
] })
|
|
12727
12770
|
]
|
|
12728
12771
|
}
|
|
@@ -12734,43 +12777,43 @@ function DepositTrackerButton({
|
|
|
12734
12777
|
subtitle,
|
|
12735
12778
|
badge
|
|
12736
12779
|
}) {
|
|
12737
|
-
return /* @__PURE__ */ (0,
|
|
12780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
12738
12781
|
"button",
|
|
12739
12782
|
{
|
|
12740
12783
|
onClick,
|
|
12741
12784
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
12742
12785
|
children: [
|
|
12743
|
-
/* @__PURE__ */ (0,
|
|
12744
|
-
/* @__PURE__ */ (0,
|
|
12745
|
-
/* @__PURE__ */ (0,
|
|
12746
|
-
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0,
|
|
12786
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12787
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
|
|
12788
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Clock, { className: "uf-w-5 uf-h-5" }),
|
|
12789
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-absolute -uf-top-1 -uf-right-1 uf-bg-blue-500 uf-text-primary-foreground uf-text-[10px] uf-font-semibold uf-rounded-full uf-min-w-[18px] uf-h-[18px] uf-flex uf-items-center uf-justify-center uf-px-1", children: badge > 99 ? "99+" : badge })
|
|
12747
12790
|
] }),
|
|
12748
|
-
/* @__PURE__ */ (0,
|
|
12749
|
-
/* @__PURE__ */ (0,
|
|
12750
|
-
/* @__PURE__ */ (0,
|
|
12791
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-text-left", children: [
|
|
12792
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12793
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12751
12794
|
] })
|
|
12752
12795
|
] }),
|
|
12753
|
-
/* @__PURE__ */ (0,
|
|
12796
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12754
12797
|
]
|
|
12755
12798
|
}
|
|
12756
12799
|
);
|
|
12757
12800
|
}
|
|
12758
12801
|
function SkeletonButton({ variant = "default" }) {
|
|
12759
|
-
return /* @__PURE__ */ (0,
|
|
12760
|
-
/* @__PURE__ */ (0,
|
|
12761
|
-
/* @__PURE__ */ (0,
|
|
12762
|
-
/* @__PURE__ */ (0,
|
|
12763
|
-
/* @__PURE__ */ (0,
|
|
12764
|
-
/* @__PURE__ */ (0,
|
|
12802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-animate-pulse", children: [
|
|
12803
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12804
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
12805
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-space-y-1.5", children: [
|
|
12806
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
12807
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
12765
12808
|
] })
|
|
12766
12809
|
] }),
|
|
12767
|
-
/* @__PURE__ */ (0,
|
|
12768
|
-
variant === "with-icons" && /* @__PURE__ */ (0,
|
|
12769
|
-
/* @__PURE__ */ (0,
|
|
12810
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12811
|
+
variant === "with-icons" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary" }, i)) }),
|
|
12812
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
12770
12813
|
] })
|
|
12771
12814
|
] });
|
|
12772
12815
|
}
|
|
12773
|
-
var t3 =
|
|
12816
|
+
var t3 = i18n2.depositModal;
|
|
12774
12817
|
function DepositModal({
|
|
12775
12818
|
open,
|
|
12776
12819
|
onOpenChange,
|
|
@@ -12830,9 +12873,9 @@ function DepositModal({
|
|
|
12830
12873
|
if (isCancelled) return;
|
|
12831
12874
|
setWalletsLoading(true);
|
|
12832
12875
|
try {
|
|
12833
|
-
const response = await
|
|
12876
|
+
const response = await createDepositAddress(
|
|
12834
12877
|
{
|
|
12835
|
-
|
|
12878
|
+
external_user_id: userId,
|
|
12836
12879
|
recipient_address: recipientAddress,
|
|
12837
12880
|
destination_chain_type: destinationChainType,
|
|
12838
12881
|
destination_chain_id: destinationChainId,
|
|
@@ -12884,27 +12927,27 @@ function DepositModal({
|
|
|
12884
12927
|
setQuotesCount(count3);
|
|
12885
12928
|
}
|
|
12886
12929
|
};
|
|
12887
|
-
return /* @__PURE__ */ (0,
|
|
12888
|
-
/* @__PURE__ */ (0,
|
|
12930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ThemeProvider, { themeClass, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Dialog2, { open, onOpenChange: handleClose, children: [
|
|
12931
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12889
12932
|
DialogContent2,
|
|
12890
12933
|
{
|
|
12891
12934
|
className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 uf-overflow-visible [&>button]:uf-hidden ${themeClass}`,
|
|
12892
12935
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
12893
12936
|
onInteractOutside: (e) => e.preventDefault(),
|
|
12894
|
-
children: view === "main" ? /* @__PURE__ */ (0,
|
|
12895
|
-
/* @__PURE__ */ (0,
|
|
12937
|
+
children: view === "main" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
12938
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12896
12939
|
DepositHeader,
|
|
12897
12940
|
{
|
|
12898
12941
|
title: modalTitle || "Deposit",
|
|
12899
12942
|
onClose: handleClose
|
|
12900
12943
|
}
|
|
12901
12944
|
),
|
|
12902
|
-
/* @__PURE__ */ (0,
|
|
12903
|
-
/* @__PURE__ */ (0,
|
|
12904
|
-
/* @__PURE__ */ (0,
|
|
12905
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
12906
|
-
] }) : /* @__PURE__ */ (0,
|
|
12907
|
-
/* @__PURE__ */ (0,
|
|
12945
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: !projectConfig ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
12946
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
12947
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
12948
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, {})
|
|
12949
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
12950
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12908
12951
|
TransferCryptoButton,
|
|
12909
12952
|
{
|
|
12910
12953
|
onClick: () => setView("transfer"),
|
|
@@ -12913,7 +12956,7 @@ function DepositModal({
|
|
|
12913
12956
|
featuredTokens: projectConfig.transfer_crypto.networks
|
|
12914
12957
|
}
|
|
12915
12958
|
),
|
|
12916
|
-
/* @__PURE__ */ (0,
|
|
12959
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12917
12960
|
DepositWithCardButton,
|
|
12918
12961
|
{
|
|
12919
12962
|
onClick: () => setView("card"),
|
|
@@ -12922,7 +12965,7 @@ function DepositModal({
|
|
|
12922
12965
|
paymentNetworks: projectConfig.payment_networks.networks
|
|
12923
12966
|
}
|
|
12924
12967
|
),
|
|
12925
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
12968
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12926
12969
|
DepositTrackerButton,
|
|
12927
12970
|
{
|
|
12928
12971
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -12932,8 +12975,8 @@ function DepositModal({
|
|
|
12932
12975
|
}
|
|
12933
12976
|
)
|
|
12934
12977
|
] }) })
|
|
12935
|
-
] }) : view === "transfer" ? /* @__PURE__ */ (0,
|
|
12936
|
-
/* @__PURE__ */ (0,
|
|
12978
|
+
] }) : view === "transfer" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
12979
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12937
12980
|
DepositHeader,
|
|
12938
12981
|
{
|
|
12939
12982
|
title: t3.transferCrypto.title,
|
|
@@ -12942,7 +12985,7 @@ function DepositModal({
|
|
|
12942
12985
|
onClose: handleClose
|
|
12943
12986
|
}
|
|
12944
12987
|
),
|
|
12945
|
-
/* @__PURE__ */ (0,
|
|
12988
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12946
12989
|
TransferCrypto,
|
|
12947
12990
|
{
|
|
12948
12991
|
userId,
|
|
@@ -12957,18 +13000,18 @@ function DepositModal({
|
|
|
12957
13000
|
wallets
|
|
12958
13001
|
}
|
|
12959
13002
|
)
|
|
12960
|
-
] }) : /* @__PURE__ */ (0,
|
|
12961
|
-
/* @__PURE__ */ (0,
|
|
13003
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
13004
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12962
13005
|
DepositHeader,
|
|
12963
13006
|
{
|
|
12964
|
-
title: cardView === "quotes" ? t3.quotes :
|
|
13007
|
+
title: cardView === "quotes" ? t3.quotes : t3.depositWithCard.title,
|
|
12965
13008
|
showBack: true,
|
|
12966
13009
|
onBack: handleBack,
|
|
12967
13010
|
onClose: handleClose,
|
|
12968
13011
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
12969
13012
|
}
|
|
12970
13013
|
),
|
|
12971
|
-
/* @__PURE__ */ (0,
|
|
13014
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12972
13015
|
BuyWithCard,
|
|
12973
13016
|
{
|
|
12974
13017
|
userId,
|
|
@@ -12990,11 +13033,12 @@ function DepositModal({
|
|
|
12990
13033
|
] })
|
|
12991
13034
|
}
|
|
12992
13035
|
),
|
|
12993
|
-
/* @__PURE__ */ (0,
|
|
13036
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12994
13037
|
DepositsModal,
|
|
12995
13038
|
{
|
|
12996
13039
|
open: depositsModalOpen,
|
|
12997
13040
|
onOpenChange: setDepositsModalOpen,
|
|
13041
|
+
onCloseAll: handleClose,
|
|
12998
13042
|
executions: depositExecutions,
|
|
12999
13043
|
userId,
|
|
13000
13044
|
publishableKey,
|
|
@@ -13003,6 +13047,45 @@ function DepositModal({
|
|
|
13003
13047
|
)
|
|
13004
13048
|
] }) });
|
|
13005
13049
|
}
|
|
13050
|
+
var buttonVariants = cva(
|
|
13051
|
+
"uf-inline-flex uf-items-center uf-justify-center uf-whitespace-nowrap uf-rounded-md uf-text-sm uf-font-medium uf-ring-offset-background uf-transition-colors focus-visible:uf-outline-none focus-visible:uf-ring-2 focus-visible:uf-ring-ring focus-visible:uf-ring-offset-2 disabled:uf-pointer-events-none disabled:uf-opacity-50",
|
|
13052
|
+
{
|
|
13053
|
+
variants: {
|
|
13054
|
+
variant: {
|
|
13055
|
+
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
13056
|
+
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
13057
|
+
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
13058
|
+
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
13059
|
+
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
13060
|
+
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
13061
|
+
},
|
|
13062
|
+
size: {
|
|
13063
|
+
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
13064
|
+
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
13065
|
+
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
13066
|
+
icon: "uf-h-10 uf-w-10"
|
|
13067
|
+
}
|
|
13068
|
+
},
|
|
13069
|
+
defaultVariants: {
|
|
13070
|
+
variant: "default",
|
|
13071
|
+
size: "default"
|
|
13072
|
+
}
|
|
13073
|
+
}
|
|
13074
|
+
);
|
|
13075
|
+
var Button = React52.forwardRef(
|
|
13076
|
+
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
13077
|
+
const Comp = asChild ? Slot3 : "button";
|
|
13078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
13079
|
+
Comp,
|
|
13080
|
+
{
|
|
13081
|
+
className: cn(buttonVariants({ variant, size: size4, className })),
|
|
13082
|
+
ref,
|
|
13083
|
+
...props
|
|
13084
|
+
}
|
|
13085
|
+
);
|
|
13086
|
+
}
|
|
13087
|
+
);
|
|
13088
|
+
Button.displayName = "Button";
|
|
13006
13089
|
|
|
13007
13090
|
// src/provider.tsx
|
|
13008
13091
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
@@ -13011,12 +13094,12 @@ function UnifoldProvider2({
|
|
|
13011
13094
|
publishableKey,
|
|
13012
13095
|
config
|
|
13013
13096
|
}) {
|
|
13014
|
-
const [isOpen, setIsOpen] = (0,
|
|
13015
|
-
const [depositConfig, setDepositConfig] = (0,
|
|
13097
|
+
const [isOpen, setIsOpen] = (0, import_react15.useState)(false);
|
|
13098
|
+
const [depositConfig, setDepositConfig] = (0, import_react15.useState)(
|
|
13016
13099
|
null
|
|
13017
13100
|
);
|
|
13018
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
13019
|
-
|
|
13101
|
+
const [resolvedTheme, setResolvedTheme] = import_react15.default.useState("dark");
|
|
13102
|
+
import_react15.default.useEffect(() => {
|
|
13020
13103
|
const appearance = config?.appearance || "dark";
|
|
13021
13104
|
if (appearance === "auto") {
|
|
13022
13105
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
@@ -13031,9 +13114,9 @@ function UnifoldProvider2({
|
|
|
13031
13114
|
setResolvedTheme(appearance);
|
|
13032
13115
|
}
|
|
13033
13116
|
}, [config?.appearance]);
|
|
13034
|
-
const depositPromiseRef =
|
|
13035
|
-
const closeTimeoutRef =
|
|
13036
|
-
const beginDeposit = (0,
|
|
13117
|
+
const depositPromiseRef = import_react15.default.useRef(null);
|
|
13118
|
+
const closeTimeoutRef = import_react15.default.useRef(null);
|
|
13119
|
+
const beginDeposit = (0, import_react15.useCallback)((config2) => {
|
|
13037
13120
|
console.log("[UnifoldProvider] beginDeposit called with:", config2);
|
|
13038
13121
|
if (closeTimeoutRef.current) {
|
|
13039
13122
|
clearTimeout(closeTimeoutRef.current);
|
|
@@ -13054,7 +13137,7 @@ function UnifoldProvider2({
|
|
|
13054
13137
|
setIsOpen(true);
|
|
13055
13138
|
return promise;
|
|
13056
13139
|
}, []);
|
|
13057
|
-
const closeDeposit = (0,
|
|
13140
|
+
const closeDeposit = (0, import_react15.useCallback)(() => {
|
|
13058
13141
|
if (depositPromiseRef.current) {
|
|
13059
13142
|
depositPromiseRef.current.reject({
|
|
13060
13143
|
message: "Deposit cancelled by user",
|
|
@@ -13068,7 +13151,7 @@ function UnifoldProvider2({
|
|
|
13068
13151
|
closeTimeoutRef.current = null;
|
|
13069
13152
|
}, 200);
|
|
13070
13153
|
}, []);
|
|
13071
|
-
const handleDepositSuccess = (0,
|
|
13154
|
+
const handleDepositSuccess = (0, import_react15.useCallback)((data) => {
|
|
13072
13155
|
console.log("[UnifoldProvider] Deposit success:", data);
|
|
13073
13156
|
if (depositConfig?.onSuccess) {
|
|
13074
13157
|
depositConfig.onSuccess(data);
|
|
@@ -13078,7 +13161,7 @@ function UnifoldProvider2({
|
|
|
13078
13161
|
depositPromiseRef.current = null;
|
|
13079
13162
|
}
|
|
13080
13163
|
}, [depositConfig]);
|
|
13081
|
-
const handleDepositError = (0,
|
|
13164
|
+
const handleDepositError = (0, import_react15.useCallback)((error) => {
|
|
13082
13165
|
console.error("[UnifoldProvider] Deposit error:", error);
|
|
13083
13166
|
if (depositConfig?.onError) {
|
|
13084
13167
|
depositConfig.onError(error);
|
|
@@ -13088,7 +13171,7 @@ function UnifoldProvider2({
|
|
|
13088
13171
|
depositPromiseRef.current = null;
|
|
13089
13172
|
}
|
|
13090
13173
|
}, [depositConfig]);
|
|
13091
|
-
const contextValue = (0,
|
|
13174
|
+
const contextValue = (0, import_react15.useMemo)(
|
|
13092
13175
|
() => ({
|
|
13093
13176
|
beginDeposit,
|
|
13094
13177
|
closeDeposit,
|
|
@@ -13104,7 +13187,7 @@ function UnifoldProvider2({
|
|
|
13104
13187
|
{
|
|
13105
13188
|
open: isOpen,
|
|
13106
13189
|
onOpenChange: closeDeposit,
|
|
13107
|
-
userId: depositConfig.
|
|
13190
|
+
userId: depositConfig.externalUserId,
|
|
13108
13191
|
publishableKey,
|
|
13109
13192
|
modalTitle: config?.modalTitle,
|
|
13110
13193
|
destinationTokenSymbol: depositConfig.destinationTokenSymbol,
|
|
@@ -13120,10 +13203,10 @@ function UnifoldProvider2({
|
|
|
13120
13203
|
)
|
|
13121
13204
|
] }) });
|
|
13122
13205
|
}
|
|
13123
|
-
var ConnectContext =
|
|
13206
|
+
var ConnectContext = import_react15.default.createContext(null);
|
|
13124
13207
|
function useUnifold2() {
|
|
13125
13208
|
const baseContext = useUnifold();
|
|
13126
|
-
const connectContext =
|
|
13209
|
+
const connectContext = import_react15.default.useContext(ConnectContext);
|
|
13127
13210
|
if (typeof window === "undefined") {
|
|
13128
13211
|
return {
|
|
13129
13212
|
publishableKey: "",
|
|
@@ -13151,15 +13234,12 @@ function useUnifold2() {
|
|
|
13151
13234
|
|
|
13152
13235
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
13153
13236
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
13154
|
-
lucide-react/dist/esm/icons/arrow-down-circle.js:
|
|
13155
13237
|
lucide-react/dist/esm/icons/arrow-left.js:
|
|
13156
|
-
lucide-react/dist/esm/icons/check-circle.js:
|
|
13157
13238
|
lucide-react/dist/esm/icons/check.js:
|
|
13158
13239
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
13159
13240
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
13160
13241
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
13161
13242
|
lucide-react/dist/esm/icons/clock.js:
|
|
13162
|
-
lucide-react/dist/esm/icons/copy.js:
|
|
13163
13243
|
lucide-react/dist/esm/icons/credit-card.js:
|
|
13164
13244
|
lucide-react/dist/esm/icons/dollar-sign.js:
|
|
13165
13245
|
lucide-react/dist/esm/icons/external-link.js:
|