@rhinestone/deposit-modal 0.12.2 → 0.13.0

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.
Files changed (65) hide show
  1. package/README.md +30 -16
  2. package/dist/ClaimModal-CREZO27I.mjs +11 -0
  3. package/dist/ClaimModal-JRIA32U2.cjs +11 -0
  4. package/dist/{DepositModalReown-TEC3MEZ4.mjs → DepositModalReown-3H75G3XQ.mjs} +44 -22
  5. package/dist/{DepositModalReown-VG66OTIU.cjs → DepositModalReown-YNNHLAV2.cjs} +57 -35
  6. package/dist/{QRCode-WUC652SH.mjs → QRCode-5RGIZZHL.mjs} +1 -1
  7. package/dist/{QRCode-5DXFNKI2.cjs → QRCode-JKXG4RHN.cjs} +2 -2
  8. package/dist/WithdrawModal-NVRX44IZ.mjs +10 -0
  9. package/dist/WithdrawModal-YYSBPCJJ.cjs +10 -0
  10. package/dist/{chunk-OIN4CXCP.cjs → chunk-2G2EIN4A.cjs} +1510 -896
  11. package/dist/{chunk-O7BCVQ6L.cjs → chunk-4KCSH4T3.cjs} +157 -199
  12. package/dist/{chunk-TM7VGHAG.cjs → chunk-5NUIKYSF.cjs} +83 -209
  13. package/dist/{chunk-UQIJU6HV.cjs → chunk-7N77GIP4.cjs} +102 -88
  14. package/dist/{chunk-J46WDSRD.mjs → chunk-COCBCQQC.mjs} +121 -86
  15. package/dist/chunk-CVGNCUVU.cjs +154 -0
  16. package/dist/{chunk-SDSKIJC7.mjs → chunk-DSIZNRWA.mjs} +1540 -926
  17. package/dist/{chunk-75DVGSAX.cjs → chunk-DW2EQA2U.cjs} +6 -3
  18. package/dist/{chunk-FXXUIK4E.mjs → chunk-EOMT5LKX.mjs} +374 -151
  19. package/dist/chunk-FZ5FZFIG.mjs +31 -0
  20. package/dist/chunk-GACIGCSN.cjs +31 -0
  21. package/dist/{chunk-HL5NUKZW.cjs → chunk-HOGZKHHY.cjs} +3 -3
  22. package/dist/{chunk-FLVLYO64.mjs → chunk-LTMMETAB.mjs} +29 -15
  23. package/dist/{chunk-2TPSF77V.mjs → chunk-OLCD75JK.mjs} +20 -146
  24. package/dist/{chunk-PWLEBV5V.cjs → chunk-RAADLTSW.cjs} +240 -205
  25. package/dist/{chunk-4ZXQPFNU.mjs → chunk-RN5VKWI6.mjs} +4 -1
  26. package/dist/{chunk-3STTWRAN.mjs → chunk-VUATPOWJ.mjs} +147 -189
  27. package/dist/{chunk-JE4R5VA3.mjs → chunk-XYJFEN5D.mjs} +1 -1
  28. package/dist/chunk-YREVFB64.mjs +154 -0
  29. package/dist/{chunk-BRYNGLDM.cjs → chunk-ZMT4ATHR.cjs} +437 -214
  30. package/dist/claim.cjs +7 -6
  31. package/dist/claim.d.cts +11 -3
  32. package/dist/claim.d.ts +11 -3
  33. package/dist/claim.mjs +6 -5
  34. package/dist/{constants-FuzG3h4m.d.cts → constants-DBrWhJWE.d.cts} +12 -7
  35. package/dist/{constants-FuzG3h4m.d.ts → constants-DBrWhJWE.d.ts} +12 -7
  36. package/dist/constants.cjs +3 -9
  37. package/dist/constants.d.cts +2 -3
  38. package/dist/constants.d.ts +2 -3
  39. package/dist/constants.mjs +4 -10
  40. package/dist/deposit.cjs +8 -8
  41. package/dist/deposit.d.cts +2 -2
  42. package/dist/deposit.d.ts +2 -2
  43. package/dist/deposit.mjs +7 -7
  44. package/dist/embed.cjs +1268 -0
  45. package/dist/embed.d.cts +177 -0
  46. package/dist/embed.d.ts +177 -0
  47. package/dist/embed.mjs +1268 -0
  48. package/dist/index.cjs +11 -16
  49. package/dist/index.d.cts +3 -3
  50. package/dist/index.d.ts +3 -3
  51. package/dist/index.mjs +14 -19
  52. package/dist/modal-ui-state-OD1RmKkK.d.cts +30 -0
  53. package/dist/modal-ui-state-OD1RmKkK.d.ts +30 -0
  54. package/dist/polymarket.cjs +17 -7
  55. package/dist/polymarket.mjs +13 -3
  56. package/dist/styles.css +124 -98
  57. package/dist/{types-oFblf65g.d.ts → types-B89I8_8H.d.ts} +27 -1
  58. package/dist/{types-BO4iP6fG.d.cts → types-nnDR4tqA.d.cts} +27 -1
  59. package/dist/withdraw.cjs +6 -6
  60. package/dist/withdraw.d.cts +11 -3
  61. package/dist/withdraw.d.ts +11 -3
  62. package/dist/withdraw.mjs +5 -5
  63. package/package.json +33 -1
  64. package/dist/chunk-IAGFDSNC.mjs +0 -11
  65. package/dist/chunk-L32UI7LA.cjs +0 -11
@@ -1,9 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkHL5NUKZWcjs = require('./chunk-HL5NUKZW.cjs');
4
3
 
4
+ var _chunkCVGNCUVUcjs = require('./chunk-CVGNCUVU.cjs');
5
5
 
6
6
 
7
+ var _chunkHOGZKHHYcjs = require('./chunk-HOGZKHHY.cjs');
7
8
 
8
9
 
9
10
 
@@ -28,17 +29,15 @@ var _chunkHL5NUKZWcjs = require('./chunk-HL5NUKZW.cjs');
28
29
 
29
30
 
30
31
 
31
- var _chunkBRYNGLDMcjs = require('./chunk-BRYNGLDM.cjs');
32
32
 
33
+ var _chunkZMT4ATHRcjs = require('./chunk-ZMT4ATHR.cjs');
33
34
 
34
- var _chunkL32UI7LAcjs = require('./chunk-L32UI7LA.cjs');
35
35
 
36
36
 
37
37
 
38
38
 
39
39
 
40
-
41
- var _chunkO7BCVQ6Lcjs = require('./chunk-O7BCVQ6L.cjs');
40
+ var _chunk4KCSH4T3cjs = require('./chunk-4KCSH4T3.cjs');
42
41
 
43
42
  // src/ClaimModal.tsx
44
43
 
@@ -68,7 +67,7 @@ var Input = _react.forwardRef.call(void 0,
68
67
  }
69
68
  ),
70
69
  error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-input-error", children: [
71
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.AlertTriangleIcon, { className: "rs-input-error-icon" }),
70
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.AlertTriangleIcon, { className: "rs-input-error-icon" }),
72
71
  error
73
72
  ] })
74
73
  ] });
@@ -76,142 +75,6 @@ var Input = _react.forwardRef.call(void 0,
76
75
  );
77
76
  Input.displayName = "Input";
78
77
 
79
- // src/core/recovery.ts
80
- var RECOVER_DOMAIN = {
81
- name: "Rhinestone Deposit Recovery",
82
- version: "1"
83
- };
84
- var RECOVER_TYPES = {
85
- RecoverDeposit: [
86
- { name: "depositId", type: "uint256" },
87
- { name: "destination", type: "address" }
88
- ]
89
- };
90
- var RecoveryError = class extends Error {
91
- constructor(message, status, code, retryable = false) {
92
- super(message);
93
- this.name = "RecoveryError";
94
- this.status = status;
95
- this.code = code;
96
- this.retryable = retryable;
97
- }
98
- };
99
- function formatRecoveryError(status, code, serverMessage) {
100
- switch (code) {
101
- case "DEPOSIT_NOT_RECOVERABLE":
102
- return {
103
- message: "This deposit can't be recovered \u2014 it may already have been claimed.",
104
- retryable: false
105
- };
106
- case "RECOVERY_UNSUPPORTED":
107
- return {
108
- message: "This deposit can't be recovered automatically. Contact support to get your funds back.",
109
- retryable: false
110
- };
111
- case "SIGNATURE_INVALID":
112
- return {
113
- message: "That signature wasn't accepted for this wallet. Contact support to recover this deposit.",
114
- retryable: false
115
- };
116
- case "VERIFICATION_UNAVAILABLE":
117
- return {
118
- message: "Couldn't verify your signature just now. Try again shortly.",
119
- retryable: true
120
- };
121
- case "REFUND_RECONCILIATION_REQUIRED":
122
- return {
123
- message: "Your recovery is being reviewed. Contact support with this deposit if it doesn't arrive.",
124
- retryable: false
125
- };
126
- case "REFUND_FAILED":
127
- return {
128
- message: _nullishCoalesce(serverMessage, () => ( "The recovery couldn't be completed. Please try again or contact support.")),
129
- retryable: true
130
- };
131
- default:
132
- if (status === 0) {
133
- return {
134
- message: "Couldn't reach the recovery service. Check your connection and try again.",
135
- retryable: true
136
- };
137
- }
138
- return {
139
- message: _nullishCoalesce(serverMessage, () => ( "The recovery couldn't be completed. Please try again or contact support.")),
140
- retryable: true
141
- };
142
- }
143
- }
144
- async function submitSignedRecovery(params) {
145
- const { backendUrl, depositId, signer, destination, signRecovery, debug } = params;
146
- const scope = "service:recovery";
147
- const typedData = {
148
- domain: RECOVER_DOMAIN,
149
- types: RECOVER_TYPES,
150
- primaryType: "RecoverDeposit",
151
- message: { depositId: BigInt(depositId), destination }
152
- };
153
- let signature;
154
- try {
155
- signature = await signRecovery({ typedData, signer, depositId, destination });
156
- } catch (error) {
157
- _chunkBRYNGLDMcjs.debugError.call(void 0, debug, scope, "signRecovery:failed", error);
158
- throw new RecoveryError(
159
- "Signature request was declined. Approve it in your wallet to recover this deposit.",
160
- 0,
161
- void 0,
162
- true
163
- );
164
- }
165
- if (!signature) {
166
- throw new RecoveryError(
167
- "Signature request was declined. Approve it in your wallet to recover this deposit.",
168
- 0,
169
- void 0,
170
- true
171
- );
172
- }
173
- const url = `${backendUrl.replace(/\/$/, "")}/deposits/recover`;
174
- _chunkBRYNGLDMcjs.debugLog.call(void 0, debug, scope, "submitSignedRecovery:request", {
175
- url,
176
- depositId,
177
- signer
178
- });
179
- let response;
180
- try {
181
- response = await fetch(url, {
182
- method: "POST",
183
- // The shared const, so recovery carries `x-deposit-modal-version` like
184
- // every other backend call. Without it this path would be invisible in the
185
- // per-client version telemetry the processor records.
186
- headers: _chunkL32UI7LAcjs.SERVICE_HEADERS,
187
- // `depositId` as a string: it is a uint256 upstream and JSON numbers lose
188
- // precision well before that range.
189
- body: JSON.stringify({ depositId, destination, signature })
190
- });
191
- } catch (error) {
192
- _chunkBRYNGLDMcjs.debugError.call(void 0, debug, scope, "submitSignedRecovery:network", error);
193
- const { message, retryable } = formatRecoveryError(0);
194
- throw new RecoveryError(message, 0, void 0, retryable);
195
- }
196
- if (!response.ok) {
197
- const body = await response.json().catch(() => ({}));
198
- _chunkBRYNGLDMcjs.debugError.call(void 0, debug, scope, "submitSignedRecovery:failed", body, {
199
- status: response.status
200
- });
201
- const { message, retryable } = formatRecoveryError(
202
- response.status,
203
- body.code,
204
- body.error
205
- );
206
- throw new RecoveryError(message, response.status, body.code, retryable);
207
- }
208
- const result = await response.json();
209
- _chunkBRYNGLDMcjs.debugLog.call(void 0, debug, scope, "submitSignedRecovery:success", {
210
- transactionHash: result.transactionHash
211
- });
212
- return result;
213
- }
214
-
215
78
  // src/ClaimModal.tsx
216
79
 
217
80
  function evmChainIdFromCaip2(chain) {
@@ -224,17 +87,17 @@ function isEligible(row) {
224
87
  }
225
88
  function describeDeposit(row) {
226
89
  const chainId = _nullishCoalesce(evmChainIdFromCaip2(row.chain), () => ( 0));
227
- const decimals = _chunkO7BCVQ6Lcjs.getTokenDecimalsByAddress.call(void 0, row.token, chainId);
228
- const symbol = _chunkO7BCVQ6Lcjs.getTokenSymbol.call(void 0, row.token, chainId);
90
+ const decimals = _chunk4KCSH4T3cjs.getTokenDecimalsByAddress.call(void 0, row.token, chainId);
91
+ const symbol = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, row.token, chainId);
229
92
  const raw = BigInt(_nullishCoalesce(_nullishCoalesce(row.sourceAmount, () => ( row.amount)), () => ( "0")));
230
93
  const human = Number(_viem.formatUnits.call(void 0, raw, decimals));
231
- const amount = _nullishCoalesce(_chunkBRYNGLDMcjs.formatTokenAmount.call(void 0, human, symbol), () => ( _viem.formatUnits.call(void 0, raw, decimals)));
94
+ const amount = _nullishCoalesce(_chunkZMT4ATHRcjs.formatTokenAmount.call(void 0, human, symbol), () => ( _viem.formatUnits.call(void 0, raw, decimals)));
232
95
  return {
233
96
  chainId,
234
97
  symbol,
235
98
  amount,
236
- chainName: _chunkO7BCVQ6Lcjs.getChainName.call(void 0, chainId),
237
- chainIcon: _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, chainId)
99
+ chainName: _chunk4KCSH4T3cjs.getChainName.call(void 0, chainId),
100
+ chainIcon: _chunk4KCSH4T3cjs.getChainIcon.call(void 0, chainId)
238
101
  };
239
102
  }
240
103
  function shortenHash(hash) {
@@ -323,17 +186,18 @@ function ClaimModal({
323
186
  onLifecycle,
324
187
  onEvent,
325
188
  onError,
326
- debug
189
+ debug,
190
+ onUiState
327
191
  }) {
328
- _chunkBRYNGLDMcjs.checkBackendUrl.call(void 0, "ClaimModal", backendUrl);
192
+ _chunkZMT4ATHRcjs.checkBackendUrl.call(void 0, "ClaimModal", backendUrl);
329
193
  const modalRef = _react.useRef.call(void 0, null);
330
- const onReadyRef = _chunkBRYNGLDMcjs.useLatestRef.call(void 0, onReady);
331
- const onLifecycleRef = _chunkBRYNGLDMcjs.useLatestRef.call(void 0, onLifecycle);
332
- const onEventRef = _chunkBRYNGLDMcjs.useLatestRef.call(void 0, onEvent);
333
- const onErrorRef = _chunkBRYNGLDMcjs.useLatestRef.call(void 0, onError);
334
- const rpcUrls = _chunkBRYNGLDMcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
194
+ const onReadyRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onReady);
195
+ const onLifecycleRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onLifecycle);
196
+ const onEventRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onEvent);
197
+ const onErrorRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onError);
198
+ const rpcUrls = _chunkZMT4ATHRcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
335
199
  const service = _react.useMemo.call(void 0,
336
- () => _chunkBRYNGLDMcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:claim" }),
200
+ () => _chunkZMT4ATHRcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:claim" }),
337
201
  [backendUrl, debug]
338
202
  );
339
203
  const [state, dispatch] = _react.useReducer.call(void 0, claimReducer, INITIAL_STATE);
@@ -341,7 +205,8 @@ function ClaimModal({
341
205
  const isOpenRef = _react.useRef.call(void 0, isOpen);
342
206
  isOpenRef.current = isOpen;
343
207
  _react.useEffect.call(void 0, () => {
344
- if (isOpen && modalRef.current) _chunkBRYNGLDMcjs.applyTheme.call(void 0, modalRef.current, theme);
208
+ if (!isOpen || !modalRef.current) return;
209
+ return _chunkZMT4ATHRcjs.applyTheme.call(void 0, modalRef.current, theme);
345
210
  }, [isOpen, theme]);
346
211
  _react.useEffect.call(void 0, () => {
347
212
  if (isOpen) {
@@ -362,9 +227,17 @@ function ClaimModal({
362
227
  }
363
228
  }, [state.step, onClose]);
364
229
  const canGoBack = state.step === "select" || state.step === "review" || state.step === "failed";
365
- const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _7 => _7.showBackButton]), () => ( true));
366
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
367
- _chunkBRYNGLDMcjs.Modal,
230
+ const onUiStateRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onUiState);
231
+ _react.useEffect.call(void 0, () => {
232
+ _optionalChain([onUiStateRef, 'access', _7 => _7.current, 'optionalCall', _8 => _8({
233
+ screen: state.step,
234
+ back: canGoBack ? () => dispatch({ type: "back" }) : void 0,
235
+ submitting: state.step === "processing"
236
+ })]);
237
+ }, [state.step, canGoBack, onUiStateRef]);
238
+ const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _9 => _9.showBackButton]), () => ( true));
239
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
240
+ _chunkZMT4ATHRcjs.Modal,
368
241
  {
369
242
  isOpen,
370
243
  onClose: handleClose,
@@ -380,7 +253,7 @@ function ClaimModal({
380
253
  className: "rs-modal-header-back",
381
254
  "aria-label": "Go back",
382
255
  onClick: () => dispatch({ type: "back" }),
383
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.ChevronLeftIcon, {})
256
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChevronLeftIcon, {})
384
257
  }
385
258
  ) }),
386
259
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -391,7 +264,7 @@ function ClaimModal({
391
264
  disabled: state.step === "processing",
392
265
  className: "rs-modal-close",
393
266
  "aria-label": "Close",
394
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.CloseIcon, {})
267
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CloseIcon, {})
395
268
  }
396
269
  ) })
397
270
  ] }),
@@ -503,19 +376,20 @@ function ClaimBody({
503
376
  const operationEpoch = operationEpochRef.current;
504
377
  const isCurrentOperation = () => isOpenRef.current && operationEpochRef.current === operationEpoch;
505
378
  dispatch({ type: "submit" });
506
- _optionalChain([onEventRef, 'access', _8 => _8.current, 'optionalCall', _9 => _9({
379
+ _optionalChain([onEventRef, 'access', _10 => _10.current, 'optionalCall', _11 => _11({
507
380
  type: "claim_modal_refund_click",
508
381
  chain: `eip155:${sourceChainId}`
509
382
  })]);
510
- _optionalChain([onLifecycleRef, 'access', _10 => _10.current, 'optionalCall', _11 => _11({
383
+ _optionalChain([onLifecycleRef, 'access', _12 => _12.current, 'optionalCall', _13 => _13({
511
384
  type: "refund_requested",
512
385
  account,
513
386
  destination,
514
387
  chain: sourceChainId
515
388
  })]);
516
389
  try {
517
- const result = await submitSignedRecovery({
390
+ const result = await _chunkCVGNCUVUcjs.submitSignedRecovery.call(void 0, {
518
391
  backendUrl,
392
+ chainId: sourceChainId,
519
393
  depositId: deposit.id,
520
394
  signer,
521
395
  destination,
@@ -524,12 +398,12 @@ function ClaimBody({
524
398
  });
525
399
  if (!isCurrentOperation()) return;
526
400
  const paidTo = destination;
527
- const decimals = _chunkO7BCVQ6Lcjs.getTokenDecimalsByAddress.call(void 0, token, sourceChainId);
528
- const symbol = _chunkO7BCVQ6Lcjs.getTokenSymbol.call(void 0, token, sourceChainId);
401
+ const decimals = _chunk4KCSH4T3cjs.getTokenDecimalsByAddress.call(void 0, token, sourceChainId);
402
+ const symbol = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, token, sourceChainId);
529
403
  const refundedRaw = BigInt(
530
404
  _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(result.amount, () => ( deposit.sourceAmount)), () => ( deposit.amount)), () => ( "0"))
531
405
  );
532
- const amountDisplay = _nullishCoalesce(_chunkBRYNGLDMcjs.formatTokenAmount.call(void 0, Number(_viem.formatUnits.call(void 0, refundedRaw, decimals)), symbol), () => ( _viem.formatUnits.call(void 0, refundedRaw, decimals)));
406
+ const amountDisplay = _nullishCoalesce(_chunkZMT4ATHRcjs.formatTokenAmount.call(void 0, Number(_viem.formatUnits.call(void 0, refundedRaw, decimals)), symbol), () => ( _viem.formatUnits.call(void 0, refundedRaw, decimals)));
533
407
  dispatch({
534
408
  type: "complete",
535
409
  txHash: result.transactionHash,
@@ -539,11 +413,11 @@ function ClaimBody({
539
413
  destination: paidTo,
540
414
  chain: sourceChainId
541
415
  });
542
- _optionalChain([onEventRef, 'access', _12 => _12.current, 'optionalCall', _13 => _13({
416
+ _optionalChain([onEventRef, 'access', _14 => _14.current, 'optionalCall', _15 => _15({
543
417
  type: "claim_modal_complete",
544
418
  chain: `eip155:${sourceChainId}`
545
419
  })]);
546
- _optionalChain([onLifecycleRef, 'access', _14 => _14.current, 'optionalCall', _15 => _15({
420
+ _optionalChain([onLifecycleRef, 'access', _16 => _16.current, 'optionalCall', _17 => _17({
547
421
  type: "complete",
548
422
  txHash: result.transactionHash,
549
423
  account,
@@ -554,23 +428,23 @@ function ClaimBody({
554
428
  })]);
555
429
  } catch (err) {
556
430
  if (!isCurrentOperation()) return;
557
- const recoveryError = err instanceof RecoveryError ? err : void 0;
558
- const status = _optionalChain([recoveryError, 'optionalAccess', _16 => _16.status]);
559
- const message = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _17 => _17.message]), () => ( _chunkBRYNGLDMcjs.formatUserError.call(void 0,
431
+ const recoveryError = err instanceof _chunkCVGNCUVUcjs.RecoveryError ? err : void 0;
432
+ const status = _optionalChain([recoveryError, 'optionalAccess', _18 => _18.status]);
433
+ const message = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _19 => _19.message]), () => ( _chunkZMT4ATHRcjs.formatUserError.call(void 0,
560
434
  err instanceof Error ? err.message : "Recovery failed"
561
435
  )));
562
436
  dispatch({
563
437
  type: "failed",
564
438
  error: message,
565
- retryable: _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _18 => _18.retryable]), () => ( true))
439
+ retryable: _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _20 => _20.retryable]), () => ( true))
566
440
  });
567
- _optionalChain([onEventRef, 'access', _19 => _19.current, 'optionalCall', _20 => _20({
441
+ _optionalChain([onEventRef, 'access', _21 => _21.current, 'optionalCall', _22 => _22({
568
442
  type: "claim_modal_failed",
569
443
  chain: `eip155:${sourceChainId}`,
570
444
  status
571
445
  })]);
572
- _optionalChain([onLifecycleRef, 'access', _21 => _21.current, 'optionalCall', _22 => _22({ type: "failed", status, error: message })]);
573
- _optionalChain([onErrorRef, 'access', _23 => _23.current, 'optionalCall', _24 => _24({ message, code: "CLAIM_FAILED" })]);
446
+ _optionalChain([onLifecycleRef, 'access', _23 => _23.current, 'optionalCall', _24 => _24({ type: "failed", status, error: message })]);
447
+ _optionalChain([onErrorRef, 'access', _25 => _25.current, 'optionalCall', _26 => _26({ message, code: "CLAIM_FAILED" })]);
574
448
  }
575
449
  }
576
450
  }
@@ -599,12 +473,12 @@ function LookupStep({
599
473
  txHash: trimmed
600
474
  });
601
475
  if (!isCurrentOperation()) return;
602
- _optionalChain([onLifecycleRef, 'access', _25 => _25.current, 'optionalCall', _26 => _26({
476
+ _optionalChain([onLifecycleRef, 'access', _27 => _27.current, 'optionalCall', _28 => _28({
603
477
  type: "lookup",
604
478
  txHash: trimmed,
605
479
  matches: deposits.length
606
480
  })]);
607
- _optionalChain([onEventRef, 'access', _27 => _27.current, 'optionalCall', _28 => _28({
481
+ _optionalChain([onEventRef, 'access', _29 => _29.current, 'optionalCall', _30 => _30({
608
482
  type: "claim_modal_lookup",
609
483
  matches: deposits.length
610
484
  })]);
@@ -621,11 +495,11 @@ function LookupStep({
621
495
  onResults(deposits);
622
496
  } catch (err) {
623
497
  if (!isCurrentOperation()) return;
624
- const message = _chunkBRYNGLDMcjs.formatUserError.call(void 0,
498
+ const message = _chunkZMT4ATHRcjs.formatUserError.call(void 0,
625
499
  err instanceof Error ? err.message : "Lookup failed"
626
500
  );
627
501
  setError(message);
628
- _optionalChain([onErrorRef, 'access', _29 => _29.current, 'optionalCall', _30 => _30({ message, code: "CLAIM_LOOKUP_FAILED" })]);
502
+ _optionalChain([onErrorRef, 'access', _31 => _31.current, 'optionalCall', _32 => _32({ message, code: "CLAIM_LOOKUP_FAILED" })]);
629
503
  } finally {
630
504
  if (isCurrentOperation()) setLoading(false);
631
505
  }
@@ -642,9 +516,9 @@ function LookupStep({
642
516
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
643
517
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
644
518
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
645
- _chunkBRYNGLDMcjs.BodyHeader,
519
+ _chunkZMT4ATHRcjs.BodyHeader,
646
520
  {
647
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.HandCoinsIcon, {}),
521
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HandCoinsIcon, {}),
648
522
  title: "Claim a deposit",
649
523
  subtitle: "Get funds from a failed deposit sent back to you on the source chain."
650
524
  }
@@ -659,9 +533,9 @@ function LookupStep({
659
533
  error: trimmed.length > 0 && !validTxHash ? "Enter a valid transaction hash" : void 0
660
534
  }
661
535
  ),
662
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.Callout, { variant: "error", children: error }),
536
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: error }),
663
537
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
664
- _chunkBRYNGLDMcjs.Button,
538
+ _chunkZMT4ATHRcjs.Button,
665
539
  {
666
540
  onClick: handleLookup,
667
541
  loading,
@@ -672,7 +546,7 @@ function LookupStep({
672
546
  }
673
547
  )
674
548
  ] }),
675
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.PoweredBy, {})
549
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
676
550
  ] });
677
551
  }
678
552
  function SelectStep({
@@ -682,9 +556,9 @@ function SelectStep({
682
556
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
683
557
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
684
558
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
685
- _chunkBRYNGLDMcjs.BodyHeader,
559
+ _chunkZMT4ATHRcjs.BodyHeader,
686
560
  {
687
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.CoinsIcon, {}),
561
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CoinsIcon, {}),
688
562
  title: "Select a deposit",
689
563
  subtitle: "This transaction produced multiple deposits. Choose the one to claim."
690
564
  }
@@ -693,9 +567,9 @@ function SelectStep({
693
567
  const { symbol, amount, chainName } = describeDeposit(row);
694
568
  const eligible = isEligible(row);
695
569
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
696
- _chunkHL5NUKZWcjs.ListRow,
570
+ _chunkHOGZKHHYcjs.ListRow,
697
571
  {
698
- leadingMedia: _chunkO7BCVQ6Lcjs.tokenIconUrl.call(void 0, symbol),
572
+ leadingMedia: _chunk4KCSH4T3cjs.tokenIconUrl.call(void 0, symbol),
699
573
  title: `${amount} ${symbol}`,
700
574
  subtitle: chainName,
701
575
  meta: eligible ? void 0 : humanizeStatus(row.status),
@@ -706,7 +580,7 @@ function SelectStep({
706
580
  );
707
581
  }) })
708
582
  ] }),
709
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.PoweredBy, {})
583
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
710
584
  ] });
711
585
  }
712
586
  function ReviewStep({
@@ -716,15 +590,15 @@ function ReviewStep({
716
590
  onSubmit
717
591
  }) {
718
592
  const { chainId, symbol, amount, chainName, chainIcon } = describeDeposit(deposit);
719
- const explorerTxUrl = _chunkBRYNGLDMcjs.useExplorerTxUrl.call(void 0, );
593
+ const explorerTxUrl = _chunkZMT4ATHRcjs.useExplorerTxUrl.call(void 0, );
720
594
  const [destination, setDestination] = _react.useState.call(void 0, _nullishCoalesce(defaultRefundDestination, () => ( "")));
721
595
  const destinationValid = _viem.isAddress.call(void 0, destination);
722
596
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
723
597
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
724
598
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
725
- _chunkBRYNGLDMcjs.BodyHeader,
599
+ _chunkZMT4ATHRcjs.BodyHeader,
726
600
  {
727
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.HandCoinsIcon, {}),
601
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HandCoinsIcon, {}),
728
602
  title: "Review refund",
729
603
  subtitle: "This returns the funds on the source chain. It does not retry the original bridge."
730
604
  }
@@ -738,14 +612,14 @@ function ReviewStep({
738
612
  " ",
739
613
  symbol
740
614
  ] }),
741
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.TokenIcon, { symbol }) })
615
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol }) })
742
616
  ] })
743
617
  ] }),
744
618
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
745
619
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
746
620
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
747
621
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
748
- chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.CdnIcon, { src: chainIcon }) })
622
+ chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: chainIcon }) })
749
623
  ] })
750
624
  ] }),
751
625
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
@@ -762,7 +636,7 @@ function ReviewStep({
762
636
  rel: "noreferrer",
763
637
  children: [
764
638
  short,
765
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.ExternalLinkIcon, {})
639
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ExternalLinkIcon, {})
766
640
  ]
767
641
  }
768
642
  ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: short });
@@ -780,7 +654,7 @@ function ReviewStep({
780
654
  }
781
655
  ),
782
656
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
783
- _chunkBRYNGLDMcjs.Button,
657
+ _chunkZMT4ATHRcjs.Button,
784
658
  {
785
659
  onClick: () => destinationValid && onSubmit(destination),
786
660
  loading: submitting,
@@ -791,7 +665,7 @@ function ReviewStep({
791
665
  }
792
666
  )
793
667
  ] }),
794
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.PoweredBy, {})
668
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
795
669
  ] });
796
670
  }
797
671
  function ResultStep({
@@ -802,13 +676,13 @@ function ResultStep({
802
676
  onRetry
803
677
  }) {
804
678
  const success = !!result;
805
- const explorerTxUrl = _chunkBRYNGLDMcjs.useExplorerTxUrl.call(void 0, );
679
+ const explorerTxUrl = _chunkZMT4ATHRcjs.useExplorerTxUrl.call(void 0, );
806
680
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
807
681
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
808
682
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
809
- _chunkBRYNGLDMcjs.BodyHeader,
683
+ _chunkZMT4ATHRcjs.BodyHeader,
810
684
  {
811
- icon: success ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.AlertTriangleIcon, {}),
685
+ icon: success ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.AlertTriangleIcon, {}),
812
686
  variant: success ? "success" : "error",
813
687
  title: success ? "Refund submitted" : "Refund failed",
814
688
  subtitle: success ? "Your funds are being returned on the source chain." : void 0
@@ -823,7 +697,7 @@ function ResultStep({
823
697
  " ",
824
698
  result.symbol
825
699
  ] }),
826
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.TokenIcon, { symbol: result.symbol }) })
700
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol: result.symbol }) })
827
701
  ] })
828
702
  ] }),
829
703
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
@@ -844,22 +718,22 @@ function ResultStep({
844
718
  rel: "noreferrer",
845
719
  children: [
846
720
  short,
847
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.ExternalLinkIcon, {})
721
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ExternalLinkIcon, {})
848
722
  ]
849
723
  }
850
724
  ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: short });
851
725
  })()
852
726
  ] })
853
- ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.Callout, { variant: "error", children: error }),
727
+ ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: error }),
854
728
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen-button-row", children: success ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
855
- onReset && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.Button, { variant: "outline", onClick: onReset, fullWidth: true, children: "Claim another deposit" }),
856
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
729
+ onReset && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Button, { variant: "outline", onClick: onReset, fullWidth: true, children: "Claim another deposit" }),
730
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
857
731
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
858
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
859
- onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.Button, { onClick: onRetry, fullWidth: true, children: "Try again" })
732
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
733
+ onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Button, { onClick: onRetry, fullWidth: true, children: "Try again" })
860
734
  ] }) })
861
735
  ] }),
862
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBRYNGLDMcjs.PoweredBy, {})
736
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
863
737
  ] });
864
738
  }
865
739