@wormhole-foundation/wormhole-connect 3.0.0-beta.1-development → 3.0.0-beta.4-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/assets/{aptos-D9VsvuGi.js → aptos-174MkQkp.js} +2 -2
  2. package/dist/assets/{ccip-u-dcupj6.js → ccip-Clh7lDFd.js} +1 -1
  3. package/dist/assets/{create-CPwTP7kz.js → create-BrCILL-b.js} +1 -1
  4. package/dist/assets/events-Qrc8Qc0_.js +1 -0
  5. package/dist/assets/{evm-BsYn5oKw.js → evm-Dxka2v4f.js} +3 -3
  6. package/dist/assets/{evm-PXwgtnG4.js → evm-zU4C--zf.js} +2 -2
  7. package/dist/assets/{index-B6dxRQ86.js → index-4D-1dcJ9.js} +1 -1
  8. package/dist/assets/{index-CeaghD18.js → index-5IQaHp4s.js} +1 -1
  9. package/dist/assets/{index-ZIIwf20G.js → index-6HbyQ3jY.js} +1 -1
  10. package/dist/assets/{index-Cz_gZSPA.js → index-B6DtW1dg.js} +1 -1
  11. package/dist/assets/{index-CgFxnAZU.js → index-BcCKudwp.js} +2 -2
  12. package/dist/assets/{index-xgCvqsOD.js → index-Bi_XAyhv.js} +1 -1
  13. package/dist/assets/{index-C_fbsqYy.js → index-CAi0XN_b.js} +1 -1
  14. package/dist/assets/{index-B8PSBQZ9.js → index-CBLLe3hL.js} +1 -1
  15. package/dist/assets/{index-DL0M3nJj.js → index-CTAjt_cp.js} +1 -1
  16. package/dist/assets/{index-B5MVX_TK.js → index-CVMIiUin.js} +1 -1
  17. package/dist/assets/{index-CCKwEjtb.js → index-CW9rA1zL.js} +1 -1
  18. package/dist/assets/{index-D7mpnTIe.js → index-CbDl1Nk6.js} +1 -1
  19. package/dist/assets/{index-DNbxAEYp.js → index-CbV0zEo3.js} +1 -1
  20. package/dist/assets/{index-DtRRvCNn.js → index-CdW-fp8-.js} +1 -1
  21. package/dist/assets/{index-BjJiAUgL.js → index-CvMogzDh.js} +1 -1
  22. package/dist/assets/{index-CMzm2YRG.js → index-CxTqvuay.js} +1 -1
  23. package/dist/assets/{index-wvkrobsf.js → index-DN2i-14o.js} +1 -1
  24. package/dist/assets/{index-Bpj3nBYn.js → index-DsjGpXT9.js} +1 -1
  25. package/dist/assets/{index-DGS3sLO1.js → index-GUU3bnHw.js} +1 -1
  26. package/dist/assets/{index-B3ZaqhJg.js → index-VJdR0Vsp.js} +1 -1
  27. package/dist/assets/{index-Ci4biYvU.js → index-toVQVrsP.js} +1 -1
  28. package/dist/assets/{index.es-Cw18p-se.js → index.es-BK07yBK8.js} +6 -6
  29. package/dist/assets/{signer-C3DgLdvN.js → signer-Cqdo4YRC.js} +2 -2
  30. package/dist/assets/{solana-CGFN2NGX.js → solana-CeiXWtGd.js} +2 -2
  31. package/dist/assets/solana-DqfcEf7L.js +2 -0
  32. package/dist/assets/solanaEmbed.esm-BW4sfcDG.js +37 -0
  33. package/dist/assets/{sui-CnHcn_0B.js → sui-TntjpiE6.js} +2 -2
  34. package/dist/assets/{tokens-FDI1dtAz.js → tokens-wBpWq5l5.js} +1 -1
  35. package/dist/main.js +51 -51
  36. package/dist/src/config/ui.d.ts +1 -0
  37. package/dist/src/config/ui.d.ts.map +1 -1
  38. package/dist/src/hooks/useFetchQuotes.d.ts.map +1 -1
  39. package/dist/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  40. package/dist/src/routes/sdkv2/route.d.ts.map +1 -1
  41. package/lib/{aptos-Dz4Js3_d.mjs → aptos-CMqi9xnz.mjs} +1 -1
  42. package/lib/{aptos-Da6iqpC-.js → aptos-CUrw_CM5.js} +1 -1
  43. package/lib/{ccip-Ceg_B70t.mjs → ccip-DjEPg__u.mjs} +1 -1
  44. package/lib/{ccip-Bb-IPrNA.js → ccip-tbJnHDO1.js} +1 -1
  45. package/lib/{constants-BqqwmYZc.js → constants-D8PkP8FD.js} +1 -1
  46. package/lib/{constants-Ba9GwEM1.mjs → constants-uvbe2N_4.mjs} +1 -1
  47. package/lib/{evm-DarNu22s.mjs → evm-C51GRwXY.mjs} +4 -4
  48. package/lib/{evm-1T5rGzcO.js → evm-D-QB4hVf.js} +3 -3
  49. package/lib/hosted.js +1 -1
  50. package/lib/hosted.mjs +1 -1
  51. package/lib/{index-VhcNuaP6.js → index-4UEV-pyS.js} +1 -1
  52. package/lib/{index-Cda4HnP1.mjs → index-C7eKFnUC.mjs} +1 -1
  53. package/lib/{index-pNqQSm4p.mjs → index-CGHEayyy.mjs} +109 -88
  54. package/lib/{index-Bn1o04G7.js → index-CUZbT8Rs.js} +4 -4
  55. package/lib/{index-DvxmZnxH.mjs → index-DD-AZ3hI.mjs} +1 -1
  56. package/lib/{index-B40ktVOy.js → index-DQ5bBanH.js} +1 -1
  57. package/lib/{index-BHMN5Px3.mjs → index-DlREYA36.mjs} +1 -1
  58. package/lib/{index-BTNmmLkb.js → index-xc0U6vWT.js} +1 -1
  59. package/lib/{index.es-_N4sKEIC.js → index.es-BmrEYzpc.js} +1 -1
  60. package/lib/{index.es-rEir51oG.mjs → index.es-CWb9-nuQ.mjs} +2 -2
  61. package/lib/index.js +1 -1
  62. package/lib/index.mjs +1 -1
  63. package/lib/{solana-CrjSp_Zk.js → solana-Bo3NnEnJ.js} +1 -1
  64. package/lib/{solana-SQhnN3yB.mjs → solana-CdLrMjvN.mjs} +3 -3
  65. package/lib/{solanaEmbed.esm-B7IRXgnI.js → solanaEmbed.esm-CYlp6Icj.js} +1 -1
  66. package/lib/{solanaEmbed.esm-Din0Z51P.mjs → solanaEmbed.esm-DiWgOIVr.mjs} +2 -2
  67. package/lib/src/config/ui.d.ts +1 -0
  68. package/lib/src/config/ui.d.ts.map +1 -1
  69. package/lib/src/hooks/useFetchQuotes.d.ts.map +1 -1
  70. package/lib/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  71. package/lib/src/routes/sdkv2/route.d.ts.map +1 -1
  72. package/lib/{sui-BePFnRSc.mjs → sui-CXBd6k8g.mjs} +1 -1
  73. package/lib/{sui-C7KPm3kD.js → sui-z1y1QOrV.js} +1 -1
  74. package/lib/{tokens-CChVRIuE.js → tokens-C9OdyBk_.js} +1 -1
  75. package/lib/{tokens-CyKAZUN-.mjs → tokens-GzwBLIsP.mjs} +2 -2
  76. package/package.json +1 -1
  77. package/dist/assets/solana-D-RpLbqD.js +0 -2
  78. package/dist/assets/solanaEmbed.esm-BkAurkzW.js +0 -37
package/lib/hosted.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./constants-BqqwmYZc.js");function d(o,e={}){window.__CONNECT_CONFIG=e.config,window.__CONNECT_THEME=e.theme;const n=document.createElement("div");n.id="wormhole-connect";const c=e.version??s.CONNECT_VERSION,i=e.cdnBaseUrl??`https://cdn.jsdelivr.net/npm/@wormhole-foundation/wormhole-connect@${c}`,t=document.createElement("script");t.setAttribute("src",`${i}/dist/main.js`),t.setAttribute("type","module"),o.appendChild(n),o.appendChild(t)}exports.wormholeConnectHosted=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./constants-D8PkP8FD.js");function d(o,e={}){window.__CONNECT_CONFIG=e.config,window.__CONNECT_THEME=e.theme;const n=document.createElement("div");n.id="wormhole-connect";const c=e.version??s.CONNECT_VERSION,i=e.cdnBaseUrl??`https://cdn.jsdelivr.net/npm/@wormhole-foundation/wormhole-connect@${c}`,t=document.createElement("script");t.setAttribute("src",`${i}/dist/main.js`),t.setAttribute("type","module"),o.appendChild(n),o.appendChild(t)}exports.wormholeConnectHosted=d;
package/lib/hosted.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as d } from "./constants-Ba9GwEM1.mjs";
1
+ import { a as d } from "./constants-uvbe2N_4.mjs";
2
2
  function r(o, t = {}) {
3
3
  window.__CONNECT_CONFIG = t.config, window.__CONNECT_THEME = t.theme;
4
4
  const n = document.createElement("div");
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./address-RcMobNYE.js"),gl=require("./dijkstra-CtFxn7S9.js"),te=require("./index-Bn1o04G7.js"),P=require("./index-Bogu114a.js"),_=require("./index-BL4H4RbP.js"),W=require("./index-DyE-3pz1.js");let yl=class extends _.r{constructor(e){super(e),this.events=new te.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(_.formatJsonRpcRequest(e.method,e.params||[],e.id||_.getBigIntRpcId().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{_.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,t)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var ml=function(){var r=document.getSelection();if(!r.rangeCount)return function(){};for(var e=document.activeElement,t=[],i=0;i<r.rangeCount;i++)t.push(r.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return r.removeAllRanges(),function(){r.type==="Caret"&&r.removeAllRanges(),r.rangeCount||t.forEach(function(n){r.addRange(n)}),e&&e.focus()}},vl=ml,Dn={"text/plain":"Text","text/html":"Url",default:"Text"},wl="Copy to clipboard: #{key}, Enter";function _l(r){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,e)}function bl(r,e){var t,i,n,s,o,a,c=!1;e||(e={}),t=e.debug||!1;try{n=vl(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=r,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),e.format)if(u.preventDefault(),typeof u.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Dn[e.format]||Dn.default;window.clipboardData.setData(h,r)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,r);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){t&&console.error("unable to copy using execCommand: ",u),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",r),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(h){t&&console.error("unable to copy using clipboardData: ",h),t&&console.error("falling back to prompt"),i=_l("message"in e?e.message:wl),window.prompt(i,r)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return c}var El=bl,Sl={}.toString,rn=Array.isArray||function(r){return Sl.call(r)=="[object Array]"},Il=te.requireElliptic(),nn={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});var ko=Q.getLocalStorage=Vo=Q.getLocalStorageOrThrow=Ko=Q.getCrypto=zo=Q.getCryptoOrThrow=jo=Q.getLocation=Uo=Q.getLocationOrThrow=Bo=Q.getNavigator=qo=Q.getNavigatorOrThrow=Fo=Q.getDocument=Do=Q.getDocumentOrThrow=Lo=Q.getFromWindowOrThrow=Mo=Q.getFromWindow=void 0;function wt(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}var Mo=Q.getFromWindow=wt;function qt(r){const e=wt(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}var Lo=Q.getFromWindowOrThrow=qt;function xl(){return qt("document")}var Do=Q.getDocumentOrThrow=xl;function Pl(){return wt("document")}var Fo=Q.getDocument=Pl;function Al(){return qt("navigator")}var qo=Q.getNavigatorOrThrow=Al;function Rl(){return wt("navigator")}var Bo=Q.getNavigator=Rl;function Nl(){return qt("location")}var Uo=Q.getLocationOrThrow=Nl;function Tl(){return wt("location")}var jo=Q.getLocation=Tl;function Cl(){return qt("crypto")}var zo=Q.getCryptoOrThrow=Cl;function Ol(){return wt("crypto")}var Ko=Q.getCrypto=Ol;function $l(){return qt("localStorage")}var Vo=Q.getLocalStorageOrThrow=$l;function kl(){return wt("localStorage")}ko=Q.getLocalStorage=kl;Object.defineProperty(nn,"__esModule",{value:!0});var Wo=nn.getWindowMetadata=void 0;const Fn=Q;function Ml(){let r,e;try{r=Fn.getDocumentOrThrow(),e=Fn.getLocationOrThrow()}catch{return null}function t(){const h=r.getElementsByTagName("link"),p=[];for(let d=0;d<h.length;d++){const f=h[d],g=f.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const y=f.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let m=e.protocol+"//"+e.host;if(y.indexOf("/")===0)m+=y;else{const v=e.pathname.split("/");v.pop();const b=v.join("/");m+=b+"/"+y}p.push(m)}else if(y.indexOf("//")===0){const m=e.protocol+y;p.push(m)}else p.push(y)}}return p}function i(...h){const p=r.getElementsByTagName("meta");for(let d=0;d<p.length;d++){const f=p[d],g=["itemprop","property","name"].map(y=>f.getAttribute(y)).filter(y=>y?h.includes(y):!1);if(g.length&&g){const y=f.getAttribute("content");if(y)return y}}return""}function n(){let h=i("name","og:site_name","og:title","twitter:title");return h||(h=r.title),h}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),c=e.origin,l=t();return{description:a,url:c,icons:l,name:o}}Wo=nn.getWindowMetadata=Ml;var Ll=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Dl=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),Fl=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=E.dist.process.platform}return r}(),ql=function(){function r(e,t,i,n){this.name=e,this.version=t,this.os=i,this.bot=n,this.type="bot-device"}return r}(),Bl=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Ul=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),jl=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,zl=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,qn=3,Kl=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",jl]],Bn=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Vl(r){return r?Un(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Ul:typeof navigator<"u"?Un(navigator.userAgent):Jl()}function Wl(r){return r!==""&&Kl.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var s=n.exec(r);return!!s&&[i,s]},!1)}function Un(r){var e=Wl(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new Bl;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<qn&&(n=Ll(n,Gl(qn-n.length))):n=[];var s=n.join("."),o=Hl(r),a=zl.exec(r);return a&&a[1]?new ql(t,s,o,a[1]):new Dl(t,s,o)}function Hl(r){for(var e=0,t=Bn.length;e<t;e++){var i=Bn[e],n=i[0],s=i[1],o=s.exec(r);if(o)return n}return null}function Jl(){var r=typeof E.dist.process<"u"&&E.dist.process.version;return r?new Fl(E.dist.process.version.slice(1)):null}function Gl(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function sn(r){return Vl(r)}function Vr(){const r=sn();return r&&r.os?r.os:void 0}function Ho(){const r=Vr();return r?r.toLowerCase().includes("android"):!1}function Jo(){const r=Vr();return r?r.toLowerCase().includes("ios")||r.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function Yl(){return Vr()?Ho()||Jo():!1}function Go(){const r=sn();return r&&r.name?r.name.toLowerCase()==="node":!1}function Ql(){return!Go()&&!!Yo()}const Xl=Mo,Zl=Lo,eu=Do,tu=Fo,ru=qo,Yo=Bo,iu=Uo,nu=jo,su=zo,ou=Ko,au=Vo,Wr=ko;function cu(){return Wo()}function lu(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return JSON.parse(r)}catch{return r}}function uu(r){return typeof r=="string"?r:JSON.stringify(r)}const Qo=lu,Xo=uu;function Zo(r,e){const t=Xo(e),i=Wr();i&&i.setItem(r,t)}function hu(r){let e=null,t=null;const i=Wr();return i&&(t=i.getItem(r)),e=t&&Qo(t),e}function du(r){const e=Wr();e&&e.removeItem(r)}const ea="WALLETCONNECT_DEEPLINK_CHOICE";function fu(r,e){const t=encodeURIComponent(r);return e.universalLink?`${e.universalLink}/wc?uri=${t}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${t}`:""}function pu(r){const e=r.href.split("?")[0];Zo(ea,Object.assign(Object.assign({},r),{href:e}))}function ta(r,e){return r.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function gu(r,e){let t=r;return e&&(t=e.map(i=>ta(r,i)).filter(Boolean)),t}const ra="https://registry.walletconnect.com";function yu(){return ra+"/api/v2/wallets"}function mu(){return ra+"/api/v2/dapps"}function ia(r,e="mobile"){var t;return{name:r.name||"",shortName:r.metadata.shortName||"",color:r.metadata.colors.primary||"",logo:(t=r.image_url.sm)!==null&&t!==void 0?t:"",universalLink:r[e].universal||"",deepLink:r[e].native||""}}function vu(r,e="mobile"){return Object.values(r).filter(t=>!!t[e].universal||!!t[e].native).map(t=>ia(t,e))}const wu=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:sn,detectOS:Vr,formatIOSMobile:fu,formatMobileRegistry:vu,formatMobileRegistryEntry:ia,getClientMeta:cu,getCrypto:ou,getCryptoOrThrow:su,getDappRegistryUrl:mu,getDocument:tu,getDocumentOrThrow:eu,getFromWindow:Xl,getFromWindowOrThrow:Zl,getLocal:hu,getLocalStorage:Wr,getLocalStorageOrThrow:au,getLocation:nu,getLocationOrThrow:iu,getMobileLinkRegistry:gu,getMobileRegistryEntry:ta,getNavigator:Yo,getNavigatorOrThrow:ru,getWalletRegistryUrl:yu,isAndroid:Ho,isBrowser:Ql,isIOS:Jo,isMobile:Yl,isNode:Go,mobileLinkChoiceKey:ea,removeLocal:du,safeJsonParse:Qo,safeJsonStringify:Xo,saveMobileLinkInfo:pu,setLocal:Zo},Symbol.toStringTag,{value:"Module"})),_u=E.getAugmentedNamespace(wu);var hr={},bu=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},na={},ct={},Eu=rn;function Su(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},r.foo()===42}catch{return!1}}j.TYPED_ARRAY_SUPPORT=Su();var jn=j.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function j(r,e,t){return!j.TYPED_ARRAY_SUPPORT&&!(this instanceof j)?new j(r,e,t):typeof r=="number"?sa(this,r):Tu(this,r,e,t)}j.TYPED_ARRAY_SUPPORT&&(j.prototype.__proto__=Uint8Array.prototype,j.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&j[Symbol.species]===j&&Object.defineProperty(j,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function on(r){if(r>=jn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+jn.toString(16)+" bytes");return r|0}function Iu(r){return r!==r}function Tt(r,e){var t;return j.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=j.prototype):(t=r,t===null&&(t=new j(e)),t.length=e),t}function sa(r,e){var t=Tt(r,e<0?0:on(e)|0);if(!j.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function xu(r,e){var t=aa(e)|0,i=Tt(r,t),n=i.write(e);return n!==t&&(i=i.slice(0,n)),i}function $i(r,e){for(var t=e.length<0?0:on(e.length)|0,i=Tt(r,t),n=0;n<t;n+=1)i[n]=e[n]&255;return i}function Pu(r,e,t,i){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");var n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),j.TYPED_ARRAY_SUPPORT?n.__proto__=j.prototype:n=$i(r,n),n}function Au(r,e){if(j.isBuffer(e)){var t=on(e.length)|0,i=Tt(r,t);return i.length===0||e.copy(i,0,0,t),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Iu(e.length)?Tt(r,0):$i(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return $i(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function oa(r,e){e=e||1/0;for(var t,i=r.length,n=null,s=[],o=0;o<i;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function aa(r){if(j.isBuffer(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;return e===0?0:oa(r).length}function Ru(r,e,t,i){for(var n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function Nu(r,e,t,i){return Ru(oa(e,r.length-t),r,t,i)}function Tu(r,e,t,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Pu(r,e,t,i):typeof e=="string"?xu(r,e):Au(r,e)}j.prototype.write=function(e,t,i){t===void 0?(i=this.length,t=0):i===void 0&&typeof t=="string"?(i=this.length,t=0):isFinite(t)&&(t=t|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-t;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return Nu(this,e,t,i)};j.prototype.slice=function(e,t){var i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var n;if(j.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=j.prototype;else{var s=t-e;n=new j(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};j.prototype.copy=function(e,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i,o;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!j.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s};j.prototype.fill=function(e,t,i){if(typeof e=="string"){if(typeof t=="string"?(t=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{var o=j.isBuffer(e)?e:new j(e),a=o.length;for(s=0;s<i-t;++s)this[s+t]=o[s%a]}return this};j.concat=function(e,t){if(!Eu(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Tt(null,0);var i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=sa(null,t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!j.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};j.byteLength=aa;j.prototype._isBuffer=!0;j.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};ct.alloc=function(r){var e=new j(r);return e.fill(0),e};ct.from=function(r){return new j(r)};var be={},an,Cu=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];be.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};be.getSymbolTotalCodewords=function(e){return Cu[e]};be.getBCHDigit=function(r){for(var e=0;r!==0;)e++,r>>>=1;return e};be.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');an=e};be.isKanjiModeEnabled=function(){return typeof an<"u"};be.toSJIS=function(e){return an(e)};var Hr={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");var i=t.toLowerCase();switch(i){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,n){if(r.isValid(i))return i;try{return e(i)}catch{return n}}})(Hr);function ca(){this.buffer=[],this.length=0}ca.prototype={get:function(r){var e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(var t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ou=ca,zn=ct;function dr(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=zn.alloc(r*r),this.reservedBit=zn.alloc(r*r)}dr.prototype.set=function(r,e,t,i){var n=r*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};dr.prototype.get=function(r,e){return this.data[r*this.size+e]};dr.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t};dr.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var $u=dr,la={};(function(r){var e=be.getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],c=1;c<n-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},r.getPositions=function(i){for(var n=[],s=r.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||n.push([s[a],s[c]]);return n}})(la);var ua={},ku=be.getSymbolSize,Kn=7;ua.getPositions=function(e){var t=ku(e);return[[0,0],[t-Kn,0],[0,t-Kn]]};var ha={};(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},r.from=function(n){return r.isValid(n)?parseInt(n,10):void 0},r.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,c=0,l=null,u=null,h=0;h<s;h++){a=c=0,l=u=null;for(var p=0;p<s;p++){var d=n.get(h,p);d===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=d,a=1),d=n.get(p,h),d===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=d,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},r.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var c=0;c<s-1;c++){var l=n.get(a,c)+n.get(a,c+1)+n.get(a+1,c)+n.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},r.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,c=0,l=0;l<s;l++){a=c=0;for(var u=0;u<s;u++)a=a<<1&2047|n.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|n.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*e.N3},r.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var c=Math.abs(Math.ceil(s*100/o/5)-10);return c*e.N4};function t(i,n,s){switch(i){case r.Patterns.PATTERN000:return(n+s)%2===0;case r.Patterns.PATTERN001:return n%2===0;case r.Patterns.PATTERN010:return s%3===0;case r.Patterns.PATTERN011:return(n+s)%3===0;case r.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case r.Patterns.PATTERN101:return n*s%2+n*s%3===0;case r.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case r.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(n,c,a))},r.getBestMask=function(n,s){for(var o=Object.keys(r.Patterns).length,a=0,c=1/0,l=0;l<o;l++){s(l),r.applyMask(l,n);var u=r.getPenaltyN1(n)+r.getPenaltyN2(n)+r.getPenaltyN3(n)+r.getPenaltyN4(n);r.applyMask(l,n),u<c&&(c=u,a=l)}return a}})(ha);var Jr={},rt=Hr,_r=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],br=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Jr.getBlocksCount=function(e,t){switch(t){case rt.L:return _r[(e-1)*4+0];case rt.M:return _r[(e-1)*4+1];case rt.Q:return _r[(e-1)*4+2];case rt.H:return _r[(e-1)*4+3];default:return}};Jr.getTotalCodewordsCount=function(e,t){switch(t){case rt.L:return br[(e-1)*4+0];case rt.M:return br[(e-1)*4+1];case rt.Q:return br[(e-1)*4+2];case rt.H:return br[(e-1)*4+3];default:return}};var da={},Gr={},fa=ct,er=fa.alloc(512),$r=fa.alloc(256);(function(){for(var e=1,t=0;t<255;t++)er[t]=e,$r[e]=t,e<<=1,e&256&&(e^=285);for(t=255;t<512;t++)er[t]=er[t-255]})();Gr.log=function(e){if(e<1)throw new Error("log("+e+")");return $r[e]};Gr.exp=function(e){return er[e]};Gr.mul=function(e,t){return e===0||t===0?0:er[$r[e]+$r[t]]};(function(r){var e=ct,t=Gr;r.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var c=0;c<s.length;c++)o[a+c]^=t.mul(n[a],s[c]);return o},r.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],c=0;c<s.length;c++)o[c]^=t.mul(s[c],a);for(var l=0;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},r.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=r.mul(s,[1,t.exp(o)]);return s}})(da);var Vn=ct,pa=da,Mu=E.bufferPolyfill.Buffer;function cn(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}cn.prototype.initialize=function(e){this.degree=e,this.genPoly=pa.generateECPolynomial(this.degree)};cn.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=Vn.alloc(this.degree),i=Mu.concat([e,t],e.length+this.degree),n=pa.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=Vn.alloc(this.degree);return n.copy(o,s),o}return n};var Lu=cn,ga={},lt={},ln={};ln.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var ze={},ya="[0-9]+",Du="[A-Z $%*+\\-./:]+",sr="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";sr=sr.replace(/u/g,"\\u");var Fu="(?:(?![A-Z0-9 $%*+\\-./:]|"+sr+`)(?:.|[\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./address-RcMobNYE.js"),gl=require("./dijkstra-CtFxn7S9.js"),te=require("./index-CUZbT8Rs.js"),P=require("./index-Bogu114a.js"),_=require("./index-BL4H4RbP.js"),W=require("./index-DyE-3pz1.js");let yl=class extends _.r{constructor(e){super(e),this.events=new te.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(_.formatJsonRpcRequest(e.method,e.params||[],e.id||_.getBigIntRpcId().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{_.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,t)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var ml=function(){var r=document.getSelection();if(!r.rangeCount)return function(){};for(var e=document.activeElement,t=[],i=0;i<r.rangeCount;i++)t.push(r.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return r.removeAllRanges(),function(){r.type==="Caret"&&r.removeAllRanges(),r.rangeCount||t.forEach(function(n){r.addRange(n)}),e&&e.focus()}},vl=ml,Dn={"text/plain":"Text","text/html":"Url",default:"Text"},wl="Copy to clipboard: #{key}, Enter";function _l(r){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,e)}function bl(r,e){var t,i,n,s,o,a,c=!1;e||(e={}),t=e.debug||!1;try{n=vl(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=r,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),e.format)if(u.preventDefault(),typeof u.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Dn[e.format]||Dn.default;window.clipboardData.setData(h,r)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,r);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){t&&console.error("unable to copy using execCommand: ",u),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",r),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(h){t&&console.error("unable to copy using clipboardData: ",h),t&&console.error("falling back to prompt"),i=_l("message"in e?e.message:wl),window.prompt(i,r)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return c}var El=bl,Sl={}.toString,rn=Array.isArray||function(r){return Sl.call(r)=="[object Array]"},Il=te.requireElliptic(),nn={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});var ko=Q.getLocalStorage=Vo=Q.getLocalStorageOrThrow=Ko=Q.getCrypto=zo=Q.getCryptoOrThrow=jo=Q.getLocation=Uo=Q.getLocationOrThrow=Bo=Q.getNavigator=qo=Q.getNavigatorOrThrow=Fo=Q.getDocument=Do=Q.getDocumentOrThrow=Lo=Q.getFromWindowOrThrow=Mo=Q.getFromWindow=void 0;function wt(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}var Mo=Q.getFromWindow=wt;function qt(r){const e=wt(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}var Lo=Q.getFromWindowOrThrow=qt;function xl(){return qt("document")}var Do=Q.getDocumentOrThrow=xl;function Pl(){return wt("document")}var Fo=Q.getDocument=Pl;function Al(){return qt("navigator")}var qo=Q.getNavigatorOrThrow=Al;function Rl(){return wt("navigator")}var Bo=Q.getNavigator=Rl;function Nl(){return qt("location")}var Uo=Q.getLocationOrThrow=Nl;function Tl(){return wt("location")}var jo=Q.getLocation=Tl;function Cl(){return qt("crypto")}var zo=Q.getCryptoOrThrow=Cl;function Ol(){return wt("crypto")}var Ko=Q.getCrypto=Ol;function $l(){return qt("localStorage")}var Vo=Q.getLocalStorageOrThrow=$l;function kl(){return wt("localStorage")}ko=Q.getLocalStorage=kl;Object.defineProperty(nn,"__esModule",{value:!0});var Wo=nn.getWindowMetadata=void 0;const Fn=Q;function Ml(){let r,e;try{r=Fn.getDocumentOrThrow(),e=Fn.getLocationOrThrow()}catch{return null}function t(){const h=r.getElementsByTagName("link"),p=[];for(let d=0;d<h.length;d++){const f=h[d],g=f.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const y=f.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let m=e.protocol+"//"+e.host;if(y.indexOf("/")===0)m+=y;else{const v=e.pathname.split("/");v.pop();const b=v.join("/");m+=b+"/"+y}p.push(m)}else if(y.indexOf("//")===0){const m=e.protocol+y;p.push(m)}else p.push(y)}}return p}function i(...h){const p=r.getElementsByTagName("meta");for(let d=0;d<p.length;d++){const f=p[d],g=["itemprop","property","name"].map(y=>f.getAttribute(y)).filter(y=>y?h.includes(y):!1);if(g.length&&g){const y=f.getAttribute("content");if(y)return y}}return""}function n(){let h=i("name","og:site_name","og:title","twitter:title");return h||(h=r.title),h}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),c=e.origin,l=t();return{description:a,url:c,icons:l,name:o}}Wo=nn.getWindowMetadata=Ml;var Ll=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Dl=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),Fl=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=E.dist.process.platform}return r}(),ql=function(){function r(e,t,i,n){this.name=e,this.version=t,this.os=i,this.bot=n,this.type="bot-device"}return r}(),Bl=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Ul=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),jl=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,zl=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,qn=3,Kl=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",jl]],Bn=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Vl(r){return r?Un(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Ul:typeof navigator<"u"?Un(navigator.userAgent):Jl()}function Wl(r){return r!==""&&Kl.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var s=n.exec(r);return!!s&&[i,s]},!1)}function Un(r){var e=Wl(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new Bl;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<qn&&(n=Ll(n,Gl(qn-n.length))):n=[];var s=n.join("."),o=Hl(r),a=zl.exec(r);return a&&a[1]?new ql(t,s,o,a[1]):new Dl(t,s,o)}function Hl(r){for(var e=0,t=Bn.length;e<t;e++){var i=Bn[e],n=i[0],s=i[1],o=s.exec(r);if(o)return n}return null}function Jl(){var r=typeof E.dist.process<"u"&&E.dist.process.version;return r?new Fl(E.dist.process.version.slice(1)):null}function Gl(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function sn(r){return Vl(r)}function Vr(){const r=sn();return r&&r.os?r.os:void 0}function Ho(){const r=Vr();return r?r.toLowerCase().includes("android"):!1}function Jo(){const r=Vr();return r?r.toLowerCase().includes("ios")||r.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function Yl(){return Vr()?Ho()||Jo():!1}function Go(){const r=sn();return r&&r.name?r.name.toLowerCase()==="node":!1}function Ql(){return!Go()&&!!Yo()}const Xl=Mo,Zl=Lo,eu=Do,tu=Fo,ru=qo,Yo=Bo,iu=Uo,nu=jo,su=zo,ou=Ko,au=Vo,Wr=ko;function cu(){return Wo()}function lu(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return JSON.parse(r)}catch{return r}}function uu(r){return typeof r=="string"?r:JSON.stringify(r)}const Qo=lu,Xo=uu;function Zo(r,e){const t=Xo(e),i=Wr();i&&i.setItem(r,t)}function hu(r){let e=null,t=null;const i=Wr();return i&&(t=i.getItem(r)),e=t&&Qo(t),e}function du(r){const e=Wr();e&&e.removeItem(r)}const ea="WALLETCONNECT_DEEPLINK_CHOICE";function fu(r,e){const t=encodeURIComponent(r);return e.universalLink?`${e.universalLink}/wc?uri=${t}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${t}`:""}function pu(r){const e=r.href.split("?")[0];Zo(ea,Object.assign(Object.assign({},r),{href:e}))}function ta(r,e){return r.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function gu(r,e){let t=r;return e&&(t=e.map(i=>ta(r,i)).filter(Boolean)),t}const ra="https://registry.walletconnect.com";function yu(){return ra+"/api/v2/wallets"}function mu(){return ra+"/api/v2/dapps"}function ia(r,e="mobile"){var t;return{name:r.name||"",shortName:r.metadata.shortName||"",color:r.metadata.colors.primary||"",logo:(t=r.image_url.sm)!==null&&t!==void 0?t:"",universalLink:r[e].universal||"",deepLink:r[e].native||""}}function vu(r,e="mobile"){return Object.values(r).filter(t=>!!t[e].universal||!!t[e].native).map(t=>ia(t,e))}const wu=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:sn,detectOS:Vr,formatIOSMobile:fu,formatMobileRegistry:vu,formatMobileRegistryEntry:ia,getClientMeta:cu,getCrypto:ou,getCryptoOrThrow:su,getDappRegistryUrl:mu,getDocument:tu,getDocumentOrThrow:eu,getFromWindow:Xl,getFromWindowOrThrow:Zl,getLocal:hu,getLocalStorage:Wr,getLocalStorageOrThrow:au,getLocation:nu,getLocationOrThrow:iu,getMobileLinkRegistry:gu,getMobileRegistryEntry:ta,getNavigator:Yo,getNavigatorOrThrow:ru,getWalletRegistryUrl:yu,isAndroid:Ho,isBrowser:Ql,isIOS:Jo,isMobile:Yl,isNode:Go,mobileLinkChoiceKey:ea,removeLocal:du,safeJsonParse:Qo,safeJsonStringify:Xo,saveMobileLinkInfo:pu,setLocal:Zo},Symbol.toStringTag,{value:"Module"})),_u=E.getAugmentedNamespace(wu);var hr={},bu=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},na={},ct={},Eu=rn;function Su(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},r.foo()===42}catch{return!1}}j.TYPED_ARRAY_SUPPORT=Su();var jn=j.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function j(r,e,t){return!j.TYPED_ARRAY_SUPPORT&&!(this instanceof j)?new j(r,e,t):typeof r=="number"?sa(this,r):Tu(this,r,e,t)}j.TYPED_ARRAY_SUPPORT&&(j.prototype.__proto__=Uint8Array.prototype,j.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&j[Symbol.species]===j&&Object.defineProperty(j,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function on(r){if(r>=jn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+jn.toString(16)+" bytes");return r|0}function Iu(r){return r!==r}function Tt(r,e){var t;return j.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=j.prototype):(t=r,t===null&&(t=new j(e)),t.length=e),t}function sa(r,e){var t=Tt(r,e<0?0:on(e)|0);if(!j.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function xu(r,e){var t=aa(e)|0,i=Tt(r,t),n=i.write(e);return n!==t&&(i=i.slice(0,n)),i}function $i(r,e){for(var t=e.length<0?0:on(e.length)|0,i=Tt(r,t),n=0;n<t;n+=1)i[n]=e[n]&255;return i}function Pu(r,e,t,i){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");var n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),j.TYPED_ARRAY_SUPPORT?n.__proto__=j.prototype:n=$i(r,n),n}function Au(r,e){if(j.isBuffer(e)){var t=on(e.length)|0,i=Tt(r,t);return i.length===0||e.copy(i,0,0,t),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Iu(e.length)?Tt(r,0):$i(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return $i(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function oa(r,e){e=e||1/0;for(var t,i=r.length,n=null,s=[],o=0;o<i;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function aa(r){if(j.isBuffer(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;return e===0?0:oa(r).length}function Ru(r,e,t,i){for(var n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function Nu(r,e,t,i){return Ru(oa(e,r.length-t),r,t,i)}function Tu(r,e,t,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Pu(r,e,t,i):typeof e=="string"?xu(r,e):Au(r,e)}j.prototype.write=function(e,t,i){t===void 0?(i=this.length,t=0):i===void 0&&typeof t=="string"?(i=this.length,t=0):isFinite(t)&&(t=t|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-t;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return Nu(this,e,t,i)};j.prototype.slice=function(e,t){var i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var n;if(j.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=j.prototype;else{var s=t-e;n=new j(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};j.prototype.copy=function(e,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i,o;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!j.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s};j.prototype.fill=function(e,t,i){if(typeof e=="string"){if(typeof t=="string"?(t=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{var o=j.isBuffer(e)?e:new j(e),a=o.length;for(s=0;s<i-t;++s)this[s+t]=o[s%a]}return this};j.concat=function(e,t){if(!Eu(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Tt(null,0);var i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=sa(null,t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!j.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};j.byteLength=aa;j.prototype._isBuffer=!0;j.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};ct.alloc=function(r){var e=new j(r);return e.fill(0),e};ct.from=function(r){return new j(r)};var be={},an,Cu=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];be.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};be.getSymbolTotalCodewords=function(e){return Cu[e]};be.getBCHDigit=function(r){for(var e=0;r!==0;)e++,r>>>=1;return e};be.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');an=e};be.isKanjiModeEnabled=function(){return typeof an<"u"};be.toSJIS=function(e){return an(e)};var Hr={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");var i=t.toLowerCase();switch(i){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,n){if(r.isValid(i))return i;try{return e(i)}catch{return n}}})(Hr);function ca(){this.buffer=[],this.length=0}ca.prototype={get:function(r){var e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(var t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ou=ca,zn=ct;function dr(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=zn.alloc(r*r),this.reservedBit=zn.alloc(r*r)}dr.prototype.set=function(r,e,t,i){var n=r*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};dr.prototype.get=function(r,e){return this.data[r*this.size+e]};dr.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t};dr.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var $u=dr,la={};(function(r){var e=be.getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],c=1;c<n-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},r.getPositions=function(i){for(var n=[],s=r.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||n.push([s[a],s[c]]);return n}})(la);var ua={},ku=be.getSymbolSize,Kn=7;ua.getPositions=function(e){var t=ku(e);return[[0,0],[t-Kn,0],[0,t-Kn]]};var ha={};(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},r.from=function(n){return r.isValid(n)?parseInt(n,10):void 0},r.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,c=0,l=null,u=null,h=0;h<s;h++){a=c=0,l=u=null;for(var p=0;p<s;p++){var d=n.get(h,p);d===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=d,a=1),d=n.get(p,h),d===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=d,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},r.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var c=0;c<s-1;c++){var l=n.get(a,c)+n.get(a,c+1)+n.get(a+1,c)+n.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},r.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,c=0,l=0;l<s;l++){a=c=0;for(var u=0;u<s;u++)a=a<<1&2047|n.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|n.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*e.N3},r.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var c=Math.abs(Math.ceil(s*100/o/5)-10);return c*e.N4};function t(i,n,s){switch(i){case r.Patterns.PATTERN000:return(n+s)%2===0;case r.Patterns.PATTERN001:return n%2===0;case r.Patterns.PATTERN010:return s%3===0;case r.Patterns.PATTERN011:return(n+s)%3===0;case r.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case r.Patterns.PATTERN101:return n*s%2+n*s%3===0;case r.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case r.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(n,c,a))},r.getBestMask=function(n,s){for(var o=Object.keys(r.Patterns).length,a=0,c=1/0,l=0;l<o;l++){s(l),r.applyMask(l,n);var u=r.getPenaltyN1(n)+r.getPenaltyN2(n)+r.getPenaltyN3(n)+r.getPenaltyN4(n);r.applyMask(l,n),u<c&&(c=u,a=l)}return a}})(ha);var Jr={},rt=Hr,_r=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],br=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Jr.getBlocksCount=function(e,t){switch(t){case rt.L:return _r[(e-1)*4+0];case rt.M:return _r[(e-1)*4+1];case rt.Q:return _r[(e-1)*4+2];case rt.H:return _r[(e-1)*4+3];default:return}};Jr.getTotalCodewordsCount=function(e,t){switch(t){case rt.L:return br[(e-1)*4+0];case rt.M:return br[(e-1)*4+1];case rt.Q:return br[(e-1)*4+2];case rt.H:return br[(e-1)*4+3];default:return}};var da={},Gr={},fa=ct,er=fa.alloc(512),$r=fa.alloc(256);(function(){for(var e=1,t=0;t<255;t++)er[t]=e,$r[e]=t,e<<=1,e&256&&(e^=285);for(t=255;t<512;t++)er[t]=er[t-255]})();Gr.log=function(e){if(e<1)throw new Error("log("+e+")");return $r[e]};Gr.exp=function(e){return er[e]};Gr.mul=function(e,t){return e===0||t===0?0:er[$r[e]+$r[t]]};(function(r){var e=ct,t=Gr;r.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var c=0;c<s.length;c++)o[a+c]^=t.mul(n[a],s[c]);return o},r.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],c=0;c<s.length;c++)o[c]^=t.mul(s[c],a);for(var l=0;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},r.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=r.mul(s,[1,t.exp(o)]);return s}})(da);var Vn=ct,pa=da,Mu=E.bufferPolyfill.Buffer;function cn(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}cn.prototype.initialize=function(e){this.degree=e,this.genPoly=pa.generateECPolynomial(this.degree)};cn.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=Vn.alloc(this.degree),i=Mu.concat([e,t],e.length+this.degree),n=pa.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=Vn.alloc(this.degree);return n.copy(o,s),o}return n};var Lu=cn,ga={},lt={},ln={};ln.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var ze={},ya="[0-9]+",Du="[A-Z $%*+\\-./:]+",sr="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";sr=sr.replace(/u/g,"\\u");var Fu="(?:(?![A-Z0-9 $%*+\\-./:]|"+sr+`)(?:.|[\r
2
2
  ]))+`;ze.KANJI=new RegExp(sr,"g");ze.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ze.BYTE=new RegExp(Fu,"g");ze.NUMERIC=new RegExp(ya,"g");ze.ALPHANUMERIC=new RegExp(Du,"g");var qu=new RegExp("^"+sr+"$"),Bu=new RegExp("^"+ya+"$"),Uu=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ze.testKanji=function(e){return qu.test(e)};ze.testNumeric=function(e){return Bu.test(e)};ze.testAlphanumeric=function(e){return Uu.test(e)};(function(r){var e=ln,t=ze;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},r.getBestModeForData=function(s){return t.testNumeric(s)?r.NUMERIC:t.testAlphanumeric(s)?r.ALPHANUMERIC:t.testKanji(s)?r.KANJI:r.BYTE},r.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},r.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");var s=n.toLowerCase();switch(s){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+n)}}r.from=function(s,o){if(r.isValid(s))return s;try{return i(s)}catch{return o}}})(lt);(function(r){var e=be,t=Jr,i=Hr,n=lt,s=ln,o=rn,a=7973,c=e.getBCHDigit(a);function l(d,f,g){for(var y=1;y<=40;y++)if(f<=r.getCapacity(y,g,d))return y}function u(d,f){return n.getCharCountIndicator(d,f)+4}function h(d,f){var g=0;return d.forEach(function(y){var m=u(y.mode,f);g+=m+y.getBitsLength()}),g}function p(d,f){for(var g=1;g<=40;g++){var y=h(d,g);if(y<=r.getCapacity(g,f,n.MIXED))return g}}r.from=function(f,g){return s.isValid(f)?parseInt(f,10):g},r.getCapacity=function(f,g,y){if(!s.isValid(f))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=n.BYTE);var m=e.getSymbolTotalCodewords(f),v=t.getTotalCodewordsCount(f,g),b=(m-v)*8;if(y===n.MIXED)return b;var w=b-u(y,f);switch(y){case n.NUMERIC:return Math.floor(w/10*3);case n.ALPHANUMERIC:return Math.floor(w/11*2);case n.KANJI:return Math.floor(w/13);case n.BYTE:default:return Math.floor(w/8)}},r.getBestVersionForData=function(f,g){var y,m=i.from(g,i.M);if(o(f)){if(f.length>1)return p(f,m);if(f.length===0)return 1;y=f[0]}else y=f;return l(y.mode,y.getLength(),m)},r.getEncodedBits=function(f){if(!s.isValid(f)||f<7)throw new Error("Invalid QR Code version");for(var g=f<<12;e.getBCHDigit(g)-c>=0;)g^=a<<e.getBCHDigit(g)-c;return f<<12|g}})(ga);var ma={},ki=be,va=1335,ju=21522,Wn=ki.getBCHDigit(va);ma.getEncodedBits=function(e,t){for(var i=e.bit<<3|t,n=i<<10;ki.getBCHDigit(n)-Wn>=0;)n^=va<<ki.getBCHDigit(n)-Wn;return(i<<10|n)^ju};var wa={},zu=lt;function Ct(r){this.mode=zu.NUMERIC,this.data=r.toString()}Ct.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Ct.prototype.getLength=function(){return this.data.length};Ct.prototype.getBitsLength=function(){return Ct.getBitsLength(this.data.length)};Ct.prototype.write=function(e){var t,i,n;for(t=0;t+3<=this.data.length;t+=3)i=this.data.substr(t,3),n=parseInt(i,10),e.put(n,10);var s=this.data.length-t;s>0&&(i=this.data.substr(t),n=parseInt(i,10),e.put(n,s*3+1))};var Ku=Ct,Vu=lt,hi=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Ot(r){this.mode=Vu.ALPHANUMERIC,this.data=r}Ot.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Ot.prototype.getLength=function(){return this.data.length};Ot.prototype.getBitsLength=function(){return Ot.getBitsLength(this.data.length)};Ot.prototype.write=function(e){var t;for(t=0;t+2<=this.data.length;t+=2){var i=hi.indexOf(this.data[t])*45;i+=hi.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(hi.indexOf(this.data[t]),6)};var Wu=Ot,Hu=ct,Ju=lt;function $t(r){this.mode=Ju.BYTE,this.data=Hu.from(r)}$t.getBitsLength=function(e){return e*8};$t.prototype.getLength=function(){return this.data.length};$t.prototype.getBitsLength=function(){return $t.getBitsLength(this.data.length)};$t.prototype.write=function(r){for(var e=0,t=this.data.length;e<t;e++)r.put(this.data[e],8)};var Gu=$t,Yu=lt,Qu=be;function kt(r){this.mode=Yu.KANJI,this.data=r}kt.getBitsLength=function(e){return e*13};kt.prototype.getLength=function(){return this.data.length};kt.prototype.getBitsLength=function(){return kt.getBitsLength(this.data.length)};kt.prototype.write=function(r){var e;for(e=0;e<this.data.length;e++){var t=Qu.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
3
  Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var Xu=kt;(function(r){var e=lt,t=Ku,i=Wu,n=Gu,s=Xu,o=ze,a=be,c=gl.dijkstraExports;function l(m){return unescape(encodeURIComponent(m)).length}function u(m,v,b){for(var w=[],S;(S=m.exec(b))!==null;)w.push({data:S[0],index:S.index,mode:v,length:S[0].length});return w}function h(m){var v=u(o.NUMERIC,e.NUMERIC,m),b=u(o.ALPHANUMERIC,e.ALPHANUMERIC,m),w,S;a.isKanjiModeEnabled()?(w=u(o.BYTE,e.BYTE,m),S=u(o.KANJI,e.KANJI,m)):(w=u(o.BYTE_KANJI,e.BYTE,m),S=[]);var I=v.concat(b,w,S);return I.sort(function(x,A){return x.index-A.index}).map(function(x){return{data:x.data,mode:x.mode,length:x.length}})}function p(m,v){switch(v){case e.NUMERIC:return t.getBitsLength(m);case e.ALPHANUMERIC:return i.getBitsLength(m);case e.KANJI:return s.getBitsLength(m);case e.BYTE:return n.getBitsLength(m)}}function d(m){return m.reduce(function(v,b){var w=v.length-1>=0?v[v.length-1]:null;return w&&w.mode===b.mode?(v[v.length-1].data+=b.data,v):(v.push(b),v)},[])}function f(m){for(var v=[],b=0;b<m.length;b++){var w=m[b];switch(w.mode){case e.NUMERIC:v.push([w,{data:w.data,mode:e.ALPHANUMERIC,length:w.length},{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.ALPHANUMERIC:v.push([w,{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.KANJI:v.push([w,{data:w.data,mode:e.BYTE,length:l(w.data)}]);break;case e.BYTE:v.push([{data:w.data,mode:e.BYTE,length:l(w.data)}])}}return v}function g(m,v){for(var b={},w={start:{}},S=["start"],I=0;I<m.length;I++){for(var x=m[I],A=[],C=0;C<x.length;C++){var O=x[C],$=""+I+C;A.push($),b[$]={node:O,lastCount:0},w[$]={};for(var D=0;D<S.length;D++){var k=S[D];b[k]&&b[k].node.mode===O.mode?(w[k][$]=p(b[k].lastCount+O.length,O.mode)-p(b[k].lastCount,O.mode),b[k].lastCount+=O.length):(b[k]&&(b[k].lastCount=O.length),w[k][$]=p(O.length,O.mode)+4+e.getCharCountIndicator(O.mode,v))}}S=A}for(D=0;D<S.length;D++)w[S[D]].end=0;return{map:w,table:b}}function y(m,v){var b,w=e.getBestModeForData(m);if(b=e.from(v,w),b!==e.BYTE&&b.bit<w.bit)throw new Error('"'+m+'" cannot be encoded with mode '+e.toString(b)+`.
4
4
  Suggested mode is: `+e.toString(w));switch(b===e.KANJI&&!a.isKanjiModeEnabled()&&(b=e.BYTE),b){case e.NUMERIC:return new t(m);case e.ALPHANUMERIC:return new i(m);case e.KANJI:return new s(m);case e.BYTE:return new n(m)}}r.fromArray=function(v){return v.reduce(function(b,w){return typeof w=="string"?b.push(y(w,null)):w.data&&b.push(y(w.data,w.mode)),b},[])},r.fromString=function(v,b){for(var w=h(v,a.isKanjiModeEnabled()),S=f(w),I=g(S,b),x=c.find_path(I.map,"start","end"),A=[],C=1;C<x.length-1;C++)A.push(I.table[x[C]].node);return r.fromArray(d(A))},r.rawSplit=function(v){return r.fromArray(h(v,a.isKanjiModeEnabled()))}})(wa);var Hn=ct,Yr=be,di=Hr,Zu=Ou,eh=$u,th=la,rh=ua,Mi=ha,Li=Jr,ih=Lu,kr=ga,nh=ma,sh=lt,fi=wa,oh=rn;function ah(r,e){for(var t=r.size,i=rh.getPositions(e),n=0;n<i.length;n++)for(var s=i[n][0],o=i[n][1],a=-1;a<=7;a++)if(!(s+a<=-1||t<=s+a))for(var c=-1;c<=7;c++)o+c<=-1||t<=o+c||(a>=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?r.set(s+a,o+c,!0,!0):r.set(s+a,o+c,!1,!0))}function ch(r){for(var e=r.size,t=8;t<e-8;t++){var i=t%2===0;r.set(t,6,i,!0),r.set(6,t,i,!0)}}function lh(r,e){for(var t=th.getPositions(e),i=0;i<t.length;i++)for(var n=t[i][0],s=t[i][1],o=-2;o<=2;o++)for(var a=-2;a<=2;a++)o===-2||o===2||a===-2||a===2||o===0&&a===0?r.set(n+o,s+a,!0,!0):r.set(n+o,s+a,!1,!0)}function uh(r,e){for(var t=r.size,i=kr.getEncodedBits(e),n,s,o,a=0;a<18;a++)n=Math.floor(a/3),s=a%3+t-8-3,o=(i>>a&1)===1,r.set(n,s,o,!0),r.set(s,n,o,!0)}function pi(r,e,t){var i=r.size,n=nh.getEncodedBits(e,t),s,o;for(s=0;s<15;s++)o=(n>>s&1)===1,s<6?r.set(s,8,o,!0):s<8?r.set(s+1,8,o,!0):r.set(i-15+s,8,o,!0),s<8?r.set(8,i-s-1,o,!0):s<9?r.set(8,15-s-1+1,o,!0):r.set(8,15-s-1,o,!0);r.set(i-8,8,1,!0)}function hh(r,e){for(var t=r.size,i=-1,n=t-1,s=7,o=0,a=t-1;a>0;a-=2)for(a===6&&a--;;){for(var c=0;c<2;c++)if(!r.isReserved(n,a-c)){var l=!1;o<e.length&&(l=(e[o]>>>s&1)===1),r.set(n,a-c,l),s--,s===-1&&(o++,s=7)}if(n+=i,n<0||t<=n){n-=i,i=-i;break}}}function dh(r,e,t){var i=new Zu;t.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),sh.getCharCountIndicator(l.mode,r)),l.write(i)});var n=Yr.getSymbolTotalCodewords(r),s=Li.getTotalCodewordsCount(r,e),o=(n-s)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);for(var a=(o-i.getLengthInBits())/8,c=0;c<a;c++)i.put(c%2?17:236,8);return fh(i,r,e)}function fh(r,e,t){for(var i=Yr.getSymbolTotalCodewords(e),n=Li.getTotalCodewordsCount(e,t),s=i-n,o=Li.getBlocksCount(e,t),a=i%o,c=o-a,l=Math.floor(i/o),u=Math.floor(s/o),h=u+1,p=l-u,d=new ih(p),f=0,g=new Array(o),y=new Array(o),m=0,v=Hn.from(r.buffer),b=0;b<o;b++){var w=b<c?u:h;g[b]=v.slice(f,f+w),y[b]=d.encode(g[b]),f+=w,m=Math.max(m,w)}var S=Hn.alloc(i),I=0,x,A;for(x=0;x<m;x++)for(A=0;A<o;A++)x<g[A].length&&(S[I++]=g[A][x]);for(x=0;x<p;x++)for(A=0;A<o;A++)S[I++]=y[A][x];return S}function ph(r,e,t,i){var n;if(oh(r))n=fi.fromArray(r);else if(typeof r=="string"){var s=e;if(!s){var o=fi.rawSplit(r);s=kr.getBestVersionForData(o,t)}n=fi.fromString(r,s||40)}else throw new Error("Invalid data");var a=kr.getBestVersionForData(n,t);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
@@ -1,6 +1,6 @@
1
1
  import { d as R, a as sa, X as Wl, g as oa, aX as L, ae as Hl, b2 as Jl } from "./address-Drr_9OcK.mjs";
2
2
  import { d as Gl } from "./dijkstra-BZM-8g-B.mjs";
3
- import { q as He, z as Yl, A as Ye, y as aa } from "./index-pNqQSm4p.mjs";
3
+ import { q as He, z as Yl, A as Ye, y as aa } from "./index-CGHEayyy.mjs";
4
4
  import { c as I } from "./index-B1XGfrNH.mjs";
5
5
  import { r as Ql, a as It, g as xt, i as qe, b as ni, I as Rt, f as Ce, t as fe, w as Hi, c as Si, C as Xl, d as Zl, e as ns, h as eu, j as tu, k as vn, p as ru, l as wn, A as iu, E as pe, m as nu, y as be, P as ss, Q as su, n as ou, T as ca, o as _n, q as bn, s as Qe, _ as au, u as vt } from "./index-DSSOE7Me.mjs";
6
6
  import { s as la, a as Re, h as ua, L as cu, d as nr, l as lu, e as Ii, g as uu, i as os, k as hu } from "./index-CT2-qOL1.mjs";
@@ -5,7 +5,7 @@ import _n, { jsx as S, jsxs as se, Fragment as Xt } from "react/jsx-runtime";
5
5
  import * as oe from "react";
6
6
  import wr, { useEffect as Ht, useRef as cn, useMemo as Ve, createContext as T8, useContext as Ba, forwardRef as E8, createElement as Ky, isValidElement as nc, cloneElement as ic, Children as e7, useCallback as $t, useState as yt, memo as $1, Component as t7 } from "react";
7
7
  import { d as re, g as Qi, a as pi, p as Jc, f as zr, b as R2, T as Sr, i as Ac, c as ks, e as so, h as Bs, j as r7, A as Kc, t as P2, k as Ln, l as dn, u as er, m as ci, s as Tc, n as I8, W as ir, M as el, o as L8, q as U2, r as rf, v as ro, w as n7, x as D8, y as S8, z as la, B as j8, C as O8, D as Ec, E as li, F as yn, G as ai, H as i7, I as o7, J as yi, K as a7, L as s7, N as c7, O as l7, P as f7, R as u7, Q as d7, S as h7, U as Zt, V as Rt, X as Vr, Y as G1, Z as _8, _ as So, $ as nf, a0 as of, a1 as $o, a2 as ys, a3 as tl, a4 as p7, a5 as Uo, a6 as co, a7 as z8, a8 as Ma, a9 as g7, aa as M7, ab as k8, ac as Zr, ad as q1, ae as fa, af as m7, ag as B8, ah as y7, ai as v7, aj as af, ak as sf, al as Io } from "./address-Drr_9OcK.mjs";
8
- import { C as b7, a as x7, b as Y2, W as F8 } from "./constants-Ba9GwEM1.mjs";
8
+ import { C as b7, a as x7, b as Y2, W as F8 } from "./constants-uvbe2N_4.mjs";
9
9
  import "./address-Cj96wodd.mjs";
10
10
  import { M as X1, R as J1, U as C7, i as w7, a as N7, b as A7 } from "./address-B9anhmbU.mjs";
11
11
  import { CacheProvider as T7, Global as E7, ThemeContext as K1, css as lo, keyframes as gi, __unsafe_useEmotionCache as I7 } from "@emotion/react";
@@ -30648,7 +30648,7 @@ class Pc extends Rc {
30648
30648
  const n = await In(), o = n.getChain(t.chain), c = await o.getDecimals(t.address), i = await bL(t);
30649
30649
  let f = ((C = i == null ? void 0 : i.symbol) == null ? void 0 : C.toUpperCase()) || "", u = (i == null ? void 0 : i.name) || "", p = ((A = i == null ? void 0 : i.image) == null ? void 0 : A.large) || null;
30650
30650
  if (!f) {
30651
- const { getTokenMetadataFromRpc: E } = await import("./tokens-CyKAZUN-.mjs"), T = await E(t);
30651
+ const { getTokenMetadataFromRpc: E } = await import("./tokens-GzwBLIsP.mjs"), T = await E(t);
30652
30652
  T && (console.info("Got metadata from RPC", T), f = T.symbol, u = T.name, p = T.icon);
30653
30653
  }
30654
30654
  let h;
@@ -31107,24 +31107,24 @@ const Oo = {
31107
31107
  if (!i)
31108
31108
  throw new Error("wallet is undefined");
31109
31109
  if (c.context === At.ETH)
31110
- return await (await import("./evm-DarNu22s.mjs").then((p) => p.k)).signAndSendTransaction(
31110
+ return await (await import("./evm-C51GRwXY.mjs").then((p) => p.k)).signAndSendTransaction(
31111
31111
  t,
31112
31112
  i,
31113
31113
  e
31114
31114
  );
31115
31115
  if (c.context === At.SOLANA)
31116
- return await (await import("./solana-SQhnN3yB.mjs")).signAndSendTransaction(
31116
+ return await (await import("./solana-CdLrMjvN.mjs")).signAndSendTransaction(
31117
31117
  t,
31118
31118
  i,
31119
31119
  o
31120
31120
  );
31121
31121
  if (c.context === At.SUI)
31122
- return (await (await import("./sui-BePFnRSc.mjs")).signAndSendTransaction(
31122
+ return (await (await import("./sui-CXBd6k8g.mjs")).signAndSendTransaction(
31123
31123
  t,
31124
31124
  i
31125
31125
  )).id;
31126
31126
  if (c.context === At.APTOS)
31127
- return (await (await import("./aptos-Dz4Js3_d.mjs")).signAndSendTransaction(
31127
+ return (await (await import("./aptos-CMqi9xnz.mjs")).signAndSendTransaction(
31128
31128
  t,
31129
31129
  i
31130
31130
  )).id;
@@ -31144,16 +31144,16 @@ const Oo = {
31144
31144
  if (e === void 0)
31145
31145
  return [];
31146
31146
  if (e.context === At.ETH) {
31147
- const t = await import("./evm-DarNu22s.mjs").then((n) => n.k);
31147
+ const t = await import("./evm-C51GRwXY.mjs").then((n) => n.k);
31148
31148
  return Object.values(U0(t.getWallets(), At.ETH));
31149
31149
  } else if (e.context === At.SOLANA) {
31150
- const n = (await import("./solana-SQhnN3yB.mjs")).fetchOptions();
31150
+ const n = (await import("./solana-CdLrMjvN.mjs")).fetchOptions();
31151
31151
  return Object.values(U0(n, At.SOLANA));
31152
31152
  } else if (e.context === At.SUI) {
31153
- const n = await (await import("./sui-BePFnRSc.mjs")).fetchOptions();
31153
+ const n = await (await import("./sui-CXBd6k8g.mjs")).fetchOptions();
31154
31154
  return Object.values(U0(n, At.SUI));
31155
31155
  } else if (e.context === At.APTOS) {
31156
- const n = (await import("./aptos-Dz4Js3_d.mjs")).fetchOptions();
31156
+ const n = (await import("./aptos-CMqi9xnz.mjs")).fetchOptions();
31157
31157
  return Object.values(U0(n, At.APTOS));
31158
31158
  }
31159
31159
  return [];
@@ -31419,14 +31419,17 @@ class TD {
31419
31419
  i.context
31420
31420
  )) return [];
31421
31421
  const u = `supportedDestTokens-${t.address}-${n}-${o}`;
31422
- return await this.tokenCache.requestWithCache(
31422
+ return (await this.tokenCache.requestWithCache(
31423
31423
  u,
31424
31424
  () => this.rc.supportedDestinationTokens(
31425
31425
  t.tokenId,
31426
31426
  c.context,
31427
31427
  i.context
31428
31428
  )
31429
- );
31429
+ )).filter((h) => {
31430
+ const g = ge.tokens.get(h);
31431
+ return !(g && em(g, i.chain));
31432
+ });
31430
31433
  }
31431
31434
  async getQuote(t, n, o, c, i, f, u) {
31432
31435
  const p = await this.createRequest(
@@ -31529,7 +31532,7 @@ class TD {
31529
31532
  async isIlliquidDestToken(t, n, o) {
31530
31533
  if (!this.IS_TOKEN_BRIDGE_ROUTE) return !1;
31531
31534
  const { symbol: c, nativeChain: i } = t;
31532
- return !!(em(t, o.chain) || await ED(
31535
+ return !!(await ED(
31533
31536
  t,
31534
31537
  n,
31535
31538
  o
@@ -51579,7 +51582,6 @@ const Cy = T8(
51579
51582
  }, tP = {
51580
51583
  SHUTTLE: 1e4
51581
51584
  }, rP = (e, t) => {
51582
- var E;
51583
51585
  const [n, o] = yt((/* @__PURE__ */ new Date()).valueOf()), c = cn(
51584
51586
  void 0
51585
51587
  ), [i, f] = yt(!1), [u, p] = yt({}), [h, g] = yt(!0);
@@ -51598,7 +51600,7 @@ const Cy = T8(
51598
51600
  t.amount,
51599
51601
  t.sourceToken
51600
51602
  );
51601
- Ht(() => {
51603
+ return Ht(() => {
51602
51604
  if (e.length === 0) return;
51603
51605
  let T = 0;
51604
51606
  if (Object.keys(u).length > 0) {
@@ -51630,7 +51632,9 @@ const Cy = T8(
51630
51632
  return p({}), f(!1), D;
51631
51633
  if (C || !h)
51632
51634
  return D;
51633
- const I = t, L = Object.values(u).filter((j) => j.success);
51635
+ const I = t, L = Object.values(u).filter(
51636
+ (j) => j.success
51637
+ );
51634
51638
  if (L.length > 0) {
51635
51639
  const { sourceToken: j, destinationToken: O } = L[0];
51636
51640
  (!yn(j.token, I.sourceToken) || !yn(O.token, I.destToken)) && p({});
@@ -51645,62 +51649,98 @@ const Cy = T8(
51645
51649
  t.nativeGas,
51646
51650
  t.recipient,
51647
51651
  h
51648
- ]);
51649
- for (const T in u) {
51650
- const D = u[T];
51651
- if (D !== void 0 && D.success) {
51652
- const I = _o(
51653
- x,
51654
- D.destinationToken.amount,
51655
- t.destToken
51656
- );
51657
- if (A && I) {
51658
- const L = I / A;
51659
- A >= 1e3 && L <= 0.9 && delete u[T];
51660
- }
51661
- }
51662
- }
51663
- for (const T in u)
51664
- if (T.startsWith("MayanSwap")) {
51665
- const D = u[T];
51666
- if (D !== void 0 && D.success) {
51667
- const I = tP[(E = D.details) == null ? void 0 : E.type.toUpperCase()];
51668
- if (I && A !== void 0 && A > I)
51669
- u[T] = {
51670
- success: !1,
51671
- error: new Error(`Amount exceeds limit of $${I} USD`)
51672
- };
51673
- else {
51674
- const L = _o(
51675
- x,
51676
- t.amount,
51677
- t.sourceToken
51678
- ), j = _o(
51652
+ ]), {
51653
+ quotes: Ve(() => {
51654
+ var D;
51655
+ let T = Object.assign({}, u);
51656
+ for (const I in T) {
51657
+ const L = T[I];
51658
+ if (L !== void 0 && L.success) {
51659
+ const j = _o(
51679
51660
  x,
51680
- D.destinationToken.amount,
51661
+ L.destinationToken.amount,
51681
51662
  t.destToken
51682
51663
  );
51683
- if (L && j) {
51684
- const O = L - j;
51685
- !isNaN(O) && O > 0 && (u[T].relayFee = {
51686
- token: {
51687
- chain: "Solana",
51688
- address: ir.parseAddress(
51689
- "Solana",
51690
- li.get("Mainnet", "Solana")
51691
- )
51692
- },
51693
- amount: Jc(
51694
- y7(O, 6),
51695
- 6
51696
- )
51697
- });
51664
+ if (A && j) {
51665
+ const O = j / A;
51666
+ A >= 1e3 && O <= 0.9 && delete T[I];
51698
51667
  }
51699
51668
  }
51700
51669
  }
51701
- }
51702
- return {
51703
- quotes: u,
51670
+ for (const I in T)
51671
+ if (I.startsWith("MayanSwap")) {
51672
+ const L = T[I];
51673
+ if (L !== void 0 && L.success) {
51674
+ const j = tP[(D = L.details) == null ? void 0 : D.type.toUpperCase()];
51675
+ if (j && A !== void 0 && A > j)
51676
+ delete T[I], console.warn(
51677
+ `Filtering out ${I} quote which exceeds $${j} USD`
51678
+ );
51679
+ else {
51680
+ const O = _o(
51681
+ x,
51682
+ t.amount,
51683
+ t.sourceToken
51684
+ ), k = _o(
51685
+ x,
51686
+ L.destinationToken.amount,
51687
+ t.destToken
51688
+ );
51689
+ if (O && k) {
51690
+ const B = O - k;
51691
+ !isNaN(B) && B > 0 && (T[I].relayFee = {
51692
+ token: {
51693
+ chain: "Solana",
51694
+ address: ir.parseAddress(
51695
+ "Solana",
51696
+ li.get("Mainnet", "Solana")
51697
+ )
51698
+ },
51699
+ amount: Jc(
51700
+ y7(B, 6),
51701
+ 6
51702
+ )
51703
+ });
51704
+ }
51705
+ }
51706
+ }
51707
+ }
51708
+ if (ge.ui.onlyOfferManualRoutesAsFallback) {
51709
+ let I = !1;
51710
+ const L = {};
51711
+ for (const j in T) {
51712
+ const O = T[j];
51713
+ ge.routes.get(j).AUTOMATIC_DEPOSIT && (I = !0, L[j] = O);
51714
+ }
51715
+ I && (T = L);
51716
+ }
51717
+ if (typeof ge.filterRoutes == "function") {
51718
+ const I = Object.keys(T);
51719
+ try {
51720
+ const L = ge.filterRoutes([...I]);
51721
+ if (Array.isArray(L) && L.every(
51722
+ (j) => typeof j == "string" && I.includes(j)
51723
+ ))
51724
+ for (const j in T)
51725
+ L.includes(j) || delete T[j];
51726
+ else
51727
+ console.warn(
51728
+ "config.filterRoutes returned one or more invalid route names",
51729
+ L,
51730
+ "Falling back to all supported routes",
51731
+ I
51732
+ );
51733
+ } catch (L) {
51734
+ console.warn(
51735
+ "Error when filtering routes",
51736
+ L,
51737
+ "Falling back to all supported routes",
51738
+ I
51739
+ );
51740
+ }
51741
+ }
51742
+ return T;
51743
+ }, [u]),
51704
51744
  isFetchingInitialQuotes: i
51705
51745
  };
51706
51746
  };
@@ -51742,7 +51782,7 @@ const nP = ({
51742
51782
  return (async () => {
51743
51783
  h(!0);
51744
51784
  let C = [];
51745
- if (await ge.routes.forEach(async (A, E) => {
51785
+ await ge.routes.forEach(async (A, E) => {
51746
51786
  if (!E.AUTOMATIC_DEPOSIT && (i == null ? void 0 : i.name) === Da.NAME)
51747
51787
  return;
51748
51788
  let T = !1;
@@ -51768,26 +51808,7 @@ const nP = ({
51768
51808
  E.rc.name.includes("Mayan") && E.rc.name !== "MayanRouteSHUTTLE" && (T = !0), T && C.push(A);
51769
51809
  }), C.includes("ManualTBTC") && (C = C.filter(
51770
51810
  (A) => !["ManualTokenBridge", "AutomaticTokenBridge"].includes(A)
51771
- )), typeof ge.filterRoutes == "function")
51772
- try {
51773
- const A = ge.filterRoutes(C);
51774
- Array.isArray(A) && A.every(
51775
- (E) => typeof E == "string" && C.includes(E)
51776
- ) ? C = A : console.warn(
51777
- "config.filterRoutes returned one or more invalid route names",
51778
- A,
51779
- "Falling back to all supported routes",
51780
- C
51781
- );
51782
- } catch (A) {
51783
- console.warn(
51784
- "Error when filtering routes",
51785
- A,
51786
- "Falling back to all supported routes",
51787
- C
51788
- );
51789
- }
51790
- g && (h(!1), u(C));
51811
+ )), g && (h(!1), u(C));
51791
51812
  })(), () => {
51792
51813
  g = !1;
51793
51814
  };
@@ -56948,7 +56969,7 @@ const aY = Gt()((e) => ({
56948
56969
  return j && yn(j, L) ? 2 : L.isTokenBridgeWrappedToken ? 0 : 1;
56949
56970
  }, C = Ve(() => {
56950
56971
  if (!e.tokenList) return [];
56951
- let L = e.tokenList;
56972
+ const L = e.tokenList;
56952
56973
  if (u) {
56953
56974
  let k = [];
56954
56975
  const B = ge.tokens.get(