@crossmint/client-sdk-react-ui 2.6.17 → 3.0.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.
- package/dist/chunk-5CU74TAA.js +1 -0
- package/dist/{chunk-73XVCYPH.cjs → chunk-64YKD3VV.cjs} +1 -1
- package/dist/{chunk-WN6KNFYP.js → chunk-6MIHLYJK.js} +1 -1
- package/dist/chunk-6SHLJS5F.cjs +1 -0
- package/dist/chunk-7O34YRD5.js +1 -0
- package/dist/{chunk-GG3WKQG7.js → chunk-AC2SJG3Q.js} +1 -1
- package/dist/chunk-AENARY6B.cjs +180 -0
- package/dist/{chunk-3GQHN6K5.cjs → chunk-AM2LP6OA.cjs} +1 -1
- package/dist/chunk-AU3VQ3FZ.cjs +1 -0
- package/dist/{chunk-YCVGGKNO.js → chunk-AZ72RWXJ.js} +1 -1
- package/dist/{chunk-2JE4R2XO.js → chunk-BA44FXE6.js} +1 -1
- package/dist/{chunk-QF7R4UM7.js → chunk-EQJXHQXI.js} +1 -1
- package/dist/{chunk-4KWOGABX.js → chunk-ETAEFFCS.js} +1 -1
- package/dist/{chunk-YTMXTBHQ.js → chunk-EUJ5GQ5N.js} +1 -1
- package/dist/chunk-F6X2ZGRY.js +1 -0
- package/dist/{chunk-RVCYJAKY.cjs → chunk-GS26S4PZ.cjs} +1 -1
- package/dist/{chunk-TZP33ZEU.cjs → chunk-H4U5OTBS.cjs} +1 -1
- package/dist/{chunk-C3MBKVLB.cjs → chunk-HNV3LB4A.cjs} +1 -1
- package/dist/{chunk-GFGJL7BJ.cjs → chunk-HOZJUW3M.cjs} +1 -1
- package/dist/chunk-I6UUWJCL.cjs +1 -0
- package/dist/{chunk-5JBAFOQI.js → chunk-IBUBTQ42.js} +1 -1
- package/dist/chunk-ILP5ZA7W.js +180 -0
- package/dist/{chunk-SSQYOHWB.cjs → chunk-JCG2KY4G.cjs} +1 -1
- package/dist/chunk-JEFMDNXO.js +1 -0
- package/dist/{chunk-PIDVMDD2.js → chunk-JGWSU6QP.js} +1 -1
- package/dist/{chunk-WEZO24N7.js → chunk-KDDZO4YX.js} +1 -1
- package/dist/{chunk-IC3B2QFJ.js → chunk-KJQTGUGV.js} +1 -1
- package/dist/{chunk-3AIPQMME.cjs → chunk-KMSV2Y6J.cjs} +1 -1
- package/dist/chunk-LHI636RZ.cjs +1 -0
- package/dist/{chunk-TTHIYMFU.js → chunk-LI7QMYLA.js} +1 -1
- package/dist/{chunk-NYIJKTTL.js → chunk-LMKGXH5T.js} +1 -1
- package/dist/{chunk-TMMBKPWH.js → chunk-LMXT72IJ.js} +1 -1
- package/dist/{chunk-DJTBSDTY.js → chunk-MY7Z6LTZ.js} +1 -1
- package/dist/{chunk-5LTXPYXD.cjs → chunk-NXEC4PED.cjs} +1 -1
- package/dist/chunk-OUS4XLPU.js +1 -0
- package/dist/{chunk-H65BGTCH.cjs → chunk-PKYYC5N5.cjs} +1 -1
- package/dist/{chunk-2CXF3CLF.cjs → chunk-QRMYO2NX.cjs} +1 -1
- package/dist/{chunk-PRRCD32U.cjs → chunk-S5QCH2ED.cjs} +1 -1
- package/dist/chunk-SGMSQYXA.cjs +1 -0
- package/dist/{chunk-I4KUTLEI.js → chunk-T4JTHWXU.js} +1 -1
- package/dist/{chunk-76WX7MJH.cjs → chunk-TE27CKWW.cjs} +1 -1
- package/dist/{chunk-V3TDTZGR.js → chunk-TQ3JBX7K.js} +1 -1
- package/dist/{chunk-JJEOOOMI.cjs → chunk-UDNW7GHL.cjs} +1 -1
- package/dist/{chunk-TLXGITLY.cjs → chunk-UV7TO6A4.cjs} +2 -2
- package/dist/chunk-VHFWR2IK.cjs +1 -0
- package/dist/{chunk-WQVHJ4U5.cjs → chunk-WNUSI552.cjs} +2 -2
- package/dist/{chunk-2ES3NHBW.cjs → chunk-WPDCUPIT.cjs} +1 -1
- package/dist/{chunk-PY5KRKC4.cjs → chunk-XX4K26MY.cjs} +1 -1
- package/dist/{chunk-EO7HS4N3.js → chunk-YHU5Q3JI.js} +1 -1
- package/dist/chunk-YYZYQ3CJ.js +0 -0
- package/dist/{chunk-NDDN6KQ5.js → chunk-ZHPSJCFM.js} +1 -1
- package/dist/{chunk-75CRB74H.cjs → chunk-ZNFOZDZO.cjs} +1 -1
- package/dist/components/CrossmintNFTCollectionView.cjs +1 -1
- package/dist/components/CrossmintNFTCollectionView.js +1 -1
- package/dist/components/CrossmintNFTDetail.cjs +1 -1
- package/dist/components/CrossmintNFTDetail.js +1 -1
- package/dist/components/auth/AuthForm.cjs +1 -1
- package/dist/components/auth/AuthForm.js +1 -1
- package/dist/components/auth/AuthFormBackButton.cjs +1 -1
- package/dist/components/auth/AuthFormBackButton.js +1 -1
- package/dist/components/auth/AuthFormDialog.cjs +1 -1
- package/dist/components/auth/AuthFormDialog.js +1 -1
- package/dist/components/auth/EmbeddedAuthForm.cjs +1 -1
- package/dist/components/auth/EmbeddedAuthForm.js +1 -1
- package/dist/components/auth/PasskeyPrompt.cjs +1 -1
- package/dist/components/auth/PasskeyPrompt.js +1 -1
- package/dist/components/auth/methods/email/EmailAuthFlow.cjs +1 -1
- package/dist/components/auth/methods/email/EmailAuthFlow.js +1 -1
- package/dist/components/auth/methods/email/EmailOTPInput.cjs +1 -1
- package/dist/components/auth/methods/email/EmailOTPInput.js +1 -1
- package/dist/components/auth/methods/email/EmailSignIn.cjs +1 -1
- package/dist/components/auth/methods/email/EmailSignIn.js +1 -1
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +46 -1
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +46 -1
- package/dist/components/auth/methods/google/ContinueWithGoogle.cjs +1 -1
- package/dist/components/auth/methods/google/ContinueWithGoogle.js +1 -1
- package/dist/components/auth/methods/google/GoogleSignIn.cjs +1 -1
- package/dist/components/auth/methods/google/GoogleSignIn.js +1 -1
- package/dist/components/auth/methods/twitter/TwitterSignIn.cjs +1 -1
- package/dist/components/auth/methods/twitter/TwitterSignIn.js +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.js +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.js +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.js +1 -1
- package/dist/components/card-management/CrossmintPaymentMethodManagement.cjs +1 -1
- package/dist/components/card-management/CrossmintPaymentMethodManagement.js +1 -1
- package/dist/components/card-management/CrossmintPaymentMethodManagementIFrame.cjs +1 -1
- package/dist/components/card-management/CrossmintPaymentMethodManagementIFrame.js +1 -1
- package/dist/components/card-management/index.cjs +1 -1
- package/dist/components/card-management/index.js +1 -1
- package/dist/components/embed/index.cjs +1 -1
- package/dist/components/embed/index.js +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +1 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +1 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +1 -1
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.cjs +1 -1
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.js +1 -1
- package/dist/components/embed/v3/index.cjs +1 -1
- package/dist/components/embed/v3/index.js +1 -1
- package/dist/components/hosted/index.cjs +1 -1
- package/dist/components/hosted/index.js +1 -1
- package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.cjs +1 -1
- package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.js +1 -1
- package/dist/components/hosted/v3/index.cjs +1 -1
- package/dist/components/hosted/v3/index.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -1
- package/dist/components/order-intent/OrderIntentVerification.cjs +1 -1
- package/dist/components/order-intent/OrderIntentVerification.d.cts +1 -1
- package/dist/components/order-intent/OrderIntentVerification.d.ts +1 -1
- package/dist/components/order-intent/OrderIntentVerification.js +1 -1
- package/dist/components/order-intent/index.cjs +1 -1
- package/dist/components/order-intent/index.js +1 -1
- package/dist/components/payment-method-agentic-enrollment/PaymentMethodAgenticEnrollmentVerification.cjs +1 -0
- package/dist/components/payment-method-agentic-enrollment/PaymentMethodAgenticEnrollmentVerification.d.cts +12 -0
- package/dist/components/payment-method-agentic-enrollment/PaymentMethodAgenticEnrollmentVerification.d.ts +12 -0
- package/dist/components/payment-method-agentic-enrollment/PaymentMethodAgenticEnrollmentVerification.js +1 -0
- package/dist/components/payment-method-agentic-enrollment/index.cjs +1 -0
- package/dist/components/payment-method-agentic-enrollment/index.d.cts +3 -0
- package/dist/components/payment-method-agentic-enrollment/index.d.ts +3 -0
- package/dist/components/payment-method-agentic-enrollment/index.js +1 -0
- package/dist/components/signers/EmailSignersDialog.cjs +1 -1
- package/dist/components/signers/EmailSignersDialog.js +1 -1
- package/dist/components/signers/PhoneSignersDialog.cjs +1 -1
- package/dist/components/signers/PhoneSignersDialog.js +1 -1
- package/dist/components/signers/index.cjs +1 -1
- package/dist/components/signers/index.js +1 -1
- package/dist/components/wallets/ExportPrivateKeyButton.cjs +1 -1
- package/dist/components/wallets/ExportPrivateKeyButton.d.cts +2 -1
- package/dist/components/wallets/ExportPrivateKeyButton.d.ts +2 -1
- package/dist/components/wallets/ExportPrivateKeyButton.js +1 -1
- package/dist/components/wallets/index.cjs +1 -1
- package/dist/components/wallets/index.d.cts +1 -1
- package/dist/components/wallets/index.d.ts +1 -1
- package/dist/components/wallets/index.js +1 -1
- package/dist/consts/version.cjs +1 -1
- package/dist/consts/version.js +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAuth.cjs +1 -1
- package/dist/hooks/useAuth.js +1 -1
- package/dist/hooks/useCrossmintCheckout.cjs +1 -1
- package/dist/hooks/useCrossmintCheckout.js +1 -1
- package/dist/hooks/useOAuthWindowListener.cjs +1 -1
- package/dist/hooks/useOAuthWindowListener.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/providers/CrossmintAuthProvider.cjs +1 -1
- package/dist/providers/CrossmintAuthProvider.js +1 -1
- package/dist/providers/CrossmintProvider.cjs +1 -1
- package/dist/providers/CrossmintProvider.js +1 -1
- package/dist/providers/CrossmintWalletProvider.cjs +1 -1
- package/dist/providers/CrossmintWalletProvider.js +1 -1
- package/dist/providers/auth/FarcasterProvider.cjs +1 -1
- package/dist/providers/auth/FarcasterProvider.js +1 -1
- package/dist/providers/auth/OAuthFlowProvider.cjs +1 -1
- package/dist/providers/auth/OAuthFlowProvider.js +1 -1
- package/dist/providers/dynamic/DynamicWalletProvider.cjs +6 -1
- package/dist/providers/dynamic/DynamicWalletProvider.js +6 -1
- package/dist/providers/index.cjs +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/utils/createCrossmintApiClient.cjs +1 -1
- package/dist/utils/createCrossmintApiClient.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-2ZE6WGPX.js +0 -1
- package/dist/chunk-3TODY3FY.cjs +0 -1
- package/dist/chunk-74WTJ7XP.cjs +0 -1
- package/dist/chunk-7STEMUBW.js +0 -1
- package/dist/chunk-BCP5RVJO.js +0 -230
- package/dist/chunk-BR77Q3PK.cjs +0 -1
- package/dist/chunk-GSVZY7YL.js +0 -1
- package/dist/chunk-JSNUJJQJ.js +0 -1
- package/dist/chunk-KXIAPJK6.cjs +0 -1
- package/dist/chunk-XZJJ2NDY.js +0 -1
- package/dist/chunk-YXQAMA7D.cjs +0 -230
- package/dist/chunk-YZJIE7CP.cjs +0 -1
- /package/dist/{chunk-QI37PBS5.cjs → chunk-2PVYNZP7.cjs} +0 -0
- /package/dist/{chunk-J2CHI2A2.cjs → chunk-4M5LNKYM.cjs} +0 -0
- /package/dist/{chunk-C2TAQBAD.js → chunk-NTFFCZWX.js} +0 -0
- /package/dist/{chunk-5MZTUSMQ.js → chunk-QVXTNSBH.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-JEFMDNXO.js";var i=o;export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSGMSQYXAcjs = require('./chunk-SGMSQYXA.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');function C(t,i){return new (0, _commonsdkbase.CrossmintApiClient)(t,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-ui",version:_chunkSGMSQYXAcjs.a},apiKeyExpectations:i}})}exports.a = C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-LMKGXH5T.js";import{createContext as p,useContext as h,useEffect as l,useState as i}from"react";import{useCrossmint as g}from"@crossmint/client-sdk-react-base";import{jsx as k}from"react/jsx-runtime";var s=p(void 0);function b({children:e}){let[r,d]=i(void 0),[c,u]=i(void 0),{crossmint:C}=g(),m=o(C,{usageOrigin:"client"});return l(()=>{let n=t=>{if(t.origin!==new URL(m.baseUrl).origin||t.data.event!=="order:updated")return;let{order:a,orderClientSecret:f}=t.data.data;d(a),u(f)};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[r]),k(s.Provider,{value:{order:r,orderClientSecret:c},children:e})}function S(){let e=h(s);if(!e)throw new Error("useCrossmintCheckout must be used within a CrossmintCheckoutProvider");return e}export{b as a,S as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var t="3.0.0";var a={name:"@crossmint/client-sdk-react-ui",version:t,repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=16384' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=16384' tsup --watch","test:vitest":"vitest run","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@basis-theory-ai/react":"2.0.0-beta.3","@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@dynamic-labs/ethereum":"4.28.0","@dynamic-labs/sdk-react-core":"4.28.0","@dynamic-labs/solana":"4.28.0","@dynamic-labs/sui":"4.28.0","@emotion/react":"^11.11.0","@emotion/styled":"11.14.1","@ethersproject/transactions":"5.7.0","@farcaster/auth-kit":"0.6.0","@mysten/sui":"1.24.0","@solana/web3.js":"1.98.1",bs58:"5.0.0",clsx:"2.1.1",color:"4.2.3","input-otp":"1.4.2","lodash.isequal":"4.5.0",ox:"0.6.9","react-jss":"10.10.0","react-transition-group":"4.4.5",viem:"2.33.1",zod:"3.22.4"},devDependencies:{"@testing-library/react":"^16.0.1","@types/color":"4.2.0","@types/lodash.isequal":"4.5.6","@types/react":"^19.1.10","@types/react-dom":"^19.1.0","@types/react-transition-group":"4.4.12","pino-pretty":"^7.6.0",react:"^19.1.0","react-dom":"^19.1.0",typedoc:"0.28.16"},peerDependencies:{"@solana/web3.js":"^1.98.1",react:">=17.0.2","react-dom":">=17.0.2"}};exports.a = t; exports.b = a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,d as c}from"./chunk-PXDN3KFO.js";import{useBtAi as d,BtAiProvider as I}from"@basis-theory-ai/react";import{useEffect as f,useCallback as u}from"react";import{jsx as a}from"react/jsx-runtime";function g(t){return a(I,{apiKey:t.config.btApiKey,environment:t.config.environment,children:a(y,o({},t))})}function y({orderIntent:t,onVerificationComplete:n,onVerificationError:r}){let{verifyInstruction:i}=d(),s=u(()=>c(this,null,function*(){try{let e=yield i(t.payment.btAgentId,t.payment.btInstructionId);n==null||n(e)}catch(e){r==null||r(e)}}),[i,t.payment.btAgentId,t.payment.btInstructionId,n,r]);return f(()=>{s()},[s]),null}export{g as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m}from"./chunk-2F3UEXTE.js";import{a as
|
|
1
|
+
import{a as m}from"./chunk-2F3UEXTE.js";import{a as s}from"./chunk-NZUCXN2O.js";import{a}from"./chunk-DFSB3TWF.js";import{a as p}from"./chunk-QFUZG5YR.js";import{a as c,b as i,c as l}from"./chunk-PXDN3KFO.js";import h from"@emotion/styled";import{jsx as d}from"react/jsx-runtime";var f=h.button`
|
|
2
2
|
${s}
|
|
3
3
|
|
|
4
4
|
position: absolute;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkNXEC4PEDcjs = require('./chunk-NXEC4PED.cjs');var _chunk6O6IJTQDcjs = require('./chunk-6O6IJTQD.cjs');var _chunkXBXL7GMYcjs = require('./chunk-XBXL7GMY.cjs');var _chunkGTOPYCJZcjs = require('./chunk-GTOPYCJZ.cjs');var _chunkS5QCH2EDcjs = require('./chunk-S5QCH2ED.cjs');var _chunkHNUI5756cjs = require('./chunk-HNUI5756.cjs');var _chunkUMWTEGO6cjs = require('./chunk-UMWTEGO6.cjs');var _chunkDJZOP4MTcjs = require('./chunk-DJZOP4MT.cjs');var _chunkAHMPKIEYcjs = require('./chunk-AHMPKIEY.cjs');var _chunkS4BKL6MRcjs = require('./chunk-S4BKL6MR.cjs');var _chunkSCHRLC2Icjs = require('./chunk-SCHRLC2I.cjs');var _chunkO3H2EYFAcjs = require('./chunk-O3H2EYFA.cjs');var _chunk3X24JZVGcjs = require('./chunk-3X24JZVG.cjs');var _chunkEAWYV5ZOcjs = require('./chunk-EAWYV5ZO.cjs');var _chunkVXAHFAP4cjs = require('./chunk-VXAHFAP4.cjs');var _chunkNRN4WNQLcjs = require('./chunk-NRN4WNQL.cjs');var _chunkI4GMMHQRcjs = require('./chunk-I4GMMHQR.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _commonsdkbase = require('@crossmint/common-sdk-base');var _color = require('color'); var _color2 = _interopRequireDefault(_color);var _commonsdkauth = require('@crossmint/common-sdk-auth');var _clientsdkwindow = require('@crossmint/client-sdk-window');var _zod = require('zod');var Pt=(o,e)=>{let{crossmintAuth:t}=M(),[r,a]=_react.useState.call(void 0, null),i=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>(i.current==null&&(i.current=new (0, _clientsdkwindow.ChildWindow)(window.opener||window.parent,"*",{incomingEvents:Zt})),()=>{i.current!=null&&i.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:_react.useCallback.call(void 0, (n,h)=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){if(i.current==null)throw new Error("Child window not initialized");a(n),e(null),console.log("createPopupAndSetupListeners",n,h),console.log("oauthUrlMap",o),console.log("oauthUrlMap[provider]",o[n]);let l=new URL(o[n]);if(h!=null){let f=Array.from(l.searchParams.entries());l.search="",h&&l.searchParams.append("provider_login_hint",h),f.forEach(([c,p])=>{l.searchParams.append(c,p)})}let g=yield _clientsdkwindow.PopupWindow.init(l.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),x=f=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){var c,p;yield t==null?void 0:t.handleRefreshAuthMaterial(f.oneTimeSecret),(c=i.current)==null||c.off("authMaterialFromPopupCallback"),(p=g.window)==null||p.close(),a(null)}),m=f=>{var c,p;e(f.error),(c=i.current)==null||c.off("errorFromPopupCallback"),(p=g.window)==null||p.close(),a(null)};i.current.on("authMaterialFromPopupCallback",x),i.current.on("errorFromPopupCallback",m);let v=setInterval(()=>{var f,c;(f=g.window)!=null&&f.closed&&(clearInterval(v),a(null),(c=i.current)==null||c.off("authMaterialFromPopupCallback"))},2500)}),[o,t,e]),isLoading:r!=null,activeOAuthProvider:r}},Zt={authMaterialFromPopupCallback:_zod.z.object({oneTimeSecret:_zod.z.string()}),errorFromPopupCallback:_zod.z.object({error:_zod.z.string()})};var _jsxruntime = require('react/jsx-runtime');var Et={google:"",twitter:""},It=_react.createContext.call(void 0, void 0);function F(){let o=_react.useContext.call(void 0, It);if(!o)throw new Error("useOAuthFlow must be used within an OAuthFlowProvider");return o}function Ft({children:o,prefetchOAuthUrls:e}){let{crossmintAuth:t,loginMethods:r}=Lt(),{setError:a}=_chunkHNUI5756cjs.a.call(void 0, ),[i,u]=_react.useState.call(void 0, Et),[n,h]=_react.useState.call(void 0, !0),{createPopupAndSetupListeners:l,isLoading:g,activeOAuthProvider:x}=Pt(i,a),m=_react.useCallback.call(void 0, ()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){h(!0);try{let p=(r||[]).filter(d=>d in Et).map(d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){let b=yield t==null?void 0:t.getOAuthUrl(d);return{[d]:b}})),S=Object.assign({},...yield Promise.all(p));u(S)}catch(c){a(c instanceof Error?c.message:"Unable to load oauth providers. Please try again later.")}finally{h(!1)}}),[r,t,a]);_react.useEffect.call(void 0, ()=>{e&&m()},[m,e]);let f={startOAuthLogin:_react.useCallback.call(void 0, (c,p)=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){yield l(c,p)}),[l]),isLoading:n||g,activeOAuthProvider:x};return _jsxruntime.jsx.call(void 0, It.Provider,{value:f,children:o})}var no=_styled2.default.button`
|
|
2
|
+
${_chunk3X24JZVGcjs.a}
|
|
3
|
+
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
height: 32px;
|
|
9
|
+
padding: 0 10px;
|
|
10
|
+
border: 1px solid ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.border)||_chunkEAWYV5ZOcjs.a["cm-border"]}};
|
|
11
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"12px"}};
|
|
12
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.buttonBackground)||_chunkEAWYV5ZOcjs.a["cm-background-primary"]}};
|
|
13
|
+
cursor: ${o=>o.isLoading?"not-allowed":"pointer"};
|
|
14
|
+
|
|
15
|
+
/* Hover and focus states */
|
|
16
|
+
&:hover {
|
|
17
|
+
background-color: ${o=>o.isLoading?_chunkEAWYV5ZOcjs.a["cm-muted-primary"]:_chunkEAWYV5ZOcjs.a["cm-hover"]};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:focus {
|
|
21
|
+
outline: none;
|
|
22
|
+
background-color: theme["cm-hover"];
|
|
23
|
+
}
|
|
24
|
+
`,io=_styled2.default.span`
|
|
25
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]}};
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
`;function Ut({emailInput:o,appearance:e}){var i,u;let{startOAuthLogin:t,activeOAuthProvider:r}=F(),a=r==="google";return _jsxruntime.jsxs.call(void 0, no,{type:"button",appearance:e,isLoading:a,onClick:a?void 0:()=>t("google",o.trim().toLowerCase()),children:[_jsxruntime.jsx.call(void 0, _chunkVXAHFAP4cjs.a,{style:{height:"18px",width:"18px"}}),a?_jsxruntime.jsx.call(void 0, _chunkAHMPKIEYcjs.a,{style:{color:(i=e==null?void 0:e.colors)==null?void 0:i.textSecondary,fill:(u=e==null?void 0:e.colors)==null?void 0:u.textPrimary,width:"18px",height:"18px"}}):_jsxruntime.jsx.call(void 0, io,{appearance:e,children:"Continue"})]})}var so=_styled2.default.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
justify-content: flex-start;
|
|
33
|
+
width: 100%;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
`,lo=_styled2.default.div`
|
|
36
|
+
width: 100%;
|
|
37
|
+
`,uo=_styled2.default.label`
|
|
38
|
+
display: block;
|
|
39
|
+
margin-bottom: 5px;
|
|
40
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||_chunkEAWYV5ZOcjs.a["cm-text-primary"]}};
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
`,co=_styled2.default.form`
|
|
44
|
+
position: relative;
|
|
45
|
+
`,po=_styled2.default.input`
|
|
46
|
+
${_chunk3X24JZVGcjs.a}
|
|
47
|
+
|
|
48
|
+
/* Base input styles */
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-grow: 1;
|
|
51
|
+
text-align: left;
|
|
52
|
+
padding-left: 16px;
|
|
53
|
+
padding-right: ${o=>o.showGoogleButton?"132px":"80px"};
|
|
54
|
+
height: 58px;
|
|
55
|
+
width: 100%;
|
|
56
|
+
border: 1px solid;
|
|
57
|
+
border-color: ${o=>{var e,t,r,a;return o.hasError?((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)||_chunkEAWYV5ZOcjs.a["cm-danger"]:((a=(r=o.appearance)==null?void 0:r.colors)==null?void 0:a.border)||_chunkEAWYV5ZOcjs.a["cm-border"]}};
|
|
58
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"12px"}};
|
|
59
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||_chunkEAWYV5ZOcjs.a["cm-background-primary"]}};
|
|
60
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||_chunkEAWYV5ZOcjs.a["cm-text-primary"]}};
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
|
|
63
|
+
|
|
64
|
+
&::placeholder {
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus {
|
|
70
|
+
outline: none;
|
|
71
|
+
box-shadow: 0 0 0 2px ${o=>{var e,t;return new (0, _color2.default)(((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]).alpha(.18).toString()}};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:read-only {
|
|
75
|
+
cursor: not-allowed;
|
|
76
|
+
opacity: 0.7;
|
|
77
|
+
}
|
|
78
|
+
`,mo=_styled2.default.div`
|
|
79
|
+
position: absolute;
|
|
80
|
+
right: 0;
|
|
81
|
+
top: 0;
|
|
82
|
+
bottom: 0;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
padding-right: 16px;
|
|
86
|
+
`,ho=_styled2.default.button`
|
|
87
|
+
${_chunk3X24JZVGcjs.a}
|
|
88
|
+
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||_chunkEAWYV5ZOcjs.a["cm-background-primary"]}};
|
|
92
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]}};
|
|
93
|
+
cursor: ${o=>o.disabled?"not-allowed":"pointer"};
|
|
94
|
+
opacity: ${o=>o.disabled?.6:1};
|
|
95
|
+
border: none;
|
|
96
|
+
padding: 8px 12px;
|
|
97
|
+
border-radius: 6px;
|
|
98
|
+
transition: opacity 200ms ease;
|
|
99
|
+
|
|
100
|
+
&:hover:not(:disabled) {
|
|
101
|
+
opacity: 0.8;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:focus-visible {
|
|
105
|
+
outline: 2px solid ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]}};
|
|
106
|
+
outline-offset: 2px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:not(:disabled):focus-visible {
|
|
110
|
+
box-shadow: 0 0 0 2px ${o=>{var e,t;return new (0, _color2.default)(((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]).alpha(.18).toString()}};
|
|
111
|
+
}
|
|
112
|
+
`,fo=_styled2.default.p`
|
|
113
|
+
font-size: 12px;
|
|
114
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)||_chunkEAWYV5ZOcjs.a["cm-danger"]}};
|
|
115
|
+
margin: 8px 0 8px 0;
|
|
116
|
+
`;function Mt({setOtpEmailData:o}){var c,p,S;let{crossmintAuth:e}=M(),{appearance:t,defaultEmail:r,setStep:a,setError:i,loginMethods:u}=_chunkHNUI5756cjs.a.call(void 0, ),[n,h]=_react.useState.call(void 0, r!=null?r:""),[l,g]=_react.useState.call(void 0, ""),[x,m]=_react.useState.call(void 0, !1),v=n.toLowerCase().includes("@gmail.com")&&!n.toLowerCase().includes("+")&&_commonsdkauth.isEmailValid.call(void 0, n)&&!x&&u.includes("google");function f(d){return _chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){d.preventDefault(),m(!0);try{let b=n.trim().toLowerCase(),W=yield e==null?void 0:e.sendEmailOtp(b);o({email:b,emailId:W.emailId}),a("otp")}catch(b){m(!1),i("Failed to send email. Please try again or contact support.")}})}return _jsxruntime.jsx.call(void 0, so,{children:_jsxruntime.jsxs.call(void 0, lo,{children:[_jsxruntime.jsx.call(void 0, uo,{appearance:t,children:"Email"}),_jsxruntime.jsxs.call(void 0, co,{role:"form",onSubmit:d=>{if(v){d.preventDefault();return}_commonsdkauth.isEmailValid.call(void 0, n)?f(d):d.preventDefault()},noValidate:!0,children:[_jsxruntime.jsx.call(void 0, _chunkS4BKL6MRcjs.a,{children:"Email"}),_jsxruntime.jsx.call(void 0, po,{id:"emailInput",appearance:t,hasError:!!l,showGoogleButton:v,type:"email",placeholder:"your@email.com",value:n,onChange:d=>{h(d.target.value),g(""),i(null)},readOnly:x,"aria-describedby":"emailError"}),_jsxruntime.jsxs.call(void 0, mo,{children:[l&&_jsxruntime.jsx.call(void 0, _chunkNRN4WNQLcjs.a,{customColor:(c=t==null?void 0:t.colors)==null?void 0:c.danger}),x&&_jsxruntime.jsx.call(void 0, _chunkAHMPKIEYcjs.a,{style:{color:(p=t==null?void 0:t.colors)==null?void 0:p.textSecondary,fill:(S=t==null?void 0:t.colors)==null?void 0:S.textPrimary}}),v?_jsxruntime.jsx.call(void 0, Ut,{emailInput:n,appearance:t}):!l&&!x?_jsxruntime.jsx.call(void 0, ho,{type:"submit",appearance:t,disabled:!_commonsdkauth.isEmailValid.call(void 0, n)||x,children:"Submit"}):null]})]}),l&&_jsxruntime.jsx.call(void 0, fo,{appearance:t,id:"emailError",children:l})]})})}function $t(){let{step:o}=_chunkHNUI5756cjs.a.call(void 0, ),[e,t]=_react.useState.call(void 0, null);return o==="otp"?_jsxruntime.jsx.call(void 0, Rt,{otpEmailData:e,setOtpEmailData:t}):o==="initial"?_jsxruntime.jsx.call(void 0, Mt,{setOtpEmailData:t}):null}function zt(e){var o=_chunk2WSEHVNPcjs.c.call(void 0, e,[]);var n;let{step:t,appearance:r}=_chunkHNUI5756cjs.a.call(void 0, ),{startOAuthLogin:a,activeOAuthProvider:i}=F(),u=i==="google";return t!=="initial"?null:_jsxruntime.jsx.call(void 0, _chunkGTOPYCJZcjs.a,_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {icon:_jsxruntime.jsx.call(void 0, _chunkVXAHFAP4cjs.a,{style:{height:"25px",width:"25px"}}),isLoading:u,appearance:r,onButtonClick:()=>a("google")},o),{children:_jsxruntime.jsx.call(void 0, "span",{style:{color:(n=r==null?void 0:r.colors)==null?void 0:n.textPrimary},children:"Sign in with Google"})}))}function Dt(e){var o=_chunk2WSEHVNPcjs.c.call(void 0, e,[]);let{step:t,appearance:r}=_chunkHNUI5756cjs.a.call(void 0, ),{startOAuthLogin:a,activeOAuthProvider:i}=F(),u=i==="twitter";return t!=="initial"?null:_jsxruntime.jsx.call(void 0, _chunkGTOPYCJZcjs.a,_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {icon:_jsxruntime.jsx.call(void 0, _chunkUMWTEGO6cjs.a,{style:{height:"22px",width:"22px"}}),isLoading:u,appearance:r,onButtonClick:()=>a("twitter")},o),{children:"Sign in with X"}))}var Ao=_react.lazy.call(void 0, ()=>Promise.all([Promise.resolve().then(() => _interopRequireWildcard(require("./providers/auth/FarcasterProvider.cjs"))),Promise.resolve().then(() => _interopRequireWildcard(require("./components/auth/methods/farcaster/FarcasterSignIn.cjs")))]).then(([o,e])=>({default:({baseUrl:t})=>_jsxruntime.jsx.call(void 0, o.FarcasterProvider,{baseUrl:t,children:_jsxruntime.jsx.call(void 0, e.FarcasterSignIn,{})})}))),wo=_styled2.default.div`
|
|
117
|
+
position: relative;
|
|
118
|
+
padding: 40px 24px 30px 24px;
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: 10px;
|
|
122
|
+
-webkit-font-smoothing: antialiased;
|
|
123
|
+
animation: none;
|
|
124
|
+
|
|
125
|
+
@media (min-width: 480px) {
|
|
126
|
+
padding: 40px 40px 30px 40px;
|
|
127
|
+
}
|
|
128
|
+
`,vo=_styled2.default.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: flex-start;
|
|
131
|
+
justify-content: flex-start;
|
|
132
|
+
border-radius: 8px;
|
|
133
|
+
padding: 8px;
|
|
134
|
+
gap: 8px;
|
|
135
|
+
margin-top: 34px;
|
|
136
|
+
background-color: ${o=>{var e,t,r;return new (0, _color2.default)((r=(t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)!=null?r:_chunkEAWYV5ZOcjs.a["cm-danger"]).alpha(.12).toString()}};
|
|
137
|
+
`;function Ht({style:o}){var h,l,g,x,m,v,f,c,p,S;let{step:e,appearance:t,loginMethods:r,baseUrl:a,error:i,termsOfServiceText:u,authModalTitle:n}=_chunkHNUI5756cjs.a.call(void 0, );return _jsxruntime.jsxs.call(void 0, wo,{style:o,children:[i!=null?_jsxruntime.jsxs.call(void 0, vo,{appearance:t,children:[_jsxruntime.jsx.call(void 0, "div",{style:{minWidth:"20px"},children:_jsxruntime.jsx.call(void 0, _chunkNRN4WNQLcjs.a,{customColor:(l=(h=t==null?void 0:t.colors)==null?void 0:h.danger)!=null?l:_chunkEAWYV5ZOcjs.a["cm-danger"]})}),_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"14px",margin:0,color:(x=(g=t==null?void 0:t.colors)==null?void 0:g.danger)!=null?x:_chunkEAWYV5ZOcjs.a["cm-danger"]},children:i})]}):null,e==="initial"?_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.b,{appearance:t,children:n!=null?n:"Sign in to Crossmint"}),_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.c,{appearance:t,children:"Access using one of the options below."})]}):null,r.includes("google")?_jsxruntime.jsx.call(void 0, zt,{}):null,r.includes("farcaster")?_jsxruntime.jsx.call(void 0, _react.Suspense,{fallback:null,children:_jsxruntime.jsx.call(void 0, Ao,{baseUrl:a})}):null,r.includes("twitter")?_jsxruntime.jsx.call(void 0, Dt,{}):null,r.some(d=>d.startsWith("web3"))?_jsxruntime.jsx.call(void 0, _chunkNXEC4PEDcjs.a,{}):null,r.includes("email")?_jsxruntime.jsxs.call(void 0, "div",{children:[r.length>1?_jsxruntime.jsx.call(void 0, _chunk6O6IJTQDcjs.a,{appearance:t,text:"OR"}):null,_jsxruntime.jsx.call(void 0, $t,{})]}):null,e==="initial"&&u!=null?_jsxruntime.jsxs.call(void 0, "div",{style:{fontSize:"0.875rem",textAlign:"center",marginTop:"0.5rem",color:(v=(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary)!=null?v:_chunkEAWYV5ZOcjs.a["cm-text-secondary"]},children:[_jsxruntime.jsx.call(void 0, "style",{children:`
|
|
138
|
+
p a {
|
|
139
|
+
color: ${(c=(f=t==null?void 0:t.colors)==null?void 0:f.textLink)!=null?c:_chunkEAWYV5ZOcjs.a["cm-link"]};
|
|
140
|
+
}
|
|
141
|
+
`}),u]}):null,e==="initial"||e==="otp"?_jsxruntime.jsx.call(void 0, _chunkSCHRLC2Icjs.a,{style:{marginTop:"1rem",justifyContent:"center"},color:(S=(p=t==null?void 0:t.colors)==null?void 0:p.textSecondary)!=null?S:_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}):null]})}function H({open:o}){let{appearance:e,setDialogOpen:t}=_chunkHNUI5756cjs.a.call(void 0, );return _jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.a,{open:o,setDialogOpen:t,appearance:e,children:_jsxruntime.jsx.call(void 0, Ht,{style:{maxWidth:"448px",padding:"0px"}})})}var Lo=_react.lazy.call(void 0, ()=>Promise.resolve().then(() => _interopRequireWildcard(require("./providers/dynamic/DynamicWalletProvider.cjs"))).then(o=>({default:o.DynamicWalletProvider}))),To={crossmintAuth:void 0,login:()=>{},logout:()=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){}),jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},experimental_externalWalletSigner:void 0,experimental_loginWithOAuth:()=>Promise.resolve(),loginMethods:[]},st= exports.l =_react.createContext.call(void 0, To);function Uo({children:o,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r=!0,authModalTitle:a,onLoginSuccess:i,loginMethods:u=["email","google"]}){let n=_clientsdkreactbase.useCrossmintAuthBase.call(void 0, ),{crossmint:h,experimental_setCustomAuth:l,experimental_customAuth:g}=_clientsdkreactbase.useCrossmint.call(void 0, "CrossmintAuthProvider must be used within CrossmintProvider"),x=_commonsdkbase.validateApiKeyAndGetCrossmintBaseUrl.call(void 0, h.apiKey),[m,v]=_react.useState.call(void 0, !1),[f,c]=_react.useState.call(void 0, void 0),[p,S]=_react.useState.call(void 0, !0),d=u.some(k=>k.startsWith("web3")),[b,W]=_react.useState.call(void 0, void 0),O=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{var k,B;n.jwt==null&&(g==null?void 0:g.jwt)!=null&&l(void 0),b!=null||((k=n.user)==null?void 0:k.email)!=null?l({jwt:n.jwt,email:(B=n.user)==null?void 0:B.email,externalWalletSigner:b}):l({jwt:n.jwt})},[b,n.jwt,n.user,l,g]),_react.useEffect.call(void 0, ()=>{n.jwt!=null&&m&&v(!1)},[n.jwt,m]);let R=_react.useCallback.call(void 0, k=>{if(n.jwt!=null){console.log("User already logged in");return}k!=null&&typeof k=="string"&&c(k),v(!0)},[n.jwt]),U=_react.useCallback.call(void 0, ()=>n.status==="initializing"||d&&!p?"initializing":n.jwt!=null?"logged-in":m?"in-progress":"logged-out",[n.status,n.jwt,d,p,m]),ut=_react.useCallback.call(void 0, k=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var B;if(n.jwt!=null){console.log("User already logged in");return}yield(B=O.current)==null?void 0:B.call(O,k)}),[n.jwt]),Vt=_react.useMemo.call(void 0, ()=>_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},n),{login:R,status:U(),experimental_externalWalletSigner:b,experimental_loginWithOAuth:ut,loginMethods:u}),[n,R,U,b,ut,u]);return _jsxruntime.jsx.call(void 0, st.Provider,{value:Vt,children:_jsxruntime.jsx.call(void 0, _chunkHNUI5756cjs.b,{setDialogOpen:(k,B)=>{v(k),B&&(i==null||i())},initialState:{appearance:e,loginMethods:u,termsOfServiceText:t,authModalTitle:a,baseUrl:x,defaultEmail:f},children:_jsxruntime.jsx.call(void 0, Ft,{prefetchOAuthUrls:U()==="logged-out"&&r,children:_jsxruntime.jsx.call(void 0, Bo,{loginWithOAuthRef:O,children:d?_jsxruntime.jsx.call(void 0, _react.Suspense,{fallback:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[o,_jsxruntime.jsx.call(void 0, H,{open:m})]}),children:_jsxruntime.jsxs.call(void 0, Lo,{apiKeyEnvironment:h.apiKey.includes("production")?"production":"staging",loginMethods:u,appearance:e,onSdkLoaded:S,onWalletConnected:W,children:[o,_jsxruntime.jsx.call(void 0, H,{open:m})]})}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[o,_jsxruntime.jsx.call(void 0, H,{open:m})]})})})})})}function Bo({children:o,loginWithOAuthRef:e}){let{startOAuthLogin:t}=F(),r=_clientsdkreactbase.useCrossmintAuthBase.call(void 0, ),a=_react.useCallback.call(void 0, i=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){if(r.jwt!=null){console.log("User already logged in");return}yield t(i)}),[r.jwt,t]);return _react.useEffect.call(void 0, ()=>{e.current=a},[a,e]),_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:o})}function Or({children:o,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r=!0,authModalTitle:a,onLoginSuccess:i,loginMethods:u=["email","google"],refreshRoute:n,logoutRoute:h}){return _jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintAuthBaseProvider,{onLoginSuccess:i,refreshRoute:n,logoutRoute:h,children:_jsxruntime.jsx.call(void 0, Uo,{onLoginSuccess:i,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r,authModalTitle:a,loginMethods:u,children:o})})}function M(){let o=_react.useContext.call(void 0, st);if(o==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return o}var Lt=M;var Wo=_styled2.default.div`
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
`,Ro=_styled2.default.div`
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: flex-start;
|
|
149
|
+
width: 100%;
|
|
150
|
+
`,$o=_styled2.default.div`
|
|
151
|
+
position: relative;
|
|
152
|
+
left: 12px;
|
|
153
|
+
`,zo=_styled2.default.p`
|
|
154
|
+
font-size: 16px;
|
|
155
|
+
font-weight: 400;
|
|
156
|
+
margin: 16px 0 4px 0;
|
|
157
|
+
text-align: center;
|
|
158
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||_chunkEAWYV5ZOcjs.a["cm-text-primary"]}};
|
|
159
|
+
`,jo=_styled2.default.p`
|
|
160
|
+
text-align: center;
|
|
161
|
+
padding: 0 16px;
|
|
162
|
+
margin: 0;
|
|
163
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}};
|
|
164
|
+
font-size: 14px;
|
|
165
|
+
line-height: 1.4;
|
|
166
|
+
`,Do=_styled2.default.div`
|
|
167
|
+
padding: 32px 0;
|
|
168
|
+
`,j=_styled2.default.call(void 0, _chunkXBXL7GMYcjs.c)`
|
|
169
|
+
@media (max-width: 379px) {
|
|
170
|
+
width: 40px;
|
|
171
|
+
height: 56px;
|
|
172
|
+
font-size: 28px;
|
|
173
|
+
margin: 0;
|
|
174
|
+
}
|
|
175
|
+
`,Go=_styled2.default.div`
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
line-height: 1.3;
|
|
178
|
+
text-align: center;
|
|
179
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}};
|
|
180
|
+
`;function Rt({otpEmailData:o,setOtpEmailData:e}){var p,S,d,b,W;let{crossmintAuth:t}=M(),{appearance:r,setDialogOpen:a,setStep:i,setError:u}=_chunkHNUI5756cjs.a.call(void 0, ),[n,h]=_react.useState.call(void 0, ""),[l,g]=_react.useState.call(void 0, !1),[x,m]=_react.useState.call(void 0, !1),v=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var O,R;m(!0);try{let U=yield t==null?void 0:t.confirmEmailOtp((O=o==null?void 0:o.email)!=null?O:"",(R=o==null?void 0:o.emailId)!=null?R:"",n);yield t==null?void 0:t.handleRefreshAuthMaterial(U),a(!1,!0),i("initial")}catch(U){console.error("Error confirming email OTP",U),u("Invalid code. Please try again."),g(!0)}finally{m(!1)}}),f=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var O;try{yield t==null?void 0:t.sendEmailOtp((O=o==null?void 0:o.email)!=null?O:"")}catch(R){u("Failed to resend code. Please try again.")}});return _jsxruntime.jsxs.call(void 0, Wo,{children:[_jsxruntime.jsx.call(void 0, _chunkS5QCH2EDcjs.a,{onClick:()=>{i("initial"),e(null)},iconColor:(p=r==null?void 0:r.colors)==null?void 0:p.textPrimary,ringColor:(S=r==null?void 0:r.colors)==null?void 0:S.accent}),_jsxruntime.jsxs.call(void 0, Ro,{children:[_jsxruntime.jsx.call(void 0, $o,{children:_jsxruntime.jsx.call(void 0, _chunkI4GMMHQRcjs.a,{customAccentColor:(d=r==null?void 0:r.colors)==null?void 0:d.accent,customButtonBackgroundColor:(b=r==null?void 0:r.colors)==null?void 0:b.buttonBackground,customBackgroundColor:(W=r==null?void 0:r.colors)==null?void 0:W.background})}),_jsxruntime.jsx.call(void 0, zo,{appearance:r,children:"Check your email"}),_jsxruntime.jsxs.call(void 0, jo,{appearance:r,children:["A temporary login code has been sent to",_jsxruntime.jsx.call(void 0, "br",{}),o!=null&&o.email?_jsxruntime.jsx.call(void 0, "strong",{children:o.email}):"your email address"]}),_jsxruntime.jsx.call(void 0, Do,{children:_jsxruntime.jsx.call(void 0, _chunkXBXL7GMYcjs.a,{maxLength:6,value:n,onChange:O=>{h(O),g(!1),u(null)},onComplete:v,disabled:x,appearance:r,children:_jsxruntime.jsxs.call(void 0, _chunkXBXL7GMYcjs.b,{children:[_jsxruntime.jsx.call(void 0, j,{index:0,hasError:l}),_jsxruntime.jsx.call(void 0, j,{index:1,hasError:l}),_jsxruntime.jsx.call(void 0, j,{index:2,hasError:l}),_jsxruntime.jsx.call(void 0, j,{index:3,hasError:l}),_jsxruntime.jsx.call(void 0, j,{index:4,hasError:l}),_jsxruntime.jsx.call(void 0, j,{index:5,hasError:l})]})})}),_jsxruntime.jsxs.call(void 0, Go,{appearance:r,children:["Can't find the email? Check spam folder.",_jsxruntime.jsx.call(void 0, "br",{}),"Some emails may take several minutes to arrive."]}),_jsxruntime.jsx.call(void 0, _chunkDJZOP4MTcjs.a,{initialSeconds:60,appearance:r,countdownText:O=>`Re-send code in ${O}s`,countdownCompleteText:"Re-send code",handleOnClick:f})]})]})}exports.a = Rt; exports.b = Pt; exports.c = F; exports.d = Ft; exports.e = Ut; exports.f = Mt; exports.g = $t; exports.h = zt; exports.i = Dt; exports.j = Ht; exports.k = H; exports.l = st; exports.m = Or; exports.n = M; exports.o = Lt; exports.p = _clientsdkreactbase.useCrossmint; exports.q = _clientsdkreactbase.useWallet;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkSCHRLC2Icjs = require('./chunk-SCHRLC2I.cjs');var _chunkO3H2EYFAcjs = require('./chunk-O3H2EYFA.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkSCHRLC2Icjs = require('./chunk-SCHRLC2I.cjs');var _chunkO3H2EYFAcjs = require('./chunk-O3H2EYFA.cjs');var _chunkEAWYV5ZOcjs = require('./chunk-EAWYV5ZO.cjs');var _chunkQYQERFYLcjs = require('./chunk-QYQERFYL.cjs');var _chunkVI6TW7JTcjs = require('./chunk-VI6TW7JT.cjs');var _chunkTWX7ZBKZcjs = require('./chunk-TWX7ZBKZ.cjs');var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);var _jsxruntime = require('react/jsx-runtime');var v=_styled2.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('@basis-theory-ai/react');var _react3 = require('react');var _jsxruntime = require('react/jsx-runtime');function h(n){return _jsxruntime.jsx.call(void 0, _react.BtAiProvider,{apiKey:n.config.btApiKey,environment:n.config.environment,children:_jsxruntime.jsx.call(void 0, d,_chunk2WSEHVNPcjs.a.call(void 0, {},n))})}function d({agentEnrollmentId:n,onVerificationComplete:e,onVerificationError:t}){let{verifyEnrollment:i}=_react.useBtAi.call(void 0, ),o=_react3.useCallback.call(void 0, ()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{let r=yield i(n);e==null||e(r)}catch(r){t==null||t(r)}}),[i,n,e,t]);return _react3.useEffect.call(void 0, ()=>{o()},[o]),null}exports.a = h;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-ANYQCOAS.js";import{a as C}from"./chunk-LUSXGZYB.js";import{a as d,b as f,c as u}from"./chunk-RV2X7AFS.js";import{a as P}from"./chunk-BWCRTWMO.js";import{a as b}from"./chunk-XFYW7RD2.js";import{Fragment as S,jsx as t,jsxs as e}from"react/jsx-runtime";function A({phone:i,open:r,setOpen:v,step:s,onSubmitOTP:D,onResendOTPCode:h,onSubmitPhone:y,rejectRef:n,appearance:o}){var m,c;function l(O){var g;(r||O)&&((g=n.current)==null||g.call(n,new Error),v(!1))}return e(d,{open:r,setDialogOpen:l,appearance:o,style:{overflow:"hidden"},children:[s==="initial"?e(S,{children:[t(f,{appearance:o,children:"Confirm it's you"}),t(u,{appearance:o,children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code via SMS."})]}):null,s==="otp"?t(a,{contactInfo:i!=null?i:"",contactType:"phone",icon:t(P,{customAccentColor:(m=o==null?void 0:o.colors)==null?void 0:m.accent,customBackgroundColor:(c=o==null?void 0:o.colors)==null?void 0:c.background}),title:"Check your phone",description:e(S,{children:["A temporary login code has been sent via SMS to ",t("strong",{children:i})]}),helpText:`Can't receive the SMS? Check your phone number.
|
|
2
2
|
Some messages may take several minutes to arrive.`,onSubmitOTP:D,onResendCode:h,appearance:o}):t(C,{contactInfo:i!=null?i:"",icon:t(b,{}),onConfirm:y,onCancel:l,appearance:o})]})}export{A as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk-6SBTKAH5.js";import{a as f}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-6SBTKAH5.js";import{a as f}from"./chunk-LMKGXH5T.js";import{a,b as y}from"./chunk-PXDN3KFO.js";import{useCrossmint as S}from"@crossmint/client-sdk-react-base";import{lazy as V,useEffect as s,useRef as c,useState as d}from"react";import{crossmintEmbeddedCheckoutV3Service as I}from"@crossmint/client-sdk-base";import{Fragment as F,jsx as o,jsxs as L}from"react/jsx-runtime";var w=V(()=>import("./components/embed/v3/crypto/CryptoWalletConnectionHandler.js").then(t=>({default:t.CryptoWalletConnectionHandler})));function N(t){var l;let[e,C]=d(null),[b,P]=d(0),[g,k]=d(!1),E=c((l=t.payment.crypto.payer)==null?void 0:l.initialChain),n=c(t);if(x(t,n.current)){let r=a({},t),p=H(t,E.current);p.shouldPreserve&&(r.payment.crypto.payer=p.updatedPayer),n.current=r}let{crossmint:v}=S(),m=f(v,{usageOrigin:"client"}),u=I({apiClient:m}),i=c(null);return s(()=>{let r=i.current;!r||e||C(u.iframe.createClient(r))},[i.current,e]),s(()=>{if(e!=null)return e.on("ui:height.changed",r=>P(r.height)),()=>{e.off("ui:height.changed")}},[e]),s(()=>{if(e==null)return;let r=e.on("crypto:load",()=>{k(!0),e.send("crypto:load.success",{})});return()=>{e.off(r)}},[e]),L(F,{children:[o("iframe",{ref:i,src:u.iframe.getUrl(n.current),id:"crossmint-embedded-checkout.iframe",role:"crossmint-embedded-checkout.iframe",allow:"payment *; microphone; camera",style:{boxShadow:"none",border:"none",padding:"0px",width:"100%",minWidth:"100%",overflow:"hidden",display:"block",userSelect:"none",transform:"translate(0px)",opacity:"1",transition:"ease 0s, opacity 0.4s ease 0.1s",height:`${b}px`,backgroundColor:"transparent"}}),g||n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?o(h,{payer:n.current.payment.crypto.payer,iframeClient:e}):o(w,{iframeClient:e,apiKeyEnvironment:m.parsedAPIKey.environment}):null,o("span",{id:"crossmint-focus-target",tabIndex:-1})]})}function x(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function H(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:y(a({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}export{N as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
1
|
+
import{a as t}from"./chunk-5CU74TAA.js";import{assertValidValidateNFTDetailProps as e,getNFTDetailSrc as i}from"@crossmint/client-sdk-base";import{jsx as s}from"react/jsx-runtime";function d(r){e(r);let o=i(r,t);return s("iframe",{src:o,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-details"})}export{d as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as b}from"./chunk-ANYQCOAS.js";import{a as D}from"./chunk-LUSXGZYB.js";import{a as g,b as u,c as C}from"./chunk-RV2X7AFS.js";import{a as h}from"./chunk-BAXCSO7J.js";import{a as v}from"./chunk-C3JRTLQP.js";import{Fragment as k,jsx as i,jsxs as r}from"react/jsx-runtime";function x({email:t,open:e,setOpen:y,step:l,onSubmitOTP:O,onResendOTPCode:a,onSubmitEmail:P,rejectRef:n,appearance:o}){var m,d,c;function s(S){var f;(e||S)&&((f=n.current)==null||f.call(n,new Error),y(!1))}return r(g,{open:e,setDialogOpen:s,appearance:o,style:{overflow:"hidden"},children:[l==="initial"?r(k,{children:[i(u,{appearance:o,children:"Confirm it's you"}),i(C,{appearance:o,children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code."})]}):null,l==="otp"?i(b,{contactInfo:t!=null?t:"",contactType:"email",icon:i("div",{style:{position:"relative",left:"12px"},children:i(v,{customAccentColor:(m=o==null?void 0:o.colors)==null?void 0:m.accent,customButtonBackgroundColor:(d=o==null?void 0:o.colors)==null?void 0:d.buttonBackground,customBackgroundColor:(c=o==null?void 0:o.colors)==null?void 0:c.background})}),title:"Check your email",description:r(k,{children:["A temporary login code has been sent to ",i("strong",{children:t})]}),helpText:`Can't find the email? Check spam folder.
|
|
2
2
|
Some emails may take several minutes to arrive.`,onSubmitOTP:O,onResendCode:a,appearance:o}):i(D,{contactInfo:t!=null?t:"",icon:i(h,{}),onConfirm:P,onCancel:s,appearance:o})]})}export{x as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"./chunk-UG5R7IPH.js";import{a as y}from"./chunk-RV2X7AFS.js";import{a
|
|
1
|
+
import{a as f}from"./chunk-UG5R7IPH.js";import{a as y}from"./chunk-RV2X7AFS.js";import{a}from"./chunk-DFSB3TWF.js";import{a as l}from"./chunk-OOLXYAO7.js";import{a as C}from"./chunk-77PBG2JJ.js";import{a as g}from"./chunk-HVZ5M3FY.js";import r from"@emotion/styled";import{Fragment as R,jsx as t,jsxs as i}from"react/jsx-runtime";var v=r.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,d as a}from"./chunk-PXDN3KFO.js";import{useBtAi as l,BtAiProvider as m}from"@basis-theory-ai/react";import{useEffect as f,useCallback as y}from"react";import{jsx as c}from"react/jsx-runtime";function u(n){return c(m,{apiKey:n.config.btApiKey,environment:n.config.environment,children:c(d,s({},n))})}function d({agentEnrollmentId:n,onVerificationComplete:e,onVerificationError:t}){let{verifyEnrollment:i}=l(),o=y(()=>a(this,null,function*(){try{let r=yield i(n);e==null||e(r)}catch(r){t==null||t(r)}}),[i,n,e,t]);return f(()=>{o()},[o]),null}export{u as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkM2ROWHEXcjs = require('./chunk-M2ROWHEX.cjs');var _chunkOVJIGWD7cjs = require('./chunk-OVJIGWD7.cjs');var _chunkO3H2EYFAcjs = require('./chunk-O3H2EYFA.cjs');var _chunkYGN7O63Xcjs = require('./chunk-YGN7O63X.cjs');var _chunkEDALAJ5Icjs = require('./chunk-EDALAJ5I.cjs');var _jsxruntime = require('react/jsx-runtime');function B({phone:i,open:r,setOpen:v,step:s,onSubmitOTP:D,onResendOTPCode:h,onSubmitPhone:y,rejectRef:n,appearance:o}){var m,c;function l(O){var g;(r||O)&&((g=n.current)==null||g.call(n,new Error),v(!1))}return _jsxruntime.jsxs.call(void 0, _chunkO3H2EYFAcjs.a,{open:r,setDialogOpen:l,appearance:o,style:{overflow:"hidden"},children:[s==="initial"?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.b,{appearance:o,children:"Confirm it's you"}),_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.c,{appearance:o,children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code via SMS."})]}):null,s==="otp"?_jsxruntime.jsx.call(void 0, _chunkM2ROWHEXcjs.a,{contactInfo:i!=null?i:"",contactType:"phone",icon:_jsxruntime.jsx.call(void 0, _chunkYGN7O63Xcjs.a,{customAccentColor:(m=o==null?void 0:o.colors)==null?void 0:m.accent,customBackgroundColor:(c=o==null?void 0:o.colors)==null?void 0:c.background}),title:"Check your phone",description:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:["A temporary login code has been sent via SMS to ",_jsxruntime.jsx.call(void 0, "strong",{children:i})]}),helpText:`Can't receive the SMS? Check your phone number.
|
|
2
2
|
Some messages may take several minutes to arrive.`,onSubmitOTP:D,onResendCode:h,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkOVJIGWD7cjs.a,{contactInfo:i!=null?i:"",icon:_jsxruntime.jsx.call(void 0, _chunkEDALAJ5Icjs.a,{}),onConfirm:y,onCancel:l,appearance:o})]})}exports.a = B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKMSV2Y6Jcjs = require('./chunk-KMSV2Y6J.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkKMSV2Y6Jcjs.a,_chunk2WSEHVNPcjs.a.call(void 0, {},d))}exports.a = s;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkM2ROWHEXcjs = require('./chunk-M2ROWHEX.cjs');var _chunkOVJIGWD7cjs = require('./chunk-OVJIGWD7.cjs');var _chunkO3H2EYFAcjs = require('./chunk-O3H2EYFA.cjs');var _chunkBPEDL7VVcjs = require('./chunk-BPEDL7VV.cjs');var _chunkI4GMMHQRcjs = require('./chunk-I4GMMHQR.cjs');var _jsxruntime = require('react/jsx-runtime');function M({email:t,open:e,setOpen:y,step:l,onSubmitOTP:O,onResendOTPCode:a,onSubmitEmail:P,rejectRef:n,appearance:o}){var m,d,c;function s(S){var f;(e||S)&&((f=n.current)==null||f.call(n,new Error),y(!1))}return _jsxruntime.jsxs.call(void 0, _chunkO3H2EYFAcjs.a,{open:e,setDialogOpen:s,appearance:o,style:{overflow:"hidden"},children:[l==="initial"?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.b,{appearance:o,children:"Confirm it's you"}),_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.c,{appearance:o,children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code."})]}):null,l==="otp"?_jsxruntime.jsx.call(void 0, _chunkM2ROWHEXcjs.a,{contactInfo:t!=null?t:"",contactType:"email",icon:_jsxruntime.jsx.call(void 0, "div",{style:{position:"relative",left:"12px"},children:_jsxruntime.jsx.call(void 0, _chunkI4GMMHQRcjs.a,{customAccentColor:(m=o==null?void 0:o.colors)==null?void 0:m.accent,customButtonBackgroundColor:(d=o==null?void 0:o.colors)==null?void 0:d.buttonBackground,customBackgroundColor:(c=o==null?void 0:o.colors)==null?void 0:c.background})}),title:"Check your email",description:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:["A temporary login code has been sent to ",_jsxruntime.jsx.call(void 0, "strong",{children:t})]}),helpText:`Can't find the email? Check spam folder.
|
|
2
2
|
Some emails may take several minutes to arrive.`,onSubmitOTP:O,onResendCode:a,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkOVJIGWD7cjs.a,{contactInfo:t!=null?t:"",icon:_jsxruntime.jsx.call(void 0, _chunkBPEDL7VVcjs.a,{}),onConfirm:P,onCancel:s,appearance:o})]})}exports.a = M;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk56YL3XJWcjs = require('./chunk-56YL3XJW.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk56YL3XJWcjs = require('./chunk-56YL3XJW.cjs');var _chunk64YKD3VVcjs = require('./chunk-64YKD3VV.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _jsxruntime = require('react/jsx-runtime');function z(d){let[f,h]=_react.useState.call(void 0, !1),{crossmint:k}=_clientsdkreactbase.useCrossmint.call(void 0, ),y=_chunk64YKD3VVcjs.a.call(void 0, k),c=d,{recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v}=c,b=_chunk2WSEHVNPcjs.c.call(void 0, c,["recipient","locale","lineItems","payment","appearance","metadata"]),n={recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v},x=_clientsdkbase.crossmintHostedCheckoutV3Service.call(void 0, {apiClient:y,hostedCheckoutProps:n}),t=_clientsdkbase.crossmintHostedCheckoutV3StylesService.call(void 0, n),p=b,{onClick:r,className:E,children:o}=p,I=_chunk2WSEHVNPcjs.c.call(void 0, p,["onClick","className","children"]);function B(e){e.preventDefault(),e.stopPropagation(),x.createWindow(),r&&r(e)}let i=t.generateCss();return _react.useEffect.call(void 0, ()=>{let{cleanup:e}=t.injectCss(i);return h(!0),e},[i]),f?_jsxruntime.jsxs.call(void 0, "button",_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {onClick:B,className:_clsx2.default.call(void 0, t.identifiers.buttonClassNames,E)},I),{children:[_jsxruntime.jsx.call(void 0, _chunk56YL3XJWcjs.a,{style:{marginRight:"12px",flex:"none"},displayType:"icon-only",id:t.identifiers.logoId,height:16,width:16}),o!=null?o:_jsxruntime.jsx.call(void 0, "p",{style:{margin:0},children:t.getButtonText()})]})):null}exports.a = z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk64YKD3VVcjs = require('./chunk-64YKD3VV.cjs');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function b(n){let[e,s]=_react.useState.call(void 0, null),[l,d]=_react.useState.call(void 0, 0),m=_react.useRef.call(void 0, null),{crossmint:f}=_clientsdkreactbase.useCrossmint.call(void 0, ),h=_chunk64YKD3VVcjs.a.call(void 0, f,{usageOrigin:"client"}),r=_clientsdkbase.createPaymentMethodManagementService.call(void 0, {apiClient:h});return _react.useEffect.call(void 0, ()=>{let t=m.current;!t||e||s(r.iframe.createClient(t))},[m.current,e]),_react.useEffect.call(void 0, ()=>{if(e!=null)return e.on("ui:height.changed",t=>d(t.height)),e.on("payment-method:selected",t=>{var a;return(a=n.onPaymentMethodSelected)==null?void 0:a.call(n,t)}),e.on("agentic-enrollment:created",t=>{var a;return(a=n.onAgenticEnrollmentCreated)==null?void 0:a.call(n,t.agenticEnrollment,t.verificationConfig)}),()=>{e.off("ui:height.changed"),e.off("payment-method:selected"),e.off("agentic-enrollment:created")}},[e]),_jsxruntime.jsx.call(void 0, "iframe",{ref:m,src:r.iframe.getUrl(n),id:"crossmint-payment-method-management.iframe",role:"crossmint-payment-method-management.iframe",allow:"payment *; microphone; camera",style:{boxShadow:"none",border:"none",padding:"0px",width:"100%",minWidth:"100%",overflow:"hidden",display:"block",userSelect:"none",transform:"translate(0px)",opacity:"1",transition:"ease 0s, opacity 0.4s ease 0.1s",height:`${l}px`,backgroundColor:"transparent"}})}exports.a = b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-ETAEFFCS.js";import{a as i}from"./chunk-AZ72RWXJ.js";import{a as s}from"./chunk-EUJ5GQ5N.js";import{a as r}from"./chunk-PXDN3KFO.js";import{CrossmintWalletBaseProvider as p}from"@crossmint/client-sdk-react-base";import{Fragment as d,jsx as o,jsxs as P}from"react/jsx-runtime";function c({emailSignerProps:t,phoneSignerProps:n,passkeyPromptProps:e}){return P(d,{children:[o(a,r({},t)),o(i,r({},n)),e!=null&&o(s,r({},e))]})}function I({children:t,showPasskeyHelpers:n=!0,appearance:e,createOnLogin:l,callbacks:m}){return o(p,{createOnLogin:l,appearance:e,showPasskeyHelpers:n,callbacks:m,renderUI:c,children:t})}export{I as a};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import{a as Pt}from"./chunk-LI7QMYLA.js";import{a as vt}from"./chunk-ED6OVXN6.js";import{a as yt,b as Ct,c as At}from"./chunk-O5IPDCMT.js";import{a as J}from"./chunk-4HSZ5QA3.js";import{a as wt}from"./chunk-AC2SJG3Q.js";import{a as C,b as xt}from"./chunk-2F3UEXTE.js";import{a as Ot}from"./chunk-KFFPM6JM.js";import{a as ht}from"./chunk-JL7YHC7D.js";import{a as X}from"./chunk-AOBO3CEQ.js";import{a as ft}from"./chunk-23YVHBPI.js";import{a as bt}from"./chunk-UG5R7IPH.js";import{a as pt,b as mt,c as dt}from"./chunk-RV2X7AFS.js";import{a as G}from"./chunk-NZUCXN2O.js";import{a as s}from"./chunk-DFSB3TWF.js";import{a as q}from"./chunk-OAHZHKRR.js";import{a as N}from"./chunk-UAFW3OWA.js";import{a as gt}from"./chunk-C3JRTLQP.js";import{a as z,b as j,c as V,d as y}from"./chunk-PXDN3KFO.js";import{useState as ut}from"react";import U from"@emotion/styled";import{useCrossmint as Dr,useWallet as Gr}from"@crossmint/client-sdk-react-base";import{useContext as Wo}from"react";import{useEffect as at,useMemo as Oo,useState as Y,useCallback as Z,createContext as Po,useRef as So,lazy as ko,Suspense as Eo}from"react";import{validateApiKeyAndGetCrossmintBaseUrl as Io}from"@crossmint/common-sdk-base";import{useCrossmint as Fo,CrossmintAuthBaseProvider as Lo,useCrossmintAuthBase as Vt}from"@crossmint/client-sdk-react-base";import{lazy as yo,Suspense as Co}from"react";import Ao from"color";import Ht from"@emotion/styled";import{useState as xo}from"react";import{useState as ot}from"react";import Mt from"color";import T from"@emotion/styled";import{isEmailValid as et}from"@crossmint/common-sdk-auth";import{createContext as oo,useCallback as kt,useContext as eo,useEffect as ro,useState as Et}from"react";import{useEffect as Xt,useRef as qt,useState as Jt,useCallback as Qt}from"react";import{ChildWindow as Yt,PopupWindow as Zt}from"@crossmint/client-sdk-window";import{z as Q}from"zod";var St=(o,e)=>{let{crossmintAuth:t}=W(),[r,a]=Jt(null),i=qt(null);return Xt(()=>(i.current==null&&(i.current=new Yt(window.opener||window.parent,"*",{incomingEvents:to})),()=>{i.current!=null&&i.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:Qt((n,h)=>y(void 0,null,function*(){if(i.current==null)throw new Error("Child window not initialized");a(n),e(null),console.log("createPopupAndSetupListeners",n,h),console.log("oauthUrlMap",o),console.log("oauthUrlMap[provider]",o[n]);let l=new URL(o[n]);if(h!=null){let f=Array.from(l.searchParams.entries());l.search="",h&&l.searchParams.append("provider_login_hint",h),f.forEach(([c,p])=>{l.searchParams.append(c,p)})}let g=yield Zt.init(l.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),x=f=>y(void 0,null,function*(){var c,p;yield t==null?void 0:t.handleRefreshAuthMaterial(f.oneTimeSecret),(c=i.current)==null||c.off("authMaterialFromPopupCallback"),(p=g.window)==null||p.close(),a(null)}),m=f=>{var c,p;e(f.error),(c=i.current)==null||c.off("errorFromPopupCallback"),(p=g.window)==null||p.close(),a(null)};i.current.on("authMaterialFromPopupCallback",x),i.current.on("errorFromPopupCallback",m);let v=setInterval(()=>{var f,c;(f=g.window)!=null&&f.closed&&(clearInterval(v),a(null),(c=i.current)==null||c.off("authMaterialFromPopupCallback"))},2500)}),[o,t,e]),isLoading:r!=null,activeOAuthProvider:r}},to={authMaterialFromPopupCallback:Q.object({oneTimeSecret:Q.string()}),errorFromPopupCallback:Q.object({error:Q.string()})};import{jsx as no}from"react/jsx-runtime";var It={google:"",twitter:""},Ft=oo(void 0);function L(){let o=eo(Ft);if(!o)throw new Error("useOAuthFlow must be used within an OAuthFlowProvider");return o}function Lt({children:o,prefetchOAuthUrls:e}){let{crossmintAuth:t,loginMethods:r}=Tt(),{setError:a}=C(),[i,u]=Et(It),[n,h]=Et(!0),{createPopupAndSetupListeners:l,isLoading:g,activeOAuthProvider:x}=St(i,a),m=kt(()=>y(this,null,function*(){h(!0);try{let p=(r||[]).filter(d=>d in It).map(d=>y(this,null,function*(){let b=yield t==null?void 0:t.getOAuthUrl(d);return{[d]:b}})),k=Object.assign({},...yield Promise.all(p));u(k)}catch(c){a(c instanceof Error?c.message:"Unable to load oauth providers. Please try again later.")}finally{h(!1)}}),[r,t,a]);ro(()=>{e&&m()},[m,e]);let f={startOAuthLogin:kt((c,p)=>y(this,null,function*(){yield l(c,p)}),[l]),isLoading:n||g,activeOAuthProvider:x};return no(Ft.Provider,{value:f,children:o})}import Ut from"@emotion/styled";import{jsx as tt,jsxs as so}from"react/jsx-runtime";var io=Ut.button`
|
|
2
|
+
${G}
|
|
3
|
+
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
height: 32px;
|
|
9
|
+
padding: 0 10px;
|
|
10
|
+
border: 1px solid ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.border)||s["cm-border"]}};
|
|
11
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"12px"}};
|
|
12
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.buttonBackground)||s["cm-background-primary"]}};
|
|
13
|
+
cursor: ${o=>o.isLoading?"not-allowed":"pointer"};
|
|
14
|
+
|
|
15
|
+
/* Hover and focus states */
|
|
16
|
+
&:hover {
|
|
17
|
+
background-color: ${o=>o.isLoading?s["cm-muted-primary"]:s["cm-hover"]};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:focus {
|
|
21
|
+
outline: none;
|
|
22
|
+
background-color: theme["cm-hover"];
|
|
23
|
+
}
|
|
24
|
+
`,ao=Ut.span`
|
|
25
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]}};
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
`;function Bt({emailInput:o,appearance:e}){var i,u;let{startOAuthLogin:t,activeOAuthProvider:r}=L(),a=r==="google";return so(io,{type:"button",appearance:e,isLoading:a,onClick:a?void 0:()=>t("google",o.trim().toLowerCase()),children:[tt(q,{style:{height:"18px",width:"18px"}}),a?tt(X,{style:{color:(i=e==null?void 0:e.colors)==null?void 0:i.textSecondary,fill:(u=e==null?void 0:e.colors)==null?void 0:u.textPrimary,width:"18px",height:"18px"}}):tt(ao,{appearance:e,children:"Continue"})]})}import{jsx as F,jsxs as rt}from"react/jsx-runtime";var lo=T.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
justify-content: flex-start;
|
|
33
|
+
width: 100%;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
`,uo=T.div`
|
|
36
|
+
width: 100%;
|
|
37
|
+
`,co=T.label`
|
|
38
|
+
display: block;
|
|
39
|
+
margin-bottom: 5px;
|
|
40
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||s["cm-text-primary"]}};
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
`,po=T.form`
|
|
44
|
+
position: relative;
|
|
45
|
+
`,mo=T.input`
|
|
46
|
+
${G}
|
|
47
|
+
|
|
48
|
+
/* Base input styles */
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-grow: 1;
|
|
51
|
+
text-align: left;
|
|
52
|
+
padding-left: 16px;
|
|
53
|
+
padding-right: ${o=>o.showGoogleButton?"132px":"80px"};
|
|
54
|
+
height: 58px;
|
|
55
|
+
width: 100%;
|
|
56
|
+
border: 1px solid;
|
|
57
|
+
border-color: ${o=>{var e,t,r,a;return o.hasError?((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)||s["cm-danger"]:((a=(r=o.appearance)==null?void 0:r.colors)==null?void 0:a.border)||s["cm-border"]}};
|
|
58
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"12px"}};
|
|
59
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||s["cm-background-primary"]}};
|
|
60
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||s["cm-text-primary"]}};
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
|
|
63
|
+
|
|
64
|
+
&::placeholder {
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||s["cm-text-secondary"]}};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus {
|
|
70
|
+
outline: none;
|
|
71
|
+
box-shadow: 0 0 0 2px ${o=>{var e,t;return new Mt(((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]).alpha(.18).toString()}};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:read-only {
|
|
75
|
+
cursor: not-allowed;
|
|
76
|
+
opacity: 0.7;
|
|
77
|
+
}
|
|
78
|
+
`,ho=T.div`
|
|
79
|
+
position: absolute;
|
|
80
|
+
right: 0;
|
|
81
|
+
top: 0;
|
|
82
|
+
bottom: 0;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
padding-right: 16px;
|
|
86
|
+
`,fo=T.button`
|
|
87
|
+
${G}
|
|
88
|
+
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||s["cm-background-primary"]}};
|
|
92
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]}};
|
|
93
|
+
cursor: ${o=>o.disabled?"not-allowed":"pointer"};
|
|
94
|
+
opacity: ${o=>o.disabled?.6:1};
|
|
95
|
+
border: none;
|
|
96
|
+
padding: 8px 12px;
|
|
97
|
+
border-radius: 6px;
|
|
98
|
+
transition: opacity 200ms ease;
|
|
99
|
+
|
|
100
|
+
&:hover:not(:disabled) {
|
|
101
|
+
opacity: 0.8;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:focus-visible {
|
|
105
|
+
outline: 2px solid ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]}};
|
|
106
|
+
outline-offset: 2px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:not(:disabled):focus-visible {
|
|
110
|
+
box-shadow: 0 0 0 2px ${o=>{var e,t;return new Mt(((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]).alpha(.18).toString()}};
|
|
111
|
+
}
|
|
112
|
+
`,go=T.p`
|
|
113
|
+
font-size: 12px;
|
|
114
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)||s["cm-danger"]}};
|
|
115
|
+
margin: 8px 0 8px 0;
|
|
116
|
+
`;function Wt({setOtpEmailData:o}){var c,p,k;let{crossmintAuth:e}=W(),{appearance:t,defaultEmail:r,setStep:a,setError:i,loginMethods:u}=C(),[n,h]=ot(r!=null?r:""),[l,g]=ot(""),[x,m]=ot(!1),v=n.toLowerCase().includes("@gmail.com")&&!n.toLowerCase().includes("+")&&et(n)&&!x&&u.includes("google");function f(d){return y(this,null,function*(){d.preventDefault(),m(!0);try{let b=n.trim().toLowerCase(),R=yield e==null?void 0:e.sendEmailOtp(b);o({email:b,emailId:R.emailId}),a("otp")}catch(b){m(!1),i("Failed to send email. Please try again or contact support.")}})}return F(lo,{children:rt(uo,{children:[F(co,{appearance:t,children:"Email"}),rt(po,{role:"form",onSubmit:d=>{if(v){d.preventDefault();return}et(n)?f(d):d.preventDefault()},noValidate:!0,children:[F(ft,{children:"Email"}),F(mo,{id:"emailInput",appearance:t,hasError:!!l,showGoogleButton:v,type:"email",placeholder:"your@email.com",value:n,onChange:d=>{h(d.target.value),g(""),i(null)},readOnly:x,"aria-describedby":"emailError"}),rt(ho,{children:[l&&F(N,{customColor:(c=t==null?void 0:t.colors)==null?void 0:c.danger}),x&&F(X,{style:{color:(p=t==null?void 0:t.colors)==null?void 0:p.textSecondary,fill:(k=t==null?void 0:t.colors)==null?void 0:k.textPrimary}}),v?F(Bt,{emailInput:n,appearance:t}):!l&&!x?F(fo,{type:"submit",appearance:t,disabled:!et(n)||x,children:"Submit"}):null]})]}),l&&F(go,{appearance:t,id:"emailError",children:l})]})})}import{jsx as Rt}from"react/jsx-runtime";function zt(){let{step:o}=C(),[e,t]=xo(null);return o==="otp"?Rt($t,{otpEmailData:e,setOtpEmailData:t}):o==="initial"?Rt(Wt,{setOtpEmailData:t}):null}import{jsx as nt}from"react/jsx-runtime";function jt(e){var o=V(e,[]);var n;let{step:t,appearance:r}=C(),{startOAuthLogin:a,activeOAuthProvider:i}=L(),u=i==="google";return t!=="initial"?null:nt(J,j(z({icon:nt(q,{style:{height:"25px",width:"25px"}}),isLoading:u,appearance:r,onButtonClick:()=>a("google")},o),{children:nt("span",{style:{color:(n=r==null?void 0:r.colors)==null?void 0:n.textPrimary},children:"Sign in with Google"})}))}import{jsx as Dt}from"react/jsx-runtime";function Gt(e){var o=V(e,[]);let{step:t,appearance:r}=C(),{startOAuthLogin:a,activeOAuthProvider:i}=L(),u=i==="twitter";return t!=="initial"?null:Dt(J,j(z({icon:Dt(Ot,{style:{height:"22px",width:"22px"}}),isLoading:u,appearance:r,onButtonClick:()=>a("twitter")},o),{children:"Sign in with X"}))}import{jsx as A,jsxs as H}from"react/jsx-runtime";var wo=yo(()=>Promise.all([import("./providers/auth/FarcasterProvider.js"),import("./components/auth/methods/farcaster/FarcasterSignIn.js")]).then(([o,e])=>({default:({baseUrl:t})=>A(o.FarcasterProvider,{baseUrl:t,children:A(e.FarcasterSignIn,{})})}))),vo=Ht.div`
|
|
117
|
+
position: relative;
|
|
118
|
+
padding: 40px 24px 30px 24px;
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: 10px;
|
|
122
|
+
-webkit-font-smoothing: antialiased;
|
|
123
|
+
animation: none;
|
|
124
|
+
|
|
125
|
+
@media (min-width: 480px) {
|
|
126
|
+
padding: 40px 40px 30px 40px;
|
|
127
|
+
}
|
|
128
|
+
`,bo=Ht.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: flex-start;
|
|
131
|
+
justify-content: flex-start;
|
|
132
|
+
border-radius: 8px;
|
|
133
|
+
padding: 8px;
|
|
134
|
+
gap: 8px;
|
|
135
|
+
margin-top: 34px;
|
|
136
|
+
background-color: ${o=>{var e,t,r;return new Ao((r=(t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)!=null?r:s["cm-danger"]).alpha(.12).toString()}};
|
|
137
|
+
`;function _t({style:o}){var h,l,g,x,m,v,f,c,p,k;let{step:e,appearance:t,loginMethods:r,baseUrl:a,error:i,termsOfServiceText:u,authModalTitle:n}=C();return H(vo,{style:o,children:[i!=null?H(bo,{appearance:t,children:[A("div",{style:{minWidth:"20px"},children:A(N,{customColor:(l=(h=t==null?void 0:t.colors)==null?void 0:h.danger)!=null?l:s["cm-danger"]})}),A("p",{style:{fontSize:"14px",margin:0,color:(x=(g=t==null?void 0:t.colors)==null?void 0:g.danger)!=null?x:s["cm-danger"]},children:i})]}):null,e==="initial"?H("div",{children:[A(mt,{appearance:t,children:n!=null?n:"Sign in to Crossmint"}),A(dt,{appearance:t,children:"Access using one of the options below."})]}):null,r.includes("google")?A(jt,{}):null,r.includes("farcaster")?A(Co,{fallback:null,children:A(wo,{baseUrl:a})}):null,r.includes("twitter")?A(Gt,{}):null,r.some(d=>d.startsWith("web3"))?A(Pt,{}):null,r.includes("email")?H("div",{children:[r.length>1?A(vt,{appearance:t,text:"OR"}):null,A(zt,{})]}):null,e==="initial"&&u!=null?H("div",{style:{fontSize:"0.875rem",textAlign:"center",marginTop:"0.5rem",color:(v=(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary)!=null?v:s["cm-text-secondary"]},children:[A("style",{children:`
|
|
138
|
+
p a {
|
|
139
|
+
color: ${(c=(f=t==null?void 0:t.colors)==null?void 0:f.textLink)!=null?c:s["cm-link"]};
|
|
140
|
+
}
|
|
141
|
+
`}),u]}):null,e==="initial"||e==="otp"?A(bt,{style:{marginTop:"1rem",justifyContent:"center"},color:(k=(p=t==null?void 0:t.colors)==null?void 0:p.textSecondary)!=null?k:s["cm-text-secondary"]}):null]})}import{jsx as Kt}from"react/jsx-runtime";function _({open:o}){let{appearance:e,setDialogOpen:t}=C();return Kt(pt,{open:o,setDialogOpen:t,appearance:e,children:Kt(_t,{style:{maxWidth:"448px",padding:"0px"}})})}import{Fragment as st,jsx as I,jsxs as it}from"react/jsx-runtime";var To=ko(()=>import("./providers/dynamic/DynamicWalletProvider.js").then(o=>({default:o.DynamicWalletProvider}))),Uo={crossmintAuth:void 0,login:()=>{},logout:()=>y(void 0,null,function*(){}),jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},experimental_externalWalletSigner:void 0,experimental_loginWithOAuth:()=>Promise.resolve(),loginMethods:[]},lt=Po(Uo);function Bo({children:o,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r=!0,authModalTitle:a,onLoginSuccess:i,loginMethods:u=["email","google"]}){let n=Vt(),{crossmint:h,experimental_setCustomAuth:l,experimental_customAuth:g}=Fo("CrossmintAuthProvider must be used within CrossmintProvider"),x=Io(h.apiKey),[m,v]=Y(!1),[f,c]=Y(void 0),[p,k]=Y(!0),d=u.some(E=>E.startsWith("web3")),[b,R]=Y(void 0),O=So(null);at(()=>{var E,M;n.jwt==null&&(g==null?void 0:g.jwt)!=null&&l(void 0),b!=null||((E=n.user)==null?void 0:E.email)!=null?l({jwt:n.jwt,email:(M=n.user)==null?void 0:M.email,externalWalletSigner:b}):l({jwt:n.jwt})},[b,n.jwt,n.user,l,g]),at(()=>{n.jwt!=null&&m&&v(!1)},[n.jwt,m]);let $=Z(E=>{if(n.jwt!=null){console.log("User already logged in");return}E!=null&&typeof E=="string"&&c(E),v(!0)},[n.jwt]),B=Z(()=>n.status==="initializing"||d&&!p?"initializing":n.jwt!=null?"logged-in":m?"in-progress":"logged-out",[n.status,n.jwt,d,p,m]),ct=Z(E=>y(this,null,function*(){var M;if(n.jwt!=null){console.log("User already logged in");return}yield(M=O.current)==null?void 0:M.call(O,E)}),[n.jwt]),Nt=Oo(()=>j(z({},n),{login:$,status:B(),experimental_externalWalletSigner:b,experimental_loginWithOAuth:ct,loginMethods:u}),[n,$,B,b,ct,u]);return I(lt.Provider,{value:Nt,children:I(xt,{setDialogOpen:(E,M)=>{v(E),M&&(i==null||i())},initialState:{appearance:e,loginMethods:u,termsOfServiceText:t,authModalTitle:a,baseUrl:x,defaultEmail:f},children:I(Lt,{prefetchOAuthUrls:B()==="logged-out"&&r,children:I(Mo,{loginWithOAuthRef:O,children:d?I(Eo,{fallback:it(st,{children:[o,I(_,{open:m})]}),children:it(To,{apiKeyEnvironment:h.apiKey.includes("production")?"production":"staging",loginMethods:u,appearance:e,onSdkLoaded:k,onWalletConnected:R,children:[o,I(_,{open:m})]})}):it(st,{children:[o,I(_,{open:m})]})})})})})}function Mo({children:o,loginWithOAuthRef:e}){let{startOAuthLogin:t}=L(),r=Vt(),a=Z(i=>y(this,null,function*(){if(r.jwt!=null){console.log("User already logged in");return}yield t(i)}),[r.jwt,t]);return at(()=>{e.current=a},[a,e]),I(st,{children:o})}function Pr({children:o,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r=!0,authModalTitle:a,onLoginSuccess:i,loginMethods:u=["email","google"],refreshRoute:n,logoutRoute:h}){return I(Lo,{onLoginSuccess:i,refreshRoute:n,logoutRoute:h,children:I(Bo,{onLoginSuccess:i,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r,authModalTitle:a,loginMethods:u,children:o})})}function W(){let o=Wo(lt);if(o==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return o}var Tt=W;import{jsx as w,jsxs as K}from"react/jsx-runtime";var Ro=U.div`
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
`,$o=U.div`
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: flex-start;
|
|
149
|
+
width: 100%;
|
|
150
|
+
`,zo=U.div`
|
|
151
|
+
position: relative;
|
|
152
|
+
left: 12px;
|
|
153
|
+
`,jo=U.p`
|
|
154
|
+
font-size: 16px;
|
|
155
|
+
font-weight: 400;
|
|
156
|
+
margin: 16px 0 4px 0;
|
|
157
|
+
text-align: center;
|
|
158
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||s["cm-text-primary"]}};
|
|
159
|
+
`,Do=U.p`
|
|
160
|
+
text-align: center;
|
|
161
|
+
padding: 0 16px;
|
|
162
|
+
margin: 0;
|
|
163
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||s["cm-text-secondary"]}};
|
|
164
|
+
font-size: 14px;
|
|
165
|
+
line-height: 1.4;
|
|
166
|
+
`,Go=U.div`
|
|
167
|
+
padding: 32px 0;
|
|
168
|
+
`,D=U(At)`
|
|
169
|
+
@media (max-width: 379px) {
|
|
170
|
+
width: 40px;
|
|
171
|
+
height: 56px;
|
|
172
|
+
font-size: 28px;
|
|
173
|
+
margin: 0;
|
|
174
|
+
}
|
|
175
|
+
`,Ho=U.div`
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
line-height: 1.3;
|
|
178
|
+
text-align: center;
|
|
179
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||s["cm-text-secondary"]}};
|
|
180
|
+
`;function $t({otpEmailData:o,setOtpEmailData:e}){var p,k,d,b,R;let{crossmintAuth:t}=W(),{appearance:r,setDialogOpen:a,setStep:i,setError:u}=C(),[n,h]=ut(""),[l,g]=ut(!1),[x,m]=ut(!1),v=()=>y(this,null,function*(){var O,$;m(!0);try{let B=yield t==null?void 0:t.confirmEmailOtp((O=o==null?void 0:o.email)!=null?O:"",($=o==null?void 0:o.emailId)!=null?$:"",n);yield t==null?void 0:t.handleRefreshAuthMaterial(B),a(!1,!0),i("initial")}catch(B){console.error("Error confirming email OTP",B),u("Invalid code. Please try again."),g(!0)}finally{m(!1)}}),f=()=>y(this,null,function*(){var O;try{yield t==null?void 0:t.sendEmailOtp((O=o==null?void 0:o.email)!=null?O:"")}catch($){u("Failed to resend code. Please try again.")}});return K(Ro,{children:[w(wt,{onClick:()=>{i("initial"),e(null)},iconColor:(p=r==null?void 0:r.colors)==null?void 0:p.textPrimary,ringColor:(k=r==null?void 0:r.colors)==null?void 0:k.accent}),K($o,{children:[w(zo,{children:w(gt,{customAccentColor:(d=r==null?void 0:r.colors)==null?void 0:d.accent,customButtonBackgroundColor:(b=r==null?void 0:r.colors)==null?void 0:b.buttonBackground,customBackgroundColor:(R=r==null?void 0:r.colors)==null?void 0:R.background})}),w(jo,{appearance:r,children:"Check your email"}),K(Do,{appearance:r,children:["A temporary login code has been sent to",w("br",{}),o!=null&&o.email?w("strong",{children:o.email}):"your email address"]}),w(Go,{children:w(yt,{maxLength:6,value:n,onChange:O=>{h(O),g(!1),u(null)},onComplete:v,disabled:x,appearance:r,children:K(Ct,{children:[w(D,{index:0,hasError:l}),w(D,{index:1,hasError:l}),w(D,{index:2,hasError:l}),w(D,{index:3,hasError:l}),w(D,{index:4,hasError:l}),w(D,{index:5,hasError:l})]})})}),K(Ho,{appearance:r,children:["Can't find the email? Check spam folder.",w("br",{}),"Some emails may take several minutes to arrive."]}),w(ht,{initialSeconds:60,appearance:r,countdownText:O=>`Re-send code in ${O}s`,countdownCompleteText:"Re-send code",handleOnClick:f})]})]})}export{$t as a,St as b,L as c,Lt as d,Bt as e,Wt as f,zt as g,jt as h,Gt as i,_t as j,_ as k,lt as l,Pr as m,W as n,Tt as o,Dr as p,Gr as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk64YKD3VVcjs = require('./chunk-64YKD3VV.cjs');var _react = require('react');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');var s=_react.createContext.call(void 0, void 0);function O({children:e}){let[r,d]=_react.useState.call(void 0, void 0),[c,u]=_react.useState.call(void 0, void 0),{crossmint:C}=_clientsdkreactbase.useCrossmint.call(void 0, ),m=_chunk64YKD3VVcjs.a.call(void 0, C,{usageOrigin:"client"});return _react.useEffect.call(void 0, ()=>{let n=t=>{if(t.origin!==new URL(m.baseUrl).origin||t.data.event!=="order:updated")return;let{order:a,orderClientSecret:f}=t.data.data;d(a),u(f)};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[r]),_jsxruntime.jsx.call(void 0, s.Provider,{value:{order:r,orderClientSecret:c},children:e})}function b(){let e=_react.useContext.call(void 0, s);if(!e)throw new Error("useCrossmintCheckout must be used within a CrossmintCheckoutProvider");return e}exports.a = O; exports.b = b;
|