magic-sdk
Advanced tools
Comparing version 2.2.0-alpha.0 to 2.2.1-alpha.0
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Magic=e()}(this,function(){function t(){return(t=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o,i,a,s,c,u,l;n(function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new b(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=_(a,r);if(s){if(s===u)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=c(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,i),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var u={};function l(){}function f(){}function d(){}var h={};h[o]=function(){return this};var p=Object.getPrototypeOf,v=p&&p(p(A([])));v&&v!==e&&r.call(v,o)&&(h=v);var y=d.prototype=l.prototype=Object.create(h);function m(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e(function(n,a){!function n(o,i,a,s){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then(function(t){n("next",t,a,s)},function(t){n("throw",t,a,s)}):e.resolve(f).then(function(t){l.value=t,a(l)},function(t){return n("throw",t,a,s)})}s(u.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}}function _(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,u;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function b(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return f.prototype=y.constructor=d,d.constructor=f,d[a]=f.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},m(g.prototype),g.prototype[i]=function(){return this},t.AsyncIterator=g,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new g(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),y[a]="Generator",y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=A,b.prototype={constructor:b,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}),function(t){t.LoginWithMagicLink="magic_auth_login_with_magic_link",t.GetIdToken="magic_auth_get_id_token",t.GenerateIdToken="magic_auth_generate_id_token",t.GetMetadata="magic_auth_get_metadata",t.IsLoggedIn="magic_auth_is_logged_in",t.Logout="magic_auth_logout",t.UpdateEmail="magic_auth_update_email"}(o||(o={})),function(t){t.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",t.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",t.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",t.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",t.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT"}(i||(i={})),function(t){t.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST"}(a||(a={})),function(t){t.MissingApiKey="MISSING_API_KEY",t.ModalNotReady="MODAL_NOT_READY",t.MalformedResponse="MALFORMED_RESPONSE",t.InvalidArgument="INVALID_ARGUMENT",t.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED"}(s||(s={})),function(t){t.SyncWeb3Method="SYNC_WEB3_METHOD",t.DuplicateIframe="DUPLICATE_IFRAME",t.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",t.DeprecationNotice="DEPRECATION_NOTICE"}(c||(c={})),function(t){t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",t[t.MagicLinkExpired=-10001]="MagicLinkExpired",t[t.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",t[t.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",t[t.UpdateEmailFailed=-10004]="UpdateEmailFailed"}(u||(u={})),function(t){t.Harmony="HARMONY"}(l||(l={}));var f={__proto__:null,get EthChainType(){return l},get MagicIncomingWindowMessage(){return i},get MagicOutgoingWindowMessage(){return a},get MagicPayloadMethod(){return o},get RPCErrorCode(){return u},get SDKErrorCode(){return s},get SDKWarningCode(){return c}},d=n(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function o(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(t,e,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||t,a),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var t,n,o=[];if(0===this._eventsCount)return o;for(n in t=this._events)e.call(t,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},s.prototype.listeners=function(t){var e=this._events[r?r+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,o=e.length,i=new Array(o);n<o;n++)i[n]=e[n].fn;return i},s.prototype.listenerCount=function(t){var e=this._events[r?r+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,n,o,i,a){var s=r?r+t:t;if(!this._events[s])return!1;var c,u,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,o),!0;case 5:return l.fn.call(l.context,e,n,o,i),!0;case 6:return l.fn.call(l.context,e,n,o,i,a),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var d,h=l.length;for(u=0;u<h;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,n);break;case 4:l[u].fn.call(l[u].context,e,n,o);break;default:if(!c)for(d=1,c=new Array(f-1);d<f;d++)c[d-1]=arguments[d];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(t,e,r){return i(this,t,e,r,!1)},s.prototype.once=function(t,e,r){return i(this,t,e,r,!0)},s.prototype.removeListener=function(t,e,n,o){var i=r?r+t:t;if(!this._events[i])return this;if(!e)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==e||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==e||o&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=r?r+t:t]&&a(this,e):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,t.exports=s});function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function p(t,e,r){return e&&h(t.prototype,e),r&&h(t,r),t}function v(){return(v=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function y(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function E(t,e,r){return(E=_()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&g(o,r.prototype),o}).apply(null,arguments)}function w(t){var e="function"==typeof Map?new Map:void 0;return(w=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return E(t,arguments,m(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),g(r,t)})(t)}function b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A(t){return void 0===t}function I(t){return function(t){return null===t}(t)||A(t)}function O(t){if(!t)return!0;for(var e in t)if(Object.hasOwnProperty.call(t,e))return!1;return!0}var L={},M=function(t){function e(r,n){var o;return(o=t.call(this,"Magic SDK Error: ["+r+"] "+n)||this).code=r,o.rawMessage=n,o.__proto__=Error,Object.setPrototypeOf(b(o),e.prototype),o}return y(e,t),e}(w(Error)),P=function(t){function e(r,n,o,i){var a;return(a=t.call(this,"Magic Extension Error ("+r.name+"): ["+n+"] "+o)||this).code=n,a.rawMessage=o,a.data=i,a.__proto__=Error,Object.setPrototypeOf(b(a),e.prototype),a}return y(e,t),e}(w(Error)),N=function(){function t(t,e,r){this.code=e,this.rawMessage=r,this.message="Magic Extension Error ("+t.name+"): ["+e+"] "+r}return t.prototype.log=function(){console.warn(this.message)},t}(),x=function(t){function e(r){var n;(n=t.call(this)||this).__proto__=Error;var o=Number(null==r?void 0:r.code);return n.rawMessage=(null==r?void 0:r.message)||"Internal error",n.code=function(t){return!I(t)&&"number"==typeof t&&Object.values(u).includes(t)}(o)?o:u.InternalError,n.message="Magic RPC Error: ["+n.code+"] "+n.rawMessage,Object.setPrototypeOf(b(n),e.prototype),n}return y(e,t),e}(w(Error)),R=function(){function t(t,e){this.code=t,this.rawMessage=e,this.message="Magic SDK Warning: ["+t+"] "+e}return t.prototype.log=function(){console.warn(this.message)},t}();function S(t){var e=t.useInstead,r={"magic-sdk":"magic-sdk","magic-sdk-rn":"@magic-sdk/react-native"}[L.sdkName];return new R(c.DeprecationNotice,"`"+t.method+"` will be removed from `"+r+"` in version `"+t.removalVersions[r]+"`."+(e?" Use `"+e+"` instead.":""))}function k(t){return btoa(JSON.stringify(t))}function j(t){return JSON.parse(atob(t))}function C(t){return S({method:"encodeQueryParameters()",removalVersions:{"magic-sdk":"v3.0.0","@magic-sdk/react-native":"v3.0.0"},useInstead:"encodeJSON()"}).log(),btoa(JSON.stringify(t))}function T(t){return S({method:"decodeQueryParameters()",removalVersions:{"magic-sdk":"v3.0.0","@magic-sdk/react-native":"v3.0.0"},useInstead:"decodeJSON()"}).log(),JSON.parse(atob(t))}var D=regeneratorRuntime.mark(G);function G(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<Number.MAX_SAFE_INTEGER)){e.next=7;break}return e.next=5,++t;case 5:e.next=8;break;case 7:t=0;case 8:e.next=1;break;case 10:case"end":return e.stop()}},D)}var H=G();function U(){return H.next().value}var Q=Symbol("Payload pre-processed by Magic SDK");function V(t){return Object.defineProperty(t,Q,{value:!0,enumerable:!1}),t}function W(t){var e,r,n;return function(t){return!!t[Q]}(t)||(t.jsonrpc=null!=(e=t.jsonrpc)?e:"2.0",t.id=U(),t.method=null!=(r=t.method)?r:"noop",t.params=null!=(n=t.params)?n:[],V(t)),t}function F(t,e){return void 0===e&&(e=[]),V({params:e,method:t,jsonrpc:"2.0",id:U()})}var Y=function(){function t(e){e instanceof t?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):function(t){return!I(t)&&!(A(t.jsonrpc)||A(t.id)||A(t.result)&&A(t.error))}(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=void 0,this._error=void 0)}var e=t.prototype;return e.applyError=function(t){return this._error=t,this},e.applyResult=function(t){return this._result=t,this},p(t,[{key:"hasError",get:function(){return null!=this._error}},{key:"hasResult",get:function(){return void 0!==this._result}},{key:"payload",get:function(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}}]),t}(),q=function(t){function e(){return t.apply(this,arguments)||this}return y(e,t),e}(d);function K(){var t=new q;return{emitter:t,createChainingEmitterMethod:function(e,r){return function(){return t[e].apply(t,[].slice.call(arguments)),r}},createBoundEmitterMethod:function(e){return function(){return t[e].apply(t,[].slice.call(arguments))}}}}var z=Symbol("isPromiEvent");function J(t){var e=B(t),r=K(),n=r.createBoundEmitterMethod,o=r.createChainingEmitterMethod,i=Symbol("Promise.then"),a=Symbol("Promise.catch"),s=Symbol("Promise.finally"),c=function(t,e){return function(){var r=e[t].apply(e,[].slice.call(arguments));return u(r)}},u=function(t){var e;return Object.assign(t,((e={})[z]=!0,e[i]=t[i]||t.then,e[a]=t[a]||t.catch,e[s]=t[s]||t.finally,e.then=c(i,t),e.catch=c(a,t),e.finally=c(s,t),e.on=o("on",t),e.once=o("once",t),e.addListener=o("addListener",t),e.off=o("off",t),e.removeListener=o("removeListener",t),e.removeAllListeners=o("removeAllListeners",t),e.emit=n("emit"),e.eventNames=n("eventNames"),e.listeners=n("listeners"),e.listenerCount=n("listenerCount"),e))},l=u(e.then(function(t){return l.emit("done",t),l.emit("settled"),t},function(t){throw l.emit("error",t),l.emit("settled"),t}));return l}function B(t){return new Promise(function(e,r){var n=t(e,r);Promise.resolve(n).catch(r)})}var X=function(){function t(t){this.sdk=t}return t.prototype.request=function(t){var e=this.transport.post(this.overlay,a.MAGIC_HANDLE_REQUEST,W(t)),r=J(function(t,r){e.then(function(e){if(n(),e.hasError)r(new x(e.payload.error));else{if(!e.hasResult)throw new M(s.MalformedResponse,"Response from the Magic iframe is malformed.");t(e.payload.result)}}).catch(function(t){n(),r(t)})}),n=this.transport.on(i.MAGIC_HANDLE_EVENT,function(e){var n,o=e.data.response;if(o.id===t.id&&(null===(n=o.result)||void 0===n?void 0:n.event)){var i=o.result,a=i.params;r.emit.apply(r,[i.event].concat(void 0===a?[]:a))}});return r},p(t,[{key:"transport",get:function(){return this.sdk.transport}},{key:"overlay",get:function(){return this.sdk.overlay}}]),t}(),Z=function(t){function e(){return t.apply(this,arguments)||this}return y(e,t),e.prototype.loginWithMagicLink=function(t){var e=t.showUI,r=F(o.LoginWithMagicLink,[{email:t.email,showUI:void 0===e||e}]);return this.request(r)},e}(X),$=function(t){function e(){return t.apply(this,arguments)||this}y(e,t);var r=e.prototype;return r.getIdToken=function(t){var e=F(o.GetIdToken,[t]);return this.request(e)},r.generateIdToken=function(t){var e=F(o.GenerateIdToken,[t]);return this.request(e)},r.getMetadata=function(){var t=F(o.GetMetadata);return this.request(t)},r.updateEmail=function(t){var e=t.showUI,r=F(o.UpdateEmail,[{email:t.email,showUI:void 0===e||e}]);return this.request(r)},r.isLoggedIn=function(){var t=F(o.IsLoggedIn);return this.request(t)},r.logout=function(){var t=F(o.Logout);return this.request(t)},e}(X),tt=K(),et=tt.createBoundEmitterMethod,rt=tt.createChainingEmitterMethod,nt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).isMagic=!0,e.on=rt("on",b(e)),e.once=rt("once",b(e)),e.addListener=rt("addListener",b(e)),e.off=rt("off",b(e)),e.removeListener=rt("removeListener",b(e)),e.removeAllListeners=rt("removeAllListeners",b(e)),e.emit=et("emit"),e.eventNames=et("eventNames"),e.listeners=et("listeners"),e.listenerCount=et("listenerCount"),e}y(e,t);var r=e.prototype;return r.sendAsync=function(t,e){if(!e)throw function(t){var e,r,n;return new M(s.InvalidArgument,"Invalid "+(n=(e=t.argument+1)%100,(1==(r=e%10)&&11!==n?e+"st":2===r&&12!==n?e+"nd":3===r&&13!==n?e+"rd":e+"th")+" argument given to `")+t.procedure+"`.\n Expected: `"+t.expected+"`\n Received: `"+t.received+"`")}({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===e?"null":typeof e});if(Array.isArray(t))this.transport.post(this.overlay,a.MAGIC_HANDLE_REQUEST,t.map(function(t){return W(t)})).then(function(t){e(null,t.map(function(t){return v({},t.payload,{error:t.hasError?new x(t.payload.error):null})}))});else{var r=W(t);this.transport.post(this.overlay,a.MAGIC_HANDLE_REQUEST,r).then(function(t){e(t.hasError?new x(t.payload.error):null,t.payload)})}},r.send=function(t,e){if("string"==typeof t){var r=F(t,Array.isArray(e)?e:[]);return this.request(r)}if(!Array.isArray(t)&&!e){var n=new R(c.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.");return n.log(),new Y(t).applyError({code:-32603,message:n.rawMessage}).payload}this.sendAsync(t,e)},r.enable=function(){var t=F("eth_accounts");return this.request(t)},e}(X);function ot(t,e){return e?new URL(t,e):new URL(t)}var it=function(t){function e(){var e;(e=t.call(this,void 0)||this).isInitialized=!1,e.utils={createPromiEvent:J,encodeJSON:k,decodeJSON:j,encodeQueryParameters:C,decodeQueryParameters:T,createJsonRpcRequestPayload:F,standardizeJsonRpcRequestPayload:W};var r=["request","transport","overlay","sdk"];return new Proxy(b(e),{get:function(t,n,o){if(r.includes(n)&&!e.isInitialized)throw function(t){return new M(s.ExtensionNotInitialized,"Extensions must be initialized with a Magic SDK instance before `Extension."+t+"` can be accessed. Do not invoke `Extension."+t+"` inside an extension constructor.")}(n);return Reflect.get(t,n,o)}})||b(e)}y(e,t);var r=e.prototype;return r.init=function(t){this.isInitialized||(this.sdk=t,this.isInitialized=!0)},r.createDeprecationWarning=function(t){var e=t.useInstead;return new N(this,"DEPRECATION_NOTICE","`"+t.method+"` will be removed from this Extension in version `"+t.removalVersion+"`."+(e?" Use `"+e+"` instead.":""))},r.createWarning=function(t,e){return new N(this,t,e)},r.createError=function(t,e,r){return new P(this,t,e,r)},r.raiseError=function(t,e,r){throw new P(this,t,e,r)},e}(X),at=function(t){function e(){return t.apply(this,arguments)||this}return y(e,t),e}(it),st=function(t){function e(){return t.apply(this,arguments)||this}return y(e,t),e}(it);st.Internal=at;var ct=function(){function t(t,e){var r,n,o=this;if(this.apiKey=t,!t)throw new M(s.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.");"react-native"===L.target&&(null==e?void 0:e.endpoint)&&new R(c.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 `"+L.defaultEndpoint+"`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.").log();var i=L.version;this.endpoint=ot(null!=(r=null==e?void 0:e.endpoint)?r:L.defaultEndpoint).origin,this.auth=new Z(this),this.user=new $(this),this.rpcProvider=new nt(this);var a=null!=(n=null==e?void 0:e.extensions)?n:[],u={};Array.isArray(a)?a.forEach(function(t){t.init(o),o[t.name]=t,t instanceof st.Internal&&(O(t.config)||(u[t.name]=t.config))}):Object.keys(a).forEach(function(t){a[t].init(o);var e=a[t];o[t]=e,e instanceof st.Internal&&(O(e.config)||(u[a[t].name]=e.config))}),this.encodedQueryParams=k({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==e?void 0:e.network,host:ot(this.endpoint).host,sdk:L.sdkName,version:i,ext:O(u)?void 0:u})}return t.prototype.preload=function(){try{return Promise.resolve(this.overlay.ready).then(function(){})}catch(t){return Promise.reject(t)}},p(t,[{key:"transport",get:function(){return t.__transports__.has(this.encodedQueryParams)||t.__transports__.set(this.encodedQueryParams,new L.PayloadTransport(this.endpoint,this.encodedQueryParams)),t.__transports__.get(this.encodedQueryParams)}},{key:"overlay",get:function(){if(!t.__overlays__.has(this.encodedQueryParams)){var e=new L.ViewController(this.transport,this.endpoint,this.encodedQueryParams);t.__overlays__.set(this.encodedQueryParams,e)}return t.__overlays__.get(this.encodedQueryParams)}}]),t}();ct.__transports__=new Map,ct.__overlays__=new Map;var ut,lt=function(){function t(t,e){this.endpoint=t,this.encodedQueryParams=e,this.messageHandlers=new Set,this.init()}var e=t.prototype;return e.post=function(t,e,r){try{var n=this;return Promise.resolve(B(function(o){try{return Promise.resolve(t.ready).then(function(){var a=[],s=Array.isArray(r)?r.map(function(t){return t.id}):[];return Promise.resolve(t.postMessage({msgType:e+"-"+n.encodedQueryParams,payload:r})).then(function(){var t,e=n.on(i.MAGIC_HANDLE_RESPONSE,(t=function(){return e()},function(e){var n=function(t,e){var r,n=null===(r=e.data.response)||void 0===r?void 0:r.id,o=function(t,e){return e&&Array.isArray(t)?t.find(function(t){return t.id===e}):t}(t,n);return n&&o?{id:n,response:new Y(o).applyResult(e.data.response.result).applyError(e.data.response.error)}:{}}(r,e),i=n.id,c=n.response;i&&c&&Array.isArray(r)&&s.includes(i)?(a.push(c),a.length===r.length&&(t(),o(a))):i&&c&&!Array.isArray(r)&&i===r.id&&(t(),o(c))}))})})}catch(t){return Promise.reject(t)}}))}catch(t){return Promise.reject(t)}},e.on=function(t,e){var r=this,n=e.bind(window),o=function(e){e.data.msgType===t+"-"+r.encodedQueryParams&&n(e)};return this.messageHandlers.add(o),function(){return r.messageHandlers.delete(o)}},t}(),ft=function(){function t(t,e,r){this.transport=t,this.endpoint=e,this.encodedQueryParams=r,this.ready=this.waitForReady(),this.init&&this.init(),this.listen()}var e=t.prototype;return e.waitForReady=function(){var t=this;return new Promise(function(e){t.transport.on(i.MAGIC_OVERLAY_READY,function(){return e()})})},e.listen=function(){var t=this;this.transport.on(i.MAGIC_HIDE_OVERLAY,function(){t.hideOverlay()}),this.transport.on(i.MAGIC_SHOW_OVERLAY,function(){t.showOverlay()})},t}(),dt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},ht=function(t){function r(){return t.apply(this,arguments)||this}e(r,t);var n=r.prototype;return n.init=function(){this.iframe=this.createIframe()},n.createIframe=function(){var t=this;return new Promise(function(e){var r=function(){if(n=encodeURIComponent(t.encodedQueryParams),o=[].slice.call(document.querySelectorAll(".magic-iframe")),Boolean(o.find(function(t){return t.src.includes(n)})))new R(c.DuplicateIframe,"Duplicate iframes found.").log();else{var r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=ot(t.endpoint).host,r.src=ot("/send?params="+encodeURIComponent(t.encodedQueryParams),t.endpoint).href,function(t){for(var e=0,r=Object.entries(dt);e<r.length;e++){var n=r[e];t.style[n[0]]=n[1]}}(r),document.body.appendChild(r),e(r)}var n,o};["loaded","interactive","complete"].includes(document.readyState)?r():window.addEventListener("load",r,!1)})},n.showOverlay=function(){try{return Promise.resolve(this.iframe).then(function(t){t.style.display="block"})}catch(t){return Promise.reject(t)}},n.hideOverlay=function(){try{return Promise.resolve(this.iframe).then(function(t){t.style.display="none"})}catch(t){return Promise.reject(t)}},n.postMessage=function(t){try{return Promise.resolve(this.iframe).then(function(e){if(!e||!e.contentWindow)throw new M(s.ModalNotReady,"Modal is not ready.");e.contentWindow.postMessage(t,"*")})}catch(t){return Promise.reject(t)}},r}(ft),pt=(ut=ct,Object.assign(L,{target:"web",sdkName:"magic-sdk",version:"2.1.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ht,PayloadTransport:function(t){function n(){return t.apply(this,arguments)||this}return e(n,t),n.prototype.init=function(){var t=this;window.addEventListener("message",function(e){if(e.origin===t.endpoint&&e.data&&e.data.msgType&&t.messageHandlers.size){var n;e.data.response=null!=(n=e.data.response)?n:{};for(var o,i=function(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,void 0):void 0}}(t))){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}(t.messageHandlers.values());!(o=i()).done;)(0,o.value)(e)}})},n}(lt)}),ut);return Object.assign(pt,t({},f,{SDKError:M,ExtensionError:P,ExtensionWarning:N,RPCError:x,SDKWarning:R,Extension:st})),pt}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Magic=t()}(this,function(){function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(e,t){return e(t={exports:{}},t.exports),t.exports}var o,i,a,s,u,c,l;n(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r,n){var o=Object.create((t&&t.prototype instanceof l?t:l).prototype),i=new b(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=_(a,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,i),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function l(){}function f(){}function h(){}var d={};d[o]=function(){return this};var p=Object.getPrototypeOf,v=p&&p(p(A([])));v&&v!==t&&r.call(v,o)&&(d=v);var y=h.prototype=l.prototype=Object.create(d);function g(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function m(e,t){var n;this._invoke=function(o,i){function a(){return new t(function(n,a){!function n(o,i,a,s){var c=u(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then(function(e){n("next",e,a,s)},function(e){n("throw",e,a,s)}):t.resolve(f).then(function(e){l.value=e,a(l)},function(e){return n("throw",e,a,s)})}s(c.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}}function _(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,c;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function b(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return f.prototype=y.constructor=h,h.constructor=f,h[a]=f.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},g(m.prototype),m.prototype[i]=function(){return this},e.AsyncIterator=m,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new m(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),y[a]="Generator",y[o]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=A,b.prototype={constructor:b,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}),function(e){e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.WebAuthnRegistrationStart="magic_auth_webauthn_registration_start",e.RegisterWithWebAuth="magic_auth_webauthn_register",e.LoginWithWebAuthn="magic_auth_login_with_web_authn",e.WebAuthnLoginVerfiy="magic_auth_login_with_webauthn_verify",e.GetWebAuthnInfo="magic_user_get_webauthn_credentials",e.UpdateWebAuthnInfo="magic_user_update_webauthn",e.UnregisterWebAuthDevice="magic_user_unregister_webauthn",e.RegisterWebAuthDeviceStart="magic_auth_register_webauthn_device_start",e.RegisterWebAuthDevice="magic_auth_register_webauthn_device"}(o||(o={})),function(e){e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT"}(i||(i={})),function(e){e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST"}(a||(a={})),function(e){e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.WebAuthnNotSupported="WEBAUTHN_NOT_SUPPORTED",e.WebAuthnCreateCredentialError="WEBAUTHN_CREATE_CREDENTIAL_ERROR"}(s||(s={})),function(e){e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE"}(u||(u={})),function(e){e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed"}(c||(c={})),function(e){e.Harmony="HARMONY"}(l||(l={}));var f={__proto__:null,get EthChainType(){return l},get MagicIncomingWindowMessage(){return i},get MagicOutgoingWindowMessage(){return a},get MagicPayloadMethod(){return o},get RPCErrorCode(){return c},get SDKErrorCode(){return s},get SDKWarningCode(){return u}},h=n(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=this._events[r?r+e:e];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,o=t.length,i=new Array(o);n<o;n++)i[n]=t[n].fn;return i},s.prototype.listenerCount=function(e){var t=this._events[r?r+e:e];return t?t.fn?1:t.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,o),!0;case 5:return l.fn.call(l.context,t,n,o,i),!0;case 6:return l.fn.call(l.context,t,n,o,i,a),!0}for(c=1,u=new Array(f-1);c<f;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,d=l.length;for(c=0;c<d;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),f){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,n);break;case 4:l[c].fn.call(l[c].context,t,n,o);break;default:if(!u)for(h=1,u=new Array(f-1);h<f;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||o&&!s[u].once||n&&s[u].context!==n)&&c.push(s[u]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?this._events[t=r?r+e:e]&&a(this,t):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s});function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,r){return t&&d(e.prototype,t),r&&d(e,r),e}function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function w(e,t,r){return(w=_()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&m(o,r.prototype),o}).apply(null,arguments)}function E(e){var t="function"==typeof Map?new Map:void 0;return(E=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return w(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),m(r,e)})(e)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e){return void 0===e}function I(e){return function(e){return null===e}(e)||A(e)}function O(e){if(!e)return!0;for(var t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var P={},L=function(e){function t(r,n){var o;return(o=e.call(this,"Magic SDK Error: ["+r+"] "+n)||this).code=r,o.rawMessage=n,o.__proto__=Error,Object.setPrototypeOf(b(o),t.prototype),o}return y(t,e),t}(E(Error)),M=function(e){function t(r,n,o,i){var a;return(a=e.call(this,"Magic Extension Error ("+r.name+"): ["+n+"] "+o)||this).code=n,a.rawMessage=o,a.data=i,a.__proto__=Error,Object.setPrototypeOf(b(a),t.prototype),a}return y(t,e),t}(E(Error)),N=function(){function e(e,t,r){this.code=t,this.rawMessage=r,this.message="Magic Extension Error ("+e.name+"): ["+t+"] "+r}return e.prototype.log=function(){console.warn(this.message)},e}(),R=function(e){function t(r){var n;(n=e.call(this)||this).__proto__=Error;var o=Number(null==r?void 0:r.code);return n.rawMessage=(null==r?void 0:r.message)||"Internal error",n.code=function(e){return!I(e)&&"number"==typeof e&&Object.values(c).includes(e)}(o)?o:c.InternalError,n.message="Magic RPC Error: ["+n.code+"] "+n.rawMessage,Object.setPrototypeOf(b(n),t.prototype),n}return y(t,e),t}(E(Error)),x=function(){function e(e,t){this.code=e,this.rawMessage=t,this.message="Magic SDK Warning: ["+e+"] "+t}return e.prototype.log=function(){console.warn(this.message)},e}();function S(){return new L(s.WebAuthnNotSupported,"WebAuthn is not supported in this device.")}function C(e){return new L(s.WebAuthnCreateCredentialError,"Error creating credential: "+e)}function k(e){var t=e.useInstead,r={"magic-sdk":"magic-sdk","magic-sdk-rn":"@magic-sdk/react-native"}[P.sdkName];return new x(u.DeprecationNotice,"`"+e.method+"` will be removed from `"+r+"` in version `"+e.removalVersions[r]+"`."+(t?" Use `"+t+"` instead.":""))}function j(e){return btoa(JSON.stringify(e))}function D(e){return JSON.parse(atob(e))}function T(e){return k({method:"encodeQueryParameters()",removalVersions:{"magic-sdk":"v3.0.0","@magic-sdk/react-native":"v3.0.0"},useInstead:"encodeJSON()"}).log(),btoa(JSON.stringify(e))}function W(e){return k({method:"decodeQueryParameters()",removalVersions:{"magic-sdk":"v3.0.0","@magic-sdk/react-native":"v3.0.0"},useInstead:"decodeJSON()"}).log(),JSON.parse(atob(e))}var G=regeneratorRuntime.mark(U);function U(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<Number.MAX_SAFE_INTEGER)){t.next=7;break}return t.next=5,++e;case 5:t.next=8;break;case 7:e=0;case 8:t.next=1;break;case 10:case"end":return t.stop()}},G)}var H=U();function q(){return H.next().value}var V=Symbol("Payload pre-processed by Magic SDK");function Q(e){return Object.defineProperty(e,V,{value:!0,enumerable:!1}),e}function K(e){var t,r,n;return function(e){return!!e[V]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=q(),e.method=null!=(r=e.method)?r:"noop",e.params=null!=(n=e.params)?n:[],Q(e)),e}function F(e,t){return void 0===t&&(t=[]),Q({params:t,method:e,jsonrpc:"2.0",id:q()})}var Y=function(){function e(t){t instanceof e?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):function(e){return!I(e)&&!(A(e.jsonrpc)||A(e.id)||A(e.result)&&A(e.error))}(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}var t=e.prototype;return t.applyError=function(e){return this._error=e,this},t.applyResult=function(e){return this._result=e,this},p(e,[{key:"hasError",get:function(){return null!=this._error}},{key:"hasResult",get:function(){return void 0!==this._result}},{key:"payload",get:function(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}}]),e}(),J=function(e){function t(){return e.apply(this,arguments)||this}return y(t,e),t}(h);function z(){var e=new J;return{emitter:e,createChainingEmitterMethod:function(t,r){return function(){return e[t].apply(e,[].slice.call(arguments)),r}},createBoundEmitterMethod:function(t){return function(){return e[t].apply(e,[].slice.call(arguments))}}}}var B=Symbol("isPromiEvent");function X(e){var t=Z(e),r=z(),n=r.createBoundEmitterMethod,o=r.createChainingEmitterMethod,i=Symbol("Promise.then"),a=Symbol("Promise.catch"),s=Symbol("Promise.finally"),u=function(e,t){return function(){var r=t[e].apply(t,[].slice.call(arguments));return c(r)}},c=function(e){var t;return Object.assign(e,((t={})[B]=!0,t[i]=e[i]||e.then,t[a]=e[a]||e.catch,t[s]=e[s]||e.finally,t.then=u(i,e),t.catch=u(a,e),t.finally=u(s,e),t.on=o("on",e),t.once=o("once",e),t.addListener=o("addListener",e),t.off=o("off",e),t.removeListener=o("removeListener",e),t.removeAllListeners=o("removeAllListeners",e),t.emit=n("emit"),t.eventNames=n("eventNames"),t.listeners=n("listeners"),t.listenerCount=n("listenerCount"),t))},l=c(t.then(function(e){return l.emit("done",e),l.emit("settled"),e},function(e){throw l.emit("error",e),l.emit("settled"),e}));return l}function Z(e){return new Promise(function(t,r){var n=e(t,r);Promise.resolve(n).catch(r)})}var $=function(){function e(e){this.sdk=e}return e.prototype.request=function(e){var t=this.transport.post(this.overlay,a.MAGIC_HANDLE_REQUEST,K(e)),r=X(function(e,r){t.then(function(t){if(n(),t.hasError)r(new R(t.payload.error));else{if(!t.hasResult)throw new L(s.MalformedResponse,"Response from the Magic iframe is malformed.");e(t.payload.result)}}).catch(function(e){n(),r(e)})}),n=this.transport.on(i.MAGIC_HANDLE_EVENT,function(t){var n,o=t.data.response;if(o.id===e.id&&(null===(n=o.result)||void 0===n?void 0:n.event)){var i=o.result,a=i.params;r.emit.apply(r,[i.event].concat(void 0===a?[]:a))}});return r},p(e,[{key:"transport",get:function(){return this.sdk.transport}},{key:"overlay",get:function(){return this.sdk.overlay}}]),e}();function ee(e){var t,r,n,o,i=e.length%3,a="";function s(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,n=e.length-i;t<n;t+=3)a+=s((o=r=(e[t]<<16)+(e[t+1]<<8)+e[t+2])>>18&63)+s(o>>12&63)+s(o>>6&63)+s(63&o);switch(i){case 1:a+=s((r=e[e.length-1])>>2),a+=s(r<<4&63),a+="==";break;case 2:a+=s((r=(e[e.length-2]<<8)+e[e.length-1])>>10),a+=s(r>>4&63),a+=s(r<<2&63),a+="="}return a}function te(e){return ee(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function re(e){return ee(e).replace(/\+/g,"-").replace(/\//g,"_")}var ne=function(e){var t=new Uint8Array(e.response.attestationObject),r=new Uint8Array(e.response.clientDataJSON),n=new Uint8Array(e.rawId),o=e.getClientExtensionResults();return{id:e.id,rawId:te(n),type:e.type,attObj:te(t),clientData:te(r),registrationClientExtensions:JSON.stringify(o)}};function oe(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}var ie=function(e){function t(){return e.apply(this,arguments)||this}y(t,e);var r=t.prototype;return r.loginWithMagicLink=function(e){var t=e.showUI,r=F(o.LoginWithMagicLink,[{email:e.email,showUI:void 0===t||t}]);return this.request(r)},r.registerWithWebAuthn=function(e){try{var t=this;if(!window.PublicKeyCredential)throw S();var r=e.nickname,n=void 0===r?"":r;return Promise.resolve(t.request(F(o.WebAuthnRegistrationStart,[{username:e.username}]))).then(function(e){var r;function i(i){return t.request(F(o.RegisterWithWebAuth,[{id:e.id,nickname:n,transport:r.response.getTransports(),user_agent:navigator.userAgent,registration_response:ne(r)}]))}var a=oe(function(){return Promise.resolve(navigator.credentials.create({publicKey:e.credential_options})).then(function(e){r=e})},function(e){throw C(e)});return a&&a.then?a.then(i):i()})}catch(e){return Promise.reject(e)}},r.loginWithWebAuthn=function(e){try{var t=this;if(!window.PublicKeyCredential)throw S();var r=e.username;return Promise.resolve(t.request(F(o.LoginWithWebAuthn,[{username:r}]))).then(function(e){var n;function i(e){return t.request(F(o.WebAuthnLoginVerfiy,[{username:r,assertion_response:(i=n,s=new Uint8Array(i.response.authenticatorData),u=new Uint8Array(i.response.clientDataJSON),c=new Uint8Array(i.rawId),l=new Uint8Array(i.response.signature),f=i.getClientExtensionResults(),{id:i.id,rawId:te(c),type:i.type,authData:re(s),clientData:re(u),signature:(a=l,Array.from(a).map(function(e){return("0"+e.toString(16)).substr(-2)}).join("")),assertionClientExtensions:JSON.stringify(f)})}]));var i,a,s,u,c,l,f}var a=oe(function(){return Promise.resolve(navigator.credentials.get({publicKey:e})).then(function(e){n=e})},function(e){throw C(e)});return a&&a.then?a.then(i):i()})}catch(e){return Promise.reject(e)}},t}($),ae=function(e){function t(){return e.apply(this,arguments)||this}y(t,e);var r=t.prototype;return r.getIdToken=function(e){var t=F(o.GetIdToken,[e]);return this.request(t)},r.generateIdToken=function(e){var t=F(o.GenerateIdToken,[e]);return this.request(t)},r.getMetadata=function(){var e=F(o.GetMetadata);return this.request(e)},r.updateEmail=function(e){var t=e.showUI,r=F(o.UpdateEmail,[{email:e.email,showUI:void 0===t||t}]);return this.request(r)},r.isLoggedIn=function(){var e=F(o.IsLoggedIn);return this.request(e)},r.logout=function(){var e=F(o.Logout);return this.request(e)},r.getWebAuthnInfo=function(){var e=F(o.GetWebAuthnInfo,[]);return this.request(e)},r.updateWebAuthnInfo=function(e){var t=F(o.UpdateWebAuthnInfo,[{webAuthnCredentialsId:e.id,nickname:e.nickname}]);return this.request(t)},r.unregisterWebAuthnDevice=function(e){var t=F(o.UnregisterWebAuthDevice,[{webAuthnCredentialsId:e}]);return this.request(t)},r.registerWebAuthnDevice=function(e){void 0===e&&(e="");try{var t=this;if(!window.PublicKeyCredential)throw S();return Promise.resolve(t.request(F(o.RegisterWebAuthDeviceStart,[]))).then(function(r){var n;function i(r){return t.request(F(o.RegisterWebAuthDevice,[{nickname:e,transport:n.response.getTransports(),user_agent:navigator.userAgent,registration_response:ne(n)}]))}var a=function(e,t){try{var o=Promise.resolve(navigator.credentials.create({publicKey:r.credential_options})).then(function(e){n=e})}catch(e){return t(e)}return o&&o.then?o.then(void 0,t):o}(0,function(e){throw C(e)});return a&&a.then?a.then(i):i()})}catch(e){return Promise.reject(e)}},t}($),se=z(),ue=se.createBoundEmitterMethod,ce=se.createChainingEmitterMethod,le=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isMagic=!0,t.on=ce("on",b(t)),t.once=ce("once",b(t)),t.addListener=ce("addListener",b(t)),t.off=ce("off",b(t)),t.removeListener=ce("removeListener",b(t)),t.removeAllListeners=ce("removeAllListeners",b(t)),t.emit=ue("emit"),t.eventNames=ue("eventNames"),t.listeners=ue("listeners"),t.listenerCount=ue("listenerCount"),t}y(t,e);var r=t.prototype;return r.sendAsync=function(e,t){if(!t)throw function(e){var t,r,n;return new L(s.InvalidArgument,"Invalid "+(n=(t=e.argument+1)%100,(1==(r=t%10)&&11!==n?t+"st":2===r&&12!==n?t+"nd":3===r&&13!==n?t+"rd":t+"th")+" argument given to `")+e.procedure+"`.\n Expected: `"+e.expected+"`\n Received: `"+e.received+"`")}({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.transport.post(this.overlay,a.MAGIC_HANDLE_REQUEST,e.map(function(e){return K(e)})).then(function(e){t(null,e.map(function(e){return v({},e.payload,{error:e.hasError?new R(e.payload.error):null})}))});else{var r=K(e);this.transport.post(this.overlay,a.MAGIC_HANDLE_REQUEST,r).then(function(e){t(e.hasError?new R(e.payload.error):null,e.payload)})}},r.send=function(e,t){if("string"==typeof e){var r=F(e,Array.isArray(t)?t:[]);return this.request(r)}if(!Array.isArray(e)&&!t){var n=new x(u.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.");return n.log(),new Y(e).applyError({code:-32603,message:n.rawMessage}).payload}this.sendAsync(e,t)},r.enable=function(){var e=F("eth_accounts");return this.request(e)},t}($);function fe(e,t){return t?new URL(e,t):new URL(e)}var he=function(e){function t(){var t;(t=e.call(this,void 0)||this).isInitialized=!1,t.utils={createPromiEvent:X,encodeJSON:j,decodeJSON:D,encodeQueryParameters:T,decodeQueryParameters:W,createJsonRpcRequestPayload:F,standardizeJsonRpcRequestPayload:K};var r=["request","transport","overlay","sdk"];return new Proxy(b(t),{get:function(e,n,o){if(r.includes(n)&&!t.isInitialized)throw function(e){return new L(s.ExtensionNotInitialized,"Extensions must be initialized with a Magic SDK instance before `Extension."+e+"` can be accessed. Do not invoke `Extension."+e+"` inside an extension constructor.")}(n);return Reflect.get(e,n,o)}})||b(t)}y(t,e);var r=t.prototype;return r.init=function(e){this.isInitialized||(this.sdk=e,this.isInitialized=!0)},r.createDeprecationWarning=function(e){var t=e.useInstead;return new N(this,"DEPRECATION_NOTICE","`"+e.method+"` will be removed from this Extension in version `"+e.removalVersion+"`."+(t?" Use `"+t+"` instead.":""))},r.createWarning=function(e,t){return new N(this,e,t)},r.createError=function(e,t,r){return new M(this,e,t,r)},r.raiseError=function(e,t,r){throw new M(this,e,t,r)},t}($),de=function(e){function t(){return e.apply(this,arguments)||this}return y(t,e),t}(he),pe=function(e){function t(){return e.apply(this,arguments)||this}return y(t,e),t}(he);pe.Internal=de;var ve=function(){function e(e,t){var r,n,o=this;if(this.apiKey=e,!e)throw new L(s.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.");"react-native"===P.target&&(null==t?void 0:t.endpoint)&&new x(u.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 `"+P.defaultEndpoint+"`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.").log();var i=P.version;this.endpoint=fe(null!=(r=null==t?void 0:t.endpoint)?r:P.defaultEndpoint).origin,this.auth=new ie(this),this.user=new ae(this),this.rpcProvider=new le(this);var a=null!=(n=null==t?void 0:t.extensions)?n:[],c={};Array.isArray(a)?a.forEach(function(e){e.init(o),o[e.name]=e,e instanceof pe.Internal&&(O(e.config)||(c[e.name]=e.config))}):Object.keys(a).forEach(function(e){a[e].init(o);var t=a[e];o[e]=t,t instanceof pe.Internal&&(O(t.config)||(c[a[e].name]=t.config))}),this.encodedQueryParams=j({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:fe(this.endpoint).host,sdk:P.sdkName,version:i,ext:O(c)?void 0:c})}return e.prototype.preload=function(){try{return Promise.resolve(this.overlay.ready).then(function(){})}catch(e){return Promise.reject(e)}},p(e,[{key:"transport",get:function(){return e.__transports__.has(this.encodedQueryParams)||e.__transports__.set(this.encodedQueryParams,new P.PayloadTransport(this.endpoint,this.encodedQueryParams)),e.__transports__.get(this.encodedQueryParams)}},{key:"overlay",get:function(){if(!e.__overlays__.has(this.encodedQueryParams)){var t=new P.ViewController(this.transport,this.endpoint,this.encodedQueryParams);e.__overlays__.set(this.encodedQueryParams,t)}return e.__overlays__.get(this.encodedQueryParams)}}]),e}();ve.__transports__=new Map,ve.__overlays__=new Map;var ye,ge=function(){function e(e,t){this.endpoint=e,this.encodedQueryParams=t,this.messageHandlers=new Set,this.init()}var t=e.prototype;return t.post=function(e,t,r){try{var n=this;return Promise.resolve(Z(function(o){try{return Promise.resolve(e.ready).then(function(){var a=[],s=Array.isArray(r)?r.map(function(e){return e.id}):[];return Promise.resolve(e.postMessage({msgType:t+"-"+n.encodedQueryParams,payload:r})).then(function(){var e,t=n.on(i.MAGIC_HANDLE_RESPONSE,(e=function(){return t()},function(t){var n=function(e,t){var r,n=null===(r=t.data.response)||void 0===r?void 0:r.id,o=function(e,t){return t&&Array.isArray(e)?e.find(function(e){return e.id===t}):e}(e,n);return n&&o?{id:n,response:new Y(o).applyResult(t.data.response.result).applyError(t.data.response.error)}:{}}(r,t),i=n.id,u=n.response;i&&u&&Array.isArray(r)&&s.includes(i)?(a.push(u),a.length===r.length&&(e(),o(a))):i&&u&&!Array.isArray(r)&&i===r.id&&(e(),o(u))}))})})}catch(e){return Promise.reject(e)}}))}catch(e){return Promise.reject(e)}},t.on=function(e,t){var r=this,n=t.bind(window),o=function(t){t.data.msgType===e+"-"+r.encodedQueryParams&&n(t)};return this.messageHandlers.add(o),function(){return r.messageHandlers.delete(o)}},e}(),me=function(){function e(e,t,r){this.transport=e,this.endpoint=t,this.encodedQueryParams=r,this.ready=this.waitForReady(),this.init&&this.init(),this.listen()}var t=e.prototype;return t.waitForReady=function(){var e=this;return new Promise(function(t){e.transport.on(i.MAGIC_OVERLAY_READY,function(){return t()})})},t.listen=function(){var e=this;this.transport.on(i.MAGIC_HIDE_OVERLAY,function(){e.hideOverlay()}),this.transport.on(i.MAGIC_SHOW_OVERLAY,function(){e.showOverlay()})},e}(),_e={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},we=function(e){function r(){return e.apply(this,arguments)||this}t(r,e);var n=r.prototype;return n.init=function(){this.iframe=this.createIframe()},n.createIframe=function(){var e=this;return new Promise(function(t){var r=function(){if(n=encodeURIComponent(e.encodedQueryParams),o=[].slice.call(document.querySelectorAll(".magic-iframe")),Boolean(o.find(function(e){return e.src.includes(n)})))new x(u.DuplicateIframe,"Duplicate iframes found.").log();else{var r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=fe(e.endpoint).host,r.src=fe("/send?params="+encodeURIComponent(e.encodedQueryParams),e.endpoint).href,function(e){for(var t=0,r=Object.entries(_e);t<r.length;t++){var n=r[t];e.style[n[0]]=n[1]}}(r),document.body.appendChild(r),t(r)}var n,o};["loaded","interactive","complete"].includes(document.readyState)?r():window.addEventListener("load",r,!1)})},n.showOverlay=function(){try{return Promise.resolve(this.iframe).then(function(e){e.style.display="block"})}catch(e){return Promise.reject(e)}},n.hideOverlay=function(){try{return Promise.resolve(this.iframe).then(function(e){e.style.display="none"})}catch(e){return Promise.reject(e)}},n.postMessage=function(e){try{return Promise.resolve(this.iframe).then(function(t){if(!t||!t.contentWindow)throw new L(s.ModalNotReady,"Modal is not ready.");t.contentWindow.postMessage(e,"*")})}catch(e){return Promise.reject(e)}},r}(me),Ee=(ye=ve,Object.assign(P,{target:"web",sdkName:"magic-sdk",version:"2.2.1-alpha.0",defaultEndpoint:"https://auth.magic.link/",ViewController:we,PayloadTransport:function(e){function n(){return e.apply(this,arguments)||this}return t(n,e),n.prototype.init=function(){var e=this;window.addEventListener("message",function(t){if(t.origin===e.endpoint&&t.data&&t.data.msgType&&e.messageHandlers.size){var n;t.data.response=null!=(n=t.data.response)?n:{};for(var o,i=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,void 0):void 0}}(e))){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e.messageHandlers.values());!(o=i()).done;)(0,o.value)(t)}})},n}(ge)}),ye);return Object.assign(Ee,e({},f,{SDKError:L,ExtensionError:M,ExtensionWarning:N,RPCError:R,SDKWarning:x,Extension:pe})),Ee}); |
@@ -1,2 +0,2 @@ | ||
var t=require("@magic-sdk/provider"),e=require("@magic-sdk/types");function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}!function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new E(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=w(a,r);if(c){if(c===s)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var s={};function l(){}function f(){}function h(){}var d={};d[o]=function(){return this};var p=Object.getPrototypeOf,y=p&&p(p(L([])));y&&y!==e&&r.call(y,o)&&(d=y);var v=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e(function(n,a){!function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then(function(t){n("next",t,a,c)},function(t){n("throw",t,a,c)}):e.resolve(f).then(function(t){l.value=t,a(l)},function(t){return n("throw",t,a,c)})}c(s.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:j}}function j(){return{value:void 0,done:!0}}return f.prototype=v.constructor=h,h.constructor=f,h[a]=f.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},m(g.prototype),g.prototype[i]=function(){return this},t.AsyncIterator=g,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new g(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(v),v[a]="Generator",v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}({});try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}();var o={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},i=function(e){function n(){return e.apply(this,arguments)||this}r(n,e);var i=n.prototype;return i.init=function(){this.iframe=this.createIframe()},i.createIframe=function(){var e=this;return new Promise(function(r){var n=function(){if(i=encodeURIComponent(e.encodedQueryParams),a=[].slice.call(document.querySelectorAll(".magic-iframe")),Boolean(a.find(function(t){return t.src.includes(i)})))t.createDuplicateIframeWarning().log();else{var n=document.createElement("iframe");n.classList.add("magic-iframe"),n.dataset.magicIframeLabel=t.createURL(e.endpoint).host,n.src=t.createURL("/send?params="+encodeURIComponent(e.encodedQueryParams),e.endpoint).href,function(t){for(var e=0,r=Object.entries(o);e<r.length;e++){var n=r[e];t.style[n[0]]=n[1]}}(n),document.body.appendChild(n),r(n)}var i,a};["loaded","interactive","complete"].includes(document.readyState)?n():window.addEventListener("load",n,!1)})},i.showOverlay=function(){try{return Promise.resolve(this.iframe).then(function(t){t.style.display="block"})}catch(t){return Promise.reject(t)}},i.hideOverlay=function(){try{return Promise.resolve(this.iframe).then(function(t){t.style.display="none"})}catch(t){return Promise.reject(t)}},i.postMessage=function(e){try{return Promise.resolve(this.iframe).then(function(r){if(!r||!r.contentWindow)throw t.createModalNotReadyError();r.contentWindow.postMessage(e,"*")})}catch(t){return Promise.reject(t)}},n}(t.ViewController),a=t.createSDK(t.SDKBase,{target:"web",sdkName:"magic-sdk",version:"2.1.0",defaultEndpoint:"https://auth.magic.link/",ViewController:i,PayloadTransport:function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.init=function(){var t=this;window.addEventListener("message",function(e){if(e.origin===t.endpoint&&e.data&&e.data.msgType&&t.messageHandlers.size){var r;e.data.response=null!=(r=e.data.response)?r:{};for(var o,i=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,void 0):void 0}}(t))){r&&(t=r);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)}(t.messageHandlers.values());!(o=i()).done;)(0,o.value)(e)}})},e}(t.PayloadTransport)});Object.keys(e).forEach(function(t){"default"!==t&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})}),Object.defineProperty(exports,"Extension",{enumerable:!0,get:function(){return t.Extension}}),Object.defineProperty(exports,"ExtensionError",{enumerable:!0,get:function(){return t.MagicExtensionError}}),Object.defineProperty(exports,"ExtensionWarning",{enumerable:!0,get:function(){return t.MagicExtensionWarning}}),Object.defineProperty(exports,"RPCError",{enumerable:!0,get:function(){return t.MagicRPCError}}),Object.defineProperty(exports,"SDKError",{enumerable:!0,get:function(){return t.MagicSDKError}}),Object.defineProperty(exports,"SDKWarning",{enumerable:!0,get:function(){return t.MagicSDKWarning}}),exports.Magic=a; | ||
require("regenerator-runtime/runtime");var e=require("@magic-sdk/provider"),r=require("@magic-sdk/types");function t(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var o={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},i=function(r){function n(){return r.apply(this,arguments)||this}t(n,r);var i=n.prototype;return i.init=function(){this.iframe=this.createIframe()},i.createIframe=function(){var r=this;return new Promise(function(t){var n=function(){if(i=encodeURIComponent(r.encodedQueryParams),a=[].slice.call(document.querySelectorAll(".magic-iframe")),Boolean(a.find(function(e){return e.src.includes(i)})))e.createDuplicateIframeWarning().log();else{var n=document.createElement("iframe");n.classList.add("magic-iframe"),n.dataset.magicIframeLabel=e.createURL(r.endpoint).host,n.src=e.createURL("/send?params="+encodeURIComponent(r.encodedQueryParams),r.endpoint).href,function(e){for(var r=0,t=Object.entries(o);r<t.length;r++){var n=t[r];e.style[n[0]]=n[1]}}(n),document.body.appendChild(n),t(n)}var i,a};["loaded","interactive","complete"].includes(document.readyState)?n():window.addEventListener("load",n,!1)})},i.showOverlay=function(){try{return Promise.resolve(this.iframe).then(function(e){e.style.display="block"})}catch(e){return Promise.reject(e)}},i.hideOverlay=function(){try{return Promise.resolve(this.iframe).then(function(e){e.style.display="none"})}catch(e){return Promise.reject(e)}},i.postMessage=function(r){try{return Promise.resolve(this.iframe).then(function(t){if(!t||!t.contentWindow)throw e.createModalNotReadyError();t.contentWindow.postMessage(r,"*")})}catch(e){return Promise.reject(e)}},n}(e.ViewController),a=e.createSDK(e.SDKBase,{target:"web",sdkName:"magic-sdk",version:"2.2.1-alpha.0",defaultEndpoint:"https://auth.magic.link/",ViewController:i,PayloadTransport:function(e){function r(){return e.apply(this,arguments)||this}return t(r,e),r.prototype.init=function(){var e=this;window.addEventListener("message",function(r){if(r.origin===e.endpoint&&r.data&&r.data.msgType&&e.messageHandlers.size){var t;r.data.response=null!=(t=r.data.response)?t:{};for(var o,i=function(e,r){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return n(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e))){t&&(e=t);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(e.messageHandlers.values());!(o=i()).done;)(0,o.value)(r)}})},r}(e.PayloadTransport)});Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})}),Object.defineProperty(exports,"Extension",{enumerable:!0,get:function(){return e.Extension}}),Object.defineProperty(exports,"ExtensionError",{enumerable:!0,get:function(){return e.MagicExtensionError}}),Object.defineProperty(exports,"ExtensionWarning",{enumerable:!0,get:function(){return e.MagicExtensionWarning}}),Object.defineProperty(exports,"RPCError",{enumerable:!0,get:function(){return e.MagicRPCError}}),Object.defineProperty(exports,"SDKError",{enumerable:!0,get:function(){return e.MagicSDKError}}),Object.defineProperty(exports,"SDKWarning",{enumerable:!0,get:function(){return e.MagicSDKWarning}}),exports.Magic=a; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{createModalNotReadyError as t,createURL as r,createDuplicateIframeWarning as e,ViewController as n,PayloadTransport as o,createSDK as i,SDKBase as a}from"@magic-sdk/provider";export{Extension,MagicExtensionError as ExtensionError,MagicExtensionWarning as ExtensionWarning,MagicRPCError as RPCError,MagicSDKError as SDKError,MagicSDKWarning as SDKWarning}from"@magic-sdk/provider";export*from"@magic-sdk/types";function c(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r}function s(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}!function(t){var r=function(t){var r=Object.prototype,e=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,r,e,n){var o=Object.create((r&&r.prototype instanceof l?r:l).prototype),i=new b(n||[]);return o._invoke=function(t,r,e){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=w(a,e);if(c){if(c===u)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var l=s(t,r,e);if("normal"===l.type){if(n=e.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:e.done}}"throw"===l.type&&(n="completed",e.method="throw",e.arg=l.arg)}}}(t,e,i),o}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function l(){}function f(){}function h(){}var d={};d[o]=function(){return this};var p=Object.getPrototypeOf,y=p&&p(p(L([])));y&&y!==r&&e.call(y,o)&&(d=y);var v=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach(function(r){t[r]=function(t){return this._invoke(r,t)}})}function g(t,r){var n;this._invoke=function(o,i){function a(){return new r(function(n,a){!function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&e.call(f,"__await")?r.resolve(f.__await).then(function(t){n("next",t,a,c)},function(t){n("throw",t,a,c)}):r.resolve(f).then(function(t){l.value=t,a(l)},function(t){return n("throw",t,a,c)})}c(u.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}}function w(t,r){var e=t.iterator[r.method];if(void 0===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,w(t,r),"throw"===r.method))return u;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=s(e,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,u;var o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,u):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,u)}function E(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function x(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function b(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(e.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=v.constructor=h,h.constructor=f,h[a]=f.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===f||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},m(g.prototype),g.prototype[i]=function(){return this},t.AsyncIterator=g,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new g(c(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(v),v[a]="Generator",v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,b.prototype={constructor:b,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&e.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e,n){return a.type="throw",a.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=e.call(i,"catchLoc"),s=e.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),u},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),u}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;x(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:L(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),u}},t}({});try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}}();var u={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},l=i(a,{target:"web",sdkName:"magic-sdk",version:"2.1.0",defaultEndpoint:"https://auth.magic.link/",ViewController:function(n){function o(){return n.apply(this,arguments)||this}c(o,n);var i=o.prototype;return i.init=function(){this.iframe=this.createIframe()},i.createIframe=function(){var t=this;return new Promise(function(n){var o=function(){if(i=encodeURIComponent(t.encodedQueryParams),a=[].slice.call(document.querySelectorAll(".magic-iframe")),Boolean(a.find(function(t){return t.src.includes(i)})))e().log();else{var o=document.createElement("iframe");o.classList.add("magic-iframe"),o.dataset.magicIframeLabel=r(t.endpoint).host,o.src=r("/send?params="+encodeURIComponent(t.encodedQueryParams),t.endpoint).href,function(t){for(var r=0,e=Object.entries(u);r<e.length;r++){var n=e[r];t.style[n[0]]=n[1]}}(o),document.body.appendChild(o),n(o)}var i,a};["loaded","interactive","complete"].includes(document.readyState)?o():window.addEventListener("load",o,!1)})},i.showOverlay=function(){try{return Promise.resolve(this.iframe).then(function(t){t.style.display="block"})}catch(t){return Promise.reject(t)}},i.hideOverlay=function(){try{return Promise.resolve(this.iframe).then(function(t){t.style.display="none"})}catch(t){return Promise.reject(t)}},i.postMessage=function(r){try{return Promise.resolve(this.iframe).then(function(e){if(!e||!e.contentWindow)throw t();e.contentWindow.postMessage(r,"*")})}catch(t){return Promise.reject(t)}},o}(n),PayloadTransport:function(t){function r(){return t.apply(this,arguments)||this}return c(r,t),r.prototype.init=function(){var t=this;window.addEventListener("message",function(r){if(r.origin===t.endpoint&&r.data&&r.data.msgType&&t.messageHandlers.size){var e;r.data.response=null!=(e=r.data.response)?e:{};for(var n,o=function(t,r){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,r){if(t){if("string"==typeof t)return s(t,void 0);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(t,void 0):void 0}}(t))){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(e=t[Symbol.iterator]()).next.bind(e)}(t.messageHandlers.values());!(n=o()).done;)(0,n.value)(r)}})},r}(o)});export{l as Magic}; | ||
import"regenerator-runtime/runtime";import{createModalNotReadyError as e,createURL as r,createDuplicateIframeWarning as t,ViewController as n,PayloadTransport as o,createSDK as i,SDKBase as a}from"@magic-sdk/provider";export{Extension,MagicExtensionError as ExtensionError,MagicExtensionWarning as ExtensionWarning,MagicRPCError as RPCError,MagicSDKError as SDKError,MagicSDKWarning as SDKWarning}from"@magic-sdk/provider";export*from"@magic-sdk/types";function s(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var d={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},u=i(a,{target:"web",sdkName:"magic-sdk",version:"2.2.1-alpha.0",defaultEndpoint:"https://auth.magic.link/",ViewController:function(n){function o(){return n.apply(this,arguments)||this}s(o,n);var i=o.prototype;return i.init=function(){this.iframe=this.createIframe()},i.createIframe=function(){var e=this;return new Promise(function(n){var o=function(){if(i=encodeURIComponent(e.encodedQueryParams),a=[].slice.call(document.querySelectorAll(".magic-iframe")),Boolean(a.find(function(e){return e.src.includes(i)})))t().log();else{var o=document.createElement("iframe");o.classList.add("magic-iframe"),o.dataset.magicIframeLabel=r(e.endpoint).host,o.src=r("/send?params="+encodeURIComponent(e.encodedQueryParams),e.endpoint).href,function(e){for(var r=0,t=Object.entries(d);r<t.length;r++){var n=t[r];e.style[n[0]]=n[1]}}(o),document.body.appendChild(o),n(o)}var i,a};["loaded","interactive","complete"].includes(document.readyState)?o():window.addEventListener("load",o,!1)})},i.showOverlay=function(){try{return Promise.resolve(this.iframe).then(function(e){e.style.display="block"})}catch(e){return Promise.reject(e)}},i.hideOverlay=function(){try{return Promise.resolve(this.iframe).then(function(e){e.style.display="none"})}catch(e){return Promise.reject(e)}},i.postMessage=function(r){try{return Promise.resolve(this.iframe).then(function(t){if(!t||!t.contentWindow)throw e();t.contentWindow.postMessage(r,"*")})}catch(e){return Promise.reject(e)}},o}(n),PayloadTransport:function(e){function r(){return e.apply(this,arguments)||this}return s(r,e),r.prototype.init=function(){var e=this;window.addEventListener("message",function(r){if(r.origin===e.endpoint&&r.data&&r.data.msgType&&e.messageHandlers.size){var t;r.data.response=null!=(t=r.data.response)?t:{};for(var n,o=function(e,r){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return c(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,void 0):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(e.messageHandlers.values());!(n=o()).done;)(0,n.value)(r)}})},r}(o)});export{u as Magic}; | ||
//# sourceMappingURL=index.m.js.map |
@@ -1,2 +0,2 @@ | ||
import{ViewController as t,createModalNotReadyError as e,createURL as r,createDuplicateIframeWarning as n,PayloadTransport as o,createSDK as i,SDKBase as a}from"@magic-sdk/provider";export{Extension,MagicExtensionError as ExtensionError,MagicExtensionWarning as ExtensionWarning,MagicRPCError as RPCError,MagicSDKError as SDKError,MagicSDKWarning as SDKWarning}from"@magic-sdk/provider";export*from"@magic-sdk/types";!function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=w(a,r);if(c){if(c===u)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var h=s(t,e,r);if("normal"===h.type){if(n=r.done?"completed":"suspendedYield",h.arg===u)continue;return{value:h.arg,done:r.done}}"throw"===h.type&&(n="completed",r.method="throw",r.arg=h.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function h(){}function l(){}function f(){}var d={};d[o]=function(){return this};var p=Object.getPrototypeOf,y=p&&p(p(b([])));y&&y!==e&&r.call(y,o)&&(d=y);var v=f.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e(function(n,a){!function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var h=u.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then(function(t){n("next",t,a,c)},function(t){n("throw",t,a,c)}):e.resolve(l).then(function(t){h.value=t,a(h)},function(t){return n("throw",t,a,c)})}c(u.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,u;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function b(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=v.constructor=f,f.constructor=l,f[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},m(g.prototype),g.prototype[i]=function(){return this},t.AsyncIterator=g,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new g(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(v),v[a]="Generator",v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=b,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:b(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}({});try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}();const c={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},s=i(a,{target:"web",sdkName:"magic-sdk",version:"2.1.0",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends t{init(){this.iframe=this.createIframe()}createIframe(){return new Promise(t=>{const e=()=>{if(function(t){const e=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(e.find(e=>e.src.includes(t)))}(encodeURIComponent(this.encodedQueryParams)))n().log();else{const e=document.createElement("iframe");e.classList.add("magic-iframe"),e.dataset.magicIframeLabel=r(this.endpoint).host,e.src=r("/send?params="+encodeURIComponent(this.encodedQueryParams),this.endpoint).href,function(t){for(const[e,r]of Object.entries(c))t.style[e]=r}(e),document.body.appendChild(e),t(e)}};["loaded","interactive","complete"].includes(document.readyState)?e():window.addEventListener("load",e,!1)})}async showOverlay(){(await this.iframe).style.display="block"}async hideOverlay(){(await this.iframe).style.display="none"}async postMessage(t){const r=await this.iframe;if(!r||!r.contentWindow)throw e();r.contentWindow.postMessage(t,"*")}},PayloadTransport:class extends o{init(){window.addEventListener("message",t=>{if(t.origin===this.endpoint&&t.data&&t.data.msgType&&this.messageHandlers.size){t.data.response=t.data.response??{};for(const e of this.messageHandlers.values())e(t)}})}}});export{s as Magic}; | ||
import"regenerator-runtime/runtime";import{ViewController as e,createModalNotReadyError as t,createURL as n,createDuplicateIframeWarning as a,PayloadTransport as i,createSDK as s,SDKBase as r}from"@magic-sdk/provider";export{Extension,MagicExtensionError as ExtensionError,MagicExtensionWarning as ExtensionWarning,MagicRPCError as RPCError,MagicSDKError as SDKError,MagicSDKWarning as SDKWarning}from"@magic-sdk/provider";export*from"@magic-sdk/types";const o={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},d=s(r,{target:"web",sdkName:"magic-sdk",version:"2.2.1-alpha.0",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends e{init(){this.iframe=this.createIframe()}createIframe(){return new Promise(e=>{const t=()=>{if(function(e){const t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(t=>t.src.includes(e)))}(encodeURIComponent(this.encodedQueryParams)))a().log();else{const t=document.createElement("iframe");t.classList.add("magic-iframe"),t.dataset.magicIframeLabel=n(this.endpoint).host,t.src=n("/send?params="+encodeURIComponent(this.encodedQueryParams),this.endpoint).href,function(e){for(const[t,n]of Object.entries(o))e.style[t]=n}(t),document.body.appendChild(t),e(t)}};["loaded","interactive","complete"].includes(document.readyState)?t():window.addEventListener("load",t,!1)})}async showOverlay(){(await this.iframe).style.display="block"}async hideOverlay(){(await this.iframe).style.display="none"}async postMessage(e){const n=await this.iframe;if(!n||!n.contentWindow)throw t();n.contentWindow.postMessage(e,"*")}},PayloadTransport:class extends i{init(){window.addEventListener("message",e=>{if(e.origin===this.endpoint&&e.data&&e.data.msgType&&this.messageHandlers.size){e.data.response=e.data.response??{};for(const t of this.messageHandlers.values())t(e)}})}}});export{d as Magic}; | ||
//# sourceMappingURL=index.modern.js.map |
{ | ||
"name": "magic-sdk", | ||
"version": "2.2.0-alpha.0", | ||
"version": "2.2.1-alpha.0", | ||
"description": "Passwordless authentication for the web.", | ||
@@ -23,3 +23,3 @@ "author": "Fortmatic <team@fortmatic.com> (https://fortmatic.com/)", | ||
"build": "yarn run build:npm && yarn run build:cdn", | ||
"build:npm": "microbundle build src/index.ts --define $ENV --target web --format modern,es,cjs --external @magic-sdk/provider,@magic-sdk/types", | ||
"build:npm": "microbundle build src/index.ts --define $ENV --target web --format modern,es,cjs", | ||
"build:cdn": "microbundle build src/index.cdn.ts --define $ENV --tsconfig tsconfig.cdn.json --output dist/magic.js --target web --name Magic --format umd --sourcemap false --external none", | ||
@@ -31,4 +31,4 @@ "precommit": "lint-staged" | ||
"@babel/runtime": "^7.9.6", | ||
"@magic-sdk/provider": "^2.3.0-alpha.0", | ||
"@magic-sdk/types": "^1.2.0-alpha.0", | ||
"@magic-sdk/provider": "^2.3.1-alpha.0", | ||
"@magic-sdk/types": "^1.2.1-alpha.0", | ||
"regenerator-runtime": "0.13.5" | ||
@@ -63,3 +63,3 @@ }, | ||
}, | ||
"gitHead": "60dfc87d2b809ce0f806820a8c9d08fd756daf1b" | ||
"gitHead": "d59abcf55f2b99627e55d302bb9c451c01403cf2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
0
2
73197
198