@txnlab/use-wallet 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import algosdk from 'algosdk';
2
- import require$$0$2, { useReducer, useRef, useDebugValue, useEffect, useLayoutEffect, useMemo } from 'react';
2
+ import require$$0, { useReducer, useRef, useDebugValue, useEffect, useLayoutEffect, useMemo } from 'react';
3
+ import { formatJsonRpcRequest } from '@json-rpc-tools/utils';
3
4
 
4
- function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return !!n&&!!n[Q]}function t(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return "production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g(n),n.p.forEach(S),n.p=null;}function g(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P$1(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en$1;t&&(i=[e],o=on$1);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en$1={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on$1={};i(en$1,(function(n,r){on$1[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on$1.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on$1.set.call(this,r,t,void 0)},on$1.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en$1.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P$1(n,c)}),(function(n){throw O(c),n})):(j(c,o),P$1(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P$1(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
5
+ function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return !!n&&!!n[Q]}function t(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return "production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g(n),n.p.forEach(S),n.p=null;}function g(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P$1(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P$1(n,c)}),(function(n){throw O(c),n})):(j(c,o),P$1(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P$1(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
5
6
 
6
7
  /**
7
8
  * The immer middleware turns the `set` method into a proxy for the immer `produce` method.
@@ -1640,27 +1641,6 @@ const audio = `data:audio/mp3;base64,SUQzBAAAAAIYBlRJVDIAAAAWAAAAMzAgU2Vjb25kcyB
1640
1641
 
1641
1642
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1642
1643
 
1643
- function getAugmentedNamespace(n) {
1644
- var f = n.default;
1645
- if (typeof f == "function") {
1646
- var a = function () {
1647
- return f.apply(this, arguments);
1648
- };
1649
- a.prototype = f.prototype;
1650
- } else a = {};
1651
- Object.defineProperty(a, '__esModule', {value: true});
1652
- Object.keys(n).forEach(function (k) {
1653
- var d = Object.getOwnPropertyDescriptor(n, k);
1654
- Object.defineProperty(a, k, d.get ? d : {
1655
- enumerable: true,
1656
- get: function () {
1657
- return n[k];
1658
- }
1659
- });
1660
- });
1661
- return a;
1662
- }
1663
-
1664
1644
  var lib = {};
1665
1645
 
1666
1646
  var uaParser_min = {exports: {}};
@@ -1675,15 +1655,15 @@ var uaParser_min = {exports: {}};
1675
1655
 
1676
1656
  Object.defineProperty(lib, '__esModule', { value: true });
1677
1657
 
1678
- function _interopDefault$1 (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
1658
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
1679
1659
 
1680
- var React$1 = require$$0$2;
1681
- var React__default = _interopDefault$1(React$1);
1660
+ var React = require$$0;
1661
+ var React__default = _interopDefault(React);
1682
1662
 
1683
1663
  var UAParser = uaParser_min.exports;
1684
1664
 
1685
1665
  var ClientUAInstance = new UAParser();
1686
- var browser$2 = ClientUAInstance.getBrowser();
1666
+ var browser = ClientUAInstance.getBrowser();
1687
1667
  var cpu = ClientUAInstance.getCPU();
1688
1668
  var device = ClientUAInstance.getDevice();
1689
1669
  var engine = ClientUAInstance.getEngine();
@@ -1715,7 +1695,7 @@ var parseUserAgent = function parseUserAgent(userAgent) {
1715
1695
 
1716
1696
  var UAHelper = /*#__PURE__*/Object.freeze({
1717
1697
  ClientUAInstance: ClientUAInstance,
1718
- browser: browser$2,
1698
+ browser: browser,
1719
1699
  cpu: cpu,
1720
1700
  device: device,
1721
1701
  engine: engine,
@@ -2414,33 +2394,33 @@ var isSmartTV = isSmartTVType(device);
2414
2394
  var isConsole = isConsoleType(device);
2415
2395
  var isWearable = isWearableType(device);
2416
2396
  var isEmbedded = isEmbeddedType(device);
2417
- var isMobileSafari = isMobileSafariType(browser$2) || getIPad13();
2418
- var isChromium = isChromiumType(browser$2);
2397
+ var isMobileSafari = isMobileSafariType(browser) || getIPad13();
2398
+ var isChromium = isChromiumType(browser);
2419
2399
  var isMobile = isMobileAndTabletType(device) || getIPad13();
2420
2400
  var isMobileOnly = isMobileType(device);
2421
2401
  var isTablet = isTabletType(device) || getIPad13();
2422
- var isBrowser$1 = isBrowserType(device);
2402
+ var isBrowser = isBrowserType(device);
2423
2403
  var isDesktop = isBrowserType(device);
2424
2404
  var isAndroid = isAndroidType(os);
2425
2405
  var isWinPhone = isWinPhoneType(os);
2426
2406
  var isIOS = isIOSType(os) || getIPad13();
2427
- var isChrome = isChromeType(browser$2);
2428
- var isFirefox = isFirefoxType(browser$2);
2429
- var isSafari = isSafariType(browser$2);
2430
- var isOpera = isOperaType(browser$2);
2431
- var isIE = isIEType(browser$2);
2407
+ var isChrome = isChromeType(browser);
2408
+ var isFirefox = isFirefoxType(browser);
2409
+ var isSafari = isSafariType(browser);
2410
+ var isOpera = isOperaType(browser);
2411
+ var isIE = isIEType(browser);
2432
2412
  var osVersion = getOsVersion(os);
2433
2413
  var osName = getOsName(os);
2434
- var fullBrowserVersion = getBrowserFullVersion(browser$2);
2435
- var browserVersion = getBrowserVersion(browser$2);
2436
- var browserName = getBrowserName(browser$2);
2414
+ var fullBrowserVersion = getBrowserFullVersion(browser);
2415
+ var browserVersion = getBrowserVersion(browser);
2416
+ var browserName = getBrowserName(browser);
2437
2417
  var mobileVendor = getMobileVendor(device);
2438
2418
  var mobileModel = getMobileModel(device);
2439
2419
  var engineName = getEngineName(engine);
2440
2420
  var engineVersion = getEngineVersion(engine);
2441
2421
  var getUA = getUseragent(ua);
2442
- var isEdge = isEdgeType(browser$2) || isEdgeChromiumType(ua);
2443
- var isYandex = isYandexType(browser$2);
2422
+ var isEdge = isEdgeType(browser) || isEdgeChromiumType(ua);
2423
+ var isYandex = isYandexType(browser);
2444
2424
  var deviceType = getDeviceType(device);
2445
2425
  var isIOS13 = getIOS13();
2446
2426
  var isIPad13 = getIPad13();
@@ -2448,11 +2428,11 @@ var isIPhone13 = getIphone13();
2448
2428
  var isIPod13 = getIPod13();
2449
2429
  var isElectron = isElectronType();
2450
2430
  var isEdgeChromium = isEdgeChromiumType(ua);
2451
- var isLegacyEdge = isEdgeType(browser$2) && !isEdgeChromiumType(ua);
2431
+ var isLegacyEdge = isEdgeType(browser) && !isEdgeChromiumType(ua);
2452
2432
  var isWindows = isWindowsType(os);
2453
2433
  var isMacOs = isMacOsType(os);
2454
- var isMIUI = isMIUIType(browser$2);
2455
- var isSamsungBrowser = isSamsungBrowserType(browser$2);
2434
+ var isMIUI = isMIUIType(browser);
2435
+ var isSamsungBrowser = isSamsungBrowserType(browser);
2456
2436
  var getSelectorsByUserAgent = function getSelectorsByUserAgent(userAgent) {
2457
2437
  if (!userAgent || typeof userAgent !== 'string') {
2458
2438
  console.error('No valid user agent string was provided');
@@ -2480,49 +2460,49 @@ var AndroidView = function AndroidView(_ref) {
2480
2460
  children = _ref.children,
2481
2461
  props = _objectWithoutProperties(_ref, ["renderWithFragment", "children"]);
2482
2462
 
2483
- return isAndroid ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2463
+ return isAndroid ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2484
2464
  };
2485
2465
  var BrowserView = function BrowserView(_ref2) {
2486
2466
  var renderWithFragment = _ref2.renderWithFragment,
2487
2467
  children = _ref2.children,
2488
2468
  props = _objectWithoutProperties(_ref2, ["renderWithFragment", "children"]);
2489
2469
 
2490
- return isBrowser$1 ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2470
+ return isBrowser ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2491
2471
  };
2492
2472
  var IEView = function IEView(_ref3) {
2493
2473
  var renderWithFragment = _ref3.renderWithFragment,
2494
2474
  children = _ref3.children,
2495
2475
  props = _objectWithoutProperties(_ref3, ["renderWithFragment", "children"]);
2496
2476
 
2497
- return isIE ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2477
+ return isIE ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2498
2478
  };
2499
2479
  var IOSView = function IOSView(_ref4) {
2500
2480
  var renderWithFragment = _ref4.renderWithFragment,
2501
2481
  children = _ref4.children,
2502
2482
  props = _objectWithoutProperties(_ref4, ["renderWithFragment", "children"]);
2503
2483
 
2504
- return isIOS ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2484
+ return isIOS ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2505
2485
  };
2506
2486
  var MobileView = function MobileView(_ref5) {
2507
2487
  var renderWithFragment = _ref5.renderWithFragment,
2508
2488
  children = _ref5.children,
2509
2489
  props = _objectWithoutProperties(_ref5, ["renderWithFragment", "children"]);
2510
2490
 
2511
- return isMobile ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2491
+ return isMobile ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2512
2492
  };
2513
2493
  var TabletView = function TabletView(_ref6) {
2514
2494
  var renderWithFragment = _ref6.renderWithFragment,
2515
2495
  children = _ref6.children,
2516
2496
  props = _objectWithoutProperties(_ref6, ["renderWithFragment", "children"]);
2517
2497
 
2518
- return isTablet ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2498
+ return isTablet ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2519
2499
  };
2520
2500
  var WinPhoneView = function WinPhoneView(_ref7) {
2521
2501
  var renderWithFragment = _ref7.renderWithFragment,
2522
2502
  children = _ref7.children,
2523
2503
  props = _objectWithoutProperties(_ref7, ["renderWithFragment", "children"]);
2524
2504
 
2525
- return isWinPhone ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2505
+ return isWinPhone ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2526
2506
  };
2527
2507
  var MobileOnlyView = function MobileOnlyView(_ref8) {
2528
2508
  var renderWithFragment = _ref8.renderWithFragment,
@@ -2531,28 +2511,28 @@ var MobileOnlyView = function MobileOnlyView(_ref8) {
2531
2511
  _ref8.style;
2532
2512
  var props = _objectWithoutProperties(_ref8, ["renderWithFragment", "children", "viewClassName", "style"]);
2533
2513
 
2534
- return isMobileOnly ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2514
+ return isMobileOnly ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2535
2515
  };
2536
2516
  var SmartTVView = function SmartTVView(_ref9) {
2537
2517
  var renderWithFragment = _ref9.renderWithFragment,
2538
2518
  children = _ref9.children,
2539
2519
  props = _objectWithoutProperties(_ref9, ["renderWithFragment", "children"]);
2540
2520
 
2541
- return isSmartTV ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2521
+ return isSmartTV ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2542
2522
  };
2543
2523
  var ConsoleView = function ConsoleView(_ref10) {
2544
2524
  var renderWithFragment = _ref10.renderWithFragment,
2545
2525
  children = _ref10.children,
2546
2526
  props = _objectWithoutProperties(_ref10, ["renderWithFragment", "children"]);
2547
2527
 
2548
- return isConsole ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2528
+ return isConsole ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2549
2529
  };
2550
2530
  var WearableView = function WearableView(_ref11) {
2551
2531
  var renderWithFragment = _ref11.renderWithFragment,
2552
2532
  children = _ref11.children,
2553
2533
  props = _objectWithoutProperties(_ref11, ["renderWithFragment", "children"]);
2554
2534
 
2555
- return isWearable ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2535
+ return isWearable ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2556
2536
  };
2557
2537
  var CustomView = function CustomView(_ref12) {
2558
2538
  var renderWithFragment = _ref12.renderWithFragment,
@@ -2562,7 +2542,7 @@ var CustomView = function CustomView(_ref12) {
2562
2542
  var condition = _ref12.condition,
2563
2543
  props = _objectWithoutProperties(_ref12, ["renderWithFragment", "children", "viewClassName", "style", "condition"]);
2564
2544
 
2565
- return condition ? renderWithFragment ? React__default.createElement(React$1.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2545
+ return condition ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", props, children) : null;
2566
2546
  };
2567
2547
 
2568
2548
  function withOrientationChange(WrappedComponent) {
@@ -2643,7 +2623,7 @@ function withOrientationChange(WrappedComponent) {
2643
2623
  }
2644
2624
 
2645
2625
  function useMobileOrientation() {
2646
- var _useState = React$1.useState(function () {
2626
+ var _useState = React.useState(function () {
2647
2627
  var orientation = window.innerWidth > window.innerHeight ? 90 : 0;
2648
2628
  return {
2649
2629
  isPortrait: orientation === 0,
@@ -2655,7 +2635,7 @@ function useMobileOrientation() {
2655
2635
  state = _useState2[0],
2656
2636
  setState = _useState2[1];
2657
2637
 
2658
- var handleOrientationChange = React$1.useCallback(function () {
2638
+ var handleOrientationChange = React.useCallback(function () {
2659
2639
  var orientation = window.innerWidth > window.innerHeight ? 90 : 0;
2660
2640
  var next = {
2661
2641
  isPortrait: orientation === 0,
@@ -2664,7 +2644,7 @@ function useMobileOrientation() {
2664
2644
  };
2665
2645
  state.orientation !== next.orientation && setState(next);
2666
2646
  }, [state.orientation]);
2667
- React$1.useEffect(function () {
2647
+ React.useEffect(function () {
2668
2648
  if ((typeof window === "undefined" ? "undefined" : _typeof(window)) !== undefined && isMobile) {
2669
2649
  handleOrientationChange();
2670
2650
  window.addEventListener("load", handleOrientationChange, false);
@@ -2715,7 +2695,7 @@ lib.fullBrowserVersion = fullBrowserVersion;
2715
2695
  lib.getSelectorsByUserAgent = getSelectorsByUserAgent;
2716
2696
  lib.getUA = getUA;
2717
2697
  lib.isAndroid = isAndroid;
2718
- lib.isBrowser = isBrowser$1;
2698
+ lib.isBrowser = isBrowser;
2719
2699
  lib.isChrome = isChrome;
2720
2700
  lib.isChromium = isChromium;
2721
2701
  lib.isConsole = isConsole;
@@ -3707,1070 +3687,6 @@ var kmdClient = KMDWallet.init().catch((e) => {
3707
3687
  }
3708
3688
  });
3709
3689
 
3710
- var cjs$2 = {};
3711
-
3712
- /******************************************************************************
3713
- Copyright (c) Microsoft Corporation.
3714
-
3715
- Permission to use, copy, modify, and/or distribute this software for any
3716
- purpose with or without fee is hereby granted.
3717
-
3718
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3719
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3720
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3721
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3722
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3723
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3724
- PERFORMANCE OF THIS SOFTWARE.
3725
- ***************************************************************************** */
3726
- /* global Reflect, Promise */
3727
-
3728
- var extendStatics = function(d, b) {
3729
- extendStatics = Object.setPrototypeOf ||
3730
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
3731
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
3732
- return extendStatics(d, b);
3733
- };
3734
-
3735
- function __extends(d, b) {
3736
- if (typeof b !== "function" && b !== null)
3737
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
3738
- extendStatics(d, b);
3739
- function __() { this.constructor = d; }
3740
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3741
- }
3742
-
3743
- var __assign = function() {
3744
- __assign = Object.assign || function __assign(t) {
3745
- for (var s, i = 1, n = arguments.length; i < n; i++) {
3746
- s = arguments[i];
3747
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
3748
- }
3749
- return t;
3750
- };
3751
- return __assign.apply(this, arguments);
3752
- };
3753
-
3754
- function __rest(s, e) {
3755
- var t = {};
3756
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3757
- t[p] = s[p];
3758
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
3759
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3760
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3761
- t[p[i]] = s[p[i]];
3762
- }
3763
- return t;
3764
- }
3765
-
3766
- function __decorate(decorators, target, key, desc) {
3767
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3768
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3769
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3770
- return c > 3 && r && Object.defineProperty(target, key, r), r;
3771
- }
3772
-
3773
- function __param(paramIndex, decorator) {
3774
- return function (target, key) { decorator(target, key, paramIndex); }
3775
- }
3776
-
3777
- function __metadata(metadataKey, metadataValue) {
3778
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
3779
- }
3780
-
3781
- function __awaiter(thisArg, _arguments, P, generator) {
3782
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3783
- return new (P || (P = Promise))(function (resolve, reject) {
3784
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
3785
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
3786
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
3787
- step((generator = generator.apply(thisArg, _arguments || [])).next());
3788
- });
3789
- }
3790
-
3791
- function __generator(thisArg, body) {
3792
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
3793
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
3794
- function verb(n) { return function (v) { return step([n, v]); }; }
3795
- function step(op) {
3796
- if (f) throw new TypeError("Generator is already executing.");
3797
- while (_) try {
3798
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3799
- if (y = 0, t) op = [op[0] & 2, t.value];
3800
- switch (op[0]) {
3801
- case 0: case 1: t = op; break;
3802
- case 4: _.label++; return { value: op[1], done: false };
3803
- case 5: _.label++; y = op[1]; op = [0]; continue;
3804
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
3805
- default:
3806
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
3807
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
3808
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
3809
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
3810
- if (t[2]) _.ops.pop();
3811
- _.trys.pop(); continue;
3812
- }
3813
- op = body.call(thisArg, _);
3814
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
3815
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
3816
- }
3817
- }
3818
-
3819
- var __createBinding = Object.create ? (function(o, m, k, k2) {
3820
- if (k2 === undefined) k2 = k;
3821
- var desc = Object.getOwnPropertyDescriptor(m, k);
3822
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3823
- desc = { enumerable: true, get: function() { return m[k]; } };
3824
- }
3825
- Object.defineProperty(o, k2, desc);
3826
- }) : (function(o, m, k, k2) {
3827
- if (k2 === undefined) k2 = k;
3828
- o[k2] = m[k];
3829
- });
3830
-
3831
- function __exportStar(m, o) {
3832
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
3833
- }
3834
-
3835
- function __values(o) {
3836
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3837
- if (m) return m.call(o);
3838
- if (o && typeof o.length === "number") return {
3839
- next: function () {
3840
- if (o && i >= o.length) o = void 0;
3841
- return { value: o && o[i++], done: !o };
3842
- }
3843
- };
3844
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
3845
- }
3846
-
3847
- function __read(o, n) {
3848
- var m = typeof Symbol === "function" && o[Symbol.iterator];
3849
- if (!m) return o;
3850
- var i = m.call(o), r, ar = [], e;
3851
- try {
3852
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
3853
- }
3854
- catch (error) { e = { error: error }; }
3855
- finally {
3856
- try {
3857
- if (r && !r.done && (m = i["return"])) m.call(i);
3858
- }
3859
- finally { if (e) throw e.error; }
3860
- }
3861
- return ar;
3862
- }
3863
-
3864
- /** @deprecated */
3865
- function __spread() {
3866
- for (var ar = [], i = 0; i < arguments.length; i++)
3867
- ar = ar.concat(__read(arguments[i]));
3868
- return ar;
3869
- }
3870
-
3871
- /** @deprecated */
3872
- function __spreadArrays() {
3873
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3874
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
3875
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
3876
- r[k] = a[j];
3877
- return r;
3878
- }
3879
-
3880
- function __spreadArray(to, from, pack) {
3881
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3882
- if (ar || !(i in from)) {
3883
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
3884
- ar[i] = from[i];
3885
- }
3886
- }
3887
- return to.concat(ar || Array.prototype.slice.call(from));
3888
- }
3889
-
3890
- function __await(v) {
3891
- return this instanceof __await ? (this.v = v, this) : new __await(v);
3892
- }
3893
-
3894
- function __asyncGenerator(thisArg, _arguments, generator) {
3895
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
3896
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
3897
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
3898
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
3899
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
3900
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
3901
- function fulfill(value) { resume("next", value); }
3902
- function reject(value) { resume("throw", value); }
3903
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
3904
- }
3905
-
3906
- function __asyncDelegator(o) {
3907
- var i, p;
3908
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
3909
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
3910
- }
3911
-
3912
- function __asyncValues(o) {
3913
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
3914
- var m = o[Symbol.asyncIterator], i;
3915
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
3916
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
3917
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
3918
- }
3919
-
3920
- function __makeTemplateObject(cooked, raw) {
3921
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3922
- return cooked;
3923
- }
3924
- var __setModuleDefault = Object.create ? (function(o, v) {
3925
- Object.defineProperty(o, "default", { enumerable: true, value: v });
3926
- }) : function(o, v) {
3927
- o["default"] = v;
3928
- };
3929
-
3930
- function __importStar(mod) {
3931
- if (mod && mod.__esModule) return mod;
3932
- var result = {};
3933
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
3934
- __setModuleDefault(result, mod);
3935
- return result;
3936
- }
3937
-
3938
- function __importDefault(mod) {
3939
- return (mod && mod.__esModule) ? mod : { default: mod };
3940
- }
3941
-
3942
- function __classPrivateFieldGet(receiver, state, kind, f) {
3943
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3944
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
3945
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
3946
- }
3947
-
3948
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
3949
- if (kind === "m") throw new TypeError("Private method is not writable");
3950
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
3951
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
3952
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
3953
- }
3954
-
3955
- function __classPrivateFieldIn(state, receiver) {
3956
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
3957
- return typeof state === "function" ? receiver === state : state.has(receiver);
3958
- }
3959
-
3960
- var _tslib = /*#__PURE__*/Object.freeze({
3961
- __proto__: null,
3962
- __extends: __extends,
3963
- get __assign () { return __assign; },
3964
- __rest: __rest,
3965
- __decorate: __decorate,
3966
- __param: __param,
3967
- __metadata: __metadata,
3968
- __awaiter: __awaiter,
3969
- __generator: __generator,
3970
- __createBinding: __createBinding,
3971
- __exportStar: __exportStar,
3972
- __values: __values,
3973
- __read: __read,
3974
- __spread: __spread,
3975
- __spreadArrays: __spreadArrays,
3976
- __spreadArray: __spreadArray,
3977
- __await: __await,
3978
- __asyncGenerator: __asyncGenerator,
3979
- __asyncDelegator: __asyncDelegator,
3980
- __asyncValues: __asyncValues,
3981
- __makeTemplateObject: __makeTemplateObject,
3982
- __importStar: __importStar,
3983
- __importDefault: __importDefault,
3984
- __classPrivateFieldGet: __classPrivateFieldGet,
3985
- __classPrivateFieldSet: __classPrivateFieldSet,
3986
- __classPrivateFieldIn: __classPrivateFieldIn
3987
- });
3988
-
3989
- var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(_tslib);
3990
-
3991
- var constants = {};
3992
-
3993
- var hasRequiredConstants;
3994
-
3995
- function requireConstants () {
3996
- if (hasRequiredConstants) return constants;
3997
- hasRequiredConstants = 1;
3998
- (function (exports) {
3999
- Object.defineProperty(exports, "__esModule", { value: true });
4000
- exports.STANDARD_ERROR_MAP = exports.SERVER_ERROR_CODE_RANGE = exports.RESERVED_ERROR_CODES = exports.SERVER_ERROR = exports.INTERNAL_ERROR = exports.INVALID_PARAMS = exports.METHOD_NOT_FOUND = exports.INVALID_REQUEST = exports.PARSE_ERROR = void 0;
4001
- exports.PARSE_ERROR = "PARSE_ERROR";
4002
- exports.INVALID_REQUEST = "INVALID_REQUEST";
4003
- exports.METHOD_NOT_FOUND = "METHOD_NOT_FOUND";
4004
- exports.INVALID_PARAMS = "INVALID_PARAMS";
4005
- exports.INTERNAL_ERROR = "INTERNAL_ERROR";
4006
- exports.SERVER_ERROR = "SERVER_ERROR";
4007
- exports.RESERVED_ERROR_CODES = [-32700, -32600, -32601, -32602, -32603];
4008
- exports.SERVER_ERROR_CODE_RANGE = [-32000, -32099];
4009
- exports.STANDARD_ERROR_MAP = {
4010
- [exports.PARSE_ERROR]: { code: -32700, message: "Parse error" },
4011
- [exports.INVALID_REQUEST]: { code: -32600, message: "Invalid Request" },
4012
- [exports.METHOD_NOT_FOUND]: { code: -32601, message: "Method not found" },
4013
- [exports.INVALID_PARAMS]: { code: -32602, message: "Invalid params" },
4014
- [exports.INTERNAL_ERROR]: { code: -32603, message: "Internal error" },
4015
- [exports.SERVER_ERROR]: { code: -32000, message: "Server error" },
4016
- };
4017
-
4018
- } (constants));
4019
- return constants;
4020
- }
4021
-
4022
- var error = {};
4023
-
4024
- var hasRequiredError;
4025
-
4026
- function requireError () {
4027
- if (hasRequiredError) return error;
4028
- hasRequiredError = 1;
4029
- Object.defineProperty(error, "__esModule", { value: true });
4030
- error.validateJsonRpcError = error.getErrorByCode = error.getError = error.isValidErrorCode = error.isReservedErrorCode = error.isServerErrorCode = void 0;
4031
- const constants_1 = requireConstants();
4032
- function isServerErrorCode(code) {
4033
- return code <= constants_1.SERVER_ERROR_CODE_RANGE[0] && code >= constants_1.SERVER_ERROR_CODE_RANGE[1];
4034
- }
4035
- error.isServerErrorCode = isServerErrorCode;
4036
- function isReservedErrorCode(code) {
4037
- return constants_1.RESERVED_ERROR_CODES.includes(code);
4038
- }
4039
- error.isReservedErrorCode = isReservedErrorCode;
4040
- function isValidErrorCode(code) {
4041
- return typeof code === "number";
4042
- }
4043
- error.isValidErrorCode = isValidErrorCode;
4044
- function getError(type) {
4045
- if (!Object.keys(constants_1.STANDARD_ERROR_MAP).includes(type)) {
4046
- return constants_1.STANDARD_ERROR_MAP[constants_1.INTERNAL_ERROR];
4047
- }
4048
- return constants_1.STANDARD_ERROR_MAP[type];
4049
- }
4050
- error.getError = getError;
4051
- function getErrorByCode(code) {
4052
- const match = Object.values(constants_1.STANDARD_ERROR_MAP).find(e => e.code === code);
4053
- if (!match) {
4054
- return constants_1.STANDARD_ERROR_MAP[constants_1.INTERNAL_ERROR];
4055
- }
4056
- return match;
4057
- }
4058
- error.getErrorByCode = getErrorByCode;
4059
- function validateJsonRpcError(response) {
4060
- if (typeof response.error.code === "undefined") {
4061
- return { valid: false, error: "Missing code for JSON-RPC error" };
4062
- }
4063
- if (typeof response.error.message === "undefined") {
4064
- return { valid: false, error: "Missing message for JSON-RPC error" };
4065
- }
4066
- if (!isValidErrorCode(response.error.code)) {
4067
- return {
4068
- valid: false,
4069
- error: `Invalid error code type for JSON-RPC: ${response.error.code}`,
4070
- };
4071
- }
4072
- if (isReservedErrorCode(response.error.code)) {
4073
- const error = getErrorByCode(response.error.code);
4074
- if (error.message !== constants_1.STANDARD_ERROR_MAP[constants_1.INTERNAL_ERROR].message &&
4075
- response.error.message === error.message) {
4076
- return {
4077
- valid: false,
4078
- error: `Invalid error code message for JSON-RPC: ${response.error.code}`,
4079
- };
4080
- }
4081
- }
4082
- return { valid: true };
4083
- }
4084
- error.validateJsonRpcError = validateJsonRpcError;
4085
-
4086
- return error;
4087
- }
4088
-
4089
- var env$2 = {};
4090
-
4091
- var cjs$1 = {};
4092
-
4093
- var global$1 = (typeof global !== "undefined" ? global :
4094
- typeof self !== "undefined" ? self :
4095
- typeof window !== "undefined" ? window : {});
4096
-
4097
- Object.defineProperty(exports, "__esModule", { value: true });
4098
- exports.isBrowserCryptoAvailable = exports.getSubtleCrypto = exports.getBrowerCrypto = void 0;
4099
- function getBrowerCrypto() {
4100
- return (global$1 === null || global$1 === void 0 ? void 0 : global$1.crypto) || (global$1 === null || global$1 === void 0 ? void 0 : global$1.msCrypto) || {};
4101
- }
4102
- exports.getBrowerCrypto = getBrowerCrypto;
4103
- function getSubtleCrypto() {
4104
- const browserCrypto = getBrowerCrypto();
4105
- return browserCrypto.subtle || browserCrypto.webkitSubtle;
4106
- }
4107
- exports.getSubtleCrypto = getSubtleCrypto;
4108
- function isBrowserCryptoAvailable() {
4109
- return !!getBrowerCrypto() && !!getSubtleCrypto();
4110
- }
4111
- exports.isBrowserCryptoAvailable = isBrowserCryptoAvailable;
4112
-
4113
- var crypto = /*#__PURE__*/Object.freeze({
4114
- __proto__: null
4115
- });
4116
-
4117
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(crypto);
4118
-
4119
- // shim for using process in browser
4120
- // based off https://github.com/defunctzombie/node-process/blob/master/browser.js
4121
-
4122
- function defaultSetTimout() {
4123
- throw new Error('setTimeout has not been defined');
4124
- }
4125
- function defaultClearTimeout () {
4126
- throw new Error('clearTimeout has not been defined');
4127
- }
4128
- var cachedSetTimeout = defaultSetTimout;
4129
- var cachedClearTimeout = defaultClearTimeout;
4130
- if (typeof global$1.setTimeout === 'function') {
4131
- cachedSetTimeout = setTimeout;
4132
- }
4133
- if (typeof global$1.clearTimeout === 'function') {
4134
- cachedClearTimeout = clearTimeout;
4135
- }
4136
-
4137
- function runTimeout(fun) {
4138
- if (cachedSetTimeout === setTimeout) {
4139
- //normal enviroments in sane situations
4140
- return setTimeout(fun, 0);
4141
- }
4142
- // if setTimeout wasn't available but was latter defined
4143
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
4144
- cachedSetTimeout = setTimeout;
4145
- return setTimeout(fun, 0);
4146
- }
4147
- try {
4148
- // when when somebody has screwed with setTimeout but no I.E. maddness
4149
- return cachedSetTimeout(fun, 0);
4150
- } catch(e){
4151
- try {
4152
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4153
- return cachedSetTimeout.call(null, fun, 0);
4154
- } catch(e){
4155
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
4156
- return cachedSetTimeout.call(this, fun, 0);
4157
- }
4158
- }
4159
-
4160
-
4161
- }
4162
- function runClearTimeout(marker) {
4163
- if (cachedClearTimeout === clearTimeout) {
4164
- //normal enviroments in sane situations
4165
- return clearTimeout(marker);
4166
- }
4167
- // if clearTimeout wasn't available but was latter defined
4168
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
4169
- cachedClearTimeout = clearTimeout;
4170
- return clearTimeout(marker);
4171
- }
4172
- try {
4173
- // when when somebody has screwed with setTimeout but no I.E. maddness
4174
- return cachedClearTimeout(marker);
4175
- } catch (e){
4176
- try {
4177
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4178
- return cachedClearTimeout.call(null, marker);
4179
- } catch (e){
4180
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
4181
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
4182
- return cachedClearTimeout.call(this, marker);
4183
- }
4184
- }
4185
-
4186
-
4187
-
4188
- }
4189
- var queue = [];
4190
- var draining = false;
4191
- var currentQueue;
4192
- var queueIndex = -1;
4193
-
4194
- function cleanUpNextTick() {
4195
- if (!draining || !currentQueue) {
4196
- return;
4197
- }
4198
- draining = false;
4199
- if (currentQueue.length) {
4200
- queue = currentQueue.concat(queue);
4201
- } else {
4202
- queueIndex = -1;
4203
- }
4204
- if (queue.length) {
4205
- drainQueue();
4206
- }
4207
- }
4208
-
4209
- function drainQueue() {
4210
- if (draining) {
4211
- return;
4212
- }
4213
- var timeout = runTimeout(cleanUpNextTick);
4214
- draining = true;
4215
-
4216
- var len = queue.length;
4217
- while(len) {
4218
- currentQueue = queue;
4219
- queue = [];
4220
- while (++queueIndex < len) {
4221
- if (currentQueue) {
4222
- currentQueue[queueIndex].run();
4223
- }
4224
- }
4225
- queueIndex = -1;
4226
- len = queue.length;
4227
- }
4228
- currentQueue = null;
4229
- draining = false;
4230
- runClearTimeout(timeout);
4231
- }
4232
- function nextTick(fun) {
4233
- var args = new Array(arguments.length - 1);
4234
- if (arguments.length > 1) {
4235
- for (var i = 1; i < arguments.length; i++) {
4236
- args[i - 1] = arguments[i];
4237
- }
4238
- }
4239
- queue.push(new Item(fun, args));
4240
- if (queue.length === 1 && !draining) {
4241
- runTimeout(drainQueue);
4242
- }
4243
- }
4244
- // v8 likes predictible objects
4245
- function Item(fun, array) {
4246
- this.fun = fun;
4247
- this.array = array;
4248
- }
4249
- Item.prototype.run = function () {
4250
- this.fun.apply(null, this.array);
4251
- };
4252
- var title = 'browser';
4253
- var platform = 'browser';
4254
- var browser = true;
4255
- var env$1 = {};
4256
- var argv = [];
4257
- var version = ''; // empty string to avoid regexp issues
4258
- var versions = {};
4259
- var release = {};
4260
- var config = {};
4261
-
4262
- function noop() {}
4263
-
4264
- var on = noop;
4265
- var addListener = noop;
4266
- var once = noop;
4267
- var off = noop;
4268
- var removeListener = noop;
4269
- var removeAllListeners = noop;
4270
- var emit = noop;
4271
-
4272
- function binding(name) {
4273
- throw new Error('process.binding is not supported');
4274
- }
4275
-
4276
- function cwd () { return '/' }
4277
- function chdir (dir) {
4278
- throw new Error('process.chdir is not supported');
4279
- }function umask() { return 0; }
4280
-
4281
- // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
4282
- var performance = global$1.performance || {};
4283
- var performanceNow =
4284
- performance.now ||
4285
- performance.mozNow ||
4286
- performance.msNow ||
4287
- performance.oNow ||
4288
- performance.webkitNow ||
4289
- function(){ return (new Date()).getTime() };
4290
-
4291
- // generate timestamp or delta
4292
- // see http://nodejs.org/api/process.html#process_process_hrtime
4293
- function hrtime(previousTimestamp){
4294
- var clocktime = performanceNow.call(performance)*1e-3;
4295
- var seconds = Math.floor(clocktime);
4296
- var nanoseconds = Math.floor((clocktime%1)*1e9);
4297
- if (previousTimestamp) {
4298
- seconds = seconds - previousTimestamp[0];
4299
- nanoseconds = nanoseconds - previousTimestamp[1];
4300
- if (nanoseconds<0) {
4301
- seconds--;
4302
- nanoseconds += 1e9;
4303
- }
4304
- }
4305
- return [seconds,nanoseconds]
4306
- }
4307
-
4308
- var startTime = new Date();
4309
- function uptime() {
4310
- var currentTime = new Date();
4311
- var dif = currentTime - startTime;
4312
- return dif / 1000;
4313
- }
4314
-
4315
- var browser$1 = {
4316
- nextTick: nextTick,
4317
- title: title,
4318
- browser: browser,
4319
- env: env$1,
4320
- argv: argv,
4321
- version: version,
4322
- versions: versions,
4323
- on: on,
4324
- addListener: addListener,
4325
- once: once,
4326
- off: off,
4327
- removeListener: removeListener,
4328
- removeAllListeners: removeAllListeners,
4329
- emit: emit,
4330
- binding: binding,
4331
- cwd: cwd,
4332
- chdir: chdir,
4333
- umask: umask,
4334
- hrtime: hrtime,
4335
- platform: platform,
4336
- release: release,
4337
- config: config,
4338
- uptime: uptime
4339
- };
4340
-
4341
- Object.defineProperty(exports, "__esModule", { value: true });
4342
- exports.isBrowser = exports.isNode = exports.isReactNative = void 0;
4343
- function isReactNative() {
4344
- return (typeof document === 'undefined' &&
4345
- typeof navigator !== 'undefined' &&
4346
- navigator.product === 'ReactNative');
4347
- }
4348
- exports.isReactNative = isReactNative;
4349
- function isNode$1() {
4350
- return (typeof browser$1 !== 'undefined' &&
4351
- typeof browser$1.versions !== 'undefined' &&
4352
- typeof browser$1.versions.node !== 'undefined');
4353
- }
4354
- exports.isNode = isNode$1;
4355
- function isBrowser() {
4356
- return !isReactNative() && !isNode$1();
4357
- }
4358
- exports.isBrowser = isBrowser;
4359
-
4360
- var env = /*#__PURE__*/Object.freeze({
4361
- __proto__: null
4362
- });
4363
-
4364
- var require$$1 = /*@__PURE__*/getAugmentedNamespace(env);
4365
-
4366
- var hasRequiredCjs$1;
4367
-
4368
- function requireCjs$1 () {
4369
- if (hasRequiredCjs$1) return cjs$1;
4370
- hasRequiredCjs$1 = 1;
4371
- (function (exports) {
4372
- var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4373
- if (k2 === undefined) k2 = k;
4374
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4375
- }) : (function(o, m, k, k2) {
4376
- if (k2 === undefined) k2 = k;
4377
- o[k2] = m[k];
4378
- }));
4379
- var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
4380
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
4381
- };
4382
- Object.defineProperty(exports, "__esModule", { value: true });
4383
- __exportStar(require$$0, exports);
4384
- __exportStar(require$$1, exports);
4385
-
4386
- } (cjs$1));
4387
- return cjs$1;
4388
- }
4389
-
4390
- var hasRequiredEnv;
4391
-
4392
- function requireEnv () {
4393
- if (hasRequiredEnv) return env$2;
4394
- hasRequiredEnv = 1;
4395
- (function (exports) {
4396
- Object.defineProperty(exports, "__esModule", { value: true });
4397
- exports.isNodeJs = void 0;
4398
- const tslib_1 = require$$0$1;
4399
- const environment_1 = requireCjs$1();
4400
- exports.isNodeJs = environment_1.isNode;
4401
- tslib_1.__exportStar(requireCjs$1(), exports);
4402
-
4403
- } (env$2));
4404
- return env$2;
4405
- }
4406
-
4407
- var format = {};
4408
-
4409
- var hasRequiredFormat;
4410
-
4411
- function requireFormat () {
4412
- if (hasRequiredFormat) return format;
4413
- hasRequiredFormat = 1;
4414
- Object.defineProperty(format, "__esModule", { value: true });
4415
- format.formatErrorMessage = format.formatJsonRpcError = format.formatJsonRpcResult = format.formatJsonRpcRequest = format.payloadId = void 0;
4416
- const error_1 = requireError();
4417
- const constants_1 = requireConstants();
4418
- function payloadId() {
4419
- const date = Date.now() * Math.pow(10, 3);
4420
- const extra = Math.floor(Math.random() * Math.pow(10, 3));
4421
- return date + extra;
4422
- }
4423
- format.payloadId = payloadId;
4424
- function formatJsonRpcRequest(method, params, id) {
4425
- return {
4426
- id: id || payloadId(),
4427
- jsonrpc: "2.0",
4428
- method,
4429
- params,
4430
- };
4431
- }
4432
- format.formatJsonRpcRequest = formatJsonRpcRequest;
4433
- function formatJsonRpcResult(id, result) {
4434
- return {
4435
- id,
4436
- jsonrpc: "2.0",
4437
- result,
4438
- };
4439
- }
4440
- format.formatJsonRpcResult = formatJsonRpcResult;
4441
- function formatJsonRpcError(id, error) {
4442
- return {
4443
- id,
4444
- jsonrpc: "2.0",
4445
- error: formatErrorMessage(error),
4446
- };
4447
- }
4448
- format.formatJsonRpcError = formatJsonRpcError;
4449
- function formatErrorMessage(error) {
4450
- if (typeof error === "undefined") {
4451
- return error_1.getError(constants_1.INTERNAL_ERROR);
4452
- }
4453
- if (typeof error === "string") {
4454
- error = Object.assign(Object.assign({}, error_1.getError(constants_1.SERVER_ERROR)), { message: error });
4455
- }
4456
- if (error_1.isReservedErrorCode(error.code)) {
4457
- error = error_1.getErrorByCode(error.code);
4458
- }
4459
- if (!error_1.isServerErrorCode(error.code)) {
4460
- throw new Error("Error code is not in server code range");
4461
- }
4462
- return error;
4463
- }
4464
- format.formatErrorMessage = formatErrorMessage;
4465
-
4466
- return format;
4467
- }
4468
-
4469
- var routing = {};
4470
-
4471
- var hasRequiredRouting;
4472
-
4473
- function requireRouting () {
4474
- if (hasRequiredRouting) return routing;
4475
- hasRequiredRouting = 1;
4476
- Object.defineProperty(routing, "__esModule", { value: true });
4477
- routing.isValidTrailingWildcardRoute = routing.isValidLeadingWildcardRoute = routing.isValidWildcardRoute = routing.isValidDefaultRoute = routing.isValidRoute = void 0;
4478
- function isValidRoute(route) {
4479
- if (route.includes("*")) {
4480
- return isValidWildcardRoute(route);
4481
- }
4482
- if (/\W/g.test(route)) {
4483
- return false;
4484
- }
4485
- return true;
4486
- }
4487
- routing.isValidRoute = isValidRoute;
4488
- function isValidDefaultRoute(route) {
4489
- return route === "*";
4490
- }
4491
- routing.isValidDefaultRoute = isValidDefaultRoute;
4492
- function isValidWildcardRoute(route) {
4493
- if (isValidDefaultRoute(route)) {
4494
- return true;
4495
- }
4496
- if (!route.includes("*")) {
4497
- return false;
4498
- }
4499
- if (route.split("*").length !== 2) {
4500
- return false;
4501
- }
4502
- if (route.split("*").filter(x => x.trim() === "").length !== 1) {
4503
- return false;
4504
- }
4505
- return true;
4506
- }
4507
- routing.isValidWildcardRoute = isValidWildcardRoute;
4508
- function isValidLeadingWildcardRoute(route) {
4509
- return !isValidDefaultRoute(route) && isValidWildcardRoute(route) && !route.split("*")[0].trim();
4510
- }
4511
- routing.isValidLeadingWildcardRoute = isValidLeadingWildcardRoute;
4512
- function isValidTrailingWildcardRoute(route) {
4513
- return !isValidDefaultRoute(route) && isValidWildcardRoute(route) && !route.split("*")[1].trim();
4514
- }
4515
- routing.isValidTrailingWildcardRoute = isValidTrailingWildcardRoute;
4516
-
4517
- return routing;
4518
- }
4519
-
4520
- var types = {};
4521
-
4522
- var cjs = {};
4523
-
4524
- var blockchain = {};
4525
-
4526
- var misc = {};
4527
-
4528
- var hasRequiredMisc;
4529
-
4530
- function requireMisc () {
4531
- if (hasRequiredMisc) return misc;
4532
- hasRequiredMisc = 1;
4533
- Object.defineProperty(misc, "__esModule", { value: true });
4534
- misc.IEvents = void 0;
4535
- class IEvents {
4536
- }
4537
- misc.IEvents = IEvents;
4538
-
4539
- return misc;
4540
- }
4541
-
4542
- var provider = {};
4543
-
4544
- var hasRequiredProvider;
4545
-
4546
- function requireProvider () {
4547
- if (hasRequiredProvider) return provider;
4548
- hasRequiredProvider = 1;
4549
- Object.defineProperty(provider, "__esModule", { value: true });
4550
- provider.IJsonRpcProvider = provider.IBaseJsonRpcProvider = provider.IJsonRpcConnection = void 0;
4551
- const misc_1 = requireMisc();
4552
- class IJsonRpcConnection extends misc_1.IEvents {
4553
- constructor(opts) {
4554
- super();
4555
- }
4556
- }
4557
- provider.IJsonRpcConnection = IJsonRpcConnection;
4558
- class IBaseJsonRpcProvider extends misc_1.IEvents {
4559
- constructor() {
4560
- super();
4561
- }
4562
- }
4563
- provider.IBaseJsonRpcProvider = IBaseJsonRpcProvider;
4564
- class IJsonRpcProvider extends IBaseJsonRpcProvider {
4565
- constructor(connection) {
4566
- super();
4567
- }
4568
- }
4569
- provider.IJsonRpcProvider = IJsonRpcProvider;
4570
-
4571
- return provider;
4572
- }
4573
-
4574
- var hasRequiredBlockchain;
4575
-
4576
- function requireBlockchain () {
4577
- if (hasRequiredBlockchain) return blockchain;
4578
- hasRequiredBlockchain = 1;
4579
- Object.defineProperty(blockchain, "__esModule", { value: true });
4580
- blockchain.IBlockchainProvider = blockchain.IBlockchainAuthenticator = blockchain.IPendingRequests = void 0;
4581
- const misc_1 = requireMisc();
4582
- const provider_1 = requireProvider();
4583
- class IPendingRequests {
4584
- constructor(storage) {
4585
- this.storage = storage;
4586
- }
4587
- }
4588
- blockchain.IPendingRequests = IPendingRequests;
4589
- class IBlockchainAuthenticator extends misc_1.IEvents {
4590
- constructor(config) {
4591
- super();
4592
- this.config = config;
4593
- }
4594
- }
4595
- blockchain.IBlockchainAuthenticator = IBlockchainAuthenticator;
4596
- class IBlockchainProvider extends provider_1.IJsonRpcProvider {
4597
- constructor(connection, config) {
4598
- super(connection);
4599
- }
4600
- }
4601
- blockchain.IBlockchainProvider = IBlockchainProvider;
4602
-
4603
- return blockchain;
4604
- }
4605
-
4606
- var jsonrpc = {};
4607
-
4608
- var hasRequiredJsonrpc;
4609
-
4610
- function requireJsonrpc () {
4611
- if (hasRequiredJsonrpc) return jsonrpc;
4612
- hasRequiredJsonrpc = 1;
4613
- Object.defineProperty(jsonrpc, "__esModule", { value: true });
4614
-
4615
- return jsonrpc;
4616
- }
4617
-
4618
- var multi = {};
4619
-
4620
- var hasRequiredMulti;
4621
-
4622
- function requireMulti () {
4623
- if (hasRequiredMulti) return multi;
4624
- hasRequiredMulti = 1;
4625
- Object.defineProperty(multi, "__esModule", { value: true });
4626
- multi.IMultiServiceProvider = void 0;
4627
- const provider_1 = requireProvider();
4628
- class IMultiServiceProvider extends provider_1.IBaseJsonRpcProvider {
4629
- constructor(config) {
4630
- super();
4631
- this.config = config;
4632
- }
4633
- }
4634
- multi.IMultiServiceProvider = IMultiServiceProvider;
4635
-
4636
- return multi;
4637
- }
4638
-
4639
- var router = {};
4640
-
4641
- var hasRequiredRouter;
4642
-
4643
- function requireRouter () {
4644
- if (hasRequiredRouter) return router;
4645
- hasRequiredRouter = 1;
4646
- Object.defineProperty(router, "__esModule", { value: true });
4647
- router.IJsonRpcRouter = void 0;
4648
- class IJsonRpcRouter {
4649
- constructor(routes) {
4650
- this.routes = routes;
4651
- }
4652
- }
4653
- router.IJsonRpcRouter = IJsonRpcRouter;
4654
-
4655
- return router;
4656
- }
4657
-
4658
- var schema = {};
4659
-
4660
- var hasRequiredSchema;
4661
-
4662
- function requireSchema () {
4663
- if (hasRequiredSchema) return schema;
4664
- hasRequiredSchema = 1;
4665
- Object.defineProperty(schema, "__esModule", { value: true });
4666
-
4667
- return schema;
4668
- }
4669
-
4670
- var validator = {};
4671
-
4672
- var hasRequiredValidator;
4673
-
4674
- function requireValidator () {
4675
- if (hasRequiredValidator) return validator;
4676
- hasRequiredValidator = 1;
4677
- Object.defineProperty(validator, "__esModule", { value: true });
4678
- validator.IJsonRpcValidator = void 0;
4679
- class IJsonRpcValidator {
4680
- constructor(schemas) {
4681
- this.schemas = schemas;
4682
- }
4683
- }
4684
- validator.IJsonRpcValidator = IJsonRpcValidator;
4685
-
4686
- return validator;
4687
- }
4688
-
4689
- var hasRequiredCjs;
4690
-
4691
- function requireCjs () {
4692
- if (hasRequiredCjs) return cjs;
4693
- hasRequiredCjs = 1;
4694
- (function (exports) {
4695
- Object.defineProperty(exports, "__esModule", { value: true });
4696
- const tslib_1 = require$$0$1;
4697
- tslib_1.__exportStar(requireBlockchain(), exports);
4698
- tslib_1.__exportStar(requireJsonrpc(), exports);
4699
- tslib_1.__exportStar(requireMisc(), exports);
4700
- tslib_1.__exportStar(requireMulti(), exports);
4701
- tslib_1.__exportStar(requireProvider(), exports);
4702
- tslib_1.__exportStar(requireRouter(), exports);
4703
- tslib_1.__exportStar(requireSchema(), exports);
4704
- tslib_1.__exportStar(requireValidator(), exports);
4705
-
4706
- } (cjs));
4707
- return cjs;
4708
- }
4709
-
4710
- var hasRequiredTypes;
4711
-
4712
- function requireTypes () {
4713
- if (hasRequiredTypes) return types;
4714
- hasRequiredTypes = 1;
4715
- (function (exports) {
4716
- Object.defineProperty(exports, "__esModule", { value: true });
4717
- const tslib_1 = require$$0$1;
4718
- tslib_1.__exportStar(requireCjs(), exports);
4719
-
4720
- } (types));
4721
- return types;
4722
- }
4723
-
4724
- var validators = {};
4725
-
4726
- var hasRequiredValidators;
4727
-
4728
- function requireValidators () {
4729
- if (hasRequiredValidators) return validators;
4730
- hasRequiredValidators = 1;
4731
- Object.defineProperty(validators, "__esModule", { value: true });
4732
- validators.isJsonRpcValidationInvalid = validators.isJsonRpcError = validators.isJsonRpcResult = validators.isJsonRpcResponse = validators.isJsonRpcRequest = validators.isJsonRpcPayload = void 0;
4733
- function isJsonRpcPayload(payload) {
4734
- return "id" in payload && "jsonrpc" in payload && payload.jsonrpc === "2.0";
4735
- }
4736
- validators.isJsonRpcPayload = isJsonRpcPayload;
4737
- function isJsonRpcRequest(payload) {
4738
- return isJsonRpcPayload(payload) && "method" in payload;
4739
- }
4740
- validators.isJsonRpcRequest = isJsonRpcRequest;
4741
- function isJsonRpcResponse(payload) {
4742
- return isJsonRpcPayload(payload) && (isJsonRpcResult(payload) || isJsonRpcError(payload));
4743
- }
4744
- validators.isJsonRpcResponse = isJsonRpcResponse;
4745
- function isJsonRpcResult(payload) {
4746
- return "result" in payload;
4747
- }
4748
- validators.isJsonRpcResult = isJsonRpcResult;
4749
- function isJsonRpcError(payload) {
4750
- return "error" in payload;
4751
- }
4752
- validators.isJsonRpcError = isJsonRpcError;
4753
- function isJsonRpcValidationInvalid(validation) {
4754
- return "error" in validation && validation.valid === false;
4755
- }
4756
- validators.isJsonRpcValidationInvalid = isJsonRpcValidationInvalid;
4757
-
4758
- return validators;
4759
- }
4760
-
4761
- (function (exports) {
4762
- Object.defineProperty(exports, "__esModule", { value: true });
4763
- const tslib_1 = require$$0$1;
4764
- tslib_1.__exportStar(requireConstants(), exports);
4765
- tslib_1.__exportStar(requireError(), exports);
4766
- tslib_1.__exportStar(requireEnv(), exports);
4767
- tslib_1.__exportStar(requireFormat(), exports);
4768
- tslib_1.__exportStar(requireRouting(), exports);
4769
- tslib_1.__exportStar(requireTypes(), exports);
4770
- tslib_1.__exportStar(requireValidators(), exports);
4771
-
4772
- } (cjs$2));
4773
-
4774
3690
  class WalletConnectClient extends BaseWallet {
4775
3691
  #client;
4776
3692
  id;
@@ -4794,7 +3710,7 @@ class WalletConnectClient extends BaseWallet {
4794
3710
  port: NODE_PORT,
4795
3711
  };
4796
3712
  const WalletConnect = (await import('@walletconnect/client')).default;
4797
- const QRCodeModal = (await Promise.resolve().then(function () { return index$1; }))
3713
+ const QRCodeModal = (await import('algorand-walletconnect-qrcode-modal'))
4798
3714
  .default;
4799
3715
  const initWallet = {
4800
3716
  id: PROVIDER_ID.WALLET_CONNECT,
@@ -4910,7 +3826,7 @@ class WalletConnectClient extends BaseWallet {
4910
3826
  return acc;
4911
3827
  }, []);
4912
3828
  const requestParams = [txnsToSign];
4913
- const request = cjs$2.formatJsonRpcRequest("algo_signTxn", requestParams);
3829
+ const request = formatJsonRpcRequest("algo_signTxn", requestParams);
4914
3830
  // Play an audio file to keep Wallet Connect's web socket open on iOS
4915
3831
  // when the user goes into background mode.
4916
3832
  this.keepWCAliveStart();
@@ -4932,7 +3848,7 @@ class WalletConnectClient extends BaseWallet {
4932
3848
  async signEncodedTransactions(transactions) {
4933
3849
  const transactionsToSign = this.formatTransactionsArray(transactions);
4934
3850
  const requestParams = [transactionsToSign];
4935
- const request = cjs$2.formatJsonRpcRequest("algo_signTxn", requestParams);
3851
+ const request = formatJsonRpcRequest("algo_signTxn", requestParams);
4936
3852
  this.keepWCAliveStart();
4937
3853
  const result = await this.#client.sendCustomRequest(request);
4938
3854
  this.keepWCAliveStop();
@@ -5189,706 +4105,5 @@ function useConnectWallet(options) {
5189
4105
  };
5190
4106
  }
5191
4107
 
5192
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
5193
-
5194
- var browserUtils = require('@walletconnect/browser-utils');
5195
- var QRCode = _interopDefault(require('qrcode'));
5196
- var copy = _interopDefault(require('copy-to-clipboard'));
5197
- var React = require('preact/compat');
5198
-
5199
- function open(uri) {
5200
- QRCode.toString(uri, {
5201
- type: "terminal"
5202
- }).then(console.log);
5203
- }
5204
-
5205
- var WALLETCONNECT_STYLE_SHEET = ":root {\n --animation-duration: 300ms;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.animated {\n animation-duration: var(--animation-duration);\n animation-fill-mode: both;\n}\n\n.fadeIn {\n animation-name: fadeIn;\n}\n\n.fadeOut {\n animation-name: fadeOut;\n}\n\n#walletconnect-wrapper {\n -webkit-user-select: none;\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n pointer-events: none;\n position: fixed;\n top: 0;\n user-select: none;\n width: 100%;\n z-index: 99999999999999;\n}\n\n.walletconnect-modal__headerLogo {\n height: 21px;\n}\n\n.walletconnect-modal__header p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n align-items: flex-start;\n display: flex;\n flex: 1;\n margin-left: 5px;\n}\n\n.walletconnect-modal__close__wrapper {\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 10000;\n background: white;\n border-radius: 26px;\n padding: 6px;\n box-sizing: border-box;\n width: 26px;\n height: 26px;\n cursor: pointer;\n}\n\n.walletconnect-modal__close__icon {\n position: relative;\n top: 7px;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: rotate(45deg);\n}\n\n.walletconnect-modal__close__line1 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n}\n\n.walletconnect-modal__close__line2 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n transform: rotate(90deg);\n}\n\n.walletconnect-qrcode__base {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n background: rgba(37, 41, 46, 0.95);\n height: 100%;\n left: 0;\n pointer-events: auto;\n position: fixed;\n top: 0;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n width: 100%;\n will-change: opacity;\n padding: 40px;\n box-sizing: border-box;\n}\n\n.walletconnect-qrcode__text {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 10px 0 20px 0;\n text-align: center;\n width: 100%;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-qrcode__text {\n font-size: 4vw;\n }\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-qrcode__text {\n font-size: 14px;\n }\n}\n\n.walletconnect-qrcode__image {\n width: calc(100% - 30px);\n box-sizing: border-box;\n cursor: none;\n margin: 0 auto;\n}\n\n.walletconnect-qrcode__notification {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n font-size: 16px;\n padding: 16px 20px;\n border-radius: 16px;\n text-align: center;\n transition: all 0.1s ease-in-out;\n background: white;\n color: black;\n margin-bottom: -60px;\n opacity: 0;\n}\n\n.walletconnect-qrcode__notification.notification__show {\n opacity: 1;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__header {\n height: 130px;\n }\n .walletconnect-modal__base {\n overflow: auto;\n }\n}\n\n@media only screen and (min-device-width: 415px) and (max-width: 768px) {\n #content {\n max-width: 768px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 375px) and (max-width: 415px) {\n #content {\n max-width: 414px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 320px) and (max-width: 375px) {\n #content {\n max-width: 375px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (max-width: 320px) {\n #content {\n max-width: 320px;\n box-sizing: border-box;\n }\n}\n\n.walletconnect-modal__base {\n -webkit-font-smoothing: antialiased;\n background: #ffffff;\n border-radius: 24px;\n box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);\n font-family: ui-rounded, \"SF Pro Rounded\", \"SF Pro Text\", medium-content-sans-serif-font,\n -apple-system, BlinkMacSystemFont, ui-sans-serif, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell,\n \"Open Sans\", \"Helvetica Neue\", sans-serif;\n margin-top: 41px;\n padding: 24px 24px 22px;\n pointer-events: auto;\n position: relative;\n text-align: center;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n will-change: transform;\n overflow: visible;\n transform: translateY(-50%);\n top: 50%;\n max-width: 500px;\n margin: auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__base {\n padding: 24px 12px;\n }\n}\n\n.walletconnect-modal__base .hidden {\n transform: translateY(150%);\n transition: 0.125s cubic-bezier(0.4, 0, 1, 1);\n}\n\n.walletconnect-modal__header {\n align-items: center;\n display: flex;\n height: 26px;\n left: 0;\n justify-content: space-between;\n position: absolute;\n top: -42px;\n width: 100%;\n}\n\n.walletconnect-modal__base .wc-logo {\n align-items: center;\n display: flex;\n height: 26px;\n margin-top: 15px;\n padding-bottom: 15px;\n pointer-events: auto;\n}\n\n.walletconnect-modal__base .wc-logo div {\n background-color: #3399ff;\n height: 21px;\n margin-right: 5px;\n mask-image: url(\"images/wc-logo.svg\") center no-repeat;\n width: 32px;\n}\n\n.walletconnect-modal__base .wc-logo p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n}\n\n.walletconnect-modal__base h2 {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 0 0 19px 0;\n text-align: center;\n width: 100%;\n}\n\n.walletconnect-modal__base__row {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n align-items: center;\n border-radius: 20px;\n cursor: pointer;\n display: flex;\n height: 56px;\n justify-content: space-between;\n padding: 0 15px;\n position: relative;\n margin: 0px 0px 8px;\n text-align: left;\n transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n will-change: transform;\n text-decoration: none;\n}\n\n.walletconnect-modal__base__row:hover {\n background: rgba(60, 66, 82, 0.06);\n}\n\n.walletconnect-modal__base__row:active {\n background: rgba(60, 66, 82, 0.06);\n transform: scale(0.975);\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n}\n\n.walletconnect-modal__base__row__h3 {\n color: #25292e;\n font-size: 20px;\n font-weight: 700;\n margin: 0;\n padding-bottom: 3px;\n}\n\n.walletconnect-modal__base__row__right {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.walletconnect-modal__base__row__right__app-icon {\n border-radius: 8px;\n height: 34px;\n margin: 0 11px 2px 0;\n width: 34px;\n background-size: 100%;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-modal__base__row__right__caret {\n height: 18px;\n opacity: 0.3;\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n width: 8px;\n will-change: opacity;\n}\n\n.walletconnect-modal__base__row:hover .caret,\n.walletconnect-modal__base__row:active .caret {\n opacity: 0.6;\n}\n\n.walletconnect-modal__mobile__toggle {\n width: 80%;\n display: flex;\n margin: 0 auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n margin-bottom: 18px;\n background: #d4d5d9;\n}\n\n.walletconnect-modal__single_wallet {\n display: flex;\n justify-content: center;\n margin-top: 7px;\n margin-bottom: 18px;\n}\n\n.walletconnect-modal__single_wallet a {\n cursor: pointer;\n color: rgb(64, 153, 255);\n font-size: 21px;\n font-weight: 800;\n text-decoration: none !important;\n margin: 0 auto;\n}\n\n.walletconnect-modal__mobile__toggle_selector {\n width: calc(50% - 8px);\n background: white;\n position: absolute;\n border-radius: 5px;\n height: calc(100% - 8px);\n top: 4px;\n transition: all 0.2s ease-in-out;\n transform: translate3d(4px, 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {\n transform: translate3d(calc(100% + 12px), 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle a {\n font-size: 12px;\n width: 50%;\n text-align: center;\n padding: 8px;\n margin: 0;\n font-weight: 600;\n z-index: 1;\n}\n\n.walletconnect-modal__footer {\n display: flex;\n justify-content: center;\n margin-top: 20px;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__footer {\n margin-top: 5vw;\n }\n}\n\n.walletconnect-modal__footer a {\n cursor: pointer;\n color: #898d97;\n font-size: 15px;\n margin: 0 auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__footer a {\n font-size: 14px;\n }\n}\n\n.walletconnect-connect__buttons__wrapper {\n max-height: 44vh;\n}\n\n.walletconnect-connect__buttons__wrapper__android {\n margin: 50% 0;\n}\n\n.walletconnect-connect__buttons__wrapper__wrap {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n margin: 10px 0;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__buttons__wrapper__wrap {\n margin-top: 40px;\n }\n}\n\n.walletconnect-connect__button {\n background-color: rgb(64, 153, 255);\n padding: 12px;\n border-radius: 8px;\n text-decoration: none;\n color: rgb(255, 255, 255);\n font-weight: 500;\n}\n\n.walletconnect-connect__button__icon_anchor {\n cursor: pointer;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 8px;\n width: 42px;\n justify-self: center;\n flex-direction: column;\n text-decoration: none !important;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-connect__button__icon_anchor {\n margin: 4px;\n }\n}\n\n.walletconnect-connect__button__icon {\n border-radius: 10px;\n height: 42px;\n margin: 0;\n width: 42px;\n background-size: cover !important;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-connect__button__text {\n color: #424952;\n font-size: 2.7vw;\n text-decoration: none !important;\n padding: 0;\n margin-top: 1.8vw;\n font-weight: 600;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__button__text {\n font-size: 16px;\n margin-top: 12px;\n }\n}\n\n.walletconnect-search__input {\n border: none;\n background: #d4d5d9;\n border-style: none;\n padding: 8px 16px;\n outline: none;\n font-style: normal;\n font-stretch: normal;\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: left;\n border-radius: 8px;\n width: calc(100% - 16px);\n margin: 0;\n margin-bottom: 8px;\n}\n";
5206
-
5207
- var WALLETCONNECT_LOGO_SVG_URL = "data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E";
5208
-
5209
- var WALLETCONNECT_HEADER_TEXT = "WalletConnect";
5210
- var ANIMATION_DURATION = 300;
5211
- var DEFAULT_BUTTON_COLOR = "rgb(64, 153, 255)";
5212
- var WALLETCONNECT_WRAPPER_ID = "walletconnect-wrapper";
5213
- var WALLETCONNECT_STYLE_ID = "walletconnect-style-sheet";
5214
- var WALLETCONNECT_MODAL_ID = "walletconnect-qrcode-modal";
5215
- var WALLETCONNECT_CLOSE_BUTTON_ID = "walletconnect-qrcode-close";
5216
- var WALLETCONNECT_CTA_TEXT_ID = "walletconnect-qrcode-text";
5217
- var WALLETCONNECT_CONNECT_BUTTON_ID = "walletconnect-connect-button";
5218
-
5219
- function Header(props) {
5220
- return React.createElement("div", {
5221
- className: "walletconnect-modal__header"
5222
- }, React.createElement("img", {
5223
- src: WALLETCONNECT_LOGO_SVG_URL,
5224
- className: "walletconnect-modal__headerLogo"
5225
- }), React.createElement("p", null, WALLETCONNECT_HEADER_TEXT), React.createElement("div", {
5226
- className: "walletconnect-modal__close__wrapper",
5227
- onClick: props.onClose
5228
- }, React.createElement("div", {
5229
- id: WALLETCONNECT_CLOSE_BUTTON_ID,
5230
- className: "walletconnect-modal__close__icon"
5231
- }, React.createElement("div", {
5232
- className: "walletconnect-modal__close__line1"
5233
- }), React.createElement("div", {
5234
- className: "walletconnect-modal__close__line2"
5235
- }))));
5236
- }
5237
-
5238
- function ConnectButton(props) {
5239
- return React.createElement("a", {
5240
- className: "walletconnect-connect__button",
5241
- href: props.href,
5242
- id: (WALLETCONNECT_CONNECT_BUTTON_ID + "-" + (props.name)),
5243
- onClick: props.onClick,
5244
- rel: "noopener noreferrer",
5245
- style: {
5246
- backgroundColor: props.color
5247
- },
5248
- target: "_blank"
5249
- }, props.name);
5250
- }
5251
-
5252
- var CARET_SVG_URL = "data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E";
5253
-
5254
- function WalletButton(props) {
5255
- var color = props.color;
5256
- var href = props.href;
5257
- var name = props.name;
5258
- var logo = props.logo;
5259
- var onClick = props.onClick;
5260
- return React.createElement("a", {
5261
- className: "walletconnect-modal__base__row",
5262
- href: href,
5263
- onClick: onClick,
5264
- rel: "noopener noreferrer",
5265
- target: "_blank"
5266
- }, React.createElement("h3", {
5267
- className: "walletconnect-modal__base__row__h3"
5268
- }, name), React.createElement("div", {
5269
- className: "walletconnect-modal__base__row__right"
5270
- }, React.createElement("div", {
5271
- className: "walletconnect-modal__base__row__right__app-icon",
5272
- style: {
5273
- background: ("url('" + logo + "') " + color),
5274
- backgroundSize: "100%"
5275
- }
5276
- }), React.createElement("img", {
5277
- src: CARET_SVG_URL,
5278
- className: "walletconnect-modal__base__row__right__caret"
5279
- })));
5280
- }
5281
-
5282
- function WalletIcon(props) {
5283
- var color = props.color;
5284
- var href = props.href;
5285
- var name = props.name;
5286
- var logo = props.logo;
5287
- var onClick = props.onClick;
5288
- var fontSize = window.innerWidth < 768 ? ((name.length > 8 ? 2.5 : 2.7) + "vw") : "inherit";
5289
- return React.createElement("a", {
5290
- className: "walletconnect-connect__button__icon_anchor",
5291
- href: href,
5292
- onClick: onClick,
5293
- rel: "noopener noreferrer",
5294
- target: "_blank"
5295
- }, React.createElement("div", {
5296
- className: "walletconnect-connect__button__icon",
5297
- style: {
5298
- background: ("url('" + logo + "') " + color),
5299
- backgroundSize: "100%"
5300
- }
5301
- }), React.createElement("div", {
5302
- style: {
5303
- fontSize: fontSize
5304
- },
5305
- className: "walletconnect-connect__button__text"
5306
- }, name));
5307
- }
5308
-
5309
- var GRID_MIN_COUNT = 5;
5310
- var LINKS_PER_PAGE = 12;
5311
-
5312
- function LinkDisplay(props) {
5313
- var android = browserUtils.isAndroid();
5314
- var ref = React.useState("");
5315
- var input = ref[0];
5316
- var setInput = ref[1];
5317
- var ref$1 = React.useState("");
5318
- var filter = ref$1[0];
5319
- var setFilter = ref$1[1];
5320
- var ref$2 = React.useState(1);
5321
- var page = ref$2[0];
5322
- var setPage = ref$2[1];
5323
- var links = filter ? props.links.filter(function (link) { return link.name.toLowerCase().includes(filter.toLowerCase()); }) : props.links;
5324
- var errorMessage = props.errorMessage;
5325
- var grid = filter || links.length > GRID_MIN_COUNT;
5326
- var pages = Math.ceil(links.length / LINKS_PER_PAGE);
5327
- var range = [(page - 1) * LINKS_PER_PAGE + 1, page * LINKS_PER_PAGE];
5328
- var pageLinks = links.length ? links.filter(function (_, index) { return index + 1 >= range[0] && index + 1 <= range[1]; }) : [];
5329
- var hasPaging = !!(!android && pages > 1);
5330
- var filterTimeout = undefined;
5331
-
5332
- function handleInput(e) {
5333
- setInput(e.target.value);
5334
- clearTimeout(filterTimeout);
5335
-
5336
- if (e.target.value) {
5337
- filterTimeout = setTimeout(function () {
5338
- setFilter(e.target.value);
5339
- setPage(1);
5340
- }, 1000);
5341
- } else {
5342
- setInput("");
5343
- setFilter("");
5344
- setPage(1);
5345
- }
5346
- }
5347
-
5348
- return React.createElement("div", null, React.createElement("p", {
5349
- id: WALLETCONNECT_CTA_TEXT_ID,
5350
- className: "walletconnect-qrcode__text"
5351
- }, android ? props.text.connect_mobile_wallet : props.text.choose_preferred_wallet), !android && React.createElement("input", {
5352
- className: "walletconnect-search__input",
5353
- placeholder: "Search",
5354
- value: input,
5355
- onChange: handleInput
5356
- }), React.createElement("div", {
5357
- className: ("walletconnect-connect__buttons__wrapper" + (android ? "__android" : grid && links.length ? "__wrap" : ""))
5358
- }, !android ? pageLinks.length ? pageLinks.map(function (entry) {
5359
- var color = entry.color;
5360
- var name = entry.name;
5361
- var shortName = entry.shortName;
5362
- var logo = entry.logo;
5363
- var href = browserUtils.formatIOSMobile(props.uri, entry);
5364
- var handleClickIOS = React.useCallback(function () {
5365
- browserUtils.saveMobileLinkInfo({
5366
- name: name,
5367
- href: href
5368
- });
5369
- }, [pageLinks]);
5370
- return !grid ? React.createElement(WalletButton, {
5371
- color: color,
5372
- href: href,
5373
- name: name,
5374
- logo: logo,
5375
- onClick: handleClickIOS
5376
- }) : React.createElement(WalletIcon, {
5377
- color: color,
5378
- href: href,
5379
- name: shortName || name,
5380
- logo: logo,
5381
- onClick: handleClickIOS
5382
- });
5383
- }) : React.createElement(React.Fragment, null, React.createElement("p", null, errorMessage.length ? props.errorMessage : !!props.links.length && !links.length ? props.text.no_wallets_found : props.text.loading)) : React.createElement(ConnectButton, {
5384
- name: props.text.connect,
5385
- color: DEFAULT_BUTTON_COLOR,
5386
- href: props.uri,
5387
- onClick: React.useCallback(function () {
5388
- browserUtils.saveMobileLinkInfo({
5389
- name: "Unknown",
5390
- href: props.uri
5391
- });
5392
- }, [])
5393
- })), hasPaging && React.createElement("div", {
5394
- className: "walletconnect-modal__footer"
5395
- }, Array(pages).fill(0).map(function (_, index) {
5396
- var pageNumber = index + 1;
5397
- var selected = page === pageNumber;
5398
- return React.createElement("a", {
5399
- style: {
5400
- margin: "auto 10px",
5401
- fontWeight: selected ? "bold" : "normal"
5402
- },
5403
- onClick: function () { return setPage(pageNumber); }
5404
- }, pageNumber);
5405
- })));
5406
- }
5407
-
5408
- function Notification(props) {
5409
- var show = !!props.message.trim();
5410
- return React.createElement("div", {
5411
- className: ("walletconnect-qrcode__notification" + (show ? " notification__show" : ""))
5412
- }, props.message);
5413
- }
5414
-
5415
- var formatQRCodeImage = function (data) {
5416
- try {
5417
- var result = "";
5418
- return Promise.resolve(QRCode.toString(data, {
5419
- margin: 0,
5420
- type: "svg"
5421
- })).then(function (dataString) {
5422
- if (typeof dataString === "string") {
5423
- result = dataString.replace("<svg", "<svg class=\"walletconnect-qrcode__image\"");
5424
- }
5425
-
5426
- return result;
5427
- });
5428
- } catch (e) {
5429
- return Promise.reject(e);
5430
- }
5431
- };
5432
-
5433
- function QRCodeDisplay(props) {
5434
- var ref = React.useState("");
5435
- var notification = ref[0];
5436
- var setNotification = ref[1];
5437
- var ref$1 = React.useState("");
5438
- var svg = ref$1[0];
5439
- var setSvg = ref$1[1];
5440
- React.useEffect(function () {
5441
- try {
5442
- return Promise.resolve(formatQRCodeImage(props.uri)).then(function (_formatQRCodeImage) {
5443
- setSvg(_formatQRCodeImage);
5444
- });
5445
- } catch (e) {
5446
- Promise.reject(e);
5447
- }
5448
- }, []);
5449
-
5450
- var copyToClipboard = function () {
5451
- var success = copy(props.uri);
5452
-
5453
- if (success) {
5454
- setNotification(props.text.copied_to_clipboard);
5455
- setInterval(function () { return setNotification(""); }, 1200);
5456
- } else {
5457
- setNotification("Error");
5458
- setInterval(function () { return setNotification(""); }, 1200);
5459
- }
5460
- };
5461
-
5462
- return React.createElement("div", null, React.createElement("p", {
5463
- id: WALLETCONNECT_CTA_TEXT_ID,
5464
- className: "walletconnect-qrcode__text"
5465
- }, props.text.scan_qrcode_with_wallet), React.createElement("div", {
5466
- dangerouslySetInnerHTML: {
5467
- __html: svg
5468
- }
5469
- }), React.createElement("div", {
5470
- className: "walletconnect-modal__footer"
5471
- }, React.createElement("a", {
5472
- onClick: copyToClipboard
5473
- }, props.text.copy_to_clipboard)), React.createElement(Notification, {
5474
- message: notification
5475
- }));
5476
- }
5477
-
5478
- var officialAlgorandWallet = {
5479
- id: "23138217b046ae8d9d07e62b3337fb288c4445f92f64be067809cd0a8f9454b9",
5480
- name: "Pera Wallet",
5481
- homepage: "https://perawallet.app",
5482
- chains: ["algorand"],
5483
- image_id: "1765f9aa-f99e-414e-826b-6b570d480999",
5484
- image_url: {
5485
- sm: "https://algorand-app.s3.amazonaws.com/app-icons/Pera-walletconnect-128.png",
5486
- md: "https://algorand-app.s3.amazonaws.com/app-icons/Pera-walletconnect-128.png",
5487
- lg: "https://algorand-app.s3.amazonaws.com/app-icons/Pera-walletconnect-128.png"
5488
- },
5489
- app: {
5490
- browser: "",
5491
- ios: "https://apps.apple.com/us/app/algorand-wallet/id1459898525",
5492
- android: "https://play.google.com/store/apps/details?id=com.algorand.android",
5493
- mac: "",
5494
- windows: "",
5495
- linux: ""
5496
- },
5497
- mobile: {
5498
- native: "algorand-wc:",
5499
- universal: ""
5500
- },
5501
- desktop: {
5502
- native: "",
5503
- universal: ""
5504
- },
5505
- metadata: {
5506
- shortName: "Pera Wallet",
5507
- colors: {
5508
- primary: "rgb(255, 238, 85)",
5509
- secondary: ""
5510
- }
5511
- }
5512
- };
5513
- var registry = {};
5514
- registry[officialAlgorandWallet.id] = officialAlgorandWallet;
5515
-
5516
- function Modal(props) {
5517
- var android = browserUtils.isAndroid();
5518
- var mobile = browserUtils.isMobile();
5519
- var whitelist = mobile ? props.qrcodeModalOptions && props.qrcodeModalOptions.mobileLinks ? props.qrcodeModalOptions.mobileLinks : undefined : props.qrcodeModalOptions && props.qrcodeModalOptions.desktopLinks ? props.qrcodeModalOptions.desktopLinks : undefined;
5520
- var ref = React.useState(false);
5521
- var loading = ref[0];
5522
- var setLoading = ref[1];
5523
- var ref$1 = React.useState(false);
5524
- var fetched = ref$1[0];
5525
- var setFetched = ref$1[1];
5526
- var ref$2 = React.useState(!mobile);
5527
- var displayQRCode = ref$2[0];
5528
- var setDisplayQRCode = ref$2[1];
5529
- var displayProps = {
5530
- mobile: mobile,
5531
- text: props.text,
5532
- uri: props.uri,
5533
- qrcodeModalOptions: props.qrcodeModalOptions
5534
- };
5535
- var ref$3 = React.useState("");
5536
- var singleLinkHref = ref$3[0];
5537
- var setSingleLinkHref = ref$3[1];
5538
- var ref$4 = React.useState(false);
5539
- var hasSingleLink = ref$4[0];
5540
- var setHasSingleLink = ref$4[1];
5541
- var ref$5 = React.useState([]);
5542
- var links = ref$5[0];
5543
- var setLinks = ref$5[1];
5544
- var ref$6 = React.useState("");
5545
- var errorMessage = ref$6[0];
5546
- var setErrorMessage = ref$6[1];
5547
-
5548
- var getLinksIfNeeded = function () {
5549
- if (fetched || loading || whitelist && !whitelist.length || links.length > 0) {
5550
- return;
5551
- }
5552
-
5553
- React.useEffect(function () {
5554
- var initLinks = function () {
5555
- try {
5556
- if (android) { return Promise.resolve(); }
5557
- setLoading(true);
5558
-
5559
- try {
5560
- var platform = mobile ? "mobile" : "desktop";
5561
-
5562
- var _links = browserUtils.getMobileLinkRegistry(browserUtils.formatMobileRegistry(registry, platform), whitelist);
5563
-
5564
- setLoading(false);
5565
- setFetched(true);
5566
- setErrorMessage(!_links.length ? props.text.no_supported_wallets : "");
5567
- setLinks(_links);
5568
- var hasSingleLink = _links.length === 1;
5569
-
5570
- if (hasSingleLink) {
5571
- setSingleLinkHref(browserUtils.formatIOSMobile(props.uri, _links[0]));
5572
- setDisplayQRCode(true);
5573
- }
5574
-
5575
- setHasSingleLink(hasSingleLink);
5576
- } catch (e) {
5577
- setLoading(false);
5578
- setFetched(true);
5579
- setErrorMessage(props.text.something_went_wrong);
5580
- console.error(e);
5581
- }
5582
-
5583
- return Promise.resolve();
5584
- } catch (e) {
5585
- return Promise.reject(e);
5586
- }
5587
- };
5588
-
5589
- initLinks();
5590
- });
5591
- };
5592
-
5593
- getLinksIfNeeded();
5594
- var rightSelected = mobile ? displayQRCode : !displayQRCode;
5595
- return React.createElement("div", {
5596
- id: WALLETCONNECT_MODAL_ID,
5597
- className: "walletconnect-qrcode__base animated fadeIn"
5598
- }, React.createElement("div", {
5599
- className: "walletconnect-modal__base"
5600
- }, React.createElement(Header, {
5601
- onClose: props.onClose
5602
- }), hasSingleLink && displayQRCode ? React.createElement("div", {
5603
- className: "walletconnect-modal__single_wallet"
5604
- }, React.createElement("a", {
5605
- onClick: function () { return browserUtils.saveMobileLinkInfo({
5606
- name: links[0].name,
5607
- href: singleLinkHref
5608
- }); },
5609
- href: singleLinkHref,
5610
- rel: "noopener noreferrer",
5611
- target: "_blank"
5612
- }, props.text.connect_with + " " + (hasSingleLink ? links[0].name : "") + " ›")) : android || loading || !loading && links.length ? React.createElement("div", {
5613
- className: ("walletconnect-modal__mobile__toggle" + (rightSelected ? " right__selected" : ""))
5614
- }, React.createElement("div", {
5615
- className: "walletconnect-modal__mobile__toggle_selector"
5616
- }), mobile ? React.createElement(React.Fragment, null, React.createElement("a", {
5617
- onClick: function () { return (setDisplayQRCode(false), getLinksIfNeeded()); }
5618
- }, props.text.mobile), React.createElement("a", {
5619
- onClick: function () { return setDisplayQRCode(true); }
5620
- }, props.text.qrcode)) : React.createElement(React.Fragment, null, React.createElement("a", {
5621
- onClick: function () { return setDisplayQRCode(true); }
5622
- }, props.text.qrcode), React.createElement("a", {
5623
- onClick: function () { return (setDisplayQRCode(false), getLinksIfNeeded()); }
5624
- }, props.text.desktop))) : null, React.createElement("div", null, displayQRCode || !android && !loading && !links.length ? React.createElement(QRCodeDisplay, Object.assign({}, displayProps)) : React.createElement(LinkDisplay, Object.assign({}, displayProps,
5625
- {links: links,
5626
- errorMessage: errorMessage})))));
5627
- }
5628
-
5629
- var de = {
5630
- choose_preferred_wallet: "Wähle bevorzugte Wallet",
5631
- connect_mobile_wallet: "Verbinde mit Mobile Wallet",
5632
- scan_qrcode_with_wallet: "Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",
5633
- connect: "Verbinden",
5634
- qrcode: "QR-Code",
5635
- mobile: "Mobile",
5636
- desktop: "Desktop",
5637
- copy_to_clipboard: "In die Zwischenablage kopieren",
5638
- copied_to_clipboard: "In die Zwischenablage kopiert!",
5639
- connect_with: "Verbinden mit Hilfe von",
5640
- loading: "Laden...",
5641
- something_went_wrong: "Etwas ist schief gelaufen",
5642
- no_supported_wallets: "Es gibt noch keine unterstützten Wallet",
5643
- no_wallets_found: "keine Wallet gefunden"
5644
- };
5645
-
5646
- var en = {
5647
- choose_preferred_wallet: "Choose your preferred wallet",
5648
- connect_mobile_wallet: "Connect to Mobile Wallet",
5649
- scan_qrcode_with_wallet: "Scan QR code with a WalletConnect-compatible wallet",
5650
- connect: "Connect",
5651
- qrcode: "QR Code",
5652
- mobile: "Mobile",
5653
- desktop: "Desktop",
5654
- copy_to_clipboard: "Copy to clipboard",
5655
- copied_to_clipboard: "Copied to clipboard!",
5656
- connect_with: "Connect with",
5657
- loading: "Loading...",
5658
- something_went_wrong: "Something went wrong",
5659
- no_supported_wallets: "There are no supported wallets yet",
5660
- no_wallets_found: "No wallets found"
5661
- };
5662
-
5663
- var es = {
5664
- choose_preferred_wallet: "Elige tu billetera preferida",
5665
- connect_mobile_wallet: "Conectar a billetera móvil",
5666
- scan_qrcode_with_wallet: "Escanea el código QR con una billetera compatible con WalletConnect",
5667
- connect: "Conectar",
5668
- qrcode: "Código QR",
5669
- mobile: "Móvil",
5670
- desktop: "Desktop",
5671
- copy_to_clipboard: "Copiar",
5672
- copied_to_clipboard: "Copiado!",
5673
- connect_with: "Conectar mediante",
5674
- loading: "Cargando...",
5675
- something_went_wrong: "Algo salió mal",
5676
- no_supported_wallets: "Todavía no hay billeteras compatibles",
5677
- no_wallets_found: "No se encontraron billeteras"
5678
- };
5679
-
5680
- var fr = {
5681
- choose_preferred_wallet: "Choisissez votre portefeuille préféré",
5682
- connect_mobile_wallet: "Se connecter au portefeuille mobile",
5683
- scan_qrcode_with_wallet: "Scannez le QR code avec un portefeuille compatible WalletConnect",
5684
- connect: "Se connecter",
5685
- qrcode: "QR Code",
5686
- mobile: "Mobile",
5687
- desktop: "Desktop",
5688
- copy_to_clipboard: "Copier",
5689
- copied_to_clipboard: "Copié!",
5690
- connect_with: "Connectez-vous à l'aide de",
5691
- loading: "Chargement...",
5692
- something_went_wrong: "Quelque chose a mal tourné",
5693
- no_supported_wallets: "Il n'y a pas encore de portefeuilles pris en charge",
5694
- no_wallets_found: "Aucun portefeuille trouvé"
5695
- };
5696
-
5697
- var ko = {
5698
- choose_preferred_wallet: "원하는 지갑을 선택하세요",
5699
- connect_mobile_wallet: "모바일 지갑과 연결",
5700
- scan_qrcode_with_wallet: "WalletConnect 지원 지갑에서 QR코드를 스캔하세요",
5701
- connect: "연결",
5702
- qrcode: "QR 코드",
5703
- mobile: "모바일",
5704
- desktop: "데스크탑",
5705
- copy_to_clipboard: "클립보드에 복사",
5706
- copied_to_clipboard: "클립보드에 복사되었습니다!",
5707
- connect_with: "와 연결하다",
5708
- loading: "로드 중...",
5709
- something_went_wrong: "문제가 발생했습니다.",
5710
- no_supported_wallets: "아직 지원되는 지갑이 없습니다",
5711
- no_wallets_found: "지갑을 찾을 수 없습니다"
5712
- };
5713
-
5714
- var pt = {
5715
- choose_preferred_wallet: "Escolha sua carteira preferida",
5716
- connect_mobile_wallet: "Conectar-se à carteira móvel",
5717
- scan_qrcode_with_wallet: "Ler o código QR com uma carteira compatível com WalletConnect",
5718
- connect: "Conectar",
5719
- qrcode: "Código QR",
5720
- mobile: "Móvel",
5721
- desktop: "Desktop",
5722
- copy_to_clipboard: "Copiar",
5723
- copied_to_clipboard: "Copiado!",
5724
- connect_with: "Ligar por meio de",
5725
- loading: "Carregamento...",
5726
- something_went_wrong: "Algo correu mal",
5727
- no_supported_wallets: "Ainda não há carteiras suportadas",
5728
- no_wallets_found: "Nenhuma carteira encontrada"
5729
- };
5730
-
5731
- var zh = {
5732
- choose_preferred_wallet: "选择你的钱包",
5733
- connect_mobile_wallet: "连接至移动端钱包",
5734
- scan_qrcode_with_wallet: "使用兼容 WalletConnect 的钱包扫描二维码",
5735
- connect: "连接",
5736
- qrcode: "二维码",
5737
- mobile: "移动",
5738
- desktop: "桌面",
5739
- copy_to_clipboard: "复制到剪贴板",
5740
- copied_to_clipboard: "复制到剪贴板成功!",
5741
- connect_with: "通过以下方式连接",
5742
- loading: "正在加载...",
5743
- something_went_wrong: "出了问题",
5744
- no_supported_wallets: "目前还没有支持的钱包",
5745
- no_wallets_found: "没有找到钱包"
5746
- };
5747
-
5748
- var fa = {
5749
- choose_preferred_wallet: "کیف پول مورد نظر خود را انتخاب کنید",
5750
- connect_mobile_wallet: "به کیف پول موبایل وصل شوید",
5751
- scan_qrcode_with_wallet: "کد QR را با یک کیف پول سازگار با WalletConnect اسکن کنید",
5752
- connect: "اتصال",
5753
- qrcode: "کد QR",
5754
- mobile: "سیار",
5755
- desktop: "دسکتاپ",
5756
- copy_to_clipboard: "کپی به کلیپ بورد",
5757
- copied_to_clipboard: "در کلیپ بورد کپی شد!",
5758
- connect_with: "ارتباط با",
5759
- loading: "...بارگذاری",
5760
- something_went_wrong: "مشکلی پیش آمد",
5761
- no_supported_wallets: "هنوز هیچ کیف پول پشتیبانی شده ای وجود ندارد",
5762
- no_wallets_found: "هیچ کیف پولی پیدا نشد"
5763
- };
5764
-
5765
- var languages = {
5766
- de: de,
5767
- en: en,
5768
- es: es,
5769
- fr: fr,
5770
- ko: ko,
5771
- pt: pt,
5772
- zh: zh,
5773
- fa: fa
5774
- };
5775
-
5776
- function injectStyleSheet() {
5777
- var doc = browserUtils.getDocumentOrThrow();
5778
- var prev = doc.getElementById(WALLETCONNECT_STYLE_ID);
5779
-
5780
- if (prev) {
5781
- doc.head.removeChild(prev);
5782
- }
5783
-
5784
- var style = doc.createElement("style");
5785
- style.setAttribute("id", WALLETCONNECT_STYLE_ID);
5786
- style.innerText = WALLETCONNECT_STYLE_SHEET;
5787
- doc.head.appendChild(style);
5788
- }
5789
-
5790
- function renderWrapper() {
5791
- var doc = browserUtils.getDocumentOrThrow();
5792
- var wrapper = doc.createElement("div");
5793
- wrapper.setAttribute("id", WALLETCONNECT_WRAPPER_ID);
5794
- doc.body.appendChild(wrapper);
5795
- return wrapper;
5796
- }
5797
-
5798
- function triggerCloseAnimation() {
5799
- var doc = browserUtils.getDocumentOrThrow();
5800
- var modal = doc.getElementById(WALLETCONNECT_MODAL_ID);
5801
-
5802
- if (modal) {
5803
- modal.className = modal.className.replace("fadeIn", "fadeOut");
5804
- setTimeout(function () {
5805
- var wrapper = doc.getElementById(WALLETCONNECT_WRAPPER_ID);
5806
-
5807
- if (wrapper) {
5808
- doc.body.removeChild(wrapper);
5809
- }
5810
- }, ANIMATION_DURATION);
5811
- }
5812
- }
5813
-
5814
- function getWrappedCallback(cb) {
5815
- return function () {
5816
- triggerCloseAnimation();
5817
-
5818
- if (cb) {
5819
- cb();
5820
- }
5821
- };
5822
- }
5823
-
5824
- function getText() {
5825
- var lang = browserUtils.getNavigatorOrThrow().language.split("-")[0] || "en";
5826
- return languages[lang] || languages["en"];
5827
- }
5828
-
5829
- function open$1(uri, cb, qrcodeModalOptions) {
5830
- injectStyleSheet();
5831
- var wrapper = renderWrapper();
5832
- React.render(React.createElement(Modal, {
5833
- text: getText(),
5834
- uri: uri,
5835
- onClose: getWrappedCallback(cb),
5836
- qrcodeModalOptions: qrcodeModalOptions
5837
- }), wrapper);
5838
- }
5839
- function close$1() {
5840
- triggerCloseAnimation();
5841
- }
5842
-
5843
- var ALGORAND_QUERY_PARAM_NAME = "algorand";
5844
- function transformUri(uri, addAlgorandMarkerToUri) {
5845
- if (addAlgorandMarkerToUri == null || addAlgorandMarkerToUri) {
5846
- var urlObject = new URL(uri);
5847
-
5848
- if (!urlObject.searchParams.has(ALGORAND_QUERY_PARAM_NAME)) {
5849
- urlObject.searchParams.set(ALGORAND_QUERY_PARAM_NAME, "true");
5850
- return urlObject.toString();
5851
- }
5852
- }
5853
-
5854
- return uri;
5855
- }
5856
-
5857
- function objectWithoutProperties (obj, exclude) { var target = {}; for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) target[k] = obj[k]; return target; }
5858
-
5859
- var isNode = function () { return typeof browser$1 !== "undefined" && typeof browser$1.versions !== "undefined" && typeof browser$1.versions.node !== "undefined"; };
5860
-
5861
- function open$2(uri, cb, qrcodeModalOptions) {
5862
- var ref = qrcodeModalOptions || {};
5863
- var addAlgorandMarkerToUri = ref.addAlgorandMarkerToUri;
5864
- var rest = objectWithoutProperties( ref, ["addAlgorandMarkerToUri"] );
5865
- var vanillaOptions = rest;
5866
- uri = transformUri(uri, addAlgorandMarkerToUri);
5867
- console.log(uri);
5868
-
5869
- if (isNode()) {
5870
- open(uri);
5871
- } else {
5872
- open$1(uri, cb, vanillaOptions);
5873
- }
5874
- }
5875
-
5876
- function close$2() {
5877
- if (isNode()) ; else {
5878
- close$1();
5879
- }
5880
- }
5881
-
5882
- var index = {
5883
- open: open$2,
5884
- close: close$2
5885
- };
5886
-
5887
- module.exports = index;
5888
-
5889
- var index$1 = /*#__PURE__*/Object.freeze({
5890
- __proto__: null
5891
- });
5892
-
5893
4108
  export { KMD_HOST, KMD_PASSWORD, KMD_PORT, KMD_TOKEN, KMD_WALLET$1 as KMD_WALLET, NODE_NETWORK, NODE_PORT, NODE_SERVER, NODE_TOKEN, PROVIDER_ID, clients, convertMicroalgosToAlgos, formatPrice, getWalletClient, providers, useConnectWallet, useWallet };
5894
4109
  //# sourceMappingURL=index.js.map