@cirkay-eng/cirkay-components 0.9.23-beta.3 → 0.9.23-beta.4
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/components/connected/connected.js +1 -1
- package/dist/components/error-screen/error-screen.js +1 -1
- package/dist/components/fan-pass-claim/fan-pass-claim.js +1 -1
- package/dist/components/fan-pass-unlock/fan-pass-unlock.js +1 -1
- package/dist/components/frame/frame.js +1 -1
- package/dist/components/login/login.js +1 -1
- package/dist/components/mobile-pass/mobile-pass.js +1 -1
- package/dist/docs/fan-pass-claim/designTokens.d.ts +71 -0
- package/dist/docs/fan-pass-claim/designTokens.d.ts.map +1 -0
- package/dist/docs/fan-pass-unlock/designTokens.d.ts +3 -0
- package/dist/docs/fan-pass-unlock/designTokens.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/@magic-sdk_provider@28.20.0_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.js +10 -0
- package/dist/node_modules/.pnpm/@magic-sdk_provider@28.20.0_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@magic-sdk_types@24.18.0/node_modules/@magic-sdk/types/dist/es/index.js +4 -0
- package/dist/node_modules/.pnpm/@magic-sdk_types@24.18.0/node_modules/@magic-sdk/types/dist/es/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.3.0_rollup@4.60.2_tslib@2.8.1_typescript@5.9.3 → @rollup_plugin-typescript@12.1.2_rollup@4.32.1_tslib@2.8.1_typescript@5.7.3}/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/.pnpm/magic-sdk@28.21.0/node_modules/magic-sdk/dist/es/index.js +9 -0
- package/dist/node_modules/.pnpm/magic-sdk@28.21.0/node_modules/magic-sdk/dist/es/index.js.map +1 -0
- package/dist/utils/recaptcha-v3.d.ts +3 -0
- package/dist/utils/recaptcha-v3.d.ts.map +1 -0
- package/dist/utils/recaptcha-v3.js +85 -0
- package/dist/utils/recaptcha-v3.js.map +1 -0
- package/dist/utils/site-url.d.ts +2 -0
- package/dist/utils/site-url.d.ts.map +1 -0
- package/dist/utils/site-url.js +18 -0
- package/dist/utils/site-url.js.map +1 -0
- package/package.json +1 -1
- package/dist/custom-elements.json +0 -3693
- /package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.3.0_rollup@4.60.2_tslib@2.8.1_typescript@5.9.3 → @rollup_plugin-typescript@12.1.2_rollup@4.32.1_tslib@2.8.1_typescript@5.7.3}/node_modules/tslib/tslib.es6.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.
|
|
1
|
+
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.58.0_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators/property.js';
|
|
4
4
|
import '@pushengineering/push-web-components/text';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.
|
|
1
|
+
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.58.0_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators/property.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.
|
|
1
|
+
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.58.0_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { nothing, html } from 'lit';
|
|
3
3
|
import { loginShadowParts, frameShadowParts, connectedShadowParts } from '../../constants/shadow-parts.js';
|
|
4
4
|
import { property, query } from 'lit/decorators.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.
|
|
1
|
+
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.58.0_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
4
|
import { loginShadowParts, connectedShadowParts, frameShadowParts } from '../../constants/shadow-parts.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.
|
|
1
|
+
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.58.0_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators/property.js';
|
|
4
4
|
import '@pushengineering/push-web-components/text';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.
|
|
1
|
+
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.58.0_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { state } from 'lit/decorators/state.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.
|
|
1
|
+
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.58.0_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators/property.js';
|
|
4
4
|
import '@pushengineering/push-web-components/text';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
declare const designTokens: {
|
|
2
|
+
primary: {
|
|
3
|
+
'fp-body-font': {
|
|
4
|
+
value: string;
|
|
5
|
+
description: string;
|
|
6
|
+
category: string;
|
|
7
|
+
};
|
|
8
|
+
'fp-heading-font': {
|
|
9
|
+
value: string;
|
|
10
|
+
description: string;
|
|
11
|
+
category: string;
|
|
12
|
+
};
|
|
13
|
+
'fp-button-background-color': {
|
|
14
|
+
value: string;
|
|
15
|
+
description: string;
|
|
16
|
+
category: string;
|
|
17
|
+
};
|
|
18
|
+
'fp-button-text-color': {
|
|
19
|
+
value: string;
|
|
20
|
+
description: string;
|
|
21
|
+
category: string;
|
|
22
|
+
};
|
|
23
|
+
'fp-overlay-background-color': {
|
|
24
|
+
value: string;
|
|
25
|
+
description: string;
|
|
26
|
+
category: string;
|
|
27
|
+
};
|
|
28
|
+
'fp-overlay-background-opacity': {
|
|
29
|
+
value: string;
|
|
30
|
+
description: string;
|
|
31
|
+
category: string;
|
|
32
|
+
};
|
|
33
|
+
'fp-modal-background-color': {
|
|
34
|
+
value: string;
|
|
35
|
+
description: string;
|
|
36
|
+
category: string;
|
|
37
|
+
};
|
|
38
|
+
'fp-modal-text-color': {
|
|
39
|
+
value: string;
|
|
40
|
+
description: string;
|
|
41
|
+
category: string;
|
|
42
|
+
};
|
|
43
|
+
'fp-input-background-color': {
|
|
44
|
+
value: string;
|
|
45
|
+
description: string;
|
|
46
|
+
category: string;
|
|
47
|
+
};
|
|
48
|
+
'fp-input-border-color': {
|
|
49
|
+
value: string;
|
|
50
|
+
description: string;
|
|
51
|
+
category: string;
|
|
52
|
+
};
|
|
53
|
+
'fp-focus-ring-color': {
|
|
54
|
+
value: string;
|
|
55
|
+
description: string;
|
|
56
|
+
category: string;
|
|
57
|
+
};
|
|
58
|
+
'fp-input-border-width': {
|
|
59
|
+
value: string;
|
|
60
|
+
description: string;
|
|
61
|
+
category: string;
|
|
62
|
+
};
|
|
63
|
+
'fp-input-border-radius': {
|
|
64
|
+
value: string;
|
|
65
|
+
description: string;
|
|
66
|
+
category: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export default designTokens;
|
|
71
|
+
//# sourceMappingURL=designTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"designTokens.d.ts","sourceRoot":"","sources":["../../../src/docs/fan-pass-claim/designTokens.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEjB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"designTokens.d.ts","sourceRoot":"","sources":["../../../src/docs/fan-pass-unlock/designTokens.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,IAEjB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RPCErrorCode as m$1, SDKErrorCode as p, MagicIncomingWindowMessage as f$1, SDKWarningCode as l, MagicPayloadMethod as _$1, LoginWithSmsOTPEventEmit as R$1, DeviceVerificationEventEmit as h$1, LoginWithEmailOTPEventEmit as A, RecencyCheckEventEmit as O$1, UpdateEmailEventEmit as b$1, RecoveryFactorEventEmit as W$1, RecoverAccountEventEmit as B$1, EnableMFAEventEmit as w, DisableMFAEventEmit as D$1, LocalStorageKeys as v, MagicOutgoingWindowMessage as g, NftCheckoutIntermediaryEvents as P$1, UserEventsOnReceived as H$1, UserEventsEmit as G, routeToMagicMethods as z$1 } from '../../../../../../@magic-sdk_types@24.18.0/node_modules/@magic-sdk/types/dist/es/index.js';
|
|
2
|
+
|
|
3
|
+
var Qt=Object.create;var fe=Object.defineProperty,Zt=Object.defineProperties,er=Object.getOwnPropertyDescriptor,tr=Object.getOwnPropertyDescriptors,rr=Object.getOwnPropertyNames,rt=Object.getOwnPropertySymbols,nr=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty,sr=Object.prototype.propertyIsEnumerable;var nt=(r,e,t)=>e in r?fe(r,e,{enumerable:true,configurable:true,writable:true,value:t}):r[e]=t,q=(r,e)=>{for(var t in e||(e={}))st.call(e,t)&&nt(r,t,e[t]);if(rt)for(var t of rt(e))sr.call(e,t)&&nt(r,t,e[t]);return r},z=(r,e)=>Zt(r,tr(e));var or=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ir=(r,e)=>{for(var t in e)fe(r,t,{get:e[t],enumerable:true});},ar=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of rr(e))!st.call(r,o)&&o!==t&&fe(r,o,{get:()=>e[o],enumerable:!(n=er(e,o))||n.enumerable});return r};var cr=(r,e,t)=>(t=r!=null?Qt(nr(r)):{},ar(!r||!r.__esModule?fe(t,"default",{value:r,enumerable:true}):t,r));var f=(r,e,t)=>new Promise((n,o)=>{var s=c=>{try{a(t.next(c));}catch(l){o(l);}},i=c=>{try{a(t.throw(c));}catch(l){o(l);}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,i);a((t=t.apply(r,e)).next());});var $t=or((ts,Je)=>{var nn=Object.prototype.hasOwnProperty,w="~";function de(){}Object.create&&(de.prototype=Object.create(null),new de().__proto__||(w=false));function sn(r,e,t){this.fn=r,this.context=e,this.once=t||false;}function Ct(r,e,t,n,o){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new sn(t,n||r,o),i=w?w+e:e;return r._events[i]?r._events[i].fn?r._events[i]=[r._events[i],s]:r._events[i].push(s):(r._events[i]=s,r._eventsCount++),r}function Te(r,e){--r._eventsCount===0?r._events=new de:delete r._events[e];}function T(){this._events=new de,this._eventsCount=0;}T.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)nn.call(t,n)&&e.push(w?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};T.prototype.listeners=function(e){var t=w?w+e:e,n=this._events[t];if(!n)return [];if(n.fn)return [n.fn];for(var o=0,s=n.length,i=new Array(s);o<s;o++)i[o]=n[o].fn;return i};T.prototype.listenerCount=function(e){var t=w?w+e:e,n=this._events[t];return n?n.fn?1:n.length:0};T.prototype.emit=function(e,t,n,o,s,i){var a=w?w+e:e;if(!this._events[a])return false;var c=this._events[a],l=arguments.length,d,p;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,undefined,true),l){case 1:return c.fn.call(c.context),true;case 2:return c.fn.call(c.context,t),true;case 3:return c.fn.call(c.context,t,n),true;case 4:return c.fn.call(c.context,t,n,o),true;case 5:return c.fn.call(c.context,t,n,o,s),true;case 6:return c.fn.call(c.context,t,n,o,s,i),true}for(p=1,d=new Array(l-1);p<l;p++)d[p-1]=arguments[p];c.fn.apply(c.context,d);}else {var M=c.length,v;for(p=0;p<M;p++)switch(c[p].once&&this.removeListener(e,c[p].fn,undefined,true),l){case 1:c[p].fn.call(c[p].context);break;case 2:c[p].fn.call(c[p].context,t);break;case 3:c[p].fn.call(c[p].context,t,n);break;case 4:c[p].fn.call(c[p].context,t,n,o);break;default:if(!d)for(v=1,d=new Array(l-1);v<l;v++)d[v-1]=arguments[v];c[p].fn.apply(c[p].context,d);}}return true};T.prototype.on=function(e,t,n){return Ct(this,e,t,n,false)};T.prototype.once=function(e,t,n){return Ct(this,e,t,n,true)};T.prototype.removeListener=function(e,t,n,o){var s=w?w+e:e;if(!this._events[s])return this;if(!t)return Te(this,s),this;var i=this._events[s];if(i.fn)i.fn===t&&(!o||i.once)&&(!n||i.context===n)&&Te(this,s);else {for(var a=0,c=[],l=i.length;a<l;a++)(i[a].fn!==t||o&&!i[a].once||n&&i[a].context!==n)&&c.push(i[a]);c.length?this._events[s]=c.length===1?c[0]:c:Te(this,s);}return this};T.prototype.removeAllListeners=function(e){var t;return e?(t=w?w+e:e,this._events[t]&&Te(this,t)):(this._events=new de,this._eventsCount=0),this};T.prototype.off=T.prototype.removeListener;T.prototype.addListener=T.prototype.on;T.prefixed=w;T.EventEmitter=T;typeof Je<"u"&&(Je.exports=T);});function lr(r){let e={exports:{}};return r(e,e.exports),e.exports}var dr=Number.MAX_SAFE_INTEGER||9007199254740991;var Fe={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:dr,MAX_SAFE_COMPONENT_LENGTH:16},ur=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},h=ur,ae=lr(function(r,e){let{MAX_SAFE_COMPONENT_LENGTH:t}=Fe,n=(e=r.exports={}).re=[],o=e.src=[],s=e.t={},i=0,a=(c,l,d)=>{let p=i++;h(p,l),s[c]=p,o[p]=l,n[p]=new RegExp(l,d?"g":undefined);};a("NUMERICIDENTIFIER","0|[1-9]\\d*"),a("NUMERICIDENTIFIERLOOSE","[0-9]+"),a("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),a("MAINVERSION",`(${o[s.NUMERICIDENTIFIER]})\\.(${o[s.NUMERICIDENTIFIER]})\\.(${o[s.NUMERICIDENTIFIER]})`),a("MAINVERSIONLOOSE",`(${o[s.NUMERICIDENTIFIERLOOSE]})\\.(${o[s.NUMERICIDENTIFIERLOOSE]})\\.(${o[s.NUMERICIDENTIFIERLOOSE]})`),a("PRERELEASEIDENTIFIER",`(?:${o[s.NUMERICIDENTIFIER]}|${o[s.NONNUMERICIDENTIFIER]})`),a("PRERELEASEIDENTIFIERLOOSE",`(?:${o[s.NUMERICIDENTIFIERLOOSE]}|${o[s.NONNUMERICIDENTIFIER]})`),a("PRERELEASE",`(?:-(${o[s.PRERELEASEIDENTIFIER]}(?:\\.${o[s.PRERELEASEIDENTIFIER]})*))`),a("PRERELEASELOOSE",`(?:-?(${o[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[s.PRERELEASEIDENTIFIERLOOSE]})*))`),a("BUILDIDENTIFIER","[0-9A-Za-z-]+"),a("BUILD",`(?:\\+(${o[s.BUILDIDENTIFIER]}(?:\\.${o[s.BUILDIDENTIFIER]})*))`),a("FULLPLAIN",`v?${o[s.MAINVERSION]}${o[s.PRERELEASE]}?${o[s.BUILD]}?`),a("FULL",`^${o[s.FULLPLAIN]}$`),a("LOOSEPLAIN",`[v=\\s]*${o[s.MAINVERSIONLOOSE]}${o[s.PRERELEASELOOSE]}?${o[s.BUILD]}?`),a("LOOSE",`^${o[s.LOOSEPLAIN]}$`),a("GTLT","((?:<|>)?=?)"),a("XRANGEIDENTIFIERLOOSE",`${o[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),a("XRANGEIDENTIFIER",`${o[s.NUMERICIDENTIFIER]}|x|X|\\*`),a("XRANGEPLAIN",`[v=\\s]*(${o[s.XRANGEIDENTIFIER]})(?:\\.(${o[s.XRANGEIDENTIFIER]})(?:\\.(${o[s.XRANGEIDENTIFIER]})(?:${o[s.PRERELEASE]})?${o[s.BUILD]}?)?)?`),a("XRANGEPLAINLOOSE",`[v=\\s]*(${o[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[s.XRANGEIDENTIFIERLOOSE]})(?:${o[s.PRERELEASELOOSE]})?${o[s.BUILD]}?)?)?`),a("XRANGE",`^${o[s.GTLT]}\\s*${o[s.XRANGEPLAIN]}$`),a("XRANGELOOSE",`^${o[s.GTLT]}\\s*${o[s.XRANGEPLAINLOOSE]}$`),a("COERCE",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?(?:$|[^\\d])`),a("COERCERTL",o[s.COERCE],true),a("LONETILDE","(?:~>?)"),a("TILDETRIM",`(\\s*)${o[s.LONETILDE]}\\s+`,true),e.tildeTrimReplace="$1~",a("TILDE",`^${o[s.LONETILDE]}${o[s.XRANGEPLAIN]}$`),a("TILDELOOSE",`^${o[s.LONETILDE]}${o[s.XRANGEPLAINLOOSE]}$`),a("LONECARET","(?:\\^)"),a("CARETTRIM",`(\\s*)${o[s.LONECARET]}\\s+`,true),e.caretTrimReplace="$1^",a("CARET",`^${o[s.LONECARET]}${o[s.XRANGEPLAIN]}$`),a("CARETLOOSE",`^${o[s.LONECARET]}${o[s.XRANGEPLAINLOOSE]}$`),a("COMPARATORLOOSE",`^${o[s.GTLT]}\\s*(${o[s.LOOSEPLAIN]})$|^$`),a("COMPARATOR",`^${o[s.GTLT]}\\s*(${o[s.FULLPLAIN]})$|^$`),a("COMPARATORTRIM",`(\\s*)${o[s.GTLT]}\\s*(${o[s.LOOSEPLAIN]}|${o[s.XRANGEPLAIN]})`,true),e.comparatorTrimReplace="$1$2$3",a("HYPHENRANGE",`^\\s*(${o[s.XRANGEPLAIN]})\\s+-\\s+(${o[s.XRANGEPLAIN]})\\s*$`),a("HYPHENRANGELOOSE",`^\\s*(${o[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[s.XRANGEPLAINLOOSE]})\\s*$`),a("STAR","(<|>)?=?\\s*\\*"),a("GTE0","^\\s*>=\\s*0.0.0\\s*$"),a("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$");}),ot=/^[0-9]+$/,ht=(r,e)=>{let t=ot.test(r),n=ot.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},pr=(r,e)=>ht(e,r),mr={compareIdentifiers:ht,rcompareIdentifiers:pr},{MAX_LENGTH:it,MAX_SAFE_INTEGER:Ee}=Fe,{re:at,t:ct}=ae,{compareIdentifiers:oe}=mr,E=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:false}),e instanceof E){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version;}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>it)throw new TypeError(`version is longer than ${it} characters`);h("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?at[ct.LOOSE]:at[ct.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ee||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ee||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ee||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<Ee)return s}return o}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format();}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(h("SemVer.compare",this.version,this.options,e),!(e instanceof E)){if(typeof e=="string"&&e===this.version)return 0;e=new E(e,this.options);}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof E||(e=new E(e,this.options)),oe(this.major,e.major)||oe(this.minor,e.minor)||oe(this.patch,e.patch)}comparePre(e){if(e instanceof E||(e=new E(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],o=e.prerelease[t];if(h("prerelease compare",t,n,o),n===undefined&&o===undefined)return 0;if(o===undefined)return 1;if(n===undefined)return -1;if(n!==o)return oe(n,o)}while(++t)}compareBuild(e){e instanceof E||(e=new E(e,this.options));let t=0;do{let n=this.build[t],o=e.build[t];if(h("prerelease compare",t,n,o),n===undefined&&o===undefined)return 0;if(o===undefined)return 1;if(n===undefined)return -1;if(n!==o)return oe(n,o)}while(++t)}inc(e,t){switch(e){case "premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case "preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case "prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case "prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case "major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case "minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case "patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case "pre":if(this.prerelease.length===0)this.prerelease=[0];else {let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0);}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},hr=(r,e,t)=>new E(r,t).compare(new E(e,t)),Y=hr,fr=(r,e,t)=>Y(r,e,t)===0,Er=fr,gr=(r,e,t)=>Y(r,e,t)!==0,yr=gr,Rr=(r,e,t)=>Y(r,e,t)>0,vr=Rr,Ir=(r,e,t)=>Y(r,e,t)>=0,Tr=Ir,br=(r,e,t)=>Y(r,e,t)<0,Pr=br,wr=(r,e,t)=>Y(r,e,t)<=0,xr=wr,Mr=(r,e,t,n)=>{switch(e){case "===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case "!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case "":case "=":case "==":return Er(r,t,n);case "!=":return yr(r,t,n);case ">":return vr(r,t,n);case ">=":return Tr(r,t,n);case "<":return Pr(r,t,n);case "<=":return xr(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}},Ue=Mr,ie=Symbol("SemVer ANY"),U=class{static get ANY(){return ie}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:false}),e instanceof U){if(e.loose===!!t.loose)return e;e=e.value;}h("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ie?this.value="":this.value=this.operator+this.semver.version,h("comp",this);}parse(e){let t=this.options.loose?lt[dt.COMPARATORLOOSE]:lt[dt.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==undefined?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new E(n[2],this.options.loose):this.semver=ie;}toString(){return this.value}test(e){if(h("Comparator.test",e,this.options.loose),this.semver===ie||e===ie)return true;if(typeof e=="string")try{e=new E(e,this.options);}catch(t){return false}return Ue(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof U))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:false}),this.operator==="")return this.value===""||new L(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new L(this.value,t).test(e.semver);let n=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),o=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),s=this.semver.version===e.semver.version,i=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=Ue(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),c=Ue(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||o||s&&i||a||c}},{re:lt,t:dt}=ae,L=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:false}),e instanceof L)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new L(e.raw,t);if(e instanceof U)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format();}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?I[y.HYPHENRANGELOOSE]:I[y.HYPHENRANGE];e=e.replace(n,Fr(this.options.includePrerelease)),h("hyphen replace",e),e=e.replace(I[y.COMPARATORTRIM],Sr),h("comparator trim",e,I[y.COMPARATORTRIM]),e=(e=(e=e.replace(I[y.TILDETRIM],Nr)).replace(I[y.CARETTRIM],Ar)).split(/\s+/).join(" ");let o=t?I[y.COMPARATORLOOSE]:I[y.COMPARATOR];return e.split(" ").map(s=>Cr(s,this.options)).join(" ").split(/\s+/).map(s=>Ur(s,this.options)).filter(this.options.loose?s=>!!s.match(o):()=>true).map(s=>new U(s,this.options))}intersects(e,t){if(!(e instanceof L))throw new TypeError("a Range is required");return this.set.some(n=>ut(n,t)&&e.set.some(o=>ut(o,t)&&n.every(s=>o.every(i=>s.intersects(i,t)))))}test(e){if(!e)return false;if(typeof e=="string")try{e=new E(e,this.options);}catch(t){return false}for(let t=0;t<this.set.length;t++)if(Wr(this.set[t],e,this.options))return true;return false}},{re:I,t:y,comparatorTrimReplace:Sr,tildeTrimReplace:Nr,caretTrimReplace:Ar}=ae,ut=(r,e)=>{let t=true,n=r.slice(),o=n.pop();for(;t&&n.length;)t=n.every(s=>o.intersects(s,e)),o=n.pop();return t},Cr=(r,e)=>(h("comp",r,e),r=Or(r,e),h("caret",r),r=$r(r,e),h("tildes",r),r=kr(r,e),h("xrange",r),r=qr(r,e),h("stars",r),r),P=r=>!r||r.toLowerCase()==="x"||r==="*",$r=(r,e)=>r.trim().split(/\s+/).map(t=>Lr(t,e)).join(" "),Lr=(r,e)=>{let t=e.loose?I[y.TILDELOOSE]:I[y.TILDE];return r.replace(t,(n,o,s,i,a)=>{let c;return h("tilde",r,n,o,s,i,a),P(o)?c="":P(s)?c=`>=${o}.0.0 <${+o+1}.0.0-0`:P(i)?c=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:a?(h("replaceTilde pr",a),c=`>=${o}.${s}.${i}-${a} <${o}.${+s+1}.0-0`):c=`>=${o}.${s}.${i} <${o}.${+s+1}.0-0`,h("tilde return",c),c})},Or=(r,e)=>r.trim().split(/\s+/).map(t=>_r(t,e)).join(" "),_r=(r,e)=>{h("caret",r,e);let t=e.loose?I[y.CARETLOOSE]:I[y.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(o,s,i,a,c)=>{let l;return h("caret",r,o,s,i,a,c),P(s)?l="":P(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:P(a)?l=s==="0"?`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(h("replaceCaret pr",c),l=s==="0"?i==="0"?`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(h("no pr"),l=s==="0"?i==="0"?`>=${s}.${i}.${a}${n} <${s}.${i}.${+a+1}-0`:`>=${s}.${i}.${a}${n} <${s}.${+i+1}.0-0`:`>=${s}.${i}.${a} <${+s+1}.0.0-0`),h("caret return",l),l})},kr=(r,e)=>(h("replaceXRanges",r,e),r.split(/\s+/).map(t=>Dr(t,e)).join(" ")),Dr=(r,e)=>{r=r.trim();let t=e.loose?I[y.XRANGELOOSE]:I[y.XRANGE];return r.replace(t,(n,o,s,i,a,c)=>{h("xRange",r,n,o,s,i,a,c);let l=P(s),d=l||P(i),p=d||P(a),M=p;return o==="="&&M&&(o=""),c=e.includePrerelease?"-0":"",l?n=o===">"||o==="<"?"<0.0.0-0":"*":o&&M?(d&&(i=0),a=0,o===">"?(o=">=",d?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",d?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):d?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:p&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),h("xRange return",n),n})},qr=(r,e)=>(h("replaceStars",r,e),r.trim().replace(I[y.STAR],"")),Ur=(r,e)=>(h("replaceGTE0",r,e),r.trim().replace(I[e.includePrerelease?y.GTE0PRE:y.GTE0],"")),Fr=r=>(e,t,n,o,s,i,a,c,l,d,p,M,v)=>`${t=P(n)?"":P(o)?`>=${n}.0.0${r?"-0":""}`:P(s)?`>=${n}.${o}.0${r?"-0":""}`:i?`>=${t}`:`>=${t}${r?"-0":""}`} ${c=P(l)?"":P(d)?`<${+l+1}.0.0-0`:P(p)?`<${l}.${+d+1}.0-0`:M?`<=${l}.${d}.${p}-${M}`:r?`<${l}.${d}.${+p+1}-0`:`<=${c}`}`.trim(),Wr=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return false;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(h(r[n].semver),r[n].semver!==U.ANY&&r[n].semver.prerelease.length>0){let o=r[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return true}return false}return true},ft=(r,e,t)=>{try{e=new L(e,t);}catch(n){return false}return e.test(r)};var{MAX_LENGTH:Jr}=Fe,{re:pt,t:mt}=ae,Gr=(r,e)=>{if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:false}),r instanceof E)return r;if(typeof r!="string"||r.length>Jr||!(e.loose?pt[mt.LOOSE]:pt[mt.FULL]).test(r))return null;try{return new E(r,e)}catch(t){return null}},Kr=Gr,{re:ge,t:ye}=ae,Et=(r,e)=>{if(r instanceof E)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;let t=null;if((e=e||{}).rtl){let n;for(;(n=ge[ye.COERCERTL].exec(r))&&(!t||t.index+t[0].length!==r.length);)t&&n.index+n[0].length===t.index+t[0].length||(t=n),ge[ye.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;ge[ye.COERCERTL].lastIndex=-1;}else t=r.match(ge[ye.COERCE]);return t===null?null:Kr(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};function jr(r){return String.fromCharCode(parseInt(r.slice(1),16))}function Vr(r){return `%${`00${r.charCodeAt(0).toString(16)}`.slice(-2)}`}function Hr(r){return btoa(encodeURIComponent(r).replace(/%[0-9A-F]{2}/g,jr))}function Br(r){return decodeURIComponent(Array.from(atob(r),Vr).join(""))}function Re(r){return Hr(JSON.stringify(r))}function gt(r){return JSON.parse(Br(r))}function O(r){return typeof r=="undefined"}function Yr(r){return r===null}function ve(r){return Yr(r)||O(r)}function yt(r){return ve(r)?false:!O(r.jsonrpc)&&!O(r.id)&&(!O(r.result)||!O(r.error))}function Rt(r){return ve(r)?false:typeof r=="number"&&Object.values(m$1).includes(r)}function ce(r){if(!r)return true;for(let e in r)if(Object.hasOwnProperty.call(r,e))return false;return true}var m={};function Qr(r,e){return Object.assign(m,e),r}var vt={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"};var C=class extends Error{constructor(t,n){super(`Magic SDK Error: [${t}] ${n}`);this.code=t;this.rawMessage=n;this.__proto__=Error;Object.setPrototypeOf(this,C.prototype);}},_=class extends Error{constructor(t){super();this.__proto__=Error;let n=Number(t==null?undefined:t.code);this.rawMessage=(t==null?undefined:t.message)||"Internal error",this.code=Rt(n)?n:m$1.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(t==null?undefined:t.data)||undefined,Object.setPrototypeOf(this,_.prototype);}},F=class{constructor(e,t){this.code=e;this.rawMessage=t;this.message=`Magic SDK Warning: [${e}] ${t}`;}log(){console.warn(this.message);}},Q=class extends Error{constructor(t,n,o,s){super(`Magic Extension Error (${t.name}): [${n}] ${o}`);this.code=n;this.rawMessage=o;this.data=s;this.__proto__=Error;Object.setPrototypeOf(this,Q.prototype);}},le=class{constructor(e,t,n){this.code=t;this.rawMessage=n;this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`;}log(){console.warn(this.message);}};function It(){return new C(p.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Tt(){return new C(p.ModalNotReady,"Modal is not ready.")}function bt(){return new C(p.MalformedResponse,"Response from the Magic iframe is malformed.")}function Pt(r){return new C(p.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${r}\` can be accessed. Do not invoke \`Extension.${r}\` inside an extension constructor.`)}function wt(r){let e=`Some extensions are incompatible with \`${m.sdkName}@${m.version}\`:`;return r.filter(t=>typeof t.compat!="undefined"&&t.compat!==null).forEach(t=>{let n=t.compat[m.sdkName];typeof n=="string"?e+=`
|
|
4
|
+
- Extension \`${t.name}\` supports version(s) \`${n}\``:n||(e+=`
|
|
5
|
+
- Extension \`${t.name}\` does not support ${m.platform} environments.`);}),new C(p.IncompatibleExtensions,e)}function xt(r){let e=t=>{let n=t+1,o=n%10,s=n%100;return o===1&&s!==11?`${n}st`:o===2&&s!==12?`${n}nd`:o===3&&s!==13?`${n}rd`:`${n}th`};return new C(p.InvalidArgument,`Invalid ${e(r.argument)} argument given to \`${r.procedure}\`.
|
|
6
|
+
Expected: \`${r.expected}\`
|
|
7
|
+
Received: \`${r.received}\``)}function Xn(){return new F(l.DuplicateIframe,"Duplicate iframes found.")}function Mt(){return new F(l.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function St(){return new F(l.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${m.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function W(r){let{method:e,removalVersions:t,useInstead:n}=r,o=t[m.sdkName],s=n?` Use \`${n}\` instead.`:"",i=`\`${e}\` will be removed from \`${m.sdkName}\` in version \`${o}\`.${s}`;return new F(l.DeprecationNotice,i)}function*en(){let r=0;for(;;)r<Number.MAX_SAFE_INTEGER?yield ++r:r=0;}var tn=en();function We(){return tn.next().value}var Nt=Symbol("Payload pre-processed by Magic SDK");function At(r){return Object.defineProperty(r,Nt,{value:true,enumerable:false}),r}function rn(r){return !!r[Nt]}function H(r){var e,t,n;return rn(r)||(r.jsonrpc=(e=r.jsonrpc)!=null?e:"2.0",r.id=We(),r.method=(t=r.method)!=null?t:"noop",r.params=(n=r.params)!=null?n:[],At(r)),r}function u(r,e=[]){return At({params:e,method:r,jsonrpc:"2.0",id:We()})}var J=class{constructor(e){e instanceof J?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):yt(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=undefined,this._error=undefined);}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return {jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}};var Lt=cr($t()),Ge=class extends Lt.default{};function be(){let r=new Ge;return {emitter:r,createChainingEmitterMethod:(n,o)=>(...s)=>(r[n].apply(r,s),o),createBoundEmitterMethod:n=>(...o)=>r[n].apply(r,o)}}var Ot=Symbol("isPromiEvent");function _t(r){return !!r[Ot]}function x(r){let e=Ke(r),{createBoundEmitterMethod:t,createChainingEmitterMethod:n}=be(),o=Symbol("Promise.then"),s=Symbol("Promise.catch"),i=Symbol("Promise.finally"),a=(d,p)=>(...M)=>{let v=p[d].apply(p,M);return c(v)},c=d=>Object.assign(d,{[Ot]:true,[o]:d[o]||d.then,[s]:d[s]||d.catch,[i]:d[i]||d.finally,then:a(o,d),catch:a(s,d),finally:a(i,d),on:n("on",d),once:n("once",d),addListener:n("addListener",d),off:n("off",d),removeListener:n("removeListener",d),removeAllListeners:n("removeAllListeners",d),emit:t("emit"),eventNames:t("eventNames"),listeners:t("listeners"),listenerCount:t("listenerCount")}),l=c(e.then(d=>(l.emit("done",d),l.emit("settled"),d),d=>{throw l.emit("error",d),l.emit("settled"),d}));return l.on(H$1.ClosedByUser,()=>{l.emit(G.ClosedByUser);}),l}function Ke(r){return new Promise((e,t)=>{let n=r(e,t);Promise.resolve(n).catch(t);})}var R=class{constructor(e){this.sdk=e;}get overlay(){return this.sdk.overlay}request(e){if(this.sdk.thirdPartyWallets.isConnected&&!z$1.includes(e.method))return x((i,a)=>{this.sdk.thirdPartyWallets.requestOverride(e).then(i).catch(a);});let t=this.overlay.post(g.MAGIC_HANDLE_REQUEST,H(e)),n=x((s,i)=>{t.then(a=>{if(o(),a.hasError)i(new _(a.payload.error));else if(a.hasResult)s(a.payload.result);else throw bt()}).catch(a=>{o(),i(a);});}),o=this.overlay.on(f$1.MAGIC_HANDLE_EVENT,s=>{var a;let{response:i}=s.data;if(i.id===e.id&&((a=i.result)==null?undefined:a.event)){let{event:c,params:l=[]}=i.result;n.emit(c,...l);}});return n}createIntermediaryEvent(e,t){return o=>{let s=u(_$1.IntermediaryEvent,[{payloadId:t,eventType:e,args:o}]);this.request(s);}}};function kt(r,e){let[t]=r.split(".").map(Number);return t>=e}var B={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},we=class extends R{loginWithMagicLink(e){let t=m.sdkName==="@magic-sdk/react-native"||m.sdkName==="@magic-sdk/react-native-bare"||m.sdkName==="@magic-sdk/react-native-expo";if(t&&kt(m.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");t&&W({method:"auth.loginWithMagicLink()",removalVersions:B,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:n,showUI:o=true,redirectURI:s,overrides:i,lifespan:a}=e,c=u(this.sdk.testMode?_$1.LoginWithMagicLinkTestMode:_$1.LoginWithMagicLink,[{email:n,showUI:o,redirectURI:s,overrides:i,lifespan:a}]);return this.request(c)}loginWithSMS(e){let{phoneNumber:t,showUI:n=true,lifespan:o}=e,s=u(this.sdk.testMode?_$1.LoginWithSmsTestMode:_$1.LoginWithSms,[{phoneNumber:t,showUI:n,lifespan:o}]),i=this.request(s);return !n&&i&&(i.on(R$1.VerifySmsOtp,a=>{this.createIntermediaryEvent(R$1.VerifySmsOtp,s.id)(a);}),i.on(R$1.Cancel,()=>{this.createIntermediaryEvent(R$1.Cancel,s.id)();})),i}loginWithEmailOTP(e){let{email:t,showUI:n,deviceCheckUI:o,overrides:s,lifespan:i}=e,a=u(this.sdk.testMode?_$1.LoginWithEmailOTPTestMode:_$1.LoginWithEmailOTP,[{email:t,showUI:n,deviceCheckUI:o,overrides:s,lifespan:i}]),c=this.request(a);return !o&&c&&c.on(h$1.Retry,()=>{this.createIntermediaryEvent(h$1.Retry,a.id)();}),!n&&c&&(c.on(A.VerifyEmailOtp,l=>{this.createIntermediaryEvent(A.VerifyEmailOtp,a.id)(l);}),c.on(A.VerifyMFACode,l=>{this.createIntermediaryEvent(A.VerifyMFACode,a.id)(l);}),c.on(A.LostDevice,()=>{this.createIntermediaryEvent(A.LostDevice,a.id)();}),c.on(A.VerifyRecoveryCode,l=>{this.createIntermediaryEvent(A.VerifyRecoveryCode,a.id)(l);}),c.on(A.Cancel,()=>{this.createIntermediaryEvent(A.Cancel,a.id)();})),c}loginWithCredential(e){let{credentialOrQueryString:t,lifespan:n}=e||{},o=t!=null?t:"";if(!t&&m.platform==="web"){o=window.location.search;let i=window.location.origin+window.location.pathname;window.history.replaceState(null,"",i);}let s=u(this.sdk.testMode?_$1.LoginWithCredentialTestMode:_$1.LoginWithCredential,[o,n]);return this.request(s)}setAuthorizationToken(e){let t=u(_$1.SetAuthorizationToken,[{jwt:e}]);return this.request(t)}updateEmailWithUI(e){let{email:t,showUI:n=true}=e,o=u(this.sdk.testMode?_$1.UpdateEmailTestMode:_$1.UpdateEmail,[{email:t,showUI:n}]),s=this.request(o);return n||(s.on(O$1.Retry,()=>{this.createIntermediaryEvent(O$1.Retry,o.id)();}),s.on(O$1.Cancel,()=>{this.createIntermediaryEvent(O$1.Cancel,o.id)();}),s.on(O$1.VerifyEmailOtp,i=>{this.createIntermediaryEvent(O$1.VerifyEmailOtp,o.id)(i);}),s.on(O$1.VerifyMFACode,i=>{this.createIntermediaryEvent(O$1.VerifyMFACode,o.id)(i);}),s.on(b$1.RetryWithNewEmail,i=>{this.createIntermediaryEvent(b$1.RetryWithNewEmail,o.id)(i);}),s.on(b$1.Cancel,()=>{this.createIntermediaryEvent(b$1.Cancel,o.id)();}),s.on(b$1.VerifyEmailOtp,i=>{this.createIntermediaryEvent(b$1.VerifyEmailOtp,o.id)(i);})),s}};var ue={};ir(ue,{clear:()=>pn,getItem:()=>b,iterate:()=>je,key:()=>hn,keys:()=>fn,length:()=>mn,removeItem:()=>k,setItem:()=>S});var xe;function K(r){return (...e)=>f(this,null,function*(){return xe||(xe=yield m.configureStorage()),yield xe.ready(),xe[r](...e)})}var b=K("getItem"),S=K("setItem"),k=K("removeItem"),pn=K("clear"),mn=K("length"),hn=K("key"),fn=K("keys"),je=K("iterate");function qt(){let r=window.crypto.getRandomValues(new Uint8Array(16));r[6]=r[6]&15|64,r[8]=r[8]&191|128;let e="";return e+=r[0].toString(16),e+=r[1].toString(16),e+=r[2].toString(16),e+=r[3].toString(16),e+="-",e+=r[4].toString(16),e+=r[5].toString(16),e+="-",e+=r[6].toString(16),e+=r[7].toString(16),e+="-",e+=r[8].toString(16),e+=r[9].toString(16),e+="-",e+=r[10].toString(16),e+=r[11].toString(16),e+=r[12].toString(16),e+=r[13].toString(16),e+=r[14].toString(16),e+=r[15].toString(16),e}var Ve="STORE_KEY_PRIVATE_KEY",Me="STORE_KEY_PUBLIC_JWK",Ft="ECDSA",En="P-256",gn={name:Ft,namedCurve:En};function pe(){let r=typeof window!="undefined"&&!!window.crypto,e=r&&!!window.crypto.subtle;return r&&e}function Wt(){return f(this,null,function*(){let r=yield yn();if(!r){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,t=yield b(Ve);if(!t||!e){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:qt()},o={typ:"dpop+jwt",alg:"ES256",jwk:r},s={protected:Ut(JSON.stringify(o)),claims:Ut(JSON.stringify(n))},i=vn(`${s.protected}.${s.claims}`),a={name:Ft,hash:{name:"SHA-256"}},c=Tn(new Uint8Array(yield e.sign(a,t,i)));return `${s.protected}.${s.claims}.${c}`})}function yn(){return f(this,null,function*(){if(!pe()){console.info("webcrypto is not supported");return}return (yield b(Me))||(yield Rn()),b(Me)})}function Rn(){return f(this,null,function*(){let{subtle:r}=window.crypto,e=yield r.generateKey(gn,false,["sign"]),t=yield r.exportKey("jwk",e.publicKey);yield S(Ve,e.privateKey),yield S(Me,t);})}function Ut(r){return Jt(In(r))}function vn(r){return new TextEncoder().encode(r)}function Jt(r){return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function In(r){return encodeURIComponent(r).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(parseInt(n,16)))}function Tn(r){let e="";return r.forEach(t=>{e+=String.fromCharCode(t);}),Jt(e)}var He="ds",Be="ek",Xe="iv",ze="AES-GCM",bn=256;function te(){return f(this,null,function*(){let r=[];yield je((e,t,n)=>{t.startsWith(`${He}_`)&&r.push(t);});for(let e of r)yield k(e);})}function Gt(r){let e="",t=new Uint8Array(r),n=t.byteLength;for(let o=0;o<n;o++)e+=String.fromCharCode(t[o]);return window.btoa(e)}function Kt(r){let e=window.atob(r),t=e.length,n=new Uint8Array(t);for(let o=0;o<t;o++)n[o]=e.charCodeAt(o);return n.buffer}function Pn(){return f(this,null,function*(){if(!pe()){console.info("webcrypto is not supported");return}let{crypto:r}=window,e=yield b(Xe);return e||r.getRandomValues(new Uint8Array(12))})}function wn(){return f(this,null,function*(){if(!pe()){console.info("webcrypto is not supported");return}let{subtle:r}=window.crypto,e=yield b(Be);return e||(yield r.generateKey({name:ze,length:bn},false,["encrypt","decrypt"]))})}function jt(r,e){return f(this,null,function*(){let t=yield Pn(),n=yield wn();if(!t||!n||!r)return;let o=Kt(r),{subtle:s}=window.crypto,i=yield s.encrypt({name:ze,iv:t},n,o),a=Gt(i);yield S(`${He}_${e}`,a),yield S(Be,n),yield S(Xe,t);})}function Vt(r){return f(this,null,function*(){let e=yield b(`${He}_${r}`),t=yield b(Xe),n=yield b(Be);if(!t||!e||!n||!pe())return;let{subtle:o}=window.crypto,s=yield o.decrypt({name:ze,iv:t},n,Kt(e));return Gt(s)})}function Ye(r,e){return e?new URL(r,e):new URL(r)}var Ne=class extends R{constructor(){super(...arguments);this.localForageIsLoggedInKey="magic_auth_is_logged_in";this.userLoggedOutCallbacks=[];}getIdToken(t){let n=u(this.sdk.testMode?_$1.GetIdTokenTestMode:_$1.GetIdToken,[t]);return this.request(n)}generateIdToken(t){let n=u(this.sdk.testMode?_$1.GenerateIdTokenTestMode:_$1.GenerateIdToken,[t]);return this.request(n)}getInfo(){let t=u(_$1.GetInfo,[]);return this.request(t)}isLoggedIn(){return x((t,n)=>f(this,null,function*(){try{let o=!1;this.sdk.useStorageCache&&(o=(yield b(this.localForageIsLoggedInKey))==="true",o&&t(!0));let s=u(this.sdk.testMode?_$1.IsLoggedInTestMode:_$1.IsLoggedIn),i=yield this.request(s);this.sdk.useStorageCache&&(i?S(this.localForageIsLoggedInKey,!0):k(this.localForageIsLoggedInKey),o&&!i&&this.emitUserLoggedOut(!0)),t(i);}catch(o){n(o);}}))}logout(){return k(this.localForageIsLoggedInKey),te(),x((t,n)=>f(this,null,function*(){try{let o=u(this.sdk.testMode?_$1.LogoutTestMode:_$1.Logout),s=yield this.request(o);this.sdk.useStorageCache&&this.emitUserLoggedOut(s),t(s);}catch(o){n(o);}}))}requestInfoWithUI(t){let n=u(_$1.RequestUserInfoWithUI,t?[t]:[]);return this.request(n)}showSettings(t){let{showUI:n=true}=t||{},o=u(this.sdk.testMode?_$1.UserSettingsTestMode:_$1.UserSettings,[t]),s=this.request(o);return !n&&s&&(s.on(W$1.SendNewPhoneNumber,i=>{this.createIntermediaryEvent(W$1.SendNewPhoneNumber,o.id)(i);}),s.on(W$1.SendOtpCode,i=>{this.createIntermediaryEvent(W$1.SendOtpCode,o.id)(i);}),s.on(W$1.StartEditPhoneNumber,()=>{this.createIntermediaryEvent(W$1.StartEditPhoneNumber,o.id)();}),s.on(W$1.Cancel,()=>{this.createIntermediaryEvent(W$1.Cancel,o.id)();}),s.on(O$1.VerifyEmailOtp,i=>{this.createIntermediaryEvent(O$1.VerifyEmailOtp,o.id)(i);})),s}recoverAccount(t){let{email:n,showUI:o}=t,s=u(this.sdk.testMode?_$1.RecoverAccountTestMode:_$1.RecoverAccount,[{email:n,showUI:o}]),i=this.request(s);return !o&&i&&(i.on(B$1.Cancel,()=>{this.createIntermediaryEvent(B$1.Cancel,s.id)();}),i.on(B$1.ResendSms,()=>{this.createIntermediaryEvent(B$1.ResendSms,s.id)();}),i.on(B$1.VerifyOtp,a=>{this.createIntermediaryEvent(B$1.VerifyOtp,s.id)(a);}),i.on(B$1.UpdateEmail,a=>{this.createIntermediaryEvent(B$1.UpdateEmail,s.id)(a);}),i.on(b$1.Cancel,()=>{this.createIntermediaryEvent(b$1.Cancel,s.id)();}),i.on(b$1.RetryWithNewEmail,a=>{this.createIntermediaryEvent(b$1.RetryWithNewEmail,s.id)(a);}),i.on(b$1.VerifyEmailOtp,a=>{this.createIntermediaryEvent(b$1.VerifyEmailOtp,s.id)(a);})),i}revealPrivateKey(){let t=u(_$1.RevealPK);return this.request(t)}getMetadata(){W({method:"user.getMetadata()",removalVersions:B,useInstead:"user.getInfo()"}).log();let t=u(this.sdk.testMode?_$1.GetMetadataTestMode:_$1.GetMetadata);return this.request(t)}onUserLoggedOut(t){this.userLoggedOutCallbacks.push(t);}enableMFA(t){let{showUI:n=true}=t,o=u(_$1.EnableMFA,[{showUI:n}]),s=this.request(o);return !n&&s&&(s.on(w.VerifyMFACode,i=>{this.createIntermediaryEvent(w.VerifyMFACode,o.id)(i);}),s.on(w.Cancel,()=>{this.createIntermediaryEvent(w.Cancel,o.id)();})),s}disableMFA(t){let{showUI:n=true}=t,o=u(_$1.DisableMFA,[{showUI:n}]),s=this.request(o);return !n&&s&&(s.on(D$1.VerifyMFACode,i=>{this.createIntermediaryEvent(D$1.VerifyMFACode,o.id)(i);}),s.on(D$1.LostDevice,i=>{this.createIntermediaryEvent(D$1.LostDevice,o.id)(i);}),s.on(D$1.Cancel,()=>{this.createIntermediaryEvent(D$1.Cancel,o.id)();})),s}emitUserLoggedOut(t){this.userLoggedOutCallbacks.forEach(n=>{n(t);});}};var Ae=class extends R{connectWithUI(e){let t=x((n,o)=>f(this,null,function*(){try{let s=u(_$1.Login,[q({enabledWallets:this.sdk.thirdPartyWallets.enabledWallets},e)]),i=this.request(s);this.sdk.thirdPartyWallets.eventListeners.forEach(({event:c,callback:l})=>{i.on(c,()=>l(s.id));}),i.on("id-token-created",c=>{t.emit("id-token-created",c);});let a=yield i;a.error&&o(a),n(a);}catch(s){o(s);}}));return t}showUI(e){return this.request(u(_$1.ShowUI,[e]))}showAddress(){return this.request(u(_$1.ShowAddress))}showSendTokensUI(){return this.request(u(_$1.ShowSendTokensUI))}showOnRamp(){return this.request(u(_$1.ShowOnRamp))}showNFTs(){return this.request(u(_$1.ShowNFTs))}showBalances(){return this.request(u(_$1.ShowBalances))}sendGaslessTransaction(e,t){return this.request(u(_$1.SendGaslessTransaction,[e,t]))}getInfo(){W({method:"wallet.getInfo()",removalVersions:B,useInstead:"user.getInfo()"}).log();let e=u(_$1.GetInfo,[]);return this.request(e)}disconnect(){W({method:"wallet.disconnect()",removalVersions:B,useInstead:"user.logout()"}).log(),te();let e=u(_$1.Disconnect);return this.request(e)}requestUserInfoWithUI(e){W({method:"wallet.requestUserInfoWithUI()",removalVersions:B,useInstead:"user.requestUserInfoWithUI()"}).log();let t=u(_$1.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}};var $e=class extends R{constructor(){super(...arguments);this.eventListeners=[];this.enabledWallets={};this.isConnected=false;}resetThirdPartyWalletState(){localStorage.removeItem(v.PROVIDER),localStorage.removeItem(v.ADDRESS),localStorage.removeItem(v.CHAIN_ID),this.isConnected=false;}requestOverride(t){if(t.method===_$1.Login)return this.resetThirdPartyWalletState(),super.request(t);if(t.method===_$1.GetInfo)return this.getInfo(t);if(t.method===_$1.IsLoggedIn)return this.isLoggedIn(t);if(t.method===_$1.Logout)return this.logout(t);switch(localStorage.getItem(v.PROVIDER)){case "web3modal":return this.web3modalRequest(t);default:return this.resetThirdPartyWalletState(),super.request(t)}}isLoggedIn(t){switch(localStorage.getItem(v.PROVIDER)){case "web3modal":return this.web3modalIsLoggedIn();default:return this.resetThirdPartyWalletState(),super.request(t)}}getInfo(t){switch(localStorage.getItem(v.PROVIDER)){case "web3modal":return this.web3modalGetInfo();default:return this.resetThirdPartyWalletState(),super.request(t)}}logout(t){let n=localStorage.getItem(v.PROVIDER);switch(this.resetThirdPartyWalletState(),n){case "web3modal":return this.web3modalLogout();default:return super.request(t)}}web3modalRequest(t){return x((n,o)=>{this.sdk.web3modal.modal.getWalletProvider().request(t).then(n).catch(o);})}web3modalIsLoggedIn(){return x(t=>{let n=this.sdk.web3modal.modal.getStatus();if(n==="connected"&&t(true),n==="disconnected"&&(this.resetThirdPartyWalletState(),t(false)),n==="reconnecting"){let o=this.sdk.web3modal.modal.subscribeProvider(({status:s})=>{s==="connected"&&(o(),t(true)),s==="disconnected"&&(o(),this.resetThirdPartyWalletState(),t(false));});}})}formatWeb3modalGetInfoResponse(){var o;let t=(o=this.sdk.web3modal.modal.getWalletInfo())==null?undefined:o.name,n=this.sdk.web3modal.modal.getAddress();return {publicAddress:n,email:null,issuer:`did:ethr:${n}`,phoneNumber:null,isMfaEnabled:false,recoveryFactors:[],walletType:t||"web3modal"}}web3modalGetInfo(){return x((t,n)=>{let o=this.sdk.web3modal.modal.getStatus();if(o==="connected"&&t(this.formatWeb3modalGetInfoResponse()),o==="disconnected"&&(this.resetThirdPartyWalletState(),n("Magic RPC Error: [-32603] Internal error: User denied account access.")),o==="reconnecting"){let s=this.sdk.web3modal.modal.subscribeProvider(({status:i})=>{i==="connected"&&(s(),t(this.formatWeb3modalGetInfoResponse())),i==="disconnected"&&(s(),this.resetThirdPartyWalletState(),n("Magic RPC Error: [-32603] Internal error: User denied account access."));});}})}web3modalLogout(){return x(t=>f(this,null,function*(){try{yield this.sdk.web3modal.modal.disconnect();}catch(n){console.error(n);}t(true);}))}};var{createBoundEmitterMethod:Le,createChainingEmitterMethod:se}=be(),Oe=class extends R{constructor(){super(...arguments);this.isMagic=true;this.on=se("on",this);this.once=se("once",this);this.addListener=se("addListener",this);this.off=se("off",this);this.removeListener=se("removeListener",this);this.removeAllListeners=se("removeAllListeners",this);this.emit=Le("emit");this.eventNames=Le("eventNames");this.listeners=Le("listeners");this.listenerCount=Le("listenerCount");}sendAsync(t,n){if(!n)throw xt({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:n===null?"null":typeof n});if(Array.isArray(t))this.overlay.post(g.MAGIC_HANDLE_REQUEST,t.map(o=>{let s=H(o);return this.prefixPayloadMethodForTestMode(s),s})).then(o=>{n(null,o.map(s=>z(q({},s.payload),{error:s.hasError?new _(s.payload.error):null})));});else {let o=H(t);this.prefixPayloadMethodForTestMode(o),this.overlay.post(g.MAGIC_HANDLE_REQUEST,o).then(s=>{n(s.hasError?new _(s.payload.error):null,s.payload);});}}send(t,n){if(typeof t=="string"){let s=u(t,Array.isArray(n)?n:[]);return this.request(s)}if(Array.isArray(t)||!!n){this.sendAsync(t,n);return}let o=Mt();return o.log(),new J(t).applyError({code:-32603,message:o.rawMessage}).payload}enable(){let t=u(_$1.Login);return this.request(t)}request(t){return this.prefixPayloadMethodForTestMode(t),super.request(t)}prefixPayloadMethodForTestMode(t){let n="testMode/eth/";this.sdk.testMode&&(t.method=`${n}${t.method}`);}};var Xt=["request","overlay","sdk"];function Mn(r){let e=Object.getPrototypeOf(r),t=[e];for(;e!==R.prototype;)e=Object.getPrototypeOf(e),t.push(e);return t}var _e=class extends R{constructor(){super(undefined);this.__sdk_access_field_descriptors__=new Map;this.__is_initialized__=false;this.utils={createPromiEvent:x,isPromiEvent:_t,encodeJSON:Re,decodeJSON:gt,createJsonRpcRequestPayload:u,standardizeJsonRpcRequestPayload:H,storage:ue};let t=[this,...Mn(this)];Xt.forEach(n=>{let o=t.map(c=>Object.getOwnPropertyDescriptor(c,n)),s=o.findIndex(c=>!!c),i=s>0,a=o[s];a&&(this.__sdk_access_field_descriptors__.set(n,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,n,{configurable:true,get:()=>{throw Pt(n)}}));});}init(t){this.__is_initialized__||(Xt.forEach(n=>{if(this.__sdk_access_field_descriptors__.has(n)){let{descriptor:o,isPrototypeField:s}=this.__sdk_access_field_descriptors__.get(n);s?delete this[n]:Object.defineProperty(this,n,o);}}),this.sdk=t,this.__is_initialized__=true);}createDeprecationWarning(t){let{method:n,removalVersion:o,useInstead:s}=t,i=s?` Use \`${s}\` instead.`:"",a=`\`${n}\` will be removed from this Extension in version \`${o}\`.${i}`;return new le(this,"DEPRECATION_NOTICE",a)}createWarning(t,n){return new le(this,t,n)}createError(t,n,o){return new Q(this,t,n,o)}},Qe=class extends _e{},D=class extends _e{};D.Internal=Qe,D.Anonymous="anonymous extension";var De=class extends R{purchase(e){let t=u(_$1.NFTPurchase,[e]);return this.request(t)}checkout(e){let t=this.sdk.thirdPartyWallets.isConnected,n=u(_$1.NFTCheckout,[z(q({},e),{walletProvider:t?"web3modal":"magic"})]),o=this.request(n);return t&&(o.on(P$1.Initiated,s=>f(this,null,function*(){try{let i=yield this.request({method:"eth_sendTransaction",params:[s]});this.createIntermediaryEvent(P$1.Success,n.id)(i);}catch(i){this.createIntermediaryEvent(P$1.Failure,n.id)();}})),o.on(P$1.Disconnect,()=>{this.sdk.thirdPartyWallets.resetThirdPartyWalletState(),o.emit("disconnect");})),o}transfer(e){let t=u(_$1.NFTTransfer,[e]);return this.request(t)}};function zt(r){return r.compat&&r.compat[m.sdkName]!=null?typeof r.compat[m.sdkName]=="string"?ft(Et(m.version),r.compat[m.sdkName]):!!r.compat[m.sdkName]:true}function Sn(r,e,t){return !e&&!t?`${r}_eth_mainnet`:t?`${r}_${JSON.stringify(t)}`:e?typeof e=="string"?`${r}_eth_${e}`:`${r}_${e.rpcUrl}_${e.chainId}_${e.chainType}`:`${r}_unknown`}function Nn(r){var o;let e=(o=r==null?undefined:r.extensions)!=null?o:[],t={},n=[];if(Array.isArray(e)?e.forEach(s=>{zt(s)?(s.init(this),(s.name||s.name!==D.Anonymous)&&(this[s.name]=s),s instanceof D.Internal&&(ce(s.config)||(t[s.name]=s.config))):n.push(s);}):Object.keys(e).forEach(s=>{if(zt(e[s])){e[s].init(this);let i=e[s];this[s]=i,i instanceof D.Internal&&(ce(i.config)||(t[e[s].name]=i.config));}else n.push(e[s]);}),n.length)throw wt(n);return t}var me=class{constructor(e,t){this.apiKey=e;var i;if(!e)throw It();m.platform==="react-native"&&(t==null?undefined:t.endpoint)&&St().log();let{defaultEndpoint:n,version:o}=m;this.testMode=!!(t!=null&&t.testMode),this.useStorageCache=!!(t!=null&&t.useStorageCache),this.endpoint=Ye((i=t==null?undefined:t.endpoint)!=null?i:n).origin,this.auth=new we(this),this.user=new Ne(this),this.wallet=new Ae(this),this.nft=new De(this),this.thirdPartyWallets=new $e(this),this.rpcProvider=new Oe(this);let s=Nn.call(this,t);this.parameters=Re(z(q({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?undefined:t.network,host:Ye(this.endpoint).host,sdk:vt[m.sdkName],version:o,ext:ce(s)?undefined:s,locale:(t==null?undefined:t.locale)||"en_US"},m.bundleId?{bundleId:m.bundleId}:{}),{meta:t==null?undefined:t.meta})),this.networkHash=Sn(this.apiKey,t==null?undefined:t.network,ce(s)?undefined:s),t!=null&&t.deferPreload||this.preload();}get overlay(){if(!me.__overlays__.has(this.parameters)){let e=new m.ViewController(this.endpoint,this.parameters,this.networkHash);e.init(),me.__overlays__.set(this.parameters,e);}return me.__overlays__.get(this.parameters)}preload(){return f(this,null,function*(){yield this.overlay.checkIsReadyForRequest;})}},qe=me;qe.__overlays__=new Map;function Cn(r,e){return e&&Array.isArray(r)?r.find(t=>t.id===e):r}function $n(r,e){var o;let t=(o=e.data.response)==null?undefined:o.id,n=Cn(r,t);if(t&&n){let s=new J(n).applyResult(e.data.response.result).applyError(e.data.response.error);return {id:t,response:s}}return {}}function Ln(r,e,t){return f(this,null,function*(){var a;let n=yield b("rt"),o;if(m.platform==="web")try{o=(a=yield b("jwt"))!=null?a:yield Wt();}catch(c){console.error("webcrypto error",c);}let s={msgType:r,payload:e};o&&(s.jwt=o),o&&n&&(s.rt=n);let i=yield Vt(t);return i&&(s.deviceShare=i),s})}function On(r){return f(this,null,function*(){!r.data.rt||(yield S("rt",r.data.rt));})}var et=class{constructor(e,t,n){this.endpoint=e;this.parameters=t;this.networkHash=n;this.messageHandlers=new Set;this.isConnectedToInternet=true;this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=false,this.listen();}post(e,t){return f(this,null,function*(){return Ke((n,o)=>f(this,null,function*(){if(!this.isConnectedToInternet){let d=Tt();o(d);}this.isReadyForRequest||(yield this.waitForReady());let s=[],i=Array.isArray(t)?t.map(d=>d.id):[],a=yield Ln(`${e}-${this.parameters}`,t,this.networkHash);yield this._post(a);let c=d=>p=>{var tt;let{id:M,response:v}=$n(t,p);if(On(p),((tt=v==null?undefined:v.payload.error)==null?undefined:tt.message)==="User denied account access.")te();else if(p.data.deviceShare){let{deviceShare:Yt}=p.data;jt(Yt,this.networkHash);}M&&v&&Array.isArray(t)&&i.includes(M)?(s.push(v),s.length===t.length&&(d(),n(s))):M&&v&&!Array.isArray(t)&&M===t.id&&(d(),n(v));},l=this.on(f$1.MAGIC_HANDLE_RESPONSE,c(()=>l()));}))})}on(e,t){let n=t.bind(window),o=s=>{s.data.msgType===`${e}-${this.parameters}`&&n(s);};return this.messageHandlers.add(o),()=>this.messageHandlers.delete(o)}waitForReady(){return new Promise(e=>{let t=this.on(f$1.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=true,e(),t();});setTimeout(()=>{this.isReadyForRequest=true,e(),t();},15e3);})}listen(){this.on(f$1.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay();}),this.on(f$1.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay();}),this.on(f$1.MAGIC_SEND_PRODUCT_ANNOUNCEMENT,e=>{e.data.response.result.product_announcement&&new F(l.ProductAnnouncement,e.data.response.result.product_announcement).log();});}};
|
|
8
|
+
|
|
9
|
+
export { D as Extension, Q as MagicExtensionError, le as MagicExtensionWarning, _ as MagicRPCError, C as MagicSDKError, F as MagicSDKWarning, qe as SDKBase, Ve as STORE_KEY_PRIVATE_KEY, Me as STORE_KEY_PUBLIC_JWK, Ge as TypedEmitter, et as ViewController, W as createDeprecationWarning, Xn as createDuplicateIframeWarning, Pt as createExtensionNotInitializedError, wt as createIncompatibleExtensionsError, xt as createInvalidArgumentError, Wt as createJwt, bt as createMalformedResponseError, It as createMissingApiKeyError, Tt as createModalNotReadyError, x as createPromiEvent, Ke as createPromise, St as createReactNativeEndpointConfigurationWarning, Qr as createSDK, Mt as createSynchronousWeb3MethodWarning, be as createTypedEmitter, Ye as createURL, gt as decodeJSON, Re as encodeJSON, We as getPayloadId, ce as isEmpty, Rt as isJsonRpcErrorCode, yt as isJsonRpcResponsePayload, kt as isMajorVersionAtLeast, _t as isPromiEvent, pe as isWebCryptoSupported, ue as storage, qt as uuid };
|
|
10
|
+
//# sourceMappingURL=index.js.map
|