@crossmint/client-sdk-react-native-ui 0.13.23 → 0.13.25

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 (39) hide show
  1. package/dist/{chunk-SLOU5KYU.mjs → chunk-2P3TENLG.mjs} +1 -1
  2. package/dist/{chunk-RXPKMBUY.js → chunk-54N76NB5.js} +1 -1
  3. package/dist/{chunk-XKZ6DL3C.js → chunk-6TDBUOQE.js} +1 -1
  4. package/dist/{chunk-IHIEOHHR.js → chunk-6VB24RAY.js} +1 -1
  5. package/dist/{chunk-XQFDVUIR.js → chunk-BFSRTQYZ.js} +1 -1
  6. package/dist/{chunk-LV3HQN6T.mjs → chunk-BJ4RVJCD.mjs} +1 -1
  7. package/dist/chunk-KJVQ4KFY.mjs +1 -0
  8. package/dist/{chunk-OZY7BVZK.mjs → chunk-NAWX5EA2.mjs} +1 -1
  9. package/dist/{chunk-4KGLVNAQ.mjs → chunk-PQ2BJPQR.mjs} +1 -1
  10. package/dist/{chunk-ASMT7O6R.mjs → chunk-PQB7WIHM.mjs} +1 -1
  11. package/dist/{chunk-YGNB5JQI.js → chunk-SWS4LNSV.js} +1 -1
  12. package/dist/{chunk-PRBG566A.mjs → chunk-U6RLI4GK.mjs} +1 -1
  13. package/dist/{chunk-FF6XNU67.js → chunk-UPIRXOVH.js} +1 -1
  14. package/dist/chunk-X7RV3TA3.js +1 -0
  15. package/dist/components/embed/index.js +1 -1
  16. package/dist/components/embed/index.mjs +1 -1
  17. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
  18. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.mjs +1 -1
  19. package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.js +1 -1
  20. package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.mjs +1 -1
  21. package/dist/components/embed/v3/index.js +1 -1
  22. package/dist/components/embed/v3/index.mjs +1 -1
  23. package/dist/components/index.js +1 -1
  24. package/dist/components/index.mjs +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/index.mjs +1 -1
  27. package/dist/logger/init.js +1 -1
  28. package/dist/logger/init.mjs +1 -1
  29. package/dist/providers/CrossmintProvider.js +1 -1
  30. package/dist/providers/CrossmintProvider.mjs +1 -1
  31. package/dist/providers/CrossmintWalletProvider.js +1 -1
  32. package/dist/providers/CrossmintWalletProvider.mjs +1 -1
  33. package/dist/providers/index.js +1 -1
  34. package/dist/providers/index.mjs +1 -1
  35. package/dist/utils/createCrossmintApiClient.js +1 -1
  36. package/dist/utils/createCrossmintApiClient.mjs +1 -1
  37. package/package.json +4 -4
  38. package/dist/chunk-PHRFWZON.js +0 -1
  39. package/dist/chunk-Q3PECLWS.mjs +0 -1
@@ -1 +1 @@
1
- import{a as n}from"./chunk-OZY7BVZK.mjs";import{CrossmintApiClient as e}from"@crossmint/common-sdk-base";function C(i,t){return new e(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:n.version},apiKeyExpectations:t}})}export{C as a};
1
+ import{a as n}from"./chunk-NAWX5EA2.mjs";import{CrossmintApiClient as e}from"@crossmint/common-sdk-base";function C(i,t){return new e(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:n.version},apiKeyExpectations:t}})}export{C as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYQEWHOQ7js = require('./chunk-YQEWHOQ7.js');var _chunkVACQTZRTjs = require('./chunk-VACQTZRT.js');var _chunkXKZ6DL3Cjs = require('./chunk-XKZ6DL3C.js');var _chunk2D2RJCVXjs = require('./chunk-2D2RJCVX.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _reactnative = require('react-native');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function Q(t){var u;let[e,w]=_react.useState.call(void 0, null),[C,v]=_react.useState.call(void 0, 0),E=_react.useRef.call(void 0, (u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=_react.useRef.call(void 0, t);if(U(t,n.current)){let r=_chunkJ42HASCIjs.a.call(void 0, {},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),V=_chunkXKZ6DL3Cjs.a.call(void 0, i,{usageOrigin:"client"}),P=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:V}),s=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{let r=s.current;if(!r||e)return;let o=new (0, _clientsdkrnwindow.WebViewParent)({current:r},{incomingEvents:_clientsdkbase.embeddedCheckoutV3IncomingEvents,outgoingEvents:_clientsdkbase.embeddedCheckoutV3OutgoingEvents});w(o)},[s.current,e]),_react.useEffect.call(void 0, ()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{_chunk2D2RJCVXjs.a.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:{flex:1},children:[_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:_chunkYQEWHOQ7js.c,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunkVACQTZRTjs.a,{payer:n.current.payment.crypto.payer,webViewClient:e}):_jsxruntime.jsx.call(void 0, H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunkJ42HASCIjs.b.call(void 0, _chunkJ42HASCIjs.a.call(void 0, {},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}exports.a = Q;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYQEWHOQ7js = require('./chunk-YQEWHOQ7.js');var _chunkVACQTZRTjs = require('./chunk-VACQTZRT.js');var _chunk6TDBUOQEjs = require('./chunk-6TDBUOQE.js');var _chunk2D2RJCVXjs = require('./chunk-2D2RJCVX.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _reactnative = require('react-native');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function Q(t){var u;let[e,w]=_react.useState.call(void 0, null),[C,v]=_react.useState.call(void 0, 0),E=_react.useRef.call(void 0, (u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=_react.useRef.call(void 0, t);if(U(t,n.current)){let r=_chunkJ42HASCIjs.a.call(void 0, {},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),V=_chunk6TDBUOQEjs.a.call(void 0, i,{usageOrigin:"client"}),P=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:V}),s=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{let r=s.current;if(!r||e)return;let o=new (0, _clientsdkrnwindow.WebViewParent)({current:r},{incomingEvents:_clientsdkbase.embeddedCheckoutV3IncomingEvents,outgoingEvents:_clientsdkbase.embeddedCheckoutV3OutgoingEvents});w(o)},[s.current,e]),_react.useEffect.call(void 0, ()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{_chunk2D2RJCVXjs.a.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:{flex:1},children:[_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:_chunkYQEWHOQ7js.c,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunkVACQTZRTjs.a,{payer:n.current.payment.crypto.payer,webViewClient:e}):_jsxruntime.jsx.call(void 0, H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunkJ42HASCIjs.b.call(void 0, _chunkJ42HASCIjs.a.call(void 0, {},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}exports.a = Q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYGNB5JQIjs = require('./chunk-YGNB5JQI.js');var _commonsdkbase = require('@crossmint/common-sdk-base');function a(i,t){return new (0, _commonsdkbase.CrossmintApiClient)(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:_chunkYGNB5JQIjs.a.version},apiKeyExpectations:t}})}exports.a = a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSWS4LNSVjs = require('./chunk-SWS4LNSV.js');var _commonsdkbase = require('@crossmint/common-sdk-base');function a(i,t){return new (0, _commonsdkbase.CrossmintApiClient)(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:_chunkSWS4LNSVjs.a.version},apiKeyExpectations:t}})}exports.a = a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRXPKMBUYjs = require('./chunk-RXPKMBUY.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkRXPKMBUYjs.a,_chunkJ42HASCIjs.a.call(void 0, {},d))}exports.a = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk54N76NB5js = require('./chunk-54N76NB5.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunk54N76NB5js.a,_chunkJ42HASCIjs.a.call(void 0, {},d))}exports.a = s;
@@ -1 +1 @@
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 _chunkYGNB5JQIjs = require('./chunk-YGNB5JQI.js');var _commonsdkbase = require('@crossmint/common-sdk-base');var _reactnative = require('react-native');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _expodevice = require('expo-device'); var e = _interopRequireWildcard(_expodevice);function P(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=_commonsdkbase.validateAPIKey.call(void 0, n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new (0, _commonsdkbase.SdkLogger)({packageName:_chunkYGNB5JQIjs.a.name,packageVersion:_chunkYGNB5JQIjs.a.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=_expoconstants2.default.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=_expoconstants2.default.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new (0, _commonsdkbase.ReactNativeDatadogSink)(d,N,o);return a.addSink(h),w(a),a}function w(n){_reactnative.AppState.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}exports.a = P;
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 _chunkSWS4LNSVjs = require('./chunk-SWS4LNSV.js');var _commonsdkbase = require('@crossmint/common-sdk-base');var _reactnative = require('react-native');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _expodevice = require('expo-device'); var e = _interopRequireWildcard(_expodevice);function P(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=_commonsdkbase.validateAPIKey.call(void 0, n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new (0, _commonsdkbase.SdkLogger)({packageName:_chunkSWS4LNSVjs.a.name,packageVersion:_chunkSWS4LNSVjs.a.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=_expoconstants2.default.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=_expoconstants2.default.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new (0, _commonsdkbase.ReactNativeDatadogSink)(d,N,o);return a.addSink(h),w(a),a}function w(n){_reactnative.AppState.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}exports.a = P;
@@ -1 +1 @@
1
- import{a as r}from"./chunk-OZY7BVZK.mjs";import{SdkLogger as C,ReactNativeDatadogSink as R,validateAPIKey as S}from"@crossmint/common-sdk-base";import{AppState as b}from"react-native";import D from"expo-constants";import*as e from"expo-device";function _(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=S(n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new C({packageName:r.name,packageVersion:r.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=D.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=D.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new R(d,N,o);return a.addSink(h),w(a),a}function w(n){b.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}export{_ as a};
1
+ import{a as r}from"./chunk-NAWX5EA2.mjs";import{SdkLogger as C,ReactNativeDatadogSink as R,validateAPIKey as S}from"@crossmint/common-sdk-base";import{AppState as b}from"react-native";import D from"expo-constants";import*as e from"expo-device";function _(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=S(n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new C({packageName:r.name,packageVersion:r.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=D.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=D.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new R(d,N,o);return a.addSink(h),w(a),a}function w(n){b.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}export{_ as a};
@@ -0,0 +1 @@
1
+ import{a as L}from"./chunk-U6RLI4GK.mjs";import{a as D}from"./chunk-XNDIT72O.mjs";import{a as S}from"./chunk-3QSVHCEH.mjs";import{a as p,e as g}from"./chunk-PSSAAY7D.mjs";import{useCallback as W,useRef as w,useMemo as I,useEffect as K,useState as B}from"react";import{Platform as J,View as $}from"react-native";import{RNWebView as q,WebViewParent as Q}from"@crossmint/client-sdk-rn-window";import{environmentUrlConfig as T,signerInboundEvents as X,signerOutboundEvents as Y,SignerErrorCode as Z}from"@crossmint/client-signers";import{validateAPIKey as ee}from"@crossmint/common-sdk-base";import{CrossmintWalletBaseProvider as ne,useCrossmint as re}from"@crossmint/client-sdk-react-base";import{useLogger as te}from"@crossmint/client-sdk-react-base";import{Fragment as oe,jsx as h,jsxs as U}from"react/jsx-runtime";function ae({children:C,createOnLogin:A,appearance:G,headlessSigningFlow:V=!0,callbacks:N}){let{crossmint:z}=re("CrossmintWalletProvider must be used within CrossmintProvider"),n=te(L),{apiKey:R,appId:k}=z,P=I(()=>{let e=ee(R);if(!e.isValid)throw new Error("Invalid API key");return e},[R]),H=I(()=>T[P.environment],[P.environment]),f=w(null),t=w(null),[O,x]=B(!1),v=w(!1),s=w(!1),i=w(0),y=w(0),_=I(()=>k!=null?{crossmintAppId:k}:{},[k]),l=W(e=>g(this,null,function*(){if(t.current!=null){let r=t.current;if(s.current){n.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e,generation:i.current});return}if(v.current&&r.isConnected){n.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e,generation:i.current});return}s.current=!0;let a=Date.now();y.current=a;let o=i.current;try{n.info("react-native.wallet.webview.handshake.start",{trigger:e,generation:o,platform:J.OS}),v.current=!0,r.isConnected=!1,yield r.handshakeWithChild();let c=Date.now()-a;n.info("react-native.wallet.webview.handshake.success",{trigger:e,generation:o,durationMs:c})}catch(c){let d=Date.now()-a;o===i.current&&(v.current=!1),n.error("react-native.wallet.webview.handshake.error",{trigger:e,generation:o,durationMs:d,error:c instanceof Error?c.message:String(c)}),console.error("[CrossmintWalletProvider] Handshake error:",c)}finally{o===i.current&&(s.current=!1)}}else n.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[n]);K(()=>{f.current!=null&&t.current==null&&(n.info("react-native.wallet.webview.initializing"),t.current=new Q(f,{incomingEvents:Y,outgoingEvents:X,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[Z.IndexedDbFatal]}}),n.info("react-native.wallet.webview.initialized"),l("eager"))},[O,n,l]);let F=W(()=>g(this,null,function*(){var e,r;n.info("react-native.wallet.webview.onLoadEnd",{handshakeInProgress:s.current,isConnected:(r=(e=t.current)==null?void 0:e.isConnected)!=null?r:!1,generation:i.current}),yield l("onLoadEnd")}),[n,l]),j=W(e=>{var o,c;let r=t.current;if(r==null)return;let a=e.nativeEvent.data;if(a==="frame-ready"){n.info("react-native.wallet.webview.frame-ready.received",{handshakeInProgress:s.current,isConnected:(c=(o=t.current)==null?void 0:o.isConnected)!=null?c:!1,generation:i.current,msSinceHandshakeStart:y.current>0?Date.now()-y.current:null}),l("frame-ready");return}try{let d=JSON.parse(a);if(d&&typeof d.type=="string"&&d.type.startsWith("console.")){let E=d.type.split(".")[1],M=(d.data||[]).map(u=>{try{return u==="[Function]"||u==="[Circular Reference]"||u==="[Unserializable Object]"?u:JSON.parse(u)}catch(le){return u}}),m=`react-native.wallet.webview.console.${E}`,b={webview_args:M};switch(E){case"log":n.info(m,b);break;case"error":n.error(m,b);break;case"warn":n.warn(m,b);break;case"info":n.info(m,b);break;case"debug":n.debug(m,b);break;default:n.info("react-native.wallet.webview.console.unknown",{webview_method:E,webview_args:M})}return}}catch(d){}r.handleMessage(e)},[n,l]);return U(ne,{createOnLogin:A,appearance:G,headlessSigningFlow:V,initializeWebView:()=>g(this,null,function*(){n.info("react-native.wallet.webview.init.start"),x(!0);let e=0,r=100;for(;t.current==null&&e<r;)yield new Promise(a=>setTimeout(a,50)),e++;if(t.current==null)throw n.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");n.info("react-native.wallet.webview.init.success",{attempts:e})}),callbacks:N,renderUI:V?void 0:({emailSignerProps:e,phoneSignerProps:r})=>U(oe,{children:[h(D,p({},e)),h(S,p({},r))]}),clientTEEConnection:()=>{if(t.current==null)throw new Error("WebView not ready or handshake incomplete");return t.current},children:[C,O&&h($,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:h(q,{ref:f,source:{uri:H},globals:_,onLoadEnd:F,onMessage:j,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var r,a,o;let e=i.current;i.current++,n.warn("react-native.wallet.webview.process.terminated",{prevGeneration:e,newGeneration:i.current,wasConnected:(a=(r=t.current)==null?void 0:r.isConnected)!=null?a:!1,hadHandshakeInProgress:s.current}),v.current=!1,s.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=f.current)==null||o.reload(),l("eager")},onRenderProcessGone:()=>{var r,a,o;let e=i.current;i.current++,n.warn("react-native.wallet.webview.process.renderGone",{prevGeneration:e,newGeneration:i.current,wasConnected:(a=(r=t.current)==null?void 0:r.isConnected)!=null?a:!1,hadHandshakeInProgress:s.current}),v.current=!1,s.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=f.current)==null||o.reload(),l("eager")},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[T[P.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function Pe(C){return h(ae,p({},C))}export{Pe as a};
@@ -1 +1 @@
1
- var c={name:"@crossmint/client-sdk-react-native-ui",version:"0.13.23",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0","lucide-react-native":"0.548.0",mitt:"3.0.1","react-native-svg":"15.14.0",zod:"3.22.4"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"}};export{c as a};
1
+ var c={name:"@crossmint/client-sdk-react-native-ui",version:"0.13.25",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0","lucide-react-native":"0.548.0",mitt:"3.0.1","react-native-svg":"15.14.0",zod:"3.22.4"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"}};export{c as a};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-ASMT7O6R.mjs";import{a as e}from"./chunk-PSSAAY7D.mjs";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
1
+ import{a as o}from"./chunk-PQB7WIHM.mjs";import{a as e}from"./chunk-PSSAAY7D.mjs";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
@@ -1 +1 @@
1
- import{c as h}from"./chunk-PCJMDUSI.mjs";import{a as y}from"./chunk-FX23A4BR.mjs";import{a as f}from"./chunk-SLOU5KYU.mjs";import{a as p}from"./chunk-FFQ6EQCL.mjs";import{a as d,b as m}from"./chunk-PSSAAY7D.mjs";import{useCrossmint as S}from"@crossmint/client-sdk-react-base";import{useEffect as b,useRef as l,useState as g}from"react";import{View as W}from"react-native";import{crossmintEmbeddedCheckoutV3Service as I}from"@crossmint/client-sdk-base";import{RNWebView as A,WebViewParent as M}from"@crossmint/client-sdk-rn-window";import{embeddedCheckoutV3IncomingEvents as R,embeddedCheckoutV3OutgoingEvents as O}from"@crossmint/client-sdk-base";import{jsx as c,jsxs as L}from"react/jsx-runtime";function Y(t){var u;let[e,w]=g(null),[C,v]=g(0),E=l((u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=l(t);if(U(t,n.current)){let r=d({},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=S(),V=f(i,{usageOrigin:"client"}),P=I({apiClient:V}),s=l(null);b(()=>{let r=s.current;if(!r||e)return;let o=new M({current:r},{incomingEvents:R,outgoingEvents:O});w(o)},[s.current,e]),b(()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{p.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return L(W,{style:{flex:1},children:[c(A,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:h,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?c(y,{payer:n.current.payment.crypto.payer,webViewClient:e}):c(H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:m(d({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}export{Y as a};
1
+ import{c as h}from"./chunk-PCJMDUSI.mjs";import{a as y}from"./chunk-FX23A4BR.mjs";import{a as f}from"./chunk-2P3TENLG.mjs";import{a as p}from"./chunk-FFQ6EQCL.mjs";import{a as d,b as m}from"./chunk-PSSAAY7D.mjs";import{useCrossmint as S}from"@crossmint/client-sdk-react-base";import{useEffect as b,useRef as l,useState as g}from"react";import{View as W}from"react-native";import{crossmintEmbeddedCheckoutV3Service as I}from"@crossmint/client-sdk-base";import{RNWebView as A,WebViewParent as M}from"@crossmint/client-sdk-rn-window";import{embeddedCheckoutV3IncomingEvents as R,embeddedCheckoutV3OutgoingEvents as O}from"@crossmint/client-sdk-base";import{jsx as c,jsxs as L}from"react/jsx-runtime";function Y(t){var u;let[e,w]=g(null),[C,v]=g(0),E=l((u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=l(t);if(U(t,n.current)){let r=d({},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=S(),V=f(i,{usageOrigin:"client"}),P=I({apiClient:V}),s=l(null);b(()=>{let r=s.current;if(!r||e)return;let o=new M({current:r},{incomingEvents:R,outgoingEvents:O});w(o)},[s.current,e]),b(()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{p.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return L(W,{style:{flex:1},children:[c(A,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:h,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?c(y,{payer:n.current.payment.crypto.payer,webViewClient:e}):c(H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:m(d({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}export{Y as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var c={name:"@crossmint/client-sdk-react-native-ui",version:"0.13.23",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0","lucide-react-native":"0.548.0",mitt:"3.0.1","react-native-svg":"15.14.0",zod:"3.22.4"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"}};exports.a = c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var c={name:"@crossmint/client-sdk-react-native-ui",version:"0.13.25",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0","lucide-react-native":"0.548.0",mitt:"3.0.1","react-native-svg":"15.14.0",zod:"3.22.4"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"}};exports.a = c;
@@ -1 +1 @@
1
- import{a as m}from"./chunk-LV3HQN6T.mjs";import{useMemo as v}from"react";import d from"expo-constants";import{CrossmintProvider as f,createLoggerContext as P}from"@crossmint/client-sdk-react-base";import{jsx as p}from"react/jsx-runtime";var l=P();function N({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=v(()=>m(o,r),[o,r]),c=(n=(t=(e=d.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=d.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return p(l.Provider,{value:g,children:p(f,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}export{l as a,N as b};
1
+ import{a as m}from"./chunk-BJ4RVJCD.mjs";import{useMemo as v}from"react";import d from"expo-constants";import{CrossmintProvider as f,createLoggerContext as P}from"@crossmint/client-sdk-react-base";import{jsx as p}from"react/jsx-runtime";var l=P();function N({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=v(()=>m(o,r),[o,r]),c=(n=(t=(e=d.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=d.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return p(l.Provider,{value:g,children:p(f,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}export{l as a,N as b};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkXQFDVUIRjs = require('./chunk-XQFDVUIR.js');var _react = require('react');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');var l=_clientsdkreactbase.createLoggerContext.call(void 0, );function I({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=_react.useMemo.call(void 0, ()=>_chunkXQFDVUIRjs.a.call(void 0, o,r),[o,r]),c=(n=(t=(e=_expoconstants2.default.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=_expoconstants2.default.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return _jsxruntime.jsx.call(void 0, l.Provider,{value:g,children:_jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintProvider,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}exports.a = l; exports.b = I;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkBFSRTQYZjs = require('./chunk-BFSRTQYZ.js');var _react = require('react');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');var l=_clientsdkreactbase.createLoggerContext.call(void 0, );function I({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=_react.useMemo.call(void 0, ()=>_chunkBFSRTQYZjs.a.call(void 0, o,r),[o,r]),c=(n=(t=(e=_expoconstants2.default.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=_expoconstants2.default.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return _jsxruntime.jsx.call(void 0, l.Provider,{value:g,children:_jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintProvider,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}exports.a = l; exports.b = I;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUPIRXOVHjs = require('./chunk-UPIRXOVH.js');var _chunkYJORUMPBjs = require('./chunk-YJORUMPB.js');var _chunkMVVSGLQLjs = require('./chunk-MVVSGLQL.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _react = require('react');var _reactnative = require('react-native');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _clientsigners = require('@crossmint/client-signers');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');function ae({children:C,createOnLogin:A,appearance:G,headlessSigningFlow:V=!0,callbacks:N}){let{crossmint:z}=_clientsdkreactbase.useCrossmint.call(void 0, "CrossmintWalletProvider must be used within CrossmintProvider"),n=_clientsdkreactbase.useLogger.call(void 0, _chunkUPIRXOVHjs.a),{apiKey:R,appId:k}=z,P=_react.useMemo.call(void 0, ()=>{let e=_commonsdkbase.validateAPIKey.call(void 0, R);if(!e.isValid)throw new Error("Invalid API key");return e},[R]),H=_react.useMemo.call(void 0, ()=>_clientsigners.environmentUrlConfig[P.environment],[P.environment]),f=_react.useRef.call(void 0, null),t=_react.useRef.call(void 0, null),[O,x]=_react.useState.call(void 0, !1),v=_react.useRef.call(void 0, !1),s=_react.useRef.call(void 0, !1),i=_react.useRef.call(void 0, 0),y=_react.useRef.call(void 0, 0),_=_react.useMemo.call(void 0, ()=>k!=null?{crossmintAppId:k}:{},[k]),l=_react.useCallback.call(void 0, e=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){if(t.current!=null){let r=t.current;if(s.current){n.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e,generation:i.current});return}if(v.current&&r.isConnected){n.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e,generation:i.current});return}s.current=!0;let a=Date.now();y.current=a;let o=i.current;try{n.info("react-native.wallet.webview.handshake.start",{trigger:e,generation:o,platform:_reactnative.Platform.OS}),v.current=!0,r.isConnected=!1,yield r.handshakeWithChild();let c=Date.now()-a;n.info("react-native.wallet.webview.handshake.success",{trigger:e,generation:o,durationMs:c})}catch(c){let d=Date.now()-a;o===i.current&&(v.current=!1),n.error("react-native.wallet.webview.handshake.error",{trigger:e,generation:o,durationMs:d,error:c instanceof Error?c.message:String(c)}),console.error("[CrossmintWalletProvider] Handshake error:",c)}finally{o===i.current&&(s.current=!1)}}else n.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[n]);_react.useEffect.call(void 0, ()=>{f.current!=null&&t.current==null&&(n.info("react-native.wallet.webview.initializing"),t.current=new (0, _clientsdkrnwindow.WebViewParent)(f,{incomingEvents:_clientsigners.signerOutboundEvents,outgoingEvents:_clientsigners.signerInboundEvents,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[_clientsigners.SignerErrorCode.IndexedDbFatal]}}),n.info("react-native.wallet.webview.initialized"),l("eager"))},[O,n,l]);let F=_react.useCallback.call(void 0, ()=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){var e,r;n.info("react-native.wallet.webview.onLoadEnd",{handshakeInProgress:s.current,isConnected:(r=(e=t.current)==null?void 0:e.isConnected)!=null?r:!1,generation:i.current}),yield l("onLoadEnd")}),[n,l]),j=_react.useCallback.call(void 0, e=>{var o,c;let r=t.current;if(r==null)return;let a=e.nativeEvent.data;if(a==="frame-ready"){n.info("react-native.wallet.webview.frame-ready.received",{handshakeInProgress:s.current,isConnected:(c=(o=t.current)==null?void 0:o.isConnected)!=null?c:!1,generation:i.current,msSinceHandshakeStart:y.current>0?Date.now()-y.current:null}),l("frame-ready");return}try{let d=JSON.parse(a);if(d&&typeof d.type=="string"&&d.type.startsWith("console.")){let E=d.type.split(".")[1],M=(d.data||[]).map(u=>{try{return u==="[Function]"||u==="[Circular Reference]"||u==="[Unserializable Object]"?u:JSON.parse(u)}catch(le){return u}}),m=`react-native.wallet.webview.console.${E}`,b={webview_args:M};switch(E){case"log":n.info(m,b);break;case"error":n.error(m,b);break;case"warn":n.warn(m,b);break;case"info":n.info(m,b);break;case"debug":n.debug(m,b);break;default:n.info("react-native.wallet.webview.console.unknown",{webview_method:E,webview_args:M})}return}}catch(d){}r.handleMessage(e)},[n,l]);return _jsxruntime.jsxs.call(void 0, _clientsdkreactbase.CrossmintWalletBaseProvider,{createOnLogin:A,appearance:G,headlessSigningFlow:V,initializeWebView:()=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){n.info("react-native.wallet.webview.init.start"),x(!0);let e=0,r=100;for(;t.current==null&&e<r;)yield new Promise(a=>setTimeout(a,50)),e++;if(t.current==null)throw n.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");n.info("react-native.wallet.webview.init.success",{attempts:e})}),callbacks:N,renderUI:V?void 0:({emailSignerProps:e,phoneSignerProps:r})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkYJORUMPBjs.a,_chunkJ42HASCIjs.a.call(void 0, {},e)),_jsxruntime.jsx.call(void 0, _chunkMVVSGLQLjs.a,_chunkJ42HASCIjs.a.call(void 0, {},r))]}),clientTEEConnection:()=>{if(t.current==null)throw new Error("WebView not ready or handshake incomplete");return t.current},children:[C,O&&_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:f,source:{uri:H},globals:_,onLoadEnd:F,onMessage:j,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var r,a,o;let e=i.current;i.current++,n.warn("react-native.wallet.webview.process.terminated",{prevGeneration:e,newGeneration:i.current,wasConnected:(a=(r=t.current)==null?void 0:r.isConnected)!=null?a:!1,hadHandshakeInProgress:s.current}),v.current=!1,s.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=f.current)==null||o.reload(),l("eager")},onRenderProcessGone:()=>{var r,a,o;let e=i.current;i.current++,n.warn("react-native.wallet.webview.process.renderGone",{prevGeneration:e,newGeneration:i.current,wasConnected:(a=(r=t.current)==null?void 0:r.isConnected)!=null?a:!1,hadHandshakeInProgress:s.current}),v.current=!1,s.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=f.current)==null||o.reload(),l("eager")},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[_clientsigners.environmentUrlConfig[P.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function ke(C){return _jsxruntime.jsx.call(void 0, ae,_chunkJ42HASCIjs.a.call(void 0, {},C))}exports.a = ke;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-DKQZSNOO.js');require('../../chunk-72MMCJ2E.js');var _chunkIHIEOHHRjs = require('../../chunk-IHIEOHHR.js');require('../../chunk-RXPKMBUY.js');require('../../chunk-YQEWHOQ7.js');require('../../chunk-VACQTZRT.js');require('../../chunk-XKZ6DL3C.js');require('../../chunk-2D2RJCVX.js');require('../../chunk-YGNB5JQI.js');require('../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunkIHIEOHHRjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-DKQZSNOO.js');require('../../chunk-72MMCJ2E.js');var _chunk6VB24RAYjs = require('../../chunk-6VB24RAY.js');require('../../chunk-54N76NB5.js');require('../../chunk-YQEWHOQ7.js');require('../../chunk-VACQTZRT.js');require('../../chunk-6TDBUOQE.js');require('../../chunk-2D2RJCVX.js');require('../../chunk-SWS4LNSV.js');require('../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunk6VB24RAYjs.a;
@@ -1 +1 @@
1
- import"../../chunk-TIQGKXQA.mjs";import"../../chunk-MB7H3PBJ.mjs";import{a}from"../../chunk-4KGLVNAQ.mjs";import"../../chunk-ASMT7O6R.mjs";import"../../chunk-PCJMDUSI.mjs";import"../../chunk-FX23A4BR.mjs";import"../../chunk-SLOU5KYU.mjs";import"../../chunk-FFQ6EQCL.mjs";import"../../chunk-OZY7BVZK.mjs";import"../../chunk-PSSAAY7D.mjs";export{a as CrossmintEmbeddedCheckout};
1
+ import"../../chunk-TIQGKXQA.mjs";import"../../chunk-MB7H3PBJ.mjs";import{a}from"../../chunk-PQ2BJPQR.mjs";import"../../chunk-PQB7WIHM.mjs";import"../../chunk-PCJMDUSI.mjs";import"../../chunk-FX23A4BR.mjs";import"../../chunk-2P3TENLG.mjs";import"../../chunk-FFQ6EQCL.mjs";import"../../chunk-NAWX5EA2.mjs";import"../../chunk-PSSAAY7D.mjs";export{a as CrossmintEmbeddedCheckout};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIHIEOHHRjs = require('../../../chunk-IHIEOHHR.js');require('../../../chunk-RXPKMBUY.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-XKZ6DL3C.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-YGNB5JQI.js');require('../../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunkIHIEOHHRjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6VB24RAYjs = require('../../../chunk-6VB24RAY.js');require('../../../chunk-54N76NB5.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-6TDBUOQE.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-SWS4LNSV.js');require('../../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunk6VB24RAYjs.a;
@@ -1 +1 @@
1
- import{a}from"../../../chunk-4KGLVNAQ.mjs";import"../../../chunk-ASMT7O6R.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-FX23A4BR.mjs";import"../../../chunk-SLOU5KYU.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-OZY7BVZK.mjs";import"../../../chunk-PSSAAY7D.mjs";export{a as CrossmintEmbeddedCheckout};
1
+ import{a}from"../../../chunk-PQ2BJPQR.mjs";import"../../../chunk-PQB7WIHM.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-FX23A4BR.mjs";import"../../../chunk-2P3TENLG.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-NAWX5EA2.mjs";import"../../../chunk-PSSAAY7D.mjs";export{a as CrossmintEmbeddedCheckout};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRXPKMBUYjs = require('../../../chunk-RXPKMBUY.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-XKZ6DL3C.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-YGNB5JQI.js');require('../../../chunk-J42HASCI.js');exports.EmbeddedCheckoutV3WebView = _chunkRXPKMBUYjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk54N76NB5js = require('../../../chunk-54N76NB5.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-6TDBUOQE.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-SWS4LNSV.js');require('../../../chunk-J42HASCI.js');exports.EmbeddedCheckoutV3WebView = _chunk54N76NB5js.a;
@@ -1 +1 @@
1
- import{a}from"../../../chunk-ASMT7O6R.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-FX23A4BR.mjs";import"../../../chunk-SLOU5KYU.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-OZY7BVZK.mjs";import"../../../chunk-PSSAAY7D.mjs";export{a as EmbeddedCheckoutV3WebView};
1
+ import{a}from"../../../chunk-PQB7WIHM.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-FX23A4BR.mjs";import"../../../chunk-2P3TENLG.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-NAWX5EA2.mjs";import"../../../chunk-PSSAAY7D.mjs";export{a as EmbeddedCheckoutV3WebView};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../../chunk-72MMCJ2E.js');var _chunkIHIEOHHRjs = require('../../../chunk-IHIEOHHR.js');require('../../../chunk-RXPKMBUY.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-XKZ6DL3C.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-YGNB5JQI.js');require('../../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunkIHIEOHHRjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../../chunk-72MMCJ2E.js');var _chunk6VB24RAYjs = require('../../../chunk-6VB24RAY.js');require('../../../chunk-54N76NB5.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-6TDBUOQE.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-SWS4LNSV.js');require('../../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunk6VB24RAYjs.a;
@@ -1 +1 @@
1
- import"../../../chunk-MB7H3PBJ.mjs";import{a}from"../../../chunk-4KGLVNAQ.mjs";import"../../../chunk-ASMT7O6R.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-FX23A4BR.mjs";import"../../../chunk-SLOU5KYU.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-OZY7BVZK.mjs";import"../../../chunk-PSSAAY7D.mjs";export{a as CrossmintEmbeddedCheckout};
1
+ import"../../../chunk-MB7H3PBJ.mjs";import{a}from"../../../chunk-PQ2BJPQR.mjs";import"../../../chunk-PQB7WIHM.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-FX23A4BR.mjs";import"../../../chunk-2P3TENLG.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-NAWX5EA2.mjs";import"../../../chunk-PSSAAY7D.mjs";export{a as CrossmintEmbeddedCheckout};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-2PX34LDU.js');require('../chunk-AJMHVVST.js');var _chunkUA34B5QBjs = require('../chunk-UA34B5QB.js');require('../chunk-DKQZSNOO.js');require('../chunk-72MMCJ2E.js');var _chunkIHIEOHHRjs = require('../chunk-IHIEOHHR.js');require('../chunk-RXPKMBUY.js');require('../chunk-YQEWHOQ7.js');require('../chunk-VACQTZRT.js');require('../chunk-XKZ6DL3C.js');require('../chunk-I4D3YJW2.js');var _chunkYJORUMPBjs = require('../chunk-YJORUMPB.js');var _chunkMVVSGLQLjs = require('../chunk-MVVSGLQL.js');require('../chunk-F7VXWATP.js');require('../chunk-DC5HCBPK.js');require('../chunk-EI5LOD4Y.js');require('../chunk-2D2RJCVX.js');require('../chunk-YGNB5JQI.js');require('../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunkIHIEOHHRjs.a; exports.EmailSignersDialog = _chunkYJORUMPBjs.a; exports.ExportPrivateKeyButton = _chunkUA34B5QBjs.a; exports.PhoneSignersDialog = _chunkMVVSGLQLjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-2PX34LDU.js');require('../chunk-AJMHVVST.js');var _chunkUA34B5QBjs = require('../chunk-UA34B5QB.js');require('../chunk-DKQZSNOO.js');require('../chunk-72MMCJ2E.js');var _chunk6VB24RAYjs = require('../chunk-6VB24RAY.js');require('../chunk-54N76NB5.js');require('../chunk-YQEWHOQ7.js');require('../chunk-VACQTZRT.js');require('../chunk-6TDBUOQE.js');require('../chunk-I4D3YJW2.js');var _chunkYJORUMPBjs = require('../chunk-YJORUMPB.js');var _chunkMVVSGLQLjs = require('../chunk-MVVSGLQL.js');require('../chunk-F7VXWATP.js');require('../chunk-DC5HCBPK.js');require('../chunk-EI5LOD4Y.js');require('../chunk-2D2RJCVX.js');require('../chunk-SWS4LNSV.js');require('../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunk6VB24RAYjs.a; exports.EmailSignersDialog = _chunkYJORUMPBjs.a; exports.ExportPrivateKeyButton = _chunkUA34B5QBjs.a; exports.PhoneSignersDialog = _chunkMVVSGLQLjs.a;
@@ -1 +1 @@
1
- import"../chunk-UBHIBMTA.mjs";import"../chunk-5CLFJLE4.mjs";import{a as d}from"../chunk-EF2YTIUF.mjs";import"../chunk-TIQGKXQA.mjs";import"../chunk-MB7H3PBJ.mjs";import{a as c}from"../chunk-4KGLVNAQ.mjs";import"../chunk-ASMT7O6R.mjs";import"../chunk-PCJMDUSI.mjs";import"../chunk-FX23A4BR.mjs";import"../chunk-SLOU5KYU.mjs";import"../chunk-J7Q2R6UH.mjs";import{a}from"../chunk-XNDIT72O.mjs";import{a as b}from"../chunk-3QSVHCEH.mjs";import"../chunk-D5QADN6Z.mjs";import"../chunk-YLJDAK2S.mjs";import"../chunk-7USVT6EZ.mjs";import"../chunk-FFQ6EQCL.mjs";import"../chunk-OZY7BVZK.mjs";import"../chunk-PSSAAY7D.mjs";export{c as CrossmintEmbeddedCheckout,a as EmailSignersDialog,d as ExportPrivateKeyButton,b as PhoneSignersDialog};
1
+ import"../chunk-UBHIBMTA.mjs";import"../chunk-5CLFJLE4.mjs";import{a as d}from"../chunk-EF2YTIUF.mjs";import"../chunk-TIQGKXQA.mjs";import"../chunk-MB7H3PBJ.mjs";import{a as c}from"../chunk-PQ2BJPQR.mjs";import"../chunk-PQB7WIHM.mjs";import"../chunk-PCJMDUSI.mjs";import"../chunk-FX23A4BR.mjs";import"../chunk-2P3TENLG.mjs";import"../chunk-J7Q2R6UH.mjs";import{a}from"../chunk-XNDIT72O.mjs";import{a as b}from"../chunk-3QSVHCEH.mjs";import"../chunk-D5QADN6Z.mjs";import"../chunk-YLJDAK2S.mjs";import"../chunk-7USVT6EZ.mjs";import"../chunk-FFQ6EQCL.mjs";import"../chunk-NAWX5EA2.mjs";import"../chunk-PSSAAY7D.mjs";export{c as CrossmintEmbeddedCheckout,a as EmailSignersDialog,d as ExportPrivateKeyButton,b as PhoneSignersDialog};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-C62HRWJA.js');var _chunkPHRFWZONjs = require('./chunk-PHRFWZON.js');var _chunkFF6XNU67js = require('./chunk-FF6XNU67.js');require('./chunk-2PX34LDU.js');require('./chunk-AJMHVVST.js');var _chunkUA34B5QBjs = require('./chunk-UA34B5QB.js');require('./chunk-DKQZSNOO.js');require('./chunk-72MMCJ2E.js');var _chunkIHIEOHHRjs = require('./chunk-IHIEOHHR.js');require('./chunk-RXPKMBUY.js');require('./chunk-YQEWHOQ7.js');require('./chunk-VACQTZRT.js');require('./chunk-XKZ6DL3C.js');require('./chunk-I4D3YJW2.js');var _chunkYJORUMPBjs = require('./chunk-YJORUMPB.js');var _chunkMVVSGLQLjs = require('./chunk-MVVSGLQL.js');require('./chunk-F7VXWATP.js');require('./chunk-DC5HCBPK.js');require('./chunk-EI5LOD4Y.js');var _chunkEF5KYLDOjs = require('./chunk-EF5KYLDO.js');require('./chunk-SHTETN4C.js');var _chunk77GXCNDPjs = require('./chunk-77GXCNDP.js');require('./chunk-2D2RJCVX.js');var _chunkMKCQJOIOjs = require('./chunk-MKCQJOIO.js');require('./chunk-XQFDVUIR.js');require('./chunk-YGNB5JQI.js');require('./chunk-J42HASCI.js');var _walletssdk = require('@crossmint/wallets-sdk');exports.CrossmintAuthProvider = _chunkEF5KYLDOjs.b; exports.CrossmintCheckoutProvider = _chunk77GXCNDPjs.a; exports.CrossmintEmbeddedCheckout = _chunkIHIEOHHRjs.a; exports.CrossmintProvider = _chunkFF6XNU67js.b; exports.CrossmintWalletProvider = _chunkPHRFWZONjs.a; exports.EVMWallet = _walletssdk.EVMWallet; exports.EmailSignersDialog = _chunkYJORUMPBjs.a; exports.ExportPrivateKeyButton = _chunkUA34B5QBjs.a; exports.PhoneSignersDialog = _chunkMVVSGLQLjs.a; exports.SolanaWallet = _walletssdk.SolanaWallet; exports.StellarWallet = _walletssdk.StellarWallet; exports.Wallet = _walletssdk.Wallet; exports.useAuth = _chunkEF5KYLDOjs.d; exports.useCrossmint = _chunkEF5KYLDOjs.e; exports.useCrossmintAuth = _chunkEF5KYLDOjs.c; exports.useCrossmintCheckout = _chunk77GXCNDPjs.b; exports.useWallet = _chunkEF5KYLDOjs.f; exports.useWalletEmailSigner = _chunkMKCQJOIOjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-C62HRWJA.js');var _chunkX7RV3TA3js = require('./chunk-X7RV3TA3.js');var _chunkUPIRXOVHjs = require('./chunk-UPIRXOVH.js');require('./chunk-2PX34LDU.js');require('./chunk-AJMHVVST.js');var _chunkUA34B5QBjs = require('./chunk-UA34B5QB.js');require('./chunk-DKQZSNOO.js');require('./chunk-72MMCJ2E.js');var _chunk6VB24RAYjs = require('./chunk-6VB24RAY.js');require('./chunk-54N76NB5.js');require('./chunk-YQEWHOQ7.js');require('./chunk-VACQTZRT.js');require('./chunk-6TDBUOQE.js');require('./chunk-I4D3YJW2.js');var _chunkYJORUMPBjs = require('./chunk-YJORUMPB.js');var _chunkMVVSGLQLjs = require('./chunk-MVVSGLQL.js');require('./chunk-F7VXWATP.js');require('./chunk-DC5HCBPK.js');require('./chunk-EI5LOD4Y.js');var _chunkEF5KYLDOjs = require('./chunk-EF5KYLDO.js');require('./chunk-SHTETN4C.js');var _chunk77GXCNDPjs = require('./chunk-77GXCNDP.js');require('./chunk-2D2RJCVX.js');var _chunkMKCQJOIOjs = require('./chunk-MKCQJOIO.js');require('./chunk-BFSRTQYZ.js');require('./chunk-SWS4LNSV.js');require('./chunk-J42HASCI.js');var _walletssdk = require('@crossmint/wallets-sdk');exports.CrossmintAuthProvider = _chunkEF5KYLDOjs.b; exports.CrossmintCheckoutProvider = _chunk77GXCNDPjs.a; exports.CrossmintEmbeddedCheckout = _chunk6VB24RAYjs.a; exports.CrossmintProvider = _chunkUPIRXOVHjs.b; exports.CrossmintWalletProvider = _chunkX7RV3TA3js.a; exports.EVMWallet = _walletssdk.EVMWallet; exports.EmailSignersDialog = _chunkYJORUMPBjs.a; exports.ExportPrivateKeyButton = _chunkUA34B5QBjs.a; exports.PhoneSignersDialog = _chunkMVVSGLQLjs.a; exports.SolanaWallet = _walletssdk.SolanaWallet; exports.StellarWallet = _walletssdk.StellarWallet; exports.Wallet = _walletssdk.Wallet; exports.useAuth = _chunkEF5KYLDOjs.d; exports.useCrossmint = _chunkEF5KYLDOjs.e; exports.useCrossmintAuth = _chunkEF5KYLDOjs.c; exports.useCrossmintCheckout = _chunk77GXCNDPjs.b; exports.useWallet = _chunkEF5KYLDOjs.f; exports.useWalletEmailSigner = _chunkMKCQJOIOjs.a;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import"./chunk-I3QSTPTV.mjs";import{a as y}from"./chunk-Q3PECLWS.mjs";import{b as s}from"./chunk-PRBG566A.mjs";import"./chunk-UBHIBMTA.mjs";import"./chunk-5CLFJLE4.mjs";import{a as x}from"./chunk-EF2YTIUF.mjs";import"./chunk-TIQGKXQA.mjs";import"./chunk-MB7H3PBJ.mjs";import{a as c}from"./chunk-4KGLVNAQ.mjs";import"./chunk-ASMT7O6R.mjs";import"./chunk-PCJMDUSI.mjs";import"./chunk-FX23A4BR.mjs";import"./chunk-SLOU5KYU.mjs";import"./chunk-J7Q2R6UH.mjs";import{a as i}from"./chunk-XNDIT72O.mjs";import{a as m}from"./chunk-3QSVHCEH.mjs";import"./chunk-D5QADN6Z.mjs";import"./chunk-YLJDAK2S.mjs";import"./chunk-7USVT6EZ.mjs";import{b as o,c as a,d as n,e as l,f as p}from"./chunk-LK3AO6AY.mjs";import"./chunk-ZCKUSOGC.mjs";import{a as e,b as r}from"./chunk-IUDQDPIN.mjs";import"./chunk-FFQ6EQCL.mjs";import{a as t}from"./chunk-J477SX6P.mjs";import"./chunk-LV3HQN6T.mjs";import"./chunk-OZY7BVZK.mjs";import"./chunk-PSSAAY7D.mjs";import{EVMWallet as u,SolanaWallet as C,StellarWallet as k,Wallet as A}from"@crossmint/wallets-sdk";export{o as CrossmintAuthProvider,e as CrossmintCheckoutProvider,c as CrossmintEmbeddedCheckout,s as CrossmintProvider,y as CrossmintWalletProvider,u as EVMWallet,i as EmailSignersDialog,x as ExportPrivateKeyButton,m as PhoneSignersDialog,C as SolanaWallet,k as StellarWallet,A as Wallet,n as useAuth,l as useCrossmint,a as useCrossmintAuth,r as useCrossmintCheckout,p as useWallet,t as useWalletEmailSigner};
1
+ import"./chunk-I3QSTPTV.mjs";import{a as y}from"./chunk-KJVQ4KFY.mjs";import{b as s}from"./chunk-U6RLI4GK.mjs";import"./chunk-UBHIBMTA.mjs";import"./chunk-5CLFJLE4.mjs";import{a as x}from"./chunk-EF2YTIUF.mjs";import"./chunk-TIQGKXQA.mjs";import"./chunk-MB7H3PBJ.mjs";import{a as c}from"./chunk-PQ2BJPQR.mjs";import"./chunk-PQB7WIHM.mjs";import"./chunk-PCJMDUSI.mjs";import"./chunk-FX23A4BR.mjs";import"./chunk-2P3TENLG.mjs";import"./chunk-J7Q2R6UH.mjs";import{a as i}from"./chunk-XNDIT72O.mjs";import{a as m}from"./chunk-3QSVHCEH.mjs";import"./chunk-D5QADN6Z.mjs";import"./chunk-YLJDAK2S.mjs";import"./chunk-7USVT6EZ.mjs";import{b as o,c as a,d as n,e as l,f as p}from"./chunk-LK3AO6AY.mjs";import"./chunk-ZCKUSOGC.mjs";import{a as e,b as r}from"./chunk-IUDQDPIN.mjs";import"./chunk-FFQ6EQCL.mjs";import{a as t}from"./chunk-J477SX6P.mjs";import"./chunk-BJ4RVJCD.mjs";import"./chunk-NAWX5EA2.mjs";import"./chunk-PSSAAY7D.mjs";import{EVMWallet as u,SolanaWallet as C,StellarWallet as k,Wallet as A}from"@crossmint/wallets-sdk";export{o as CrossmintAuthProvider,e as CrossmintCheckoutProvider,c as CrossmintEmbeddedCheckout,s as CrossmintProvider,y as CrossmintWalletProvider,u as EVMWallet,i as EmailSignersDialog,x as ExportPrivateKeyButton,m as PhoneSignersDialog,C as SolanaWallet,k as StellarWallet,A as Wallet,n as useAuth,l as useCrossmint,a as useCrossmintAuth,r as useCrossmintCheckout,p as useWallet,t as useWalletEmailSigner};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXQFDVUIRjs = require('../chunk-XQFDVUIR.js');require('../chunk-YGNB5JQI.js');require('../chunk-J42HASCI.js');exports.initReactNativeLogger = _chunkXQFDVUIRjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBFSRTQYZjs = require('../chunk-BFSRTQYZ.js');require('../chunk-SWS4LNSV.js');require('../chunk-J42HASCI.js');exports.initReactNativeLogger = _chunkBFSRTQYZjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-LV3HQN6T.mjs";import"../chunk-OZY7BVZK.mjs";import"../chunk-PSSAAY7D.mjs";export{a as initReactNativeLogger};
1
+ import{a}from"../chunk-BJ4RVJCD.mjs";import"../chunk-NAWX5EA2.mjs";import"../chunk-PSSAAY7D.mjs";export{a as initReactNativeLogger};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFF6XNU67js = require('../chunk-FF6XNU67.js');require('../chunk-XQFDVUIR.js');require('../chunk-YGNB5JQI.js');require('../chunk-J42HASCI.js');exports.CrossmintProvider = _chunkFF6XNU67js.b; exports.LoggerContext = _chunkFF6XNU67js.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUPIRXOVHjs = require('../chunk-UPIRXOVH.js');require('../chunk-BFSRTQYZ.js');require('../chunk-SWS4LNSV.js');require('../chunk-J42HASCI.js');exports.CrossmintProvider = _chunkUPIRXOVHjs.b; exports.LoggerContext = _chunkUPIRXOVHjs.a;
@@ -1 +1 @@
1
- import{a,b}from"../chunk-PRBG566A.mjs";import"../chunk-LV3HQN6T.mjs";import"../chunk-OZY7BVZK.mjs";import"../chunk-PSSAAY7D.mjs";export{b as CrossmintProvider,a as LoggerContext};
1
+ import{a,b}from"../chunk-U6RLI4GK.mjs";import"../chunk-BJ4RVJCD.mjs";import"../chunk-NAWX5EA2.mjs";import"../chunk-PSSAAY7D.mjs";export{b as CrossmintProvider,a as LoggerContext};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPHRFWZONjs = require('../chunk-PHRFWZON.js');require('../chunk-FF6XNU67.js');require('../chunk-YJORUMPB.js');require('../chunk-MVVSGLQL.js');require('../chunk-F7VXWATP.js');require('../chunk-DC5HCBPK.js');require('../chunk-EI5LOD4Y.js');require('../chunk-XQFDVUIR.js');require('../chunk-YGNB5JQI.js');require('../chunk-J42HASCI.js');exports.CrossmintWalletProvider = _chunkPHRFWZONjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkX7RV3TA3js = require('../chunk-X7RV3TA3.js');require('../chunk-UPIRXOVH.js');require('../chunk-YJORUMPB.js');require('../chunk-MVVSGLQL.js');require('../chunk-F7VXWATP.js');require('../chunk-DC5HCBPK.js');require('../chunk-EI5LOD4Y.js');require('../chunk-BFSRTQYZ.js');require('../chunk-SWS4LNSV.js');require('../chunk-J42HASCI.js');exports.CrossmintWalletProvider = _chunkX7RV3TA3js.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-Q3PECLWS.mjs";import"../chunk-PRBG566A.mjs";import"../chunk-XNDIT72O.mjs";import"../chunk-3QSVHCEH.mjs";import"../chunk-D5QADN6Z.mjs";import"../chunk-YLJDAK2S.mjs";import"../chunk-7USVT6EZ.mjs";import"../chunk-LV3HQN6T.mjs";import"../chunk-OZY7BVZK.mjs";import"../chunk-PSSAAY7D.mjs";export{a as CrossmintWalletProvider};
1
+ import{a}from"../chunk-KJVQ4KFY.mjs";import"../chunk-U6RLI4GK.mjs";import"../chunk-XNDIT72O.mjs";import"../chunk-3QSVHCEH.mjs";import"../chunk-D5QADN6Z.mjs";import"../chunk-YLJDAK2S.mjs";import"../chunk-7USVT6EZ.mjs";import"../chunk-BJ4RVJCD.mjs";import"../chunk-NAWX5EA2.mjs";import"../chunk-PSSAAY7D.mjs";export{a as CrossmintWalletProvider};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-C62HRWJA.js');var _chunkPHRFWZONjs = require('../chunk-PHRFWZON.js');var _chunkFF6XNU67js = require('../chunk-FF6XNU67.js');require('../chunk-YJORUMPB.js');require('../chunk-MVVSGLQL.js');require('../chunk-F7VXWATP.js');require('../chunk-DC5HCBPK.js');require('../chunk-EI5LOD4Y.js');var _chunkEF5KYLDOjs = require('../chunk-EF5KYLDO.js');require('../chunk-SHTETN4C.js');require('../chunk-77GXCNDP.js');require('../chunk-2D2RJCVX.js');require('../chunk-MKCQJOIO.js');require('../chunk-XQFDVUIR.js');require('../chunk-YGNB5JQI.js');require('../chunk-J42HASCI.js');exports.CrossmintAuthProvider = _chunkEF5KYLDOjs.b; exports.CrossmintProvider = _chunkFF6XNU67js.b; exports.CrossmintWalletProvider = _chunkPHRFWZONjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-C62HRWJA.js');var _chunkX7RV3TA3js = require('../chunk-X7RV3TA3.js');var _chunkUPIRXOVHjs = require('../chunk-UPIRXOVH.js');require('../chunk-YJORUMPB.js');require('../chunk-MVVSGLQL.js');require('../chunk-F7VXWATP.js');require('../chunk-DC5HCBPK.js');require('../chunk-EI5LOD4Y.js');var _chunkEF5KYLDOjs = require('../chunk-EF5KYLDO.js');require('../chunk-SHTETN4C.js');require('../chunk-77GXCNDP.js');require('../chunk-2D2RJCVX.js');require('../chunk-MKCQJOIO.js');require('../chunk-BFSRTQYZ.js');require('../chunk-SWS4LNSV.js');require('../chunk-J42HASCI.js');exports.CrossmintAuthProvider = _chunkEF5KYLDOjs.b; exports.CrossmintProvider = _chunkUPIRXOVHjs.b; exports.CrossmintWalletProvider = _chunkX7RV3TA3js.a;
@@ -1 +1 @@
1
- import"../chunk-I3QSTPTV.mjs";import{a as c}from"../chunk-Q3PECLWS.mjs";import{b}from"../chunk-PRBG566A.mjs";import"../chunk-XNDIT72O.mjs";import"../chunk-3QSVHCEH.mjs";import"../chunk-D5QADN6Z.mjs";import"../chunk-YLJDAK2S.mjs";import"../chunk-7USVT6EZ.mjs";import{b as a}from"../chunk-LK3AO6AY.mjs";import"../chunk-ZCKUSOGC.mjs";import"../chunk-IUDQDPIN.mjs";import"../chunk-FFQ6EQCL.mjs";import"../chunk-J477SX6P.mjs";import"../chunk-LV3HQN6T.mjs";import"../chunk-OZY7BVZK.mjs";import"../chunk-PSSAAY7D.mjs";export{a as CrossmintAuthProvider,b as CrossmintProvider,c as CrossmintWalletProvider};
1
+ import"../chunk-I3QSTPTV.mjs";import{a as c}from"../chunk-KJVQ4KFY.mjs";import{b}from"../chunk-U6RLI4GK.mjs";import"../chunk-XNDIT72O.mjs";import"../chunk-3QSVHCEH.mjs";import"../chunk-D5QADN6Z.mjs";import"../chunk-YLJDAK2S.mjs";import"../chunk-7USVT6EZ.mjs";import{b as a}from"../chunk-LK3AO6AY.mjs";import"../chunk-ZCKUSOGC.mjs";import"../chunk-IUDQDPIN.mjs";import"../chunk-FFQ6EQCL.mjs";import"../chunk-J477SX6P.mjs";import"../chunk-BJ4RVJCD.mjs";import"../chunk-NAWX5EA2.mjs";import"../chunk-PSSAAY7D.mjs";export{a as CrossmintAuthProvider,b as CrossmintProvider,c as CrossmintWalletProvider};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXKZ6DL3Cjs = require('../chunk-XKZ6DL3C.js');require('../chunk-YGNB5JQI.js');require('../chunk-J42HASCI.js');exports.createCrossmintApiClient = _chunkXKZ6DL3Cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6TDBUOQEjs = require('../chunk-6TDBUOQE.js');require('../chunk-SWS4LNSV.js');require('../chunk-J42HASCI.js');exports.createCrossmintApiClient = _chunk6TDBUOQEjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-SLOU5KYU.mjs";import"../chunk-OZY7BVZK.mjs";import"../chunk-PSSAAY7D.mjs";export{a as createCrossmintApiClient};
1
+ import{a}from"../chunk-2P3TENLG.mjs";import"../chunk-NAWX5EA2.mjs";import"../chunk-PSSAAY7D.mjs";export{a as createCrossmintApiClient};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/client-sdk-react-native-ui",
3
- "version": "0.13.23",
3
+ "version": "0.13.25",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -22,14 +22,14 @@
22
22
  "mitt": "3.0.1",
23
23
  "react-native-svg": "15.14.0",
24
24
  "zod": "3.22.4",
25
- "@crossmint/client-sdk-auth": "1.2.50",
26
25
  "@crossmint/client-sdk-base": "2.0.2",
27
- "@crossmint/client-sdk-react-base": "1.0.5",
26
+ "@crossmint/client-sdk-react-base": "1.0.6",
28
27
  "@crossmint/client-sdk-rn-window": "0.3.15",
29
28
  "@crossmint/client-signers": "0.1.2",
30
29
  "@crossmint/common-sdk-auth": "1.0.72",
31
30
  "@crossmint/common-sdk-base": "0.9.20",
32
- "@crossmint/wallets-sdk": "0.20.2"
31
+ "@crossmint/wallets-sdk": "0.20.2",
32
+ "@crossmint/client-sdk-auth": "1.2.50"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@expo/config-plugins": "^9.0.17",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFF6XNU67js = require('./chunk-FF6XNU67.js');var _chunkYJORUMPBjs = require('./chunk-YJORUMPB.js');var _chunkMVVSGLQLjs = require('./chunk-MVVSGLQL.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _react = require('react');var _reactnative = require('react-native');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _clientsigners = require('@crossmint/client-signers');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');function ee({children:h,createOnLogin:T,appearance:A,headlessSigningFlow:P=!0,callbacks:D}){let{crossmint:N}=_clientsdkreactbase.useCrossmint.call(void 0, "CrossmintWalletProvider must be used within CrossmintProvider"),n=_clientsdkreactbase.useLogger.call(void 0, _chunkFF6XNU67js.a),{apiKey:k,appId:g}=N,C=_react.useMemo.call(void 0, ()=>{let e=_commonsdkbase.validateAPIKey.call(void 0, k);if(!e.isValid)throw new Error("Invalid API key");return e},[k]),z=_react.useMemo.call(void 0, ()=>_clientsigners.environmentUrlConfig[C.environment],[C.environment]),s=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, null),[V,S]=_react.useState.call(void 0, !1),l=_react.useRef.call(void 0, !1),c=_react.useRef.call(void 0, !1),d=_react.useRef.call(void 0, 0),x=_react.useMemo.call(void 0, ()=>g!=null?{crossmintAppId:g}:{},[g]);_react.useEffect.call(void 0, ()=>{s.current!=null&&r.current==null&&(n.info("react-native.wallet.webview.initializing"),r.current=new (0, _clientsdkrnwindow.WebViewParent)(s,{incomingEvents:_clientsigners.signerOutboundEvents,outgoingEvents:_clientsigners.signerInboundEvents,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[_clientsigners.SignerErrorCode.IndexedDbFatal]}}),n.info("react-native.wallet.webview.initialized"))},[V,n]);let b=_react.useCallback.call(void 0, e=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){if(r.current!=null){let a=r.current;if(c.current){n.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e});return}if(l.current&&a.isConnected){n.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e});return}c.current=!0;let i=d.current;try{n.info("react-native.wallet.webview.handshake.start",{trigger:e}),l.current=!0,a.isConnected=!1,yield a.handshakeWithChild(),n.info("react-native.wallet.webview.handshake.success",{trigger:e})}catch(t){i===d.current&&(l.current=!1),n.error("react-native.wallet.webview.handshake.error",{trigger:e,error:t instanceof Error?t.message:String(t)}),console.error("[CrossmintWalletProvider] Handshake error:",t)}finally{i===d.current&&(c.current=!1)}}else n.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[n]),_=_react.useCallback.call(void 0, ()=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){n.info("react-native.wallet.webview.onLoadEnd"),yield b("onLoadEnd")}),[n,b]),F=_react.useCallback.call(void 0, e=>{let a=r.current;if(a==null)return;let i=e.nativeEvent.data;if(i==="frame-ready"){n.info("react-native.wallet.webview.frame-ready.received"),b("frame-ready");return}try{let t=JSON.parse(i);if(t&&typeof t.type=="string"&&t.type.startsWith("console.")){let y=t.type.split(".")[1],I=(t.data||[]).map(o=>{try{return o==="[Function]"||o==="[Circular Reference]"||o==="[Unserializable Object]"?o:JSON.parse(o)}catch(ie){return o}}),w=`react-native.wallet.webview.console.${y}`,u={webview_args:I};switch(y){case"log":n.info(w,u);break;case"error":n.error(w,u);break;case"warn":n.warn(w,u);break;case"info":n.info(w,u);break;case"debug":n.debug(w,u);break;default:n.info("react-native.wallet.webview.console.unknown",{webview_method:y,webview_args:I})}return}}catch(t){}a.handleMessage(e)},[n,b]);return _jsxruntime.jsxs.call(void 0, _clientsdkreactbase.CrossmintWalletBaseProvider,{createOnLogin:T,appearance:A,headlessSigningFlow:P,initializeWebView:()=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){n.info("react-native.wallet.webview.init.start"),S(!0);let e=0,a=100;for(;r.current==null&&e<a;)yield new Promise(i=>setTimeout(i,50)),e++;if(r.current==null)throw n.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");n.info("react-native.wallet.webview.init.success",{attempts:e})}),callbacks:D,renderUI:P?void 0:({emailSignerProps:e,phoneSignerProps:a})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkYJORUMPBjs.a,_chunkJ42HASCIjs.a.call(void 0, {},e)),_jsxruntime.jsx.call(void 0, _chunkMVVSGLQLjs.a,_chunkJ42HASCIjs.a.call(void 0, {},a))]}),clientTEEConnection:()=>{if(r.current==null)throw new Error("WebView not ready or handshake incomplete");return r.current},children:[h,V&&_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:s,source:{uri:z},globals:x,onLoadEnd:_,onMessage:F,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var e;n.warn("react-native.wallet.webview.process.terminated"),d.current++,l.current=!1,c.current=!1,r.current!=null&&(r.current.isConnected=!1),(e=s.current)==null||e.reload()},onRenderProcessGone:()=>{var e;n.warn("react-native.wallet.webview.process.renderGone"),d.current++,l.current=!1,c.current=!1,r.current!=null&&(r.current.isConnected=!1),(e=s.current)==null||e.reload()},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[_clientsigners.environmentUrlConfig[C.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function pe(h){return _jsxruntime.jsx.call(void 0, ee,_chunkJ42HASCIjs.a.call(void 0, {},h))}exports.a = pe;
@@ -1 +0,0 @@
1
- import{a as R}from"./chunk-PRBG566A.mjs";import{a as O}from"./chunk-XNDIT72O.mjs";import{a as L}from"./chunk-3QSVHCEH.mjs";import{a as m,e as p}from"./chunk-PSSAAY7D.mjs";import{useCallback as E,useRef as f,useMemo as W,useEffect as G,useState as H}from"react";import{View as j}from"react-native";import{RNWebView as K,WebViewParent as B}from"@crossmint/client-sdk-rn-window";import{environmentUrlConfig as M,signerInboundEvents as J,signerOutboundEvents as $,SignerErrorCode as q}from"@crossmint/client-signers";import{validateAPIKey as Q}from"@crossmint/common-sdk-base";import{CrossmintWalletBaseProvider as X,useCrossmint as Y}from"@crossmint/client-sdk-react-base";import{useLogger as Z}from"@crossmint/client-sdk-react-base";import{Fragment as ne,jsx as v,jsxs as U}from"react/jsx-runtime";function ee({children:h,createOnLogin:T,appearance:A,headlessSigningFlow:P=!0,callbacks:D}){let{crossmint:N}=Y("CrossmintWalletProvider must be used within CrossmintProvider"),n=Z(R),{apiKey:k,appId:g}=N,C=W(()=>{let e=Q(k);if(!e.isValid)throw new Error("Invalid API key");return e},[k]),z=W(()=>M[C.environment],[C.environment]),s=f(null),r=f(null),[V,S]=H(!1),l=f(!1),c=f(!1),d=f(0),x=W(()=>g!=null?{crossmintAppId:g}:{},[g]);G(()=>{s.current!=null&&r.current==null&&(n.info("react-native.wallet.webview.initializing"),r.current=new B(s,{incomingEvents:$,outgoingEvents:J,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[q.IndexedDbFatal]}}),n.info("react-native.wallet.webview.initialized"))},[V,n]);let b=E(e=>p(this,null,function*(){if(r.current!=null){let a=r.current;if(c.current){n.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e});return}if(l.current&&a.isConnected){n.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e});return}c.current=!0;let i=d.current;try{n.info("react-native.wallet.webview.handshake.start",{trigger:e}),l.current=!0,a.isConnected=!1,yield a.handshakeWithChild(),n.info("react-native.wallet.webview.handshake.success",{trigger:e})}catch(t){i===d.current&&(l.current=!1),n.error("react-native.wallet.webview.handshake.error",{trigger:e,error:t instanceof Error?t.message:String(t)}),console.error("[CrossmintWalletProvider] Handshake error:",t)}finally{i===d.current&&(c.current=!1)}}else n.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[n]),_=E(()=>p(this,null,function*(){n.info("react-native.wallet.webview.onLoadEnd"),yield b("onLoadEnd")}),[n,b]),F=E(e=>{let a=r.current;if(a==null)return;let i=e.nativeEvent.data;if(i==="frame-ready"){n.info("react-native.wallet.webview.frame-ready.received"),b("frame-ready");return}try{let t=JSON.parse(i);if(t&&typeof t.type=="string"&&t.type.startsWith("console.")){let y=t.type.split(".")[1],I=(t.data||[]).map(o=>{try{return o==="[Function]"||o==="[Circular Reference]"||o==="[Unserializable Object]"?o:JSON.parse(o)}catch(ie){return o}}),w=`react-native.wallet.webview.console.${y}`,u={webview_args:I};switch(y){case"log":n.info(w,u);break;case"error":n.error(w,u);break;case"warn":n.warn(w,u);break;case"info":n.info(w,u);break;case"debug":n.debug(w,u);break;default:n.info("react-native.wallet.webview.console.unknown",{webview_method:y,webview_args:I})}return}}catch(t){}a.handleMessage(e)},[n,b]);return U(X,{createOnLogin:T,appearance:A,headlessSigningFlow:P,initializeWebView:()=>p(this,null,function*(){n.info("react-native.wallet.webview.init.start"),S(!0);let e=0,a=100;for(;r.current==null&&e<a;)yield new Promise(i=>setTimeout(i,50)),e++;if(r.current==null)throw n.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");n.info("react-native.wallet.webview.init.success",{attempts:e})}),callbacks:D,renderUI:P?void 0:({emailSignerProps:e,phoneSignerProps:a})=>U(ne,{children:[v(O,m({},e)),v(L,m({},a))]}),clientTEEConnection:()=>{if(r.current==null)throw new Error("WebView not ready or handshake incomplete");return r.current},children:[h,V&&v(j,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:v(K,{ref:s,source:{uri:z},globals:x,onLoadEnd:_,onMessage:F,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var e;n.warn("react-native.wallet.webview.process.terminated"),d.current++,l.current=!1,c.current=!1,r.current!=null&&(r.current.isConnected=!1),(e=s.current)==null||e.reload()},onRenderProcessGone:()=>{var e;n.warn("react-native.wallet.webview.process.renderGone"),d.current++,l.current=!1,c.current=!1,r.current!=null&&(r.current.isConnected=!1),(e=s.current)==null||e.reload()},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[M[C.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function he(h){return v(ee,m({},h))}export{he as a};