PageSourceSearch

https://www.wemix.com/_next/static/chunks/pages/_app-5eb490da1fa25fe1.js

js wemix.com collected 2026-10-04 00:30:54 UTC 1,860,784 bytes, 7,144 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{39474:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let c=o(r(50959)),l=a(r(82187)),u=r(55014),d=r(92823),h=(0,u.createModalHook)();function p({importer:e,type:t,id:r,props:n,overlayOptions:i,events:o}){let a=h(),[l,u]=(0,c.useState)();function p(){var e,t;return s(this,void 0,void 0,function*(){return yield null===(e=null==o?void 0:o.beforeClose)||void 0===e?void 0:e.call(o),a.closeModal({id:r}),null===(t=null==o?void 0:o.onClose)||void 0===t?void 0:t.call(o)})}if((0,c.useEffect)(()=>{e().then(u)},[t]),(0,c.useEffect)(()=>{var e;null===(e=null==o?void 0:o.onOpen)||void 0===e||e.call(o,{type:t,id:r,props:n})},[]),!l)return null;let g=l.default,m=Object.assign({},a.defaultOverlayOptions,l.defaultOverlayOptions,i);return c.default.createElement(d.ModalContext.Provider,{value:Object.assign(Object.assign({},a),{closeSelf:p})},c.default.createElement(f,Object.assign({},m,{closeSelf:p}),c.default.createElement(g,Object.assign({},n))))}let f=({className:e="",closeDelay:t=0,closeOnOverlayClick:r=!0,dim:n=!0,preventScroll:i=!0,children:o,closeSelf:a})=>{let[u,d]=(0,c.useState)(!1),[h,p]=(0,c.useState)(!1);function f(){return s(this,void 0,void 0,function*(){if(!h)return p(!0),d(!1),yield function(e){if(0!==e)return new Promise(t=>setTimeout(t,e))}(t),a()})}return(0,c.useEffect)(()=>void window.requestAnimationFrame(()=>d(!0)),[]),(0,c.useEffect)(()=>{if(i)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="initial"}},[]),c.default.createElement("div",{className:(0,l.default)("modal-overlay",e,{dim:n,visible:u}),"data-class":"reactleaf",onClick:e=>{r&&e.target===e.currentTarget&&f()}},(0,c.cloneElement)(o,{close:f,visible:u}))};t.default=function({register:e,openedModals:t}){return c.default.createElement("div",{id:"modal-root","data-class":"reactleaf"},t.map(t=>{let r=Object.assign({importer:e[t.type]},t);return c.default.createElement(p,Object.assign({key:t.id},r))}))}},77167:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}
1,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ModalProvider=void 0;let c=o(r(50959)),l=a(r(39474)),u=r(92823),d=a(r(2149));t.ModalProvider=({register:e,defaultOverlayOptions:t,children:r})=>{let n=(0,d.default)(),{openedModals:i}=n,o=s(n,["openedModals"]);(0,c.useEffect)(()=>{if("undefined"==typeof window)return;let e=e=>{var t,r;(null===(t=e.data)||void 0===t?void 0:t.to)&&(null===(r=e.data)||void 0===r?void 0:r.to)==="@reactleaf/modal"&&o.openModal(e.data.payload)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]);let a=u.ModalContext;return c.default.createElement(a.Provider,{value:Object.assign(Object.assign({openedModals:i,defaultOverlayOptions:t},o),{closeSelf:()=>console.error("closeSelf is not available outside of modal")})},r,c.default.createElement(l.default,{register:e,openedModals:i}))}},92823:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModalContext=void 0;let n=r(50959);t.ModalContext=(0,n.createContext)({openedModals:[],openModal:e=>"",closeModal:e=>void 0,closeAll:()=>void 0,closeSelf:()=>void 0})},55014:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createModalPreloader=t.createModalHook=void 0;let n=r(50959),i=r(92823);t.createModalHook=()=>()=>(0,n.useContext)(i.ModalContext),t.createModalPreloader=e=>(...t)=>{t.forEach(t=>e[t]())}},24543:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77167),t),i(r(55014),t),i(r(19865),t)},2149:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(50959);t.default=function(){let[e,t]=(0,n.useReducer)(function(e,t){switch(t.type){case"@modal/OPEN_MODAL":return[...e,t.payload];case"@modal/CLOSE_MODAL":return e.filter(e=>e.id!==t.payload.id);case"@modal/CLOSE_ALL":return[]}},[]);return Object.assign({openedModals:e},{openModal:e=>{var r;null===(r=document.activeElement)||void 0===r||r.blur();let n=function(e){let t=Math.floor(4294967295*Math.random()).toString(16).padStart(8,"0");return{type:"@modal/OPEN_MODAL",payload:Object.assign(Object.assign({},e),{id:t})}}(e);return t(n),n.payload.id},closeModal:e=>t({type:"@modal/CLOSE_MODAL",payload:e}),closeAll:()=>t({type:"@modal/CLOSE_ALL"})})}},19865:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88649:function(e,t,r){"use strict";e.exports=r(24543)},72165:function(e,t,r){"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function i(){let e=n();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=function(){return!!n()&&!!i()}},73027:function(e,t,r){"use strict";var n=r(14224);function i(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function o(){return void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=i,t.isNode=o,t.isBrowser=function(){return!i()&&!o()}},88497:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(65949);n.__exportStar(r(72165),t),n.__exportStar(r(73027),t)},56526:function(e,t,r){"use strict";r.d(t,{Ep:function(){return A},Fd:function(){return x},Rt:function(){return S},gw:function(){return i.a},jI:function(){return E}});var n=r(86984),i=r.n(n),o=r(41926);let s={level:"info"},a="custom_context";class c{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class l{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new c(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?this.tail&&(this.tail.next=t):this.head=t,this.tail=t,this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}}class u{constructor(e,t=1024e3){this.level=e??"error",this.levelValue=n.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new l(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===n.levels.values.error?console.error(e):t===n.levels.values.warn?console.warn(e):t===n.levels.values.debug?console.debug(e):t===n.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append((0,o.u)({timestamp:new Date().toISOString(),log:e}));let t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new l(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push((0,o.u)({extraMetadata:e})),new Blob(t,{type:"application/json"})}}class d{constructor(e,t=1024e3){this.baseChunkLogger=new u(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}class h{constructor(e,t=1024e3){this.baseChunkLogger=new u(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var p=Object.defineProperty,f=Object.defineProperties,g=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,w=(e,t,r)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>
1{for(var r in t||(t={}))y.call(t,r)&&w(e,r,t[r]);if(m)for(var r of m(t))b.call(t,r)&&w(e,r,t[r]);return e},C=(e,t)=>f(e,g(t));function E(e){return C(v({},e),{level:e?.level||s.level})}function x(e,t=a){return typeof e.bindings>"u"?function(e,t=a){return e[t]||""}(e,t):e.bindings().context||""}function A(e,t,r=a){let n=function(e,t,r=a){let n=x(e,r);return n.trim()?`${n}/${t}`:t}(e,t,r);return function(e,t,r=a){return e[r]=t,e}(e.child({context:n}),n,r)}function S(e){return"u">typeof e.loggerOverride&&"string"!=typeof e.loggerOverride?{logger:e.loggerOverride,chunkLoggerController:null}:"u">typeof window?function(e){var t,r;let n=new d(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:i()(C(v({},e.opts),{level:"trace",browser:C(v({},null==(r=e.opts)?void 0:r.browser),{write:e=>n.write(e)})})),chunkLoggerController:n}}(e):function(e){var t;let r=new h(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:i()(C(v({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}(e)}},41926:function(e,t,r){"use strict";r.d(t,{D:function(){return o},u:function(){return s}});let n=e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t),i=e=>JSON.parse(e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t);function o(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return i(e)}catch(t){return e}}function s(e){return"string"==typeof e?e:n(e)||""}},98319:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(65949);n.__exportStar(r(93497),t),n.__exportStar(r(72879),t)},93497:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},72879:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},46196:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(65949);n.__exportStar(r(20728),t),n.__exportStar(r(51215),t),n.__exportStar(r(88244),t),n.__exportStar(r(98319),t)},88244:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(65949).__exportStar(r(74218),t)},74218:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class r{}t.IWatch=r},40658:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let n=r(98319);t.toMiliseconds=function(e){return e*n.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/n.ONE_THOUSAND)}},52993:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},20728:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(65949);n.__exportStar(r(52993),t),n.__exportStar(r(40658),t)},51215:function(e,t){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},59908:function(e,t,r){"use strict";let n;r.d(t,{Z:function(){return mf}});var i={};r.r(i),r.d(i,{identity:function(){return ii}});var o={};r.r(o),r.d(o,{base2:function(){return io}});var s={};r.r(s),r.d(s,{base8:function(){return is}});var a={};r.r(a),r.d(a,{base10:function(){return ia}});var c={};r.r(c),r.d(c,{base16:function(){return ic},base16upper:function(){return il}});var l={};r.r(l),r.d(l,{base32:function(){return iu},base32hex:function(){return ig},base32hexpad:function(){return iy},base32hexpadupper:function(){return ib},base32hexupper:function(){return im},base32pad:function(){return ih},base32padupper:function(){return ip},base32upper:function(){return id},base32z:function(){return iw}});var u={};r.r(u),r.d(u,{base36:function(){return iv},base36upper:function(){return iC}});var d={};r.r(d),r.d(d,{base58btc:function(){return iE},base58flickr:function(){return ix}});var h={};r.r(h),r.d(h,{base64:function(){return iA},base64pad:function(){return iS},base64url:function(){return i_},base64urlpad:function(){return iI}});var p={};r.r(p),r.d(p,{base256emoji:function(){return iP}});var f={};r.r(f),r.d(f,{sha256:function(){return iW},sha512:function(){return iq}});var g={};r.r(g),r.d(g,{identity:function(){return iV}});var m={};r.r(m),r.d(m,{code:function(){return iG},decode:function(){return iY},encode:function(){return iZ},name:function(){return iK}});var y={};r.r(y),r.d(y,{code:function(){return i0},decode:function(){return i2},encode:function(){return i1},name:function(){return iQ}});var b=r(72100),w=r.n(b),v=r(46196);class C{}class E extends C{constructor(e){super()}}let x=v.FIVE_SECONDS,A="heartbeat_pulse";class S extends E{constructor(e){super(e),this.events=new b.EventEmitter,this.interval=x,this.interval=e?.interval||x}static async init(e){let t=new S(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}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 initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,v.toMiliseconds)(this.interval))}pulse(){this.events.emit(A)}}let _=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,I=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,k=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function O(e,t){if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);return}return t}function N(e,t={}){if("string"!=typeof e)return e;if('"'===e[0]&&'"'===e[e.length-1]&&-1===e.indexOf("\\"))return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!k.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(_.test(e)||I.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,O)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}var P=r(55872).Buffer;function T(e,...t){try{var r;return(r=e(...t))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}function R(e){if(function(e){let t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return R(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}let $="base64:";function D(e){return e&&e.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function L(e){return(e=D(e))?e+":":""}let M=()=>{let e=new Map;return{name:"memory",getInstance:()=>e,hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>[...e.keys()],clear(){e.clear()},dispose(){e.clear()}}};function U(e,t,r){return e.watch?e.watch((e,n)=>t(e,r+n)):()=>{}}
1async function j(e){"function"==typeof e.dispose&&await T(e.dispose)}function B(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function F(e,t){let r;let n=()=>{if(r)return r;let n=indexedDB.open(e);return n.onupgradeneeded=()=>n.result.createObjectStore(t),(r=B(n)).then(e=>{e.onclose=()=>r=void 0},()=>{}),r};return(e,r)=>n().then(n=>r(n.transaction(t,e).objectStore(t)))}function z(){return n||(n=F("keyval-store","keyval")),n}function H(e,t=z()){return t("readonly",t=>B(t.get(e)))}var W=r(41926),q=(e={})=>{let t;let r=e.base&&e.base.length>0?`${e.base}:`:"",n=e=>r+e;return e.dbName&&e.storeName&&(t=F(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await H(n(e),t)>"u"),getItem:async e=>await H(n(e),t)??null,setItem:(e,r)=>(function(e,t,r=z()){return r("readwrite",r=>(r.put(t,e),B(r.transaction)))})(n(e),r,t),removeItem:e=>(function(e,t=z()){return t("readwrite",t=>(t.delete(e),B(t.transaction)))})(n(e),t),getKeys:()=>(function(e=z()){return e("readonly",e=>{var t;if(e.getAllKeys)return B(e.getAllKeys());let r=[];return(t=e=>r.push(e.key),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},B(e.transaction)).then(()=>r)})})(t),clear:()=>(function(e=z()){return e("readwrite",e=>(e.clear(),B(e.transaction)))})(t)}};class V{constructor(){this.indexedDb=function(e={}){let t={mounts:{"":e.driver||M()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(let r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},n=(e,r)=>t.mountpoints.filter(t=>t.startsWith(e)||r&&e.startsWith(t)).map(r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]})),i=(e,r)=>{if(t.watching)for(let n of(r=D(r),t.watchListeners))n(e,r)},o=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await U(t.mounts[e],i,e)},s=async()=>{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},a=(e,t,n)=>{let i=new Map,o=e=>{let t=i.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},i.set(e.base,t)),t};for(let n of e){let e="string"==typeof n,i=D(e?n:n.key),s=e?void 0:n.value,a=e||!n.options?t:{...t,...n.options},c=r(i);o(c).items.push({key:i,value:s,relativeKey:c.relativeKey,options:a})}return Promise.all([...i.values()].map(e=>n(e))).then(e=>e.flat())},c={hasItem(e,t={}){let{relativeKey:n,driver:i}=r(e=D(e));return T(i.hasItem,n,t)},getItem(e,t={}){let{relativeKey:n,driver:i}=r(e=D(e));return T(i.getItem,n,t).then(e=>N(e))},getItems:(e,t={})=>a(e,t,e=>e.driver.getItems?T(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:function(...e){return D(e.join(":"))}(e.base,t.key),value:N(t.value)}))):Promise.all(e.items.map(t=>T(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:N(e)}))))),getItemRaw(e,t={}){let{relativeKey:n,driver:i}=r(e=D(e));return i.getItemRaw?T(i.getItemRaw,n,t):T(i.getItem,n,t).then(e=>{var t;return"string"==typeof e&&e.startsWith($)?(t=e.slice($.length),globalThis.Buffer?P.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))):e})},async setItem(e,t,n={}){if(void 0===t)return c.removeItem(e);let{relativeKey:o,driver:s}=r(e=D(e));s.setItem&&(await T(s.setItem,o,R(t),n),s.watch||i("update",e))},async setItems(e,t){await a(e,t,async e=>{if(e.driver.setItems)return T(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:R(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>T(e.driver.setItem,t.relativeKey,R(t.value),t.options)))})},async setItemRaw(e,t,n={}){if(void 0===t)return c.removeItem(e,n);let{relativeKey:o,driver:s}=r(e=D(e));if(s.setItemRaw)await T(s.setItemRaw,o,t,n);else{if(!s.setItem)return;await T(s.setItem,o,"string"==typeof t?t:$+(globalThis.Buffer?P.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))),n)}s.watch||i("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:n,driver:o}=r(e=D(e));o.removeItem&&(await T(o.removeItem,n,t),(t.removeMeta||t.removeMata)&&await T(o.removeItem,n+"$",t),o.watch||i("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:n,driver:i}=r(e=D(e)),o=Object.create(null);if(i.getMeta&&Object.assign(o,await T(i.getMeta,n,t)),!t.nativeOnly){let e=await T(i.getItem,
1n+"$",t).then(e=>N(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(o,e))}return o},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let r=n(e=L(e),!0),i=[],o=[],s=!0;for(let e of r){for(let r of(e.driver.flags?.maxDepth||(s=!1),await T(e.driver.getKeys,e.relativeBase,t))){let t=e.mountpoint+D(r);i.some(e=>t.startsWith(e))||o.push(t)}i=[e.mountpoint,...i.filter(t=>!t.startsWith(e.mountpoint))]}let a=void 0!==t.maxDepth&&!s;return o.filter(r=>{var n;return(!a||function(e,t){if(void 0===t)return!0;let r=0,n=e.indexOf(":");for(;n>-1;)r++,n=e.indexOf(":",n+1);return r<=t}(r,t.maxDepth))&&((n=e)?r.startsWith(n)&&"$"!==r[r.length-1]:"$"!==r[r.length-1])})},async clear(e,t={}){e=L(e),await Promise.all(n(e,!1).map(async e=>e.driver.clear?T(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(r=>e.driver.removeItem(r,t))):void 0))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>j(e)))},watch:async e=>(await o(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await s()}),async unwatch(){t.watchListeners=[],await s()},mount(e,r){if((e=L(e))&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=r,t.watching&&Promise.resolve(U(r,i,e)).then(r=>{t.unwatch[e]=r}).catch(console.error),c},async unmount(e,r=!0){(e=L(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e]?.(),delete t.unwatch[e]),r&&await j(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){let t=r(e=D(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>n(e=D(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint})),keys:(e,t={})=>c.getKeys(e,t),get:(e,t={})=>c.getItem(e,t),set:(e,t,r={})=>c.setItem(e,t,r),has:(e,t={})=>c.hasItem(e,t),del:(e,t={})=>c.removeItem(e,t),remove:(e,t={})=>c.removeItem(e,t)};return c}({driver:q({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,(0,W.u)(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var K="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},G={exports:{}};function Z(e){var t;return[e[0],(0,W.D)(null!=(t=e[1])?t:"")]}!function(){function e(){}e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof K&&K.localStorage?G.exports=K.localStorage:"u">typeof window&&window.localStorage?G.exports=window.localStorage:G.exports=new e}();class Y{constructor(){this.localStorage=G.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Z)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return(0,W.D)(t)}async setItem(e,t){this.localStorage.setItem(e,(0,W.u)(t))}async removeItem(e){this.localStorage.removeItem(e)}}let J=async(e,t,r)=>{let n="wc_storage_version",i=await t.getItem(n);if(i&&i>=1){r(t);return}let o=await e.getKeys();if(!o.length){r(t);return}let s=[];for(;o.length;){let r=o.shift();if(!r)continue;let n=r.toLowerCase();if(n.includes("wc@")||n.includes("walletconnect")||n.includes("wc_")||n.includes("wallet_connect")){let n=await e.getItem(r);await t.setItem(r,n),s.push(r)}}await t.setItem(n,1),r(t),X(e,s)},X=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class Q{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new Y;this.storage=e;try{let t=new V;J(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var ee=r(56526),et=Object.defineProperty,er=(e,t,r)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,en=(e,t,r)=>er(e,"symbol"!=typeof t?t+"":t,r);class ei extends C{constructor(e){super(),this.opts=e,en(this,"protocol","wc"),en(this,"version",2)}}var eo=Object.defineProperty,es=(e,t,r)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ea=(e,t,r)=>es(e,"symbol"!=typeof t?t+"":t,r);class ec extends C{constructor(e,t){super(),this.core=e,this.logger=t,ea(this,"records",new Map)}}
1class el{constructor(e,t){this.logger=e,this.core=t}}class eu extends C{constructor(e,t){super(),this.relayer=e,this.logger=t}}class ed extends C{constructor(e){super()}}class eh{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}class ep extends C{constructor(e,t){super(),this.relayer=e,this.logger=t}}class ef extends C{constructor(e,t){super(),this.core=e,this.logger=t}}class eg{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}}class em{constructor(e,t){this.projectId=e,this.logger=t}}class ey{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}}var eb=Object.defineProperty,ew=(e,t,r)=>t in e?eb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ev=(e,t,r)=>ew(e,"symbol"!=typeof t?t+"":t,r);class eC{constructor(e){this.opts=e,ev(this,"protocol","wc"),ev(this,"version",2)}}class eE{constructor(e){this.client=e}}function ex(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function eA(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}let eS="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,e_=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function eI(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}(e)),ex(e),e}class ek{clone(){return this._cloneInto()}}function eO(e=32){if(eS&&"function"==typeof eS.getRandomValues)return eS.getRandomValues(new Uint8Array(e));if(eS&&"function"==typeof eS.randomBytes)return eS.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}class eN extends ek{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=e_(this.buffer)}update(e){eA(this);let{view:t,buffer:r,blockLen:n}=this,i=(e=eI(e)).length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let t=e_(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){eA(this),function(e,t){ex(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,l=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+l,a,n)})(r,n-8,BigInt(8*this.length),i),this.process(r,0);let s=e_(e),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=a/4,l=this.get();if(c>l.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}let eP=BigInt(4294967296-1),eT=BigInt(32),eR={split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=function(e,t=!1){return t?{h:Number(e&eP),l:Number(e>>eT&eP)}:{h:0|Number(e>>eT&eP),l:0|Number(e&eP)}}(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]},shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,add:function(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/4294967296|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/4294967296|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/4294967296|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/4294967296|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},[e$,eD]=eR.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
16f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),eL=new Uint32Array(80),eM=new Uint32Array(80);class eU extends eN{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,r,n,i,o,s,a,c,l,u,d,h,p,f,g]}set(e,t,r,n,i,o,s,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)eL[r]=e.getUint32(t),eM[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|eL[e-15],r=0|eM[e-15],n=eR.rotrSH(t,r,1)^eR.rotrSH(t,r,8)^eR.shrSH(t,r,7),i=eR.rotrSL(t,r,1)^eR.rotrSL(t,r,8)^eR.shrSL(t,r,7),o=0|eL[e-2],s=0|eM[e-2],a=eR.rotrSH(o,s,19)^eR.rotrBH(o,s,61)^eR.shrSH(o,s,6),c=eR.rotrSL(o,s,19)^eR.rotrBL(o,s,61)^eR.shrSL(o,s,6),l=eR.add4L(i,c,eM[e-7],eM[e-16]),u=eR.add4H(l,n,a,eL[e-7],eL[e-16]);eL[e]=0|u,eM[e]=0|l}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:p,Gh:f,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){let t=eR.rotrSH(u,d,14)^eR.rotrSH(u,d,18)^eR.rotrBH(u,d,41),b=eR.rotrSL(u,d,14)^eR.rotrSL(u,d,18)^eR.rotrBL(u,d,41),w=u&h^~u&f,v=d&p^~d&g,C=eR.add5L(y,b,v,eD[e],eM[e]),E=eR.add5H(C,m,t,w,e$[e],eL[e]),x=0|C,A=eR.rotrSH(r,n,28)^eR.rotrBH(r,n,34)^eR.rotrBH(r,n,39),S=eR.rotrSL(r,n,28)^eR.rotrBL(r,n,34)^eR.rotrBL(r,n,39),_=r&i^r&s^i&s,I=n&o^n&a^o&a;m=0|f,y=0|g,f=0|h,g=0|p,h=0|u,p=0|d,({h:u,l:d}=eR.add(0|c,0|l,0|E,0|x)),c=0|s,l=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let k=eR.add3L(x,S,I);r=eR.add3H(k,E,A,_),n=0|k}({h:r,l:n}=eR.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=eR.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=eR.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:l}=eR.add(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=eR.add(0|this.Eh,0|this.El,0|u,0|d)),({h:h,l:p}=eR.add(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:g}=eR.add(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:y}=eR.add(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(r,n,i,o,s,a,c,l,u,d,h,p,f,g,m,y)}roundClean(){eL.fill(0),eM.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let ej=function(e){let t=t=>e().update(eI(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}(()=>new eU),eB=BigInt(0),eF=BigInt(1),ez=BigInt(2);function eH(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function eW(e){if(!eH(e))throw Error("Uint8Array expected")}function eq(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}let eV=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function eK(e){eW(e);let t="";for(let r=0;r<e.length;r++)t+=eV[e[r]];return t}function eG(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?eB:BigInt("0x"+e)}let eZ={_0:48,_9:57,A:65,F:70,a:97,f:102};function eY(e){return e>=eZ._0&&e<=eZ._9?e-eZ._0:e>=eZ.A&&e<=eZ.F?e-(eZ.A-10):e>=eZ.a&&e<=eZ.f?e-(eZ.a-10):void 0}function eJ(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=eY(e.charCodeAt(i)),o=eY(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function eX(e){return eW(e),eG(eK(Uint8Array.from(e).reverse()))}function eQ(e,t){return eJ(e.toString(16).padStart(2*t,"0"))}function e0(e,t){return eQ(e,t).reverse()}function e1(e,t,r){let n;if("string"==typeof t)try{n=eJ(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(eH(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function e2(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];eW(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let e5=e=>"bigint"==typeof e&&eB<=e;function e3(e,t,r,n){if(!(e5(t)&&e5(r)&&e5(n))||!(r<=t)||!(t<n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}let e6=e=>(ez<<BigInt(e-1))-eF,e4={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||eH(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function e8(e,t,r={}){let n=(t,r,n)=>{let i=e4[r];if("function"!=typeof i)throw Error("invalid validator function");let o=e[t];if(!(n&&void 0===o)&&!i(o,e))throw Error("param "+String(t)+" is invali
1d. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function e9(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let o=e(r,...n);return t.set(r,o),o}}let e7=BigInt(0),te=BigInt(1),tt=BigInt(2),tr=BigInt(3),tn=BigInt(4),ti=BigInt(5),to=BigInt(8);function ts(e,t){let r=e%t;return r>=e7?r:t+r}function ta(e,t,r){let n=e;for(;t-- >e7;)n*=n,n%=r;return n}function tc(e,t){if(e===e7)throw Error("invert: expected non-zero number");if(t<=e7)throw Error("invert: expected positive modulus, got "+t);let r=ts(e,t),n=t,i=e7,o=te;for(;r!==e7;){let e=n/r,t=n%r,s=i-o*e;n=r,r=t,i=o,o=s}if(n!==te)throw Error("invert: does not exist");return ts(i,t)}let tl=(e,t)=>(ts(e,t)&te)===te,tu=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function td(e,t){let r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function th(e,t,r=!1,n={}){let i;if(e<=e7)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=td(e,t);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:e6(o),ZERO:e7,ONE:te,create:t=>ts(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return e7<=t&&t<e},is0:e=>e===e7,isOdd:e=>(e&te)===te,neg:t=>ts(-t,e),eql:(e,t)=>e===t,sqr:t=>ts(t*t,e),add:(t,r)=>ts(t+r,e),sub:(t,r)=>ts(t-r,e),mul:(t,r)=>ts(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<e7)throw Error("invalid exponent, negatives unsupported");if(r===e7)return e.ONE;if(r===te)return t;let n=e.ONE,i=t;for(;r>e7;)r&te&&(n=e.mul(n,i)),i=e.sqr(i),r>>=te;return n})(a,e,t),div:(t,r)=>ts(t*tc(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>tc(t,e),sqrt:n.sqrt||(t=>(i||(i=function(e){if(e%tn===tr){let t=(e+te)/tn;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%to===ti){let t=(e-ti)/to;return function(e,r){let n=e.mul(r,tt),i=e.pow(n,t),o=e.mul(r,i),s=e.mul(e.mul(o,tt),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),r))throw Error("Cannot find square root");return a}}return function(e){let t,r,n;let i=(e-te)/tt;for(t=e-te,r=0;t%tt===e7;t/=tt,r++);for(n=tt;n<e&&function(e,t,r){if(t<e7)throw Error("invalid exponent, negatives unsupported");if(r<=e7)throw Error("invalid modulus");if(r===te)return e7;let n=te;for(;t>e7;)t&te&&(n=n*e%r),e=e*e%r,t>>=te;return n}(n,i,e)!==e-te;n++)if(n>1e3)throw Error("Cannot find square root: likely non-prime P");if(1===r){let t=(e+te)/tn;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let o=(t+te)/tt;return function(e,s){if(e.pow(s,i)===e.neg(e.ONE))throw Error("Cannot find square root");let a=r,c=e.pow(e.mul(e.ONE,n),t),l=e.pow(s,o),u=e.pow(s,t);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(u);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(c,te<<BigInt(a-t-1));c=e.sqr(r),l=e.mul(l,r),u=e.mul(u,c),a=t}return l}}(e)}(e)),i(a,t))),invertBatch:e=>(function(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r})(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?e0(e,s):eQ(e,s),fromBytes:e=>{if(e.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?eX(e):eG(eK(e))}});return Object.freeze(a)}let tp=BigInt(0),tf=BigInt(1);function tg(e,t){let r=t.negate();return e?r:t}function tm(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function ty(e,t){return tm(e,t),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}let tb=new WeakMap,tw=new WeakMap;function tv(e){return tw.get(e)||1}let tC=BigInt(0),tE=BigInt(1),tx=BigInt(2),tA=BigInt(8),tS={zip215:!0};BigInt(0),BigInt(1);let t_=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),tI=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);let tk=BigInt(1),tO=BigInt(2);BigInt(3);let tN=BigInt(5),tP=BigInt(8),tT=th(t_,void 0,!0),tR=function(e){var t;let r=function(e){let t=(e8(e.Fp,tu.reduce((e,t)=>
1(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),e8(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...td(e.n,e.nBitLength),...e,p:e.Fp.ORDER}));return e8(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:n,n:i,prehash:o,hash:s,randomBytes:a,nByteLength:c,h:l}=r,u=tx<<BigInt(8*c)-tE,d=n.create,h=th(r.n,r.nBitLength),p=r.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch{return{isValid:!1,value:tC}}}),f=r.adjustScalarBytes||(e=>e),g=r.domain||((e,t,r)=>{if(eq("phflag",r),t.length||r)throw Error("Contexts/pre-hash are not supported");return e});function m(e,t){e3("coordinate "+e,t,tC,u)}function y(e){if(!(e instanceof v))throw Error("ExtendedPoint expected")}let b=e9((e,t)=>{let{ex:r,ey:i,ez:o}=e,s=e.is0();null==t&&(t=s?tA:n.inv(o));let a=d(r*t),c=d(i*t),l=d(o*t);if(s)return{x:tC,y:tE};if(l!==tE)throw Error("invZ was invalid");return{x:a,y:c}}),w=e9(e=>{let{a:t,d:n}=r;if(e.is0())throw Error("bad point: ZERO");let{ex:i,ey:o,ez:s,et:a}=e,c=d(i*i),l=d(o*o),u=d(s*s),h=d(u*u),p=d(c*t);if(d(u*d(p+l))!==d(h+d(n*d(c*l))))throw Error("bad point: equation left != right (1)");if(d(i*o)!==d(s*a))throw Error("bad point: equation left != right (2)");return!0});class v{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,m("x",e),m("y",t),m("z",r),m("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof v)throw Error("extended point not allowed");let{x:t,y:r}=e||{};return m("x",t),m("y",r),new v(t,r,tE,d(t*r))}static normalizeZ(e){let t=n.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(v.fromAffine)}static msm(e,t){return function(e,t,r,n){if(function(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})}(r,e),function(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}(n,t),r.length!==n.length)throw Error("arrays of points and scalars must have equal length");let i=e.ZERO,o=function(e){let t;for(t=0;e>eB;e>>=eF,t+=1);return t}(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,a=(1<<s)-1,c=Array(a+1).fill(i),l=Math.floor((t.BITS-1)/s)*s,u=i;for(let e=l;e>=0;e-=s){c.fill(i);for(let t=0;t<n.length;t++){let i=Number(n[t]>>BigInt(e)&BigInt(a));c[i]=c[i].add(r[t])}let t=i;for(let e=c.length-1,r=i;e>0;e--)r=r.add(c[e]),t=t.add(r);if(u=u.add(t),0!==e)for(let e=0;e<s;e++)u=u.double()}return u}(v,h,e,t)}_setWindowSize(e){x.setWindowSize(this,e)}assertValidity(){w(this)}equals(e){y(e);let{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=e,a=d(t*s),c=d(i*n),l=d(r*s),u=d(o*n);return a===c&&l===u}is0(){return this.equals(v.ZERO)}negate(){return new v(d(-this.ex),this.ey,this.ez,d(-this.et))}double(){let{a:e}=r,{ex:t,ey:n,ez:i}=this,o=d(t*t),s=d(n*n),a=d(tx*d(i*i)),c=d(e*o),l=t+n,u=d(d(l*l)-o-s),h=c+s,p=h-a,f=c-s,g=d(u*p),m=d(h*f),y=d(u*f);return new v(g,m,d(p*h),y)}add(e){y(e);let{a:t,d:n}=r,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:l,ez:u,et:h}=e;if(t===BigInt(-1)){let e=d((o-i)*(l+c)),t=d((o+i)*(l-c)),r=d(t-e);if(r===tC)return this.double();let n=d(s*tx*h),p=d(a*tx*u),f=p+n,g=t+e,m=p-n,y=d(f*r),b=d(g*m),w=d(f*m);return new v(y,b,d(r*g),w)}let p=d(i*c),f=d(o*l),g=d(a*n*h),m=d(s*u),b=d((i+o)*(c+l)-p-f),w=m-g,C=m+g,E=d(f-t*p),x=d(b*w),A=d(C*E),S=d(b*E);return new v(x,A,d(w*C),S)}subtract(e){return this.add(e.negate())}wNAF(e){return x.wNAFCached(this,e,v.normalizeZ)}multiply(e){e3("scalar",e,tE,i);let{p:t,f:r}=this.wNAF(e);return v.normalizeZ([t,r])[0]}multiplyUnsafe(e,t=v.ZERO){return e3("scalar",e,tC,i),e===tC?E:this.is0()||e===tE?this:x.wNAFCachedUnsafe(this,e,v.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return x.unsafeLadder(this,i).is0()}toAffine(e){return b(this,e)}clearCofactor(){let{h:e}=r;return e===tE?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){let{d:i,a:o}=r,s=n.BYTES;e=e1("pointHex",e,s),eq("zip215",t);let a=e.slice(),c=e[s-1];a[s-1]=-129&c;let l=eX(a);e3("pointHex.y",l,tC,t?u:n.ORDER);let h=d(l*l),{isValid:f,value:g}=p(d(h-tE),d(i*h-o));
1if(!f)throw Error("Point.fromHex: invalid y coordinate");let m=(g&tE)===tE,y=(128&c)!=0;if(!t&&g===tC&&y)throw Error("Point.fromHex: x=0 and x_0=1");return y!==m&&(g=d(-g)),v.fromAffine({x:g,y:l})}static fromPrivateKey(e){return A(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),r=e0(t,n.BYTES);return r[r.length-1]|=e&tE?128:0,r}toHex(){return eK(this.toRawBytes())}}v.BASE=new v(r.Gx,r.Gy,tE,d(r.Gx*r.Gy)),v.ZERO=new v(tC,tE,tE,tC);let{BASE:C,ZERO:E}=v,x=(t=8*c,{constTimeNegate:tg,hasPrecomputes:e=>1!==tv(e),unsafeLadder(e,t,r=v.ZERO){let n=e;for(;t>tp;)t&tf&&(r=r.add(n)),n=n.double(),t>>=tf;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=ty(r,t),o=[],s=e,a=s;for(let e=0;e<n;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,r,n){let{windows:i,windowSize:o}=ty(e,t),s=v.ZERO,a=v.BASE,c=BigInt(2**e-1),l=2**e,u=BigInt(e);for(let e=0;e<i;e++){let t=e*o,i=Number(n&c);n>>=u,i>o&&(i-=l,n+=tf);let d=t+Math.abs(i)-1,h=e%2!=0,p=i<0;0===i?a=a.add(tg(h,r[t])):s=s.add(tg(p,r[d]))}return{p:s,f:a}},wNAFUnsafe(e,r,n,i=v.ZERO){let{windows:o,windowSize:s}=ty(e,t),a=BigInt(2**e-1),c=2**e,l=BigInt(e);for(let e=0;e<o;e++){let t=e*s;if(n===tp)break;let o=Number(n&a);if(n>>=l,o>s&&(o-=c,n+=tf),0===o)continue;let u=r[t+Math.abs(o)-1];o<0&&(u=u.negate()),i=i.add(u)}return i},getPrecomputes(e,t,r){let n=tb.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&tb.set(t,r(n))),n},wNAFCached(e,t,r){let n=tv(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=tv(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){tm(r,t),tw.set(e,r),tb.delete(e)}});function A(e){let t=n.BYTES;e=e1("private key",e,t);let r=e1("hashed private key",s(e),2*t),o=f(r.slice(0,t)),a=r.slice(t,2*t),c=ts(eX(o),i),l=C.multiply(c),u=l.toRawBytes();return{head:o,prefix:a,scalar:c,point:l,pointBytes:u}}function S(e=new Uint8Array,...t){return ts(eX(s(g(e2(...t),e1("context",e),!!o))),i)}return C._setWindowSize(8),{CURVE:r,getPublicKey:function(e){return A(e).pointBytes},sign:function(e,t,r={}){e=e1("message",e),o&&(e=o(e));let{prefix:s,scalar:a,pointBytes:c}=A(t),l=S(r.context,s,e),u=C.multiply(l).toRawBytes(),d=ts(l+S(r.context,u,c,e)*a,i);return e3("signature.s",d,tC,i),e1("result",e2(u,e0(d,n.BYTES)),2*n.BYTES)},verify:function(e,t,r,i=tS){let s,a,c;let{context:l,zip215:u}=i,d=n.BYTES;e=e1("signature",e,2*d),t=e1("message",t),r=e1("publicKey",r,d),void 0!==u&&eq("zip215",u),o&&(t=o(t));let h=eX(e.slice(d,2*d));try{s=v.fromHex(r,u),a=v.fromHex(e.slice(0,d),u),c=C.multiplyUnsafe(h)}catch{return!1}if(!u&&s.isSmallOrder())return!1;let p=S(l,a.toRawBytes(),s.toRawBytes(),t);return a.add(s.multiplyUnsafe(p)).subtract(c).clearCofactor().equals(v.ZERO)},ExtendedPoint:v,utils:{getExtendedPublicKey:A,randomPrivateKey:()=>a(n.BYTES),precompute:(e=8,t=v.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:tT,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:tP,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ej,randomBytes:eO,adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e},uvRatio:function(e,t){let r=ts(t*t*t,t_),n=function(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=e*e%t_*e%t_,s=ta(o,tO,t_)*o%t_,a=ta(s,tk,t_)*e%t_,c=ta(a,tN,t_)*a%t_,l=ta(c,t,t_)*c%t_,u=ta(l,r,t_)*l%t_,d=ta(u,n,t_)*u%t_,h=ta(d,i,t_)*d%t_,p=ta(h,i,t_)*d%t_,f=ta(p,t,t_)*c%t_;return{pow_p_5_8:ta(f,tO,t_)*e%t_,b2:o}}(e*ts(r*r*t,t_)).pow_p_5_8,i=ts(e*r*n,t_),o=ts(t*i*i,t_),s=i,a=ts(i*tI,t_),c=o===e,l=o===ts(-e,t_),u=o===ts(-e*tI,t_);return c&&(i=s),(l||u)&&(i=a),tl(i,t_)&&(i=ts(-i,t_)),{isValid:c||l,value:i}}}),t$="base64url",tD="utf8",tL="utf8",tM="base58btc";function tU(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function tj(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?t
1U(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function tB(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=tj(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return tU(r)}var tF=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===c;)n++,t++;for(var o=(e.length-t)*l+1>>>0,s=new Uint8Array(o);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=o-1;(0!==u||d<i)&&-1!==h;h--,d++)u+=a*s[h]>>>0,s[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var p=o-i;p!==o&&0===s[p];)p++;for(var f=new Uint8Array(n+(o-p)),g=n;p!==o;)f[g++]=s[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*u+1>>>0,l=new Uint8Array(s);i!==o;){for(var d=t[i],h=0,p=s-1;(0!==d||h<n)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");n=h,i++}for(var f=s-n;f!==s&&0===l[f];)f++;for(var g=c.repeat(r);f<s;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:d,decode:function(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}}};let tz=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},tH=e=>new TextEncoder().encode(e),tW=e=>new TextDecoder().decode(e);class tq{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class tV{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return tG(this,e)}}class tK{constructor(e){this.decoders=e}or(e){return tG(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let tG=(e,t)=>new tK({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class tZ{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new tq(e,t,r),this.decoder=new tV(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let tY=({name:e,prefix:t,encode:r,decode:n})=>new tZ(e,t,r,n),tJ=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=tF(r,t);return tY({prefix:e,name:t,encode:n,decode:e=>tz(i(e))})},tX=(e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;let s=new Uint8Array(o*r/8|0),a=0,c=0,l=0;for(let t=0;t<o;++t){let o=i[e[t]];if(void 0===o)throw SyntaxError(`Non-${n} character`);c=c<<r|o,(a+=r)>=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return s},tQ=(e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},t0=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>tY({prefix:t,name:e,encode:e=>tQ(e,n,r),decode:t=>tX(t,n,r,e)});var t1=Object.freeze({__proto__:null,identity:tY({prefix:"\0",name:"identity",encode:e=>tW(e),decode:e=>tH(e)})}),t2=Object.freeze({__proto__:null,base2:t0({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),t5=Object.freeze({__proto__:null,base8:t0({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),t3=Object.freeze({__proto__:null,base10:tJ({prefix:"9",name:"base10",alphabet:"0123456789"})}),t6=Object.freeze({__proto__:null,base16:t0({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:t0({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let t4=t0({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),t8=t0({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),t9=t0({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),t7=t0({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),re=t0({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rt=t0({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var rr=Object.freeze({__proto__:null,base32:t4,base32upper:t8,base32pad:t9,base32padupper:t7,base32hex:re,base32hexupper:rt,base32hexpad:t0({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:t0({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:t0({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),rn=Object.freeze({__proto__:null,base36:tJ({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:tJ({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),ri=Object.freeze({__proto__:null,base58btc:tJ({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:tJ({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let ro=t0({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/",bitsPerChar:6});var rs=Object.freeze({__proto__:null,base64:ro,base64pad:t0({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:t0({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:t0({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let ra=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),rc=ra.reduce((e,t,r)=>(e[r]=t,e),[]),rl=ra.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var ru=Object.freeze({__proto__:null,base256emoji:tY({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=rc[t],"")},decode:function(e){let t=[];for(let r of e){let e=rl[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function rd(e,t){var r,n=0,t=t||0,i=0,o=t,s=e.length;do{if(o>=s)throw rd.bytes=0,RangeError("Could not decode varint");r=e[o++],n+=i<28?(127&r)<<i:(127&r)*Math.pow(2,i),i+=7}while(r>=128);return rd.bytes=o-t,n}var rh=function e(t,r,n){r=r||[],n=n||0;for(var i=n;t>=2147483648;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r};let rp=(e,t,r=0)=>(rh(e,t,r),t),rf=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,rg=(e,t)=>{let r=t.byteLength,n=rf(e),i=n+rf(r),o=new Uint8Array(i+r);return rp(e,o,0),rp(r,o,n),o.set(t,i),new rm(e,r,t,o)};
1class rm{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let ry=({name:e,code:t,encode:r})=>new rb(e,t,r);class rb{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?rg(this.code,t):t.then(e=>rg(this.code,e))}throw Error("Unknown type, must be binary type")}}let rw=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var rv=Object.freeze({__proto__:null,sha256:ry({name:"sha2-256",code:18,encode:rw("SHA-256")}),sha512:ry({name:"sha2-512",code:19,encode:rw("SHA-512")})}),rC=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:tz,digest:e=>rg(0,tz(e))}});new TextEncoder,new TextDecoder;let rE={...t1,...t2,...t5,...t3,...t6,...rr,...rn,...ri,...rs,...ru};function rx(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...rv,...rC});let rA=rx("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),rS=rx("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=tj((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),r_={utf8:rA,"utf-8":rA,hex:rE.base16,latin1:rS,ascii:rS,binary:rS,...rE};function rI(e,t="utf8"){let r=r_[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function rk(e,t="utf8"){let r=r_[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?tU(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function rO(e){return(0,W.D)(rI(rk(e,t$),tD))}function rN(e){return rI(rk((0,W.u)(e),tD),t$)}function rP(e){return["did","key","z"+rI(tB([rk("K36",tM),e]),tM)].join(":")}function rT(e){let t=e.split("."),r=rO(t[0]);return{header:r,payload:rO(t[1]),signature:rk(t[2],t$),data:rk(t.slice(0,2).join("."),tL)}}function rR(e=eO(32)){let t=tR.getPublicKey(e);return{secretKey:tB([e,t]),publicKey:t}}async function r$(e,t,r,n,i=(0,v.fromMiliseconds)(Date.now())){var o,s;let a={alg:"EdDSA",typ:"JWT"},c={iss:rP(n.publicKey),sub:e,aud:t,iat:i,exp:i+r},l=rk([rN((o={header:a,payload:c}).header),rN(o.payload)].join("."),tL);return[rN((s={header:a,payload:c,signature:tR.sign(l,n.secretKey.slice(0,32))}).header),rN(s.payload),rI(s.signature,t$)].join(".")}var rD=r(14224),rL=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},rM=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"},rU=function(e){this.version=e,this.type="node",this.name="node",this.os=rD.platform},rj=function(e,t,r,n){this.name=e,this.version=t,this.os=r,this.bot=n,this.type="bot-device"},rB=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},rF=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},rz=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,rH=[["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|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;
1\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],rW=[["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/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["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/]],rq=r(73079),rV=r(42669);let rK="2.31.0",rG={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${rK}`};class rZ extends Error{constructor(e,t={}){let r=t.cause instanceof rZ?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof rZ&&t.cause.docsPath||t.docsPath,i=rG.getDocsUrl?.({...t,docsPath:n});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...rG.version?[`Version: ${rG.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=rK}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}function rY(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}class rJ extends rZ{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function rX(e,{dir:t,size:r=32}={}){return"string"==typeof e?function(e,{dir:t,size:r=32}={}){if(null===r)return e;let n=e.replace("0x","");if(n.length>2*r)throw new rJ({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n["right"===t?"padEnd":"padStart"](2*r,"0")}`}(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new rJ({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let i=0;i<r;i++){let o="right"===t;n[o?i:r-i-1]=e[o?i:e.length-i-1]}return n}(e,{dir:t,size:r})}class rQ extends rZ{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class r0 extends rZ{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function r1(e){return rY(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function r2(e,{size:t}){if(r1(e)>t)throw new r0({givenSize:r1(e),maxSize:t})}function r5(e,t={}){let{signed:r}=t;t.size&&r2(e,{size:t.size});let n=BigInt(e);if(!r)return n;let i=(e.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}let r3=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function r6(e,t={}){return"number"==typeof e||"bigint"==typeof e?r8(e,t):"string"==typeof e?function(e,t={}){return r4(r9.encode(e),t)}(e,t):"boolean"==typeof e?function(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(r2(r,{size:t.size}),rX(r,{size:t.size})):r}(e,t):r4(e,t)}function r4(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=r3[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(r2(n,{size:t.size}),rX(n,{dir:"right",size:t.size})):n}
1function r8(e,t={}){let r;let{signed:n,size:i}=t,o=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let s="bigint"==typeof r&&n?-r-1n:0;if(r&&o>r||o<s){let t="bigint"==typeof e?"n":"";throw new rQ({max:r?`${r}${t}`:void 0,min:`${s}${t}`,signed:n,size:i,value:`${e}${t}`})}let a=`0x${(n&&o<0?(1n<<BigInt(8*i))+BigInt(o):o).toString(16)}`;return i?rX(a,{size:i}):a}let r9=new TextEncoder,r7=new TextEncoder,ne={zero:48,nine:57,A:65,F:70,a:97,f:102};function nt(e){return e>=ne.zero&&e<=ne.nine?e-ne.zero:e>=ne.A&&e<=ne.F?e-(ne.A-10):e>=ne.a&&e<=ne.f?e-(ne.a-10):void 0}function nr(e,t={}){let r=e;t.size&&(r2(r,{size:t.size}),r=rX(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let i=n.length/2,o=new Uint8Array(i);for(let e=0,t=0;e<i;e++){let r=nt(n.charCodeAt(t++)),i=nt(n.charCodeAt(t++));if(void 0===r||void 0===i)throw new rZ(`Invalid byte sequence ("${n[t-2]}${n[t-1]}" in "${n}").`);o[e]=16*r+i}return o}function nn(e,t={}){let r=r7.encode(e);return"number"==typeof t.size?(r2(r,{size:t.size}),rX(r,{dir:"right",size:t.size})):r}var ni=r(85641);function no(e,t){let r=(0,ni.fr)(rY(e,{strict:!1})?function(e,t={}){return"number"==typeof e||"bigint"==typeof e?nr(r8(e,t)):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?(r2(r,{size:t.size}),rX(r,{size:t.size})):r}(e,t):rY(e)?nr(e,t):nn(e,t)}(e):e);return"bytes"===(t||"hex")?r:r6(r)}class ns extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let na=new ns(8192);async function nc({hash:e,signature:t}){let n=rY(e)?e:r6(e),{secp256k1:i}=await Promise.resolve().then(r.bind(r,53307)),o=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:r,v:n,yParity:o}=t,s=nl(Number(o??n));return new i.Signature(r5(e),r5(r)).addRecoveryBit(s)}let e=rY(t)?t:r6(t);if(65!==r1(e))throw Error("invalid signature length");let r=nl(function(e,t={}){return Number(r5(e,t))}(`0x${e.slice(130)}`));return i.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(r)})().recoverPublicKey(n.substring(2)).toHex(!1);return`0x${o}`}function nl(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function nu({hash:e,signature:t}){return function(e){let t=no(`0x${e.substring(4)}`).substring(26);return function(e,t){if(na.has(`${e}.undefined`))return na.get(`${e}.undefined`);let r=e.substring(2).toLowerCase(),n=no(nn(r),"bytes"),i=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&n[e>>1])>
1=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());let o=`0x${i.join("")}`;return na.set(`${e}.${t}`,o),o}(`0x${t}`)}(await nc({hash:e,signature:t}))}var nd=r(96884);function nh(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}class np{constructor(e,t){this.type=e,this.data=t}}class nf extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Object.create(nf.prototype)),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:nf.name})}}function ng(e,t,r){e.setUint32(t,Math.floor(r/4294967296)),e.setUint32(t+4,r)}function nm(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}let ny={type:-1,encode:function(e){return e instanceof Date?function({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=17179869183){if(0===t&&e<=4294967295){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}{let r=e/4294967296,n=new Uint8Array(8),i=new DataView(n.buffer);return i.setUint32(0,t<<2|3&r),i.setUint32(4,4294967295&e),n}}{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,t),ng(n,4,e),r}}(function(e){let t=e.getTime(),r=Math.floor(t/1e3),n=(t-1e3*r)*1e6,i=Math.floor(n/1e9);return{sec:r+i,nsec:n-1e9*i}}(e)):null},decode:function(e){let t=function(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{let e=t.getUint32(0);return{sec:(3&e)*4294967296+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:nm(t,4),nsec:t.getUint32(0)};default:throw new nf(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}};class nb{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(ny)}register({type:e,encode:t,decode:r}){if(e>=0)this.encoders[e]=t,this.decoders[e]=r;else{let n=-1-e;this.builtInEncoders[n]=t,this.builtInDecoders[n]=r}}tryToEncode(e,t){for(let r=0;r<this.builtInEncoders.length;r++){let n=this.builtInEncoders[r];if(null!=n){let i=n(e,t);if(null!=i)return new np(-1-r,i)}}for(let r=0;r<this.encoders.length;r++){let n=this.encoders[r];if(null!=n){let i=n(e,t);if(null!=i)return new np(r,i)}}return e instanceof np?e:null}decode(e,t,r){let n=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return n?n(e,t,r):new np(t,e)}}nb.defaultCodec=new nb;let nw=new TextEncoder;function nv(e,t,r){let n=t,i=n+r,o=[],s="";for(;n<i;){let t=e[n++];if((128&t)==0)o.push(t);else if((224&t)==192){let r=63&e[n++];o.push((31&t)<<6|r)}else if((240&t)==224){let r=63&e[n++],i=63&e[n++];o.push((31&t)<<12|r<<6|i)}else if((248&t)==240){let r=(7&t)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++];r>65535&&(r-=65536,o.push(r>>>10&1023|55296),r=56320|1023&r),o.push(r)}else o.push(t);o.length>=4096&&(s+=String.fromCharCode(...o),o.length=0)}return o.length>0&&(s+=String.fromCharCode(...o)),s}let nC=new TextDecoder;function nE(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}class nx{constructor(e=16,t=16){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let e=0;e<this.maxKeyLength;e++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,r){let n=this.caches[r-1];e:for(let i of n){let n=i.bytes;for(let i=0;i<r;i++)if(n[i]!==e[t+i])continue e;return i.str}return null}store(e,t){let r=this.caches[e.length-1],n={bytes:e,str:t};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=n:r.push(n)}decode(e,t,r){let n=this.find(e,t,r);if(null!=n)return this.hit++,n;this.miss++;let i=nv(e,t,r),o=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(o,i),i}}let nA="array",nS="map_key",n_="map_value",nI=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new nf("The type of key must be string or number but "+typeof e)};class nk{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let t=this.getUninitializedStateFromPool();t.type=nA,t.position=0,t.size=e,t.array=Array(e)}pushMapState(e){let t=this.getUninitializedStateFromPool();t.type=nS,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw Error("Invalid stack state. Released state is not on top of the stack.");e.type===nA&&(e.size=0,e.array=void 0,e.position=0,e.type=void 0),(e.type===nS||e.type===n_)&&(e.size=0,e.map=void 0,e.readCount=0,e.type=void 0),this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}let nO=new DataView(new ArrayBuffer(0)),nN=new Uint8Array(nO.buffer);try{nO.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}let nP=RangeError("Insufficient data"),nT=new nx;
1class nR{constructor(e){this.totalPos=0,this.pos=0,this.view=nO,this.bytes=nN,this.headByte=-1,this.stack=new nk,this.entered=!1,this.extensionCodec=e?.extensionCodec??nb.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:nT,this.mapKeyConverter=e?.mapKeyConverter??nI}clone(){return new nR({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){let t=nE(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){let t=this.bytes.subarray(this.pos),r=nE(e),n=new Uint8Array(t.length+r.length);n.set(t),n.set(r,t.length),this.setBuffer(n)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:t,pos:r}=this;return RangeError(`Extra ${t.byteLength-r} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){let t=this.clone();yield*t.decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{let t;this.entered=!0;let r=!1;for await(let n of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(n);try{t=this.doDecodeSync(),r=!0}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}let{headByte:n,pos:i,totalPos:o}=this;throw RangeError(`Insufficient data in parsing ${nh(n)} at ${o} (${i} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async *decodeMultiAsync(e,t){if(this.entered){let r=this.clone();yield*r.decodeMultiAsync(e,t);return}try{this.entered=!0;let r=t,n=-1;for await(let i of e){if(t&&0===n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),r&&(n=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),0!=--n;);}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){t:for(;;){let e;let t=this.readHeadByte();if(t>=224)e=t-256;else if(t<192){if(t<128)e=t;else if(t<144){let r=t-128;if(0!==r){this.pushMapState(r),this.complete();continue}e={}}else if(t<160){let r=t-144;if(0!==r){this.pushArrayState(r),this.complete();continue}e=[]}else{let r=t-160;e=this.decodeString(r,0)}}else if(192===t)e=null;else if(194===t)e=!1;else if(195===t)e=!0;else if(202===t)e=this.readF32();else if(203===t)e=this.readF64();else if(204===t)e=this.readU8();else if(205===t)e=this.readU16();else if(206===t)e=this.readU32();else if(207===t)e=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===t)e=this.readI8();else if(209===t)e=this.readI16();else if(210===t)e=this.readI32();else if(211===t)e=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===t){let t=this.lookU8();e=this.decodeString(t,1)}else if(218===t){let t=this.lookU16();e=this.decodeString(t,2)}else if(219===t){let t=this.lookU32();e=this.decodeString(t,4)}else if(220===t){let t=this.readU16();if(0!==t){this.pushArrayState(t),this.complete();continue}e=[]}else if(221===t){let t=this.readU32();if(0!==t){this.pushArrayState(t),this.complete();continue}e=[]}else if(222===t){let t=this.readU16();if(0!==t){this.pushMapState(t),this.complete();continue}e={}}else if(223===t){let t=this.readU32();if(0!==t){this.pushMapState(t),this.complete();continue}e={}}else if(196===t){let t=this.lookU8();e=this.decodeBinary(t,1)}else if(197===t){let t=this.lookU16();e=this.decodeBinary(t,2)}else if(198===t){let t=this.lookU32();e=this.decodeBinary(t,4)}else if(212===t)e=this.decodeExtension(1,0);else if(213===t)e=this.decodeExtension(2,0);else if(214===t)e=this.decodeExtension(4,0);else if(215===t)e=this.decodeExtension(8,0);else if(216===t)e=this.decodeExtension(16,0);else if(199===t){let t=this.lookU8();e=this.decodeExtension(t,1)}else if(200===t){let t=this.lookU16();e=this.decodeExtension(t,2)}else if(201===t){let t=this.lookU32();e=this.decodeExtension(t,4)}else throw new nf(`Unrecognized type byte: ${nh(t)}`);this.complete();let r=this.stack;for(;r.length>0;){let t=r.top();if(t.type===nA){if(t.array[t.position]=e,t.position++,t.position===t.size)e=t.array,r.release(t);else continue t}else if(t.type===nS){if("__proto__"===e)throw new nf("The key __proto__ is not allowed");t.key=this.mapKeyConverter(e),t.type=n_;continue t}else if(t.map[t.key]=e,t.readCount++,t.readCount===t.size)e=t.map,r.release(t);else{t.key=null,t.type=nS;continue t}}return e}}readHeadByte(){return -1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new nf(`Unrecognized array type byte: ${nh(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new nf(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new nf(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){let r;if(e>this.maxStrLength)throw new nf(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw nP;let n=this.pos+t;if(this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e))r=this.keyDecoder.decode(this.bytes,n,e);else{var i;i=this.bytes,r=e>200?function(e,t,r){let n=e.subarray(t,t+r);return nC.decode(n)}(i,n,e):nv(i,n,e)}return this.pos+=t+e,r}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===nS}decodeBinary(e,t){if(e>this.maxBinLength)throw new nf(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw nP;let r=this.pos+t,n=this.bytes.subarray(r,r+e);return this.pos+=t+e,n}decodeExtension(e,t){if(e>this.maxExtLength)throw new nf(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let r=this.view.getInt8(this.pos+t),n=this.decodeBinary(e,t+1);return this.extensionCodec.decode(n,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){var e,t;let r=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,r}readI64(){let e=nm(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}}class n${constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??nb.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??100,this.initialBufferSize=e?.initialBufferSize??2048,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new n$({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw Error(`Too deep objects in depth ${t}`);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):"str
1ing"==typeof e?this.encodeString(e):this.useBigInt64&&"bigint"==typeof e?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){let t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)}resizeBuffer(e){let t=new ArrayBuffer(e),r=new Uint8Array(t),n=new DataView(t);r.set(this.bytes),this.view=n,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){!1===e?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){var t,r,n;let i=function(e){let t=e.length,r=0,n=0;for(;n<t;){let i=e.charCodeAt(n++);if((4294967168&i)==0){r++;continue}if((4294965248&i)==0)r+=2;else{if(i>=55296&&i<=56319&&n<t){let t=e.charCodeAt(n);(64512&t)==56320&&(++n,i=((1023&i)<<10)+(1023&t)+65536)}(4294901760&i)==0?r+=3:r+=4}}return r}(e);this.ensureBufferSizeToWrite(5+i),this.writeStringHeader(i),t=e,r=this.bytes,n=this.pos,t.length>50?nw.encodeInto(t,r.subarray(n)):function(e,t,r){let n=e.length,i=r,o=0;for(;o<n;){let r=e.charCodeAt(o++);if((4294967168&r)==0){t[i++]=r;continue}if((4294965248&r)==0)t[i++]=r>>6&31|192;else{if(r>=55296&&r<=56319&&o<n){let t=e.charCodeAt(o);(64512&t)==56320&&(++o,r=((1023&r)<<10)+(1023&t)+65536)}(4294901760&r)==0?t[i++]=r>>12&15|224:(t[i++]=r>>18&7|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128}t[i++]=63&r|128}}(t,r,n),this.pos+=i}encodeObject(e,t){let r=this.extensionCodec.tryToEncode(e,this.context);if(null!=r)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if("object"==typeof e)this.encodeMap(e,t);else throw Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw Error(`Too large binary: ${t}`);let r=nE(e);this.writeU8a(r)}encodeArray(e,t){let r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw Error(`Too large array: ${r}`);for(let r of e)this.doEncode(r,t+1)}countWithoutUndefined(e,t){let r=0;for(let n of t)void 0!==e[n]&&r++;return r}encodeMap(e,t){let r=Object.keys(e);this.sortKeys&&r.sort();let n=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(n<16)this.writeU8(128+n);else if(n<65536)this.writeU8(222),this.writeU16(n);else if(n<4294967296)this.writeU8(223),this.writeU32(n);else throw Error(`Too large map object: ${n}`);for(let n of r){let r=e[n];this.ignoreUndefined&&void 0===r||(this.encodeString(n),this.doEncode(r,t+1))}}encodeExtension(e){if("function"==typeof e.data){let t=e.data(this.pos+6),r=t.length;if(r>=4294967296)throw Error(`Too large extension object: ${r}`);this.writeU8(201),this.writeU32(r),this.writeI8(e.type),this.writeU8a(t);return}let t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){var t,r;this.ensureBufferSizeToWrite(8),t=this.view,r=this.pos,t.setUint32(r,e/4294967296),t.setUint32(r+4,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),ng(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function nD(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function nL(e,t){if("string"!=typeof t)throw Error(`${e}: string expected`);return!0}function nM(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function nU(e){if(!Array.isArray(e))throw Error("array expected")}function nj(e,t){if(!nD(!0,t))throw Error(`${e}
1: array of strings expected`)}function nB(...e){let t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function nF(e){let t="string"==typeof e?e.split(""):e,r=t.length;nj("alphabet",t);let n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(nU(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(nU(t),t.map(t=>{nL("alphabet.decode",t);let r=n.get(t);if(void 0===r)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function nz(e=""){return nL("join",e),{encode:t=>(nj("join.decode",t),t.join(e)),decode:t=>(nL("join.decode",t),t.split(e))}}let nH=(e,t)=>0===t?e:nH(t,e%t),nW=(e,t)=>e+(t-nH(e,t)),nq=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function nV(e,t,r,n){if(nU(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw Error(`convertRadix2: wrong to=${r}`);if(nW(t,r)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${nW(t,r)}`);let i=0,o=0,s=nq[t],a=nq[r]-1,c=[];for(let n of e){if(nM(n),n>=s)throw Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,o+t>32)throw Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)c.push((i>>o-r&a)>>>0);let e=nq[o];if(void 0===e)throw Error("invalid carry");i&=e-1}if(i=i<<r-o&a,!n&&o>=t)throw Error("Excess padding");if(!n&&i>0)throw Error(`Non-zero padding: ${i}`);return n&&o>0&&c.push(i>>>0),c}let nK=nB(function(e,t=!1){if(nM(5),e>32)throw Error("radix2: bits should be in (0..32]");if(nW(8,e)>32||nW(e,8)>32)throw Error("radix2: carry overflow");return{encode:r=>{var n;if(!((n=r)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw Error("radix2.encode input should be Uint8Array");return nV(Array.from(r),8,e,!t)},decode:r=>((function(e,t){if(!nD(!1,t))throw Error(`${e}: array of numbers expected`)})("radix2.decode",r),Uint8Array.from(nV(r,e,8,t)))}}(5),nF("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),function(e,t="="){return nM(5),nL("padding",t),{encode(e){for(nj("padding.encode",e);5*e.length%8;)e.push(t);return e},decode(r){nj("padding.decode",r);let n=r.length;if(n*e%8)throw Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if((n-1)*e%8==0)throw Error("padding: invalid, string has too much padding");return r.slice(0,n)}}}(5),nz("")),nG=("function"==typeof Uint8Array.from([]).toBase64&&Uint8Array.fromBase64,[996825010,642813549,513874426,1027748829,705979059]);function nZ(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function nY(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?nZ(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function nJ(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=nY(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return nZ(r)}"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex||function(e){if("function"!=typeof e)throw Error("function expected")}(e=>{if("string"!=typeof e||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()});var nX=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===c;)n++,t++;for(var o=(e.length-t)*l+1>>>0,s=new Uint8Array(o);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=o-1;(0!==u||d<i)&&-1!==h;h--,d++)u+=a*s[h]>>>0,s[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var p=o-i;p!==o&&0===s[p];)p++;for(var f=new Uint8Array(n+(o-p)),g=n;p!==o;)f[g++]=s[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*u+1>>>0,l=new Uint8Array(s);i!==o;){for(var d=t[i],h=0,p=s-1;(0!==d||h<n)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");n=h,i++}for(var f=s-n;f!==s&&0===l[f];)f++;for(var g=c.repeat(r);f<s;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:d,decode:function(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}}};new Uint8Array(0);let nQ=(e,t)=>{if(e===t)return!0;
1if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},n0=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},n1=e=>new TextEncoder().encode(e),n2=e=>new TextDecoder().decode(e);class n5{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class n3{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return n4(this,e)}}class n6{constructor(e){this.decoders=e}or(e){return n4(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let n4=(e,t)=>new n6({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class n8{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new n5(e,t,r),this.decoder=new n3(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let n9=({name:e,prefix:t,encode:r,decode:n})=>new n8(e,t,r,n),n7=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=nX(r,t);return n9({prefix:e,name:t,encode:n,decode:e=>n0(i(e))})},ie=(e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;let s=new Uint8Array(o*r/8|0),a=0,c=0,l=0;for(let t=0;t<o;++t){let o=i[e[t]];if(void 0===o)throw SyntaxError(`Non-${n} character`);c=c<<r|o,(a+=r)>=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return s},it=(e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},ir=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>n9({prefix:t,name:e,encode:e=>it(e,n,r),decode:t=>ie(t,n,r,e)}),ii=n9({prefix:"\0",name:"identity",encode:e=>n2(e),decode:e=>n1(e)}),io=ir({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),is=ir({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),ia=n7({prefix:"9",name:"base10",alphabet:"0123456789"}),ic=ir({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),il=ir({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),iu=ir({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),id=ir({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ih=ir({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ip=ir({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ig=ir({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),im=ir({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),iy=ir({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ib=ir({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),iw=ir({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),iv=n7({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),iC=n7({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),iE=n7({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ix=n7({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),iA=ir({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/",bitsPerChar:6}),iS=ir({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),i_=ir({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),iI=ir({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ik=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),iO=ik.reduce((e,t,r)=>(e[r]=t,e),[]),iN=ik.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),iP=n9({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=iO[t],"")},decode:function(e){let t=[];for(let r of e){let e=iN[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var iT=function e(t,r,n){r=r||[];for(var i=n=n||0;t>=2147483648;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},iR=function e(t,r){var n,i=0,r=r||0,o=0,s=r,a=t.length;do{if(s>=a)throw e.bytes=0,RangeError("Could not decode varint");n=t[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=s-r,i};let i$=(e,t=0)=>[iR(e,t),iR.bytes],iD=(e,t,r=0)=>(iT(e,t,r),t),iL=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,iM=(e,t)=>{let r=t.byteLength,n=iL(e),i=n+iL(r),o=new Uint8Array(i+r);return iD(e,o,0),iD(r,o,n),o.set(t,i),new iB(e,r,t,o)},iU=e=>{let t=n0(e),[r,n]=i$(t),[i,o]=i$(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw Error("Incorrect length");return new iB(r,i,s,t)},ij=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&nQ(e.bytes,t.bytes);
1class iB{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let iF=({name:e,code:t,encode:r})=>new iz(e,t,r);class iz{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?iM(this.code,t):t.then(e=>iM(this.code,e))}throw Error("Unknown type, must be binary type")}}let iH=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),iW=iF({name:"sha2-256",code:18,encode:iH("SHA-256")}),iq=iF({name:"sha2-512",code:19,encode:iH("SHA-512")}),iV={code:0,name:"identity",encode:n0,digest:e=>iM(0,n0(e))},iK="raw",iG=85,iZ=e=>n0(e),iY=e=>n0(e),iJ=new TextEncoder,iX=new TextDecoder,iQ="json",i0=512,i1=e=>iJ.encode(JSON.stringify(e)),i2=e=>JSON.parse(iX.decode(e));class i5{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:or,byteLength:or,code:ot,version:ot,multihash:ot,bytes:ot,_baseCache:or,asCID:or})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==i8)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==i9)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return i5.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=iM(e,t);return i5.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&ij(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;return 0===r?i6(t,n,e||iE.encoder):i4(t,n,e||iu.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return on(/^0\.0/,oi),!!(e&&(e[oe]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof i5)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:i}=e;return new i5(t,r,n,i||i7(t,r,n.bytes))}if(null==e||!0!==e[oe])return null;{let{version:t,multihash:r,code:n}=e,i=iU(r);return i5.create(t,n,i)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===i8)return new i5(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${i8}) block encoding`);case 1:{let n=i7(e,t,r.bytes);return new i5(e,t,r,n)}default:throw Error("Invalid version")}}static createV0(e){return i5.create(0,i8,e)}static createV1(e,t){return i5.create(1,e,t)}static decode(e){let[t,r]=i5.decodeFirst(e);if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=i5.inspectBytes(e),r=t.size-t.multihashSize,n=n0(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw Error("Incorrect length");let i=n.subarray(t.multihashSize-t.digestSize),o=new iB(t.multihashCode,t.digestSize,i,n);return[0===t.version?i5.createV0(o):i5.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,n]=i$(e.subarray(t));return t+=n,r},n=r(),i=i8;if(18===n?(n=0,t=0):1===n&&(i=r()),0!==n&&1!==n)throw RangeError(`Invalid CID version ${n}`);let o=t,s=r(),a=r(),c=t+a;return{version:n,codec:i,multihashCode:s,digestSize:a,multihashSize:c-o,size:c}}static parse(e,t){let[r,n]=i3(e,t),i=i5.decode(n);return i._baseCache.set(r,e),i}}let i3=(e,t)=>{switch(e[0]){case"Q":return[iE.prefix,(t||iE).decode(`${iE.prefix}${e}`)];case iE.prefix:return[iE.prefix,(t||iE).decode(e)];case iu.prefix:return[iu.prefix,(t||iu).decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},i6=(e,t,r)=>{let{prefix:n}=r;if(n!==iE.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(null!=i)return i;{let i=r.encode(e).slice(1);return t.set(n,i),i}},i4=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(null!=i)return i;{let i=r.encode(e);return t.set(n,i),i}},i8=112,i9=18,i7=(e,t,r)=>{let n=iL(e),i=n+iL(t),o=new Uint8Array(i+r.byteLength);return iD(e,o,0),iD(t,o,n),o.set(r,i),o}
1,oe=Symbol.for("@ipld/js-cid/CID"),ot={writable:!1,configurable:!1,enumerable:!0},or={writable:!1,enumerable:!1,configurable:!1},on=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},oi=`CID.isCID(v) is deprecated and will be removed in the next major release.
2Following code pattern:
3
4if (CID.isCID(value)) {
5  doSomethingWithCID(value)
6}
7
8Is replaced with:
9
10const cid = CID.asCID(value)
11if (cid) {
12  // Make sure to use cid instead of value
13  doSomethingWithCID(cid)
14}
15`,oo={...i,...o,...s,...a,...c,...l,...u,...d,...h,...p};function os(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...f,...g});let oa=os("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),oc=os("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=nY((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),ol={utf8:oa,"utf-8":oa,hex:oo.base16,latin1:oc,ascii:oc,binary:oc,...oo};function ou(e,t="utf8"){let r=ol[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?nZ(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function od(e,t="utf8"){let r=ol[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}let oh={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var op=r(22565),of=r(14224),og=r(55872).Buffer;function om(e){let[t,r]=e.split(":");return{namespace:t,reference:r}}function oy(e,t){return e.includes(":")?[e]:t.chains||[]}var ob=Object.defineProperty,ow=Object.defineProperties,ov=Object.getOwnPropertyDescriptors,oC=Object.getOwnPropertySymbols,oE=Object.prototype.hasOwnProperty,ox=Object.prototype.propertyIsEnumerable,oA=(e,t,r)=>t in e?ob(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oS=(e,t)=>{for(var r in t||(t={}))oE.call(t,r)&&oA(e,r,t[r]);if(oC)for(var r of oC(t))ox.call(t,r)&&oA(e,r,t[r]);return e},o_=(e,t)=>ow(e,ov(t)),oI=(e,t,r)=>oA(e,"symbol"!=typeof t?t+"":t,r);let ok={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};function oO(){return"u">typeof of&&"u">typeof of.versions&&"u">typeof of.versions.node}function oN(){return!(0,rq.getDocument)()&&!!(0,rq.getNavigator)()&&"ReactNative"===navigator.product}function oP(){return!oO()&&!!(0,rq.getNavigator)()&&!!(0,rq.getDocument)()}function oT(){return oN()?ok.reactNative:oO()?ok.node:oP()?ok.browser:ok.unknown}function oR(){var e;try{return oN()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Application)?null==(e=r.g.Application)?void 0:e.applicationId:void 0}catch{return}}function o$(){return(0,rV.D)()||{name:"",description:"",url:"",icons:[""]}}function oD(e,t,n){let i=function(){if(oT()===ok.reactNative&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)){let{OS:e,Version:t}=r.g.Platform;return[e,t].join("-")}let e="undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new rF:"undefined"!=typeof navigator?function(e){var t=""!==e&&rH.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1);if(!t)return null;var r=t[0],n=t[1];if("searchbot"===r)return new rB;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<3&&(i=rL(rL([],i,!0),function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(3-i.length),!0)):i=[];var o=i.join("."),s=function(e){for(var t=0,r=rW.length;t<r;t++){var n=rW[t],i=n[0];if(n[1].exec(e))return i}return null}(e),a=rz.exec(e);return a&&a[1]?new rj(r,o,s,a[1]):new rM(r,o,s)}(navigator.userAgent):void 0!==rD&&rD.version?new rU(rD.version.slice(1)):null;if(null===e)return"unknown";let t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),o=function(){var e;let t=oT();return t===ok.browser?[t,(null==(e=(0,rq.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),["js",n].join("-"),i,o].join("/")}function oL(e,t){return e.filter(e=>t.includes(e)).length===e.length}function oM(e){return Object.fromEntries(e.entries())}function oU(e){return new Map(Object.entries(e))}function oj(e=v.FIVE_MINUTES,t){let r,n,i,o;let s=(0,v.toMiliseconds)(e||v.FIVE_MINUTES);return{resolve:e=>
15{i&&r&&(clearTimeout(i),r(e),o=Promise.resolve(e))},reject:e=>{i&&n&&(clearTimeout(i),n(e))},done:()=>new Promise((e,a)=>{if(o)return e(o);i=setTimeout(()=>{let e=Error(t);o=Promise.reject(e),a(e)},s),r=e,n=a})}}function oB(e,t,r){return new Promise(async(n,i)=>{let o=setTimeout(()=>i(Error(r)),t);try{let t=await e;n(t)}catch(e){i(e)}clearTimeout(o)})}function oF(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw Error(`Unknown expirer target type: ${e}`)}function oz(e){let[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else if("id"===t&&Number.isInteger(Number(r)))n.id=Number(r);else throw Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return n}function oH(e,t){return(0,v.fromMiliseconds)((t||Date.now())+(0,v.toMiliseconds)(e))}function oW(e){return Date.now()>=(0,v.toMiliseconds)(e)}function oq(e,t){return`${e}${t?`:${t}`:""}`}function oV(e=[],t=[]){return[...new Set([...e,...t])]}async function oK({id:e,topic:t,wcDeepLink:n}){var i;try{if(!n)return;let o="string"==typeof n?JSON.parse(n):n,s=o?.href;if("string"!=typeof s)return;let a=function(e,t,r){let n=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let i=`${e}`;if(e.startsWith("https://t.me")){let t=e.includes("?")?"&startapp=":"?startapp=";i=`${i}${t}${function(e,t=!1){let r=og.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}(n,!0)}`}else i=`${i}/wc?${n}`;return i}(s,e,t),c=oT();if(c===ok.browser){let e;if(!(null!=(i=(0,rq.getDocument)())&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}e="_self",function(){try{return window.self!==window.top}catch{return!1}}()?e="_top":("u">typeof window&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)||a.startsWith("https://")||a.startsWith("http://"))&&(e="_blank"),window.open(a,e,"noreferrer noopener")}else c===ok.reactNative&&"u">typeof(null==r.g?void 0:r.g.Linking)&&await r.g.Linking.openURL(a)}catch(e){console.error(e)}}async function oG(e,t){let r="";try{if(oP()&&(r=localStorage.getItem(t)))return r;r=await e.getItem(t)}catch(e){console.error(e)}return r}function oZ(e,t){if(!e.includes(t))return null;let r=e.split(/([&,?,=])/),n=r.indexOf(t);return r[n+2]}function oY(){return"u">typeof crypto&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function oJ(){return"u">typeof of&&"true"===of.env.IS_VITEST}function oX(e){return og.from(e,"base64").toString("utf-8")}class oQ{constructor({limit:e}){oI(this,"limit"),oI(this,"set"),this.limit=e,this.set=new Set}
15add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){let e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}}let o0=BigInt(4294967296-1),o1=BigInt(32);function o2(e,t=!1){return t?{h:Number(e&o0),l:Number(e>>o1&o0)}:{h:0|Number(e>>o1&o0),l:0|Number(e&o0)}}function o5(e,t=!1){let r=e.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=o2(e[o],t);[n[o],i[o]]=[r,s]}return[n,i]}let o3=(e,t,r)=>e>>>r,o6=(e,t,r)=>e<<32-r|t>>>r,o4=(e,t,r)=>e>>>r|t<<32-r,o8=(e,t,r)=>e<<32-r|t>>>r,o9=(e,t,r)=>e<<64-r|t>>>r-32,o7=(e,t,r)=>e>>>r-32|t<<64-r,se=(e,t)=>t,st=(e,t)=>e,sr=(e,t,r)=>e<<r|t>>>32-r,sn=(e,t,r)=>t<<r|e>>>32-r,si=(e,t,r)=>t<<r-32|e>>>64-r,so=(e,t,r)=>e<<r-32|t>>>64-r;function ss(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/4294967296|0)|0,l:0|i}}let sa=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),sc=(e,t,r,n)=>t+r+n+(e/4294967296|0)|0,sl=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),su=(e,t,r,n,i)=>t+r+n+i+(e/4294967296|0)|0,sd=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),sh=(e,t,r,n,i,o)=>t+r+n+i+o+(e/4294967296|0)|0,sp="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function sf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function sg(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function sm(e,...t){if(!sf(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function sy(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");sg(e.outputLen),sg(e.blockLen)}function sb(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function sw(e,t){sm(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function sv(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function sC(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function sE(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function sx(e,t){return e<<32-t|e>>>t}let sA=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function sS(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}let s_=sA?e=>e:e=>sS(e),sI=sA?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=sS(e[t]);return e},sk="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,sO=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function sN(e){if(sm(e),sk)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=sO[e[r]];return t}let sP={_0:48,_9:57,A:65,F:70,a:97,f:102};function sT(e){return e>=sP._0&&e<=sP._9?e-sP._0:e>=sP.A&&e<=sP.F?e-(sP.A-10):e>=sP.a&&e<=sP.f?e-(sP.a-10):void 0}function sR(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(sk)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=sT(e.charCodeAt(i)),o=sT(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function s$(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e)),sm(e),e}function sD(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];sm(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}class sL{}function sM(e){let t=t=>e().update(s$(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function sU(e=32){if(sp&&"function"==typeof sp.getRandomValues)return sp.getRandomValues(new Uint8Array(e));if(sp&&"function"==typeof sp.randomBytes)return Uint8Array.from(sp.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}let sj=BigInt(0),sB=BigInt(1),sF=BigInt(2),sz=BigInt(7),sH=BigInt(256),sW=BigInt(113),sq=[],sV=[],sK=[];for(let e=0,t=sB,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],sq.push(2*(5*n+r)),sV.push((e+1)*(e+2)/2%64);let i=sj;for(let e=0;e<7;e++)(t=(t<<sB^(t>>sz)*sW)%sH)&sF&&(i^=sB<<(sB<<BigInt(e))-sB);sK.push(i)}let sG=o5(sK,!0),sZ=sG[0],sY=sG[1],sJ=(e,t,r)=>r>32?si(e,t,r):sr(e,t,r),sX=(e,t,r)=>r>32?so(e,t,r):sn(e,t,r);class sQ extends sL{constructor(e,t,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,sg(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=sv(this.state)}clone(){return this._cloneInto()}keccak(){sI(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=sJ(o,s,1)^r[n],c=sX(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=sV[r],o=sJ(t,i,n),s=sX(t,i,n),a=sq[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=sZ[n],e[1]^=sY[n]}sC(r)}(this.state32,this.rounds),sI(this.state32),this.posOut=0,this.pos=0}update(e){sb(this),sm(e=s$(e));let{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){let o=Math.min(t-this.pos,n-i);for(let t=0;t<o;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){sb(this,!1),sm(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return sg(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(sw(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,sC(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new sQ(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}let s0=sM(()=>new sQ(136,1,32));class s1 extends sL{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=sE(this.buffer)}update(e){sb(this),sm(e=s$(e));let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let t=sE(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){sb(this),sw(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,sC(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,l=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+l,a,n)})(r,n-8,BigInt(8*this.length),i),this.process(r,0);let s=sE(e),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=a/4,l=this.get();if(c>l.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let s2=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s5=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),s3=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),s6=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
15734187,3204031479,3329325298]),s4=new Uint32Array(64);class s8 extends s1{constructor(e=32){super(64,e,8,!1),this.A=0|s2[0],this.B=0|s2[1],this.C=0|s2[2],this.D=0|s2[3],this.E=0|s2[4],this.F=0|s2[5],this.G=0|s2[6],this.H=0|s2[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)s4[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=s4[e-15],r=s4[e-2],n=sx(t,7)^sx(t,18)^t>>>3,i=sx(r,17)^sx(r,19)^r>>>10;s4[e]=i+s4[e-7]+n+s4[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:l}=this;for(let e=0;e<64;e++){var u,d,h,p;let t=l+(sx(s,6)^sx(s,11)^sx(s,25))+((u=s)&a^~u&c)+s6[e]+s4[e]|0,f=(sx(r,2)^sx(r,13)^sx(r,22))+((d=r)&(h=n)^d&(p=i)^h&p)|0;l=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+f|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(r,n,i,o,s,a,c,l)}roundClean(){sC(s4)}destroy(){this.set(0,0,0,0,0,0,0,0),sC(this.buffer)}}let s9=o5(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
155771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),s7=s9[0],ae=s9[1],at=new Uint32Array(80),ar=new Uint32Array(80);class an extends s1{constructor(e=64){super(128,e,16,!1),this.Ah=0|s3[0],this.Al=0|s3[1],this.Bh=0|s3[2],this.Bl=0|s3[3],this.Ch=0|s3[4],this.Cl=0|s3[5],this.Dh=0|s3[6],this.Dl=0|s3[7],this.Eh=0|s3[8],this.El=0|s3[9],this.Fh=0|s3[10],this.Fl=0|s3[11],this.Gh=0|s3[12],this.Gl=0|s3[13],this.Hh=0|s3[14],this.Hl=0|s3[15]}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,r,n,i,o,s,a,c,l,u,d,h,p,f,g]}set(e,t,r,n,i,o,s,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)at[r]=e.getUint32(t),ar[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|at[e-15],r=0|ar[e-15],n=o4(t,r,1)^o4(t,r,8)^o3(t,r,7),i=o8(t,r,1)^o8(t,r,8)^o6(t,r,7),o=0|at[e-2],s=0|ar[e-2],a=o4(o,s,19)^o9(o,s,61)^o3(o,s,6),c=sl(i,o8(o,s,19)^o7(o,s,61)^o6(o,s,6),ar[e-7],ar[e-16]),l=su(c,n,a,at[e-7],at[e-16]);at[e]=0|l,ar[e]=0|c}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:p,Gh:f,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){let t=o4(u,d,14)^o4(u,d,18)^o9(u,d,41),b=o8(u,d,14)^o8(u,d,18)^o7(u,d,41),w=u&h^~u&f,v=sd(y,b,d&p^~d&g,ae[e],ar[e]),C=sh(v,m,t,w,s7[e],at[e]),E=0|v,x=o4(r,n,28)^o9(r,n,34)^o9(r,n,39),A=o8(r,n,28)^o7(r,n,34)^o7(r,n,39),S=r&i^r&s^i&s,_=n&o^n&a^o&a;m=0|f,y=0|g,f=0|h,g=0|p,h=0|u,p=0|d,({h:u,l:d}=ss(0|c,0|l,0|C,0|E)),c=0|s,l=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let I=sa(E,A,_);r=sc(I,C,x,S),n=0|I}({h:r,l:n}=ss(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=ss(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=ss(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:l}=ss(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=ss(0|this.Eh,0|this.El,0|u,0|d)),({h:h,l:p}=ss(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:g}=ss(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:y}=ss(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(r,n,i,o,s,a,c,l,u,d,h,p,f,g,m,y)}roundClean(){sC(at,ar)}destroy(){sC(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class ai extends an{constructor(){super(48),this.Ah=0|s5[0],this.Al=0|s5[1],this.Bh=0|s5[2],this.Bl=0|s5[3],this.Ch=0|s5[4],this.Cl=0|s5[5],this.Dh=0|s5[6],this.Dl=0|s5[7],this.Eh=0|s5[8],this.El=0|s5[9],this.Fh=0|s5[10],this.Fl=0|s5[11],this.Gh=0|s5[12],this.Gl=0|s5[13],this.Hh=0|s5[14],this.Hl=0|s5[15]}}let ao=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class as extends an{constructor(){super(32),this.Ah=0|ao[0],this.Al=0|ao[1],this.Bh=0|ao[2],this.Bl=0|ao[3],this.Ch=0|ao[4],this.Cl=0|ao[5],this.Dh=0|ao[6],this.Dl=0|ao[7],this.Eh=0|ao[8],this.El=0|ao[9],this.Fh=0|ao[10],this.Fl=0|ao[11],this.Gh=0|ao[12],this.Gl=0|ao[13],this.Hh=0|ao[14],this.Hl=0|ao[15]}}let aa=sM(()=>new s8),ac=sM(()=>new an),al=sM(()=>new ai),au=sM(()=>new as),ad=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),ah=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),ap=new Uint32Array(32);function af(e,t,r,n,i,o){let s=i[o],a=i[o+1],c=ap[2*e],l=ap[2*e+1],u=ap[2*t],d=ap[2*t+1],h=ap[2*r],p=ap[2*r+1],f=ap[2*n],g=ap[2*n+1],m=sa(c,u,s);l=sc(m,l,d,a),c=0|m,({Dh:g,Dl:f}={Dh:g^l,Dl:f^c}),({Dh:g,Dl:f}={Dh:se(g,f),Dl:st(g)}),({h:p,l:h}=ss(p,h,g,f)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^h}),({Bh:d,Bl:u}={Bh:o4(d,u,24),Bl:o8(d,u,24)}),ap[2*e]=c,ap[2*e+1]=l,ap[2*t]=u,ap[2*t+1]=d,ap[2*r]=h,ap[2*r+1]=p,ap[2*n]=f,ap[2*n+1]=g}function ag(e,t,r,n,i,o){let s=i[o],a=i[o+1],c=ap[2*e],l=ap[2*e+1],u=ap[2*t],d=ap[2*t+1],h=ap[2*r],p=ap[2*r+1],f=ap[2*n],g=ap[2*n+1],m=sa(c,u,s);l=sc(m,l,d,a),c=0|m,({Dh:g,Dl:f}={Dh:g^l,Dl:f^c}),({Dh:g,Dl:f}={Dh:o4(g,f,16),Dl:o8(g,f,16)}),({h:p,l:h}=ss(p,h,g,f)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^h}),({Bh:d,Bl:u}={Bh:o9(d,u,63),Bl:o7(d,u,63)}),ap[2*e]=c,ap[2*e+1]=l,ap[2*t]=u,ap[2*t+1]=d,ap[2*r]=h,ap[2*r+1]=p,ap[2*n]=f,ap[2*n+1]=g}class am extends sL{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,sg(e),sg(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=sv(this.buffer)}update(e){sb(this),sm(e=s$(e));let{blockLen:t,buffer:r,buffer32:n}=this,i=e.length,o=e.byteOffset,s=e.buffer;for(let a=0;a<i;){this.pos===t&&(sI(n),this.compress(n,0,!1),sI(n),this.pos=0);let c=Math.min(t-this.pos,i-a),l=o+a;if(c===t&&!(l%4)&&a+c<i){let e=new Uint32Array(s,l,Math.floor((i-a)/4));sI(e);for(let r=0;a+t<i;r+=n.length,a+=t)this.length+=t,this.compress(e,r,!1);sI(e);continue}r.set(e.subarray(a,a+c),this.pos),this.pos+=c,this.length+=c,a+=c}return this}digestInto(e){sb(this),sw(e,this);let{pos:t,buffer32:r}=this;this.finished=!0,sC(this.buffer.subarray(t)),sI(r),this.compress(r,0,!0),sI(r);let n=sv(e);
15this.get().forEach((e,t)=>n[t]=s_(e))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){let{buffer:t,length:r,finished:n,destroyed:i,outputLen:o,pos:s}=this;return e||(e=new this.constructor({dkLen:o})),e.set(...this.get()),e.buffer.set(t),e.destroyed=i,e.finished=n,e.length=r,e.pos=s,e.outputLen=o,e}clone(){return this._cloneInto()}}class ay extends am{constructor(e={}){let t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|ah[0],this.v0h=0|ah[1],this.v1l=0|ah[2],this.v1h=0|ah[3],this.v2l=0|ah[4],this.v2h=0|ah[5],this.v3l=0|ah[6],this.v3h=0|ah[7],this.v4l=0|ah[8],this.v4h=0|ah[9],this.v5l=0|ah[10],this.v5h=0|ah[11],this.v6l=0|ah[12],this.v6h=0|ah[13],this.v7l=0|ah[14],this.v7h=0|ah[15],function(e,t={},r,n,i){if(sg(64),e<0||e>64)throw Error("outputLen bigger than keyLen");let{key:o,salt:s,personalization:a}=t;if(void 0!==o&&(o.length<1||o.length>64))throw Error("key length must be undefined or 1.."+r);if(void 0!==s&&16!==s.length)throw Error("salt must be undefined or 16");if(void 0!==a&&16!==a.length)throw Error("personalization must be undefined or 16")}(t,e,64,0,0);let{key:r,personalization:n,salt:i}=e,o=0;if(void 0!==r&&(o=(r=s$(r)).length),this.v0l^=this.outputLen|o<<8|16842752,void 0!==i){let e=sv(i=s$(i));this.v4l^=s_(e[0]),this.v4h^=s_(e[1]),this.v5l^=s_(e[2]),this.v5h^=s_(e[3])}if(void 0!==n){let e=sv(n=s$(n));this.v6l^=s_(e[0]),this.v6h^=s_(e[1]),this.v7l^=s_(e[2]),this.v7h^=s_(e[3])}if(void 0!==r){let e=new Uint8Array(this.blockLen);e.set(r),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:n,v2l:i,v2h:o,v3l:s,v3h:a,v4l:c,v4h:l,v5l:u,v5h:d,v6l:h,v6h:p,v7l:f,v7h:g}=this;return[e,t,r,n,i,o,s,a,c,l,u,d,h,p,f,g]}set(e,t,r,n,i,o,s,a,c,l,u,d,h,p,f,g){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|n,this.v2l=0|i,this.v2h=0|o,this.v3l=0|s,this.v3h=0|a,this.v4l=0|c,this.v4h=0|l,this.v5l=0|u,this.v5h=0|d,this.v6l=0|h,this.v6h=0|p,this.v7l=0|f,this.v7h=0|g}compress(e,t,r){this.get().forEach((e,t)=>ap[t]=e),ap.set(ah,16);let{h:n,l:i}=o2(BigInt(this.length));ap[24]=ah[8]^i,ap[25]=ah[9]^n,r&&(ap[28]=~ap[28],ap[29]=~ap[29]);let o=0;for(let r=0;r<12;r++)af(0,4,8,12,e,t+2*ad[o++]),ag(0,4,8,12,e,t+2*ad[o++]),af(1,5,9,13,e,t+2*ad[o++]),ag(1,5,9,13,e,t+2*ad[o++]),af(2,6,10,14,e,t+2*ad[o++]),ag(2,6,10,14,e,t+2*ad[o++]),af(3,7,11,15,e,t+2*ad[o++]),ag(3,7,11,15,e,t+2*ad[o++]),af(0,5,10,15,e,t+2*ad[o++]),ag(0,5,10,15,e,t+2*ad[o++]),af(1,6,11,12,e,t+2*ad[o++]),ag(1,6,11,12,e,t+2*ad[o++]),af(2,7,8,13,e,t+2*ad[o++]),ag(2,7,8,13,e,t+2*ad[o++]),af(3,4,9,14,e,t+2*ad[o++]),ag(3,4,9,14,e,t+2*ad[o++]);this.v0l^=ap[0]^ap[16],this.v0h^=ap[1]^ap[17],this.v1l^=ap[2]^ap[18],this.v1h^=ap[3]^ap[19],this.v2l^=ap[4]^ap[20],this.v2h^=ap[5]^ap[21],this.v3l^=ap[6]^ap[22],this.v3h^=ap[7]^ap[23],this.v4l^=ap[8]^ap[24],this.v4h^=ap[9]^ap[25],this.v5l^=ap[10]^ap[26],this.v5h^=ap[11]^ap[27],this.v6l^=ap[12]^ap[28],this.v6h^=ap[13]^ap[29],this.v7l^=ap[14]^ap[30],this.v7h^=ap[15]^ap[31],sC(ap)}destroy(){this.destroyed=!0,sC(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let ab=function(e){let t=(t,r)=>e(r).update(s$(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new ay(e));function aw(e){let t=`�Ethereum Signed Message:
16${e.length}`,r=new TextEncoder().encode(t+e);return"0x"+og.from(s0(r)).toString("hex")}async function av(e,t,r,n,i,o){switch(r.t){case"eip191":return await aC(e,t,r.s);case"eip1271":return await aE(e,t,r.s,n,i,o);default:throw Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function aC(e,t,r){return(await nu({hash:aw(t),signature:r})).toLowerCase()===e.toLowerCase()}async function aE(e,t,r,n,i,o){let s=om(n);if(!s.namespace||!s.reference)throw Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{let s="0x1626ba7e",a=r.substring(2),c=(a.length/2).toString(16).padStart(64,"0"),l=(t.startsWith("0x")?t:aw(t)).substring(2),u=await fetch(`${o||"https://rpc.walletconnect.org/v1"}/?chainId=${n}&projectId=${i}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:s+l+"0000000000000000000000000000000000000000000000000000000000000040"+c+a},"latest"]})}),{result:d}=await u.json();return!!d&&d.slice(0,s.length).toLowerCase()===s.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}function ax(e){let t=new Uint8Array(aa(function(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if("object"==typeof e&&null!=e&&e.data)return new Uint8Array(Object.values(e.data));if("object"==typeof e&&e)return new Uint8Array(Object.values(e));throw Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}(e)));return nd.Z.encode(t)}function aA(e){var t;let r=(t=og.from(e,"base64"),new nR(void 0).decode(t)).txn;if(!r)throw Error("Invalid signed transaction: missing 'txn' field");let n=new n$(void 0).encodeSharedRef(r),i=og.from("TX"),o=au(og.concat([i,og.from(n)]));return nK.encode(o).replace(/=+$/,"")}function aS(e){let t=[],r=BigInt(e);for(;r>=BigInt(128);)t.push(Number(r&BigInt(127)|BigInt(128))),r>>=BigInt(7);return t.push(Number(r)),og.from(t)}var a_=Object.defineProperty,aI=Object.defineProperties,ak=Object.getOwnPropertyDescriptors,aO=Object.getOwnPropertySymbols,aN=Object.prototype.hasOwnProperty,aP=Object.prototype.propertyIsEnumerable,aT=(e,t,r)=>t in e?a_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aR=(e,t)=>{for(var r in t||(t={}))aN.call(t,r)&&aT(e,r,t[r]);if(aO)for(var r of aO(t))aP.call(t,r)&&aT(e,r,t[r]);return e},a$=(e,t)=>
16aI(e,ak(t));let aD=e=>e?.split(":"),aL=e=>{let t=e&&aD(e);if(t)return e.includes("did:pkh:")?t[3]:t[1]},aM=e=>{let t=e&&aD(e);if(t)return t[2]+":"+t[3]},aU=e=>{let t=e&&aD(e);if(t)return t.pop()};async function aj(e){let{cacao:t,projectId:r}=e,{s:n,p:i}=t,o=aB(i,i.iss),s=aU(i.iss);return await av(s,o,n,aM(i.iss),r)}let aB=(e,t)=>{let r=`${e.domain} wants you to sign in with your Ethereum account:`,n=aU(t);if(!e.aud&&!e.uri)throw Error("Either `aud` or `uri` is required to construct the message");let i=e.statement||void 0,o=`URI: ${e.aud||e.uri}`,s=`Version: ${e.version}`,a=`Chain ID: ${aL(t)}`,c=`Nonce: ${e.nonce}`,l=`Issued At: ${e.iat}`,u=e.exp?`Expiration Time: ${e.exp}`:void 0,d=e.nbf?`Not Before: ${e.nbf}`:void 0,h=e.requestId?`Request ID: ${e.requestId}`:void 0,p=e.resources?`Resources:${e.resources.map(e=>`
17- ${e}`).join("")}`:void 0,f=aV(e.resources);return f&&(i=function(e="",t){aF(t);let r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;let n=[],i=0;Object.keys(t.att).forEach(e=>{let r=Object.keys(t.att[e]).map(e=>({ability:e.split("/")[0],action:e.split("/")[1]}));r.sort((e,t)=>e.action.localeCompare(t.action));let o={};r.forEach(e=>{o[e.ability]||(o[e.ability]=[]),o[e.ability].push(e.action)});let s=Object.keys(o).map(t=>(i++,`(${i}) '${t}': '${o[t].join("', '")}' for '${e}'.`));n.push(s.join(", ").replace(".,","."))});let o=n.join(" "),s=`${r}${o}`;return`${e?e+" ":""}${s}`}(i,aH(f))),[r,n,"",i,"",o,s,a,c,l,u,d,h,p].filter(e=>null!=e).join(`
18`)};function aF(e){if(!e)throw Error("No recap provided, value is undefined");if(!e.att)throw Error("No `att` property found");let t=Object.keys(e.att);if(!(null!=t&&t.length))throw Error("No resources found in `att` property");t.forEach(t=>{let r=e.att[t];if(Array.isArray(r)||"object"!=typeof r)throw Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw Error(`Resource object is empty: ${t}`);Object.keys(r).forEach(e=>{let t=r[e];if(!Array.isArray(t))throw Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach(t=>{if("object"!=typeof t)throw Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)})})})}function az(e){return aF(e),`urn:recap:${og.from(JSON.stringify(e)).toString("base64").replace(/=/g,"")}`}function aH(e){var t;let r=(t=e.replace("urn:recap:",""),JSON.parse(og.from(t,"base64").toString("utf-8")));return aF(r),r}function aW(e){var t;let r=aH(e);aF(r);let n=null==(t=r.att)?void 0:t.eip155;return n?Object.keys(n).map(e=>e.split("/")[1]):[]}function aq(e){let t=aH(e);aF(t);let r=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;null!=(t=e?.[0])&&t.chains&&r.push(e[0].chains)})}),[...new Set(r.flat())]}function aV(e){if(!e)return;let t=e?.[e.length-1];return t&&t.includes("urn:recap:")?t:void 0}function aK(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function aG(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function aZ(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function aY(e,...t){if(!aK(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function aJ(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function aX(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function aQ(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}let a0=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function a1(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e);else if(aK(e))e=a3(e);else throw Error("Uint8Array expected, got "+typeof e);return e}function a2(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw Error("invalid output length, expected "+e+", got: "+t.length);if(r&&t.byteOffset%4!=0)throw Error("invalid output, must be aligned");return t}function a5(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,l=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+l,a,n)}function a3(e){return Uint8Array.from(e)}let a6=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),a4=a6("expand 16-byte k"),a8=a6("expand 32-byte k"),a9=aX(a4),a7=aX(a8);function ce(e,t){return e<<t|e>>>32-t}function ct(e){return e.byteOffset%4==0}let cr=4294967296-1,cn=new Uint32Array,ci=(e,t)=>255&e[t++]|(255&e[t++])<<8;class co{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,aY(e=a1(e),32);
18let t=ci(e,0),r=ci(e,2),n=ci(e,4),i=ci(e,6),o=ci(e,8),s=ci(e,10),a=ci(e,12),c=ci(e,14);this.r[0]=8191&t,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|n<<6)&7939,this.r[3]=(n>>>7|i<<9)&8191,this.r[4]=(i>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|s<<2)&8191,this.r[7]=(s>>>11|a<<5)&8065,this.r[8]=(a>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=ci(e,16+2*t)}process(e,t,r=!1){let{h:n,r:i}=this,o=i[0],s=i[1],a=i[2],c=i[3],l=i[4],u=i[5],d=i[6],h=i[7],p=i[8],f=i[9],g=ci(e,t+0),m=ci(e,t+2),y=ci(e,t+4),b=ci(e,t+6),w=ci(e,t+8),v=ci(e,t+10),C=ci(e,t+12),E=ci(e,t+14),x=n[0]+(8191&g),A=n[1]+((g>>>13|m<<3)&8191),S=n[2]+((m>>>10|y<<6)&8191),_=n[3]+((y>>>7|b<<9)&8191),I=n[4]+((b>>>4|w<<12)&8191),k=n[5]+(w>>>1&8191),O=n[6]+((w>>>14|v<<2)&8191),N=n[7]+((v>>>11|C<<5)&8191),P=n[8]+((C>>>8|E<<8)&8191),T=n[9]+(E>>>5|(r?0:2048)),R=0,$=0+x*o+5*f*A+5*p*S+5*h*_+5*d*I;R=$>>>13,$&=8191,$+=5*u*k+5*l*O+5*c*N+5*a*P+5*s*T,R+=$>>>13,$&=8191;let D=R+x*s+A*o+5*f*S+5*p*_+5*h*I;R=D>>>13,D&=8191,D+=5*d*k+5*u*O+5*l*N+5*c*P+5*a*T,R+=D>>>13,D&=8191;let L=R+x*a+A*s+S*o+5*f*_+5*p*I;R=L>>>13,L&=8191,L+=5*h*k+5*d*O+5*u*N+5*l*P+5*c*T,R+=L>>>13,L&=8191;let M=R+x*c+A*a+S*s+_*o+5*f*I;R=M>>>13,M&=8191,M+=5*p*k+5*h*O+5*d*N+5*u*P+5*l*T,R+=M>>>13,M&=8191;let U=R+x*l+A*c+S*a+_*s+I*o;R=U>>>13,U&=8191,U+=5*f*k+5*p*O+5*h*N+5*d*P+5*u*T,R+=U>>>13,U&=8191;let j=R+x*u+A*l+S*c+_*a+I*s;R=j>>>13,j&=8191,j+=k*o+5*f*O+5*p*N+5*h*P+5*d*T,R+=j>>>13,j&=8191;let B=R+x*d+A*u+S*l+_*c+I*a;R=B>>>13,B&=8191,B+=k*s+O*o+5*f*N+5*p*P+5*h*T,R+=B>>>13,B&=8191;let F=R+x*h+A*d+S*u+_*l+I*c;R=F>>>13,F&=8191,F+=k*a+O*s+N*o+5*f*P+5*p*T,R+=F>>>13,F&=8191;let z=R+x*p+A*h+S*d+_*u+I*l;R=z>>>13,z&=8191,z+=k*c+O*a+N*s+P*o+5*f*T,R+=z>>>13,z&=8191;let H=R+x*f+A*p+S*h+_*d+I*u;R=H>>>13,H&=8191,H+=k*l+O*c+N*a+P*s+T*o,R+=H>>>13,H&=8191,$=8191&(R=(R=(R<<2)+R|0)+$|0),R>>>=13,D+=R,n[0]=$,n[1]=D,n[2]=L,n[3]=M,n[4]=U,n[5]=j,n[6]=B,n[7]=F,n[8]=z,n[9]=H}finalize(){let{h:e,pad:t}=this,r=new Uint16Array(10),n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let i=(1^n)-1;for(let e=0;e<10;e++)r[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|r[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+t[0];e[0]=65535&o;for(let r=1;r<8;r++)o=(e[r]+t[r]|0)+(o>>>16)|0,e[r]=65535&o;aQ(r)}update(e){aJ(this),aY(e=a1(e));let{buffer:t,blockLen:r}=this,n=e.length;for(let i=0;i<n;){let o=Math.min(r-this.pos,n-i);if(o===r){for(;r<=n-i;i+=r)this.process(e,i);continue}t.set(e.subarray(i,i+o),this.pos),this.pos+=o,i+=o,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){aQ(this.h,this.r,this.buffer,this.pad)}digestInto(e){aJ(this),function(e,t){aY(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;let{buffer:t,h:r}=this,{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=r[t]>>>0,e[i++]=r[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}}let cs=function(e){let t=(t,r)=>e(r).update(a1(t)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new co(e)),ca=function(e,t){let{allowShortKeys:r,extendNonceFn:n,counterLength:i,counterRight:o,rounds:s}=function(e,t){if(null==t||"object"!=typeof t)throw Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw Error("core must be a function");return aZ(i),aZ(s),aG(o),aG(r),(t,a,c,l,u=0)=>{aY(t),aY(a),aY(c);let d=c.length;if(void 0===l&&(l=new Uint8Array(d)),aY(l),aZ(u),u<0||u>=cr)throw Error("arx: counter overflow");if(l.length<d)throw Error(`arx: output (${l.length}) is shorter than data (${d})`);let h=[],p=t.length,f,g;if(32===p)h.push(f=a3(t)),g=a7;else if(16===p&&r)(f=new Uint8Array(32)).set(t),f.set(t,16),g=a9,h.push(f);
18else throw Error(`arx: invalid 32-byte key, got length=${p}`);ct(a)||h.push(a=a3(a));let m=aX(f);if(n){if(24!==a.length)throw Error("arx: extended nonce must be 24 bytes");n(g,m,aX(a.subarray(0,16)),m),a=a.subarray(16)}let y=16-i;if(y!==a.length)throw Error(`arx: nonce must be ${y} or 16 bytes`);if(12!==y){let e=new Uint8Array(12);e.set(a,o?0:12-a.length),a=e,h.push(a)}return function(e,t,r,n,i,o,s,a){let c=i.length,l=new Uint8Array(64),u=aX(l),d=ct(i)&&ct(o),h=d?aX(i):cn,p=d?aX(o):cn;for(let f=0;f<c;s++){if(e(t,r,n,u,s,a),s>=cr)throw Error("arx: counter overflow");let g=Math.min(64,c-f);if(d&&64===g){let e=f/4;if(f%4!=0)throw Error("arx: invalid block position");for(let t=0,r;t<16;t++)p[r=e+t]=h[r]^u[t];f+=64;continue}for(let e=0,t;e<g;e++)o[t=f+e]=i[t]^l[e];f+=g}}(e,g,m,aX(a),c,l,u,s),aQ(...h),l}}(function(e,t,r,n,i,o=20){let s=e[0],a=e[1],c=e[2],l=e[3],u=t[0],d=t[1],h=t[2],p=t[3],f=t[4],g=t[5],m=t[6],y=t[7],b=r[0],w=r[1],v=r[2],C=s,E=a,x=c,A=l,S=u,_=d,I=h,k=p,O=f,N=g,P=m,T=y,R=i,$=b,D=w,L=v;for(let e=0;e<o;e+=2)O=O+(R=ce(R^(C=C+S|0),16))|0,C=C+(S=ce(S^O,12))|0,O=O+(R=ce(R^C,8))|0,S=ce(S^O,7),N=N+($=ce($^(E=E+_|0),16))|0,E=E+(_=ce(_^N,12))|0,N=N+($=ce($^E,8))|0,_=ce(_^N,7),P=P+(D=ce(D^(x=x+I|0),16))|0,x=x+(I=ce(I^P,12))|0,P=P+(D=ce(D^x,8))|0,I=ce(I^P,7),T=T+(L=ce(L^(A=A+k|0),16))|0,A=A+(k=ce(k^T,12))|0,T=T+(L=ce(L^A,8))|0,k=ce(k^T,7),P=P+(L=ce(L^(C=C+_|0),16))|0,C=C+(_=ce(_^P,12))|0,P=P+(L=ce(L^C,8))|0,_=ce(_^P,7),T=T+(R=ce(R^(E=E+I|0),16))|0,E=E+(I=ce(I^T,12))|0,T=T+(R=ce(R^E,8))|0,I=ce(I^T,7),O=O+($=ce($^(x=x+k|0),16))|0,x=x+(k=ce(k^O,12))|0,O=O+($=ce($^x,8))|0,k=ce(k^O,7),N=N+(D=ce(D^(A=A+S|0),16))|0,A=A+(S=ce(S^N,12))|0,N=N+(D=ce(D^A,8))|0,S=ce(S^N,7);let M=0;n[M++]=s+C|0,n[M++]=a+E|0,n[M++]=c+x|0,n[M++]=l+A|0,n[M++]=u+S|0,n[M++]=d+_|0,n[M++]=h+I|0,n[M++]=p+k|0,n[M++]=f+O|0,n[M++]=g+N|0,n[M++]=m+P|0,n[M++]=y+T|0,n[M++]=i+R|0,n[M++]=b+$|0,n[M++]=w+D|0,n[M++]=v+L|0},{counterRight:!1,counterLength:4,allowShortKeys:!1}),cc=new Uint8Array(16),cl=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(cc.subarray(r))},cu=new Uint8Array(32);function cd(e,t,r,n,i){let o=e(t,r,cu),s=cs.create(o);i&&cl(s,i),cl(s,n);let a=function(e,t,r){aG(r);let n=new Uint8Array(16),i=new DataView(n.buffer,n.byteOffset,n.byteLength);return a5(i,0,BigInt(t),r),a5(i,8,BigInt(e),r),n}(n.length,i?i.length:0,!0);s.update(a);let c=s.digest();return aQ(o,a),c}let ch=((e,t)=>{function r(n,...i){if(aY(n),!a0)throw Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){let t=i[0];if(!t)throw Error("nonce / iv required");e.varSizeNonce?aY(t):aY(t,e.nonceLength)}let o=e.tagLength;o&&void 0!==i[1]&&aY(i[1]);let s=t(n,...i),a=(e,t)=>{if(void 0!==t){if(2!==e)throw Error("cipher output not supported");aY(t)}},c=!1;return{encrypt(e,t){if(c)throw Error("cannot encrypt() twice with same key + nonce");return c=!0,aY(e),a(s.encrypt.length,t),s.encrypt(e,t)},decrypt(e,t){if(aY(e),o&&e.length<o)throw Error("invalid ciphertext length: smaller than tagLength="+o);return a(s.decrypt.length,t),s.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:64,nonceLength:12,tagLength:16},(e,t,r)=>({encrypt(n,i){let o=n.length;(i=a2(o+16,i,!1)).set(n);let s=i.subarray(0,-16);ca(e,t,s,s,1);let a=cd(ca,e,t,s,r);return i.set(a,o),aQ(a),i},decrypt(n,i){i=a2(n.length-16,i,!1);let o=n.subarray(0,-16),s=n.subarray(-16),a=cd(ca,e,t,o,r);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(s,a))throw Error("invalid tag");return i.set(n.subarray(0,-16)),ca(e,t,i,i,1),aQ(a),i}}));class cp extends sL{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,sy(e);let r=s$(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),sC(i)}update(e){return sb(this),this.iHash.update(e),this}digestInto(e){sb(this),sm(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let cf=(e,t,r)=>new cp(e,t).update(r).digest();cf.create=(e,t)=>
18new cp(e,t);let cg=Uint8Array.from([0]),cm=Uint8Array.of(),cy=(e,t,r,n,i)=>{var o;return function(e,t,r,n=32){sy(e),sg(n);let i=e.outputLen;if(n>255*i)throw Error("Length should be <= 255*HashLen");let o=Math.ceil(n/i);void 0===r&&(r=cm);let s=new Uint8Array(o*i),a=cf.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let e=0;e<o;e++)cg[0]=e+1,c.update(0===e?cm:l).update(r).update(cg).digestInto(l),s.set(l,i*e),a._cloneInto(c);return a.destroy(),c.destroy(),sC(l,cg),s.slice(0,n)}(e,(o=r,sy(e),void 0===o&&(o=new Uint8Array(e.outputLen)),cf(e,s$(o),s$(t))),n,i)},cb=BigInt(0),cw=BigInt(1);function cv(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function cC(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function cE(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?cb:BigInt("0x"+e)}function cx(e){return sm(e),cE(sN(Uint8Array.from(e).reverse()))}function cA(e,t){return sR(e.toString(16).padStart(2*t,"0"))}function cS(e,t){return cA(e,t).reverse()}function c_(e,t,r){let n;if("string"==typeof t)try{n=sR(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(sf(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}let cI=e=>"bigint"==typeof e&&cb<=e;function ck(e,t,r,n){if(!(cI(t)&&cI(r)&&cI(n))||!(r<=t)||!(t<n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}let cO=e=>(cw<<BigInt(e))-cw;function cN(e,t,r={}){if(!e||"object"!=typeof e)throw Error("expected valid options object");function n(t,r,n){let i=e[t];if(n&&void 0===i)return;let o=typeof i;if(o!==r||null===i)throw Error(`param "${t}" is invalid: expected ${r}, got ${o}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}function cP(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let o=e(r,...n);return t.set(r,o),o}}let cT=BigInt(0),cR=BigInt(1),c$=BigInt(2),cD=BigInt(3),cL=BigInt(4),cM=BigInt(5),cU=BigInt(8);function cj(e,t){let r=e%t;return r>=cT?r:t+r}function cB(e,t,r){let n=e;for(;t-- >cT;)n*=n,n%=r;return n}function cF(e,t){if(e===cT)throw Error("invert: expected non-zero number");if(t<=cT)throw Error("invert: expected positive modulus, got "+t);let r=cj(e,t),n=t,i=cT,o=cR;for(;r!==cT;){let e=n/r,t=n%r,s=i-o*e;n=r,r=t,i=o,o=s}if(n!==cR)throw Error("invert: does not exist");return cj(i,t)}function cz(e,t){let r=(e.ORDER+cR)/cL,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function cH(e,t){let r=(e.ORDER-cM)/cU,n=e.mul(t,c$),i=e.pow(n,r),o=e.mul(t,i),s=e.mul(e.mul(o,c$),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),t))throw Error("Cannot find square root");return a}let cW=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function cq(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),o=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),o),n}function cV(e,t){let r=(e.ORDER-cR)/c$,n=e.pow(t,r),i=e.eql(n,e.ONE),o=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!i&&!o&&!s)throw Error("invalid Legendre symbol result");return i?1:o?0:-1}function cK(e,t,r=!1,n={}){let i,o,s;if(e<=cT)throw Error("invalid field: expected ORDER > 0, got "+e);if("object"==typeof t&&null!=t){if(n.sqrt||r)throw Error("cannot specify opts in two arguments");t.BITS&&(i=t.BITS),t.sqrt&&(o=t.sqrt),"boolean"==typeof t.isLE&&(r=t.isLE)}else"number"==typeof t&&(i=t),n.sqrt&&(o=n.sqrt);let{nBitLength:a,nByteLength:c}=function(e,t){void 0!==t&&sg(t);let r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}(e,i);if(c>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let l=Object.freeze({ORDER:e,isLE:r,BITS:a,BYTES:c,MASK:cO(a),ZERO:cT,ONE:cR,create:t=>cj(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return cT<=t&&t<e},is0:e=>e===cT,isValidNot0:e=>!l.is0(e)&&l.isValid(e),isOdd:e=>(e&cR)===cR,neg:t=>cj(-t,e),eql:(e,t)=>
18e===t,sqr:t=>cj(t*t,e),add:(t,r)=>cj(t+r,e),sub:(t,r)=>cj(t-r,e),mul:(t,r)=>cj(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<cT)throw Error("invalid exponent, negatives unsupported");if(r===cT)return e.ONE;if(r===cR)return t;let n=e.ONE,i=t;for(;r>cT;)r&cR&&(n=e.mul(n,i)),i=e.sqr(i),r>>=cR;return n})(l,e,t),div:(t,r)=>cj(t*cF(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>cF(t,e),sqrt:o||(t=>(s||(s=e%cL===cD?cz:e%cU===cM?cH:function(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-cR,r=0;for(;t%c$===cT;)t/=c$,r++;let n=c$,i=cK(e);for(;1===cV(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return cz;let o=i.pow(n,t),s=(t+cR)/c$;return function(e,n){if(e.is0(n))return n;if(1!==cV(e,n))throw Error("Cannot find square root");let i=r,a=e.mul(e.ONE,o),c=e.pow(n,t),l=e.pow(n,s);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=cR<<BigInt(i-t-1),o=e.pow(a,n);i=t,a=e.sqr(o),c=e.mul(c,a),l=e.mul(l,o)}return l}}(e)),s(l,t))),toBytes:e=>r?cS(e,c):cA(e,c),fromBytes:e=>{if(e.length!==c)throw Error("Field.fromBytes: expected "+c+" bytes, got "+e.length);return r?cx(e):cE(sN(e))},invertBatch:e=>cq(l,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(l)}function cG(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function cZ(e){let t=cG(e);return t+Math.ceil(t/2)}let cY=BigInt(0),cJ=BigInt(1);function cX(e,t){let r=t.negate();return e?r:t}function cQ(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function c0(e,t){cQ(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:cO(e),maxNumber:i,shiftBy:BigInt(e)}}function c1(e,t,r){let{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=r,a=Number(e&i),c=e>>s;a>n&&(a-=o,c+=cJ);let l=t*n;return{nextN:c,offset:l+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:l}}let c2=new WeakMap,c5=new WeakMap;function c3(e){return c5.get(e)||1}function c6(e){if(e!==cY)throw Error("invalid wNAF")}function c4(e,t){if(!t)return cK(e);if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return cN(t,cW.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),t}BigInt(0),BigInt(1),BigInt(2),BigInt(8);let c8=BigInt(0),c9=BigInt(1),c7=BigInt(2);BigInt(0);let le=BigInt(1),lt=BigInt(2),lr=BigInt(3),ln=BigInt(5),li=BigInt(8),lo={p:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:li,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function ls(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}let la=(()=>{let e=lo.p;return function(e){let{P:t,type:r,adjustScalarBytes:n,powPminus2:i,randomBytes:o}=(cN(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})),s="x25519"===r;if(!s&&"x448"!==r)throw Error("invalid type");let a=o||sU,c=s?255:448,l=s?32:56,u=BigInt(s?9:5),d=BigInt(s?121665:39081),h=s?c7**BigInt(254):c7**BigInt(447),p=h+(s?BigInt(8)*c7**BigInt(251)-c9:BigInt(4)*c7**BigInt(445)-c9)+c9,f=e=>cj(e,t),g=cS(f(u),l);function m(e,r){let o=function(e,r){ck("u",e,c8,t),ck("scalar",r,h,p);let n=c9,o=c8,s=e,a=c9,l=c8;for(let t=BigInt(c-1);t>=c8;t--){let i=r>>t&c9;l^=i,({x_2:n,x_3:s}=b(l,n,s)),({x_2:o,x_3:a}=b(l,o,a)),l=i;let c=n+o,u=f(c*c),h=n-o,p=f(h*h),g=u-p,m=s+a,y=f((s-a)*c),w=f(m*h),v=y+w,C=y-w;s=f(v*v),a=f(e*f(C*C)),n=f(u*p),o=f(g*(u+f(d*g)))}return{x_2:n,x_3:s}=b(l,n,s),{x_2:o,x_3:a}=b(l,o,a),f(n*i(o))}(function(e){let t=c_("u coordinate",e,l);return s&&(t[31]&=127),f(cx(t))}(r),cx(n(c_("scalar",e,l))));if(o===c8)throw Error("invalid private or public key received");return cS(f(o),l)}function y(e){return m(e,g)}function b(e,t,r){let n=f(e*(t-r));return{x_2:t=f(t-n),x_3:r=f(r+n)}}return{scalarMult:m,scalarMultBase:y,getSharedSecret:(e,t)=>m(e,t),getPublicKey:e=>y(e),utils:{randomPrivateKey:()=>a(l)},GuBytes:g.slice()}}({P:e,type:"x25519",powPminus2:t=>{let{pow_p_5_8:r,b2:n}
18=function(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=lo.p,s=e*e%o*e%o,a=cB(s,lt,o)*s%o,c=cB(a,le,o)*e%o,l=cB(c,ln,o)*c%o,u=cB(l,t,o)*l%o,d=cB(u,r,o)*u%o,h=cB(d,n,o)*d%o,p=cB(h,i,o)*h%o,f=cB(p,i,o)*h%o,g=cB(f,t,o)*l%o;return{pow_p_5_8:cB(g,lt,o)*e%o,b2:s}}(t);return cj(cB(r,lr,e)*n,e)},adjustScalarBytes:ls})})();function lc(e){void 0!==e.lowS&&cv("lowS",e.lowS),void 0!==e.prehash&&cv("prehash",e.prehash)}class ll extends Error{constructor(e=""){super(e)}}let lu={Err:ll,_tlv:{encode:(e,t)=>{let{Err:r}=lu;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=cC(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?cC(i.length/2|128):"";return cC(e)+o+i+t},decode(e,t){let{Err:r}=lu,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],o=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)o=o<<8|e;if(n+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let s=t.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+o)}}},_int:{encode(e){let{Err:t}=lu;if(e<ld)throw new t("integer: negative integers are not allowed");let r=cC(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=lu;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return cE(sN(e))}},toSig(e){let{Err:t,_int:r,_tlv:n}=lu,i=c_("signature",e),{v:o,l:s}=n.decode(48,i);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,o),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=lu,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}},ld=BigInt(0),lh=BigInt(1),lp=BigInt(2),lf=BigInt(3),lg=BigInt(4);function lm(e,t,r){let{BYTES:n}=e;return function(i){let o;if("bigint"==typeof i)o=i;else{let r=c_("private key",i);if(t){if(!t.includes(2*r.length))throw Error("invalid private key");let e=new Uint8Array(n);e.set(r,e.length-r.length),r=e}try{o=e.fromBytes(r)}catch{throw Error(`invalid private key: expected ui8a of size ${n}, got ${typeof i}`)}}if(r&&(o=e.create(o)),!e.isValidNot0(o))throw Error("invalid private key: out of range [1..N-1]");return o}}function ly(e){return Uint8Array.of(e?2:3)}function lb(e,t){let r=t=>(function(e){let{CURVE:t,curveOpts:r,ecdsaOpts:n}=function(e){let{CURVE:t,curveOpts:r}=function(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r={Fp:e.Fp,Fn:cK(t.n,e.nBitLength),allowedPrivateKeyLengths:e.allowedPrivateKeyLengths,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,wrapPrivateKey:e.wrapPrivateKey,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:r}}(e);return{CURVE:t,curveOpts:r,ecdsaOpts:{hash:e.hash,hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN}}}(e),i=function(e,t,r={}){cN(t,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let n=t.randomBytes||sU,i=t.hmac||((e,...r)=>cf(t.hash,e,sD(...r))),{Fp:o,Fn:s}=e,{ORDER:a,BITS:c}=s;function l(e,t){if(!s.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..CURVE.n`)}class u{constructor(e,t,r){l("r",e),l("s",t),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){let t=s.BYTES,r=c_("compactSignature",e,2*t);return new u(s.fromBytes(r.subarray(0,t)),s.fromBytes(r.subarray(t,2*t)))}static fromDER(e){let{r:t,s:r}=lu.toSig(c_("DER",e));return new u(t,r)}
18assertValidity(){}addRecoveryBit(e){return new u(this.r,this.s,e)}recoverPublicKey(t){let r=o.ORDER,{r:n,s:i,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw Error("recovery id invalid");if(a*lp<r&&c>1)throw Error("recovery id is ambiguous for h>1 curve");let l=2===c||3===c?n+a:n;if(!o.isValid(l))throw Error("recovery id 2 or 3 invalid");let u=o.toBytes(l),d=e.fromHex(sD(ly((1&c)==0),u)),h=s.inv(l),p=f(c_("msgHash",t)),g=s.create(-p*h),m=s.create(i*h),y=e.BASE.multiplyUnsafe(g).add(d.multiplyUnsafe(m));if(y.is0())throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>a>>lh}normalizeS(){return this.hasHighS()?new u(this.r,s.neg(this.s),this.recovery):this}toBytes(e){if("compact"===e)return sD(s.toBytes(this.r),s.toBytes(this.s));if("der"===e)return sR(lu.hexFromSig(this));throw Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return sN(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return sN(this.toBytes("compact"))}}let d=lm(s,r.allowedPrivateKeyLengths,r.wrapPrivateKey);function h(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;let n=c_("key",t).length,i=o.BYTES,a=i+1;if(!(r.allowedPrivateKeyLengths||s.BYTES===a))return n===a||n===2*i+1}let p=t.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=cE(sN(e)),r=8*e.length-c;return r>0?t>>BigInt(r):t},f=t.bits2int_modN||function(e){return s.create(p(e))},g=cO(c);function m(e){return ck("num < 2^"+c,e,ld,g),s.toBytes(e)}let y={lowS:t.lowS,prehash:!1},b={lowS:t.lowS,prehash:!1};return e.BASE.precompute(8),Object.freeze({getPublicKey:function(t,r=!0){return e.fromPrivateKey(t).toBytes(r)},getSharedSecret:function(t,r,n=!0){if(!0===h(t))throw Error("first arg must be private key");if(!1===h(r))throw Error("second arg must be public key");return e.fromHex(r).multiply(d(t)).toBytes(n)},sign:function(r,c,l=y){let{seed:h,k2sig:g}=function(r,i,c=y){if(["recovered","canonical"].some(e=>e in c))throw Error("sign() legacy options not supported");let{hash:l}=t,{lowS:h,prehash:g,extraEntropy:b}=c;null==h&&(h=!0),r=c_("msgHash",r),lc(c),g&&(r=c_("prehashed msgHash",l(r)));let w=f(r),v=d(i),C=[m(v),m(w)];if(null!=b&&!1!==b){let e=!0===b?n(o.BYTES):b;C.push(c_("extraEntropy",e))}return{seed:sD(...C),k2sig:function(t){let r=p(t);if(!s.isValidNot0(r))return;let n=s.inv(r),i=e.BASE.multiply(r).toAffine(),o=s.create(i.x);if(o===ld)return;let c=s.create(n*s.create(w+o*v));if(c===ld)return;let l=(i.x===o?0:2)|Number(i.y&lh),d=c;return h&&c>a>>lh&&(d=c>a>>lh?s.neg(c):c,l^=1),new u(o,d,l)}}}(r,c,l);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=e=>new Uint8Array(e),i=e=>Uint8Array.of(e),o=n(e),s=n(e),a=0,c=()=>{o.fill(1),s.fill(0),a=0},l=(...e)=>r(s,o,...e),u=(e=n(0))=>{s=l(i(0),e),o=l(),0!==e.length&&(s=l(i(1),e),o=l())},d=()=>{if(a++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(o=l()).slice();r.push(t),e+=o.length}return sD(...r)};return(e,t)=>{let r;for(c(),u(e);!(r=t(d()));)u();return c(),r}})(t.hash.outputLen,s.BYTES,i)(h,g)},verify:function(r,n,i,o=b){let a,c;n=c_("msgHash",n),i=c_("publicKey",i),lc(o);let{lowS:l,prehash:d,format:h}=o;if("strict"in o)throw Error("options.strict was renamed to lowS");if(void 0!==h&&!["compact","der","js"].includes(h))throw Error('format must be "compact", "der" or "js"');let p="string"==typeof r||sf(r),g=!p&&!h&&"object"==typeof r&&null!==r&&"bigint"==typeof r.r&&"bigint"==typeof r.s;if(!p&&!g)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(g){if(void 0===h||"js"===h)a=new u(r.r,r.s);else throw Error("invalid format")}if(p){try{"compact"!==h&&(a=u.fromDER(r))}catch(e){if(!(e instanceof lu.Err))throw e}a||"der"===h||(a=u.fromCompact(r))}c=e.fromHex(i)}catch{return!1}if(!a||l&&a.hasHighS())return!1;d&&(n=t.hash(n));let{r:m,s:y}=a,w=f(n),v=s.inv(y),C=s.create(w*v),E=s.create(m*v),x=e.BASE.multiplyUnsafe(C).add(c.multiplyUnsafe(E));return!x.is0()&&s.create(x.x)===m},utils:{isValidPrivateKey(e){try{return d(e),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>(function(e,t,r=!1){let n=e.length,i=cG(t),o=cZ(t);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let s=cj(r?cx(e):cE(sN(e)),t-cR)+cR;return r?cS(s,i):cA(s,i)})(n(cZ(a)),a),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)},Point:e,Signature:u})}(function(e,t={}){var r,n,i;let{Fp:o,Fn:s}=function(e,t,r={}){if(!t||"object"!=typeof t)throw Error(`expected valid ${e} CURVE object`);for(let e of["p","n","h"]){let r=t[e];if(!("bigint"==typeof r&&r>cY))throw Error(`CURVE.${e} must be positive bigint`)}let n=c4(t.p,r.Fp),i=c4(t.n,r.Fn);for(let r of["Gx","Gy","a","weierstrass"===e?"b":"d"])if(!n.isValid(t[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);return{Fp:n,Fn:i}}("weierstrass",e,t),{h:a,n:c}=e;cN(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:l}=t;if(l&&(!o.is0(e.a)||"bigint"!=typeof l.beta||"function"!=typeof l.splitScalar))throw Error('invalid endo: expected "beta": bigint and "splitScalar": function');function u(){if(!o.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let d=t.toBytes||function(e,t,r){let{x:n,y:i}=t.toAffine(),s=o.toBytes(n);return(cv("isCompressed",r),r)?(u(),sD(ly(!o.isOdd(i)),s)):sD(Uint8Array.of(4),s,o.toBytes(i))},h=t.fromBytes||function(e){sm(e);
18let t=o.BYTES,r=t+1,n=2*t+1,i=e.length,s=e[0],a=e.subarray(1);if(i===r&&(2===s||3===s)){let e;let t=o.fromBytes(a);if(!o.isValid(t))throw Error("bad point: is not on curve, wrong x");let r=p(t);try{e=o.sqrt(r)}catch(e){throw Error("bad point: is not on curve, sqrt error"+(e instanceof Error?": "+e.message:""))}return u(),(1&s)==1!==o.isOdd(e)&&(e=o.neg(e)),{x:t,y:e}}if(i===n&&4===s){let e=o.fromBytes(a.subarray(0*t,1*t)),r=o.fromBytes(a.subarray(1*t,2*t));if(!f(e,r))throw Error("bad point: is not on curve");return{x:e,y:r}}throw Error(`bad point: got length ${i}, expected compressed=${r} or uncompressed=${n}`)},p=(r=e.a,n=e.b,function(e){let t=o.sqr(e),i=o.mul(t,e);return o.add(o.add(i,o.mul(e,r)),n)});function f(e,t){let r=o.sqr(t),n=p(e);return o.eql(r,n)}if(!f(e.Gx,e.Gy))throw Error("bad curve params: generator point");let g=o.mul(o.pow(e.a,lf),lg),m=o.mul(o.sqr(e.b),BigInt(27));if(o.is0(o.add(g,m)))throw Error("bad curve params: a or b");function y(e,t,r=!1){if(!o.isValid(t)||r&&o.is0(t))throw Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof E))throw Error("ProjectivePoint expected")}let w=cP((e,t)=>{let{px:r,py:n,pz:i}=e;if(o.eql(i,o.ONE))return{x:r,y:n};let s=e.is0();null==t&&(t=s?o.ONE:o.inv(i));let a=o.mul(r,t),c=o.mul(n,t),l=o.mul(i,t);if(s)return{x:o.ZERO,y:o.ZERO};if(!o.eql(l,o.ONE))throw Error("invZ was invalid");return{x:a,y:c}}),v=cP(e=>{if(e.is0()){if(t.allowInfinityPoint&&!o.is0(e.py))return;throw Error("bad point: ZERO")}let{x:r,y:n}=e.toAffine();if(!o.isValid(r)||!o.isValid(n))throw Error("bad point: x or y not field elements");if(!f(r,n))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function C(e,t,r,n,i){return r=new E(o.mul(r.px,e),r.py,r.pz),t=cX(n,t),r=cX(i,r),t.add(r)}class E{constructor(e,t,r){this.px=y("x",e),this.py=y("y",t,!0),this.pz=y("z",r),Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!o.isValid(t)||!o.isValid(r))throw Error("invalid affine point");if(e instanceof E)throw Error("projective point not allowed");return o.is0(t)&&o.is0(r)?E.ZERO:new E(t,r,o.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){return function(e,t,r){let n=cq(e.Fp,r.map(e=>e.pz));return r.map((e,t)=>e.toAffine(n[t])).map(e.fromAffine)}(E,0,e)}static fromBytes(e){return sm(e),E.fromHex(e)}static fromHex(e){let t=E.fromAffine(h(c_("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){let r=lm(s,t.allowedPrivateKeyLengths,t.wrapPrivateKey);return E.BASE.multiply(r(e))}static msm(e,t){return function(e,t,r,n){(function(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})})(r,e),function(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}(n,t);let i=r.length,o=n.length;if(i!==o)throw Error("arrays of points and scalars must have equal length");let s=e.ZERO,a=function(e){let t;for(t=0;e>cb;e>>=cw,t+=1);return t}(BigInt(i)),c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);let l=cO(c),u=Array(Number(l)+1).fill(s),d=Math.floor((t.BITS-1)/c)*c,h=s;for(let e=d;e>=0;e-=c){u.fill(s);for(let t=0;t<o;t++){let i=Number(n[t]>>BigInt(e)&l);u[i]=u[i].add(r[t])}let t=s;for(let e=u.length-1,r=s;e>0;e--)r=r.add(u[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<c;e++)h=h.double()}return h}(E,s,e,t)}precompute(e=8,t=!0){return A.setWindowSize(this,e),t||this.multiply(lf),this}_setWindowSize(e){this.precompute(e)}assertValidity(){v(this)}hasEvenY(){let{y:e}=this.toAffine();if(!o.isOdd)throw Error("Field doesn't support isOdd");return!o.isOdd(e)}equals(e){b(e);let{px:t,py:r,pz:n}=this,{px:i,py:s,pz:a}=e,c=o.eql(o.mul(t,a),o.mul(i,n)),l=o.eql(o.mul(r,a),o.mul(s,n));return c&&l}negate(){return new E(this.px,o.neg(this.py),this.pz)}double(){let{a:t,b:r}=e,n=o.mul(r,lf),{px:i,py:s,pz:a}=this,c=o.ZERO,l=o.ZERO,u=o.ZERO,d=o.mul(i,i),h=o.mul(s,s),p=o.mul(a,a),f=o.mul(i,s);return f=o.add(f,f),u=o.mul(i,a),u=o.add(u,u),c=o.mul(t,u),l=o.mul(n,p),l=o.add(c,l),
vendor: 1,781 bytes, line 18
18c=o.sub(h,l),l=o.add(h,l),l=o.mul(c,l),c=o.mul(f,c),u=o.mul(n,u),p=o.mul(t,p),f=o.sub(d,p),f=o.mul(t,f),f=o.add(f,u),u=o.add(d,d),d=o.add(u,d),d=o.add(d,p),d=o.mul(d,f),l=o.add(l,d),p=o.mul(s,a),p=o.add(p,p),d=o.mul(p,f),c=o.sub(c,d),u=o.mul(p,h),u=o.add(u,u),new E(c,l,u=o.add(u,u))}add(t){b(t);let{px:r,py:n,pz:i}=this,{px:s,py:a,pz:c}=t,l=o.ZERO,u=o.ZERO,d=o.ZERO,h=e.a,p=o.mul(e.b,lf),f=o.mul(r,s),g=o.mul(n,a),m=o.mul(i,c),y=o.add(r,n),w=o.add(s,a);y=o.mul(y,w),w=o.add(f,g),y=o.sub(y,w),w=o.add(r,i);let v=o.add(s,c);return w=o.mul(w,v),v=o.add(f,m),w=o.sub(w,v),v=o.add(n,i),l=o.add(a,c),v=o.mul(v,l),l=o.add(g,m),v=o.sub(v,l),d=o.mul(h,w),l=o.mul(p,m),d=o.add(l,d),l=o.sub(g,d),d=o.add(g,d),u=o.mul(l,d),g=o.add(f,f),g=o.add(g,f),m=o.mul(h,m),w=o.mul(p,w),g=o.add(g,m),m=o.sub(f,m),m=o.mul(h,m),w=o.add(w,m),f=o.mul(g,w),u=o.add(u,f),f=o.mul(v,w),l=o.mul(y,l),l=o.sub(l,f),f=o.mul(y,g),d=o.mul(v,d),new E(l,u,d=o.add(d,f))}subtract(e){return this.add(e.negate())}is0(){return this.equals(E.ZERO)}multiply(e){let r,n;let{endo:i}=t;if(!s.isValidNot0(e))throw Error("invalid scalar: out of range");let o=e=>A.wNAFCached(this,e,E.normalizeZ);if(i){let{k1neg:t,k1:s,k2neg:a,k2:c}=i.splitScalar(e),{p:l,f:u}=o(s),{p:d,f:h}=o(c);n=u.add(h),r=C(i.beta,l,d,t,a)}else{let{p:t,f:i}=o(e);r=t,n=i}return E.normalizeZ([r,n])[0]}multiplyUnsafe(e){let{endo:r}=t;if(!s.isValid(e))throw Error("invalid scalar: out of range");if(e===ld||this.is0())return E.ZERO;if(e===lh)return this;if(A.hasPrecomputes(this))return this.multiply(e);if(!r)return A.wNAFCachedUnsafe(this,e);{let{k1neg:t,k1:n,k2neg:i,k2:o}=r.splitScalar(e),{p1:s,p2:a}=function(e,t,r,n){let i=t,o=e.ZERO,s=e.ZERO;for(;r>cY||n>cY;)r&cJ&&(o=o.add(i)),n&cJ&&(s=s.add(i)),i=i.double(),r>>=cJ,n>>=cJ;return{p1:o,p2:s}}(E,this,n,o);
18return C(r.beta,s,a,t,i)}}multiplyAndAddUnsafe(e,t,r){let n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return w(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return a===lh||(e?e(E,this):A.wNAFCachedUnsafe(this,c).is0())}clearCofactor(){let{clearCofactor:e}=t;return a===lh?this:e?e(E,this):this.multiplyUnsafe(a)}toBytes(e=!0){return cv("isCompressed",e),this.assertValidity(),d(E,this,e)}toRawBytes(e=!0){return this.toBytes(e)}toHex(e=!0){return sN(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}E.BASE=new E(e.Gx,e.Gy,o.ONE),E.ZERO=new E(o.ZERO,o.ONE,o.ZERO),E.Fp=o,E.Fn=s;let x=s.BITS,A=(i=t.endo?Math.ceil(x/2):x,{constTimeNegate:cX,hasPrecomputes:e=>1!==c3(e),unsafeLadder(e,t,r=E.ZERO){let n=e;for(;t>cY;)t&cJ&&(r=r.add(n)),n=n.double(),t>>=cJ;return r},precomputeWindow(e,t){let{windows:r,windowSize:n}=c0(t,i),o=[],s=e,a=s;for(let e=0;e<r;e++){a=s,o.push(a);for(let e=1;e<n;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,t,r){let n=E.ZERO,o=E.BASE,s=c0(e,i);for(let e=0;e<s.windows;e++){let{nextN:i,offset:a,isZero:c,isNeg:l,isNegF:u,offsetF:d}=c1(r,e,s);r=i,c?o=o.add(cX(u,t[d])):n=n.add(cX(l,t[a]))}return c6(r),{p:n,f:o}},wNAFUnsafe(e,t,r,n=E.ZERO){let o=c0(e,i);for(let e=0;e<o.windows&&r!==cY;e++){let{nextN:i,offset:s,isZero:a,isNeg:c}=c1(r,e,o);if(r=i,!a){let e=t[s];n=n.add(c?e.negate():e)}}return c6(r),n},getPrecomputes(e,t,r){let n=c2.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),c2.set(t,n))),n},wNAFCached(e,t,r){let n=c3(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=c3(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,t){cQ(t,i),c5.set(e,t),c2.delete(e)}});return E}(t,r),n,r);return Object.assign({},i,{ProjectivePoint:i.Point,CURVE:e})})({...e,hash:t});return{...r(t),create:r}}let lw={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},lv={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},lC={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},lE=cK(lw.p),lx=cK(lv.p),lA=cK(lC.p),lS=lb({...lw,Fp:lE,lowS:!1},aa);lb({...lv,Fp:lx,lowS:!1},al),lb({...lC,Fp:lA,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},ac);let l_="base10",lI="base16",lk="base64pad",lO="base64url",lN="utf8";function lP(){return od(sU(32),lI)}function lT(e){return od(aa(ou(e,lI)),lI)}function lR(e){return od(aa(ou(e,lN)),lI)}function l$(e){return Number(od(e,l_))}function lD(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function lL(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;return t+"=".repeat(r)}function lM(e){if(2===l$(e.type))return od(nJ([e.type,e.sealed]),lk);if(1===l$(e.type)){if(typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");
18return od(nJ([e.type,e.senderPublicKey,e.iv,e.sealed]),lk)}return od(nJ([e.type,e.iv,e.sealed]),lk)}function lU(e){let t=ou((e.encoding||lk)===lO?lL(e.encoded):e.encoded,lk),r=t.slice(0,1);if(1===l$(r)){let e=t.slice(1,33),n=t.slice(33,45);return{type:r,sealed:t.slice(45),iv:n,senderPublicKey:e}}if(2===l$(r))return{type:r,sealed:t.slice(1),iv:sU(12)};let n=t.slice(1,13);return{type:r,sealed:t.slice(13),iv:n}}function lj(e){let t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function lB(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function lF(e){return e?.relay||{protocol:"irn"}}function lz(e){let t=oh[e];if(typeof t>"u")throw Error(`Relay Protocol not supported: ${e}`);return t}function lH(e){var t;if(!e.includes("wc:")){let t=oX(e);null!=t&&t.includes("wc:")&&(e=t)}let r=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,i=e.substring(0,r),o=e.substring(r+1,n).split("@"),s=new URLSearchParams("u">typeof n?e.substring(n):""),a={};s.forEach((e,t)=>{a[t]=e});let c="string"==typeof a.methods?a.methods.split(","):void 0;return{protocol:i,topic:(t=o[0]).startsWith("//")?t.substring(2):t,version:parseInt(o[1],10),symKey:a.symKey,relay:function(e,t="-"){let r={},n="relay"+t;return Object.keys(e).forEach(t=>{if(t.startsWith(n)){let i=t.replace(n,""),o=e[t];r[i]=o}}),r}(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function lW(e){let t=new URLSearchParams,r=function(e,t="-"){let r={};return Object.keys(e).forEach(n=>{e[n]&&(r["relay"+t+n]=e[n])}),r}(e.relay);Object.keys(r).sort().forEach(e=>{t.set(e,r[e])}),t.set("symKey",e.symKey),e.expiryTimestamp&&t.set("expiryTimestamp",e.expiryTimestamp.toString()),e.methods&&t.set("methods",e.methods.join(","));let n=t.toString();return`${e.protocol}:${e.topic}@${e.version}?${n}`}function lq(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}var lV=Object.defineProperty,lK=Object.defineProperties,lG=Object.getOwnPropertyDescriptors,lZ=Object.getOwnPropertySymbols,lY=Object.prototype.hasOwnProperty,lJ=Object.prototype.propertyIsEnumerable,lX=(e,t,r)=>t in e?lV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lQ=(e,t)=>{for(var r in t||(t={}))lY.call(t,r)&&lX(e,r,t[r]);if(lZ)for(var r of lZ(t))lJ.call(t,r)&&lX(e,r,t[r]);return e},l0=(e,t)=>lK(e,lG(t));function l1(e){let t=[];return e.forEach(e=>{let[r,n]=e.split(":");t.push(`${r}:${n}`)}),t}function l2(e){return e.includes(":")}function l5(e){return l2(e)?e.split(":")[0]:e}function l3(e){var t,r,n;let i={};if(!ut(e))return i;for(let[o,s]of Object.entries(e)){let e=l2(o)?[o]:s.chains,a=s.methods||[],c=s.events||[],l=l5(o);i[l]=l0(lQ({},i[l]),{chains:oV(e,null==(t=i[l])?void 0:t.chains),methods:oV(a,null==(r=i[l])?void 0:r.methods),events:oV(c,null==(n=i[l])?void 0:n.events)})}return i}function l6(e,t){let r=function(e){let t={};return e?.forEach(e=>{var r;let[n,i]=e.split(":");t[n]||(t[n]={accounts:[],chains:[],events:[],methods:[]}),t[n].accounts.push(e),null==(r=t[n].chains)||r.push(`${n}:${i}`)}),t}(t=t.map(e=>e.replace("did:pkh:","")));for(let[t,n]of Object.entries(r))n.methods?n.methods=oV(n.methods,e):n.methods=e,n.events=["chainChanged","accountsChanged"];return r}let l4={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},l8={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function l9(e,t){let{message:r,code:n}=l8[e];return{message:t?`${r} ${t}`:r,code:n}}function l7(e,t){let{message:r,code:n}=l4[e];return{message:t?`${r} ${t}`:r,code:n}}function ue(e,t){return!!Array.isArray(e)&&(!("u">typeof t)||!e.length||e.every(t))}function ut(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function ur(e){return typeof e>"u"}function un(e,t){return!!(t&&ur(e))||"string"==typeof e&&!!e.trim().length}function ui(e,t){return!!(t&&ur(e))||"number"==typeof e&&!isNaN(e)}function uo(e){return!!(un(e,!1)&&e.includes(":"))&&2===e.split(":").length}function us(e){let t=!0;return ue(e)?e.length&&(t=e.every(e=>un(e,!1))):t=!1,t}function ua(e,t){let r=null;
18return Object.values(e).forEach(e=>{var n;let i;if(r)return;let o=(n=`${t}, namespace`,i=null,us(e?.methods)?us(e?.events)||(i=l7("UNSUPPORTED_EVENTS",`${n}, events should be an array of strings or empty array for no events`)):i=l7("UNSUPPORTED_METHODS",`${n}, methods should be an array of strings or empty array for no methods`),i);o&&(r=o)}),r}function uc(e,t){let r=null;if(e&&ut(e)){let n;let i=ua(e,t);i&&(r=i);let o=(n=null,Object.values(e).forEach(e=>{var r,i;let o;if(n)return;let s=(r=e?.accounts,i=`${t} namespace`,o=null,ue(r)?r.forEach(e=>{o||function(e){if(un(e,!1)&&e.includes(":")){let t=e.split(":");if(3===t.length){let e=t[0]+":"+t[1];return!!t[2]&&uo(e)}}return!1}(e)||(o=l7("UNSUPPORTED_ACCOUNTS",`${i}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):o=l7("UNSUPPORTED_ACCOUNTS",`${i}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),o);s&&(n=s)}),n);o&&(r=o)}else r=l9("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function ul(e){return un(e.protocol,!0)}function uu(e){return"u">typeof e}function ud(e,t){return!(!uo(t)||!(function(e){let t=[];return Object.values(e).forEach(e=>{t.push(...l1(e.accounts))}),t})(e).includes(t))}function uh(e,t,r){let n=null,i=function(e){let t={};return Object.keys(e).forEach(r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach(n=>{t[n]={methods:e[r].methods,events:e[r].events}})}),t}(e),o=function(e){let t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{let n=l1(e[r].accounts);n?.forEach(n=>{t[n]={accounts:e[r].accounts.filter(e=>e.includes(`${n}:`)),methods:e[r].methods,events:e[r].events}})}}),t}(t),s=Object.keys(i),a=Object.keys(o),c=up(Object.keys(e)),l=up(Object.keys(t)),u=c.filter(e=>!l.includes(e));return u.length&&(n=l9("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
19      Required: ${u.toString()}
20      Received: ${Object.keys(t).toString()}`)),oL(s,a)||(n=l9("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
21      Required: ${s.toString()}
22      Approved: ${a.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(":")||n)return;let i=l1(t[e].accounts);i.includes(e)||(n=l9("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}
23        Required: ${e}
24        Approved: ${i.toString()}`))}),s.forEach(e=>{n||(oL(i[e].methods,o[e].methods)?oL(i[e].events,o[e].events)||(n=l9("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=l9("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))}),n}function up(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function uf(){let e=oT();return new Promise(t=>{switch(e){case ok.browser:t(oP()&&navigator?.onLine);break;case ok.reactNative:t(ug());break;case ok.node:default:t(!0)}})}async function ug(){if(oN()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo){let e=await (null==r.g?void 0:r.g.NetInfo.fetch());return e?.isConnected}return!0}let um={};class uy{static get(e){return um[e]}static set(e,t){um[e]=t}static delete(e){delete um[e]}}function ub(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}let uw="INTERNAL_ERROR",uv="SERVER_ERROR",uC=[-32700,-32600,-32601,-32602,-32603],uE={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[uw]:{code:-32603,message:"Internal error"},[uv]:{code:-32e3,message:"Server error"}};function ux(e){return Object.keys(uE).includes(e)?uE[e]:uE[uv]}function uA(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${r} RPC url at ${t}`):e}var uS=r(88497);
24function u_(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function uI(e=6){return BigInt(u_(e))}function uk(e,t,r){return{id:r||u_(),jsonrpc:"2.0",method:e,params:t}}function uO(e,t){return{id:e,jsonrpc:"2.0",result:t}}function uN(e,t,r){var n,i,o;return{id:e,jsonrpc:"2.0",error:void 0===(n=t)?ux(uw):("string"==typeof n&&(n=Object.assign(Object.assign({},ux(uv)),{message:n})),void 0!==r&&(n.data=r),i=n.code,uC.includes(i)&&(o=n.code,n=Object.values(uE).find(e=>e.code===o)||uE[uv]),n)}}class uP{}class uT extends uP{constructor(){super()}}class uR extends uT{constructor(e){super()}}function u$(e,t){let r=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function uD(e){return u$(e,"^https?:")}function uL(e){return u$(e,"^wss?:")}function uM(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function uU(e){return uM(e)&&"method"in e}function uj(e){return uM(e)&&(uB(e)||uF(e))}function uB(e){return"result"in e}function uF(e){return"error"in e}class uz extends uR{constructor(e){super(e),this.events=new b.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(uk(e.method,e.params||[],e.id||uI().toString()),t)}async requestStrict(e,t){return new Promise(async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,e=>{uF(e)?n(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){n(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),uj(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",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(),"string"==typeof e&&(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)}}let uH=()=>"u">typeof WebSocket||"u">typeof r.g&&"u">typeof r.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket,uW=e=>e.split("?")[0],uq="u">typeof WebSocket?WebSocket:"u">typeof r.g&&"u">typeof r.g.WebSocket?r.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:r(75e3);class uV{constructor(e){if(this.url=e,this.events=new b.EventEmitter,this.registering=!1,!uL(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}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 open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(Error("Connection already closed"));return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send((0,W.u)(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!uL(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>
24{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{let n=(0,uS.isReactNative)()?void 0:{rejectUnauthorized:!RegExp("wss?://localhost(:d{2,5})?").test(e)},i=new uq(e,[],n);uH()?i.onerror=e=>{r(this.emitError(e.error))}:i.on("error",e=>{r(this.emitError(e))}),i.onopen=()=>{this.onOpen(i),t(i)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?(0,W.D)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=uN(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return uA(e,uW(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${uW(this.url)}`));return this.events.emit("register_error",t),t}}var uK=r(55872).Buffer,uG=r(14224);let uZ="core",uY=`wc@2:${uZ}:`,uJ={logger:"error"},uX={database:":memory:"},uQ="client_ed25519_seed",u0=v.ONE_DAY,u1=v.SIX_HOURS,u2="wss://relay.walletconnect.org",u5={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",publish:"relayer_publish"},u3={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},u6="2.21.7",u4={link_mode:"link_mode",relay:"relay"},u8={inbound:"inbound",outbound:"outbound"},u9="WALLETCONNECT_LINK_MODE_APPS",u7={created:"subscription_created",deleted:"subscription_deleted",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},de=(v.FIVE_SECONDS,{wc_pairingDelete:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:v.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:v.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:v.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:v.ONE_DAY,prompt:!1,tag:0},res:{ttl:v.ONE_DAY,prompt:!1,tag:0}}}),dt={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},dr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},dn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},di="https://verify.walletconnect.org",ds=`${di}/v3`,da=["https://verify.walletconnect.com",di],dc={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal"},dl={no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_listener_not_found:"proposal_listener_not_found"},du={session_approve_started:"session_approve_started",session_namespaces_validation_success:"session_namespaces_validation_success",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session"},dd={no_internet_connection:"no_internet_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},dh={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"}
24,dp={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"};var df=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===c;)n++,t++;for(var o=(e.length-t)*l+1>>>0,s=new Uint8Array(o);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=o-1;(0!==u||d<i)&&-1!==h;h--,d++)u+=a*s[h]>>>0,s[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var p=o-i;p!==o&&0===s[p];)p++;for(var f=new Uint8Array(n+(o-p)),g=n;p!==o;)f[g++]=s[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*u+1>>>0,l=new Uint8Array(s);i!==o;){for(var d=t[i],h=0,p=s-1;(0!==d||h<n)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");n=h,i++}for(var f=s-n;f!==s&&0===l[f];)f++;for(var g=c.repeat(r);f<s;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:d,decode:function(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}}};let dg=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},dm=e=>new TextEncoder().encode(e),dy=e=>new TextDecoder().decode(e);class db{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class dw{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return dC(this,e)}}class dv{constructor(e){this.decoders=e}or(e){return dC(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let dC=(e,t)=>new dv({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class dE{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new db(e,t,r),this.decoder=new dw(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let dx=({name:e,prefix:t,encode:r,decode:n})=>new dE(e,t,r,n),dA=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=df(r,t);return dx({prefix:e,name:t,encode:n,decode:e=>dg(i(e))})},dS=(e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;let s=new Uint8Array(o*r/8|0),a=0,c=0,l=0;for(let t=0;t<o;++t){let o=i[e[t]];if(void 0===o)throw SyntaxError(`Non-${n} character`);c=c<<r|o,(a+=r)>=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return s},d_=(e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},dI=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>dx({prefix:t,name:e,encode:e=>d_(e,n,r),decode:t=>dS(t,n,r,e)});var dk=Object.freeze({__proto__:null,identity:dx({prefix:"\0",name:"identity",encode:e=>dy(e),decode:e=>dm(e)})}),dO=Object.freeze({__proto__:null,base2:dI({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),dN=Object.freeze({__proto__:null,base8:dI({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),dP=Object.freeze({__proto__:null,base10:dA({prefix:"9",name:"base10",alphabet:"0123456789"})}),dT=Object.freeze({__proto__:null,base16:dI({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:dI({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let dR=dI({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),d$=dI({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),dD=dI({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dL=dI({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),dM=dI({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),dU=dI({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var dj=Object.freeze({__proto__:null,base32:dR,base32upper:d$,base32pad:dD,base32padupper:dL,base32hex:dM,base32hexupper:dU,base32hexpad:dI({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:dI({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:dI({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),dB=Object.freeze({__proto__:null,base36:dA({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:dA({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),dF=Object.freeze({__proto__:null,base58btc:dA({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:dA({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let dz=dI({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
24+/",bitsPerChar:6});var dH=Object.freeze({__proto__:null,base64:dz,base64pad:dI({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:dI({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:dI({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let dW=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),dq=dW.reduce((e,t,r)=>(e[r]=t,e),[]),dV=dW.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var dK=Object.freeze({__proto__:null,base256emoji:dx({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=dq[t],"")},decode:function(e){let t=[];for(let r of e){let e=dV[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function dG(e,t){var r,n=0,t=t||0,i=0,o=t,s=e.length;do{if(o>=s)throw dG.bytes=0,RangeError("Could not decode varint");r=e[o++],n+=i<28?(127&r)<<i:(127&r)*Math.pow(2,i),i+=7}while(r>=128);return dG.bytes=o-t,n}var dZ=function e(t,r,n){r=r||[],n=n||0;for(var i=n;t>=2147483648;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r};let dY=(e,t,r=0)=>(dZ(e,t,r),t),dJ=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,dX=(e,t)=>{let r=t.byteLength,n=dJ(e),i=n+dJ(r),o=new Uint8Array(i+r);return dY(e,o,0),dY(r,o,n),o.set(t,i),new dQ(e,r,t,o)};
24class dQ{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let d0=({name:e,code:t,encode:r})=>new d1(e,t,r);class d1{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?dX(this.code,t):t.then(e=>dX(this.code,e))}throw Error("Unknown type, must be binary type")}}let d2=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var d5=Object.freeze({__proto__:null,sha256:d0({name:"sha2-256",code:18,encode:d2("SHA-256")}),sha512:d0({name:"sha2-512",code:19,encode:d2("SHA-512")})}),d3=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:dg,digest:e=>dX(0,dg(e))}});new TextEncoder,new TextDecoder;let d6={...dk,...dO,...dN,...dP,...dT,...dj,...dB,...dF,...dH,...dK};function d4(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function d8(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...d5,...d3});let d9=d8("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),d7=d8("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?d4(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),he={utf8:d9,"utf-8":d9,hex:d6.base16,latin1:d7,ascii:d7,binary:d7,...d6};var ht=Object.defineProperty,hr=(e,t,r)=>t in e?ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hn=(e,t,r)=>hr(e,"symbol"!=typeof t?t+"":t,r);class hi{constructor(e,t){this.core=e,this.logger=t,hn(this,"keychain",new Map),hn(this,"name","keychain"),hn(this,"version","0.3"),hn(this,"initialized",!1),hn(this,"storagePrefix",uY),hn(this,"init",async()=>{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}}),hn(this,"has",e=>(this.isInitialized(),this.keychain.has(e))),hn(this,"set",async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()}),hn(this,"get",e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=l9("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}),hn(this,"del",async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()}),this.core=e,this.logger=(0,ee.Ep)(t,this.name)}get context(){return(0,ee.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,oM(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?oU(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}}var ho=Object.defineProperty,hs=(e,t,r)=>t in e?ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ha=(e,t,r)=>hs(e,"symbol"!=typeof t?t+"":t,r);class hc{constructor(e,t,r){this.core=e,this.logger=t,ha(this,"name","crypto"),ha(this,"keychain"),ha(this,"randomSessionIdentifier",lP()),ha(this,"initialized",!1),ha(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),ha(this,"hasKeys",e=>(this.isInitialized(),this.keychain.has(e))),ha(this,"getClientId",async()=>(this.isInitialized(),rP(rR(await this.getClientSeed()).publicKey))),ha(this,"generateKeyPair",()=>{this.isInitialized();let e=function(){let e=la.utils.randomPrivateKey(),t=la.getPublicKey(e);return{privateKey:od(e,lI),publicKey:od(t,lI)}}();return this.setPrivateKey(e.publicKey,e.privateKey)}),ha(this,"signJWT",async e=>{this.isInitialized();let t=rR(await this.getClientSeed()),r=this.randomSessionIdentifier;return await r$(r,e,u0,t)}),ha(this,"generateSharedKey",(e,t,r)=>{var n;this.isInitialized();let i=(n=this.getPrivateKey(e),od(cy(aa,la.getSharedSecret(ou(n,lI),ou(t,lI)),void 0,void 0,32),lI));return this.setSymKey(i,r)}),ha(this,"setSymKey",async(e,t)=>{this.isInitialized();let r=t||lT(e);return await this.keychain.set(r,e),r}),ha(this,"deleteKeyPair",async e=>{this.isInitialized(),await this.keychain.del(e)}),ha(this,"deleteSymKey",async e=>{this.isInitialized(),await this.keychain.del(e)}),ha(this,"encode",async(e,t,r)=>{this.isInitialized();let n=lj(r),i=(0,W.u)(t);
24if(2===n.type)return function(e,t){let r=ou("2",l_),n=sU(12),i=lM({type:r,sealed:ou(e,lN),iv:n});return t===lO?lD(i):i}(i,r?.encoding);if(lB(n)){let t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}let o=this.getSymKey(e),{type:s,senderPublicKey:a}=n;return function(e){var t;let r=(t="u">typeof e.type?e.type:0,ou(`${t}`,l_));if(1===l$(r)&&typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");let n="u">typeof e.senderPublicKey?ou(e.senderPublicKey,lI):void 0,i="u">typeof e.iv?ou(e.iv,lI):sU(12),o=lM({type:r,sealed:ch(ou(e.symKey,lI),i).encrypt(ou(e.message,lN)),iv:i,senderPublicKey:n});return e.encoding===lO?lD(o):o}({type:s,symKey:o,message:i,senderPublicKey:a,encoding:r?.encoding})}),ha(this,"decode",async(e,t,r)=>{this.isInitialized();let n=function(e,t){let r=lU({encoded:e,encoding:t?.encoding});return lj({type:l$(r.type),senderPublicKey:"u">typeof r.senderPublicKey?od(r.senderPublicKey,lI):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(2===n.type){let e=function(e,t){let{sealed:r}=lU({encoded:e,encoding:t});return od(r,lN)}(t,r?.encoding);return(0,W.D)(e)}if(lB(n)){let t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}try{let n=this.getSymKey(e),i=function(e){let t=ou(e.symKey,lI),{sealed:r,iv:n}=lU({encoded:e.encoded,encoding:e.encoding}),i=ch(t,n).decrypt(r);if(null===i)throw Error("Failed to decrypt");return od(i,lN)}({symKey:n,encoded:t,encoding:r?.encoding});return(0,W.D)(i)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}}),ha(this,"getPayloadType",(e,t=lk)=>l$(lU({encoded:e,encoding:t}).type)),ha(this,"getPayloadSenderPublicKey",(e,t=lk)=>{let r=lU({encoded:e,encoding:t});return r.senderPublicKey?od(r.senderPublicKey,lI):void 0}),this.core=e,this.logger=(0,ee.Ep)(t,this.name),this.keychain=r||new hi(this.core,this.logger)}get context(){return(0,ee.Fd)(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(uQ)}catch{e=lP(),await this.keychain.set(uQ,e)}return function(e,t="utf8"){let r=he[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?d4(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}}var hl=Object.defineProperty,hu=Object.defineProperties,hd=Object.getOwnPropertyDescriptors,hh=Object.getOwnPropertySymbols,hp=Object.prototype.hasOwnProperty,hf=Object.prototype.propertyIsEnumerable,hg=(e,t,r)=>t in e?hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hm=(e,t)=>{for(var r in t||(t={}))hp.call(t,r)&&hg(e,r,t[r]);if(hh)for(var r of hh(t))hf.call(t,r)&&hg(e,r,t[r]);return e},hy=(e,t)=>hu(e,hd(t)),hb=(e,t,r)=>hg(e,"symbol"!=typeof t?t+"":t,r);class hw extends el{constructor(e,t){super(e,t),this.logger=e,this.core=t,hb(this,"messages",new Map),hb(this,"messagesWithoutClientAck",new Map),hb(this,"name","messages"),hb(this,"version","0.3"),hb(this,"initialized",!1),hb(this,"storagePrefix",uY),hb(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e);let t=await this.getRelayerMessagesWithoutClientAck();"u">typeof t&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}}),hb(this,"set",async(e,t,r)=>{this.isInitialized();let n=lR(t),i=this.messages.get(e);if(typeof i>"u"&&(i={}),"u">typeof i[n])return n;if(i[n]=t,this.messages.set(e,i),r===u8.inbound){let r=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,hy(hm({},r),{[n]:t}))}return await this.persist(),n}),hb(this,"get",e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t}),hb(this,"getWithoutAck",e=>{this.isInitialized();let t={};for(let r of e){let e=this.messagesWithoutClientAck.get(r)||{};t[r]=Object.values(e)}return t}),hb(this,"has",(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[lR(t)])),hb(this,"ack",async(e,t)=>{this.isInitialized();let r=this.messagesWithoutClientAck.get(e);if(typeof r>"u")return;let n=lR(t);delete r[n],0===Object.keys(r).length?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,r),await this.persist()}),hb(this,"del",async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()}),this.logger=(0,ee.Ep)(e,this.name),this.core=t}
24get context(){return(0,ee.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,oM(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,oM(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?oU(e):void 0}async getRelayerMessagesWithoutClientAck(){let e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return"u">typeof e?oU(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}}var hv=Object.defineProperty,hC=Object.defineProperties,hE=Object.getOwnPropertyDescriptors,hx=Object.getOwnPropertySymbols,hA=Object.prototype.hasOwnProperty,hS=Object.prototype.propertyIsEnumerable,h_=(e,t,r)=>t in e?hv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hI=(e,t)=>{for(var r in t||(t={}))hA.call(t,r)&&h_(e,r,t[r]);if(hx)for(var r of hx(t))hS.call(t,r)&&h_(e,r,t[r]);return e},hk=(e,t)=>hC(e,hE(t)),hO=(e,t,r)=>h_(e,"symbol"!=typeof t?t+"":t,r);class hN extends eu{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,hO(this,"events",new b.EventEmitter),hO(this,"name","publisher"),hO(this,"queue",new Map),hO(this,"publishTimeout",(0,v.toMiliseconds)(v.ONE_MINUTE)),hO(this,"initialPublishTimeout",(0,v.toMiliseconds)(15*v.ONE_SECOND)),hO(this,"needsTransportRestart",!1),hO(this,"publish",async(e,t,r)=>{var n,i,o,s,a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});let c=r?.ttl||u1,l=r?.prompt||!1,u=r?.tag||0,d=r?.id||uI().toString(),h=lz(lF().protocol),p={id:d,method:r?.publishMethod||h.publish,params:hI({topic:e,message:t,ttl:c,prompt:l,tag:u,attestation:r?.attestation},r?.tvf&&{tvf:r.tvf})},f=`Failed to publish payload, please try again. id:${d} tag:${u}`;try{ur(null==(n=p.params)?void 0:n.prompt)&&(null==(i=p.params)||delete i.prompt),ur(null==(o=p.params)?void 0:o.tag)&&(null==(s=p.params)||delete s.tag);let a=new Promise(async e=>{let t=({id:r})=>{var n;(null==(n=p.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(u5.publish,t),e())};this.relayer.events.on(u5.publish,t);let n=oB(new Promise((e,t)=>{this.rpcPublish(p,r).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${d} tag:${u}`);try{await n,this.events.removeListener(u5.publish,t)}catch(e){this.queue.set(d,{request:p,opts:r,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:d,topic:e,message:t,opts:r}}),await oB(a,this.publishTimeout,f)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(a=r?.internal)&&a.throwOnFailedPublish)throw e}finally{this.queue.delete(d)}}),hO(this,"publishCustom",async e=>{var t,r,n,i,o;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:e});let{payload:s,opts:a={}}=e,{attestation:c,tvf:l,publishMethod:u,prompt:d,tag:h,ttl:p=v.FIVE_MINUTES}=a,f=a.id||uI().toString(),g=lz(lF().protocol),m=u||g.publish,y={id:f,method:m,params:hI(hk(hI({},s),{ttl:p,prompt:d,tag:h,attestation:c}),l)},b=`Failed to publish custom payload, please try again. id:${f} tag:${h}`;try{ur(null==(t=y.params)?void 0:t.prompt)&&(null==(r=y.params)||delete r.prompt),ur(null==(n=y.params)?void 0:n.tag)&&(null==(i=y.params)||delete i.tag);let e=new Promise(async e=>{let t=({id:r})=>{var n;(null==(n=y.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(u5.publish,t),e())};this.relayer.events.on(u5.publish,t);let r=oB(new Promise((e,t)=>
24{this.rpcPublish(y,a).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${m} id:${f} tag:${h}`);try{await r,this.events.removeListener(u5.publish,t)}catch(e){this.queue.set(f,{request:y,opts:a,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,payload:s,opts:a}}),await oB(e,this.publishTimeout,b)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(o=a?.internal)&&o.throwOnFailedPublish)throw e}finally{this.queue.delete(f)}}),hO(this,"on",(e,t)=>{this.events.on(e,t)}),hO(this,"once",(e,t)=>{this.events.once(e,t)}),hO(this,"off",(e,t)=>{this.events.off(e,t)}),hO(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.relayer=e,this.logger=(0,ee.Ep)(t,this.name),this.registerEventListeners()}get context(){return(0,ee.Fd)(this.logger)}async rpcPublish(e,t){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});let r=await this.relayer.request(e);return this.relayer.events.emit(u5.publish,hI(hI({},e),t)),this.logger.debug("Successfully Published Payload"),r}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{var r;let n=e.attempt+1;this.queue.set(t,hk(hI({},e),{attempt:n})),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${null==(r=e.request.params)?void 0:r.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(A,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(u5.connection_stalled);return}this.checkQueue()}),this.relayer.on(u5.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}var hP=Object.defineProperty,hT=(e,t,r)=>t in e?hP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hR=(e,t,r)=>hT(e,"symbol"!=typeof t?t+"":t,r);class h${constructor(){hR(this,"map",new Map),hR(this,"set",(e,t)=>{let r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])}),hR(this,"get",e=>this.map.get(e)||[]),hR(this,"exists",(e,t)=>this.get(e).includes(t)),hR(this,"delete",(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;let r=this.get(e);if(!this.exists(e,t))return;let n=r.filter(e=>e!==t);if(!n.length){this.map.delete(e);return}this.map.set(e,n)}),hR(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var hD=Object.defineProperty,hL=Object.defineProperties,hM=Object.getOwnPropertyDescriptors,hU=Object.getOwnPropertySymbols,hj=Object.prototype.hasOwnProperty,hB=Object.prototype.propertyIsEnumerable,hF=(e,t,r)=>t in e?hD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hz=(e,t)=>{for(var r in t||(t={}))hj.call(t,r)&&hF(e,r,t[r]);if(hU)for(var r of hU(t))hB.call(t,r)&&hF(e,r,t[r]);return e},hH=(e,t)=>hL(e,hM(t)),hW=(e,t,r)=>hF(e,"symbol"!=typeof t?t+"":t,r);class hq extends ep{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,hW(this,"subscriptions",new Map),hW(this,"topicMap",new h$),hW(this,"events",new b.EventEmitter),hW(this,"name","subscription"),hW(this,"version","0.3"),hW(this,"pending",new Map),hW(this,"cached",[]),hW(this,"initialized",!1),hW(this,"storagePrefix",uY),hW(this,"subscribeTimeout",(0,v.toMiliseconds)(v.ONE_MINUTE)),hW(this,"initialSubscribeTimeout",(0,v.toMiliseconds)(15*v.ONE_SECOND)),hW(this,"clientId"),hW(this,"batchSubscribeTopicsLimit",500),hW(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),hW(this,"subscribe",async(e,t)=>{var r;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let n=lF(t),i={topic:e,relay:n,transportType:t?.transportType};null!=(r=t?.internal)&&r.skipSubscribe||this.pending.set(e,i);let o=await this.rpcSubscribe(e,n,t);return"string"==typeof o&&(this.onSubscribe(o,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),o}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}}),hW(this,"unsubscribe",async(e,t)=>{this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)}),hW(this,"isSubscribed",e=>new Promise(t=>{t(this.topicMap.topics.includes(e))})),hW(this,"isKnownTopic",e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))})),hW(this,"on",(e,t)=>{this.events.on(e,t)}),hW(this,"once",(e,t)=>{this.events.once(e,t)}),hW(this,"off",(e,t)=>{this.events.off(e,t)}),hW(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),hW(this,"start",async()=>{await this.onConnect()}),hW(this,"stop",async()=>{await this.onDisconnect()}),hW(this,"restart",async()=>
24{await this.restore(),await this.onRestart()}),hW(this,"checkPending",async()=>{if(0===this.pending.size&&(!this.initialized||!this.relayer.connected))return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}),hW(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(A,async()=>{await this.checkPending()}),this.events.on(u7.created,async e=>{let t=u7.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(u7.deleted,async e=>{let t=u7.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}),this.relayer=e,this.logger=(0,ee.Ep)(t,this.name),this.clientId=""}get context(){return(0,ee.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{let n=lF(r);await this.restartToComplete({topic:e,id:t,relay:n}),await this.rpcUnsubscribe(e,t,n);let i=l7("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r){var n,i;
24let o=await this.getSubscriptionId(e);if(null!=(n=r?.internal)&&n.skipSubscribe)return o;r&&r?.transportType!==u4.relay||await this.restartToComplete({topic:e,id:e,relay:t});let s={method:lz(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});let a=null==(i=r?.internal)?void 0:i.throwOnFailedPublish;try{if(r?.transportType===u4.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(e=>this.logger.warn(e))},(0,v.toMiliseconds)(v.ONE_SECOND)),o;let t=new Promise(async t=>{let r=n=>{n.topic===e&&(this.events.removeListener(u7.created,r),t(n.id))};this.events.on(u7.created,r);try{let n=await oB(new Promise((e,t)=>{this.relayer.request(s).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(u7.created,r),t(n)}catch{}}),n=await oB(t,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!n&&a)throw Error(`Subscribing to ${e} failed, please try again`);return n?o:null}catch(e){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(u5.connection_stalled),a)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return;let t={method:lz(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{await await oB(new Promise(e=>{this.relayer.request(t).catch(e=>this.logger.warn(e)).then(e)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(u5.connection_stalled)}}async rpcBatchFetchMessages(e){let t;if(!e.length)return;let r={method:lz(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{t=await await oB(new Promise((e,t)=>{this.relayer.request(r).catch(e=>{this.logger.warn(e),t(e)}).then(e)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(u5.connection_stalled)}return t}rpcUnsubscribe(e,t,r){let n={method:lz(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,hH(hz({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,hz({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,hz({},t)),this.topicMap.set(t.topic,e),this.events.emit(u7.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=l9("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(u7.deleted,hH(hz({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(u7.sync)}async onRestart(){if(this.cached.length){let e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<t;r++){let t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(u7.resubscribed)}
24async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(e=>{var t;return e.topic===(null==(t=this.subscriptions.get(e.id))?void 0:t.topic)})){let{message:e}=l9("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async e=>hH(hz({},e),{id:await this.getSubscriptionId(e.topic)})))))}async batchFetchMessages(e){var t;if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(await (t=(0,v.toMiliseconds)(v.ONE_SECOND),new Promise(e=>setTimeout(e,t))),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(e){this.relayer.connected||this.relayer.connecting||(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return lR(e+await this.getClientId())}}var hV=Object.defineProperty,hK=Object.getOwnPropertySymbols,hG=Object.prototype.hasOwnProperty,hZ=Object.prototype.propertyIsEnumerable,hY=(e,t,r)=>t in e?hV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hJ=(e,t)=>{for(var r in t||(t={}))hG.call(t,r)&&hY(e,r,t[r]);if(hK)for(var r of hK(t))hZ.call(t,r)&&hY(e,r,t[r]);return e},hX=(e,t,r)=>hY(e,"symbol"!=typeof t?t+"":t,r);class hQ extends ed{constructor(e){super(e),hX(this,"protocol","wc"),hX(this,"version",2),hX(this,"core"),hX(this,"logger"),hX(this,"events",new b.EventEmitter),hX(this,"provider"),hX(this,"messages"),hX(this,"subscriber"),hX(this,"publisher"),hX(this,"name","relayer"),hX(this,"transportExplicitlyClosed",!1),hX(this,"initialized",!1),hX(this,"connectionAttemptInProgress",!1),hX(this,"relayUrl"),hX(this,"projectId"),hX(this,"packageName"),hX(this,"bundleId"),hX(this,"hasExperiencedNetworkDisruption",!1),hX(this,"pingTimeout"),hX(this,"heartBeatTimeout",(0,v.toMiliseconds)(v.THIRTY_SECONDS+v.FIVE_SECONDS)),hX(this,"reconnectTimeout"),hX(this,"connectPromise"),hX(this,"reconnectInProgress",!1),hX(this,"requestsInFlight",[]),hX(this,"connectTimeout",(0,v.toMiliseconds)(15*v.ONE_SECOND)),hX(this,"request",async e=>{var t,r;this.logger.debug("Publishing Request Payload");let n=e.id||uI().toString();await this.toEstablishConnection();try{this.logger.trace({id:n,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - publishing...");let i=`${n}:${(null==(r=e.params)?void 0:r.tag)||""}`;this.requestsInFlight.push(i);let o=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==i),o}catch(e){throw this.logger.debug(`Failed to Publish Request: ${n}`),e}}),hX(this,"resetPingTimeout",()=>{oO()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,r,n;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),null==(n=null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.terminate)||n.call(r)}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))}),hX(this,"onPayloadHandler",e=>{this.onProviderPayload(e),this.resetPingTimeout()}),hX(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected \uD83D\uDEDC"),this.startPingTimeout(),this.events.emit(u5.connect)}),hX(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected \uD83D\uDED1"),this.requestsInFlight=[],this.onProviderDisconnect()}),hX(this,"onProviderErrorHandler",e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(u5.error,e),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),hX(this,"registerProviderListeners",()=>{this.provider.on(u3.payload,this.onPayloadHandler),this.provider.on(u3.connect,this.onConnectHandler),this.provider.on(u3.disconnect,this.onDisconnectHandler),this.provider.on(u3.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger="u">typeof e.logger&&"string"!=typeof e.logger?(0,ee.Ep)(e.logger,this.name):(0,ee.gw)((0,ee.jI)({level:e.logger||"error"})),this.messages=new hw(this.logger,e.core),this.subscriber=new hq(this,this.logger),this.publisher=new hN(this,this.logger),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||u2,oN()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)&&(null==r.g?void 0:r.g.Platform.OS)==="android"?this.packageName=oR():oN()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)&&(null==r.g?void 0:r.g.Platform.OS)==="ios"&&(this.bundleId=oR()),this.provider={}}
24async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return(0,ee.Fd)(this.logger)}get connected(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===1}get connecting(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===0||void 0!==this.connectPromise}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:u4.relay},u8.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){var r,n,i;this.isInitialized(),null!=t&&t.transportType&&t?.transportType!=="relay"||await this.toEstablishConnection();let o=typeof(null==(r=t?.internal)?void 0:r.throwOnFailedPublish)>
24"u"||(null==(n=t?.internal)?void 0:n.throwOnFailedPublish),s=(null==(i=this.subscriber.topicMap.get(e))?void 0:i[0])||"",a,c=t=>{t.topic===e&&(this.subscriber.off(u7.created,c),a())};return await Promise.all([new Promise(e=>{a=e,this.subscriber.on(u7.created,c)}),new Promise(async(r,n)=>{s=await this.subscriber.subscribe(e,hJ({internal:{throwOnFailedPublish:o}},t)).catch(e=>{o&&n(e)})||s,r()})]),s}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}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 transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await oB(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(t,r)=>{await this.connect(e).then(t).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await uf())throw Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);for(let e of(this.logger.debug(`Batch of ${t.length} message events sorted`),t))try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,"Error while processing batch message event: "+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:r}=e;if(!t.sessionExists){let e=oH(v.FIVE_MINUTES);await this.core.pairing.pairings.set(r,{topic:r,expiry:e,relay:{protocol:"irn"},active:!1})}this.events.emit(u5.message,e),await this.recordMessageEvent(e,u8.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise(async(e,t)=>{let r=()=>{t(Error("Connection interrupted while trying to connect"))};this.provider.once(u3.disconnect,r),await oB(new Promise((e,t)=>{this.provider.connect().then(e).catch(t)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{this.provider.off(u3.disconnect,r),clearTimeout(this.reconnectTimeout)}),await new Promise(async(e,r)=>{let n=()=>{t(Error("Connection interrupted while trying to subscribe"))};this.provider.once(u3.disconnect,n),await this.subscriber.start().then(e).catch(r).finally(()=>{this.provider.off(u3.disconnect,n)})}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){await this.subscriber.stop(),this.logger.warn({},e.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,(0,v.toMiliseconds)(1*t))),t++}}startPingTimeout(){var e,t,r,n,i;if(oO())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(i=null==(n=null==(r=this.provider)?void 0:r.connection)?void 0:n.socket)||i.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new uz(new uV(function({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:s,bundleId:a,packageName:c}){let l=r.split("?"),u=oD(e,t,n),d=function(e,t){let r=new URLSearchParams(e);for(let e of Object.keys(t).sort())if(t.hasOwnProperty(e)){let n=t[e];void 0!==n&&r.set(e,n)}return r.toString()}(l[1]||"",{auth:i,ua:u,projectId:o,useOnCloseEvent:s||void 0,packageName:c||void 0,bundleId:a||void 0});return l[0]+"?"+d}({sdkVersion:u6,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){let{topic:r,message:n}=e;await this.messages.set(r,n,t)}async shouldIgnoreMessageEvent(e){let{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;let n=this.messages.has(t,r);return n&&this.logger.warn(`Ignoring duplicate message: ${r}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),uU(e)){if(!e.method.endsWith("_subscription"))return;let t=e.params,{topic:r,message:n,publishedAt:i,attestation:o}=t.data,s={topic:r,message:n,publishedAt:i,transportType:u4.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(hJ({type:"event",event:t.id}
24,s)),this.events.emit(t.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else uj(e)&&this.events.emit(u5.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,u8.inbound),this.events.emit(u5.message,e))}async acknowledgePayload(e){let t=uO(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(u3.payload,this.onPayloadHandler),this.provider.off(u3.connect,this.onConnectHandler),this.provider.off(u3.disconnect,this.onDisconnectHandler),this.provider.off(u3.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await uf();(function(e){switch(oT()){case ok.browser:!oN()&&oP()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)));break;case ok.reactNative:oN()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener(t=>e(t?.isConnected));case ok.node:}})(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(A,async()=>{var e;if(!this.transportExplicitlyClosed&&!this.connected&&(!(oP()&&(0,rq.getDocument)())||(null==(e=(0,rq.getDocument)())?void 0:e.visibilityState)==="visible"))try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(u5.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,v.toMiliseconds)(.1)))))}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}}function h0(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function h1(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let h2="[object Arguments]",h5="[object Object]";function h3(){}function h6(e){if(!e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}var h4=Object.defineProperty,h8=Object.getOwnPropertySymbols,h9=Object.prototype.hasOwnProperty,h7=Object.prototype.propertyIsEnumerable,pe=(e,t,r)=>t in e?h4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pt=(e,t)=>{for(var r in t||(t={}))h9.call(t,r)&&pe(e,r,t[r]);if(h8)for(var r of h8(t))h7.call(t,r)&&pe(e,r,t[r]);return e},pr=(e,t,r)=>pe(e,"symbol"!=typeof t?t+"":t,r);class pn extends eh{constructor(e,t,r,n=uY,i){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,pr(this,"map",new Map),pr(this,"version","0.3"),pr(this,"cached",[]),pr(this,"initialized",!1),pr(this,"getKey"),pr(this,"storagePrefix",uY),pr(this,"recentlyDeleted",[]),pr(this,"recentlyDeletedLimit",200),pr(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{var t;this.getKey&&null!==e&&!ur(e)?this.map.set(this.getKey(e),e):(null==(t=e?.proposer)?void 0:t.publicKey)?this.map.set(e.id,e):e?.topic&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)}),pr(this,"set",async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())}),pr(this,"get",e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e))),pr(this,"getAll",e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>(function e(t,r,n,i,o,s,a){let c=a(t,r,n,i,o,s);if(void 0!==c)return c;if(typeof t==typeof r)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===r;case"number":return t===r||Object.is(t,r)}return function t(r,n,i,o){if(Object.is(r,n))return!0;let s=h1(r),a=h1(n);
24if(s===h2&&(s=h5),a===h2&&(a=h5),s!==a)return!1;switch(s){case"[object String]":return r.toString()===n.toString();case"[object Number]":{let e=r.valueOf(),t=n.valueOf();return e===t||Number.isNaN(e)&&Number.isNaN(t)}case"[object Boolean]":case"[object Date]":case"[object Symbol]":return Object.is(r.valueOf(),n.valueOf());case"[object RegExp]":return r.source===n.source&&r.flags===n.flags;case"[object Function]":return r===n}let c=(i=i??new Map).get(r),l=i.get(n);if(null!=c&&null!=l)return c===n;i.set(r,n),i.set(n,r);try{switch(s){case"[object Map]":if(r.size!==n.size)return!1;for(let[t,s]of r.entries())if(!n.has(t)||!e(s,n.get(t),t,r,n,i,o))return!1;return!0;case"[object Set]":{if(r.size!==n.size)return!1;let t=Array.from(r.values()),s=Array.from(n.values());for(let a=0;a<t.length;a++){let c=t[a],l=s.findIndex(t=>e(c,t,void 0,r,n,i,o));if(-1===l)return!1;s.splice(l,1)}return!0}case"[object Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":case"[object BigUint64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object BigInt64Array]":case"[object Float32Array]":case"[object Float64Array]":if("u">typeof uK&&uK.isBuffer(r)!==uK.isBuffer(n)||r.length!==n.length)return!1;for(let t=0;t<r.length;t++)if(!e(r[t],n[t],t,r,n,i,o))return!1;return!0;case"[object ArrayBuffer]":return r.byteLength===n.byteLength&&t(new Uint8Array(r),new Uint8Array(n),i,o);case"[object DataView]":return r.byteLength===n.byteLength&&r.byteOffset===n.byteOffset&&t(new Uint8Array(r),new Uint8Array(n),i,o);case"[object Error]":return r.name===n.name&&r.message===n.message;case h5:{if(!(t(r.constructor,n.constructor,i,o)||h6(r)&&h6(n)))return!1;let s=[...Object.keys(r),...h0(r)],a=[...Object.keys(n),...h0(n)];if(s.length!==a.length)return!1;for(let t=0;t<s.length;t++){let a=s[t],c=r[a];if(!Object.hasOwn(n,a))return!1;let l=n[a];if(!e(c,l,a,r,n,i,o))return!1}return!0}default:return!1}}finally{i.delete(r),i.delete(n)}}(t,r,s,a)})(t[r],e[r],void 0,void 0,void 0,void 0,h3))):this.values)),pr(this,"update",async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let r=pt(pt({},this.getData(e)),t);this.map.set(e,r),await this.persist()}),pr(this,"delete",async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())}),this.logger=(0,ee.Ep)(t,this.name),this.storagePrefix=n,this.getKey=i}get context(){return(0,ee.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=l9("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=l9("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=l9("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}}var pi=Object.defineProperty,po=(e,t,r)=>t in e?pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ps=(e,t,r)=>po(e,"symbol"!=typeof t?t+"":t,r);class pa{constructor(e,t){this.core=e,this.logger=t,ps(this,"name","pairing"),ps(this,"version","0.3"),ps(this,"events",new(w())),ps(this,"pairings"),ps(this,"initialized",!1),ps(this,"storagePrefix",uY),ps(this,"ignoredPayloadTypes",[1]),ps(this,"registeredMethods",[]),ps(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),ps(this,"register",({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]}),ps(this,"create",async e=>{this.isInitialized();let t=lP(),r=await this.core.crypto.setSymKey(t),n=oH(v.FIVE_MINUTES),i={protocol:"irn"},o={topic:r,expiry:n,relay:i,active:!1,methods:e?.methods},s=lW({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:i,expiryTimestamp:n,methods:e?.methods});return this.events.emit(dt.create,o),this.core.expirer.set(r,n),await this.pairings.set(r,o),await this.core.relayer.subscribe(r,{transportType:e?.transportType,internal:e?.internal}),{topic:r,uri:s}}),ps(this,"pair",async e=>{let t;this.isInitialized();let r=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[dc.pairing_started]}});this.isValidPair(e,r);let{topic:n,symKey:i,relay:o,expiryTimestamp:s,methods:a}
24=lH(e.uri);if(r.props.properties.topic=n,r.addTrace(dc.pairing_uri_validation_success),r.addTrace(dc.pairing_uri_not_expired),this.pairings.keys.includes(n)){if(t=this.pairings.get(n),r.addTrace(dc.existing_pairing),t.active)throw r.setError(dl.active_pairing_already_exists),Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);r.addTrace(dc.pairing_not_expired)}let c=s||oH(v.FIVE_MINUTES),l={topic:n,relay:o,expiry:c,active:!1,methods:a};this.core.expirer.set(n,c),await this.pairings.set(n,l),r.addTrace(dc.store_new_pairing),e.activatePairing&&await this.activate({topic:n}),this.events.emit(dt.create,l),r.addTrace(dc.emit_inactive_pairing),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(i,n),r.addTrace(dc.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{r.setError(dl.no_internet_connection)}try{await this.core.relayer.subscribe(n,{relay:o})}catch(e){throw r.setError(dl.subscribe_pairing_topic_failure),e}return r.addTrace(dc.subscribe_pairing_topic_success),l}),ps(this,"activate",async({topic:e})=>{this.isInitialized();let t=oH(v.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})}),ps(this,"ping",async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn("ping() is deprecated and will be removed in the next major release.");let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:i}=oj();this.events.once(oq("pairing_ping",e),({error:e})=>{e?i(e):n()}),await r()}}),ps(this,"updateExpiry",async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})}),ps(this,"updateMetadata",async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})}),ps(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),ps(this,"disconnect",async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",l7("USER_DISCONNECTED")),await this.deletePairing(t))}),ps(this,"formatUriFromPairing",e=>{this.isInitialized();let{topic:t,relay:r,expiry:n,methods:i}=e,o=this.core.crypto.keychain.get(t);return lW({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:o,relay:r,expiryTimestamp:n,methods:i})}),ps(this,"sendRequest",async(e,t,r)=>{let n=uk(t,r),i=await this.core.crypto.encode(e,n),o=de[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,i,o),n.id}),ps(this,"sendResult",async(e,t,r)=>{let n=uO(e,r),i=await this.core.crypto.encode(t,n),o=de[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(n)}),ps(this,"sendError",async(e,t,r)=>{let n=uN(e,r),i=await this.core.crypto.encode(t,n),o=(await this.core.history.get(t,e)).request.method,s=de[o]?de[o].res:de.unregistered_method.res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)}),ps(this,"deletePairing",async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,l7("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])}),ps(this,"cleanup",async()=>{let e=this.pairings.getAll().filter(e=>oW(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))}),ps(this,"onRelayEventRequest",async e=>{let{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return await this.onPairingPingRequest(t,r);case"wc_pairingDelete":return await this.onPairingDeleteRequest(t,r);default:return await this.onUnknownRpcMethodRequest(t,r)}}),ps(this,"onRelayEventResponse",async e=>{let{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)}),ps(this,"onPairingPingRequest",async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(dt.ping,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),ps(this,"onPairingPingResponse",(e,t)=>{let{id:r}=t;setTimeout(()=>{uB(t)?this.events.emit(oq("pairing_ping",r),{}):uF(t)&&this.events.emit(oq("pairing_ping",r),{error:t.error})},500)}),ps(this,"onPairingDeleteRequest",async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(dt.delete,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),ps(this,"onUnknownRpcMethodRequest",async(e,t)=>{let{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;let t=l7("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),ps(this,"onUnknownRpcMethodResponse",e=>{this.registeredMethods.includes(e)||this.logger.error(l7("WC_METHOD_UNSUPPORTED",e))}),ps(this,"isValidPair",(e,t)=>{var r;if(!uu(e)){let{message:r}=l9("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(dl.malformed_pairing_uri),Error(r)}if(!function(e){function t(e){try{return"u">typeof new URL(e)}catch{return!1}}try{if(un(e,!1)){if(t(e))return!0;let r=oX(e);return t(r)}}catch{}return!1}(e.uri)){let{message:r}=l9("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(dl.malformed_pairing_uri),Error(r)}let n=lH(e?.uri);if(!(null!=(r=n?.relay)&&r.protocol)){let{message:e}=l9("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(dl.malformed_pairing_uri),Error(e)}if(!(null!=n&&n.symKey)){let{message:e}=l9("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(dl.malformed_pairing_uri),Error(e)}if(null!=n&&n.expiryTimestamp&&(0,v.toMiliseconds)(n?.expiryTimestamp)<Date.now()){t.setError(dl.pairing_expired);let{message:e}=l9("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw Error(e)}}),ps(this,"isValidPing",async e=>{if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)}),ps(this,"isValidDisconnect",async e=>{if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)}),ps(this,"isValidPairingTopic",async e=>{if(!un(e,!1)){let{message:t}=l9("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=l9("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(oW(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=l9("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}),this.core=e,this.logger=(0,ee.Ep)(t,this.name),this.pairings=new pn(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,ee.Fd)(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(u5.message,async e=>{let{topic:t,message:r,transportType:n}=e;if(this.pairings.keys.includes(t)&&n!==u4.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{let e=await this.core.crypto.decode(t,r);uU(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):uj(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,r)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(dn.expired,async e=>{let{topic:t}=oz(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(dt.expire,{topic:t}))})}}var pc=Object.defineProperty,pl=(e,t,r)=>t in e?pc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pu=(e,t,r)=>pl(e,"symbol"!=typeof t?t+"":t,r);class pd extends ec{constructor(e,t){super(e,t),this.core=e,this.logger=t,pu(this,"records",new Map),pu(this,"events",new b.EventEmitter),pu(this,"name","history"),pu(this,"version","0.3"),pu(this,"cac
24hed",[]),pu(this,"initialized",!1),pu(this,"storagePrefix",uY),pu(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),pu(this,"set",(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;let n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:oH(v.THIRTY_DAYS)};this.records.set(n.id,n),this.persist(),this.events.emit(dr.created,n)}),pu(this,"resolve",async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=uF(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(dr.updated,t))}),pu(this,"get",async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t))),pu(this,"delete",(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(r=>{r.topic!==e||"u">typeof t&&r.id!==t||(this.records.delete(r.id),this.events.emit(dr.deleted,r))}),this.persist()}),pu(this,"exists",async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e)),pu(this,"on",(e,t)=>{this.events.on(e,t)}),pu(this,"once",(e,t)=>{this.events.once(e,t)}),pu(this,"off",(e,t)=>{this.events.off(e,t)}),pu(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=(0,ee.Ep)(t,this.name)}get context(){return(0,ee.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if("u">typeof t.response)return;let r={topic:t.topic,request:uk(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=l9("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(dr.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=l9("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(dr.created,e=>{let t=dr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(dr.updated,e=>{let t=dr.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(dr.deleted,e=>{let t=dr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(A,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,v.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(dr.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}}var ph=Object.defineProperty,pp=(e,t,r)=>t in e?ph(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pf=(e,t,r)=>pp(e,"symbol"!=typeof t?t+"":t,r);class pg extends ef{constructor(e,t){super(e,t),this.core=e,this.logger=t,pf(this,"expirations",new Map),pf(this,"events",new b.EventEmitter),pf(this,"name","expirer"),pf(this,"version","0.3"),pf(this,"cac
24hed",[]),pf(this,"initialized",!1),pf(this,"storagePrefix",uY),pf(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),pf(this,"has",e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}}),pf(this,"set",(e,t)=>{this.isInitialized();let r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(dn.created,{target:r,expiration:n})}),pf(this,"get",e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)}),pf(this,"del",e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(dn.deleted,{target:t,expiration:r})}}),pf(this,"on",(e,t)=>{this.events.on(e,t)}),pf(this,"once",(e,t)=>{this.events.once(e,t)}),pf(this,"off",(e,t)=>{this.events.off(e,t)}),pf(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=(0,ee.Ep)(t,this.name)}get context(){return(0,ee.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return oF("topic",e);if("number"==typeof e)return oF("id",e);let{message:t}=l9("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(dn.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=l9("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=l9("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:r}=t;(0,v.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(dn.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(A,()=>this.checkExpirations()),this.events.on(dn.created,e=>{let t=dn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(dn.expired,e=>{let t=dn.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(dn.deleted,e=>{let t=dn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}}var pm=Object.defineProperty,py=(e,t,r)=>t in e?pm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pb=(e,t,r)=>py(e,"symbol"!=typeof t?t+"":t,r);class pw extends eg{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,pb(this,"name","verify-api"),pb(this,"abortController"),pb(this,"isDevEnv"),pb(this,"verifyUrlV3",ds),pb(this,"storagePrefix",uY),pb(this,"version",2),pb(this,"publicKey"),pb(this,"fetchPromise"),pb(this,"init",async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,v.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),pb(this,"register",async e=>{if(!oP()||this.isDevEnv)return;let t=window.location.origin,{id:r,decryptedId:n}=e,i=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${n}`;try{let e=(0,rq.getDocument)(),t=this.startAbortTimer(5*v.ONE_SECOND),n=await new Promise((n,o)=>{let s=()=>{window.removeEventListener("message",c),e.body.removeChild(a),o("attestation aborted")};this.abortController.signal.addEventListener("abort",s);let a=e.createElement("iframe");a.src=i,a.style.display="none",a.addEventListener("error",s,{signal:this.abortController.signal});let c=i=>{if(i.data&&"string"==typeof i.data)try{let o=JSON.parse(i.data);if("verify_attestation"===o.type){if(rT(o.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",s),window.removeEventListener("message",c),n(null===o.attestation?"":o.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(a),window.addEventListener("message",c,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",n),n}catch(e){this.logger.warn(e)}return""}),pb(this,"resolve",async e=>{if(this.isDevEnv)return"";let{attestationId:t,hash:r,encryptedId:n}=e;if(""===t){this.logger.debug("resolve: attestationId is empty, skipping");return}if(t){if(rT(t).payload.id!==n)return;let e=await this.isValidJwtAttestation(t);
24if(e){if(!e.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return e}}if(!r)return;let i=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,i)}),pb(this,"fetchAttestation",async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let r=this.startAbortTimer(5*v.ONE_SECOND),n=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?await n.json():void 0}),pb(this,"getVerifyUrl",e=>{let t=e||di;return da.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${di}`),t=di),t}),pb(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(v.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}}),pb(this,"persistPublicKey",async e=>{this.logger.debug("persisting public key to local storage",e),await this.store.setItem(this.storeKey,e),this.publicKey=e}),pb(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),pb(this,"isValidJwtAttestation",async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}let r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}}),pb(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),pb(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e}),pb(this,"validateAttestation",(e,t)=>{let r=function(e,t){let[r,n,i]=e.split("."),o=og.from(lL(i),"base64");if(64!==o.length)throw Error("Invalid signature length");let s=o.slice(0,32),a=o.slice(32,64),c=aa(`${r}.${n}`),l=function(e){let t=og.from(e.x,"base64"),r=og.from(e.y,"base64");return nJ([new Uint8Array([4]),t,r])}(t);if(!lS.verify(nJ([s,a]),c,l))throw Error("Invalid signature");return rT(e).payload}(e,t.publicKey),n={hasExpired:(0,v.toMiliseconds)(r.exp)<Date.now(),payload:r};if(n.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),Error("JWT attestation expired");return{origin:n.payload.origin,isScam:n.payload.isScam,isVerified:n.payload.isVerified}}),this.logger=(0,ee.Ep)(t,this.name),this.abortController=new AbortController,this.isDevEnv=oJ(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return(0,ee.Fd)(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,v.toMiliseconds)(e))}}var pv=Object.defineProperty,pC=(e,t,r)=>t in e?pv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pE=(e,t,r)=>pC(e,"symbol"!=typeof t?t+"":t,r);class px extends em{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,pE(this,"context","echo"),pE(this,"registerDeviceToken",async e=>{let{clientId:t,token:r,notificationType:n,enableEncrypted:i=!1}=e,o=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:n,token:r,always_raw:i})})}),this.logger=(0,ee.Ep)(t,this.context)}}var pA=Object.defineProperty,pS=Object.getOwnPropertySymbols,p_=Object.prototype.hasOwnProperty,pI=Object.prototype.propertyIsEnumerable,pk=(e,t,r)=>t in e?pA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pO=(e,t)=>{for(var r in t||(t={}))p_.call(t,r)&&pk(e,r,t[r]);if(pS)for(var r of pS(t))pI.call(t,r)&&pk(e,r,t[r]);return e},pN=(e,t,r)=>pk(e,"symbol"!=typeof t?t+"":t,r);class pP extends ey{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,pN(this,"context","event-client"),pN(this,"storagePrefix",uY),pN(this,"storageVersion",.1),pN(this,"events",new Map),pN(this,"shouldPersist",!1),pN(this,"init",async()=>
24{if(!oJ())try{let e={eventId:oY(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:oD(this.core.relayer.protocol,this.core.relayer.version,u6)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}}),pN(this,"createEvent",e=>{let{event:t="ERROR",type:r="",properties:{topic:n,trace:i}}=e,o=oY(),s=this.core.projectId||"",a=pO({eventId:o,timestamp:Date.now(),props:{event:t,type:r,properties:{topic:n,trace:i}},bundleId:s,domain:this.getAppDomain()},this.setMethods(o));return this.telemetryEnabled&&(this.events.set(o,a),this.shouldPersist=!0),a}),pN(this,"getEvent",e=>{let{eventId:t,topic:r}=e;if(t)return this.events.get(t);let n=Array.from(this.events.values()).find(e=>e.props.properties.topic===r);if(n)return pO(pO({},n),this.setMethods(n.eventId))}),pN(this,"deleteEvent",e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0}),pN(this,"setEventListeners",()=>{this.core.heartbeat.on(A,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,v.fromMiliseconds)(Date.now())-(0,v.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})}),pN(this,"setMethods",e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)})),pN(this,"addTrace",(e,t)=>{let r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)}),pN(this,"setError",(e,t)=>{let r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)}),pN(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),pN(this,"restore",async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,pO(pO({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}}),pN(this,"submit",async()=>{if(!this.telemetryEnabled||0===this.events.size)return;let e=[];for(let[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}}),pN(this,"sendEvent",async e=>{let t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${u6}${t}`,{method:"POST",body:JSON.stringify(e)})}),pN(this,"getAppDomain",()=>o$().url),this.logger=(0,ee.Ep)(t,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var pT=Object.defineProperty,pR=Object.getOwnPropertySymbols,p$=Object.prototype.hasOwnProperty,pD=Object.prototype.propertyIsEnumerable,pL=(e,t,r)=>t in e?pT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pM=(e,t)=>{for(var r in t||(t={}))p$.call(t,r)&&pL(e,r,t[r]);if(pR)for(var r of pR(t))pD.call(t,r)&&pL(e,r,t[r]);return e},pU=(e,t,r)=>pL(e,"symbol"!=typeof t?t+"":t,r);class pj extends ei{constructor(e){var t;super(e),pU(this,"protocol","wc"),pU(this,"version",2),pU(this,"name",uZ),pU(this,"relayUrl"),pU(this,"projectId"),pU(this,"customStoragePrefix"),pU(this,"events",new b.EventEmitter),pU(this,"logger"),pU(this,"heartbeat"),pU(this,"relayer"),pU(this,"crypto"),pU(this,"storage"),pU(this,"history"),pU(this,"expirer"),pU(this,"pairing"),pU(this,"verify"),pU(this,"echoClient"),pU(this,"linkModeSupportedApps"),pU(this,"eventClient"),pU(this,"initialized",!1),pU(this,"logChunkController"),pU(this,"on",(e,t)=>this.events.on(e,t)),pU(this,"once",(e,t)=>this.events.once(e,t)),pU(this,"off",(e,t)=>this.events.off(e,t)),pU(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),pU(this,"dispatchEnvelope",({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;let n={topic:e,message:t,publishedAt:Date.now(),transportType:u4.link_mode};this.relayer.onLinkMessageEvent(n,{sessionExists:r})});let r=this.getGlobalCore(e?.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(e){console.warn("Failed to copy global core",e)}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||u2,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";let n=(0,ee.jI)({level:"string"==typeof e?.logger&&e.logger?e.logger:uJ.logger,name:uZ}),{logger:i,chunkLoggerController:o}=(0,ee.Rt)({opts:n,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=o,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=(0,ee.Ep)(i,this.name),this.heartbeat=new S,this.crypto=new hc(this,this.logger,e?.keychain),this.history=new pd(this,this.logger),this.expirer=new pg(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new Q(pM(pM({},uX),e?.storageOptions)),this.relayer=new hQ({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new pa(this,this.logger),this.verify=new pw(this,this.logger,this.storage),this.echoClient=new px(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new pP(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(e){let t=new pj(e);await t.initialize();let r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return(0,ee.Fd)(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(u9,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
24),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(u9)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e}`,r=`${t}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[t]}catch(e){console.warn("Failed to get global WalletConnect core",e);return}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;let r=`_walletConnectCore_${(null==(t=e.opts)?void 0:t.customStoragePrefix)||""}`;globalThis[r]=e}catch(e){console.warn("Failed to set global WalletConnect core",e)}}isGlobalCoreDisabled(){try{return"u">typeof uG&&"true"===uG.env.DISABLE_GLOBAL_CORE}catch{return!0}}}let pB="client",pF=`wc@2:${pB}:`,pz={name:pB,logger:"error"},pH="WALLETCONNECT_DEEPLINK_CHOICE",pW="Proposal expired",pq=v.SEVEN_DAYS,pV={wc_sessionPropose:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1104},res:{ttl:v.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1106},res:{ttl:v.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1112},res:{ttl:v.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1114},res:{ttl:v.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:v.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:v.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1119}}},pK={min:v.FIVE_MINUTES,max:v.SEVEN_DAYS},pG={idle:"IDLE",active:"ACTIVE"},pZ={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},pY=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],pJ="[email protected]:auth:",pX=`${pJ}:PUB_KEY`;var pQ=Object.defineProperty,p0=Object.defineProperties,p1=Object.getOwnPropertyDescriptors,p2=Object.getOwnPropertySymbols,p5=Object.prototype.hasOwnProperty,p3=Object.prototype.propertyIsEnumerable,p6=(e,t,r)=>t in e?pQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p4=(e,t)=>{for(var r in t||(t={}))p5.call(t,r)&&p6(e,r,t[r]);if(p2)for(var r of p2(t))p3.call(t,r)&&p6(e,r,t[r]);return e},p8=(e,t)=>p0(e,p1(t)),p9=(e,t,r)=>p6(e,"symbol"!=typeof t?t+"":t,r);class p7 extends eE{constructor(e){super(e),p9(this,"name","engine"),p9(this,"events",new(w())),p9(this,"initialized",!1),p9(this,"requestQueue",{state:pG.idle,queue:[]}),p9(this,"sessionRequestQueue",{state:pG.idle,queue:[]}),p9(this,"emittedSessionRequests",new oQ({limit:500})),p9(this,"requestQueueDelay",v.ONE_SECOND),p9(this,"expectedPairingMethodMap",new Map),p9(this,"recentlyDeletedMap",new Map),p9(this,"recentlyDeletedLimit",200),p9(this,"relayMessageCache",[]),p9(this,"pendingSessions",new Map),p9(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(pV)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,v.toMiliseconds)(this.requestQueueDelay)))}),p9(this,"connect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t=p8(p4({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t),t.optionalNamespaces=function(e,t){var r,n,i,o,s,a;let c=l3(e),l=l3(t),u={};for(let e of Object.keys(c).concat(Object.keys(l)))u[e]={chains:oV(null==(r=c[e])?void 0:r.chains,null==(n=l[e])?void 0:n.chains),methods:oV(null==(i=c[e])?void 0:i.methods,null==(o=l[e])?void 0:o.methods),events:oV(null==(s=c[e])?void 0:s.events,null==(a=l[e])?void 0:a.events)};return u}(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};let{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:o,scopedProperties:s,relays:a}=t,c=r,l,u=!1;try{if(c){let e=this.client.core.pairing.pairings.get(c);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),u=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),e}if(!c||!u){let{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});c=e,l=t}if(!c){let{message:e}=l9("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw Error(e)}let d=await this.client.core.crypto.generateKeyPair(),h=pV.wc_sessionPropose.req.ttl||v.FIVE_MINUTES,p=oH(h),f=p8(p4(p4({requiredNamespaces:n,optionalNamespaces:i,relays:a??[{protocol:"irn"}],proposer:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:p,pairingTopic:c},o&&{sessionProperties:o}),s&&{scopedProperties:s}),{id:u_()}),g=oq("session_connect",f.id),{reject:m,resolve:y,done:b}=oj(h,pW),w=({id:e})=>{e===f.id&&(this.client.events.off("proposal_expire",w),this.pendingSessions.delete(f.id),this.events.emit(g,{error:{message:pW,code:0}}))};return this.client.events.on("proposal_expire",w),this.events.once(g,({error:e,session:t})=>{this.client.events.off("proposal_expire",w),e?m(e):t&&y(t)}),await this.sendProposeSession({proposal:f,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:f.id}}}),await this.setProposal(f.id,f),{uri:l,approval:b}}),p9(this,"pair",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}}),p9(this,"approve",async e=>{var t,r,n;let i=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[du.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw i.setError(dd.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),i.setError(dd.proposal_not_found),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),i.setError(dd.session_approve_namespace_validation_failure),e}let{id:o,relayProtocol:s,namespaces:a,sessionProperties:c,scopedProperties:l,sessionConfig:u}=e,d=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:i.eventId});let{pairingTopic:h,proposer:p,requiredNamespaces:f,optionalNamespaces:g}=d,m=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:h});m||(m=null==(n=this.client.core.eventClient)?void 0:n.createEvent({type:du.session_approve_started,properties:{topic:h,trace:[du.session_approve_started,du.session_namespaces_validation_success]}}));let y=await this.client.core.crypto.generateKeyPair(),b=p.publicKey,w=await this.client.core.crypto.generateSharedKey(y,b),v=p4(p4(p4({relay:{protocol:s??"irn"},namespaces:a,controller:{publicKey:y,metadata:this.client.metadata},expiry:oH(pq)},c&&{sessionProperties:c}),l&&{scopedProperties:l}),u&&{sessionConfig:u}),C=u4.relay;m.addTrace(du.subscribing_session_topic);try{await this.client.core.relayer.subscribe(w,{transportType:C,internal:{skipSubscribe:!0}})}catch(e){throw m.setError(dd.subscribe_session_topic_failure),e}m.addTrace(du.subscribe_session_topic_success);let E=p8(p4({},v),{topic:w,requiredNamespaces:f,optionalNamespaces:g,pairingTopic:h,acknowledged:!1,self:v.controller,peer:{publicKey:p.publicKey,metadata:p.metadata},controller:y,transportType:u4.relay});await this.client.session.set(w,E),m.addTrace(du.store_session);try{await this.sendApproveSession({sessionTopic:w,proposal:d,pairingProposalResponse:{relay:{protocol:s??"irn"},responderPublicKey:y},sessionSettleRequest:v,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:o}}}),m.addTrace(du.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(w,l7("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(w),e}return this.client.core.eventClient.deleteEvent({eventId:m.eventId}),await this.client.core.pairing.updateMetadata({topic:h,metadata:p.metadata}),await this.deleteProposal(o),await this.client.core.pairing.activate({topic:h}),await this.setExpiry(w,oH(pq)),{topic:w,acknowledged:()=>Promise.resolve(this.client.session.get(w))}}),p9(this,"reject",async e=>{let t;this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}let{id:r,reason:n}=e;try{t=this.client.proposal.get(r).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),e}
24t&&await this.sendError({id:r,topic:t,error:n,rpcOpts:pV.wc_sessionPropose.reject}),await this.deleteProposal(r)}),p9(this,"update",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}let{topic:t,namespaces:r}=e,{done:n,resolve:i,reject:o}=oj(),s=u_(),a=uI().toString(),c=this.client.session.get(t).namespaces;return this.events.once(oq("session_update",s),({error:e})=>{e?o(e):i()}),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:s,relayRpcId:a}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),o(e)}),{acknowledged:n}}),p9(this,"extend",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}let{topic:t}=e,r=u_(),{done:n,resolve:i,reject:o}=oj();return this.events.once(oq("session_extend",r),({error:e})=>{e?o(e):i()}),await this.setExpiry(t,oH(pq)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(e=>{o(e)}),{acknowledged:n}}),p9(this,"request",async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}let{chainId:t,request:r,topic:n,expiry:i=pV.wc_sessionRequest.req.ttl}=e,o=this.client.session.get(n);o?.transportType===u4.relay&&await this.confirmOnlineStateOrThrow();let s=u_(),a=uI().toString(),{done:c,resolve:l,reject:u}=oj(i,"Request expired. Please try again.");this.events.once(oq("session_request",s),({error:e,result:t})=>{e?u(e):l(t)});let d="wc_sessionRequest",h=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);if(h)return await this.sendRequest({clientRpcId:s,relayRpcId:a,topic:n,method:d,params:{request:p8(p4({},r),{expiryTimestamp:oH(i)}),chainId:t},expiry:i,throwOnFailedPublish:!0,appLink:h}).catch(e=>u(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),await c();let p={request:p8(p4({},r),{expiryTimestamp:oH(i)}),chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:s,relayRpcId:a,topic:n,method:d,params:p,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(s,p)}).catch(e=>u(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),e()}),new Promise(async e=>{var t;if(!(null!=(t=o.sessionConfig)&&t.disableDeepLink)){let e=await oG(this.client.core.storage,pH);await oK({id:s,topic:n,wcDeepLink:e})}e()}),c()]).then(e=>e[2])}),p9(this,"respond",async e=>{this.isInitialized(),await this.isValidRespond(e);let{topic:t,response:r}=e,{id:n}=r,i=this.client.session.get(t);i.transportType===u4.relay&&await this.confirmOnlineStateOrThrow();let o=this.getAppLinkIfEnabled(i.peer.metadata,i.transportType);uB(r)?await this.sendResult({id:n,topic:t,result:r.result,throwOnFailedPublish:!0,appLink:o}):uF(r)&&await this.sendError({id:n,topic:t,error:r.error,appLink:o}),this.cleanupAfterResponse(e)}),p9(this,"ping",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=u_(),r=uI().toString(),{done:n,resolve:i,reject:o}=oj();this.events.once(oq("session_ping",e),({error:e})=>{e?o(e):i()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),n()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:t}))}),p9(this,"emit",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:r,chainId:n}=e,i=uI().toString(),o=u_();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:n},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:o})}),p9(this,"disconnect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:l7("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=l9("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}}),p9(this,"find",e=>(this.isInitialized(),this.client.session.getAll().filter(t=>(function(e,t){let{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),i=Object.keys(r),o=!0;return!!oL(i,n)&&(n.forEach(t=>{let{accounts:n,methods:i,events:s}=e.namespaces[t],a=l1(n),c=r[t];oL(oy(t,c),a)&&oL(c.methods,i)&&oL(c.events,s)||(o=!1)}),o)})(t,e)))),p9(this,"getPendingSessionRequests",()=>
24this.client.pendingRequest.getAll()),p9(this,"authenticate",async(e,t)=>{var r,n,i;let o;this.isInitialized(),this.isValidAuthenticate(e);let s=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),a=s?u4.link_mode:u4.relay;a===u4.relay&&await this.confirmOnlineStateOrThrow();let{chains:c,statement:l="",uri:u,domain:d,nonce:h,type:p,exp:f,nbf:g,methods:m=[],expiry:y}=e,b=[...e.resources||[]],{topic:w,uri:v}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:a});this.client.logger.info({message:"Generated new pairing",pairing:{topic:w,uri:v}});let C=await this.client.core.crypto.generateKeyPair(),E=lT(C);if(await Promise.all([this.client.auth.authKeys.set(pX,{responseTopic:E,publicKey:C}),this.client.auth.pairingTopics.set(E,{topic:E,pairingTopic:w})]),await this.client.core.relayer.subscribe(E,{transportType:a}),this.client.logger.info(`sending request to new pairing topic: ${w}`),m.length>0){let{namespace:e}=om(c[0]),t=az(function(e,t,r,n={}){return r?.sort((e,t)=>e.localeCompare(t)),{att:{[e]:function(e,t,r={}){return Object.assign({},...(t=t?.sort((e,t)=>e.localeCompare(t))).map(t=>({[`${e}/${t}`]:[r]})))}(t,r,n)}}}(e,"request",m));aV(b)&&(n=t,i=b.pop(),t=az(function(e,t){aF(e),aF(t);let r=Object.keys(e.att).concat(Object.keys(t.att)).sort((e,t)=>e.localeCompare(t)),n={att:{}};return r.forEach(r=>{var i,o;Object.keys((null==(i=e.att)?void 0:i[r])||{}).concat(Object.keys((null==(o=t.att)?void 0:o[r])||{})).sort((e,t)=>e.localeCompare(t)).forEach(i=>{var o,s;n.att[r]=a$(aR({},n.att[r]),{[i]:(null==(o=e.att[r])?void 0:o[i])||(null==(s=t.att[r])?void 0:s[i])})})}),n}(aH(n),aH(i)))),b.push(t)}let x=y&&y>pV.wc_sessionAuthenticate.req.ttl?y:pV.wc_sessionAuthenticate.req.ttl,A={authPayload:{type:p??"caip122",chains:c,statement:l,aud:u,domain:d,version:"1",nonce:h,iat:new Date().toISOString(),exp:f,nbf:g,resources:b},requester:{publicKey:C,metadata:this.client.metadata},expiryTimestamp:oH(x)},S={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:c,methods:[...new Set(["personal_sign",...m])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:w,proposer:{publicKey:C,metadata:this.client.metadata},expiryTimestamp:oH(pV.wc_sessionPropose.req.ttl),id:u_()},{done:_,resolve:I,reject:k}=oj(x,"Request expired"),O=u_(),N=oq("session_connect",S.id),P=oq("session_request",O),T=async({error:e,session:t})=>{this.events.off(P,R),e?k(e):t&&I({session:t})},R=async e=>{var r,n,i;let o;if(await this.deletePendingAuthRequest(O,{message:"fulfilled",code:0}),e.error){let t=l7("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(N,T),k(e.error.message))}await this.deleteProposal(S.id),this.events.off(N,T);let{cacaos:s,responder:c}=e.result,l=[],u=[];for(let e of s){await aj({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),k(l7("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:t}=e,r=aV(t.resources),n=[aM(t.iss)],i=aU(t.iss);if(r){let e=aW(r),t=aq(r);l.push(...e),n.push(...t)}for(let e of n)u.push(`${e}:${i}`)}let d=await this.client.core.crypto.generateSharedKey(C,c.publicKey);l.length>0&&(o={topic:d,acknowledged:!0,self:{publicKey:C,metadata:this.client.metadata},peer:c,controller:c.publicKey,expiry:oH(pq),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:w,namespaces:l6([...new Set(l)],[...new Set(u)]),transportType:a},await this.client.core.relayer.subscribe(d,{transportType:a}),await this.client.session.set(d,o),w&&await this.client.core.pairing.updateMetadata({topic:w,metadata:c.metadata}),o=this.client.session.get(d)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(n=c.metadata.redirect)&&n.linkMode&&null!=(i=c.metadata.redirect)&&i.universal&&t&&(this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.session.update(d,{transportType:u4.link_mode})),I({auths:s,session:o})};this.events.once(N,T),this.events.once(P,R);try{if(s){let e=uk("wc_sessionAuthenticate",A,O);this.client.core.history.set(w,e);let r=await this.client.core.crypto.encode("",e,{type:2,encoding:lO});o=lq(t,w,r)}else await Promise.all([this.sendRequest({topic:w,method:"wc_sessionAuthenticate",params:A,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:O}),this.sendRequest({topic:w,method:"wc_sessionPropose",params:S,expiry:pV.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:S.id})])}catch(e){throw this.events.off(N,T),this.events.off(P,R),e}return await this.setProposal(S.id,S),await this.setAuthRequest(O,{request:p8(p4({},A),{verifyContext:{}}),pairingTopic:w,transportType:a}),{uri:o??v,response:_}}),p9(this,"approveSessionAuthenticate",async e=>{let t;let{id:r,auths:n}=e,i=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[dh.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw i.setError(dp.no_internet_connection),e}let o=this.getPendingAuthRequest(r);if(!o)throw i.setError(dp.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${r}`);let s=o.transportType||u4.relay;s===u4.relay&&await this.confirmOnlineStateOrThrow();let a=o.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),l=lT(a),u={type:1,receiverPublicKey:a,senderPublicKey:c},d=[],h=[];for(let e of n){if(!await aj({cacao:e,projectId:this.client.core.projectId})){i.setError(dp.invalid_cacao);let e=l7("SESSION_SETTLEMENT_FAILED","Signature verification failed");
24throw await this.sendError({id:r,topic:l,error:e,encodeOpts:u}),Error(e.message)}i.addTrace(dh.cacaos_verified);let{p:t}=e,n=aV(t.resources),o=[aM(t.iss)],s=aU(t.iss);if(n){let e=aW(n),t=aq(n);d.push(...e),o.push(...t)}for(let e of o)h.push(`${e}:${s}`)}let p=await this.client.core.crypto.generateSharedKey(c,a);if(i.addTrace(dh.create_authenticated_session_topic),d?.length>0){t={topic:p,acknowledged:!0,self:{publicKey:c,metadata:this.client.metadata},peer:{publicKey:a,metadata:o.requester.metadata},controller:a,expiry:oH(pq),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:l6([...new Set(d)],[...new Set(h)]),transportType:s},i.addTrace(dh.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(p,{transportType:s})}catch(e){throw i.setError(dp.subscribe_authenticated_session_topic_failure),e}i.addTrace(dh.subscribe_authenticated_session_topic_success),await this.client.session.set(p,t),i.addTrace(dh.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}i.addTrace(dh.publishing_authenticated_session_approve);try{await this.sendResult({topic:l,id:r,result:{cacaos:n,responder:{publicKey:c,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,s)})}catch(e){throw i.setError(dp.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:i.eventId}),{session:t}}),p9(this,"rejectSessionAuthenticate",async e=>{this.isInitialized();let{id:t,reason:r}=e,n=this.getPendingAuthRequest(t);if(!n)throw Error(`Could not find pending auth request with id ${t}`);n.transportType===u4.relay&&await this.confirmOnlineStateOrThrow();let i=n.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),s=lT(i);await this.sendError({id:t,topic:s,error:r,encodeOpts:{type:1,receiverPublicKey:i,senderPublicKey:o},rpcOpts:pV.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(n.requester.metadata,n.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.deleteProposal(t)}),p9(this,"formatAuthMessage",e=>{this.isInitialized();let{request:t,iss:r}=e;return aB(t,r)}),p9(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)}),p9(this,"cleanupDuplicatePairings",async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var n,i;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(i=r.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}}),p9(this,"deleteSession",async e=>{var t;let{topic:r,expirerHasDeleted:n=!1,emitEvent:i=!0,id:o=0}=e,{self:s}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,l7("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(s.publicKey)&&await this.client.core.crypto.deleteKeyPair(s.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(pH).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,l7("USER_DISCONNECTED"))}),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=pG.idle),i&&this.client.events.emit("session_delete",{id:o,topic:r})}),p9(this,"deleteProposal",async(e,t)=>{if(t)try{let t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError(dd.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,l7("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")}),p9(this,"deletePendingSessionRequest",async(e,t,r=!1)=>
24{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=pG.idle,this.client.events.emit("session_request_expire",{id:e}))}),p9(this,"deletePendingAuthRequest",async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])}),p9(this,"setExpiry",async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))}),p9(this,"setProposal",async(e,t)=>{this.client.core.expirer.set(e,oH(pV.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)}),p9(this,"setAuthRequest",async(e,t)=>{let{request:r,pairingTopic:n,transportType:i=u4.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:n,verifyContext:r.verifyContext,transportType:i})}),p9(this,"setPendingSessionRequest",async e=>{let{id:t,topic:r,params:n,verifyContext:i}=e,o=n.request.expiryTimestamp||oH(pV.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,o),await this.client.pendingRequest.set(t,{id:t,topic:r,params:n,verifyContext:i})}),p9(this,"sendRequest",async e=>{let t,n;let{topic:i,method:o,params:s,expiry:a,relayRpcId:c,clientRpcId:l,throwOnFailedPublish:u,appLink:d,tvf:h,publishOpts:p={}}=e,f=uk(o,s,l),g=!!d;try{let e=g?lO:lk;t=await this.client.core.crypto.encode(i,f,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),e}if(pY.includes(o)){let e=lR(JSON.stringify(f)),r=lR(t);n=await this.client.core.verify.register({id:r,decryptedId:e})}let m=p4(p4({},pV[o].req),p);if(m.attestation=n,a&&(m.ttl=a),c&&(m.id=c),this.client.core.history.set(i,f),g){let e=lq(d,i,t);await r.g.Linking.openURL(e,this.client.name)}else m.tvf=p8(p4({},h),{correlationId:f.id}),u?(m.internal=p8(p4({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,t,m)):this.client.core.relayer.publish(i,t,m).catch(e=>this.client.logger.error(e));return f.id}),p9(this,"sendProposeSession",async e=>{let{proposal:t,publishOpts:r}=e,n=uk("wc_sessionPropose",t,t.id);this.client.core.history.set(t.pairingTopic,n);let i=await this.client.core.crypto.encode(t.pairingTopic,n,{encoding:lk}),o=lR(JSON.stringify(n)),s=lR(i),a=await this.client.core.verify.register({id:s,decryptedId:o});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:i},opts:p8(p4({},r),{publishMethod:"wc_proposeSession",attestation:a})})}),p9(this,"sendApproveSession",async e=>{let{sessionTopic:t,pairingProposalResponse:r,proposal:n,sessionSettleRequest:i,publishOpts:o}=e,s=uO(n.id,r),a=await this.client.core.crypto.encode(n.pairingTopic,s,{encoding:lk}),c=uk("wc_sessionSettle",i,o?.id),l=await this.client.core.crypto.encode(t,c,{encoding:lk});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:n.pairingTopic,sessionProposalResponse:a,sessionSettlementRequest:l},opts:p8(p4({},o),{publishMethod:"wc_approveSession"})})}),p9(this,"sendResult",async e=>{let t,n,i;let{id:o,topic:s,result:a,throwOnFailedPublish:c,encodeOpts:l,appLink:u}=e,d=uO(o,a),h=u&&"u">typeof(null==r.g?void 0:r.g.Linking);try{let e=h?lO:lk;t=await this.client.core.crypto.encode(s,d,p8(p4({},l||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),e}try{let e=(n=await this.client.core.history.get(s,o)).request;try{i=this.getTVFParams(o,e.params,a)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${o}) failed`),e}if(h){let e=lq(u,s,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=pV[n.request.method].res;e.tvf=p8(p4({},i),{correlationId:o}),c?(e.internal=p8(p4({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,t,e)):this.client.core.relayer.publish(s,t,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(d)}),p9(this,"sendError",async e=>{let t,n;let{id:i,topic:o,error:s,encodeOpts:a,rpcOpts:c,appLink:l}=e,u=uN(i,s),d=l&&"u">typeof(null==r.g?void 0:r.g.Linking);try{let e=d?lO:lk;t=await this.client.core.crypto.encode(o,u,p8(p4({},a||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${o} failed`),e}try{n=await this.client.core.history.get(o,i)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${o}, ${i}) failed`),e}if(d){let e=lq(l,o,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=n.request.method,r=c||pV[e].res;this.client.core.relayer.publish(o,t,r)}await this.client.core.history.resolve(u)}),p9(this,"cleanup",async()=>{let e=[],t=[];
24this.client.session.getAll().forEach(t=>{let r=!1;oW(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{oW(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])}),p9(this,"onProviderMessageEvent",async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)}),p9(this,"onRelayEventRequest",async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()}),p9(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===pG.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=pG.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=pG.idle}),p9(this,"processRequest",async e=>{let{topic:t,payload:r,attestation:n,transportType:i,encryptedId:o}=e,s=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:s}))switch(s){case"wc_sessionPropose":return await this.onSessionProposeRequest
24({topic:t,payload:r,attestation:n,encryptedId:o});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:n,encryptedId:o,transportType:i});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:n,encryptedId:o,transportType:i});default:return this.client.logger.info(`Unsupported request method ${s}`)}}),p9(this,"onRelayEventResponse",async e=>{let{topic:t,payload:r,transportType:n}=e,i=(await this.client.core.history.get(t,r.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,n);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${i}`)}}),p9(this,"onRelayEventUnknownPayload",e=>{let{topic:t}=e,{message:r}=l9("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(r)}),p9(this,"shouldIgnorePairingRequest",e=>{let{topic:t,requestMethod:r}=e,n=this.expectedPairingMethodMap.get(t);return!(!n||n.includes(r))&&!!(n.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),p9(this,"onSessionProposeRequest",async e=>{let{topic:t,payload:r,attestation:n,encryptedId:i}=e,{params:o,id:s}=r;try{let e=this.client.core.eventClient.getEvent({topic:t});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(dl.proposal_listener_not_found)),this.isValidConnect(p4({},r.params));let a=o.expiryTimestamp||oH(pV.wc_sessionPropose.req.ttl),c=p4({id:s,pairingTopic:t,expiryTimestamp:a,attestation:n,encryptedId:i},o);await this.setProposal(s,c);let l=await this.getVerifyContext({attestationId:n,hash:lR(JSON.stringify(r)),encryptedId:i,metadata:c.proposer.metadata});e?.addTrace(dc.emit_session_proposal),this.client.events.emit("session_proposal",{id:s,params:c,verifyContext:l})}catch(e){await this.sendError({id:s,topic:t,error:e,rpcOpts:pV.wc_sessionPropose.autoReject}),this.client.logger.error(e)}}),p9(this,"onSessionProposeResponse",async(e,t,r)=>{let{id:n}=t;if(uB(t)){let{result:i}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});let o=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});let s=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});let a=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});let c=await this.client.core.crypto.generateSharedKey(s,a);this.pendingSessions.set(n,{sessionTopic:c,pairingTopic:e,proposalId:n,publicKey:s});let l=await this.client.core.relayer.subscribe(c,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if(uF(t)){await this.deleteProposal(n);let e=oq("session_connect",n);if(0===this.events.listenerCount(e))throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}}),p9(this,"onSessionSettleRequest",async(e,t)=>{let{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);let{relay:r,controller:i,expiry:o,namespaces:s,sessionProperties:a,scopedProperties:c,sessionConfig:l}=t.params,u=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!u)return this.client.logger.error(`Pending session not found for topic ${e}`);let d=this.client.proposal.get(u.proposalId),h=p8(p4(p4(p4({topic:e,relay:r,expiry:o,namespaces:s,acknowledged:!0,pairingTopic:u.pairingTopic,requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces,controller:i.publicKey,self:{publicKey:u.publicKey,metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},a&&{sessionProperties:a}),c&&{scopedProperties:c}),l&&{sessionConfig:l}),{transportType:u4.relay});await this.client.session.set(h.topic,h),await this.setExpiry(h.topic,h.expiry),await this.client.core.pairing.updateMetadata({topic:u.pairingTopic,metadata:h.peer.metadata}),this.client.events.emit("session_connect",{session:h}),this.events.emit(oq("session_connect",u.proposalId),{session:h}),this.pendingSessions.delete(u.proposalId),this.deleteProposal(u.proposalId,!1),this.cleanupDupl
24icatePairings(h),await this.sendResult({id:t.id,topic:e,result:!0})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),p9(this,"onSessionSettleResponse",async(e,t)=>{let{id:r}=t;uB(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(oq("session_approve",r),{})):uF(t)&&(await this.client.session.delete(e,l7("USER_DISCONNECTED")),this.events.emit(oq("session_approve",r),{error:t.error}))}),p9(this,"onSessionUpdateRequest",async(e,t)=>{let{params:r,id:n}=t;try{let t=`${e}_session_update`,i=uy.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.warn(`Discarding out of sync request - ${n}`),this.sendError({id:n,topic:e,error:l7("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(p4({topic:e},r));try{uy.set(t,n),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:n,topic:e,result:!0})}catch(e){throw uy.delete(t),e}this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}}),p9(this,"isRequestOutOfSync",(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3)),p9(this,"onSessionUpdateResponse",(e,t)=>{let{id:r}=t,n=oq("session_update",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);uB(t)?this.events.emit(oq("session_update",r),{}):uF(t)&&this.events.emit(oq("session_update",r),{error:t.error})}),p9(this,"onSessionExtendRequest",async(e,t)=>{let{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,oH(pq)),await this.sendResult({id:r,topic:e,result:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),p9(this,"onSessionExtendResponse",(e,t)=>{let{id:r}=t,n=oq("session_extend",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);uB(t)?this.events.emit(oq("session_extend",r),{}):uF(t)&&this.events.emit(oq("session_extend",r),{error:t.error})}),p9(this,"onSessionPingRequest",async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),p9(this,"onSessionPingResponse",(e,t)=>{let{id:r}=t,n=oq("session_ping",r);setTimeout(()=>{if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners 2176`);uB(t)?this.events.emit(oq("session_ping",r),{}):uF(t)&&this.events.emit(oq("session_ping",r),{error:t.error})},500)}),p9(this,"onSessionDeleteRequest",async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise(t=>{this.client.core.relayer.once(u5.publish,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:l7("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(e){this.client.logger.error(e)}}),p9(this,"onSessionRequest",async e=>{var t,r,n;let{topic:i,payload:o,attestation:s,encryptedId:a,transportType:c}=e,{id:l,params:u}=o;try{await this.isValidRequest(p4({topic:i},u));let e=this.client.session.get(i),o=await this.getVerifyContext({attestationId:s,hash:lR(JSON.stringify(uk("wc_sessionRequest",u,l))),encryptedId:a,metadata:e.peer.metadata,transportType:c}),d={id:l,topic:i,params:u,verifyContext:o};await this.setPendingSessionRequest(d),c===u4.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(n=this.client.signConfig)&&n.disableRequestQueue?this.emitSessionRequest(d):(this.addSessionRequestToSessionRequestQueue(d),this.processSessionRequestQueue())}catch(e){await this.sendError({id:l,topic:i,error:e}),this.client.logger.error(e)}}),p9(this,"onSessionRequestResponse",(e,t)=>{let{id:r}=t,n=oq("session_request",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);uB(t)?this.events.emit(oq("session_request",r),{result:t.result}):uF(t)&&this.events.emit(oq("session_request",r),{error:t.error})}),p9(this,"onSessionEventRequest",async(e,t)=>{let{id:r,params:n}=t;try{let t=`${e}_session_event_${n.event.name}`,i=uy.get(t);if(i&&this.isRequestOutOfSync(i,r)){this.client.logger.info(`Discarding out of sync request - ${r}`);return}this.isValidEmit(p4({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n}),uy.set(t,r)}
24catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),p9(this,"onSessionAuthenticateResponse",(e,t)=>{let{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),uB(t)?this.events.emit(oq("session_request",r),{result:t.result}):uF(t)&&this.events.emit(oq("session_request",r),{error:t.error})}),p9(this,"onSessionAuthenticateRequest",async e=>{var t;let{topic:r,payload:n,attestation:i,encryptedId:o,transportType:s}=e;try{let{requester:e,authPayload:a,expiryTimestamp:c}=n.params,l=await this.getVerifyContext({attestationId:i,hash:lR(JSON.stringify(n)),encryptedId:o,metadata:e.metadata,transportType:s}),u={requester:e,pairingTopic:r,id:n.id,authPayload:a,verifyContext:l,expiryTimestamp:c};await this.setAuthRequest(n.id,{request:u,pairingTopic:r,transportType:s}),s===u4.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id,verifyContext:l})}catch(o){this.client.logger.error(o);let e=n.params.requester.publicKey,t=await this.client.core.crypto.generateKeyPair(),i=this.getAppLinkIfEnabled(n.params.requester.metadata,s);await this.sendError({id:n.id,topic:r,error:o,encodeOpts:{type:1,receiverPublicKey:e,senderPublicKey:t},rpcOpts:pV.wc_sessionAuthenticate.autoReject,appLink:i})}}),p9(this,"addSessionRequestToSessionRequestQueue",e=>{this.sessionRequestQueue.queue.push(e)}),p9(this,"cleanupAfterResponse",e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=pG.idle,this.processSessionRequestQueue()},(0,v.toMiliseconds)(this.requestQueueDelay))}),p9(this,"cleanupPendingSentRequestsForTopic",({topic:e,error:t})=>{let r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{let r=oq("session_request",e.request.id);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);this.events.emit(oq("session_request",e.request.id),{error:t})})}),p9(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===pG.active){this.client.logger.info("session request queue is already active.");return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}}),p9(this,"emitSessionRequest",e=>{if(this.emittedSessionRequests.has(e.id)){this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`);return}this.sessionRequestQueue.state=pG.active,this.emittedSessionRequests.add(e.id),this.client.events.emit("session_request",e)}),p9(this,"onPairingCreated",e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);
24t&&this.onSessionProposeRequest({topic:e.topic,payload:uk("wc_sessionPropose",p8(p4({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties}),t.id),attestation:t.attestation,encryptedId:t.encryptedId})}),p9(this,"isValidConnect",async e=>{let t;if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:o,scopedProperties:s,relays:a}=e;if(ur(r)||await this.isValidPairingTopic(r),t=!1,a?a&&ue(a)&&a.length&&a.forEach(e=>{t=ul(e)}):t=!0,!t){let{message:e}=l9("MISSING_OR_INVALID",`connect() relays: ${a}`);throw Error(e)}if(!ur(n)&&0!==ut(n)){let e="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(e):this.client.logger.warn(e),this.validateNamespaces(n,"requiredNamespaces")}if(ur(i)||0===ut(i)||this.validateNamespaces(i,"optionalNamespaces"),ur(o)||this.validateSessionProps(o,"sessionProperties"),!ur(s)){this.validateSessionProps(s,"scopedProperties");let e=Object.keys(n||{}).concat(Object.keys(i||{}));if(!Object.keys(s).every(t=>e.includes(t.split(":")[0])))throw Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(s)}, required/optional namespaces: ${JSON.stringify(e)}`)}}),p9(this,"validateNamespaces",(e,t)=>{let r=function(e,t,r){let n=null;if(e&&ut(e)){let i;let o=ua(e,t);o&&(n=o);let s=(i=null,Object.entries(e).forEach(([e,n])=>{var o,s;let a;if(i)return;let c=(o=oy(e,n),s=`${t} ${r}`,a=null,ue(o)&&o.length?o.forEach(e=>{a||uo(e)||(a=l7("UNSUPPORTED_CHAINS",`${s}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):uo(e)||(a=l7("UNSUPPORTED_CHAINS",`${s}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),a);c&&(i=c)}),i);s&&(n=s)}else n=l9("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}(e,"connect()",t);if(r)throw Error(r.message)}),p9(this,"isValidApprove",async e=>{if(!uu(e))throw Error(l9("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:r,relayProtocol:n,sessionProperties:i,scopedProperties:o}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let s=this.client.proposal.get(t),a=uc(r,"approve()");if(a)throw Error(a.message);let c=uh(s.requiredNamespaces,r,"approve()");if(c)throw Error(c.message);if(!un(n,!0)){let{message:e}=l9("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw Error(e)}if(ur(i)||this.validateSessionProps(i,"sessionProperties"),!ur(o)){this.validateSessionProps(o,"scopedProperties");let e=new Set(Object.keys(r));if(!Object.keys(o).every(t=>e.has(t.split(":")[0])))throw Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(o)}, approved namespaces: ${Array.from(e).join(", ")}`)}}),p9(this,"isValidReject",async e=>{if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!r||"object"!=typeof r||!r.code||!ui(r.code,!1)||!r.message||!un(r.message,!1)){let{message:e}=l9("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw Error(e)}}),p9(this,"isValidSessionSettleRequest",e=>{let t;if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}let{relay:r,controller:n,namespaces:i,expiry:o}=e;if(!ul(r)){let{message:e}=l9("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let s=(t=null,un(n?.publicKey,!1)||(t=l9("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),t);if(s)throw Error(s.message);let a=uc(i,"onSessionSettleRequest()");if(a)throw Error(a.message);if(oW(o)){let{message:e}=l9("EXPIRED","onSessionSettleRequest()");throw Error(e)}}),p9(this,"isValidUpdate",async e=>{if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);
24let n=this.client.session.get(t),i=uc(r,"update()");if(i)throw Error(i.message);let o=uh(n.requiredNamespaces,r,"update()");if(o)throw Error(o.message)}),p9(this,"isValidExtend",async e=>{if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)}),p9(this,"isValidRequest",async e=>{var t;if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:r,request:n,chainId:i,expiry:o}=e;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);let{namespaces:s}=this.client.session.get(r);if(!ud(s,i)){let{message:e}=l9("MISSING_OR_INVALID",`request() chainId: ${i}`);throw Error(e)}if(ur(n)||!un(n.method,!1)){let{message:e}=l9("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw Error(e)}if(!(un(t=n.method,!1)&&(function(e,t){let r=[];return Object.values(e).forEach(e=>{l1(e.accounts).includes(t)&&r.push(...e.methods)}),r})(s,i).includes(t))){let{message:e}=l9("MISSING_OR_INVALID",`request() method: ${n.method}`);throw Error(e)}if(o&&(!ui(o,!1)||!(o<=pK.max)||!(o>=pK.min))){let{message:e}=l9("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${pK.min} and ${pK.max}`);throw Error(e)}}),p9(this,"isValidRespond",async e=>{var t;if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:r,response:n}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(ur(n)||ur(n.result)&&ur(n.error)||!ui(n.id,!1)||!un(n.jsonrpc,!1)){let{message:e}=l9("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw Error(e)}}),p9(this,"isValidPing",async e=>{if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),p9(this,"isValidEmit",async e=>{var t;if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:r,event:n,chainId:i}=e;await this.isValidSessionTopic(r);let{namespaces:o}=this.client.session.get(r);if(!ud(o,i)){let{message:e}=l9("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw Error(e)}if(ur(n)||!un(n.name,!1)){let{message:e}=l9("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw Error(e)}if(!(un(t=n.name,!1)&&(function(e,t){let r=[];return Object.values(e).forEach(e=>{l1(e.accounts).includes(t)&&r.push(...e.events)}),r})(o,i).includes(t))){let{message:e}=l9("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw Error(e)}}),p9(this,"isValidDisconnect",async e=>{if(!uu(e)){let{message:t}=l9("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),p9(this,"isValidAuthenticate",e=>{let{chains:t,uri:r,domain:n,nonce:i}=e;if(!Array.isArray(t)||0===t.length)throw Error("chains is required and must be a non-empty array");if(!un(r,!1))throw Error("uri is required parameter");if(!un(n,!1))throw Error("domain is required parameter");if(!un(i,!1))throw Error("nonce is required parameter");if([...new Set(t.map(e=>om(e).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:o}=om(t[0]);if("eip155"!==o)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),p9(this,"getVerifyContext",async e=>{let{attestationId:t,hash:r,encryptedId:n,metadata:i,transportType:o}=e,s={verified:{verifyUrl:i.verifyUrl||di,validation:"UNKNOWN",origin:i.url||""}};try{if(o===u4.link_mode){let e=this.getAppLinkIfEnabled(i,o);return s.verified.validation=e&&new URL(e).origin===new URL(i.url).origin?"VALID":"INVALID",s}let e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:n,verifyUrl:i.verifyUrl});e&&(s.verified.origin=e.origin,s.verified.isScam=e.isScam,s.verified.validation=e.origin===new URL(i.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(s)}`),s}),p9(this,"validateSessionProps",(e,t)=>{Object.values(e).forEach((r,n)=>{if(null==r){let{message:i}=l9("MISSING_OR_INVALID",`${t} must contain an existing value for each key. Received: ${r} for key ${Object.keys(e)[n]}`);throw Error(i)}})}),p9(this,"getPendingAuthRequest",e=>{let t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0}),p9(this,"addToRecentlyDeleted",(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;
24for(let r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}}),p9(this,"checkRecentlyDeleted",e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:r}=l9("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw Error(r)}}),p9(this,"isLinkModeEnabled",(e,t)=>{var n,i,o,s,a,c,l,u,d;return!!e&&t===u4.link_mode&&(null==(i=null==(n=this.client.metadata)?void 0:n.redirect)?void 0:i.linkMode)===!0&&(null==(s=null==(o=this.client.metadata)?void 0:o.redirect)?void 0:s.universal)!==void 0&&(null==(c=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:c.universal)!==""&&(null==(l=e?.redirect)?void 0:l.universal)!==void 0&&(null==(u=e?.redirect)?void 0:u.universal)!==""&&(null==(d=e?.redirect)?void 0:d.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&"u">typeof(null==r.g?void 0:r.g.Linking)}),p9(this,"getAppLinkIfEnabled",(e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0}),p9(this,"handleLinkModeMessage",({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;let t=oZ(e,"topic")||"",r=decodeURIComponent(oZ(e,"wc_ev")||""),n=this.client.session.keys.includes(t);n&&this.client.session.update(t,{transportType:u4.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:n})}),p9(this,"registerLinkModeListeners",async()=>{var e;if(oJ()||oN()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){let e=null==r.g?void 0:r.g.Linking;if("u">typeof e){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}),p9(this,"getTVFParams",(e,t,r)=>{var n,i,o;if(!(null!=(n=t.request)&&n.method))return{};let s={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{let e=this.extractTxHashesFromResult(t.request,r);s.txHashes=e,s.contractAddresses=this.isValidContractData(t.request.params)?[null==(o=null==(i=t.request.params)?void 0:i[0])?void 0:o.to]:[]}catch(e){this.client.logger.warn("Error getting TVF params",e)}return s}),p9(this,"isValidContractData",e=>{var t;if(!e)return!1;try{let r=e?.data||(null==(t=e?.[0])?void 0:t.data);if(!r.startsWith("0x"))return!1;let n=r.slice(2);return!!/^[0-9a-fA-F]*$/.test(n)&&n.length%2==0}catch{}return!1}),p9(this,"extractTxHashesFromResult",(e,t)=>{var r;try{if(!t)return[];let n=e.method,i=pZ[n];if("sui_signTransaction"===n)return[function(e){let t=new Uint8Array(og.from(e,"base64")),r=Array.from("TransactionData::").map(e=>e.charCodeAt(0)),n=new Uint8Array(r.length+t.length);n.set(r),n.set(t,r.length);let i=ab(n,{dkLen:32});return nd.Z.encode(i)}(t.transactionBytes)];if("near_signTransaction"===n)return[ax(t)];if("near_signTransactions"===n)return t.map(e=>ax(e));if("xrpl_signTransactionFor"===n||"xrpl_signTransaction"===n)return[null==(r=t.tx_json)?void 0:r.hash];if("polkadot_signTransaction"===n)return[function(e){let t=Uint8Array.from(og.from(e.signature,"hex")),r=function({publicKey:e,signature:t,payload:r}){var n,i;let o=ub(r.method),s=128|parseInt((null==(n=r.version)?void 0:n.toString())||"4"),a=function(e){let t=nd.Z.decode(e)[0];return 42===t?0:60===t?2:1}(r.address),c="00"===r.era?new Uint8Array([0]):ub(r.era);if(1!==c.length&&2!==c.length)throw Error("Invalid era length");let l=parseInt(r.nonce,16),u=new Uint8Array([255&l,l>>8&255]),d=new Uint8Array([0,...e,a,...t,...c,...u,...function(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){let t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}if(e<BigInt(1)<<BigInt(30)){let t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}throw Error("BigInt compact encoding not supported > 2^30")}(BigInt(`0x${(i=r.tip).startsWith("0x")?i.slice(2):i}`)),...o]);return new Uint8Array([...function(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){let t=e<<2|1;return new Uint8Array([255&t,t>>8&255])}if(e<1073741824){let t=e<<2|2;return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}throw Error("Compact encoding > 2^30 not supported")}(d.length+1),s,...d])}({publicKey:function(e){let t=nd.Z.decode(e);if(t.length<33)throw Error("Too short to contain a public key");return t.slice(1,33)}(e.transaction.address),signature:t,payload:e.transaction});return function(e){let t=ub(e),r=(0,op.blake2b)(t,void 0,32);return"0x"+og.from(r).toString("hex")}(og.from(r).toString("hex"))}({transaction:e.params.transactionPayload,signature:t.signature})];if("algo_signTxn"===n)return ue(t)?t.map(e=>aA(e)):[aA(t)];
24if("cosmos_signDirect"===n)return[function(e){let t=og.from(e.signed.bodyBytes,"base64"),r=og.from(e.signed.authInfoBytes,"base64"),n=og.from(e.signature.signature,"base64"),i=[];i.push(og.from([10])),i.push(aS(t.length)),i.push(t),i.push(og.from([18])),i.push(aS(r.length)),i.push(r),i.push(og.from([26])),i.push(aS(n.length)),i.push(n);let o=aa(og.concat(i));return og.from(o).toString("hex").toUpperCase()}(t)];if("string"==typeof t)return[t];let o=t[i.key];if(ue(o))return"solana_signAllTransactions"===n?o.map(e=>(function(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let n=r[0];if(0===n)throw Error("No signatures found");if(r.length<1+64*n)throw Error("Transaction data too short for claimed signature count");if(r.length<100)throw Error("Transaction too short");let i=og.from(e,"base64").slice(1,65);return nd.Z.encode(i)})(e)):o;if("string"==typeof o)return[o]}catch(e){this.client.logger.warn("Error extracting tx hashes from result",e)}return[]})}async processPendingMessageEvents(){try{let e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(let[e,r]of Object.entries(t))for(let t of r)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn("processPendingMessageEvents failed",e)}}isInitialized(){if(!this.initialized){let{message:e}=l9("NOT_INITIALIZED",this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(u5.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){let{topic:t,message:r,attestation:n,transportType:i}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(pX)?this.client.auth.authKeys.get(pX):{responseTopic:void 0,publicKey:void 0};try{let e=await this.client.core.crypto.decode(t,r,{receiverPublicKey:o,encoding:i===u4.link_mode?lO:lk});uU(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:n,transportType:i,encryptedId:lR(r)})):uj(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:i}),this.client.core.history.delete(t,e.id)):await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:i}),await this.client.core.relayer.messages.ack(t,r)}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(dn.expired,async e=>{let{topic:t,id:r}=oz(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,l9("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,l9("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))})}registerPairingEvents(){this.client.core.pairing.events.on(dt.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(dt.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!un(e,!1)){let{message:t}=l9("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=l9("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(oW(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=l9("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!un(e,!1)){let{message:t}=l9("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=l9("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if(oW(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=l9("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=l9("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(un(e,!1)){let{message:t}=l9("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=l9("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if("number"!=typeof e){let{message:t}=l9("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=l9("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if(oW(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=l9("EXPIRED",`proposal id: ${e}`);throw Error(t)}}}class fe extends pn{constructor(e,t){super(e,t,"proposal",pF),this.core=e,this.logger=t}}class ft extends pn{constructor(e,t){super(e,t,"session",pF),this.core=e,this.logger=t}}class fr extends pn{constructor(e,t){super(e,t,"request",pF,e=>e.id),this.core=e,this.logger=t}}class fn extends pn{constructor(e,t){super(e,t,"authKeys",pJ,()=>pX),this.core=e,this.logger=t}}class fi extends pn{constructor(e,t){super(e,t,"pairingTopics",pJ),this.core=e,this.logger=t}}class fo extends pn{constructor(e,t){super(e,t,"requests",pJ,e=>e.id),this.core=e,this.logger=t}}var fs=Object.defineProperty,fa=(e,t,r)=>t in e?fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fc=(e,t,r)=>fa(e,"symbol"!=typeof t?t+"":t,r);class fl{constructor(e,t){this.core=e,this.logger=t,fc(this,"authKeys"),fc(this,"pairingTopics"),fc(this,"requests"),this.authKeys=new fn(this.core,this.logger),this.pairingTopics=new fi(this.core,this.logger),this.requests=new fo(this.core,this.logger)}
24async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var fu=Object.defineProperty,fd=(e,t,r)=>t in e?fu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fh=(e,t,r)=>fd(e,"symbol"!=typeof t?t+"":t,r);class fp extends eC{constructor(e){super(e),fh(this,"protocol","wc"),fh(this,"version",2),fh(this,"name",pz.name),fh(this,"metadata"),fh(this,"core"),fh(this,"logger"),fh(this,"events",new b.EventEmitter),fh(this,"engine"),fh(this,"session"),fh(this,"proposal"),fh(this,"pendingRequest"),fh(this,"auth"),fh(this,"signConfig"),fh(this,"on",(e,t)=>this.events.on(e,t)),fh(this,"once",(e,t)=>this.events.once(e,t)),fh(this,"off",(e,t)=>this.events.off(e,t)),fh(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),fh(this,"removeAllListeners",e=>this.events.removeAllListeners(e)),fh(this,"connect",async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"pair",async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"approve",async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"reject",async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"update",async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"extend",async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"request",async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"respond",async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"ping",async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"emit",async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"disconnect",async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"find",e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}}),fh(this,"authenticate",async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"formatAuthMessage",e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"approveSessionAuthenticate",async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),fh(this,"rejectSessionAuthenticate",async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),this.name=e?.name||pz.name,this.metadata=function(e){var t,r;let n=o$();try{return null!=e&&e.url&&n.url&&new URL(e.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),e.url=n.url),null!=(t=e?.icons)&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>""!==e)),o_(oS(oS({},n),e),{url:e?.url||n.url,name:e?.name||n.name,description:e?.description||n.description,icons:null!=(r=e?.icons)&&r.length&&e.icons.length>0?e.icons:n.icons})}catch(t){return console.warn("Error populating app metadata",t),e||n}}(e?.metadata),this.signConfig=e?.signConfig;let t="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:(0,ee.gw)((0,ee.jI)({level:e?.logger||pz.logger}));this.core=e?.core||new pj(e),this.logger=(0,ee.Ep)(t,this.name),this.session=new ft(this.core,this.logger),this.proposal=new fe(this.core,this.logger),this.pendingRequest=new fr(this.core,this.logger),this.engine=new p7(this),this.auth=new fl(this.core,this.logger)}static async init(e){let t=new fp(e);return await t.initialize(),t}get context(){return(0,ee.Fd)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var ff=r(5019),fg=r.n(ff),fm=Object.defineProperty,fy=Object.defineProperties,fb=Object.getOwnPropertyDescriptors,fw=Object.getOwnPropertySymbols,fv=Object.prototype.hasOwnProperty,fC=Object.prototype.propertyIsEnumerable,fE=(e,t,r)=>t in e?fm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fx=(e,t)=>{for(var r in t||(t={}))fv.call(t,r)&&fE(e,r,t[r]);if(fw)for(var r of fw(t))fC.call(t,r)&&fE(e,r,t[r]);return e},fA=(e,t)=>
24fy(e,fb(t));let fS={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class f_{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new b.EventEmitter,this.isAvailable=!1,this.registering=!1,!uD(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}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 open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{let t=(0,W.u)(e),r=await (await fg()(this.url,fA(fx({},fS),{body:t}))).json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!uD(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(Error("HTTP connection is missing or invalid"));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t=(0,W.u)({id:1,jsonrpc:"2.0",method:"test",params:[]});await fg()(e,fA(fx({},fS),{body:t}))}this.onOpen()}catch(t){let e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?(0,W.D)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=uN(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return uA(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}var fI=r(55872).Buffer;let fk="error",fO="wc@2:universal_provider:",fN="https://rpc.walletconnect.org/v1/",fP="generic",fT=`${fN}bundler`,fR="default_chain_changed";function f$(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function fD(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function fL(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let fM="[object String]",fU="[object Number]",fj="[object Boolean]",fB="[object Arguments]";function fF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fz(e,t,r,n=new Map,i){let o=i?.(e,t,r,n);if(null!=o)return o;if(f$(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){let t=Array(e.length);n.set(e,t);for(let o=0;o<e.length;o++)t[o]=fz(e[o],o,r,n,i);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;for(let[o,s]of(n.set(e,t),e))t.set(o,fz(s,o,r,n,i));return t}if(e instanceof Set){let t=new Set;for(let o of(n.set(e,t),e))t.add(fz(o,void 0,r,n,i));return t}if("u">typeof fI&&fI.isBuffer(e))return e.subarray();if(fF(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,t);for(let o=0;o<e.length;o++)t[o]=fz(e[o],o,r,n,i);return t}if(e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,t),fH(t,e,r,n,i),t}if("u">typeof File&&e instanceof File){let t=new File([e],e.name,{type:e.type});return n.set(e,t),fH(t,e,r,n,i),t}if(e instanceof Blob){let t=new Blob([e],{type:e.type});return n.set(e,t),fH(t,e,r,n,i),t}if(e instanceof Error){let t=new e.constructor;return n.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,fH(t,e,r,n,i),t}if("object"==typeof e&&function(e){switch(fL(e)){case fB:case"[object Array]":case"[object ArrayBuffer]":case"[object DataView]":case fj:case"[object Date]":case"[object Float32Array]":case"[object Float64Array
24]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Map]":case fU:case"[object Object]":case"[object RegExp]":case"[object Set]":case fM:case"[object Symbol]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return!0;default:return!1}}(e)){let t=Object.create(Object.getPrototypeOf(e));return n.set(e,t),fH(t,e,r,n,i),t}return e}function fH(e,t,r=e,n,i){let o=[...Object.keys(t),...fD(t)];for(let s=0;s<o.length;s++){let a=o[s],c=Object.getOwnPropertyDescriptor(e,a);(null==c||c.writable)&&(e[a]=fz(t[a],a,r,n,i))}}function fW(e){var t;return t=(t,r,n,i)=>{let o=void 0;if(null!=o)return o;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case fU:case fM:case fj:{let t=new e.constructor(e?.valueOf());return fH(t,e),t}case fB:{let t={};return fH(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}},fz(e,void 0,e,new Map,t)}function fq(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===fL(e)}function fV(e){return"object"==typeof e&&null!==e}function fK(){}var fG=Object.defineProperty,fZ=Object.defineProperties,fY=Object.getOwnPropertyDescriptors,fJ=Object.getOwnPropertySymbols,fX=Object.prototype.hasOwnProperty,fQ=Object.prototype.propertyIsEnumerable,f0=(e,t,r)=>t in e?fG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f1=(e,t)=>{for(var r in t||(t={}))fX.call(t,r)&&f0(e,r,t[r]);if(fJ)for(var r of fJ(t))fQ.call(t,r)&&f0(e,r,t[r]);return e},f2=(e,t)=>fZ(e,fY(t));function f5(e,t,r){var n;let i=om(e);return(null==(n=t.rpcMap)?void 0:n[i.reference])||`${fN}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function f3(e){return e.includes(":")?e.split(":")[1]:e}function f6(e){return e.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function f4(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>{var r,n;return(null==(r=t?.chains)?void 0:r.length)&&(null==(n=t?.chains)?void 0:n.length)>0}))}function f8(e={},t={}){return function(e,...t){return function(e,...t){let r=t.slice(0,-1),n=t[t.length-1],i=e;for(let e=0;e<r.length;e++)i=function e(t,r,n,i){if(f$(t)&&(t=Object(t)),null==r||"object"!=typeof r)return t;if(i.has(r))return function(e){if(f$(e))return e;if(Array.isArray(e)||fF(e)||e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e),r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){let t=new r(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let t=new r(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}return"u">typeof File&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):"object"==typeof e?Object.assign(Object.create(t),e):e}(i.get(r));if(i.set(r,t),Array.isArray(r)){r=r.slice();for(let e=0;e<r.length;e++)r[e]=r[e]??void 0}let o=[...Object.keys(r),...fD(r)];for(let s=0;s<o.length;s++){let a=o[s],c=r[a],l=t[a];if(fq(c)&&(c={...c}),fq(l)&&(l={...l}),"u">typeof fI&&fI.isBuffer(c)&&(c=fW(c)),Array.isArray(c)){if("object"==typeof l&&null!=l){let e=[],t=Reflect.ownKeys(l);for(let r=0;r<t.length;r++){let n=t[r];e[n]=l[n]}l=e}else l=[]}let u=n(l,c,a,t,r,i);null!=u?t[a]=u:Array.isArray(c)||fV(l)&&fV(c)?t[a]=e(l,c,n,i):null==l&&function(e){if("object"!=typeof e||null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){let t=e[Symbol.toStringTag];return!!(null!=t&&Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable)&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(c)?t[a]=e({},c,n,i):null==l&&fF(c)?t[a]=fW(c):(void 0===l||void 0!==c)&&(t[a]=c)}return t}(i,r[e],n,new Map);return i}(e,...t,fK)}(f4(f9(e)),f4(f9(t)))}function f9(e){var t,r,n,i,o;let s={};if(!ut(e))return s;for(let[a,c]of Object.entries(e)){let e=l2(a)?[a]:c.chains,l=c.methods||[],u=c.events||[],d=c.rpcMap||{},h=l5(a);s[h]=f2(f1(f1({},s[h]),c),{chains:oV(e,null==(t=s[h])?void 0:t.chains),methods:oV(l,null==(r=s[h])?void 0:r.methods),events:oV(u,null==(n=s[h])?void 0:n.events)}),(ut(d)||ut((null==(i=s[h])?void 0:i.rpcMap)||{}))&&(s[h].rpcMap=f1(f1({},d),null==(o=s[h])?void 0:o.rpcMap))}return s}function f7(e){return e.includes(":")?e.split(":")[2]:e}function ge(e){let t={};for(let[r,n]of Object.entries(e)){let e=n.methods||[],i=n.events||[],o=n.accounts||[],s=l2(r)?[r]:n.chains?n.chains:f6(n.accounts);t[r]={chains:s,methods:e,events:i,accounts:o}}return t}function gt(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):isNaN(Number(e=e.includes(":")?e.split(":")[1]:e))?e:Number(e)}let gr={},gn=e=>gr[e],gi=(e,t)=>{gr[e]=t};var go=Object.defineProperty,gs=Object.getOwnPropertySymbols,ga=Object.prototype.hasOwnProperty,gc=Object.prototype.propertyIsEnumerable,gl=(e,t,r)=>t in e?go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gu=(e,t)=>
24{for(var r in t||(t={}))ga.call(t,r)&&gl(e,r,t[r]);if(gs)for(var r of gs(t))gc.call(t,r)&&gl(e,r,t[r]);return e};let gd="eip155",gh=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],gp=e=>e&&e.startsWith("0x")?BigInt(e).toString(10):e,gf=e=>e&&e.startsWith("0x")?e:`0x${BigInt(e).toString(16)}`,gg=e=>Object.keys(e).filter(e=>gh.includes(e)).reduce((t,r)=>(t[r]=e[r],t),{}),gm=(e,t,r)=>{let{sessionProperties:n={},scopedProperties:i={}}=e,o={};if(!ut(i)&&!ut(n))return;let s=gg(n);for(let e of r){let r=gp(e);if(!r)continue;o[gf(r)]=s;let n=i?.[`${gd}:${r}`];if(n){let e=n?.[`${gd}:${r}:${t}`];o[gf(r)]=gu(gu({},o[gf(r)]),gg(e||n))}}for(let[e,t]of Object.entries(o))0===Object.keys(t).length&&delete o[e];return Object.keys(o).length>0?o:void 0};var gy=Object.defineProperty,gb=(e,t,r)=>t in e?gy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gw=(e,t,r)=>gb(e,"symbol"!=typeof t?t+"":t,r);class gv{constructor(e){gw(this,"name","polkadot"),gw(this,"client"),gw(this,"httpProviders"),gw(this,"events"),gw(this,"namespace"),gw(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(fR,`${this.name}:${e}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=f3(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new uz(new f_(r,gn("disableProviderPing")))}}var gC=Object.defineProperty,gE=Object.defineProperties,gx=Object.getOwnPropertyDescriptors,gA=Object.getOwnPropertySymbols,gS=Object.prototype.hasOwnProperty,g_=Object.prototype.propertyIsEnumerable,gI=(e,t,r)=>t in e?gC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gk=(e,t)=>{for(var r in t||(t={}))gS.call(t,r)&&gI(e,r,t[r]);if(gA)for(var r of gA(t))g_.call(t,r)&&gI(e,r,t[r]);return e},gO=(e,t)=>gE(e,gx(t)),gN=(e,t,r)=>gI(e,"symbol"!=typeof t?t+"":t,r);class gP{constructor(e){gN(this,"name","eip155"),gN(this,"client"),gN(this,"chainId"),gN(this,"namespace"),gN(this,"httpProviders"),gN(this,"events"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(fR,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){let r=t||f5(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new uz(new f_(r,gn("disableProviderPing")))}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=parseInt(f3(t));e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){let e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,r;let n=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0",i=parseInt(n=n.startsWith("0x")?n:`0x${n}`,16);if(this.isChainApproved(i))this.setDefaultChain(`${i}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]}),this.setDefaultChain(`${i}`);else throw Error(`Failed to switch to chain 'eip155:${i}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,r,n,i,o;let s;let a=null==(r=null==(t=e.request)?void 0:t.params)?void 0:r[0],c=(null==(i=null==(n=e.request)?void 0:n.params)?void 0:i[1])||[];if(!a)throw Error("Missing address parameter in `wallet_getCapabilities` request");let l=this.client.session.get(e.topic),u=(null==(o=l?.sessionProperties)?void 0:o.capabilities)||{},d=`${a}${c.join(",")}`,h=u?.[d];if(h)return h;try{s=gm(l,a,c)}catch(e){console.warn("Failed to extract capabilities from session",e)}if(s)return s;let p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:gO(gk({},l.sessionProperties||{}),{capabilities:gO(gk({},u||{}
24),{[d]:p})})})}catch(e){console.warn("Failed to update session with capabilities",e)}return p}async getCallStatus(e){var t,r;let n=this.client.session.get(e.topic),i=null==(t=n.sessionProperties)?void 0:t.bundler_name;if(i){let t=this.getBundlerUrl(e.chainId,i);try{return await this.getUserOperationReceipt(t,e)}catch(e){console.warn("Failed to fetch call status from bundler",e,t)}}let o=null==(r=n.sessionProperties)?void 0:r.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(e){console.warn("Failed to fetch call status from custom bundler",e,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var r;let n=new URL(e),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(uk("eth_getUserOperationReceipt",[null==(r=t.request.params)?void 0:r[0]]))});if(!i.ok)throw Error(`Failed to fetch user operation receipt - ${i.status}`);return await i.json()}getBundlerUrl(e,t){return`${fT}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}var gT=Object.defineProperty,gR=(e,t,r)=>t in e?gT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,g$=(e,t,r)=>gR(e,"symbol"!=typeof t?t+"":t,r);class gD{constructor(e){g$(this,"name","solana"),g$(this,"client"),g$(this,"httpProviders"),g$(this,"events"),g$(this,"namespace"),g$(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(fR,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=f3(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new uz(new f_(r,gn("disableProviderPing")))}}var gL=Object.defineProperty,gM=(e,t,r)=>t in e?gL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gU=(e,t,r)=>gM(e,"symbol"!=typeof t?t+"":t,r);class gj{constructor(e){gU(this,"name","cosmos"),gU(this,"client"),gU(this,"httpProviders"),gU(this,"events"),gU(this,"namespace"),gU(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(fR,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=f3(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new uz(new f_(r,gn("disableProviderPing")))}}var gB=Object.defineProperty,gF=(e,t,r)=>t in e?gB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gz=(e,t,r)=>gF(e,"symbol"!=typeof t?t+"":t,r);class gH{constructor(e){gz(this,"name","algorand"),gz(this,"client"),gz(this,"httpProviders"),gz(this,"events"),gz(this,"namespace"),gz(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){let r=t||f5(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(fR,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new uz(new f_(r,gn("disableProviderPing")))}}var gW=Object.defineProperty,gq=(e,t,r)=>t in e?gW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gV=(e,t,r)=>gq(e,"symbol"!=typeof t?t+"":t,r);class gK{constructor(e){gV(this,"name","cip34"),gV(this,"client"),gV(this,"httpProviders"),gV(this,"events"),gV(this,"namespace"),gV(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(fR,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let r=this.getCardanoRPCUrl(t),n=f3(t);e[n]=this.createHttpProvider(n,r)}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){let t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||this.getCardanoRPCUrl(e);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new uz(new f_(r,gn("disableProviderPing")))}}var gG=Object.defineProperty,gZ=(e,t,r)=>t in e?gG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gY=(e,t,r)=>gZ(e,"symbol"!=typeof t?t+"":t,r);class gJ{constructor(e){gY(this,"name","elrond"),gY(this,"client"),gY(this,"httpProviders"),gY(this,"events"),gY(this,"namespace"),gY(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(fR,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=f3(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new uz(new f_(r,gn("disableProviderPing")))}}var gX=Object.defineProperty,gQ=(e,t,r)=>t in e?gX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,g0=(e,t,r)=>gQ(e,"symbol"!=typeof t?t+"":t,r);class g1{constructor(e){g0(this,"name","multiversx"),g0(this,"client"),g0(this,"httpProviders"),g0(this,"events"),g0(this,"namespace"),g0(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(fR,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=f3(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new uz(new f_(r,gn("disableProviderPing")))}}var g2=Object.defineProperty,g5=(e,t,r)=>t in e?g2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,g3=(e,t,r)=>g5(e,"symbol"!=typeof t?t+"":t,r);class g6{constructor(e){g3(this,"name","near"),g3(this,"client"),g3(this,"httpProviders"),g3(this,"events"),g3(this,"namespace"),g3(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){let r=t||f5(`${this.name}:${e}`,this.namespace);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(fR,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace);return typeof r>"u"?void 0:new uz(new f_(r,gn("disableProviderPing")))}}var g4=Object.defineProperty,g8=(e,t,r)=>t in e?g4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,g9=(e,t,r)=>g8(e,"symbol"!=typeof t?t+"":t,r);class g7{constructor(e){g9(this,"name","tezos"),g9(this,"client"),g9(this,"httpProviders"),g9(this,"events"),g9(this,"namespace"),g9(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){let r=t||f5(`${this.name}:${e}`,this.namespace);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(fR,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{e[t]=this.createHttpProvider(t)}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace);return typeof r>"u"?void 0:new uz(new f_(r))}}var me=Object.defineProperty,mt=(e,t,r)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mr=(e,t,r)=>mt(e,"symbol"!=typeof t?t+"":t,r);class mn{constructor(e){mr(this,"name",fP),mr(this,"client"),mr(this,"httpProviders"),mr(this,"events"),mr(this,"namespace"),mr(this,"chainId"),this.namespace=e.namespace,this.events=gn("events"),this.client=gn("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||
24[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(fR,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getNamespaceName(){let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return om(e).namespace}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){var e,t;let r={};return null==(t=null==(e=this.namespace)?void 0:e.accounts)||t.forEach(e=>{r[om(e).reference]=this.createHttpProvider(e)}),r}getHttpProvider(e){let t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||f5(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new uz(new f_(r,gn("disableProviderPing")))}}var mi=Object.defineProperty,mo=Object.defineProperties,ms=Object.getOwnPropertyDescriptors,ma=Object.getOwnPropertySymbols,mc=Object.prototype.hasOwnProperty,ml=Object.prototype.propertyIsEnumerable,mu=(e,t,r)=>t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,md=(e,t)=>{for(var r in t||(t={}))mc.call(t,r)&&mu(e,r,t[r]);if(ma)for(var r of ma(t))ml.call(t,r)&&mu(e,r,t[r]);return e},mh=(e,t)=>mo(e,ms(t)),mp=(e,t,r)=>mu(e,"symbol"!=typeof t?t+"":t,r);class mf{constructor(e){mp(this,"client"),mp(this,"namespaces"),mp(this,"optionalNamespaces"),mp(this,"sessionProperties"),mp(this,"scopedProperties"),mp(this,"events",new(w())),mp(this,"rpcProviders",{}),mp(this,"session"),mp(this,"providerOpts"),mp(this,"logger"),mp(this,"uri"),mp(this,"disableProviderPing",!1),this.providerOpts=e,this.logger="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:(0,ee.gw)((0,ee.jI)({level:e?.logger||fk})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){let t=new mf(e);return await t.initialize(),t}async request(e,t,r){let[n,i]=this.validateChain(t);if(!this.session)throw Error("Please call connect() before request()");return await this.getProvider(n).request({request:md({},e),chainId:`${n}:${i}`,topic:this.session.topic,expiry:r})}sendAsync(e,t,r,n){let i=new Date().getTime();this.request(e,r,n).then(e=>t(null,uO(i,e))).catch(e=>t(e,void 0))}async enable(){if(!this.client)throw Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:l7("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw Error("Sign Client not initialized");if(this.setNamespaces(e),this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();let{uri:r,response:n}=await this.client.authenticate(e,t);r&&(this.uri=r,this.events.emit("display_uri",r));let i=await n();if(this.session=i.session,this.session){let e=ge(this.session.namespaces);this.namespaces=f8(this.namespaces,e),await this.persist("namespaces",this.namespaces),this.onConnect()}return i}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){let{uri:t,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});t&&(this.uri=t,this.events.emit("display_uri",t));let n=await r();this.session=n;let i=ge(n.namespaces);return this.namespaces=f8(this.namespaces,i),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;let[r,n]=this.validateChain(e);this.getProvider(r).setDefaultChain(n,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){try{this.logger.info("Cleaning up inactive pairings...");let t=this.client.pairing.getAll();if(!ue(t))return;for(let r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}catch(e){this.logger.warn("Failed to cleanup pending pairings",e)}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,t;if(this.client=this.providerOpts.client||await fp.init({core:this.providerOpts.core,logger:this.providerOpts.logger||fk,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.org",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(r){throw this.logger.error("Failed to get session",r),Error(`The provided session: ${null==(t=null==(e=this.providerOpts)?void 0:e.session)?void 0:t.topic} doesn't exist in the Sign client`)}else{let e=this.client.session.getAll();this.session=e[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw Error("Sign Client not initialized");if(!this.session)throw Error("Session not initialized. Please call connect() before enable()");let e=[...new Set(Object.keys(this.session.namespaces).map(e=>l5(e)))];gi("client",this.client),gi("events",this.events),gi("disableProviderPing",this.disableProviderPing),e.forEach(e
24=>{if(!this.session)return;let t=function(e,t){let r=Object.keys(t.namespaces).filter(t=>t.includes(e));if(!r.length)return[];let n=[];return r.forEach(e=>{let r=t.namespaces[e].accounts;n.push(...r)}),n}(e,this.session);if(t?.length===0)return;let r=f6(t),n=mh(md({},f8(this.namespaces,this.optionalNamespaces)[e]),{accounts:t,chains:r});switch(e){case"eip155":this.rpcProviders[e]=new gP({namespace:n});break;case"algorand":this.rpcProviders[e]=new gH({namespace:n});break;case"solana":this.rpcProviders[e]=new gD({namespace:n});break;case"cosmos":this.rpcProviders[e]=new gj({namespace:n});break;case"polkadot":this.rpcProviders[e]=new gv({namespace:n});break;case"cip34":this.rpcProviders[e]=new gK({namespace:n});break;case"elrond":this.rpcProviders[e]=new gJ({namespace:n});break;case"multiversx":this.rpcProviders[e]=new g1({namespace:n});break;case"near":this.rpcProviders[e]=new g6({namespace:n});break;case"tezos":this.rpcProviders[e]=new g7({namespace:n});break;default:this.rpcProviders[e]=new mn({namespace:n})}})}registerEventListeners(){if(typeof this.client>"u")throw Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var t;let{topic:r}=e;r===(null==(t=this.session)?void 0:t.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var t;let{params:r,topic:n}=e;if(n!==(null==(t=this.session)?void 0:t.topic))return;let{event:i}=r;if("accountsChanged"===i.name){let e=i.data;e&&ue(e)&&this.events.emit("accountsChanged",e.map(f7))}else if("chainChanged"===i.name){let e=r.chainId,t=r.event.data,n=l5(e),i=gt(e)!==gt(t)?`${n}:${gt(t)}`:e;this.onChainChanged(i)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var r,n;if(e!==(null==(r=this.session)?void 0:r.topic))return;let{namespaces:i}=t,o=null==(n=this.client)?void 0:n.session.get(e);this.session=mh(md({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{var t;e.topic===(null==(t=this.session)?void 0:t.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",mh(md({},l7("USER_DISCONNECTED")),{data:e.topic})))}),this.on(fR,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[fP]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])})}setNamespaces(e){let{namespaces:t={},optionalNamespaces:r={},sessionProperties:n,scopedProperties:i}=e;this.optionalNamespaces=f8(t,r),this.sessionProperties=n,this.scopedProperties=i}validateChain(e){let[t,r]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,r];if(t&&!Object.keys(this.namespaces||{}).map(e=>l5(e)).includes(t))throw Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];let n=l5(Object.keys(this.namespaces)[0]),i=this.rpcProviders[n].getDefaultChain();return[n,i]}async requestAccounts(){let[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged(e,t=!1){if(!this.namespaces)return;let[r,n]=this.validateChain(e);if(!n)return;this.updateNamespaceChain(r,n);let i=this.getProvider(r).getDefaultChain();t?(this.events.emit("chainChanged",n),this.emitAccountsChangedOnChainChange({namespace:r,previousChainId:i,newChainId:e})):this.getProvider(r).setDefaultChain(n),await this.persist("namespaces",this.namespaces)}emitAccountsChangedOnChainChange({namespace:e,previousChainId:t,newChainId:r}){var n,i;try{if(t===r)return;let o=null==(i=null==(n=this.session)?void 0:n.namespaces[e])?void 0:i.accounts;if(!o)return;let s=o.filter(e=>e.includes(`${r}:`)).map(f7);if(!ue(s))return;this.events.emit("accountsChanged",s)}catch(e){this.logger.warn("Failed to emit accountsChanged on chain change",e)}}updateNamespaceChain(e,t){if(!this.namespaces)return;let r=this.namespaces[e]?e:`${e}:${t}`;this.namespaces[r]?this.namespaces[r]&&(this.namespaces[r].defaultChain=t):this.namespaces[r]={chains:[],methods:[],events:[],defaultChain:t}}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,t){var r;let n=(null==(r=this.session)?void 0:r.topic)||"";await this.client.core.storage.setItem(`${fO}/${e}${n}`,t)}async getFromStore(e){var t;let r=(null==(t=this.session)?void 0:t.topic)||"";return await this.client.core.storage.getItem(`${fO}/${e}${r}`)}async deleteFromStore(e){var t;let r=(null==(t=this.session)?void 0:t.topic)||"";await this.client.core.storage.removeItem(`${fO}/${e}${r}`)}async cleanupStorage(){var e;try{if((null==(e=this.client)?void 0:e.session.length)>0)return;for(let e of(await this.client.core.storage.getKeys()))e.startsWith(fO)&&await this.client.core.storage.removeItem(e)}catch(e){this.logger.warn("Failed to cleanup storage",e)}}}},73079:function(e,t){"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){let t=r(e);if(!t)throw Error(`${e} is not defined in Window`);return t}
24Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},42669:function(e,t,r){"use strict";t.D=void 0;let n=r(73079);t.D=function(){let e,t,r;try{e=n.getDocumentOrThrow(),t=n.getLocationOrThrow()}catch(e){return null}function i(...t){let r=e.getElementsByTagName("meta");for(let e=0;e<r.length;e++){let n=r[e],i=["itemprop","property","name"].map(e=>n.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(i.length&&i){let e=n.getAttribute("content");if(e)return e}}return""}let o=((r=i("name","og:site_name","og:title","twitter:title"))||(r=e.title),r),s=i("description","og:description","twitter:description","keywords");return{description:s,url:t.origin,icons:function(){let r=e.getElementsByTagName("link"),n=[];for(let e=0;e<r.length;e++){let i=r[e],o=i.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-1){let e=i.getAttribute("href");if(e){if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{let n=t.pathname.split("/");n.pop(),r+=n.join("/")+"/"+e}n.push(r)}else if(0===e.indexOf("//")){let r=t.protocol+e;n.push(r)}else n.push(e)}}}return n}(),name:o}}},65415:function(e,t){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=c(e),s=o[0],a=o[1],l=new i((s+a)*3/4-a),u=0,d=a>0?s-4:s;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(e,t,n){for(var i,o=[],s=t;s<n;s+=3)o.push(r[(i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]))>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},88e3:function(e,t,r){let n=r(76713);function i(e,t,r){let n=e[t]+e[r],i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let o=e[t+1]+n;i>=4294967296&&o++,e[t]=i,e[t+1]=o}function s(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,s,a){let c=d[s],l=d[s+1],h=d[a],p=d[a+1];i(u,e,t),o(u,e,c,l);let f=u[n]^u[e],g=u[n+1]^u[e+1];u[n]=g,u[n+1]=f,i(u,r,n),f=u[t]^u[r],g=u[t+1]^u[r+1],u[t]=f>>>24^g<<8,u[t+1]=g>>>24^f<<8,i(u,e,t),o(u,e,h,p),f=u[n]^u[e],g=u[n+1]^u[e+1],u[n]=f>>>16^g<<16,u[n+1]=g>>>16^f<<16,i(u,r,n),f=u[t]^u[r],g=u[t+1]^u[r+1],u[t]=g>>>31^f<<1,u[t+1]=f>>>31^g<<1}let c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),l=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,
246,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(e){return 2*e})),u=new Uint32Array(32),d=new Uint32Array(32);function h(e,t){let r=0;for(r=0;r<16;r++)u[r]=e.h[r],u[r+16]=c[r];for(u[24]=u[24]^e.t,u[25]=u[25]^e.t/4294967296,t&&(u[28]=~u[28],u[29]=~u[29]),r=0;r<32;r++)d[r]=s(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,l[16*r+0],l[16*r+1]),a(2,10,18,26,l[16*r+2],l[16*r+3]),a(4,12,20,28,l[16*r+4],l[16*r+5]),a(6,14,22,30,l[16*r+6],l[16*r+7]),a(0,10,20,30,l[16*r+8],l[16*r+9]),a(2,12,22,24,l[16*r+10],l[16*r+11]),a(4,14,16,26,l[16*r+12],l[16*r+13]),a(6,8,18,28,l[16*r+14],l[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^u[r]^u[r+16]}let p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function f(e,t,r,n){if(0===e||e>64)throw Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw Error("Illegal personal, expected Uint8Array with length is 16");let i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};p.fill(0),p[0]=e,t&&(p[1]=t.length),p[2]=1,p[3]=1,r&&p.set(r,32),n&&p.set(n,48);for(let e=0;e<16;e++)i.h[e]=c[e]^s(p,4*e);return t&&(g(i,t),i.c=128),i}function g(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[r]}function m(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;h(e,!0);let t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function y(e,t,r,i,o){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),o&&(o=n.normalizeInput(o));let s=f(r,t,i,o);return g(s,e),m(s)}e.exports={blake2b:y,blake2bHex:function(e,t,r,i,o){let s=y(e,t,r,i,o);return n.toHex(s)},blake2bInit:f,blake2bUpdate:g,blake2bFinal:m}},18262:function(e,t,r){let n=r(76713);function i(e,t,r,n,i,s){c[e]=c[e]+c[t]+i,c[n]=o(c[n]^c[e],16),c[r]=c[r]+c[n],c[t]=o(c[t]^c[r],12),c[e]=c[e]+c[t]+s,c[n]=o(c[n]^c[e],8),c[r]=c[r]+c[n],c[t]=o(c[t]^c[r],7)}function o(e,t){return e>>>t^e<<32-t}let s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),c=new Uint32Array(16),l=new Uint32Array(16);function u(e,t){let r=0;for(r=0;r<8;r++)c[r]=e.h[r],c[r+8]=s[r];for(c[12]^=e.t,c[13]^=e.t/4294967296,t&&(c[14]=~c[14]),r=0;r<16;r++){var n,o;l[r]=(n=e.b)[o=4*r]^n[o+1]<<8^n[o+2]<<16^n[o+3]<<24}for(r=0;r<10;r++)i(0,4,8,12,l[a[16*r+0]],l[a[16*r+1]]),i(1,5,9,13,l[a[16*r+2]],l[a[16*r+3]]),i(2,6,10,14,l[a[16*r+4]],l[a[16*r+5]]),i(3,7,11,15,l[a[16*r+6]],l[a[16*r+7]]),i(0,5,10,15,l[a[16*r+8]],l[a[16*r+9]]),i(1,6,11,12,l[a[16*r+10]],l[a[16*r+11]]),i(2,7,8,13,l[a[16*r+12]],l[a[16*r+13]]),i(3,4,9,14,l[a[16*r+14]],l[a[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=c[r]^c[r+8]}function d(e,t){if(!(e>0&&e<=32))throw Error("Incorrect output length, should be in [1, 32]");let r=t?t.length:0;if(t&&!(r>0&&r<=32))throw Error("Incorrect key length, should be in [1, 32]");let n={h:new Uint32Array(s),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(h(n,t),n.c=64),n}function h(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,u(e,!1),e.c=0),e.b[e.c++]=t[r]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;u(e,!0);let t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function f(e,t,r){r=r||32,e=n.normalizeInput(e);let i=d(r,t);return h(i,e),p(i)}e.exports={blake2s:f,blake2sHex:function(e,t,r){let i=f(e,t,r);return n.toHex(i)},blake2sInit:d,blake2sUpdate:h,blake2sFinal:p}},22565:function(e,t,r){let n=r(88e3),i=r(18262);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},76713:function(e){function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else if("string"==typeof e)t=new TextEncoder().encode(e);else throw Error("Input must be an string, Buffer or Uint8Array");return t},toHex:function(e){return Array.prototype.map.call(e,function(e){return(e<16?"0":"")+e.toString(16)}).join("")},debugPrint:function(e,r,n){let i="\n"+e+" = ";for(let o=0;o<r.length;o+=2){if(32===n)i+=t(r[o]).toUpperCase()+" "+t(r[o+1]).toUpperCase();else if(64===n)i+=t(r[o+1]).toUpperCase()+t(r[o]).toUpperCase();else throw Error("Invalid size "+n);o%6==4?i+="\n"+Array(e.length+4).join(" "):o<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=new Date().getTime(),i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;let o=new Date().getTime();console.log("Generated random input in "+(o-n)+"ms"),n=o;for(let o=0;o<r;o++){let r=e(i),o=new Date().getTime(),s=o-n;n=o,console.log("Hashed in "+s+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/1048576/(s/1e3)*100)/100+" MB PER SECOND")}}}},55872:function(e,t,r){"use strict";let n=r(65415),i=r(30551),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>
242147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|f(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(M(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(M(e,ArrayBuffer)||e&&M(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(M(e,SharedArrayBuffer)||e&&M(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);let i=function(e){var t;if(a.isBuffer(e)){let t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return l(e),s(e<0?0:0|p(e))}function d(e){let t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),n}function p(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||M(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=U[e[n]];return i}(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":var o,s;return o=t,s=r,0===o&&s===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}(this,t,r);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function m(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(o=r=+r)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}
vendor: 16,698 bytes, line 24
24else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,c/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else -1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(l(e,o+n)!==l(t,n)){r=!1;break}if(r)return o}return -1}function w(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:(192&(r=e[i+1]))==128&&(c=(31&t)<<6|63&r)>127&&(o=c);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(c=(15&t)<<12|(63&r)<<6|63&n)>2047&&(c<55296||c>57343)&&(o=c);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&c<1114112&&(o=c)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,i,o){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function E(e,t,r,n,i){N(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function x(e,t,r,n,i){N(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function A(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function S(e,t,r,n,o){return t=+t,r>>>=0,o||A(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function _(e,t,r,n,o){return t=+t,r>>>=0,o||A(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(l(e),e<=0)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},a.allocUnsafe=function(e){return u(e)},a.allocUnsafeSlow=function(e){return u(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(M(t,Uint8Array))i+t.length>n.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(a.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},a.byteLength=f,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},a.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},a.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},a.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?w(this,0,e):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){let e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,c=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<c;++e)if(l[e]!==u[e]){o=l[e],s=u[e];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){var i,o,s,a,c,l,u,d;if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let p=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let i;r=Number(r)||0;let o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;let s=t.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(n!=n)break;e[r+i]=n}return i}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,L($(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return s=t,a=r,L(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,s,a);case"base64":return c=t,l=r,L(D(e),this,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,d=r,L(function(e,t){let r,n;let i=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-u),this,u,d);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=j(function(e){P(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&T(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+16777216*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+16777216*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),a.prototype.readBigUInt64BE=j(function(e){P(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&T(e,this.length-8);let n=16777216*t+65536*this[++e]+256*this[++e]+this[++e],i=16777216*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=j(function(e){P(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&T(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+16777216*this[++e])}),a.prototype.readBigInt64BE=j(function(e){P(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&T(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(16777216*this[++e]+65536*this[++e]+256*this[++e]+r)}),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;C(this,e,t,r,n,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;C(this,e,t,r,n,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=j(function(e,t=0){return E(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=j(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=j(function(e,t=0){return E(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=j(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(e,t,r){return S(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return S(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return _(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return _(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},a.prototype.fill=function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let o=a.isBuffer(e)?e:a.from(e,n),s=o.length;
24if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};let I={};function k(e,t,r){I[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function O(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function N(e,t,r,n,i,o){if(e>r||e<t){let n;let i="bigint"==typeof t?"n":"";throw n=o>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(o+1)*8}${i}`:`>= -(2${i} ** ${(o+1)*8-1}${i}) and < 2 ** ${(o+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new I.ERR_OUT_OF_RANGE("value",n,e)}P(i,"offset"),(void 0===n[i]||void 0===n[i+o])&&T(i,n.length-(o+1))}function P(e,t){if("number"!=typeof e)throw new I.ERR_INVALID_ARG_TYPE(t,"number",e)}function T(e,t,r){if(Math.floor(e)!==e)throw P(e,r),new I.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new I.ERR_BUFFER_OUT_OF_BOUNDS;throw new I.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}k("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),k("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),k("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?i=O(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=O(i)),i+="n"),n+=` It must be ${t}. Received ${i}`},RangeError);let R=/[^+/0-9A-Za-z-_]/g;function $(e,t){let r;t=t||1/0;let n=e.length,i=null,o=[];for(let s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function D(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function L(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function M(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let U=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function j(e){return"undefined"==typeof BigInt?B:e}function B(){throw Error("BigInt not supported")}},81706:function(e,t){"use strict";t.Q=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},n=(t||{}).decode||i,o=0;o<e.length;){var s=e.indexOf("=",o);if(-1===s)break;var a=e.indexOf(";",o);if(-1===a)a=e.length;else if(a<s){o=e.lastIndexOf(";",s-1)+1;continue}var c=e.slice(o,s).trim();if(void 0===r[c]){var l=e.slice(s+1,a).trim();34===l.charCodeAt(0)&&(l=l.slice(1,-1)),r[c]=function(e,t){try{return t(e)}catch(t){return e}}(l,n)}o=a+1}return r},t.q=function(e,t,i){var s=i||{},a=s.encode||o;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!n.test(e))throw TypeError("argument name is invalid");var c=a(t);if(c&&!n.test(c))throw TypeError("argument val is invalid");var l=e+"="+c;if(null!=s.maxAge){var u=s.maxAge-0;if(isNaN(u)||!isFinite(u))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(u)}if(s.domain){if(!n.test(s.domain))throw TypeError("option domain is invali
24d");l+="; Domain="+s.domain}if(s.path){if(!n.test(s.path))throw TypeError("option path is invalid");l+="; Path="+s.path}if(s.expires){var d=s.expires;if("[object Date]"!==r.call(d)&&!(d instanceof Date)||isNaN(d.valueOf()))throw TypeError("option expires is invalid");l+="; Expires="+d.toUTCString()}if(s.httpOnly&&(l+="; HttpOnly"),s.secure&&(l+="; Secure"),s.partitioned&&(l+="; Partitioned"),s.priority)switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(s.sameSite)switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l};var r=Object.prototype.toString,n=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function i(e){return -1!==e.indexOf("%")?decode
24URIComponent(e):e}function o(e){return encodeURIComponent(e)}},5019:function(e,t,r){var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();(function(e){var t=void 0!==i&&i||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},n={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(n.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function h(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function p(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){if(this.bodyUsed=this.bodyUsed,this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(n.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(n.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(n.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var t;n.arrayBuffer&&n.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(n.blob)return this.blob().then(p);throw Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,i,o=d(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,r=h(t=new FileReader),i=(n=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?n[1]:"utf-8",t.readAsText(e,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},n.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=a(e),t=c(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[a(e)]},u.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},u.prototype.set=function(e,t){this.map[a(e)]=c(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),l(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),l(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),l(e)},n.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var m=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function y(e,r){if(!(this instanceof y))throw TypeError('Please use the "new" operator, this DOM object c
24onstructor cannot be called as a function.');var n,i,o=(r=r||{}).body;if(e instanceof y){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,r.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=r.credentials||this.credentials||"same-origin",(r.headers||!this.headers)&&(this.headers=new u(r.headers)),this.method=(i=(n=r.method||this.method||"GET").toUpperCase(),m.indexOf(i)>-1?i:n),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal||function(){if("AbortController"in t)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),("GET"===this.method||"HEAD"===this.method)&&("no-store"===r.cache||"no-cache"===r.cache)){var s=/([?&])_=[^&]*/;s.test(this.url)?this.url=this.url.replace(s,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function b(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function w(e,t){if(!(this instanceof w))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},g.call(y.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var v=[301,302,303,307,308];w.redirect=function(e,t){if(-1===v.indexOf(t))throw RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function C(r,i){return new Promise(function(o,s){var l=new y(r,i);if(l.signal&&l.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function h(){d.abort()}if(d.onload=function(){var e,t,r={statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();try{t.append(n,i)}catch(e){console.warn("Response "+e.message)}}}),t)};0===l.url.indexOf("file://")&&(d.status<200||d.status>599)?r.status=200:r.status=d.status,r.url="responseURL"in d?d.responseURL:r.headers.get("X-Request-URL");var n="response"in d?d.response:d.responseText;setTimeout(function(){o(new w(n,r))},0)},d.onerror=function(){setTimeout(function(){s(TypeError("Network request failed"))},0)},d.ontimeout=function(){setTimeout(function(){s(TypeError("Network request timed out"))},0)},d.onabort=function(){setTimeout(function(){s(new e.DOMException("Aborted","AbortError"))},0)},d.open(l.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(t){return e}}(l.url),!0),"include"===l.credentials?d.withCredentials=!0:"omit"===l.credentials&&(d.withCredentials=!1),"responseType"in d&&(n.blob?d.responseType="blob":n.arrayBuffer&&(d.responseType="arraybuffer")),i&&"object"==typeof i.headers&&!(i.headers instanceof u||t.Headers&&i.headers instanceof t.Headers)){var p=[];
24Object.getOwnPropertyNames(i.headers).forEach(function(e){p.push(a(e)),d.setRequestHeader(e,c(i.headers[e]))}),l.headers.forEach(function(e,t){-1===p.indexOf(t)&&d.setRequestHeader(t,e)})}else l.headers.forEach(function(e,t){d.setRequestHeader(t,e)});l.signal&&(l.signal.addEventListener("abort",h),d.onreadystatechange=function(){4===d.readyState&&l.signal.removeEventListener("abort",h)}),d.send(void 0===l._bodyInit?null:l._bodyInit)})}C.polyfill=!0,t.fetch||(t.fetch=C,t.Headers=u,t.Request=y,t.Response=w),e.Headers=u,e.Request=y,e.Response=w,e.fetch=C,Object.defineProperty(e,"__esModule",{value:!0})})({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=n.fetch?n:i;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},16483:function(e){var t;t=function(){"use strict";var e="millisecond",t="second",r="minute",n="hour",i="week",o="month",s="quarter",a="year",c="date",l="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},p="en",f={};f[p]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||"th")+"]"}};var g="$isDayjsObject",m=function(e){return e instanceof v||!(!e||!e[g])},y=function e(t,r,n){var i;if(!t)return p;if("string"==typeof t){var o=t.toLowerCase();f[o]&&(i=o),r&&(f[o]=r,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;f[a]=t,i=a}return!n&&i&&(p=i),i||!n&&p},b=function(e,t){if(m(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new v(r)},w={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+h(Math.floor(r/60),2,"0")+":"+h(r%60,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,o),s=r-i<0,a=t.clone().add(n+(s?-1:1),o);return+(-(n+(r-i)/(s?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(l){return({M:o,y:a,w:i,d:"day",D:c,h:n,m:r,s:t,ms:e,Q:s})[l]||String(l||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};w.l=y,w.i=m,w.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var v=function(){function h(e){this.$L=y(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[g]=!0}var p=h.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(w.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(u);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return w},p.isValid=function(){return this.$d.toString()!==l},p.isSame=function(e,t){var r=b(e);return this.startOf(t)<=r&&r<=this.endOf(t)},p.isAfter=function(e,t){return b(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<b(e)},p.$g=function(e,t,r){return w.u(e)?this[t]:this.set(r,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,s){var l=this,u=!!w.u(s)||s,d=w.p(e),h=function(e,t){var r=w.w(l.$u?Date.UTC(l.$y,t,e):new Date(l.$y,t,e),l);return u?r:r.endOf("day")},p=function(e,t){return w.w(l.toDate()[e].apply(l.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),l)},f=this.$W,g=this.$M,m=this.$D,y="set"+(this.$u?"UTC":"");switch(d){case a:return u?h(1,0):h(31,11);case o:return u?h(1,g):h(0,g+1);case i:var b=this.$locale().weekStart||0,v=(f<b?f+7:f)-b;return h(u?m-v:m+(6-v),g);case"day":case c:return p(y+"Hours",0);case n:return p(y+"Minutes",1);case r:return p(y+"Seconds",2);case t:return p(y+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(i,s){var l,u=w.p(i),d="set"+(this.$u?"UTC":""),h=((l={}).day=d+"Date",l[c]=d+"Date",l[o]=d+"Month",l[a]=d+"FullYear",l[n]=d+"Hours",l[r]=d+"Minutes",l[t]=d+"Seconds",l[e]=d+"Milliseconds",l)[u],p="day"===u?this.$D+(s-this.$W):s;if(u===o||u===a){var f=this.clone().set(c,1);f.$d[h](p),f.init(),this.$d=f.set(c,Math.min(this.$D,f.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[w.p(e)]()},p.add=function(e,s){var c,l=this;e=Number(e);var u=w.p(s),d=function(t){var r=b(l);return w.w(r.date(r.date()+Math.round(t*e)),l)};if(u===o)return this.set(o,this.$M+e);if(u===a)return this.set(a,this.$y+e);if("day"===u)return d(1);if(u===i)return d(7);var h=((c={})[r]=6e4,c[n]=36e5,c[t]=1e3,c)[u]||1,p=this.$d.getTime()+e*h;return w.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||l;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=w.z(this),o=this.$H,s=this.$m,a=this.$M,c=r.weekdays,u=r.months,h=r.meri
24diem,p=function(e,r,i,o){return e&&(e[r]||e(t,n))||i[r].slice(0,o)},f=function(e){return w.s(o%12||12,e,"0")},g=h||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(d,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return w.s(t.$y,4,"0");case"M":return a+1;case"MM":return w.s(a+1,2,"0");case"MMM":return p(r.monthsShort,a,u,3);case"MMMM":return p(u,a);case"D":return t.$D;case"DD":return w.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(r.weekdaysMin,t.$W,c,2);case"ddd":return p(r.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(o);case"HH":return w.s(o,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return g(o,s,!0);case"A":return g(o,s,!1);case"m":return String(s);case"mm":return w.s(s,2,"0");case"s":return String(t.$s);case"ss":return w.s(t.$s,2,"0");case"SSS":return w.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")})},p.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},p.diff=function(e,c,l){var u,d=this,h=w.p(c),p=b(e),f=(p.utcOffset()-this.utcOffset())*6e4,g=this-p,m=function(){return w.m(d,p)};switch(h){case a:u=m()/12;break;case o:u=m();break;case s:u=m()/3;break;case i:u=(g-f)/6048e5;break;case"day":u=(g-f)/864e5;break;case n:u=g/36e5;break;case r:u=g/6e4;break;case t:u=g/1e3;break;default:u=g}return l?u:w.a(u)},p.daysInMonth=function(){return this.endOf(o).$D},p.$locale=function(){return f[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=y(e,t,!0);return n&&(r.$L=n),r},p.clone=function(){return w.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},h}(),C=v.prototype;return b.prototype=C,[["$ms",e],["$s",t],["$m",r],["$H",n],["$W","day"],["$M",o],["$y",a],["$D",c]].forEach(function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),b.extend=function(e,t){return e.$i||(e(t,v,b),e.$i=!0),b},b.locale=y,b.isDayjs=m,b.unix=function(e){return b(1e3*e)},b.en=f[p],b.Ls=f,b.p={},b},e.exports=t()},10563:function(e){var t;t=function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||"th")+"]"}}},e.exports=t()},97148:function(e){var t;t=function(){return function(e,t,r){e=e||{};var n=t.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(e,t,r,i){return n.fromToBase(e,t,r,i)}r.en.relativeTime=i,n.fromToBase=function(t,n,o,s,a){for(var c,l,u,d=o.$locale().relativeTime||i,h=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=h.length,f=0;f<p;f+=1){var g=h[f];g.d&&(c=s?r(t).diff(o,g.d,!0):o.diff(t,g.d,!0));var m=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,m<=g.r||!g.r){m<=1&&f>0&&(g=h[f-1]);var y=d[g.l];a&&(m=a(""+m)),l="string"==typeof y?y.replace("%d",m):y(m,n,g.l,u);break}}if(n)return l;var b=u?d.future:d.past;return"function"==typeof b?b(l):b.replace("%s",l)},n.to=function(e,t){return o(e,t,this,!0)},n.from=function(e,t){return o(e,t,this)};var s=function(e){return e.$u?r.utc():r()};n.toNow=function(e){return this.to(s(this),e)},n.fromNow=function(e){return this.from(s(this),e)}}},e.exports=t()},7409:function(e){var t;t=function(){return function(e,t,r){r.updateLocale=function(e,t){var n=r.Ls[e];if(n)return(t?Object.keys(t):[]).forEach(function(e){n[e]=t[e]}),n}}},e.exports=t()},35376:function(e){"use strict";var t={single_source_shortest_paths:function(e,r,n){var i,o,s,a,c,l,u,d={},h={};h[r]=0;var p=t.PriorityQueue.make();for(p.push(r,0);!p.empty();)for(s in o=(i=p.pop()).value,a=i.cost,c=e[o]||{})c.hasOwnProperty(s)&&(l=a+c[s],u=h[s],(void 0===h[s]||u>l)&&(h[s]=l,p.push(s,l),d[s]=o));if(void 0!==n&&void 0===h[n])throw Error(["Could not find a path from ",r," to ",n,"."].join(""));return d},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var i=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,i={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},24654:function(e){"use strict";e.exports=function(e){for(var t=[],r=e.length,n=0;n<r;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319&&r>n+1){var o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(i=(i-55296)*1024+o-56320+65536,n+=1)}if(i<128){t.push(i);continue}if(i<2048){t.push(i>>6|192),t.push(63&i|128);continue}if(i<55296||i>=57344&&i<65536){t.push(i>>
2412|224),t.push(i>>6&63|128),t.push(63&i|128);continue}if(i>=65536&&i<=1114111){t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer}},2337:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw TypeError("The listener must be a function");var a=new i(n,o||e,s),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,o,s){var a=r?r+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,i),!0;case 5:return u.fn.call(u.context,t,n,i,o),!0;case 6:return u.fn.call(u.context,t,n,i,o,s),!0}for(l=1,c=Array(d-1);l<d;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,i);break;default:if(!c)for(h=1,c=Array(d-1);h<d;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||i&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[o]=1===l.length?l[0]:l:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},72100:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){var i;function o(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&(i={once:!0},"function"==typeof e.on&&g(e,"error",o,i))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var i,o,s,l=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):f(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var s,a=Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else for(var l=c.length,u=f(c,l),r=0;r<l;++r)n(u[r],this,t);return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit
24("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},65936:function(e,t,r){var n,i,o;o={canUseDOM:i=!!("undefined"!=typeof window&&window.document&&window.document.createElement),canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:i&&!!(window.addEventListener||window.attachEvent),canUseViewport:i&&!!window.screen},void 0!==(n=(function(){return o}).call(t,r,t,e))&&(e.exports=n)},72535:function(e,t,r){"use strict";var n=r(56237),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return n.isMemo(e)?s:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=s;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(f){var i=p(r);i&&i!==f&&e(t,i,n)}var s=u(r);d&&(s=s.concat(d(r)));for(var a=c(t),g=c(r),m=0;m<s.length;++m){var y=s[m];if(!o[y]&&!(n&&n[y])&&!(g&&g[y])&&!(a&&a[y])){var b=h(r,y);try{l(t,y,b)}catch(e){}}}}return t}},30551:function(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,l=c>>1,u=-7,d=r?i-1:0,h=r?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+d],d+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+d],d+=h,u-=8);if(0===o)o=1-l;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=l}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,l=8*o-i-1,u=(1<<l)-1,d=u>>1,h=23===i?5960464477539062e-23:0,p=n?0:o-1,f=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+d>=1?t+=h/c:t+=h*Math.pow(2,1-d),t*c>=2&&(s++,c/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=f,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+p]=255&s,p+=f,s/=256,l-=8);e[r+p-f]|=128*g}},53886:function(e,t,r){"use strict";r.d(t,{cC:function(){return j},Jc:function(){return e8},$G:function(){return W}});var n,i=r(59125),o=r(41766),s=r(50959),a=r(41392),c=r(89626),l=r.n(c),u=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function d(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=e.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(t.name=r[1],(l()[r[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var n=e.indexOf("-->");return{type:"comment",comment:-1!==n?e.slice(4,n):""}}for(var i=new RegExp(u),o=null;null!==(o=i.exec(e));)if(o[0].trim()){if(o[1]){var s=o[1].trim(),a=[s,""];s.indexOf("=")>-1&&(a=s.split("=")),t.attrs[a[0]]=a[1],i.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1))}return t}var h=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,p=/^\s*$/,f=Object.create(null),g={parse:function(e,t){t||(t={}),t.components||(t.components=f);var r,n=[],i=[],o=-1,s=!1;if(0!==e.indexOf("<")){var a=e.indexOf("<");n.push({type:"text",content:-1===a?e:e.substring(0,a)})}return e.replace(h,function(a,c){if(s){if(a!=="</"+r.name+">")return;s=!1}var l,u="/"!==a.charAt(1),h=a.startsWith("<!--"),f=c+a.length,g=e.charAt(f);if(h){var m=d(a);return o<0?n.push(m):(l=i[o]).children.push(m),n}if(u&&(o++,"tag"===(r=d(a)).type&&t.components[r.name]&&(r.type="component",s=!0),r.voidElement||s||!g||"<"===g||r.children.push({type:"text",content:e.slice(f,e.indexOf("<",f))}),0===o&&n.push(r),(l=i[o-1])&&l.children.push(r),i[o]=r),(!u||r.voidElement)&&(o>-1&&(r.voidElement||r.name===a.slice(2,-1))&&(r=-1==--o?n:i[o]),!s&&"<"!==g&&g)){l=-1===o?n:i[o].children;var y=e.indexOf("<",f),b=e.slice(f,-1===y?void 0:y);p.test(b)&&(b=" "),(y>-1&&o+l.length>=0||" "!==b)&&l.push({type:"text",content:b})}}),n}};function m(){if(console&&console.warn){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];"string"==typeof r[0]&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var y={};function b(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&y[t[0]]||("string"==typeof t[0]&&(y[t[0]]=new Date),m.apply(void 0,t))}var w=function(e,t){return function(){e.isInitialized?t():e.on("initialized",function r(){setTimeout(function(){e.off("initialized",r)},0),t()})}};function v(e,t,r){e.loadNamespaces(t,w(e,r))}function C(e,t,r,n){"string"==typeof r&&(r=[r]),r.forEach(function(t){0>e.options.ns.indexOf(t)&&e.options.ns.push(t)}),e.loadLanguages(t,w(e,n))}var E=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,x={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xa9","&#169;":"\xa9","&reg;":"\xae","&#174;":"\xae","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},A=function(e){return x[e]},S={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(E,A)}},_=["format"],I=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUne
24scape"];function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function N(e,t){if(!e)return!1;var r=e.props?e.props.children:e.children;return t?r.length>0:!!r}function P(e){return e?e.props?e.props.children:e.children:[]}function T(e){return Array.isArray(e)?e:[e]}var R=r(76132),$=r(99190),D=(0,s.createContext)(),L=function(){function e(){(0,R.Z)(this,e),this.usedNamespaces={}}return(0,$.Z)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach(function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}(),M=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function j(e){var t=e.children,r=e.count,c=e.parent,l=e.i18nKey,u=e.context,d=e.tOptions,h=e.values,p=e.defaults,f=e.components,y=e.ns,w=e.i18n,v=e.t,C=e.shouldUnescape,E=(0,o.Z)(e,M),x=(0,s.useContext)(D)||{},A=x.i18n,k=x.defaultNS,R=w||A||n,$=v||R&&R.t.bind(R);return function(e){var t=e.children,r=e.count,i=e.parent,c=e.i18nKey,l=e.context,u=e.tOptions,d=void 0===u?{}:u,h=e.values,p=e.defaults,f=e.components,y=e.ns,w=e.i18n,v=e.t,C=e.shouldUnescape,E=(0,o.Z)(e,I),x=w||n;if(!x)return b("You will need to pass in an i18next instance by using i18nextReactModule"),t;var A=v||x.t.bind(x)||function(e){return e};l&&(d.context=l);var k=O(O({},S),x.options&&x.options.react),R=y||A.ns||x.options&&x.options.defaultNS;R="string"==typeof R?[R]:R||["translation"];var $=p||function e(t,r){if(!t)return"";var n="",i=T(t),c=r.transSupportBasicHtmlNodes&&r.transKeepBasicHtmlNodesFor?r.transKeepBasicHtmlNodesFor:[];return i.forEach(function(t,i){if("string"==typeof t)n+="".concat(t);else if((0,s.isValidElement)(t)){var l=Object.keys(t.props).length,u=c.indexOf(t.type)>-1,d=t.props.children;if(!d&&u&&0===l)n+="<".concat(t.type,"/>");else if(d||u&&0===l){if(t.props.i18nIsDynamicList)n+="<".concat(i,"></").concat(i,">");else if(u&&1===l&&"string"==typeof d)n+="<".concat(t.type,">").concat(d,"</").concat(t.type,">");else{var h=e(d,r);n+="<".concat(i,">").concat(h,"</").concat(i,">")}}else n+="<".concat(i,"></").concat(i,">")}else if(null===t)m("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"===(0,a.Z)(t)){var p=t.format,f=Object.keys((0,o.Z)(t,_));if(1===f.length){var g=p?"".concat(f[0],", ").concat(p):f[0];n+="{{".concat(g,"}}")}else m("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",t)}else m("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",t)}),n}(t,k)||k.transEmptyNodeValue||c,D=k.hashTransKey,L=c||(D?D($):$),M=h?d.interpolation:{interpolation:O(O({},d.interpolation),{},{prefix:"#$?",suffix:"?$#"})},U=O(O(O(O({},d),{},{count:r},h),M),{},{defaultValue:$,ns:R}),j=function(e,t,r,n,i,o){if(""===t)return[];var c=n.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(c.join("|")).test(t);if(!e&&!l)return[t];var u={};!function e(t){T(t).forEach(function(t){"string"==typeof t||(N(t)?e(P(t)):"object"!==(0,a.Z)(t)||(0,s.isValidElement)(t)||Object.assign(u,t))})}(e);var d=g.parse("<0>".concat(t,"</0>")),h=O(O({},u),i);function p(e,t,r){var n=P(e),i=m(n,t.children,r);return"[object Array]"===Object.prototype.toString.call(n)&&n.every(function(e){return(0,s.isValidElement)(e)})&&0===i.length?n:i}function f(e,t,r,n,i){e.dummy&&(e.children=t),r.push((0,s.cloneElement)(e,O(O({},e.props),{},{key:n}),i?void 0:t))}function m(t,i,u){var d=T(t);return T(i).reduce(function(t,i,g){var y=i.children&&i.children[0]&&i.children[0].content&&r.services.interpolator.interpolate(i.children[0].content,h,r.language);if("tag"===i.type){var b,w,v,C=d[parseInt(i.name,10)];!C&&1===u.length&&u[0][i.name]&&(C=u[0][i.name]),C||(C={});var E=0!==Object.keys(i.attrs).length?(b={props:i.attrs},(v=O({},w=C)).props=Object.assign(b.props,w.props),v):C,x=(0,s.isValidElement)(E),A=x&&N(i,!0)&&!i.voidElement,S=l&&"object"===(0,a.Z)(E)&&E.dummy&&!x,_="object"===(0,a.Z)(e)&&null!==e&&Object.hasOwnProperty.call(e,i.name);if("string"==typeof E){var I=r.services.interpolator.interpolate(E,h,r.language);t.push(I)}else if(N(E)||A){var k=p(E,i,u);f(E,k,t,g)}else if(S){var P=m(d,i.children,u);t.push((0,s.cloneElement)(E,O(O({},E.props),{},{key:g}),P))}
24else if(Number.isNaN(parseFloat(i.name))){if(_){var T=p(E,i,u);f(E,T,t,g,i.voidElement)}else if(n.transSupportBasicHtmlNodes&&c.indexOf(i.name)>-1){if(i.voidElement)t.push((0,s.createElement)(i.name,{key:"".concat(i.name,"-").concat(g)}));else{var R=m(d,i.children,u);t.push((0,s.createElement)(i.name,{key:"".concat(i.name,"-").concat(g)},R))}}else if(i.voidElement)t.push("<".concat(i.name," />"));else{var $=m(d,i.children,u);t.push("<".concat(i.name,">").concat($,"</").concat(i.name,">"))}}else if("object"!==(0,a.Z)(E)||x)1===i.children.length&&y?t.push((0,s.cloneElement)(E,O(O({},E.props),{},{key:g}),y)):t.push((0,s.cloneElement)(E,O(O({},E.props),{},{key:g})));else{var D=i.children[0]?y:null;D&&t.push(D)}}else if("text"===i.type){var L=n.transWrapTextNodes,M=o?n.unescape(r.services.interpolator.interpolate(i.content,h,r.language)):r.services.interpolator.interpolate(i.content,h,r.language);L?t.push((0,s.createElement)(L,{key:"".concat(i.name,"-").concat(g)},M)):t.push(M)}return t},[])}return P(m([{dummy:!0,children:e||[]}],d,T(e||[]))[0])}(f||t,L?A(L,U):$,x,k,U,C),B=void 0!==i?i:k.defaultTransParent;return B?(0,s.createElement)(B,E,j):j}(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({children:t,count:r,parent:c,i18nKey:l,context:u,tOptions:void 0===d?{}:d,values:h,defaults:p,components:f,ns:y||$&&$.ns||k||R&&R.options&&R.options.defaultNS,i18n:R,t:v,shouldUnescape:C},E))}var B=r(48798);function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var H=function(e,t){var r=(0,s.useRef)();return(0,s.useEffect)(function(){r.current=t?r.current:e},[e,t]),r.current};function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.i18n,i=(0,s.useContext)(D)||{},o=i.i18n,c=i.defaultNS,l=r||o||n;if(l&&!l.reportNamespaces&&(l.reportNamespaces=new L),!l){b("You will need to pass in an i18next instance by using initReactI18next");var u=function(e,t){return"string"==typeof t?t:t&&"object"===(0,a.Z)(t)&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},d=[u,{},!1];return d.t=u,d.i18n={},d.ready=!1,d}l.options.react&&void 0!==l.options.react.wait&&b("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var h=z(z(z({},S),l.options.react),t),p=h.useSuspense,f=h.keyPrefix,g=e||c||l.options&&l.options.defaultNS;g="string"==typeof g?[g]:g||["translation"],l.reportNamespaces.addUsedNamespaces&&l.reportNamespaces.addUsedNamespaces(g);var m=(l.isInitialized||l.initializedStoreOnce)&&g.every(function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:r.lng,precheck:function(t,n){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.
24isLanguageChangingTo,e))return!1}}):function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],i=!!t.options&&t.options.fallbackLng,o=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var s=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return -1===n||2===n};return(!(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1)||!t.services.backendConnector.backend||!t.isLanguageChangingTo||!!s(t.isLanguageChangingTo,e))&&!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(n,e)&&(!i||s(o,e)))}(e,t,r):(b("i18n.languages were undefined or empty",t.languages),!0)}(e,l,h)});function y(){return l.getFixedT(t.lng||null,"fallback"===h.nsMode?g:g[0],f)}var w=(0,s.useState)(y),E=(0,B.Z)(w,2),x=E[0],A=E[1],_=g.join();t.lng&&(_="".concat(t.lng).concat(_));var I=H(_),k=(0,s.useRef)(!0);(0,s.useEffect)(function(){var e=h.bindI18n,r=h.bindI18nStore;function n(){k.current&&A(y)}return k.current=!0,m||p||(t.lng?C(l,t.lng,g,function(){k.current&&A(y)}):v(l,g,function(){k.current&&A(y)})),m&&I&&I!==_&&k.current&&A(y),e&&l&&l.on(e,n),r&&l&&l.store.on(r,n),function(){k.current=!1,e&&l&&e.split(" ").forEach(function(e){return l.off(e,n)}),r&&l&&r.split(" ").forEach(function(e){return l.store.off(e,n)})}},[l,_]);var O=(0,s.useRef)(!0);(0,s.useEffect)(function(){k.current&&!O.current&&A(y),O.current=!1},[l,f]);var N=[x,l,m];if(N.t=x,N.i18n=l,N.ready=m,m||!m&&!p)return N;throw new Promise(function(e){t.lng?C(l,t.lng,g,function(){return e()}):v(l,g,function(){return e()})})}function q(e){var t=e.i18n,r=e.defaultNS,n=e.children,i=(0,s.useMemo)(function(){return{i18n:t,defaultNS:r}},[t,r]);return(0,s.createElement)(D.Provider,{value:i},n)}var V=r(4529),K=r(72535),G=r.n(K),Z=r(47844),Y={defaultNS:"common",errorStackTraceLimit:0,i18n:{defaultLocale:"en",locales:["en"]},get initImmediate(){return"undefined"!=typeof window},interpolation:{escapeValue:!1},load:"currentOnly",localeExtension:"json",localePath:"./public/locales",localeStructure:"{{lng}}/{{ns}}",react:{useSuspense:!1},reloadOnPrerender:!1,serializeConfig:!0,use:[]},J=["i18n"],X=["i18n"];function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var et=["backend","detection"],er=function(e){if("string"!=typeof(null==e?void 0:e.lng))throw Error("config.lng was not passed into createConfig");var t,r,n,i=e.i18n,s=(0,o.Z)(e,J),c=Y.i18n,l=ee(ee(ee(ee({},(0,o.Z)(Y,X)),s),c),i),u=l.defaultNS,d=l.lng,h=l.localeExtension,p=l.localePath,f=l.nonExplicitSupportedLngs,g=l.locales.filter(function(e){return"default"!==e});if("cimode"===d)return l;if(void 0===l.fallbackLng&&(l.fallbackLng=l.defaultLocale,"default"===l.fallbackLng)){var m=(0,B.Z)(g,1);l.fallbackLng=m[0]}var y=null==e?void 0:null===(t=e.interpolation)||void 0===t?void 0:t.prefix,b=null==e?void 0:null===(r=e.interpolation)||void 0===r?void 0:r.suffix,w=null!=y?y:"{{",v=null!=b?b:"}}";"string"!=typeof(null==e?void 0:e.localeStructure)&&(y||b)&&(l.localeStructure="".concat(w,"lng").concat(v,"/").concat(w,"ns").concat(v));var C=l.fallbackLng,E=l.localeStructure;if(f){var x=function(e,t){var r=t.split("-"),n=(0,B.Z)(r,1)[0];return e[t]=[n],e};if("string"==typeof C)l.fallbackLng=l.locales.filter(function(e){return e.includes("-")}).reduce(x,{default:[C]});else if(Array.isArray(C))l.fallbackLng=l.locales.filter(function(e){return e.includes("-")}).reduce(x,{default:C});else if("object"===(0,a.Z)(C))l.fallbackLng=Object.entries(l.fallbackLng).reduce(function(e,t){var r=(0,B.Z)(t,2),n=r[0],i=r[1];return e[n]=n.includes("-")?Array.from(new Set([n.split("-")[0]].concat((0,Z.Z)(i)))):i,e},C);else if("function"==typeof C)throw Error("If nonExplicitSupportedLngs is true, no functions are allowed for fallbackLng")}return(null==e?void 0:null===(n=e.use)||void 0===n?void 0:n.some(function(e){return"backend"===e.type}))||("string"==typeof p?l.backend={addPath:"".concat(p,"/").concat(E,".missing.").concat(h),loadPath:"".concat(p,"/").concat(E,".").concat(h)}:"function"!=typeof p||(l.backend={addPath:function(e,t){return p(e,t,!0)},loadPath:function(e,t){return p(e,t,!1)}})),"string"==typeof l.ns||Array.isArray(l.ns)||(l.ns=[u]),et.forEach(function(t){e[t]&&(l[t]=ee(ee({},l[t]),e[t]))}),l},en=r(42326),ei=r(61912),eo=r(93460),es=r(35922),ea=r(65573);function ec(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function el(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
24t%2?ec(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ec(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var eu={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},ed=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,R.Z)(this,e),this.init(t,r)}return(0,$.Z)(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||eu,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,el(el({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}()),eh=function(){function e(){(0,R.Z)(this,e),this.observers={}}return(0,$.Z)(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach(function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)}),this}},{key:"off",value:function(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(function(e){return e!==t})}}},{key:"emit",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(void 0,r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(t){t.apply(t,[e].concat(r))})}}]),e}();function ep(){var e,t,r=new Promise(function(r,n){e=r,t=n});return r.resolve=e,r.reject=t,r}function ef(e){return null==e?"":""+e}function eg(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=n(o.shift());!e[s]&&r&&(e[s]=new r),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:n(o.shift())}}function em(e,t,r){var n=eg(e,t,Object);n.obj[n.k]=r}function ey(e,t){var r=eg(e,t),n=r.obj,i=r.k;if(n)return n[i]}function eb(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var ew={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function ev(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return ew[e]}):e}var eC="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,eE=[" ",",","?","!",";"];function ex(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),i=e,o=0;o<n.length;++o){if(!i||"string"==typeof i[n[o]]&&o+1<n.length)return;if(void 0===i[n[o]]){for(var s=2,a=n.slice(o,o+s).join(r),c=i[a];void 0===c&&n.length>o+s;)s++,c=i[a=n.slice(o,o+s).join(r)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(a)){if("string"==typeof c)return c;if(a&&"string"==typeof c[a])return c[a]}var l=n.slice(o+s).join(r);if(l)return ex(c,l,r);return}i=i[n[o]]}return i}}function eA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
24t%2?eA(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eA(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var e_=function(e){(0,ei.Z)(n,e);var t,r=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,es.Z)(n);return e=t?Reflect.construct(r,arguments,(0,es.Z)(this).constructor):r.apply(this,arguments),(0,eo.Z)(this,e)});function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(0,R.Z)(this,n),t=r.call(this),eC&&eh.call((0,en.Z)(t)),t.data=e||{},t.options=i,void 0===t.options.keySeparator&&(t.options.keySeparator="."),void 0===t.options.ignoreJSONStructure&&(t.options.ignoreJSONStructure=!0),t}return(0,$.Z)(n,[{key:"addNamespaces",value:function(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];r&&"string"!=typeof r&&(s=s.concat(r)),r&&"string"==typeof r&&(s=s.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(s=e.split("."));var a=ey(this.data,s);return a||!o||"string"!=typeof r?a:ex(this.data&&this.data[e]&&this.data[e][t],r,i)}},{key:"addResource",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=[e,t];r&&(s=s.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(s=e.split("."),n=t,t=s[1]),this.addNamespaces(t),em(this.data,s,n),i.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in r)("string"==typeof r[i]||"[object Array]"===Object.prototype.toString.apply(r[i]))&&this.addResource(e,t,i,r[i],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),n=r,r=t,t=s[1]),this.addNamespaces(t);var a=ey(this.data,s)||{};n?function e(t,r,n){for(var i in r)"__proto__"!==i&&"constructor"!==i&&(i in t?"string"==typeof t[i]||t[i]instanceof String||"string"==typeof r[i]||r[i]instanceof String?n&&(t[i]=r[i]):e(t[i],r[i],n):t[i]=r[i]);return t}(a,r,i):a=eS(eS({},a),r),em(this.data,s,a),o.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?eS(eS({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(function(e){return t[e]&&Object.keys(t[e]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(eh),eI={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var o=this;return e.forEach(function(e){o.processors[e]&&(t=o.processors[e].process(t,r,n,i))}),t}};function ek(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
24t%2?ek(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ek(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var eN={},eP=function(e){(0,ei.Z)(n,e);var t,r=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,es.Z)(n);return e=t?Reflect.construct(r,arguments,(0,es.Z)(this).constructor):r.apply(this,arguments),(0,eo.Z)(this,e)});function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,R.Z)(this,n),t=r.call(this),eC&&eh.call((0,en.Z)(t)),!function(e,t,r){e.forEach(function(e){t[e]&&(r[e]=t[e])})}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,(0,en.Z)(t)),t.options=i,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t.logger=ed.create("translator"),t}return(0,$.Z)(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=r&&e.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,r){t=t||"",r=r||"";var n=eE.filter(function(e){return 0>t.indexOf(e)&&0>r.indexOf(e)});if(0===n.length)return!0;var i=new RegExp("(".concat(n.map(function(e){return"?"===e?"\\?":e}).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(r);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,r,n);if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var c=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(n)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==(0,a.Z)(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"===(0,a.Z)(t)&&(t=eO({},t)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,c=this.extractFromKey(e[e.length-1],t),l=c.key,u=c.namespaces,d=u[u.length-1],h=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&"cimode"===h.toLowerCase()){if(p){var f=t.nsSeparator||this.options.nsSeparator;return o?{res:"".concat(d).concat(f).concat(l),usedKey:l,exactUsedKey:l,usedLng:h,usedNS:d}:"".concat(d).concat(f).concat(l)}return o?{res:l,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:d}:l}var g=this.resolve(e,t),m=g&&g.res,y=g&&g.usedKey||l,b=g&&g.exactUsedKey||l,w=Object.prototype.toString.apply(m),v=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,E="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(C&&m&&E&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(w)&&!("string"==typeof v&&"[object Array]"===w)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var x=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,m,eO(eO({},t),{},{ns:u})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(g.res=x,g):x}if(s){var A="[object Array]"===w,S=A?[]:{},_=A?b:y;for(var I in m)if(Object.prototype.hasOwnProperty.call(m,I)){var k="".concat(_).concat(s).concat(I
vendor: 4,143 bytes, line 24
24);S[I]=this.translate(k,eO(eO({},t),{joinArrays:!1,ns:u})),S[I]===k&&(S[I]=m[I])}m=S}}else if(C&&"string"==typeof v&&"[object Array]"===w)(m=m.join(v))&&(m=this.extendTranslation(m,e,t,r));else{var O=!1,N=!1,P=void 0!==t.count&&"string"!=typeof t.count,T=n.hasDefaultValue(t),R=P?this.pluralResolver.getSuffix(h,t.count,t):"",$=t["defaultValue".concat(R)]||t.defaultValue;!this.isValidLookup(m)&&T&&(O=!0,m=$),this.isValidLookup(m)||(N=!0,m=l);var D=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:m,L=T&&$!==m&&this.options.updateMissing;if(N||O||L){if(this.logger.log(L?"updateKey":"missingKey",h,d,l,L?$:m),s){var M=this.resolve(l,eO(eO({},t),{},{keySeparator:!1}));M&&M.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var U=[],j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&j&&j[0])for(var B=0;B<j.length;B++)U.push(j[B]);else"all"===this.options.saveMissingTo?U=this.languageUtils.toResolveHierarchy(t.lng||this.language):U.push(t.lng||this.language);var F=function(e,r,n){var o=T&&n!==m?n:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,d,r,o,L,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,d,r,o,L,t),i.emit("missingKey",e,d,r,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?U.forEach(function(e){i.pluralResolver.getSuffixes(e,t).forEach(function(r){F([e],l+r,t["defaultValue".concat(r)]||$)})}):F(U,l,$))}m=this.extendTranslation(m,e,t,g,r),N&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(l)),(N||O)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(l):l,O?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(g.res=m,g):m}},{key:"extendTranslation",value:function(e,t,r,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,eO(eO({},this.options.interpolation.defaultVariables),r),n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(eO(eO({},r),{interpolation:eO(eO({},this.options.interpolation),r.interpolation)}));var s,a="string"==typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var c=e.match(this.interpolator.nestingRegexp);s=c&&c.length}var l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l=eO(eO({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(r.nest=!1)}!r.lng&&"v1"!==this.options.compatibilityAPI&&n&&n.res&&(r.lng=n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,n=Array(e),s=0;s<e;s++)n[s]=arguments[s];return i&&i[0]===n[0]&&!r.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):o.translate.apply(o,n.concat([t]))},r)),r.interpolation&&this.interpolator.reset()}var d=r.postProcess||this.options.postProcess,h="string"==typeof d?[d]:d;return null!=e&&h&&h.length&&!1!==r.applyPostProcessor&&(e=eI.handle(h,e,t,this.options&&this.options.postProcessPassResolved?eO({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!s.isValidLookup(t)){var c=s.extractFromKey(e,a),l=c.key;r=l;var u=c.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,h=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),p=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f
24=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach(function(e){s.isValidLookup(t)||(o=e,!eN["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(eN["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(r,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(function(r){if(!s.isValidLookup(t)){i=r;var o,c=[l];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(c,l,r,e,a);else{d&&(u=s.pluralResolver.getSuffix(r,a.count,a));var u,f="".concat(s.options.pluralSeparator,"zero");if(d&&(c.push(l+u),h&&c.push(l+f)),p){var g="".concat(l).concat(s.options.contextSeparator).concat(a.context);c.push(g),d&&(c.push(g+u),h&&c.push(g+f))}}for(;o=c.pop();)s.isValidLookup(t)||(n=o,t=s.getResource(r,e,o,a))}}))})}}),{res:t,usedKey:r,exactUsedKey:n,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),n}(eh);function eT(e){return e.charAt(0).toUpperCase()+e.slice(1)}var eR=function(){function e(t){(0,R.Z)(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ed.create("languageUtils")}return(0,$.Z)(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map(function(e){return e.toLowerCase()}):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=eT(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=eT(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=eT(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach(function(e){if(!t){var n=r.formatLanguageCode(e);(!r.options.supportedLngs||r.isSupportedCode(n))&&(t=n)}}),!t&&this.options.supportedLngs&&e.forEach(function(e){if(!t){var n=r.getLanguagePartFromCode(e);if(r.isSupportedCode(n))return t=n;t=r.options.supportedLngs.find(function(e){if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&0===e.indexOf(n))return e})}}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}}
vendor: 4,699 bytes, line 24
24,{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(r.isSupportedCode(e)?i.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach(function(e){0>i.indexOf(e)&&o(r.formatLanguageCode(e))}),i}}]),e}(),e$=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],eD={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},eL=["v1","v2","v3"],eM={zero:0,one:1,two:2,few:3,many:4,other:5},eU=function(){function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,R.Z)(this,e),this.languageUtils=t,this.options=n,this.logger=ed.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(r={},e$.forEach(function(e){e.lngs.forEach(function(t){r[t]={numbers:e.nr,plurals:eD[e.fc]}})}),r)}return(0,$.Z)(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};
24return this.getSuffixes(e,r).map(function(e){return"".concat(t).concat(e)})}},{key:"getSuffixes",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(function(e,t){return eM[e]-eM[t]}).map(function(e){return"".concat(t.options.prepend).concat(e)}):n.numbers.map(function(n){return t.getSuffix(e,n,r)}):[]}},{key:"getSuffix",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(n.select(t)):this.getSuffixRetroCompatible(n,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var r=this,n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!eL.includes(this.options.compatibilityJSON)}}]),e}();function ej(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ej(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ej(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eF(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],s=void 0!==(n=ey(e,r))?n:ey(t,r);return!s&&o&&"string"==typeof r&&void 0===(s=ex(e,r,i))&&(s=ex(t,r,i)),s}var ez=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,R.Z)(this,e),this.logger=ed.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return(0,$.Z)(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:ev,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?eb(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?eb(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?eb(t.nestingPrefix):t.nestingPrefixEscaped||eb("$t("),this.nestingSuffix=t.nestingSuffix?eb(t.nestingSuffix):t.nestingSuffixEscaped||eb(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var i,o,s,a=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(0>e.indexOf(a.formatSeparator)){var i=eF(t,c,e,a.options.keySeparator,a.options.ignoreJSONStructure);return a.alwaysFormat?a.format(i,void 0,r,eB(eB(eB({},n),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),l=o.join(a.formatSeparator).trim();return a.format(eF(t,c,s,a.options.keySeparator,a.options.ignoreJSONStructure),l,r,eB(eB(eB({},n),t),{},{interpolationkey:s}))};this.resetRegExp();var d=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,h=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?l(a.escape(e)):l(e)}}
24].forEach(function(t){for(s=0;i=t.regex.exec(e);){var r=i[1].trim();if(void 0===(o=u(r))){if("function"==typeof d){var c=d(e,i,n);o="string"==typeof c?c:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))o="";else if(h){o=i[0];continue}else a.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=ef(o));var l=t.safeValue(o);if(e=e.replace(i[0],l),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}}),e}},{key:"nest",value:function(e,t){var r,n,i,o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){var r=this.nestingOptionsSeparator;if(0>e.indexOf(r))return e;var n=e.split(new RegExp("".concat(r,"[ ]*{"))),o="{".concat(n[1]);e=n[0];var s=(o=this.interpolate(o,i)).match(/'/g),a=o.match(/"/g);(s&&s.length%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i=eB(eB({},t),i))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(o)}return delete i.defaultValue,e}for(;r=this.nestingRegexp.exec(e);){var c=[];(i=(i=eB({},s)).replace&&"string"!=typeof i.replace?i.replace:i).applyPostProcessor=!1,delete i.defaultValue;var l=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var u=r[1].split(this.formatSeparator).map(function(e){return e.trim()});r[1]=u.shift(),c=u,l=!0}if((n=t(a.call(this,r[1].trim(),i),i))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=ef(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),l&&(n=c.reduce(function(e,t){return o.format(e,t,s.lng,eB(eB({},s),{},{interpolationkey:r[1].trim()}))},n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}();function eH(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eW(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eH(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eH(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eq(e){var t={};return function(r,n,i){var o=n+JSON.stringify(i),s=t[o];return s||(s=e(n,i),t[o]=s),s(r)}}var eV=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,R.Z)(this,e),this.logger=ed.create("formatter"),this.options=t,this.formats={number:eq(function(e,t){var r=new Intl.NumberFormat(e,eW({},t));return function(e){return r.format(e)}}),currency:eq(function(e,t){var r=new Intl.NumberFormat(e,eW(eW({},t),{},{style:"currency"}));return function(e){return r.format(e)}}),datetime:eq(function(e,t){var r=new Intl.DateTimeFormat(e,eW({},t));return function(e){return r.format(e)}}),relativetime:eq(function(e,t){var r=new Intl.RelativeTimeFormat(e,eW({},t));return function(e){return r.format(e,t.range||"day")}}),list:eq(function(e,t){var r=new Intl.ListFormat(e,eW({},t));return function(e){return r.format(e)}})},this.init(t)}return(0,$.Z)(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=t.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=eq(t)}},{key:"format",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce(function(e,t){var o=function(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);"currency"===t&&0>i.indexOf(":")?r.currency||(r.currency=i.trim()):"relativetime"===t&&0>i.indexOf(":")?r.range||(r.range=i.trim()):i.split(";").forEach(function(e){if(e){var t=e.split(":"),n=(0,ea.Z)(t),i=n[0],o=n.slice(1).join(":").trim().replace(/^'+|'+$/g,"");r[i.trim()]||(r[i.trim()]=o),"false"===o&&(r[i.trim()]=!1),"true"===o&&(r[i.trim()]=!0),isNaN(o)||(r[i.trim()]=parseInt(o,10))}})}return{formatName:t,formatOptions:r}}(t),s=o.formatName,a=o.formatOptions;if(n.formats[s]){var c=e;try{var l=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},u=l.locale||l.lng||i.locale||i.lng||r;c=n.formats[s](e,u,eW(eW(eW({},a),i),l))}catch(e){n.logger.warn(e)}return c}return n.logger.warn("there was no format function for ".concat(s)),e},e)}}]),e}();function eK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
24t%2?eK(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eK(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var eZ=function(e){(0,ei.Z)(n,e);var t,r=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,es.Z)(n);return e=t?Reflect.construct(r,arguments,(0,es.Z)(this).constructor):r.apply(this,arguments),(0,eo.Z)(this,e)});function n(e,t,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,R.Z)(this,n),o=r.call(this),eC&&eh.call((0,en.Z)(o)),o.backend=e,o.store=t,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=ed.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return(0,$.Z)(n,[{key:"queueLoad",value:function(e,t,r,n){var i=this,o={},s={},a={},c={};return e.forEach(function(e){var n=!0;t.forEach(function(t){var a="".concat(e,"|").concat(t);!r.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,n=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===c[t]&&(c[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),r&&this.store.addResourceBundle(i,o,r),this.state[e]=t?-1:2;var s={};this.queue.forEach(function(r){var n,a,c,l;(c=(a=eg(r.loaded,[i],Object)).obj)[l=a.k]=c[l]||[],n||c[l].push(o),void 0!==r.pending[e]&&(delete r.pending[e],r.pendingCount--),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(function(e){s[e]||(s[e]={});var t=r.loaded[e];t.length&&t.forEach(function(t){void 0===s[e][t]&&(s[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;var a=function(a,c){if(n.readingCalls--,n.waitingReads.length>0){var l=n.waitingReads.shift();n.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(a&&c&&i<n.maxRetries){setTimeout(function(){n.read.call(n,e,t,r,i+1,2*o,s)},o);return}s(a,c)},c=this.backend[r].bind(this.backend);if(2===c.length){try{var l=c(e,t);l&&"function"==typeof l.then?l.then(function(e){return a(null,e)}).catch(a):a(null,l)}catch(e){a(e)}return}return c(e,t,a)}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(function(e){r.loadOne(e)})}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,function(n,s){n&&t.logger.warn("".concat(r,"loading namespace ").concat(o," for language ").concat(i," failed"),n),!n&&s&&t.logger.log("".concat(r,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,n,s)})}},{key:"saveMissing",value:function(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=r&&""!==r){if(this.backend&&this.backend.create){var a,c=eG(eG({},o),{},{isUpdate:i}),l=this.backend.create.bind(this.backend);if(l.length<6)try{(a=5===l.length?l(e,t,r,n,c):l(e,t,r,n))&&"function"==typeof a.then?a.then(function(e){return s(null,e)}).catch(s):s(null,a)}catch(e){s(e)}else l(e,t,r,n,s,c)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}]),n}(eh);function eY(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===(0,a.Z)(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===(0,a.Z)(e[2])||"object"===(0,a.Z)(e[3])){var r=e[3]||e[2];Object.keys(r).forEach(function(e){t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function eJ(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function eX(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eQ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
24t%2?eX(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eX(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function e0(){}var e1=function(e){(0,ei.Z)(n,e);var t,r=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,es.Z)(n);return e=t?Reflect.construct(r,arguments,(0,es.Z)(this).constructor):r.apply(this,arguments),(0,eo.Z)(this,e)});function n(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if((0,R.Z)(this,n),e=r.call(this),eC&&eh.call((0,en.Z)(e)),e.options=eJ(t),e.services={},e.logger=ed,e.modules={external:[]},!function(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))})}((0,en.Z)(e)),i&&!e.isInitialized&&!t.isClone){if(!e.options.initImmediate)return e.init(t,i),(0,eo.Z)(e,(0,en.Z)(e));setTimeout(function(){e.init(t,i)},0)}return e}return(0,$.Z)(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));var n=eY();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=eQ(eQ(eQ({},n),this.options),eJ(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=eQ(eQ({},n.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){this.modules.logger?ed.init(i(this.modules.logger),this.options):ed.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=eV);var o,s=new eR(this.options);this.store=new e_(this.options.resources,this.options);var a=this.services;a.logger=ed,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new eU(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new ez(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new eZ(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))}),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new eP(this.services,this.options),this.translator.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))}),this.modules.external.forEach(function(t){t.init&&t.init(e)})}if(this.format=this.options.interpolation.format,r||(r=e0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}});var l=ep(),u=function(){var t=function(t,n){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e0,n=r,i="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return n();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach(function(e){0>o.indexOf(e)&&o.push(e)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){return s(e)}
24),this.options.preload&&this.options.preload.forEach(function(e){return s(e)}),this.services.backendConnector.load(o,this.options.ns,function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)})}else n(null)}},{key:"reloadResources",value:function(e,t,r){var n=ep();return e||(e=this.languages),t||(t=this.options.ns),r||(r=e0),this.services.backendConnector.reload(e,t,function(e){n.resolve(),r(e)}),n}},{key:"use",value:function(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&eI.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var n=ep();this.emit("languageChanging",e);var i=function(e){r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.resolvedLanguage=void 0,r.setResolvedLanguage(e)},o=function(e,o){o?(i(o),r.translator.changeLanguage(o),r.isLanguageChangingTo=void 0,r.emit("languageChanged",o),r.logger.log("languageChanged",o)):r.isLanguageChangingTo=void 0,n.resolve(function(){return r.t.apply(r,arguments)}),t&&t(e,function(){return r.t.apply(r,arguments)})},s=function(t){e||t||!r.services.languageDetector||(t=[]);var n="string"==typeof t?t:r.services.languageUtils.getBestMatchFromCodes(t);n&&(r.language||i(n),r.translator.language||r.translator.changeLanguage(n),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage&&r.services.languageDetector.cacheUserLanguage(n)),r.loadResources(n,function(e){o(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t,r){var n=this,i=function e(t,i){if("object"!==(0,a.Z)(i)){for(var o,s,c=arguments.length,l=Array(c>2?c-2:0),u=2;u<c;u++)l[u-2]=arguments[u];o=n.options.overloadTranslationOptionHandler([t,i].concat(l))}else o=eQ({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||r||e.keyPrefix;var d=n.options.keySeparator||".";return s=o.keyPrefix&&Array.isArray(t)?t.map(function(e){return"".concat(o.keyPrefix).concat(d).concat(e)}):o.keyPrefix?"".concat(o.keyPrefix).concat(d).concat(t):t,n.t(s,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=r,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
24if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=r.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var s=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return -1===n||2===n};if(r.precheck){var a=r.precheck(this,s);if(void 0!==a)return a}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,e)&&(!i||s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,n=ep();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){0>r.options.ns.indexOf(e)&&r.options.ns.push(e)}),this.loadResources(function(e){n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=ep();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],i=e.filter(function(e){return 0>n.indexOf(e)});return i.length?(this.options.preload=n.concat(i),this.loadResources(function(e){r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf((this.services&&this.services.languageUtils||new eR(eY())).getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e0,i=eQ(eQ(eQ({},this.options),t),{isClone:!0}),o=new n(i);return(void 0!==t.debug||void 0!==t.prefix)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(function(t){o[t]=e[t]}),o.services=eQ({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new eP(o.services,o.options),o.translator.on("*",function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];o.emit.apply(o,[e].concat(r))}),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(eh);(0,i.Z)(e1,"createInstance",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new e1(e,t)});var e2=e1.createInstance();e2.createInstance=e1.createInstance,e2.createInstance,e2.dir,e2.init,e2.loadResources,e2.reloadResources,e2.use,e2.changeLanguage,e2.getFixedT,e2.t,e2.exists,e2.setDefaultNamespace,e2.hasLoadedNamespace,e2.loadNamespaces,e2.loadLanguages;var e5=function(e){void 0===e.ns&&(e.ns=[]);var t,r,n=e2.createInstance(e);return n.isInitialized?t=Promise.resolve(e2.t):(null==e||null===(r=e.use)||void 0===r||r.forEach(function(e){return n.use(e)}),"function"==typeof e.onPreInitI18next&&e.onPreInitI18next(n),t=n.init(e)),{i18n:n,initPromise:t}},e3=s.createElement;function e6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function e4(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?e6(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e6(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var e8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return G()(function(r){var n,i,o=(r.pageProps||{})._nextI18Next,a=null!==(n=null==o?void 0:o.initialLocale)&&void 0!==n?n:null==r?void 0:null===(i=r.router)||void 0===i?void 0:i.locale,c=null==o?void 0:o.ns,l=(0,s.useMemo)(function(){if(!o&&!t)return null;var e,r=null!=t?t:null==o?void 0:o.userConfig;if(!r)throw Error("appWithTranslation was called without a next-i18next config");if(!(null!=r&&r.i18n))throw Error("appWithTranslation was called without config.i18n");if(!(null!=r&&null!==(e=r.i18n)&&void 0!==e&&e.defaultLocale))throw Error("config.i18n does not include a defaultLocale property");var n=(o||{}).initialI18nStore,i=null!=t&&t.resources?t.resources:n;return a||(a=r.i18n.defaultLocale),e5(e4(e4({},er(e4(e4({},r),{},{lng:a}))),{},{lng:a,ns:c,resources:i})).i18n},[o,a,t,c]);return null!==l?e3(q,{i18n:l},e3(e,r)):e3(e,(0,V.Z)({key:a},r))},e)}},16499:function(e,t,r){e.exports=r(66024)},61787:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(81902)}])},66024:function(e,t,r){"use strict";
24Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useRouter",{enumerable:!0,get:function(){return o}});let n=r(50959),i=r(71168);function o(){return(0,n.useContext)(i.RouterContext)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36778:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return a},noSSR:function(){return s}});let n=r(42430);r(11527),r(50959);let i=n._(r(56764));function o(e){return{default:(null==e?void 0:e.default)||e}}function s(e,t){return delete t.webpack,delete t.modules,e(t)}function a(e,t){let r=i.default,n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let a=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?r({...n,loader:()=>null!=a?a().then(o):Promise.resolve(o(()=>null))}):(delete n.webpack,delete n.modules,s(r,n))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11121:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=r(42430)._(r(50959)).default.createContext(null)},56764:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h}});let n=r(42430)._(r(50959)),i=r(11121),o=[],s=[],a=!1;function c(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class l{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function u(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),o=null;function c(){if(!o){let t=new l(e,r);o={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return o.promise()}if(!a){let e=r.webpack?r.webpack():r.modules;e&&s.push(t=>{for(let r of e)if(t.includes(r))return c()})}function u(e,t){!function(){c();let e=n.default.useContext(i.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let s=n.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),n.default.useMemo(()=>{var t;return s.loading||s.error?n.default.createElement(r.loading,{isLoading:s.loading,pastDelay:s.pastDelay,timedOut:s.timedOut,error:s.error,retry:o.retry}):s.loaded?n.default.createElement((t=s.loaded)&&t.default?t.default:t,e):null},[e,s])}return u.preload=()=>c(),u.displayName="LoadableComponent",n.default.forwardRef(u)}(c,e)}function d(e,t){let r=[];for(;e.length;){let n=e.pop();r.push(n(t))}return Promise.all(r).then(()=>
24{if(e.length)return d(e,t)})}u.preloadAll=()=>new Promise((e,t)=>{d(o).then(e,t)}),u.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(a=!0,t());d(s,e).then(r,r)})),window.__NEXT_PRELOADREADY=u.preloadReady;let h=u},24113:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(11527),i=r(50959),o=r(82198),s=Object.freeze(["wemix_grayscale","wemix_light","wemix_dark","wallet_light","coinmarketcap","xangle","coingecko","una_messenger_logo","medium_grayscale","twitter_grayscale","facebook_grayscale","telegram_grayscale","youtube_grayscale","official_grayscale","instagram_grayscale","discord_grayscale","medium","twitter","facebook","telegram","youtube","github","api","app_store","google_play","share_copy","share_twitter","share_telegram","share_facebook","cmc","una_messenger_grayscale","wemix_sel","wemix$_sel","wemix_white","wemix$_white","wemix_nor","wemix$_nor","usdc","wemix_play","nile","wemix_fi","wonders","explorer","papyrus","wemix_burn","wemix_wallet","wemix","wemix$","wepublic","eco_fund","unagi","wemix_scan","wemix_whitepaper","wemix_color","wemix$_gnb","wonderao","kucoin","gateio","bybit","huobi","probit_global","coinone","bitget","crypto","indodax","coinex","mexc","bitmart","btcex","gdac","bitforex","xtcom","bingx","superex","bittrex","arrow_diagonal","arrow_diagonal_staking","arrow_left","arrow_right","arrow_chevron_down","arrow_chevron_down_full","arrow_chevron_left","arrow_chevron_right","arrow_chevron_up","select_check","circle_check","arrow_down","arrow_up","ico_prev","icon_common_down","icon_common_prev","arrow_selector_down","arrow_bottom","icon_common_next","info","menu","korean","english","download","outlink","highlight","youtube_big","empty","refresh","close","copy","normal","more","assets_dark_btn","assets_white_btn","assets_grid_btn","code_base","throughput","block_interval","reward","consensus","authority","qrcode","notification","search","sorting","filter","tag","calendar","deflation","inflation","annotation","language","share","users","ico_wallet","check","icon_popup_close","icon_common_heart-full","icon_common_heart-empty","icon_secret","icon_common_pin","icon_delete_upload_image","icon_common_more","icon_comment_lock","icon_comment_unlock","icon_image_upload","icon_common_comment","icon_profile-edit_library","input_vote_delete","input_vote_add","input_delete","dao_circle_close","icon_chart_tooltip","icon_common_close","icon_download_w","icon_close_w","icon_common_clock","gray_circle_4","icon_circle_plus","icon_common_share","icon_common_heart-full","icon_common_heart-empty","icon_common_more","icon_common_post","icon_common_comment","arrow_right_pagination","icon_write_vote","ico_gnb","icon_new","icon_delete_upload_image","icon_popup_close","dot","icon_selected","icon_write_news","icon_write_vote","icon_setting","official_wemix_sel","official_wemix$_sel","icon_right_gray"].reduce((e,t)=>(e[t]=t,e),{})),a=r(93149),c=r.n(a),l=r(82898),u=r.n(l);let d=c().bind(u());var h=(0,i.memo)(e=>{let{url:t,iconName:r,className:i,size:a,width:c,iconSize:l,height:u,title:h,iconColor:p}=e;return t?(0,n.jsxs)("span",{className:d("icon-wrap",i),style:{"--svg-icon-height":"".concat(l||a||u,"px"),"--svg-icon-width":"".concat(l||a||c,"px")},children:[(0,n.jsx)(o.Z,{src:t,width:l||a||c,height:l||a||u}),h&&(0,n.jsx)("span",{className:"a11y",children:h})]}):void 0!==r?(0,n.jsxs)("span",{className:d("icon-wrap",i),style:{"--svg-icon-height":"".concat(l||a||u,"px"),"--svg-icon-width":"".concat(l||a||c,"px")},children:[(0,n.jsx)(o.Z,{src:"".concat("/assets/svg","/").concat("svg-icon","/").concat(s[r],".svg"),width:l||a||c,height:l||a||u,preProcessor:e=>{let t=e;return p&&(t=t.replace(/fill=".*?"/g,'fill="'.concat(p,'"'))),t}}),h&&(0,n.jsx)("span",{className:"a11y",children:h})]}):null})},99807:function(e,t,r){"use strict";var n=r(11527),i=r(93149),o=r.n(i),s=r(18701),a=r.n(s);let c=o().bind(a());t.Z=e=>{let{size:t=40}=e;return(0,n.jsx)("div",{className:c("spinner","spinner-".concat(t))})}},65192:function(e,t,r){"use strict";var n=r(11527),i=r(50959),o=r(93149),s=r.n(o),a=r(28325),c=r.n(a),l=r(24113);let u=s().bind(c());t.Z=e=>{let{isOpen:t,setIsOpen:r,text:o,duration:s=5,position:a=20}=e;return((0,i.useEffect)(()=>{t&&s&&setTimeout(()=>{r(!1)},1e3*s)},[t,s]),t)?(0,n.jsxs)("div",{className:u("snackbar-wrap","bottom-".concat(a)),children:[(0,n.jsx)("div",{className:u("text"),children:o}),(0,n.jsx)("div",{className:u("close-button"),onClick:()=>
24r(!1),children:(0,n.jsx)(l.Z,{iconName:"close",size:20})})]}):(0,n.jsx)(n.Fragment,{})}},90147:function(e,t,r){"use strict";var n=r(11527),i=r(93149),o=r.n(i);r(50959);var s=r(4414),a=r.n(s),c=r(24113);let l=o().bind(a());t.Z=e=>{let{open:t,setIsOpen:r,children:i,gap:o="24",position:s="center",simple:a,full:u,className:d,isClose:h,onClick:p,close:f,isBackDropClose:g=!1,styles:m}=e;return(0,n.jsx)("div",{id:"popup",className:l("popup-root",d,{open:t}),style:null==m?void 0:m.root,children:(0,n.jsx)("div",{className:l("popup-mask"),onClick:()=>{g&&(null==f||f(),null==r||r(!1))},children:(0,n.jsxs)("div",{className:l("popup-content","flex-gap-".concat(o),s,{simple:a,full:u}),children:[h&&(0,n.jsx)("button",{type:"button",className:"btn_close",onClick:p,children:(0,n.jsx)(c.Z,{iconName:"icon_popup_close",width:30,height:30})}),i]})})})}},94554:function(e,t,r){"use strict";var n=r(11527),i=r(93149),o=r.n(i),s=r(59120),a=r.n(s);let c=o().bind(a());t.Z=e=>{let{title:t}=e;return(0,n.jsx)("div",{className:c("popup-title-wrap"),children:(0,n.jsx)("h2",{children:t})})}},36199:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(11527),i=r(81633),o=r.n(i);let s=["keywords","description","author","generator","robots"],a=["og:type","og:title","og:description","og:image","og:image:alt","og:url","og:site_name"],c=["og:url","og:title","og:description","og:image","og:image:alt"],l=(e,t)=>s.includes(e)?(0,n.jsx)("meta",{name:e,content:t},e):a.includes(e)?(0,n.jsx)("meta",{property:e,content:t},e):(0,n.jsx)("title",{children:t},e),u=(e,t)=>a.includes(e)&&c.includes(e)?(0,n.jsx)("meta",{name:"".concat(e.replace("og:","twitter:")),content:t},"".concat(e,"-twitter")):null;var d=e=>{let t;if(e){let r=Object.keys(e);t=[...t=r.map(t=>l(t,e[t])),...r.map(t=>u(t,e[t]))]}return t},h=e=>{let{metaObj:t,children:r}=e;return(0,n.jsxs)(o(),{children:[t&&d(t),r]})}},11410:function(e,t,r){"use strict";r.d(t,{E:function(){return n}});let n={DEFAULT:"".concat("https://www.wemix.com","/assets/og/og.png"),ECOSYSTEM:"".concat("https://www.wemix.com","/assets/og/og_ecosystem.png"),PROJECTS:"".concat("https://www.wemix.com","/assets/og/og_projects.png"),COMMUNICATION:"".concat("https://www.wemix.com","/assets/og/og_communication.png"),WALLET:"".concat("https://www.wemix.com","/assets/og/og_wallet.png"),DEVELOPERS:"".concat("https://www.wemix.com","/assets/og/og_developers.png"),WEMIX:"".concat("https://www.wemix.com","/assets/og/og_wemix.png")}},81514:function(e,t,r){"use strict";r.d(t,{j:function(){return a}});var n=r(11527),i=r(50959);let o={desktop:"(min-width: 1280px)",smDesktop:"(min-width: 1024px)",homeDesktop:"(min-width: 1248px)",tablet:"(min-width: 768px) and (max-width: 1279px)",Tablet800:"(min-width: 800px)",lgTablet:"(max-width: 959px)",smTablet:"(min-width: 960px) and (max-width: 1280px)",mobile:"(max-width: 767px)",smMobile:"(max-width: 639px)",ecoMobile:"(min-width: 431px) and (max-width: 767px)",Tablet720:"(max-width: 720px)",min721max961:"(min-width: 721px) and (max-width: 961px)"},s=(0,i.createContext)({forceUpdate:()=>{},listenersRef:null,mediaQueryMatchesRef:null}),a=e=>{let{children:t}=e,[r,o]=(0,i.useReducer)(e=>e+1,0),a=(0,i.useRef)({}),c=(0,i.useRef)({}),l=(0,i.useRef)({forceUpdate:o,listenersRef:c,mediaQueryMatchesRef:a});return(0,i.useEffect)(()=>{let e={},t={},r=Object.keys(a.current),n=(e,t)=>{if(a.current[e]===t.matches)return;let n=[];r.forEach(e=>{let t=window.matchMedia(e),r=a.current[e]!==t.matches;a.current[e]=t.matches,r&&n.push([e,t.matches])}),n.length>0&&n.forEach(e=>{var t;let[r,n]=e;null===(t=c.current[r])||void 0===t||t.forEach(e=>e(n))})};return r.forEach(r=>{let i=window.matchMedia(r),o=t[r];o||(o=e=>{n(r,e)},t[r]=o,e[r]=i),i.addEventListener("change",o),n(r,i)}),()=>{r.forEach(r=>{e[r].removeEventListener("change",t[r])})}},[r]),(0,n.jsx)(s.Provider,{value:l.current,children:t})};t.Z=e=>{var t;let r=(0,i.useContext)(s),n=o[e],[a,c]=(0,i.useState)((null===(t=r.mediaQueryMatchesRef)||void 0===t?void 0:t.current[n])||!1);return(0,i.useEffect)(()=>{let{forceUpdate:e,mediaQueryMatchesRef:t,listenersRef:i}=r;if(null===t)return;void 0===t.current[n]&&(t.current[n]=!1);let o=null==i?void 0:i.current[n];if(!(null==o?void 0:o.includes(c))){if(null===i)return;i.current[n]=[...o||[],c]}return e(),()=>{(null==o?void 0:o.includes(c))||null===i||(i.current[n]=null==i?void 0:i.current[n].filter(e=>e!==c))}},[n,r]),a}},81902:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return ec}});var n=r(11527),i=r(53886),o=r(5111),s=r.n(o),a=r(50959),c=e=>{let{target:t,eventType:r,listener:n,runCallbackOnce:i}=e,o=(0,a.useRef)(0);(0,a.useEffect)(()=>{let e=t||window;if(!e||!r||!n)return;let s=e=>{cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{n(e)})};return i&&n(),e.addEventListener(r,s),()=>e.removeEventListener(r,s)},[t,n,r,i])},l=r(36199),u=r(11410),d=r(30969),h=r(81706);function p(e,t={}){let r=e&&"j"===e[0]&&":"===e[1]?e.substr(2):e;if(!t.doNotParse)try{return JSON.parse(r)}catch(e){}return e}class f{constructor(e,t={}){var n;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;let e=this.cookies;this.cookies=h.Q(document.cookie),this._checkChanges(e)};let i="undefined"==typeof document?"":document.cookie;this.cookies="string"==typeof(n=e||i)?h.Q(n):"object"==typeof n&&null!==n?n:{},this.defaultSetOptions=t,this.HAS_DOCUMENT_COOKIE=function(){let e=void 0===r.g?void 0:r.g.TEST_HAS_DOCUMENT_COOKIE;return"boolean"==typeof e?e:"object"==typeof document&&"string"==typeof document.cookie}()}_emitChange(e){for(let t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)}_checkChanges(e){new Set(Object.keys(e).concat(Object.keys(this.cookies))).forEac
24h(t=>{e[t]!==this.cookies[t]&&this._emitChange({name:t,value:p(this.cookies[t])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(e,t={}){return t.doNotUpdate||this.update(),p(this.cookies[e],t)}getAll(e={}){e.doNotUpdate||this.update();let t={};for(let r in this.cookies)t[r]=p(this.cookies[r],e);return t}set(e,t,r){r=r?Object.assign(Object.assign({},this.defaultSetOptions),r):this.defaultSetOptions;let n="string"==typeof t?t:JSON.stringify(t);this.cookies=Object.assign(Object.assign({},this.cookies),{[e]:n}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=h.q(e,n,r)),this._emitChange({name:e,value:t,options:r})}remove(e,t){let r=t=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=h.q(e,"",r)),this._emitChange({name:e,value:void 0,options:t})}addChangeListener(e){this.changeListeners.push(e),this.HAS_DOCUMENT_COOKIE&&1===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(e){let t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1),this.HAS_DOCUMENT_COOKIE&&0===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}let g=a.createContext(new f),{Provider:m,Consumer:y}=g;var b=r(27169),w=r(34556),v=r(15229),C=r(47388),E=r(63713),x=r(16499);let A=!1;function S(){A||((0,C.fF)("[nuqs] Aborting queues"),E.ob.abortAll(),E.KG.abort().forEach(e=>E.ob.queuedQuerySync.emit(e)))}let _=(0,C.Z0)(function(){let e=(0,x.useRouter)();return(0,a.useEffect)(()=>(e?.events.on("routeChangeStart",S),e?.events.on("beforeHistoryChange",S),()=>{e?.events.off("routeChangeStart",S),e?.events.off("beforeHistoryChange",S)}),[]),{searchParams:(0,a.useMemo)(()=>{let t=new URLSearchParams;if(null===e)return t;for(let[r,n]of Object.entries(e.query))if("string"==typeof n)t.set(r,n);else if(Array.isArray(n))for(let e of n)t.append(r,e);return t},[JSON.stringify(e?.query)]),updateUrl:(0,a.useCallback)((e,t)=>{let r=window.next?.router,n=function(e,t){let r;let n=new Set,i=/\[([^\]]+)\]/g;for(;null!==(r=i.exec(e));){let e=r[1];e&&n.add(e)}let o=Object.fromEntries(Object.entries(t).filter(([e])=>n.has(e))),s=/\[\.{3}([^\]]+)\]$/.exec(e);if(s&&s[1]){let e=s[1];o[e]=t[e]??[]}let a=/\[\[\.{3}([^\]]+)\]\]$/.exec(e);if(a&&a[1]){let e=a[1];o[e]=t[e]??[]}return o}(r.pathname,r.query),i=r.asPath.replace(/#.*$/,"").replace(/\?.*$/,"")+(0,C.R)(e)+location.hash;
24(0,C.fF)("[nuqs next/pages] Updating url: %s",i);let o="push"===t.history?r.push:r.replace;A=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>E.KG.reset())),o.call(r,{pathname:r.pathname,query:{...function(e){let t={};for(let r of e.keys()){let n=e.getAll(r);1===n.length?t[r]=n[0]:n.length>1&&(t[r]=n)}return t}(e),...n}},i,{scroll:t.scroll,shallow:t.shallow}).finally(()=>{A=!1})},[]),autoResetQueueOnUpdate:!1}});var I=r(47768),k=r(16126),O=r(50521),N=r(33270),P=class extends N.l{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let n=t.queryKey,i=t.queryHash??(0,I.Rm)(n,t),o=this.get(i);return o||(o=new k.A({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){O.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,I._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,I._x)(e,t)):t}notify(e){O.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){O.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){O.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},T=r(43310),R=class extends N.l{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#r=new Map,this.#n=0}#t;#r;#n;build(e,t,r){let n=new T.m({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#t.add(e);let t=$(e);if("string"==typeof t){let r=this.#r.get(t);r?r.push(e):this.#r.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=$(e);if("string"==typeof t){let r=this.#r.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#r.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=$(e);if("string"!=typeof t)return!0;{let r=this.#r.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=$(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#r.get(t)?.find(t=>
24t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){O.Vr.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#r.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,I.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,I.X7)(e,t))}notify(e){O.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return O.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(I.ZT))))}};function $(e){return e.options.scope?.id}var D=r(91284),L=r(74392),M=r(42701),U=class{#i;#o;#s;#a;#c;#l;#u;#d;constructor(e={}){this.#i=e.queryCache||new P,this.#o=e.mutationCache||new R,this.#s=e.defaultOptions||{},this.#a=new Map,this.#c=new Map,this.#l=0}mount(){this.#l++,1===this.#l&&(this.#u=D.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#d=L.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#l--,0===this.#l&&(this.#u?.(),this.#u=void 0,this.#d?.(),this.#d=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#o.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#i.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,I.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=this.#i.get(n.queryHash),o=i?.state.data,s=(0,I.SE)(t,o);if(void 0!==s)return this.#i.build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return O.Vr.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){let t=this.#i;O.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#i;return O.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(O.Vr.batch(()=>this.#i.findAll(e).map(e=>e.cancel(r)))).then(I.ZT).catch(I.ZT)}invalidateQueries(e,t={}){return O.Vr.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(O.Vr.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(I.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(I.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#i.build(this,t);return r.isStaleByTime((0,I.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(I.ZT).catch(I.ZT)}fetchInfiniteQuery(e){return e.behavior=(0,M.Gm)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(I.ZT).catch(I.ZT)}ensureInfiniteQueryData(e){return e.behavior=(0,M.Gm)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return L.N.isOnline()?this.#o.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#o}getDefaultOptions(){return this.#s}setDefaultOptions(e){this.#s=e}setQueryDefaults(e,t){this.#a.set((0,I.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#a.values()],r={};return t.forEach(t=>{(0,I.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#c.set((0,I.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#c.values()],r={};return t.forEach(t=>{(0,I.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#s.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,I.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===I.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#s.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#o.clear()}}
24,j=r(98850),B=r(81514),F=r(88649),z={"Common/Default":()=>Promise.all([r.e(5092),r.e(3934),r.e(8779),r.e(2438)]).then(r.bind(r,72438)),"Common/NewDefault":()=>Promise.all([r.e(2200),r.e(3907),r.e(4434)]).then(r.bind(r,84434)),"Common/Select":()=>Promise.all([r.e(5092),r.e(3934),r.e(8779),r.e(8268)]).then(r.bind(r,58268)),"Common/NewSelect":()=>Promise.all([r.e(7721),r.e(3907),r.e(4548)]).then(r.bind(r,14548)),"Dao/VoteProjectCreateProposal":()=>Promise.all([r.e(5092),r.e(6489),r.e(4674),r.e(3934),r.e(3907),r.e(6593),r.e(4349),r.e(8779),r.e(6432),r.e(6279),r.e(3930),r.e(348),r.e(1802),r.e(7780),r.e(9174),r.e(9678),r.e(5259)]).then(r.bind(r,5259)),"Dao/ProjectCreateErrorPopup":()=>Promise.all([r.e(5092),r.e(3934),r.e(8779),r.e(9390)]).then(r.bind(r,19390)),"Dao/TopPinnedChangeOrderPopup":()=>Promise.all([r.e(3934),r.e(3907),r.e(6593),r.e(4349),r.e(3524),r.e(7284),r.e(6432),r.e(7009),r.e(1311),r.e(6028),r.e(426)]).then(r.bind(r,50426)),"Dao/ReservationPostPopup":()=>Promise.all([r.e(196),r.e(3934),r.e(5092),r.e(3907),r.e(6593),r.e(4349),r.e(3524),r.e(8779),r.e(6432),r.e(1311),r.e(7276),r.e(7834)]).then(r.bind(r,37834)),"Dao/ReservationProjectPopup":()=>Promise.all([r.e(196),r.e(3934),r.e(5092),r.e(3907),r.e(6593),r.e(4349),r.e(3524),r.e(8779),r.e(6432),r.e(1311),r.e(7276),r.e(8697)]).then(r.bind(r,28697)),"Dao/SelectWritePopup":()=>Promise.all([r.e(4042),r.e(3907),r.e(6593),r.e(4349),r.e(3524),r.e(6432),r.e(1311),r.e(474)]).then(r.bind(r,70474)),"Account/AgreementPopup":()=>Promise.all([r.e(4042),r.e(3934),r.e(3907),r.e(6593),r.e(4349),r.e(3524),r.e(8779),r.e(6432),r.e(348),r.e(1311),r.e(5577)]).then(r.bind(r,5577)),"Account/NicknamePopup":()=>Promise.all([r.e(5092),r.e(3934),r.e(3907),r.e(6593),r.e(4349),r.e(3524),r.e(8779),r.e(6432),r.e(1311),r.e(9174),r.e(2344)]).then(r.bind(r,46833)),"Account/DeletePopup":()=>Promise.all([r.e(3934),r.e(3907),r.e(6593),r.e(4349),r.e(3524),r.e(6432),r.e(1311),r.e(6028),r.e(682)]).then(r.bind(r,50682))},H=r(73203),W=function(){return null};let q=new U;q.getMutationCache().config.onSuccess=async(e,t,r,n)=>{await q.invalidateQueries({predicate:e=>{var t,r,i;return null!==(i=null===(r=n.meta)||void 0===r?void 0:null===(t=r.invalidates)||void 0===t?void 0:t.some(t=>(0,I._x)({queryKey:t},e)))&&void 0!==i&&i}})},(0,H.cz)({adapters:[v.Hx],projectId:v.Sx,defaultNetwork:v.PD,networks:v.QW,metadata:v.Pu,includeWalletIds:[v.Hm.MetaMask,v.Hm.WemixPlay],excludeWalletIds:[v.Hm.OKX],allWallets:"HIDE",features:{analytics:!0,email:!1,socials:!1}});var V=e=>{let{children:t}=e,[r,i]=(0,a.useState)();return(0,a.useEffect)(()=>{"undefined"==typeof document||r||i((0,b.jx)(v.vc,document.cookie))},[]),(0,n.jsx)(_,{children:(0,n.jsx)(w.F,{config:v.vc,initialState:r,children:(0,n.jsxs)(j.aH,{client:q,children:[(0,n.jsx)(W,{initialIsOpen:!1}),(0,n.jsx)(B.j,{children:(0,n.jsx)(F.ModalProvider,{register:z,defaultOverlayOptions:{dim:!1},children:t})})]})})})},K=r(46956),G=r.n(K);r(85195),r(67247),r(72390),r(81226),r(92454),r(38055),r(32043),r(21715);var Z=r(65192),Y=r(86312),J=r(90147),X=r(94554),Q=r(99807),ee=r(93149),et=r.n(ee),er=r(13937),en=r.n(er);let ei=et().bind(en());var eo=e=>{let{isOpen:t,title:r}=e;return t?(0,n.jsx)(J.Z,{open:t,gap:"16",simple:!0,className:"zIndex1000",children:(0,n.jsxs)("div",{className:ei("wrap",{background:!!r}),children:[(0,n.jsx)("div",{className:ei("loading-circle-wrap"),children:(0,n.jsx)(Q.Z,{})}),r&&(0,n.jsx)("div",{className:ei("popup-title-wrap"),children:(0,n.jsx)(X.Z,{title:r})})]})}):(0,n.jsx)(n.Fragment,{})},es=()=>{let{snackBarText:e,setSnackBarText:t,isOpenLoading:r,setIsOpenLoading:i,loadingPopupTitle:o}=(0,Y.p)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Z.Z,{isOpen:!!e,setIsOpen:e=>{e||t("")},text:e,duration:2}),(0,n.jsx)(eo,{isOpen:r,setIsOpen:i,title:o})]})};let ea=G()(()=>Promise.all([r.e(6593),r.e(4349),r.e(3524),r.e(1311),r.e(9292)]).then(r.bind(r,89292)),{loadableGenerated:{webpack:()=>[89292]},ssr:!1});console.log=()=>{},console.table=()=>{};var ec=(0,i.Jc)(e=>{let{Component:t,pageProps:r}=e,{t:o}=(0,i.$G)(["head"]),{locale:h,asPath:p}=(0,d.useRouter)();return c({eventType:"resize",listener:()=>{let e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh","".concat(e,"px"))},runCallbackOnce:!0}),!function(){let e=(0,d.useRouter)(),[t,r]=function(e){let t=(0,a.useContext)(g);if(!t)throw Error("Missing <CookiesProvider>");let[r,n]=(0,a.useState)(()=>t.getAll());return"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement&&(0,a.useLayoutEffect)(()=>{function i(){let i=t.getAll({doNotUpdate:!0});(function(e,t,r){if(!e)return!0;for(let n of e)if(t[n]!==r[n])return!0;return!1})(e||null,i,r)&&n(i)}return t.addChangeListener(i),()=>{t.removeChangeListener(i)}},[t,r]),[r,(0,a.useMemo)(()=>t.set.bind(t),[t]),(0,a.useMemo)(()=>t.remove.bind(t),[t]),(0,a.useMemo)(()=>t.update.bind(t),[t])]}(["NEXT_LOCALE"]);(0,a.useEffect)(()=>{e.locale&&t.NEXT_LOCALE!==e.locale&&r("NEXT_LOCALE",e.locale,{path:"/",expires:new Date(Date.now()+31536e6)})},[t.NEXT_LOCALE,e.locale,r])}(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.Z,{metaObj:{"og:image":u.E.DEFAULT,title:o("head:home.title"),description:o("head:home.description"),"og:title":o("head:home.ogTitle"),"og:description":o("head:home.ogDescription"),"og:url":"".concat("https://www.wemix.com").concat("ko"===h?"/ko":"").concat(p),"og:site_name":o("head:home.ogTitle"),"og:type":"website",keywords:"".concat(o("head:home.keywords"),", ").concat(o("head:platform.keywords"),", ").concat(o("head:common.keywords"))}}),(0,n.jsx)(s(),{id:"google-analytics",strategy:"afterInteractive",children:"\n        (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n\n        new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n\n        j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;
24j.src=\n\n        'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n\n        })(window,document,'script','dataLayer','GTM-WV8LTK7');\n      "}),(0,n.jsx)(s(),{id:"google-gtag",strategy:"afterInteractive",children:"\n          window.dataLayer = window.dataLayer || [];\n          function gtag(){dataLayer.push(arguments);}\n          gtag('js', new Date());\n\n          gtag('config', 'G-0QG2C9S15S');\n        "}),(0,n.jsxs)(V,{children:[(0,n.jsx)(ea,{}),(0,n.jsx)(t,{...r}),(0,n.jsx)(es,{})]})]})})},86312:function(e,t,r){"use strict";r.d(t,{p:function(){return n}});let n=(0,r(49347).Ue)((e,t)=>({snackBarText:"",isOpenLoading:!1,setSnackBarText:t=>e({snackBarText:t}),setIsOpenLoading:(t,r)=>e({isOpenLoading:t,loadingPopupTitle:r})}))},15229:function(e,t,r){"use strict";let n;r.d(t,{Hm:function(){return to},vc:function(){return tu},PD:function(){return ts},Pu:function(){return td},QW:function(){return tc},Sx:function(){return ta},z2:function(){return th},Hx:function(){return tl}});let i=(0,r(86278).a)({id:1111,name:"WEMIX",network:"wemix-mainnet",nativeCurrency:{name:"WEMIX",symbol:"WEMIX",decimals:18},rpcUrls:{default:{http:["https://wemix3-main-http-wememe.wemix.com"],webSocket:["wss://wemix3-main-ws-wememe.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://scan.wemix.com"}}});var o=r(12442),s=r(92476);let a=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let o=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,s=e(n.getState());o=r=>{let n=e(r);if(!i(s,n)){let e=s;t(s=n,e)}},(null==r?void 0:r.fireImmediately)&&t(s,s)}return i(o)},e(t,r,n)},c=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>c(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>c(t)(e)}}},l=(e,t)=>(r,n,i)=>{let o,s={storage:function(e,t){let r;try{r=e()}catch(e){return}return{getItem:e=>{var t;let n=e=>null===e?null:JSON.parse(e,void 0),i=null!=(t=r.getItem(e))?t:null;return i instanceof Promise?i.then(n):n(i)},setItem:(e,t)=>r.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>r.removeItem(e)}}(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1,l=new Set,u=new Set,d=s.storage;if(!d)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...e)},n,i);let h=()=>{let e=s.partialize({...n()});return d.setItem(s.name,{state:e,version:s.version})},p=i.setState;i.setState=(e,t)=>{p(e,t),h()};let f=e((...e)=>{r(...e),h()},n,i);i.getInitialState=()=>f;let g=()=>{var e,t;if(!d)return;a=!1,l.forEach(e=>{var t;return e(null!=(t=n())?t:f)});let i=(null==(t=s.onRehydrateStorage)?void 0:t.call(s,null!=(e=n())?e:f))||void 0;return c(d.getItem.bind(d))(s.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return[!1,e.state];if(s.migrate)return[!0,s.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;let[i,a]=e;if(r(o=s.merge(a,null!=(t=n())?t:f),!0),i)return h()}).then(()=>{null==i||i(o,void 0),o=n(),a=!0,u.forEach(e=>e(o))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions:e=>{s={...s,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>g(),hasHydrated:()=>a,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},s.skipHydration||g(),o||f},u=e=>{let t;let r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>s,subscribe:e=>(r.add(e),()=>r.delete(e))},s=t=e(n,i,o);return o},d=e=>e?u(e):u;var h=r(74823),p=r(78612),f=r(46),g=r(85889),m=r(72490),y=r(75265),b=r(72354),w=r(78260);function v(e={}){let t,r,n,i;let{shimDisconnect:o=!0,unstable_shimAsyncInject:s}=e;function a(){let t=e.target;if("function"==typeof t){let e=t();if(e)return e}return"object"==typeof t?t:"string"==typeof t?{...C[t]??{id:t,name:`${t[0].toUpperCase()}${t.slice(1)}`,provider:`is${t[0].toUpperCase()}${t.slice(1)}`}}:{id:"injected",name:"Injected",provider:e=>e?.ethereum}}return(0,w.K)(c=>({get icon(){return a().icon},get id(){return a().id},get name(){return a().name},get supportsSimulation(){return!0},type:v.type,async setup(){let r=await this.getProvider();r?.on&&e.target&&(n||(n=this.onConnect.bind(this),r.on("connect",n)),t||(t=this.onAccountsChanged.bind(this),r.on("accountsChanged",t)))},async connect({chainId:s,isReconnecting:a}={}){let l=await this.getProvider();if(!l)throw new b.M;let u=[];
24if(a)u=await this.getAccounts().catch(()=>[]);else if(o)try{let e=await l.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});(u=e[0]?.caveats?.[0]?.value?.map(e=>h.K(e))).length>0&&(u=await this.getAccounts())}catch(e){if(e.code===p.ab.code)throw new p.ab(e);if(e.code===p.pT.code)throw e}try{u?.length||a||(u=(await l.request({method:"eth_requestAccounts"})).map(e=>(0,h.K)(e))),n&&(l.removeListener("connect",n),n=void 0),t||(t=this.onAccountsChanged.bind(this),l.on("accountsChanged",t)),r||(r=this.onChainChanged.bind(this),l.on("chainChanged",r)),i||(i=this.onDisconnect.bind(this),l.on("disconnect",i));let d=await this.getChainId();if(s&&d!==s){let e=await this.switchChain({chainId:s}).catch(e=>{if(e.code===p.ab.code)throw e;return{id:d}});d=e?.id??d}return o&&await c.storage?.removeItem(`${this.id}.disconnected`),e.target||await c.storage?.setItem("injected.connected",!0),{accounts:u,chainId:d}}catch(e){if(e.code===p.ab.code)throw new p.ab(e);if(e.code===p.pT.code)throw new p.pT(e);throw e}},async disconnect(){let t=await this.getProvider();if(!t)throw new b.M;r&&(t.removeListener("chainChanged",r),r=void 0),i&&(t.removeListener("disconnect",i),i=void 0),n||(n=this.onConnect.bind(this),t.on("connect",n));try{await (0,f.F)(()=>t.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}o&&await c.storage?.setItem(`${this.id}.disconnected`,!0),e.target||await c.storage?.removeItem("injected.connected")},async getAccounts(){let e=await this.getProvider();if(!e)throw new b.M;return(await e.request({method:"eth_accounts"})).map(e=>(0,h.K)(e))},async getChainId(){let e=await this.getProvider();if(!e)throw new b.M;return Number(await e.request({method:"eth_chainId"}))},async getProvider(){let e;if("undefined"==typeof window)return;let t=a();return(e="function"==typeof t.provider?t.provider(window):"string"==typeof t.provider?E(window,t.provider):t.provider)&&!e.removeListener&&("off"in e&&"function"==typeof e.off?e.removeListener=e.off:e.removeListener=()=>{}),e},async isAuthorized(){try{if(o&&await c.storage?.getItem(`${this.id}.disconnected`)||!e.target&&!await c.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(void 0!==s&&!1!==s){let e=async()=>("undefined"!=typeof window&&window.removeEventListener("ethereum#initialized",e),!!await this.getProvider()),t="number"==typeof s?s:1e3;if(await Promise.race([..."undefined"!=typeof window?[new Promise(t=>window.addEventListener("ethereum#initialized",()=>t(e()),{once:!0}))]:[],new Promise(r=>setTimeout(()=>r(e()),t))]))return!0}throw new b.M}return!!(await (0,g.J)(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){let r=await this.getProvider();if(!r)throw new b.M;let n=c.chains.find(e=>e.id===t);if(!n)throw new p.x3(new y.X4);let i=new Promise(e=>{let r=n=>{"chainId"in n&&n.chainId===t&&(c.emitter.off("change",r),e())};c.emitter.on("change",r)});try{return await Promise.all([r.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,m.eC)(t)}]}).then(async()=>{await this.getChainId()===t&&c.emitter.emit("change",{chainId:t})}),i]),n}catch(o){if(4902===o.code||o?.data?.originalError?.code===4902)try{let o,s;let{default:a,...l}=n.blockExplorers??{};e?.blockExplorerUrls?o=e.blockExplorerUrls:a&&(o=[a.url,...Object.values(l).map(e=>e.url)]),s=e?.rpcUrls?.length?e.rpcUrls:[n.rpcUrls.default?.http[0]??""];let u={blockExplorerUrls:o,chainId:(0,m.eC)(t),chainName:e?.chainName??n.name,iconUrls:e?.iconUrls,nativeCurrency:e?.nativeCurrency??n.nativeCurrency,rpcUrls:s};return await Promise.all([r.request({method:"wallet_addEthereumChain",params:[u]}).then(async()=>{if(await this.getChainId()===t)c.emitter.emit("change",{chainId:t});else throw new p.ab(Error("User rejected switch after adding network."))}),i]),n}catch(e){throw new p.ab(e)}if(o.code===p.ab.code)throw new p.ab(o);throw new p.x3(o)}},async onAccountsChanged(e){if(0===e.length)this.onDisconnect();else if(c.emitter.listenerCount("connect")){let e=(await this.getChainId()).toString();this.onConnect({chainId:e}),o&&await c.storage?.removeItem(`${this.id}.disconnected`)}else c.emitter.emit("change",{accounts:e.map(e=>(0,h.K)(e))})},onChainChanged(e){let t=Number(e);c.emitter.emit("change",{chainId:t})},async onConnect(e){let o=await this.getAccounts();if(0===o.length)return;let s=Number(e.chainId);c.emitter.emit("connect",{accounts:o,chainId:s});let a=await this.getProvider();a&&(n&&(a.removeListener("connect",n),n=void 0),t||(t=this.onAccountsChanged.bind(this),a.on("accountsChanged",t)),r||(r=this.onChainChanged.bind(this),a.on("chainChanged",r)),i||(i=this.onDisconnect.bind(this),a.on("disconnect",i)))},async onDisconnect(e){let t=await this.getProvider();e&&1013===e.code&&t&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),t&&(r&&(t.removeListener("chainChanged",r),r=void 0),i&&(t.removeListener("disconnect",i),i=void 0),n||(n=this.onConnect.bind(this),t.on("connect",n))))}}))}v.type="injected";let C={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider:e=>e?.coinbaseWalletExtension?e.coinbaseWalletExtension:E(e,"isCoinbaseWallet")},metaMask:{id:"metaMask",name:"MetaMask",provider:e=>E(e,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;for(let t of["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"])if(e[t])return!1;return!0})}
24,phantom:{id:"phantom",name:"Phantom",provider:e=>e?.phantom?.ethereum?e.phantom?.ethereum:E(e,"isPhantom")}};function E(e,t){function r(e){return"function"==typeof t?t(e):"string"!=typeof t||e[t]}let n=e.ethereum;return n?.providers?n.providers.find(e=>r(e)):n&&r(n)?n:void 0}var x=r(73983);class A{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new x.v})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){let r=t[0];this._emitter.emit(e,{uid:this.uid,...r})}listenerCount(e){return this._emitter.listenerCount(e)}}function S(e,t){return JSON.parse(e,(e,r)=>{let n=r;return n?.__type==="bigint"&&(n=BigInt(n.value)),n?.__type==="Map"&&(n=new Map(n.value)),t?.(e,n)??n})}function _(e,t){return e.slice(0,t).join(".")||"."}function I(e,t){let{length:r}=e;for(let n=0;n<r;++n)if(e[n]===t)return n+1;return 0}function k(e,t,r,n){return JSON.stringify(e,function(e,t){let r="function"==typeof e,n="function"==typeof t,i=[],o=[];return function(s,a){if("object"==typeof a){if(i.length){let e=I(i,this);0===e?i[i.length]=this:(i.splice(e),o.splice(e)),o[o.length]=s;let r=I(i,a);if(0!==r)return n?t.call(this,s,a,_(o,r)):`[ref=${_(o,r)}]`}else i[0]=a,o[0]=s}return r?e.call(this,s,a):a}}((e,r)=>{let n=r;return"bigint"==typeof n&&(n={__type:"bigint",value:r.toString()}),n instanceof Map&&(n={__type:"Map",value:Array.from(r.entries())}),t?.(e,n)??n},n),r??void 0)}let O={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},N=256;var P=r(44198),T=r(61154),R=r(25006);function $(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){let r,n;if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!$(e[n],t[n]))return!1;return!0}if("function"==typeof e.valueOf&&e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if("function"==typeof e.toString&&e.toString!==Object.prototype.toString)return e.toString()===t.toString();let i=Object.keys(e);if((r=i.length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.hasOwn(t,i[n]))return!1;for(n=r;0!=n--;){let r=i[n];if(r&&!$(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}let D=[];function L(e){let t=[...e.state.connections.values()];return"reconnecting"===e.state.status||$(D,t)?D:(D=t,t)}var M=r(16334),U=r(68208);async function j(e,t){let{account:r,chainId:n,...i}=t,s=r??(0,o.D)(e).address,a=e.getClient({chainId:n});return(0,R.s)(a,U.ZE,"prepareTransactionRequest")({...i,...s?{account:s}:{}})}var B=r(3902),F=r(8811),z=r(55166),H=r(46967),W=r(11598),q=r(88002),V=r(61373),K=r(74282),G=r(43813),Z=r(23605),Y=r(47429),J=r(83018),X=r(21328),Q=r(97414),ee=r(8330);let et=new J.k(128);async function er(e,t){let{account:r=e.account,chain:n=e.chain,accessList:i,authorizationList:o,blobs:s,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:p,type:f,value:g,...m}=t;if(void 0===r)throw new F.o({docsPath:"/docs/actions/wallet/sendTransaction"});let y=r?(0,B.T)(r):null;try{(0,X.F)(t);let r=await (async()=>t.to?t.to:null!==t.to&&o&&o.length>0?await (0,H.z)({authorization:o[0]}).catch(()=>{throw new z.G("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if(y?.type==="json-rpc"||null===y){let t;null!==n&&(t=await (0,Y.s)(e,Q.L,"getChainId")({}),function({chain:e,currentChainId:t}){if(!e)throw new W.Bk;if(t!==e.id)throw new W.Yl({chain:e,currentChainId:t})}({currentChainId:t,chain:n}));let b=e.chain?.formatters?.transactionRequest?.format,w=(b||Z.tG)({...(0,G.K)(m,{format:b}),accessList:i,authorizationList:o,blobs:s,chainId:t,data:a,from:y?.address,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:p,to:r,type:f,value:g}),v=et.get(e.uid);try{return await e.request({method:v?"wallet_sendTransaction":"eth_sendTransaction",params:[w]},{retryCount:0})}catch(t){if(!1===v)throw t;if("InvalidInputRpcError"===t.name||"InvalidParamsRpcError"===t.name||"MethodNotFoundRpcError"===t.name||"MethodNotSupportedRpcError"===t.name)return await e.request({method:"wallet_sendTransaction",params:[w]},{retryCount:0}).then(t=>(et.set(e.uid,!0),t)).catch(r=>{if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw et.set(e.uid,!1),t;throw r});throw t}}if(y?.type==="local"){let t=await (0,Y.s)(e,U.ZE,"prepareTransactionRequest")({account:y,accessList:i,authorizationList:o,blobs:s,chain:n,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:p,nonceManager:y.nonceManager,parameters:[...U.QZ,"sidecars"],type:f,value:g,...m,to:r}),b=n?.serializers?.transaction,w=await y.signTransaction(t,{serializer:b});return await (0,Y.s)(e,ee.p,"sendRawTransaction")({serializedTransaction:w})}if(y?.type==="smart")throw new F.Y({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new F.Y({docsPath:"/docs/actions/wallet/sendTransaction",type:y?.type})}catch(e){if(e instanceof F.Y)throw e;throw function(e,{docsPath:t,...r}){let n=(()=>{let t=(0,K.k)(e,r);return t instanceof q.cj?e:t})();return new V.mk(n,{docsPath:t,...r})}(e,{...t,account:y,chain:t.chain||void 0})}}var en=r(23887);async function ei(e,t){let r;let{account:n,chainId:i,connector:o,...s}=t;r="object"==typeof n&&n?.type==="local"?e.getClient({chainId:i}):await (0,en.e)(e,{account:n??void 0,chainId:i,connector:o});let a=(0,R.s)(r,er,"sendTransaction");return await a({...s,...n?{account:n}:{},chain:i?{id:i}:null,gas:s.gas??void 0})}var eo=r(96274),es=r(5436),ea=r(70752),ec=r(85904);async function el(e,t){let{chainId:r,timeout:n=0,...i}=t,o=e.getClient({chainId:r}),s=(0,R.s)(o,es.e,"waitForTransactionReceipt"),a=await s({...i,timeout:n});if("reverted"===a.status){let e=(0,R.s)(o,ea.f,"getTransaction"),t=await e({hash:a.transactionHash}),r=(0,R.s)(o,ec.R,"call"),n=await r({...t,data:t.input,gasPrice:"eip1559"!==t.type?t.gasPrice:void 0,maxFeePerGas:"eip1559"===t.type?t.maxFeePerGas:void 0,maxPriorityFeePerGas:"eip1559"===t.type?t.maxPriorityFeePerGas:void 0});throw Error(n?.data?(0,eo.rR)(`0x${n.data.substring(138)}`):"unknown reason")}return{...a,chainId:o.chain.id}}var eu=r(73924),ed=r(66574);async function eh(e,t){let{abi:r,account:n=e.account,address:i,args:o,dataSuffix:s,functionName:a,...c}=t;if(void 0===n)throw new F.o({docsPath:"/docs/contract/writeContract"});let l=n?(0,B.T)(n):null,u=(0,eu.R)({abi:r,args:o,functionName:a});try{return await (0,Y.s)(e,er,"sendTransaction")({data:`${u}${s?s.replace("0x",""):""}`,to:i,account:l,...c})}catch(e){throw(0,ed.S)(e,{abi:r,address:i,args:o,docsPath:"/docs/contract/writeContract",functionName:a,sender:l?.address})}}async function ep(e,t){let r;let{account:n,chainId:i,connector:o,...s}=t;r="object"==typeof n&&n?.type==="local"?e.getClient({chainId:i}):await (0,en.e)(e,{account:n??void 0,chainId:i,connector:o});let a=(0,R.s)(r,eh,"writeContract");return await a({...s,...n?{account:n}:{},chain:i?{id:i}:null})}var ef=r(14628);async function eg(e,t){let r;let{chainId:n,connector:i,...o}=t;r=t.account?t.account:(await (0,en.e)(e,{account:t.account,chainId:n,connector:i})).account;let s=e.getClient({chainId:n});return(0,R.s)(s,ef.Q,"estimateGas")({...o,account:r})}async function em(e,t){let r;if((r="function"==typeof t.connector?e._internal.connectors.setup(t.connector):t.connector).uid===e.state.current)throw new y.wi;try{e.setState(e=>({...e,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});
24let{connector:n,...i}=t,o=await r.connect(i),s=o.accounts;return r.emitter.off("connect",e._internal.events.connect),r.emitter.on("change",e._internal.events.change),r.emitter.on("disconnect",e._internal.events.disconnect),await e.storage?.setItem("recentConnectorId",r.id),e.setState(e=>({...e,connections:new Map(e.connections).set(r.uid,{accounts:s,chainId:o.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:s,chainId:o.chainId}}catch(t){throw e.setState(e=>({...e,status:e.current?"connected":"disconnected"})),t}}async function ey(e,t){let{addEthereumChainParameter:r,chainId:n}=t,i=e.state.connections.get(t.connector?.uid??e.state.current);if(i){let e=i.connector;if(!e.switchChain)throw new b.O({connector:e});return await e.switchChain({addEthereumChainParameter:r,chainId:n})}let o=e.chains.find(e=>e.id===n);if(!o)throw new y.X4;return e.setState(e=>({...e,chainId:n})),o}let eb=!1;async function ew(e,t={}){let r;if(eb)return[];eb=!0,e.setState(e=>({...e,status:e.current?"reconnecting":"connecting"}));let n=[];if(t.connectors?.length)for(let r of t.connectors){let t;t="function"==typeof r?e._internal.connectors.setup(r):r,n.push(t)}else n.push(...e.connectors);try{r=await e.storage?.getItem("recentConnectorId")}catch{}let i={};for(let[,t]of e.state.connections)i[t.connector.id]=1;r&&(i[r]=0);let o=Object.keys(i).length>0?[...n].sort((e,t)=>(i[e.id]??10)-(i[t.id]??10)):n,s=!1,a=[],c=[];for(let t of o){let r=await t.getProvider().catch(()=>void 0);if(!r||c.some(e=>e===r)||!await t.isAuthorized())continue;let n=await t.connect({isReconnecting:!0}).catch(()=>null);n&&(t.emitter.off("connect",e._internal.events.connect),t.emitter.on("change",e._internal.events.change),t.emitter.on("disconnect",e._internal.events.disconnect),e.setState(e=>{let r=new Map(s?e.connections:new Map).set(t.uid,{accounts:n.accounts,chainId:n.chainId,connector:t});return{...e,current:s?e.current:t.uid,connections:r}}),a.push({accounts:n.accounts,chainId:n.chainId,connector:t}),c.push(r),s=!0)}return("reconnecting"===e.state.status||"connecting"===e.state.status)&&(s?e.setState(e=>({...e,status:"connected"})):e.setState(e=>({...e,connections:new Map,current:null,status:"disconnected"}))),eb=!1,a}var ev=r(50875),eC=r(67407),eE=r(24104),ex=r(91283);function eA(e){return"number"==typeof e?e:"wei"===e?0:Math.abs(ex.Bd[e])}var eS=r(57903),e_=r(1153);async function eI(e,t){let{allowFailure:r=!0,chainId:n,contracts:i,...o}=t,s=e.getClient({chainId:n});return(0,R.s)(s,e_.A,"multicall")({allowFailure:r,contracts:i,...o})}var ek=r(76894);async function eO(e,t){let{allowFailure:r=!0,blockNumber:n,blockTag:i,...o}=t,s=t.contracts;try{let t={};for(let[r,n]of s.entries()){let i=n.chainId??e.state.chainId;t[i]||(t[i]=[]),t[i]?.push({contract:n,index:r})}let a=(await Promise.all(Object.entries(t).map(([t,s])=>eI(e,{...o,allowFailure:r,blockNumber:n,blockTag:i,chainId:Number.parseInt(t),contracts:s.map(({contract:e})=>e)})))).flat(),c=Object.values(t).flatMap(e=>e.map(({index:e})=>e));return a.reduce((e,t,r)=>(e&&(e[c[r]]=t),e),[])}catch(o){if(o instanceof eS.uq)throw o;let t=()=>s.map(t=>(function(e,t){let{chainId:r,...n}=t,i=e.getClient({chainId:r});return(0,R.s)(i,ek.L,"readContract")(n)})(e,{...t,blockNumber:n,blockTag:i}));if(r)return(await Promise.allSettled(t())).map(e=>"fulfilled"===e.status?{result:e.value,status:"success"}:{error:e.reason,result:void 0,status:"failure"});return await Promise.all(t())}}async function eN(e,t){let{address:r,blockNumber:n,blockTag:i,chainId:o,token:s,unit:a="ether"}=t;if(s)try{return await eP(e,{balanceAddress:r,chainId:o,symbolType:"string",tokenAddress:s})}catch(t){if("ContractFunctionExecutionError"===t.name){let t=await eP(e,{balanceAddress:r,chainId:o,symbolType:"bytes32",tokenAddress:s}),n=(0,eo.rR)((0,ev.f)(t.symbol,{dir:"right"}));return{...t,symbol:n}}throw t}let c=e.getClient({chainId:o}),l=(0,R.s)(c,eE.s,"getBalance"),u=await l(n?{address:r,blockNumber:n}:{address:r,blockTag:i}),d=e.chains.find(e=>e.id===o)??c.chain;return{decimals:d.nativeCurrency.decimals,formatted:(0,eC.b)(u,eA(a)),symbol:d.nativeCurrency.symbol,value:u}}async function eP(e,t){let{balanceAddress:r,chainId:n,symbolType:i,tokenAddress:o,unit:s}=t,a={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:i}]}],address:o},[c,l,u]=await eO(e,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[r],chainId:n},{...a,functionName:"decimals",chainId:n},{...a,functionName:"symbol",chainId:n}]}),d=(0,eC.b)(c??"0",eA(s??l));return{decimals:l,formatted:d,symbol:u,value:c}}async function eT(e,t={}){let r;if(t.connector)r=t.connector;else{let{connections:t,current:n}=e.state,i=t.get(n);r=i?.connector}let n=e.state.connections;r&&(await r.disconnect(),r.emitter.off("change",e._internal.events.change),r.emitter.off("disconnect",e._internal.events.disconnect),r.emitter.on("connect",e._internal.events.connect),n.delete(r.uid)),e.setState(e=>{if(0===n.size)return{...e,connections:new Map,current:null,status:"disconnected"};let t=n.values().next().value;return{...e,connections:new Map(n),current:t.connector.uid}});{let t=e.state.current;if(!t)return;let r=e.state.connections.get(t)?.connector;if(!r)return;await e.storage?.setItem("recentConnectorId",r.id)}}class eR extends z.G{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}r(67654);var e$=r(63583),eD=r(42036),eL=r(9605),eM=r(99321),eU=r(33802),ej=r(29607),eB=r(39674),eF=r(92290),ez=r(41248),eH=r(33279),eW=r(83847),eq=r(21220),eV=r(62250),eK=r(6082),eG=r(71384),eZ=r(20274),eY=r(52726),eJ=r(29283);function eX(e,t){let r,n,i,o,s,a,c;let l=e.isNewChainsStale??!0;return(0,w.K)(e=>({id:"walletConnect",name:"WalletConnect",type:eX.type,async setup(){let e=await this.getProvider().catch(()=>null);e&&(o||(o=this.onConnect.bind(this),e.on("connect",o)),a||(a=this.onSessionDelete.bind(this),e.on("session_delete",a)))},async connect({...e}={}){try{let t=eB.R.getCaipNetworks(),r=await this.getProvider();if(!r)throw new b.M;s||(s=this.onDisplayUri,r.on("display_uri",s));let l=await this.isChainsStale();r.session&&l&&await r.disconnect();let u=ej.OptionsController.state.universalProviderConfigOverride;
24if(!r.session||l){let n=e$.sQ.createNamespaces(t,u);await r.connect({optionalNamespaces:n,..."pairingTopic"in e?{pairingTopic:e.pairingTopic}:{}}),this.setRequestedChainsIds(t.map(e=>Number(e.id)))}let d=await this.getAccounts(),h=await this.getChainId(),p=r.session?.namespaces?.eip155?.chains,f=p?.some(e=>Number(e.split(":")[1])===h),g=1;f?g=h:p?.[0]&&(g=Number(p[0].split(":")[1])),s&&(r.removeListener("display_uri",s),s=void 0),o&&(r.removeListener("connect",o),o=void 0),n||(n=this.onAccountsChanged.bind(this),r.on("accountsChanged",n)),i||(i=this.onChainChanged.bind(this),r.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),r.on("disconnect",c)),a||(a=this.onSessionDelete.bind(this),r.on("session_delete",a));let m=u?.defaultChain;return r.setDefaultChain(m??`eip155:${g}`),{accounts:d,chainId:g}}catch(e){if(/(user rejected|connection request reset)/i.test(e?.message))throw new p.ab(e);throw e}},async disconnect(){let e=await this.getProvider();try{await e?.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{i&&(e?.removeListener("chainChanged",i),i=void 0),c&&(e?.removeListener("disconnect",c),c=void 0),o||(o=this.onConnect.bind(this),e?.on("connect",o)),n&&(e?.removeListener("accountsChanged",n),n=void 0),a&&(e?.removeListener("session_delete",a),a=void 0),this.setRequestedChainsIds([])}},async getAccounts(){let e=await this.getProvider();if(!e?.session?.namespaces)return[];let t=e?.session?.namespaces[eD.b.CHAIN.EVM]?.accounts,r=t?.map(e=>e.split(":")[2])??[],n=new Set;return r.filter(e=>{let t=e?.toLowerCase();return!n.has(t)&&(n.add(t),!0)})},async getProvider({chainId:e}={}){r||(r=await t.getUniversalProvider(),r?.events.setMaxListeners(Number.POSITIVE_INFINITY));let n=eU.M.getActiveNamespace(),i=t.getCaipNetwork()?.id;if(e&&i!==e&&n){let e=eU.M.getStoredActiveCaipNetworkId(),r=n?t.getCaipNetworks(n):[],i=r?.find(t=>t.id===e);i&&i.chainNamespace===eD.b.CHAIN.EVM&&await this.switchChain?.({chainId:Number(i.id)})}return r},async getChainId(){let e=t.getCaipNetwork(eD.b.CHAIN.EVM)?.id;if(e)return e;let r=await this.getProvider(),n=r.session?.namespaces[eD.b.CHAIN.EVM]?.chains?.[0],i=eB.R.getCaipNetworks().find(e=>e.id===n);return i?.id},async isAuthorized(){try{let[e,t]=await Promise.all([this.getAccounts(),this.getProvider()]);if(!e.length)return!1;if(await this.isChainsStale()&&t.session)return await t.disconnect().catch(()=>{}),!1;return!0}catch{return!1}},async switchChain({addEthereumChainParameter:t,chainId:r}){let n=await this.getProvider();if(!n)throw new b.M;let i=eB.R.getCaipNetworks().find(e=>e.id===r);if(!i)throw new p.x3(new y.X4);try{await n.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,m.eC)(r)}]}),i?.caipNetworkId&&n.setDefaultChain(i?.caipNetworkId),e.emitter.emit("change",{chainId:Number(r)});let t=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...t,r]),{...i,id:i.id}}catch(e){if(/(?:user rejected)/iu.test(e.message))throw new p.ab(e);try{let e;e=t?.blockExplorerUrls?t.blockExplorerUrls:i.blockExplorers?.default.url?[i.blockExplorers?.default.url]:[];let o=i.rpcUrls?.chainDefault?.http||[],s={blockExplorerUrls:e,chainId:(0,m.eC)(r),chainName:i.name,iconUrls:t?.iconUrls,nativeCurrency:i.nativeCurrency,rpcUrls:o};await n.request({method:"wallet_addEthereumChain",params:[s]});let a=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...a,r]),{...i,id:i.id}}catch(e){throw new p.ab(e)}}},onAccountsChanged(t){0===t.length?this.onDisconnect():e.emitter.emit("change",{accounts:t.map(e=>(0,h.K)(e))})},onChainChanged(t){let r=Number(t);e.emitter.emit("change",{chainId:r})},onConnect(e){this.setRequestedChainsIds(eB.R.getCaipNetworks().map(e=>Number(e.id)))},async onDisconnect(t){this.setRequestedChainsIds([]),e.emitter.emit("disconnect");let r=await this.getProvider();n&&(r.removeListener("accountsChanged",n),n=void 0),i&&(r.removeListener("chainChanged",i),i=void 0),c&&(r.removeListener("disconnect",c),c=void 0),a&&(r.removeListener("session_delete",a),a=void 0),o||(o=this.onConnect.bind(this),r.on("connect",o))},onDisplayUri(t){e.emitter.emit("message",{type:"display_uri",data:t})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){if(!r?.session?.namespaces)return[];let e=r?.session?.namespaces[eD.b.CHAIN.EVM]?.accounts;return e?.map(e=>Number.parseInt(e.split(":")[1]??""))??[]},async getRequestedChainsIds(){return[...new Set(await e.storage?.getItem(this.requestedChainsStorageKey)??[])]},async isChainsStale(){if(!l)return!1;let t=e.chains.map(e=>e.id),r=this.getNamespaceChainsIds();if(r.length&&!r.some(e=>t.includes(e)))return!1;let n=await this.getRequestedChainsIds();return!t.every(e=>n.includes(Number(e)))},async setRequestedChainsIds(t){await e.storage?.setItem(this.requestedChainsStorageKey,t)},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}r(59908),eX.type="walletConnect";var eQ=r(18680),e0=r(87170);let e1=(0,eQ.sj)({pendingTransactions:0}),e2={state:e1,subscribeKey:(e,t)=>(0,e0.VW)(e1,e,t),increase(e){e1[e]+=1},decrease(e){e1[e]-=1},reset(e){e1[e]=0}};async function e5(e){if(eM.j.isSafeApp()){let{safe:t}=await r.e(8625).then(r.bind(r,88625));if(t&&!e.some(e=>"safe"===e.type))return t()}return null}async function e3(e){try{let{coinbaseWallet:t}=await r.e(8625).then(r.bind(r,88625));if(t&&!e.some(e=>
24"coinbaseWalletSDK"===e.id))return t()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}let e6={enable:!1,pollingInterval:3e4};class e4 extends eW.q{constructor(e){let t=eF.f.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=eD.b.CHAIN.EVM,this.adapterType=eD.b.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...e6,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){let t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===eD.b.CONNECTOR_ID.AUTH){let e=await t.getProvider();if(!e?.user)return{accounts:[]};let{address:r,accounts:n}=e.user;return Promise.resolve({accounts:(n||[{address:r,type:"eoa"}]).map(e=>eM.j.createAccount("eip155",e.address,e.type))})}let{addresses:r,address:n}=(0,o.D)(this.wagmiConfig);return Promise.resolve({accounts:[...new Set(r||[n])].map(e=>eM.j.createAccount("eip155",e||"","eoa"))})}checkChainId(){let{chainId:e}=(0,o.D)(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(e=>e.chainNamespace===eD.b.CHAIN.EVM);let t={},r=[...e.connectors??[]];this.wagmiChains.forEach(r=>{let n=e.transports?.[r.id],i=eF.f.getCaipNetworkId(r);n?t[r.id]=eF.f.extendWagmiTransports(r,e.projectId,n):t[r.id]=eF.f.getViemTransport(r,e.projectId,e.customRpcUrls?.[i])}),this.wagmiConfig=function(e){let t;let{multiInjectedProviderDiscovery:r=!0,storage:i=function(e){let{deserialize:t=S,key:r="wagmi",serialize:n=k,storage:i=O}=e;function o(e){return e instanceof Promise?e.then(e=>e).catch(()=>null):e}return{...i,key:r,async getItem(e,n){let s=i.getItem(`${r}.${e}`),a=await o(s);return a?t(a)??null:n??null},async setItem(e,t){let s=`${r}.${e}`;null===t?await o(i.removeItem(s)):await o(i.setItem(s,n(t)))},async removeItem(e){await o(i.removeItem(`${r}.${e}`))}}}({storage:function(){let e="undefined"!=typeof window&&window.localStorage?window.localStorage:O;return{getItem:t=>e.getItem(t),removeItem(t){e.removeItem(t)},setItem(t,r){try{e.setItem(t,r)}catch{}}}}()}),syncConnectedChain:o=!0,ssr:c=!1,...u}=e,h="undefined"!=typeof window&&r?function(){let e=new Set,t=[],r=()=>(function(e){if("undefined"==typeof window)return;let t=t=>e(t.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)})(r=>{t.some(({info:e})=>e.uuid===r.info.uuid)||(t=[...t,r],e.forEach(e=>e(t,{added:[r]})))}),n=r();return{_listeners:()=>e,clear(){e.forEach(e=>e([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),n?.()},findProvider:({rdns:e})=>t.find(t=>t.info.rdns===e),getProviders:()=>t,reset(){this.clear(),n?.(),n=r()},subscribe:(r,{emitImmediately:n}={})=>(e.add(r),n&&r(t,{added:t}),()=>e.delete(r))}}():void 0,p=d(()=>u.chains),f=d(()=>{let e=[],t=new Set;for(let r of u.connectors??[]){let n=g(r);if(e.push(n),!c&&n.rdns)for(let e of"string"==typeof n.rdns?[n.rdns]:n.rdns)t.add(e)}if(!c&&h)for(let r of h.getProviders())t.has(r.info.rdns)||e.push(g(m(r)));return e});function g(e){let t=new A(function(e=11){if(!n||N+e>512){n="",N=0;for(let e=0;e<256;e++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(N,N+++e)}()),r={...e({emitter:t,chains:p.getState(),storage:i,transports:u.transports}),emitter:t,uid:t.uid};return t.on("connect",I),r.setup?.(),r}function m(e){let{info:t}=e,r=e.provider;return v({target:{...t,id:t.rdns,provider:r}})}let b=new Map;function w(){return{chainId:p.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let C="0.0.0-canary-";t=P.i.startsWith(C)?Number.parseInt(P.i.replace(C,"")):Number.parseInt(P.i.split(".")[0]??"0");let E=d(a(i?l(w,{migrate(e,r){if(r===t)return e;let n=w(),i=x(e,n.chainId);return{...n,chainId:i}},name:"store",partialize:e=>({connections:{__type:"Map",value:Array.from(e.connections.entries()).map(([e,t])=>{let{id:r,name:n,type:i,uid:o}=t.connector;return[e,{...t,connector:{id:r,name:n,type:i,uid:o}}]})},chainId:e.chainId,current:e.current}),merge(e,t){"object"==typeof e&&e&&"status"in e&&delete e.status;let r=x(e,t.chainId);return{...t,...e,chainId:r}},skipHydration:c,storage:i,version:t}):w));function x(e,t){return e&&"object"==typeof e&&"chainId"in e&&"number"==typeof e.chainId&&p.getState().some(t=>t.id===e.chainId)?e.chainId:t}function _(e){E.setState(t=>{let r=t.connections.get(e.uid);return r?{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts??r.accounts,chainId:e.chainId??r.chainId,connector:r.connector})}:t})}function I(e){"connecting"!==E.getState().status&&"reconnecting"!==E.getState().status&&E.setState(t=>{let r=f.getState().find(t=>t.uid===e.uid);return r?(r.emitter.listenerCount("connect")&&r.emitter.off("connect",_),r.emitter.listenerCount("change")||r.emitter.on("change",_),r.emitter.listenerCount("disconnect")||r.emitter.on("disconnect",T),{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts,chainId:e.chainId,connector:r}),current:e.uid,status:"connected"}):t})}function T(e){E.setState(t=>{let r=t.connections.get(e.uid);if(r){let e=r.connector;e.emitter.listenerCount("change")&&r.connector.emitter.off("change",_),e.emitter.listenerCount("disconnect")&&r.connector.emitter.off("disconnect",T),e.emitter.listenerCount("connect")||r.connector.emitter.on("connect",I)}if(t.connections.delete(e.uid),0===t.connections.size)return{...t,connections:new Map,current:null,status:"disconnected"};let n=t.connections.values().next().value;return{...t,connections:new Map(t.connections),current:n.connector.uid}})}return E.setState(w()),o&&E.subscribe(({connections:e,current:t})=>t?e.get(t)?.chainId:void 0,e=>{if(p.getState().some(t=>t.id===e))return E.setState(t=>({...t,chainId:e??t.chainId}))}),h?.subscribe(e=>{let t=new Set,r=new Set;for(let e of f.getState())if(t.add(e.id),e.rdns)for(let t of"string"==typeof e.rdns?[e.rdns]:e.rdns)r.add(t);let n=[];for(let i of e){if(r.has(i.info.rdns))continue;let e=g(m(i));t.has(e.id)||n.push(e)}(!i||E.persist.hasHydrated())&&f.setState(e=>[...e,...n],!0)}),{get chains(){return p.getState()},get connectors(){return f.getState()},storage:i,getClient:function(e={}){let t;let r=e.chainId??E.getState().chainId,n=p.getState().find(e=>e.id===r);if(e.chainId&&!n)throw new y.X4;{let e=b.get(E.getState().chainId);if(e&&!n)return e;if(!n)throw new y.X4}{let e=b.get(r);if(e)return e}if(u.client)t=u.client({chain:n});else{let e=n.id,r=p.getState().map(e=>e.id),i={};for(let[t,n]of Object.entries(u))if("chains"!==t&&"client"!==t&&"connectors"!==t&&"transports"!==t){if("object"==typeof n){if(e in n)i[t]=n[e];else{if(r.some(e=>e in n))continue;i[t]=n}}else i[t]=n}t=(0,s.e)({...i,chain:n,batch:i.batch??{multicall:!0},transport:t=>u.transports[e]({...t,connectors:f})})}return b.set(r,t),t},get state(){return E.getState()},setState(e){let t;t="function"==typeof e?e(E.getState()):e;let r=w();"object"!=typeof t&&(t=r),Object.keys(r).some(e=>!(e in t))&&(t=r),E.setState(t,!0)},subscribe:(e,t,r)=>E.subscribe(e,t,r?{...r,fireImmediately:r.emitImmediately}:void 0),_internal:{mipd:h,async revalidate(){let e=E.getState(),t=e.connections,r=e.current;for(let[,e]of t){let n=e.connector;n.isAuthorized&&await n.isAuthorized()||(t.delete(n.uid),r!==n.uid||(r=null))}E.setState(e=>({...e,connections:t,current:r}))},store:E,ssr:!!c,syncConnectedChain:o,transports:u.transports,chains:{setState(e){let t="function"==typeof e?e(p.getState()):e;if(0!==t.length)return p.setState(t,!0)},subscribe:e=>p.subscribe(e)}
24,connectors:{providerDetailToConnector:m,setup:g,setState:e=>f.setState("function"==typeof e?e(f.getState()):e,!0),subscribe:e=>f.subscribe(e)},events:{change:_,connect:I,disconnect:T}}}}({...e,chains:this.wagmiChains,connectors:r,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=function(e,t){let r,n;let{syncConnectedChain:i=e._internal.syncConnectedChain,...o}=t,s=t=>{r&&r();let n=e.getClient({chainId:t});return r=(0,R.s)(n,T.O,"watchPendingTransactions")(o)},a=s(t.chainId);return i&&!t.chainId&&(n=e.subscribe(({chainId:e})=>e,async e=>s(e))),()=>{a?.(),n?.()}}(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),e2.increase("pendingTransactions")}});let e=e2.subscribeKey("pendingTransactions",t=>{t>=eD.b.LIMITS.PENDING_TRANSACTIONS&&(this.unwatchPendingTransactions?.(),e())})}setupWatchers(){!function(e,t){let{onChange:r}=t;e.subscribe(()=>L(e),r,{equalityFn:$})}(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(e=>{let t=this.getCaipNetworks().find(t=>t.id===e.chainId),r=e.connector.id===eD.b.CONNECTOR_ID.AUTH;return{accounts:e.accounts.map(e=>({address:this.toChecksummedAddress(e)})),caipNetwork:t,connectorId:e.connector.id,auth:r?{name:eU.M.getConnectedSocialProvider(),username:eU.M.getConnectedSocialUsername()}:void 0}}))}}),function(e,t){let{onChange:r}=t;e.subscribe(()=>(0,o.D)(e),r,{equalityFn(e,t){let{connector:r,...n}=e,{connector:i,...o}=t;return $(n,o)&&r?.id===i?.id&&r?.uid===i?.uid}})}(this.wagmiConfig,{onChange:(e,t)=>
24{if("disconnected"===e.status&&t.address&&this.emit("disconnect"),e?.chainId&&e?.chainId!==t?.chainId&&this.emit("switchNetwork",{chainId:e.chainId}),"connected"===e.status){let r=e.address!==t?.address,n=e.connector.id!==t.connector?.id,i="connected"!==t.status;(r||n||i)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(e){let t=[];if(!1!==e.enableCoinbase){let e=await e3(this.wagmiConfig.connectors);e&&t.push(e)}let r=await e5(this.wagmiConfig.connectors);r&&t.push(r),await Promise.all(t.map(t=>{let r=this.wagmiConfig._internal.connectors.setup(t);return this.wagmiConfig._internal.connectors.setState(e=>[...e,r]),this.addWagmiConnector(r,e)}))}addWagmiConnectors(e,t){let r=[];!1!==e.enableWalletConnect&&r.push(eX(e,t)),!1!==e.enableInjected&&r.push(v({shimDisconnect:!0}));let n=t?.remoteFeatures?.email??t?.features?.email??!0,i=t?.remoteFeatures?.socials??t?.features?.socials,o=Array.isArray(i)&&i?.length>0;(n||o)&&r.push(function(e){let t,r,n=[];function i(e){return eL.p.parseEvmChainId(e)||1}async function o(r={}){let o=(t||(t=eJ.D.getInstance({projectId:e.options.projectId,chainId:eV.eq()?.caipNetworkId,enableLogger:e.options.enableAuthLogger,onTimeout:e=>{"iframe_load_failed"===e?eK.AlertController.open(eY.j.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):"iframe_request_timeout"===e?eK.AlertController.open(eY.j.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):"unverified_domain"===e&&eK.AlertController.open(eY.j.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:eY.j.EmbeddedWalletAbortController,getActiveCaipNetwork:e=>(0,eV.eq)(e),getCaipNetworks:e=>eB.R.getCaipNetworks(e)})),t),s=r.chainId;if(r.isReconnecting){let t=eL.p.parseEvmChainId(o.getLastUsedChainId()||""),r=e.chains?.[0].id;if(!(s=t||r))throw Error("ChainId not found in provider")}let a=(0,eV.r9)("eip155"),{address:c,chainId:l,accounts:u}=await eG.w.authConnectorAuthenticate({authConnector:o,chainId:s,preferredAccountType:a,socialUri:r.socialUri,chainNamespace:eD.b.CHAIN.EVM});n=u?.map(e=>e.address)||[c];let d=i(l);return{accounts:n,account:c,chainId:d,chain:{id:d,unsuported:!1}}}return(0,w.K)(t=>({id:eD.b.CONNECTOR_ID.AUTH,name:eD.b.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:eD.b.CHAIN.EVM,async connect(e={}){if(r)return r;r||(r=new Promise(t=>{t(o(e))}));let t=await r;return r=void 0,t},async disconnect(){let e=await this.getProvider();await e.disconnect()},getAccounts:()=>n?.length?(t.emitter.emit("change",{accounts:n}),Promise.resolve(n)):Promise.resolve([]),async getProvider(){return this.provider||(this.provider=eJ.D.getInstance({projectId:e.options.projectId,chainId:eV.eq()?.caipNetworkId,enableLogger:e.options.enableAuthLogger,abortController:eY.j.EmbeddedWalletAbortController,onTimeout:e=>{"iframe_load_failed"===e?eK.AlertController.open(eY.j.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):"iframe_request_timeout"===e?eK.AlertController.open(eY.j.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):"unverified_domain"===e&&eK.AlertController.open(eY.j.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:e=>(0,eV.eq)(e),getCaipNetworks:e=>eB.R.getCaipNetworks(e)})),Promise.resolve(this.provider)},async getChainId(){let e=await this.getProvider(),{chainId:t}=await e.getChainId();return i(t)},async isAuthorized(){let e=eB.R.state.activeChain===eD.b.CHAIN.EVM;return(!eD.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(e=>eZ.ConnectorController.getConnectorId(e)===eD.b.CONNECTOR_ID.AUTH)||!!e)&&Promise.resolve((await this.getProvider()).getLoginEmailUsed())},async switchChain({chainId:e}){try{let r=t.chains.find(t=>t.id===e);if(!r)throw new p.x3(Error("chain not found on connector."));let i=await this.getProvider(),o=(0,eV.r9)("eip155"),s=await i.connect({chainId:e,preferredAccountType:o});return n=s?.accounts?.map(e=>e.address)||[s.address],t.emitter.emit("change",{chainId:Number(e),accounts:n}),r}catch(e){if(e instanceof Error)throw new p.x3(e);throw e}},onAccountsChanged(e){0===e.length?this.onDisconnect():t.emitter.emit("change",{accounts:e.map(h.K)})},onChainChanged(e){let r=Number(e);t.emitter.emit("change",{chainId:r})},async onDisconnect(e){let t=await this.getProvider();await t.disconnect()}}))}({chains:this.wagmiChains,options:{projectId:e.projectId,enableAuthLogger:e.enableAuthLogger}}
24)),r.forEach(e=>{let t=this.wagmiConfig._internal.connectors.setup(e);this.wagmiConfig._internal.connectors.setState(e=>[...e,t])})}async handleAccountChanged({address:e,chainId:t,connector:r}){if(!this.namespace)throw Error("WagmiAdapter:handleAccountChanged - namespace is required");let n=await r.getProvider().catch(()=>void 0);this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:r.id,name:ez.C.ConnectorNamesMap[r.id]??r.name,imageId:ez.C.ConnectorImageIds[r.id],type:ez.C.ConnectorTypesMap[r.type]??"EXTERNAL",info:r.id===eD.b.CONNECTOR_ID.INJECTED?void 0:{rdns:r.id},provider:n,chain:this.namespace,chains:[]}})}async signMessage(e){try{return{signature:await (0,M.l)(this.wagmiConfig,{message:e.message,account:e.address})}}catch(e){throw Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){let{chainId:t,address:r}=(0,o.D)(this.wagmiConfig),n={account:r,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chainId:t,type:"legacy",parameters:["nonce"]};await j(this.wagmiConfig,n);let i=await ei(this.wagmiConfig,n);return await el(this.wagmiConfig,{hash:i,timeout:25e3}),{hash:i}}async writeContract(e){let{caipNetwork:t,...r}=e,n=Number(eL.p.caipNetworkIdToNumber(t.caipNetworkId));return{hash:await ep(this.wagmiConfig,{chain:this.wagmiChains?.[n],chainId:n,address:r.tokenAddress,account:r.fromAddress,abi:r.abi,functionName:r.method,args:r.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await eg(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch(e){throw Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return function(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new eR({value:e});let[r,n="0"]=e.split("."),i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),0===t)1===Math.round(Number(`.${n}`))&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>t){let[e,i,o]=[n.slice(0,t-1),n.slice(t-1,t),n.slice(t)],s=Math.round(Number(`${i}.${o}`));(n=s>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,"0"):`${e}${s}`).length>t&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,t)}else n=n.padEnd(t,"0");return BigInt(`${i?"-":""}${r}${n}`)}(e.value,e.decimals)}formatUnits(e){return(0,eC.b)(e.value,e.decimals)}async addWagmiConnector(e,t){if(!this.namespace)throw Error("WagmiAdapter:addWagmiConnector - namespace is required");if(e.type===eD.b.CONNECTOR_ID.INJECTED&&!1===t.enableEIP6963||e.id===eD.b.CONNECTOR_ID.AUTH||e.id===eD.b.CONNECTOR_ID.WALLET_CONNECT)return;let r=await e.getProvider().catch(()=>void 0);this.addConnector({id:e.id,explorerId:ez.C.ConnectorExplorerIds[e.id],imageUrl:t?.connectorImages?.[e.i
24d]??e.icon,name:ez.C.ConnectorNamesMap[e.id]??e.name,imageId:ez.C.ConnectorImageIds[e.id],type:ez.C.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===eD.b.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:r,chain:this.namespace,chains:[]})}async syncConnectors(e,t){!function(e,t){let{onChange:r}=t;e._internal.connectors.subscribe((e,t)=>{r(Object.values(e),t)})}(this.wagmiConfig,{onChange:t=>{t.forEach(t=>this.addWagmiConnector(t,e))}}),this.addWagmiConnectors(e,t),await Promise.all(this.wagmiConfig.connectors.map(t=>this.addWagmiConnector(t,e))),this.addThirdPartyConnectors(e)}async syncConnections(){return Promise.resolve()}async syncConnection(e){let{id:t,chainId:r}=e,n=L(this.wagmiConfig).find(e=>e.connector.id===t),i=this.getWagmiConnector(t),o=await i?.getProvider();if(eM.j.isSafeApp()&&t===eD.b.CONNECTOR_ID.SAFE&&!n?.accounts.length){let e=this.getWagmiConnector("safe");if(e){let t=await em(this.wagmiConfig,{connector:e,chainId:Number(r)}),i=await e.getProvider();return{chainId:Number(r),address:this.toChecksummedAddress(t.accounts[0]),provider:i,type:n?.connector.type?.toUpperCase(),id:n?.connector.id}}}return{chainId:Number(n?.chainId),address:this.toChecksummedAddress(n?.accounts[0]),provider:o,type:n?.connector.type?.toUpperCase(),id:n?.connector.id}}async connectWalletConnect(e){try{let t=this.getWalletConnectConnector();await t.authenticate();let r=this.getWagmiConnector("walletConnect");if(!r)throw Error("UniversalAdapter:connectWalletConnect - connector not found");let n=await em(this.wagmiConfig,{connector:r,chainId:e?Number(e):void 0});return n.chainId!==Number(e)&&await ey(this.wagmiConfig,{chainId:n.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(e){if(e instanceof p.ab)throw Error(e.shortMessage);throw e}}async connect(e){let{id:t,address:r,provider:n,type:i,info:o,chainId:s,socialUri:a}=e,c=this.getWagmiConnector(t);if(!c)throw Error("connectionControllerClient:connectExternal - connector is undefined");n&&o&&c.id===eD.b.CONNECTOR_ID.EIP6963&&c.setEip6963Wallet?.({provider:n,info:o});let l=this.wagmiConfig.state?.connections?.get(c.uid);if(l){await this.wagmiConfig.storage?.setItem("recentConnectorId",c.id);let e=[...l.accounts].sort((e,t)=>eH.g.isLowerCaseMatch(e,r)?-1:eH.g.isLowerCaseMatch(t,r)?1:0);return this.wagmiConfig?.setState(t=>({...t,connections:new Map(t.connections).set(c.uid,{accounts:e,chainId:l.chainId,connector:l.connector}),current:c.uid,status:"connected"})),{address:this.toChecksummedAddress(e[0]),chainId:l.chainId,provider:n,type:i,id:t}}let u=await em(this.wagmiConfig,{connector:c,chainId:s?Number(s):void 0,socialUri:a});return{address:this.toChecksummedAddress(u.accounts[0]),chainId:u.chainId,provider:n,type:i,id:t}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(e=>({address:this.toChecksummedAddress(e)})),connectorId:e.connector.id}))}async reconnect(e){let{id:t}=e,r=this.getWagmiConnector(t);if(!r)throw Error("connectionControllerClient:connectExternal - connector is undefined");await ew(this.wagmiConfig,{connectors:[r]})}async getBalance(e){let t=e.address,r=this.getCaipNetworks().find(t=>t.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(r&&this.wagmiConfig){let t=`${r.caipNetworkId}:${e.address}`,n=this.balancePromises[t];if(n)return n;let i=eU.M.getNativeBalanceCacheForCaipAddress(t);return i?{balance:i.balance,symbol:i.symbol}:(this.balancePromises[t]=new Promise(async n=>{try{let i=Number(e.chainId),o=await eN(this.wagmiConfig,{address:e.address,chainId:i,token:e.tokens?.[r.caipNetworkId]?.address});eU.M.updateNativeBalanceCache({caipAddress:t,balance:o.formatted,symbol:o.symbol,timestamp:Date.now()}),n({balance:o.formatted,symbol:o.symbol})}catch(e){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",e),n({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[t]}),this.balancePromises[t]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){return this.getWagmiConnector("walletConnect")?.provider}async disconnect(e){if(e.id){let t=this.getWagmiConnector(e.id),r=L(this.wagmiConfig).find(t=>eH.g.isLowerCaseMatch(t.connector.id,e.id));return(await eT(this.wagmiConfig,{connector:t}),!1===ej.OptionsController.state.enableReconnect&&this.deleteConnection(e.id),r)?{connections:[{accounts:r.accounts.map(e=>({address:this.toChecksummedAddress(e)})),connectorId:r.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){let e=L(this.wagmiConfig),t=await Promise.allSettled(e.map(async e=>{let t=this.getWagmiConnector(e.connector.id);return t&&await eT(this.wagmiConfig,{connector:t}),e}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(e=>"fulfilled"===e.status).map(({value:e})=>({accounts:e.accounts.map(e=>({address:this.toChecksummedAddress(e)})),connectorId:e.connector.id}))}}async switchNetwork(e){let{caipNetwork:t}=e,r=this.wagmiConfig.chains.find(e=>e.id.toString()===t.id.toString());await ey(this.wagmiConfig,{chainId:t.id,addEthereumChainParameter:{chainName:r?.name??t.name,nativeCurrency:r?.nativeCurrency??t.nativeCurrency,rpcUrls:[t.rpcUrls?.chainDefault?.http?.[0]??r?.rpcUrls?.default?.http?.[0]??""],blockExplorerUrls:[r?.blockExplorers?.default?.url??t.blockExplorers?.default?.url??""]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");let t=L(this.wagmiConfig)[0],r=t?this.getWagmiConnector(t.connector.id):null;if(!r)throw Error("connectionControllerClient:getCapabilities - connector is undefined");let n=await r.getProvider();if(!n)throw Error("connectionControllerClient:getCapabilities - provider is undefined");return await n.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");let t=L(this.wagmiConfig)[0],r=t?this.getWagmiConnector(t.connector.id):null;if(!r)throw Error("connectionControllerClient:grantPermissions - connector is undefined");let n=await r.getProvider();if(!n)throw Error("connectionControllerClient:grantPermissions - provider is undefined");return n.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");let t=L(this.wagmiConfig)[0],r=t?this.getWagmiConnector(t.connector.id):null;if(!r)throw Error("connectionControllerClient:revokePermissions - connector is undefined");let n=await r.getProvider();if(!n)throw Error("connectionControllerClient:revokePermissions - provider is undefined");return n.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");let t=L(this.wagmiConfig)[0],r=t?this.getWagmiConnector(t.connector.id):null;if(!r)throw Error("connectionControllerClient:walletGetAssets - connector is undefined");let n=await r.getProvider();if(!n)throw Error("connectionControllerClient:walletGetAssets - provider is undefined");return n.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw Error("WagmiAdapter:setAuthProvider - namespace is required");
24this.addConnector({id:eD.b.CONNECTOR_ID.AUTH,type:"AUTH",name:eD.b.CONNECTOR_NAMES.AUTH,provider:e,imageId:ez.C.ConnectorImageIds[eD.b.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){return e.on("connect",()=>{let e=L(this.wagmiConfig),t=this.getWagmiConnector("walletConnect");if(t&&!e.find(e=>e.connector.id===t.id)){if("eip155"===eB.R.state.activeChain)return;ew(this.wagmiConfig,{connectors:[t]})}}),this.addConnector(new eq.z({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){return(0,h.x)(e.toLowerCase())}}var e8=r(71906);function e9(e,t){return e.slice(0,t).join(".")||"."}function e7(e,t){let{length:r}=e;for(let n=0;n<r;++n)if(e[n]===t)return n+1;return 0}function te(e,t,r,n){return JSON.stringify(e,function(e,t){let r="function"==typeof e,n="function"==typeof t,i=[],o=[];return function(s,a){if("object"==typeof a){if(i.length){let e=e7(i,this);0===e?i[i.length]=this:(i.splice(e),o.splice(e)),o[o.length]=s;let r=e7(i,a);if(0!==r)return n?t.call(this,s,a,e9(o,r)):`[ref=${e9(o,r)}]`}else i[0]=a,o[0]=s}return r?e.call(this,s,a):a}}((e,r)=>{let n=r;return"bigint"==typeof n&&(n={__type:"bigint",value:r.toString()}),n instanceof Map&&(n={__type:"Map",value:Array.from(r.entries())}),t?.(e,n)??n},n),r??void 0)}let tt={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};var tr=r(27169),tn=r(94650),ti=r(8150);let to={MetaMask:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",WemixPlay:"4eb754ffaf9e177eef0ef26f82b7c2fdf8d7178c52682704bf3e7830071d3427",OKX:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709"},ts=i,ta="03c231f59aeb48769280fb9b4da9fc4d";if(!ta)throw Error("Project ID is not defined");let tc=[ts],tl=new e4({storage:function(e){let{deserialize:t=e8.v,key:r="wagmi",serialize:n=te,storage:i=tt}=e;function o(e){return e instanceof Promise?e.then(e=>e).catch(()=>null):e}return{...i,key:r,async getItem(e,n){let s=i.getItem(`${r}.${e}`),a=await o(s);return a?t(a)??null:n??null},async setItem(e,t){let s=`${r}.${e}`;null===t?await o(i.removeItem(s)):await o(i.setItem(s,n(t)))},async removeItem(e){await o(i.removeItem(`${r}.${e}`))}}}({storage:tr.Dr}),ssr:!0,projectId:ta,networks:tc,transports:{[ts.id]:(0,tn.d)()}}),tu=tl.wagmiConfig,td={name:"WEMIX",description:"WEMIX official site",url:"https://reown.com/appkit",icons:["https://assets.reown.com/reown-profile-pic.png"]},th=(0,ti.v)({chain:ts,transport:(0,tn.d)()})},82898:function(e){e.exports={"background-state-hover":"rgba(0,0,0,.07)","background-state-pressed":"rgba(0,0,0,.12)","bg-dark":"#0c0b11","bg-dark-ecosystem":"#000",black:"#000","color-chart01":"#7c7bff","color-chart02":"#2ab7e5","color-chart03":"#f7387d","color-decrease":"#ff3838","color-increase":"#27c683",gray00:"#161519",gray10:"#1d1c21",gray100:"#fff",gray20:"#32323c",gray30:"#484a57",gray40:"#5d606d",gray50:"#737985",gray60:"#8c939d",gray70:"#a6adb5",gray80:"#cbd2d9",gray90:"#eaeef2","header-height-desktop":"60px","header-height-mobile":"48px","opacity-black10":"rgba(0,0,0,.1)","opacity-black5":"rgba(0,0,0,.05)","opacity-white10":"hsla(0,0%,100%,.1)","opacity-white20":"hsla(0,0%,100%,.2)","opacity-white5":"hsla(0,0%,100%,.05)","opacity-white50":"hsla(0,0%,100%,.5)",white:"#fff","icon-wrap":"SvgIcon_icon-wrap__7FoLH"}},18701:function(e){e.exports={"background-state-hover":"rgba(0,0,0,.07)","background-state-pressed":"rgba(0,0,0,.12)","bg-dark":"#0c0b11","bg-dark-ecosystem":"#000",black:"#000","color-chart01":"#7c7bff","color-chart02":"#2ab7e5","color-chart03":"#f7387d","color-decrease":"#ff3838","color-increase":"#27c683",gray00:"#161519",gray10:"#1d1c21",gray100:"#fff",gray20:"#32323c",gray30:"#484a57",gray40:"#5d606d",gray50:"#737985",gray60:"#8c939d",gray70:"#a6adb5",gray80:"#cbd2d9",gray90:"#eaeef2","header-height-desktop":"60px","header-height-mobile":"48px","opacity-black10":"rgba(0,0,0,.1)","opacity-black5":"rgba(0,0,0,.05)","opacity-white10":"hsla(0,0%,100%,.1)","opacity-white20":"hsla(0,0%,100%,.2)","opacity-white5":"hsla(0,0%,100%,.05)","opacity-white50":"hsla(0,0%,100%,.5)",white:"#fff",spinner:"LoadingCircle_spinner__UW_qQ",rotation:"LoadingCircle_rotation__LnJj0","spinner-40":"LoadingCircle_spinner-40__PGPRl","spinner-80":"LoadingCircle_spinner-80__1oc_k","spinner-100":"LoadingCircle_spinner-100__ry4ji"}},28325:function(e){e.exports={"background-state-hover":"rgba(0,0,0,.07)","background-state-pressed":"rgba(0,0,0,.12)","bg-dark":"#0c0b11","bg-dark-ecosystem":"#000",black:"#000","color-chart01":"#7c7bff","color-chart02":"#2ab7e5","color-chart03":"#f7387d","color-decrease":"#ff3838","color-increase":"#27c683",gray00:"#161519",gray10:"#1d1c21",gray100:"#fff",gray20:"#32323c",gray30:"#484a57",gray40:"#5d606d",gray50:"#737985",gray60:"#8c939d",gray70:"#a6adb5",gray80:"#cbd2d9",gray90:"#eaeef2","header-height-desktop":"60px","header-height-mobile":"48px","opacity-black10":"rgba(0,0,0,.1)","opacity-black5":"rgba(0,0,0,.05)","opacity-white10":"hsla(0,0%,100%,.1)","opacity-white20":"hsla(0,0%,100%,.2)","opacity-white5":"hsla(0,0%,100%,.05)","opacity-white50":"hsla(0,0%,100%,.5)",white:"#fff","snackbar-wrap":"Snackbar_snackbar-wrap__LfZZu","bottom-100":"Snackbar_bottom-100__a6srE",text:"Snackbar_text__LRnxx","close-button":"Snackbar_close-button__ZOv_q"}},13937:function(e){e.exports={"background-state-hover":"rgba(0,0,0,.07)","background-state-pressed":"rgba(0,0,0,.12)","bg-dark":"#0c0b11","bg-dark-ecosystem":"#000",black:"#000","color-chart01":"#7c7bff","color-chart02":"#2ab7e5","color-chart03":"#f7387d","color-decrease":"#ff3838","color-increase":"#27c683",gray00:"#161519",gray10:"#1d1c21",gray100:"#fff",gray20:"#32323c",gray30:"#484a57",gray40:"#5d606d",gray50:"#737985",gray60:"#8c939d",gray70:"#a6adb5",gray80:"#cbd2d9",gray90:"#eaeef2","header-height-desktop":"60px","header-height-mobile":"48px","opacity-black10":"rgba(0,0,0,.1)","opacity-black5":"rgba(0,0,0,.05)","opacity-white10":"hsla(0,0%,100%,.1)","opacity-white20":"hsla(0,0%,100%,.2)","opacity-white5":"hsla(0,0%,100%,.05)","opacity-white50":"hsla(0,0%,100%,.5)",white:"#fff",wrap:"LoadingPopup_wrap__t1f8g",background:"LoadingPopup_background__sMOlX","loading-circle-wrap":"LoadingPopup_loading-circle-wrap__gqtDJ","popup-title-wrap":"LoadingPopup_popup-title-wrap__YP_I_"}},4414:function(e){e.exports={"background-state-hover":"rgba(0,0,0,.07)","background-state-pressed":"rgba(0,0,0,.12)","bg-dark":"#0c0b11","bg-dark-ecosystem":"#000",black:"#000","color-chart01":"#7c7bff","color-chart02":"#2ab7e5","color-chart03":"#f7387d","color-decrease":"#ff3838","color-increase":"#27c683",gray00:"#161519",gray10:"#1d1c21",gray100:"#fff",gray20:"#32323c",gray30:"#484a57",gray40:"#5d606d",gray50:"#737985",gray60:"#8c939d",gray70:"#a6adb5",gray80:"#cbd2d9",gray90:"#eaeef2","header-height-desktop":"60px","header-height-mobile":"48px","opacity-black10":"rgba(0,0,0,.1)","opacity-black5":"rgba(0,0,0,.05)","opacity-white10":"hsla(0,0%,100%,.1)","opacity-white20":"hsla(0,0%,100%,.2)","opacity-white5":"hsla(0,0%,100%,.05)","opacity-white50":"hsla(0,0%,100%,.5)",white:"#fff","popup-root":"PopupLayout_popup-root__e5VUg",zIndex1000:"PopupLayout_zIndex1000__ZRS_V",zIndex5000:"PopupLayout_zIndex5000__vhQPi",open:"PopupLayout_open__vaIf7","popup-mask":"PopupLayout_popup-mask__wcyPS",fadeIn:"PopupLayout_fadeIn__fsTNP","popup-content":"PopupLayout_popup-content__78WUu",fadeInPopup:"PopupLayout_fadeInPopup__2JyNz",fadeOut:"PopupLayout_fadeOut__wGX1K",simple:"PopupLayout_simple__qOoJX",full:"PopupLayout_full__w6Iho","flex-gap-24":"PopupLayout_flex-gap-24__O11WA","flex-gap-16":"PopupLayout_flex-gap-16__TvVfa",bottom:"PopupLayout_bottom__w7VgN",frozen:"PopupLayout_frozen__Olmr_",tennis_popup:"PopupLayout_tennis_popup__cQawm","wemix-open-follow-popup":"PopupLayout_wemix-open-follow-popup__zv8Sd",scaleUp:"PopupLayout_scaleUp__lKD7o"}},59120:function(e){e.exports={"background-state-hover":"rgba(0,0,0,.07)","background-state-pressed":"rgba(0,0,0,.12)","bg-dark":"#0c0b11","bg-dark-ecosystem":"#000",black:"#000","color-chart01":"#7c7bff","color-chart02":"#2ab7e5","color-chart03":"#f7387d","color-decrease":"#ff3838","color-increase":"#27c683",gray00:"#161519",gray10:"#1d1c21",gray100:"#fff",gray20:"#32323c",gray30:"#484a57",gray40:"#5d606d",gray50:"#737985",gray60:"#8c939d",gray70:"#a6adb5",gray80:"#cbd2d9",gray90:"#eaeef2","header-height-desktop":"60px","header-height-mobile":"48px","opacity-black10":"rgba(0,0,0,.1)","opacity-black5":"rgba(0,0,0,.05)","opacity-white10":"hsla(0,0%,100%,.1)","opacity-white20":"hsla(0,0%,100%,.2)","opacity-white5":"hsla(0,0%,100%,.05)","opacity-white50":"hsla(0,0%,100%,.5)",white:"#fff","popup-title-wrap":"PopupTitle_popup-title-wrap__av_p3"}},72390:function(){},67247:function(){},85195:function(){},21715:function(){},32043:function(){},38055:function(){},81226:function(){},92454:function(){},46956:function(e,t,r){e.exports=r(36778)},81633:function(e,t,r){e.exports=r(7749)},30969:function(e,t,r){e.exports=r(70102)},5111:function(e,t,r){e.exports=r(95713)},14224:function(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:s}
24catch(e){r=s}}();var c=[],l=!1,u=-1;function d(){l&&n&&(l=!1,n.length?c=n.concat(c):u=-1,c.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(n=c,c=[];++u<t;)n&&n[u].run();u=-1,t=c.length}n=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||l||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=f,i.addListener=f,i.once=f,i.off=f,i.removeListener=f,i.removeAllListeners=f,i.emit=f,i.prependListener=f,i.prependOnceListener=f,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}},68119:function(e,t,r){let n=r(84363),i=r(47638),o=r(59141),s=r(68857);function a(e,t,r,o,s){let a=[].slice.call(arguments,1),c=a.length,l="function"==typeof a[c-1];if(!l&&!n())throw Error("Callback required as last argument");if(l){if(c<2)throw Error("Too few arguments provided");2===c?(s=r,r=t,t=o=void 0):3===c&&(t.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=r,r=t,t=void 0))}else{if(c<1)throw Error("Too few arguments provided");return 1===c?(r=t,t=o=void 0):2!==c||t.getContext||(o=r,r=t,t=void 0),new Promise(function(n,s){try{let s=i.create(r,o);n(e(s,t,o))}catch(e){s(e)}})}try{let n=i.create(r,o);s(null,e(n,t,o))}catch(e){s(e)}}t.create=i.create,t.toCanvas=a.bind(null,o.render),t.toDataURL=a.bind(null,o.renderToDataURL),t.toString=a.bind(null,function(e,t,r){return s.render(e,r)})},84363:function(e){e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},28539:function(e,t,r){let n=r(64137).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];let t=Math.floor(e/7)+2,r=n(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),o=[r-7];for(let e=1;e<t-1;e++)o[e]=o[e-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){let r=[],n=t.getRowColCoords(e),i=n.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)(0!==e||0!==t)&&(0!==e||t!==i-1)&&(e!==i-1||0!==t)&&r.push([n[e],n[t]]);return r}},12215:function(e,t,r){let n=r(45965),i=["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 o(e){this.mode=n.ALPHANUMERIC,this.data=e}o.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*i.indexOf(this.data[t]);r+=i.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},e.exports=o},65520:function(e){function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){return(this.buffer[Math.floor(e/8)]>>>7-e%8&1)==1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},98844:function(e){function t(e){if(!e||e<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,n){let i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},53145:function(e,t,r){let n=r(24654),i=r(45965);function o(e){this.mode=i.BYTE,"string"==typeof e&&(e=n(e)),this.data=new Uint8Array(e)}o.getBitsLength=function(e){return 8*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},e.exports=o},29944:function(e,t,r){let n=r(10873),i=[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],o=[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,
24192,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];t.getBlocksCount=function(e,t){switch(t){case n.L:return i[(e-1)*4+0];case n.M:return i[(e-1)*4+1];case n.Q:return i[(e-1)*4+2];case n.H:return i[(e-1)*4+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return o[(e-1)*4+0];case n.M:return o[(e-1)*4+1];case n.Q:return o[(e-1)*4+2];case n.H:return o[(e-1)*4+3];default:return}}},10873:function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},70577:function(e,t,r){let n=r(64137).getSymbolSize;t.getPositions=function(e){let t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},91853:function(e,t,r){let n=r(64137),i=n.getBCHDigit(1335);t.getEncodedBits=function(e,t){let r=e.bit<<3|t,o=r<<10;for(;n.getBCHDigit(o)-i>=0;)o^=1335<<n.getBCHDigit(o)-i;return(r<<10|o)^21522}},67670:function(e,t){let r=new Uint8Array(512),n=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,n[e]=t,256&(e<<=1)&&(e^=285);for(let e=255;e<512;e++)r[e]=r[e-255]}(),t.log=function(e){if(e<1)throw Error("log("+e+")");return n[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[n[e]+n[t]]}},39198:function(e,t,r){let n=r(45965),i=r(64137);function o(e){this.mode=n.KANJI,this.data=e}o.getBitsLength=function(e){return 13*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=i.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),e.put(r,13)}},e.exports=o},84662:function(e,t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};let r={N1:3,N2:3,N3:40,N4:10};t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){let t=e.size,n=0,i=0,o=0,s=null,a=null;for(let c=0;c<t;c++){i=o=0,s=a=null;for(let l=0;l<t;l++){let t=e.get(c,l);t===s?i++:(i>=5&&(n+=r.N1+(i-5)),s=t,i=1),(t=e.get(l,c))===a?o++:(o>=5&&(n+=r.N1+(o-5)),a=t,o=1)}i>=5&&(n+=r.N1+(i-5)),o>=5&&(n+=r.N1+(o-5))}return n},t.getPenaltyN2=function(e){let t=e.size,n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);(4===t||0===t)&&n++}return n*r.N2},t.getPenaltyN3=function(e){let t=e.size,n=0,i=0,o=0;for(let r=0;r<t;r++){i=o=0;for(let s=0;s<t;s++)i=i<<1&2047|e.get(r,s),s>=10&&(1488===i||93===i)&&n++,o=o<<1&2047|e.get(s,r),s>=10&&(1488===o||93===o)&&n++}return n*r.N3},t.getPenaltyN4=function(e){let t=0,n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return Math.abs(Math.ceil(100*t/n/5)-10)*r.N4},t.applyMask=function(e,r){let n=r.size;for(let i=0;i<n;i++)for(let o=0;o<n;o++)r.isReserved(o,i)||r.xor(o,i,function(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw Error("bad maskPattern:"+e)}}(e,o,i))},t.getBestMask=function(e,r){let n=Object.keys(t.Patterns).length,i=0,o=1/0;for(let s=0;s<n;
vendor: 10,257 bytes, line 24
24s++){r(s),t.applyMask(s,e);let n=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(s,e),n<o&&(o=n,i=s)}return i}},45965:function(e,t,r){let n=r(31499),i=r(12795);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw Error("Invalid mode: "+e);if(!n.isValid(t))throw Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},47958:function(e,t,r){let n=r(45965);function i(e){this.mode=n.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,r;for(t=0;t+3<=this.data.length;t+=3)r=parseInt(this.data.substr(t,3),10),e.put(r,10);let n=this.data.length-t;n>0&&(r=parseInt(this.data.substr(t),10),e.put(r,3*n+1))},e.exports=i},39094:function(e,t,r){let n=r(67670);t.mul=function(e,t){let r=new Uint8Array(e.length+t.length-1);for(let i=0;i<e.length;i++)for(let o=0;o<t.length;o++)r[i+o]^=n.mul(e[i],t[o]);return r},t.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){let e=r[0];for(let i=0;i<t.length;i++)r[i]^=n.mul(t[i],e);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},t.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let i=0;i<e;i++)r=t.mul(r,new Uint8Array([1,n.exp(i)]));return r}},47638:function(e,t,r){let n=r(64137),i=r(10873),o=r(65520),s=r(98844),a=r(28539),c=r(70577),l=r(84662),u=r(29944),d=r(26460),h=r(39941),p=r(91853),f=r(45965),g=r(99660);function m(e,t,r){let n,i;let o=e.size,s=p.getEncodedBits(t,r);for(n=0;n<15;n++)i=(s>>n&1)==1,n<6?e.set(n,8,i,!0):n<8?e.set(n+1,8,i,!0):e.set(o-15+n,8,i,!0),n<8?e.set(8,o-n-1,i,!0):n<9?e.set(8,15-n-1+1,i,!0):e.set(8,15-n-1,i,!0);e.set(o-8,8,1,!0)}t.create=function(e,t){let r,p;if(void 0===e||""===e)throw Error("No input text");let y=i.M;return void 0!==t&&(y=i.from(t.errorCorrectionLevel,i.M),r=h.from(t.version),p=l.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),function(e,t,r,i){let p;if(Array.isArray(e))p=g.fromArray(e);else if("string"==typeof e){let n=t;if(!n){let t=g.rawSplit(e);n=h.getBestVersionForData(t,r)}p=g.fromString(e,n||40)}else throw Error("Invalid data");let y=h.getBestVersionForData(p,r);if(!y)throw Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<y)throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+y+".\n")}else t=y;let b=function(e,t,r){let i=new o;r.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(i)});let s=(n.getSymbolTotalCodewords(e)-u.getTotalCodewordsCount(e,t))*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);let a=(s-i.getLengthInBits())/8;for(let e=0;e<a;e++)i.put(e%2?17:236,8);return function(e,t,r){let i,o;let s=n.getSymbolTotalCodewords(t),a=s-u.getTotalCodewordsCount(t,r),c=u.getBlocksCount(t,r),l=s%c,h=c-l,p=Math.floor(s/c),f=Math.floor(a/c),g=f+1,m=p-f,y=new d(m),b=0,w=Array(c),v=Array(c),C=0,E=new Uint8Array(e.buffer);for(let e=0;e<c;e++){let t=e<h?f:g;w[e]=E.slice(b,b+t),v[e]=y.encode(w[e]),b+=t,C=Math.max(C,t)}let x=new Uint8Array(s),A=0;for(i=0;i<C;i++)for(o=0;o<c;o++)i<w[o].length&&(x[A++]=w[o][i]);for(i=0;i<m;i++)for(o=0;o<c;o++)x[A++]=v[o][i];return x}(i,e,t)}(t,r,p),w=new s(n.getSymbolSize(t));return function(e,t){let r=e.size,n=c.getPositions(t);for(let t=0;t<n.length;t++){let i=n[t][0],o=n[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1)&&!(r<=i+t))for(let n=-1;n<=7;n++)o+n<=-1||r<=o+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,o+n,!0,!0):e.set(i+t,o+n,!1,!0))}}(w,t),function(e){let t=e.size;for(let r=8;r<t-8;r++){let t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(w),function(e,t){let r=a.getPositions(t);for(let t=0;t<r.length;t++){let n=r[t][0],i=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,i+r,!0,!0):e.set(n+t,i+r,!1,!0)}}(w,t),m(w,r,0),t>=7&&function(e,t){let r,n,i;let o=e.size,s=h.getEncodedBits(t);for(let t=0;t<18;t++)r=Math.floor(t/3),n=t%3+o-8-3,i=(s>>t&1)==1,e.set(r,n,i,!0),e.set(n,r,i,!0)}(w,t),function(e,t){let r=e.size,n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;s<t.length&&(n=(t[s]>>>o&1)==1),e.set(i,a-r,n),-1==--o&&(s++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(w,b),isNaN(i)&&(i=l.getBestMask(w,m.bind(null,w,r))),l.applyMask(i,w),m(w,r,i),{modules:w,version:t,errorCorrectionLevel:r,maskPattern:i,segments:p}}(e,r,y,p)}},26460:function(e,t,r){let n=r(39094);function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},e.exports=i},12795:function(e,t){let r="[0-9]+",n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",i="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";t.KANJI=RegExp(n,"g"),t.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=RegExp(i,"g"),t.NUMERIC=RegExp(r,"g"),t.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let o=RegExp("^"+n+"$"),s=RegExp("^"+r+"$"),a=RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return o.test(e)},t.testNumeric=function(e){return s.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},99660:function(e,t,r){let n=r(45965),i=r(47958),o=r(12215),s=r(53145),a=r(39198),c=r(12795),l=r(64137),u=r(35376);function d(e){return unescape(encodeURIComponent(e)).length}function h(e,t,r){let n;let i=[];for(;null!==(n=e.exec(r));)i.push({data:n[0],index:n.index,mode:t,length:n[0].length});return i}function p(e){let t,r;let i=h(c.NUMERIC,n.NUMERIC,e),o=h(c.ALPHANUMERIC,n.ALPHANUMERIC,e);return l.isKanjiModeEnabled()?(t=h(c.BYTE,n.BYTE,e),r=h(c.KANJI,n.KANJI,e)):(t=h(c.BYTE_KANJI,n.BYTE,e),r=[]),i.concat(o,t,r).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,t){switch(t){case n.NUMERIC:return i.getBitsLength(e);case n.ALPHANUMERIC:return o.getBitsLength(e);case n.KANJI:return a.getBitsLength(e);case n.BYTE:return s.getBitsLength(e)}}function g(e,t){let r;let c=n.getBestModeForData(e);if((r=n.from(t,c))!==n.BYTE&&r.bit<c.bit)throw Error('"'+e+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(c));switch(r!==n.KANJI||l.isKanjiModeEnabled()||(r=n.BYTE),r){case n.NUMERIC:return new i(e);case n.ALPHANUMERIC:return new o(e);case n.KANJI:return new a(e);case n.BYTE:return new s(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},t.fromString=function(e,r){let i=function(e,t){let r={},i={start:{}},o=["start"];for(let s=0;s<e.length;s++){let a=e[s],c=[];for(let e=0;e<a.length;e++){let l=a[e],u=""+s+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<o.length;e++){let s=o[e];r[s]&&r[s].node.mode===l.mode?(i[s][u]=f(r[s].lastCount+l.length,l.mode)-f(r[s].lastCount,l.mode),r[s].lastCount+=l.length):(r[s]&&(r[s].lastCount=l.length),i[s][u]=f(l.length,l.mode)+4+n.getCharCountIndicator(l.mode,t))}}o=c}for(let e=0;e<o.length;e++)i[o[e]].end=0;return{map:i,table:r}}(function(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case n.NUMERIC:t.push([i,{data:i.data,mode:n.ALPHANUMERIC,length:i.length},{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.ALPHANUMERIC:t.push([i,{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.KANJI:t.push([i,{data:i.data,mode:n.BYTE,length:d(i.data)}]);break;case n.BYTE:t.push([{data:i.data,mode:n.BYTE,length:d(i.data)}])}}return t}(p(e,l.isKanjiModeEnabled())),r),o=u.find_path(i.map,"start","end"),s=[];for(let e=1;e<o.length-1;e++)s.push(i.table[o[e]].node);return t.fromArray(s.reduce(function(e,t){let r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?e[e.length-1].data+=t.data:e.push(t),e},[]))},t.rawSplit=function(e){return t.fromArray(p(e,l.isKanjiModeEnabled()))}},64137:function(e,t){let r;let n=[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];t.getSymbolSize=function(e){if(!e)throw Error('"version" cannot be null or undefined');if(e<1||e>40)throw Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},31499:function(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},39941:function(e,t,r){let n=r(64137),i=r(29944),o=r(10873),s=r(45965),a=r(31499),c=n.getBCHDigit
24(7973);function l(e,t){return s.getCharCountIndicator(e,t)+4}t.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!a.isValid(e))throw Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);let o=(n.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t))*8;if(r===s.MIXED)return o;let c=o-l(r,e);switch(r){case s.NUMERIC:return Math.floor(c/10*3);case s.ALPHANUMERIC:return Math.floor(c/11*2);case s.KANJI:return Math.floor(c/13);case s.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,r){let n;let i=o.from(r,o.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(function(e,t){let r=0;return e.forEach(function(e){let n=l(e.mode,t);r+=n+e.getBitsLength()}),r}(e,n)<=t.getCapacity(n,r,s.MIXED))return n}(e,i);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(let i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}(n.mode,n.getLength(),i)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-c>=0;)t^=7973<<n.getBCHDigit(t)-c;return e<<12|t}},59141:function(e,t,r){let n=r(2369);t.render=function(e,t,r){var i;let o=r,s=t;void 0!==o||t&&t.getContext||(o=t,t=void 0),t||(s=function(){try{return document.createElement("canvas")}catch(e){throw Error("You need to specify a canvas element")}}()),o=n.getOptions(o);let a=n.getImageWidth(e.modules.size,o),c=s.getContext("2d"),l=c.createImageData(a,a);return n.qrToImageData(l.data,e,o),i=s,c.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px",c.putImageData(l,0,0),s},t.renderToDataURL=function(e,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});let o=t.render(e,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},68857:function(e,t,r){let n=r(2369);function i(e,t){let r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function o(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}t.render=function(e,t,r){let s=n.getOptions(t),a=e.modules.size,c=e.modules.data,l=a+2*s.margin,u=s.color.light.a?"<path "+i(s.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",d="<path "+i(s.color.dark,"stroke")+' d="'+function(e,t,r){let n="",i=0,s=!1,a=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);l||s||(s=!0),e[c]?(a++,c>0&&l>0&&e[c-1]||(n+=s?o("M",l+r,.5+u+r):o("m",i,0),i=0,s=!1),l+1<t&&e[c+1]||(n+=o("h",a),a=0)):i++}return n}(c,a,s.margin)+'"/>',h='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+('viewBox="0 0 '+l)+" "+l+'" shape-rendering="crispEdges">'+u+d+"</svg>\n";return"function"==typeof r&&r(null,h),h}},2369:function(e,t){function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw Error("Invalid hex color: "+e);(3===t.length||4===t.length)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");let r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});let t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){let n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){let i=r.modules.size,o=r.modules.data,s=t.getScale(i,n),a=Math.floor((i+2*n.margin)*s),c=n.margin*s,l=[n.color.light,n.color.dark];for(let t=0;t<a;t++)for(let r=0;r<a;r++){let u=(t*a+r)*4,d=n.color.light;t>=c&&r>=c&&t<a-c&&r<a-c&&(d=l[o[Math.floor((t-c)/s)*i+Math.floor((r-c)/s)]?1:0]),e[u++]=d.r,e[u++]=d.g,e[u++]=d.b,e[u]=d.a}}},57828:function(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var i=n&&n.stringify||t;if("object"==typeof e&&null!==e){var o=r.length+1;if(1===o)return e;var s=Array(o);s[0]=i(e);for(var a=1;a<o;a++)s[a]=i(r[a]);return s.join(" ")}if("string"!=typeof e)return e;var c=r.length;if(0===c)return e;for(var l="",u=0,d=-1,h=e&&e.length||0,p=0;p<h;){if(37===e.charCodeAt(p)&&p+1<h){switch(d=d>-1?d:0,e.charCodeAt(p+1)){case 100:case 102:if(u>=c||null==r[u])break;d<p&&(l+=e.slice(d,p)),l+=Number(r[u]),d=p+2,p++;break;case 105:if(u>=c||null==r[u])break;d<p&&(l+=e.slice(d,p)),l+=Math.floor(Number(r[u])),d=p+2,p++;break;case 79:case 111:case 106:if(u>=c||void 0===r[u])break;d<p&&(l+=e.slice(d,p));var f=typeof r[u];if("string"===f){l+="'"+r[u]+"'",d=p+2,p++;break}if("function"===f){l+=r[u].name||"<anonymous>",d=p+2,p++;break}l+=i(r[u]),d=p+2,p++;break;case 115:if(u>=c)break;d<p&&(l+=e.slice(d,p)),l+=String(r[u]),d=p+2,p++;break;case 37:d<p&&(l+=e.slice(d,p)),l+="%",d=p+2,p++,u--}++u}++p}return -1===d?e:(d<h&&(l+=e.slice(d)),l)}},82198:function(e,t,r){"use strict";r.d(t,{Z:function(){return E}});var n,i=r(50959),o=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}
24,s=["br","col","colgroup","dl","hr","iframe","img","input","link","menuitem","meta","ol","param","select","table","tbody","tfoot","thead","tr","ul","wbr"],a={"accept-charset":"acceptCharset",acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",classid:"classID",classname:"className",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",controlslist:"controlsList",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",datetime:"dateTime",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",enctype:"encType",for:"htmlFor",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",innerhtml:"innerHTML",inputmode:"inputMode",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",marginwidth:"marginWidth",marginheight:"marginHeight",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",
24nomodule:"noModule",novalidate:"noValidate",playsinline:"playsInline",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",typemustmatch:"typeMustMatch",usemap:"useMap",accentheight:"accentHeight","accent-height":"accentHeight",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",arabicform:"arabicForm","arabic-form":"arabicForm",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",diffuseconstant:"diffuseConstant",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",edgemode:"edgeMode",enablebackground:"enableBackground","enable-background":"enableBackground",externalresourcesrequired:"externalResourcesRequired",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",imagerendering:"imageRendering","image-rendering":"imageRendering",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicodebidi:"unicodeBidi","unicode
24-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",vmathematical:"vMathematical","v-mathematical":"vMathematical",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan",onblur:"onBlur",onchange:"onChange",onclick:"onClick",oncontextmenu:"onContextMenu",ondoubleclick:"onDoubleClick",ondrag:"onDrag",ondragend:"onDragEnd",ondragenter:"onDragEnter",ondragexit:"onDragExit",ondragleave:"onDragLeave",ondragover:"onDragOver",ondragstart:"onDragStart",ondrop:"onDrop",onerror:"onError",onfocus:"onFocus",oninput:"onInput",oninvalid:"onInvalid",onkeydown:"onKeyDown",onkeypress:"onKeyPress",onkeyup:"onKeyUp",onload:"onLoad",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onscroll:"onScroll",onsubmit:"onSubmit",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"},c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},l=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function d(e,t){if(void 0===t&&(t={}),!e||!(e instanceof Node))return null;var r,n,h,p,f,g=t.actions,m=void 0===g?[]:g,y=t.index,b=t.level,w=void 0===b?0:b,v=t.randomKey,C=e,E="".concat(w,"-").concat(void 0===y?0:y),x=[];if(v&&0===w&&(E="".concat(function(e){void 0===e&&(e=6);for(var t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=e;n>0;--n)r+=t[Math.round(Math.random()*(t.length-1))];return r}(),"-").concat(E)),Array.isArray(m)&&m.forEach(function(t){t.condition(C,E,w)&&("function"!=typeof t.pre||(C=t.pre(C,E,w))instanceof Node||(C=e),"function"==typeof t.post&&x.push(t.post(C,E,w)))}),x.length)return x;switch(C.nodeType){case 1:return i.createElement((r=C.nodeName,/[a-z]+[A-Z]+[a-z]+/.test(r)?r:r.toLowerCase()),function(e,t){var r={key:t};if(e instanceof Element){var n=e.getAttribute("class");n&&(r.className=n),u([],l(e.attributes),!1).forEach(function(e){switch(e.name){case"class":break;case"style":r[e.name]=e.value.split(/ ?; ?/).reduce(function(e,t){var r=o(t.split(/ ?: ?/),2),n=r[0],i=r[1];return n&&i&&(e[n.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})]=Number.isNaN(Number(i))?i:Number(i)),e},{});break;case"allowfullscreen":case"allowpaymentrequest":case"async":case"autofocus":case"auto
24play":case"checked":case"controls":case"default":case"defer":case"disabled":case"formnovalidate":case"hidden":case"ismap":case"itemscope":case"loop":case"multiple":case"muted":case"nomodule":case"novalidate":case"open":case"readonly":case"required":case"reversed":case"selected":case"typemustmatch":r[a[e.name]||e.name]=!0;break;default:r[a[e.name]||e.name]=e.value}})}return r}(C,E),(n=C.childNodes,h=t,(p=u([],l(n),!1).map(function(e,t){return d(e,c(c({},h),{index:t,level:w+1}))}).filter(Boolean)).length?p:null));case 3:var A=(null===(f=C.nodeValue)||void 0===f?void 0:f.toString())||"";if(/^\s+$/.test(A)&&!/[\u00A0\u202F]/.test(A))return null;if(!C.parentNode)return A;var S=C.parentNode.nodeName.toLowerCase();if(s.includes(S))return/\S/.test(A)&&console.warn("A textNode is not allowed inside '".concat(S,"'. Your text \"").concat(A,'" will be ignored')),null;return A;default:return null}}function h(e,t){return(void 0===t&&(t={}),"string"==typeof e)?function(e,t){if(void 0===t&&(t={}),!e||"string"!=typeof e)return null;var r=t.nodeOnly,n=t.selector,i=t.type;try{var o=new DOMParser().parseFromString(e,void 0===i?"text/html":i).querySelector(void 0===n?"body > *":n);if(!(o instanceof Node))throw TypeError("Error parsing input");if(void 0!==r&&r)return o;return d(o,t)}catch(e){}return null}(e,t):e instanceof Node?d(e,t):null}var p=r(65936),f={IDLE:"idle",LOADING:"loading",LOADED:"loaded",FAILED:"failed",READY:"ready",UNSUPPORTED:"unsupported"};function g(){return p.canUseDOM}var m=(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),y=function(){return(y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},b=function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},w=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},v=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},C=Object.create(null),E=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"hash",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"isActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(r,"isInitialized",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(r,"handleError",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=r.props.onError,n="Browser does not support SVG"===e.message?f.UNSUPPORTED:f.FAILED;r.isActive&&r.setState({status:n},function(){"function"==typeof t&&t(e)})}}),Object.defineProperty(r,"handleLoad",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1),r.isActive&&r.setState({content:e,hasCache:t,status:f.LOADED},r.getElement)}}),Object.defineProperty(r,"request",{enumerable:!0,configurable:!0,writable:!0,value:function(){var e,t,n;return e=void 0,t=void 0,n=function(){var e,t,r,n,i,o,s,a,c,l;return b(this,function(u){switch(u.label){case 0:t=(e=this.props).cacheRequests,r=e.fetchOptions,n=e.src,t&&(C[n]={content:"",status:f.LOADING}),u.label=1;case 1:return u.trys.push([1,4,,5]),[4,fetch(n,r)];case 2:if(o=w(((i=u.sent()).headers.get("content-type")||"").split(/ ?; ?/),1)[0],i.status>299)throw Error("Not found");if(!["image/svg+xml","text/plain"].some(function(e){return o.includes(e)}))throw Error("Content type isn't valid: ".concat(o));return[4,i.text()];case 3:if(s=u.sent(),a=this.props.src,n!==a)return C[n].status===f.LOADING&&delete C[n],[2];return this.handleLoad(s),t&&(c=C[n])&&(c.content=s,c.status=f.LOADED),[3,5];case 4:return l=u.sent(),this.handleError(l),t&&(c=C[n])&&delete C[n],[3,5];case 5:return[2]}})},new(t||(t=Promise))(function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var r;e.done?i(e.value):((r=e.value)instanceof t?r:new t(function(e){e(r)})).then(s,a)}c((n=n.apply(r,e||[])).next())})}}),r.state={content:"",element:null,hasCache:!!t.cacheRequests&&!!C[t.src],status:f.IDLE},r.hash=t.uniqueHash||function(e){for(var t="abcdefghijklmnopqrstuvwxyz",r="".concat(t).concat(t.toUpperCase()).concat("1234567890"),n="",i=0;i<8;i++)n+=r[Math.floor(Math.random()*r.length)];return n}(0),r}return m(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,
24configurable:!0,writable:!0,value:function(){if(this.isActive=!0,g()&&!this.isInitialized){var e=this.state.status,t=this.props.src;try{if(e===f.IDLE){if(!(function(){if(!document)return!1;var e=document.createElement("div");e.innerHTML="<svg />";var t=e.firstChild;return!!t&&"http://www.w3.org/2000/svg"===t.namespaceURI}()&&"undefined"!=typeof window&&null!==window))throw Error("Browser does not support SVG");if(!t)throw Error("Missing src");this.load()}}catch(e){this.handleError(e)}this.isInitialized=!0}}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(g()){var r=this.state,n=r.hasCache,i=r.status,o=this.props,s=o.onLoad,a=o.src;if(t.status!==f.READY&&i===f.READY&&s&&s(a,n),e.src!==a){if(!a){this.handleError(Error("Missing src"));return}this.load()}}}}),Object.defineProperty(t.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isActive=!1}}),Object.defineProperty(t.prototype,"getElement",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getNode(),t=h(e);if(!t||!i.isValidElement(t))throw Error("Could not convert the src to a React element");this.setState({element:t,status:f.READY})}catch(e){this.handleError(Error(e.message))}}}),Object.defineProperty(t.prototype,"getNode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.description,r=e.title;try{var n=this.processSVG(),i=h(n,{nodeOnly:!0});if(!i||!(i instanceof SVGSVGElement))throw Error("Could not convert the src to a DOM Node");var o=this.updateSVGAttributes(i);if(t){var s=o.querySelector("desc");s&&s.parentNode&&s.parentNode.removeChild(s);var a=document.createElementNS("http://www.w3.org/2000/svg","desc");a.innerHTML=t,o.prepend(a)}if(void 0!==r){var c=o.querySelector("title");if(c&&c.parentNode&&c.parentNode.removeChild(c),r){var l=document.createElementNS("http://www.w3.org/2000/svg","title");l.innerHTML=r,o.prepend(l)}}return o}catch(e){return this.handleError(e)}}}),Object.defineProperty(t.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.isActive&&this.setState({content:"",element:null,hasCache:!1,status:f.LOADING},function(){var t,r=e.props,n=r.cacheRequests,i=r.src,o=n&&C[i];if(o&&o.status===f.LOADED){e.handleLoad(o.content,!0);return}var s=i.match(/^data:image\/svg[^,]*?(;base64)?,(.*)/u);if(s?t=s[1]?window.atob(s[2]):decodeURIComponent(s[2]):i.includes("<svg")&&(t=i),t){e.handleLoad(t);return}e.request()})}}),Object.defineProperty(t.prototype,"processSVG",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state.content,t=this.props.preProcessor;return t?t(e):e}}),Object.defineProperty(t.prototype,"updateSVGAttributes",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this.props,n=r.baseURL,i=void 0===n?"":n,o=r.uniquifyIDs,s=["id","href","xlink:href","xlink:role","xlink:arcrole"],a=["href","xlink:href"];return o&&v([],w(e.children),!1).forEach(function(e){if(e.attributes&&e.attributes.length){var r=Object.values(e.attributes).map(function(e){var r=e.value.match(/url\((.*?)\)/);return r&&r[1]&&(e.value=e.value.replace(r[0],"url(".concat(i).concat(r[1],"__").concat(t.hash,")"))),e});s.forEach(function(e){var n,i=r.find(function(t){return t.name===e});i&&(n=i.value,!a.includes(e)||!n||n.includes("#"))&&(i.value="".concat(i.value,"__").concat(t.hash))})}return e.children.length?t.updateSVGAttributes(e):e}),e}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state,t=e.element,r=e.status,n=this.props,o=n.children,s=n.innerRef,a=n.loader,c=void 0===a?null:a,l=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n={};for(var i in e)({}).hasOwnProperty.call(e,i)&&!t.includes(i)&&(n[i]=e[i]);return n}(this.props,"baseURL","cacheRequests","children","description","fetchOptions","innerRef","loader","onError","onLoad","preProcessor","src","title","uniqueHash","uniquifyIDs");return g()?t?i.cloneElement(t,y({ref:s},l)):[f.UNSUPPORTED,f.FAILED].includes(r)?void 0===o?null:o:c:c}}),Object.defineProperty(t,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{cacheRequests:!0,uniquifyIDs:!1}}),t}(i.PureComponent)},60198:function(e,t){"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,f=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,v=r?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case d:case o:case a:case s:case p:return e;default:switch(e=e&&e.$$typeof){case l:case h:case m:case g:case c:return e;default:return t}}case i:return t}}}function E(e){return C(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=c,t.Element=n,t.ForwardRef=h,t.Fragment=o,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||C(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return C(e)===l},t.isContextProvider=function(e){return C(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return C(e)===h},t.isFragment=function(e){return C(e)===o},t.isLazy=function(e){return C(e)===m},t.isMemo=function(e){return C(e)===g},t.isPortal=function(e){return C(e)===i},t.isProfiler=function(e){return C(e)===a},t.isStrictMode=function(e){return C(e)===s},t.isSuspense=function(e){return C(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===a||e===s||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===c||e.$$typeof===l||e.$$typeof===h||e.$$typeof===b||e.$$typeof===w||e.$$typeof===v||e.$$typeof===y)},t.typeOf=C},56237:function(e,t,r){"use strict";e.exports=r(60198)},65949:function(e,t,r){"use strict";r.r(t),r.d(t,{__assign:function(){return o},__asyncDelegator:function(){return v},__asyncGenerator:function(){return w},__asyncValues:function(){return C},__await:function(){return b},__awaiter:function(){return u},__classPrivateFieldGet:function(){return S},__classPrivateFieldSet:function(){return _},__createBinding:function(){return h},__decorate:function(){return a},__exportStar:function(){return p},__extends:function(){return i},__generator:function(){return d},__importDefault:function(){return A},__importStar:function(){return x}
vendor: 5,306 bytes, line 24
24,__makeTemplateObject:function(){return E},__metadata:function(){return l},__param:function(){return c},__read:function(){return g},__rest:function(){return s},__spread:function(){return m},__spreadArrays:function(){return y},__values:function(){return f}});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})}function d(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function h(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function p(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function w(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){o.push([e,t,r,n])>1||a(e,t)})})}function a(e,t){try{var r;(r=i[e](t)).value instanceof b?Promise.resolve(r.value.v).then(c,l):u(o[0][2],r)}catch(e){u(o[0][3],e)}}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function v(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function C(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=f(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
24function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function S(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function _(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},21409:function(e,t,r){"use strict";var n=r(50959),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,s=n.useEffect,a=n.useLayoutEffect,c=n.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=o({inst:{value:r,getSnapshot:t}}),i=n[0].inst,u=n[1];return a(function(){i.value=r,i.getSnapshot=t,l(i)&&u({inst:i})},[e,r,t]),s(function(){return l(i)&&u({inst:i}),e(function(){l(i)&&u({inst:i})})},[e]),c(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},53107:function(e,t,r){"use strict";var n=r(50959),i=r(76223),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,a=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;var p=s(e,(d=l(function(){function e(e){if(!c){if(c=!0,s=e,e=n(e),void 0!==i&&h.hasValue){var t=h.value;if(i(t,e))return a=t}return a=e}if(t=a,o(s,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(s=e,t):(s=e,a=r)}var s,a,c=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,i]))[0],d[1]);return c(function(){h.hasValue=!0,h.value=p},[p]),u(p),p}},76223:function(e,t,r){"use strict";e.exports=r(21409)},38361:function(e,t,r){"use strict";e.exports=r(53107)},89626:function(e){e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},75e3:function(e){"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},93149:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=s(e,o.call(this,r)))}return e}function o(e){if("string"==typeof e||"number"==typeof e)return this&&this[e]||e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(this,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=s(t,this&&this[r]||r));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0!==(r=(function(){return i}).apply(t,[]))&&(e.exports=r)}()},82187:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=o(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=o(t,r));return t}(r)))}return e}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0!==(r=(function(){return i}).apply(t,[]))&&(e.exports=r)}()},86984:function(e,t,r){"use strict";let n=r(57828);e.exports=o;let i=function(){function e(e){return void 0!==e&&e}try{if("undefined"!=typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function o(e){var t,r;(e=e||{}).browser=e.browser||{};let n=e.browser.transmit;if(n&&"function"!=typeof n.send)throw Error("pino: transmit option must have a send function");let u=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let d=e.serializers||{},g=Array.isArray(t=e.browser.serialize)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(d),m=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(m=!1),"function"==typeof u&&(u.error=u.fatal=u.warn=u.info=u.debug=u.trace=u),!1===e.enabled&&(e.level="silent");let y=e.level||"info",b=Object.create(u);b.log||(b.log=h),Object.defineProperty(b,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(b,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,s(w,b,"error","log"),s(w,b,"fatal","error"),s(w,b,"warn","error"),s(w,b,"info","log"),s(w,b,"debug","log"),s(w,b,"trace","log")}});let w={transmit:n,serialize:g,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?p:f};return b.levels=o.levels,b.level=y,b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prepe
24ndOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=h,b.serializers=d,b._serialize=g,b._stdErrSerialize=m,b.child=function(t,r){if(!t)throw Error("missing bindings for child Pino");r=r||{},g&&t.serializers&&(r.serializers=t.serializers);let i=r.serializers;if(g&&i){var o=Object.assign({},d,i),s=!0===e.browser.serialize?Object.keys(o):g;delete t.serializers,a([t],s,o,this._stdErrSerialize)}function u(e){this._childLevel=(0|e._childLevel)+1,this.error=c(e,t,"error"),this.fatal=c(e,t,"fatal"),this.warn=c(e,t,"warn"),this.info=c(e,t,"info"),this.debug=c(e,t,"debug"),this.trace=c(e,t,"trace"),o&&(this.serializers=o,this._serialize=s),n&&(this._logEvent=l([].concat(e._logEvent.bindings,t)))}return u.prototype=this,new u(this)},n&&(b._logEvent=l()),b}function s(e,t,r,s){let c=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?h:c[r]?c[r]:i[r]||i[s]||h,function(e,t,r){if(e.transmit||t[r]!==h){var s;t[r]=(s=t[r],function(){let c=e.timestamp(),u=Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var h=0;h<u.length;h++)u[h]=arguments[h];if(e.serialize&&!e.asObject&&a(u,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?s.call(d,function(e,t,r,i){e._serialize&&a(r,e._serialize,e.serializers,e._stdErrSerialize);let s=r.slice(),c=s[0],l={};i&&(l.time=i),l.level=o.levels.values[t];let u=(0|e._childLevel)+1;if(u<1&&(u=1),null!==c&&"object"==typeof c){for(;u--&&"object"==typeof s[0];)Object.assign(l,s.shift());c=s.length?n(s.shift(),s):void 0}else"string"==typeof c&&(c=n(s.shift(),s));return void 0!==c&&(l.msg=c),l}(this,r,u,c)):s.apply(d,u),e.transmit){let n=e.transmit.level||t.level,i=o.levels.values[n],s=o.levels.values[r];if(s<i)return;(function(e,t,r){let n=t.send,i=t.ts,o=t.methodLevel,s=t.methodValue,c=t.val,u=e._logEvent.bindings;a(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(e){return -1===u.indexOf(e)}),e._logEvent.level.label=o,e._logEvent.level.value=s,n(o,e._logEvent,c),e._logEvent=l(u)})(this,{ts:c,methodLevel:r,methodValue:s,transmitLevel:n,transmitValue:o.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},u)}})}}(e,t,r)}function a(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=o.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i]))for(let n in e[i])t&&t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function c(e,t,r){return function(){let n=Array(1+arguments.length);n[0]=t;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return e[r].apply(this,n)}}function l(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function u(){return{}}function d(e){return e}function h(){}function p(){return!1}function f(){return Date.now()}o.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},o.stdSerializers={mapHttpRequest:u,mapHttpResponse:u,wrapRequestSerializer:d,wrapResponseSerializer:d,wrapErrorSerializer:d,req:u,res:u,err:function(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}},o.stdTimeFunctions=Object.assign({},{nullTime:p,epochTime:f,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}})},67297:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,{Z:function(){return n}})},64881:function(e,t,r){"use strict";function n(e){if(Array.isArray(e))return e}r.d(t,{Z:function(){return n}})},42326:function(e,t,r){"use strict";function n(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},76132:function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}r.d(t,{Z:function(){return n}})},99190:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(67131);function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];
24i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,n.Z)(i.key),i)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}},59125:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(67131);function i(e,t,r){return(t=(0,n.Z)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},4529:function(e,t,r){"use strict";function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}r.d(t,{Z:function(){return n}})},35922:function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,{Z:function(){return n}})},61912:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(35329);function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,n.Z)(e,t)}},54578:function(e,t,r){"use strict";function n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}r.d(t,{Z:function(){return n}})},76159:function(e,t,r){"use strict";function n(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(t,{Z:function(){return n}})},41766:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(20555);function i(e,t){if(null==e)return{};var r,i,o=(0,n.Z)(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}},20555:function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}r.d(t,{Z:function(){return n}})},93460:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(41392),i=r(42326);function o(e,t){if(t&&("object"==(0,n.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}},35329:function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,{Z:function(){return n}})},48798:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(64881),i=r(23317),o=r(76159);function s(e,t){return(0,n.Z)(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(e,t)||(0,i.Z)(e,t)||(0,o.Z)()}},65573:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(64881),i=r(54578),o=r(23317),s=r(76159);function a(e){return(0,n.Z)(e)||(0,i.Z)(e)||(0,o.Z)(e)||(0,s.Z)()}},47844:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(67297),i=r(54578),o=r(23317);function s(e){return function(e){if(Array.isArray(e))return(0,n.Z)(e)}(e)||(0,i.Z)(e)||(0,o.Z)(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},67131:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(41392);function i(e){var t=function(e,t){if("object"!=(0,n.Z)(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=(0,n.Z)(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,n.Z)(t)?t:t+""}},41392:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r.d(t,{Z:function(){return n}})},23317:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(67297);function i(e,t){if(e){if("string"==typeof e)return(0,n.Z)(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,n.Z)(e,t):void 0}}},34647:function(e,t,r){"use strict";r.d(t,{C:function(){return s}});var n=r(2377);let i={attribute:!0,type:String,converter:n.Ts,reflect:!1,hasChanged:n.Qu},o=(e=i,t,r)=>{let{kind:n,metadata:o}=r,s=globalThis.litPropertyMetadata.get(o);if(void 0===s&&globalThis.litPropertyMetadata.set(o,s=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),s.set(r.name,e),"accessor"===n){let{name:n}=r;return{set(r){let i=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,i,e)},init(t){return void 0!==t&&this.C(n,void 0,e,t),t}}}if("setter"===n){let{name:n}=r;return function(r){let i=this[n];t.call(this,r),this.requestUpdate(n,i,e)}}throw Error("Unsupported decorator location: "+n)};function s(e){return(t,r)=>"object"==typeof r?o(e,t,r):((e,t,r)=>{let n=t.hasOwnProperty(r);return t.constructor.createProperty(r,e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}},31382:function(e,t,r){"use strict";r.d(t,{S:function(){return i}});var n=r(34647);function i(e){return(0,n.C)({...e,state:!0,attribute:!1})}},2377:function(e,t,r){"use strict";r.d(t,{fl:function(){return _},iv:function(){return l},Ts:function(){return x},Qu:function(){return A},$m:function(){return c}});let n=globalThis,i=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;class a{constructor(e,t,r){if(this._$cssResult$=!0,r!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(i&&void 0===e){let r=void 0!==t&&1===t.length;r&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&s.set(t,e))}return e}toString(){return this.cssText}}let c=e=>
24new a("string"==typeof e?e:e+"",void 0,o),l=(e,...t)=>new a(1===e.length?e[0]:t.reduce((t,r,n)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[n+1],e[0]),e,o),u=(e,t)=>{if(i)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let r of t){let t=document.createElement("style"),i=n.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=r.cssText,e.appendChild(t)}},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return c(t)})(e):e,{is:h,defineProperty:p,getOwnPropertyDescriptor:f,getOwnPropertyNames:g,getOwnPropertySymbols:m,getPrototypeOf:y}=Object,b=globalThis,w=b.trustedTypes,v=w?w.emptyScript:"",C=b.reactiveElementPolyfillSupport,E=(e,t)=>e,x={toAttribute(e,t){switch(t){case Boolean:e=e?v:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},A=(e,t)=>!h(e,t),S={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:A};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;class _ extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=S){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&p(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:i}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,set(t){let o=n?.call(this);i?.call(this,t),this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??S}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;let e=y(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){let e=this.properties;for(let t of[...g(e),...m(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,r]of t)this.elementProperties.set(e,r)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let r of new Set(e.flat(1/0).reverse()))t.unshift(d(r));else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){let r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return u(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(void 0!==n&&!0===r.reflect){let i=(void 0!==r.converter?.toAttribute?r.converter:x).toAttribute(t,r.type);this._$Em=e,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(void 0!==n&&this._$Em!==n){let e=r.getPropertyOptions(n),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:x;this._$Em=n;let o=i.fromAttribute(t,e.type);this[n]=o??this._$Ej?.get(n)??o,this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){let n=this.constructor,i=this[e];if(!(((r??=n.getPropertyOptions(e)).hasChanged??A)(i,t)||r.useDefault&&r.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:i},o){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==i||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===n&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,r]of e){let{wrapped:e}=r,n=this[t];
24!0!==e||this._$AL.has(t)||void 0===n||this.C(t,void 0,r,n)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[E("elementProperties")]=new Map,_[E("finalized")]=new Map,C?.({ReactiveElement:_}),(b.reactiveElementVersions??=[]).push("2.1.1")},53307:function(e,t,r){"use strict";r.d(t,{secp256k1:function(){return ex}});var n=r(32153),i=r(21645),o=r(61851);let s=BigInt(0),a=BigInt(1);function c(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function l(e){if(!c(e))throw Error("Uint8Array expected")}function u(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function d(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function h(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?s:BigInt("0x"+e)}let p="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,f=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function g(e){if(l(e),p)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=f[e[r]];return t}let m={_0:48,_9:57,A:65,F:70,a:97,f:102};function y(e){return e>=m._0&&e<=m._9?e-m._0:e>=m.A&&e<=m.F?e-(m.A-10):e>=m.a&&e<=m.f?e-(m.a-10):void 0}function b(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(p)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=y(e.charCodeAt(i)),o=y(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function w(e){return h(g(e))}function v(e){return l(e),h(g(Uint8Array.from(e).reverse()))}function C(e,t){return b(e.toString(16).padStart(2*t,"0"))}function E(e,t){return C(e,t).reverse()}function x(e,t,r){let n;if("string"==typeof t)try{n=b(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(c(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function A(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];l(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let S=e=>"bigint"==typeof e&&s<=e;function _(e,t,r){return S(e)&&S(t)&&S(r)&&t<=e&&e<r}function I(e,t,r,n){if(!_(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}let k=e=>(a<<BigInt(e))-a,O=e=>new Uint8Array(e),N=e=>Uint8Array.from(e),P={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||c(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function T(e,t,r={}){let n=(t,r,n)=>{let i=P[r];if("function"!=typeof i)throw Error("invalid validator function");let o=e[t];if((!n||void 0!==o)&&!i(o,e))throw Error("param "+String(t)+" is invalid. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function R(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let o=e(r,...n);return t.set(r,o),o}}let $=BigInt(0),D=BigInt(1),L=BigInt(2),M=BigInt(3),U=BigInt(4),j=BigInt(5),B=BigInt(8);function F(e,t){let r=e%t;return r>=$?r:t+r}function z(e,t,r){let n=e;for(;t-- >$;)n*=n,n%=r;return n}function H(e,t){if(e===$)throw Error("invert: expected non-zero number");if(t<=$)throw Error("invert: expected positive modulus, got "+t);let r=F(e,t),n=t,i=$,o=D,s=D,a=$;for(;r!==$;){let e=n/r,t=n%r,c=i-s*e,l=o-a*e;n=r,r=t,i=s,o=a,s=c,a=l}if(n!==D)throw Error("invert: does not exist");return F(i,t)}function W(e,t){let r=(e.ORDER+D)/U,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function q(e,t){let r=(e.ORDER-j)/B,n=e.mul(t,L),i=e.pow(n,r),o=e.mul(t,i),s=e.mul(e.mul(o,L),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),t))throw Error("Cannot find square root");return a}let V=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function K(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),o=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),o),n}function G(e,t){let r=(e.ORDER-D)/L,n=e.pow(t,r),i=e.eql(n,e.ONE),o=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!i&&!o&&!s)throw Error("invalid Legendre symbol result");return i?1:o?0:-1}function Z(e,t){void 0!==t&&(0,o.k8)(t);let r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Y(e,t,r=!1,n={}){let i;if(e<=$)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=Z(e,t);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:k(o),ZERO:$,ONE:D,create:t=>F(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return $<=t&&t<e},is0:e=>e===$,isOdd:e=>(e&D)===D,neg:t=>F(-t,e),eql:(e,t)=>
vendor: 16,332 bytes, line 24
24e===t,sqr:t=>F(t*t,e),add:(t,r)=>F(t+r,e),sub:(t,r)=>F(t-r,e),mul:(t,r)=>F(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<$)throw Error("invalid exponent, negatives unsupported");if(r===$)return e.ONE;if(r===D)return t;let n=e.ONE,i=t;for(;r>$;)r&D&&(n=e.mul(n,i)),i=e.sqr(i),r>>=D;return n})(a,e,t),div:(t,r)=>F(t*H(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>H(t,e),sqrt:n.sqrt||(t=>(!i&&(i=e%U===M?W:e%B===j?q:function(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-D,r=0;for(;t%L===$;)t/=L,r++;let n=L,i=Y(e);for(;1===G(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return W;let o=i.pow(n,t),s=(t+D)/L;return function(e,n){if(e.is0(n))return n;if(1!==G(e,n))throw Error("Cannot find square root");let i=r,a=e.mul(e.ONE,o),c=e.pow(n,t),l=e.pow(n,s);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=D<<BigInt(i-t-1),o=e.pow(a,n);i=t,a=e.sqr(o),c=e.mul(c,a),l=e.mul(l,o)}return l}}(e)),i(a,t))),toBytes:e=>r?E(e,s):C(e,s),fromBytes:e=>{if(e.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?v(e):w(e)},invertBatch:e=>K(a,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(a)}function J(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function X(e){let t=J(e);return t+Math.ceil(t/2)}let Q=BigInt(0),ee=BigInt(1);function et(e,t){let r=t.negate();return e?r:t}function er(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function en(e,t){er(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:k(e),maxNumber:i,shiftBy:BigInt(e)}}function ei(e,t,r){let{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=r,a=Number(e&i),c=e>>s;a>n&&(a-=o,c+=ee);let l=t*n,u=l+Math.abs(a)-1;return{nextN:c,offset:u,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:l}}let eo=new WeakMap,es=new WeakMap;function ea(e){return es.get(e)||1}function ec(e){return T(e.Fp,V.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),T(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Z(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function el(e){void 0!==e.lowS&&u("lowS",e.lowS),void 0!==e.prehash&&u("prehash",e.prehash)}class eu extends Error{constructor(e=""){super(e)}}let ed={Err:eu,_tlv:{encode:(e,t)=>{let{Err:r}=ed;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=d(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?d(i.length/2|128):"";return d(e)+o+i+t},decode(e,t){let{Err:r}=ed,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],o=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)o=o<<8|e;if(n+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let s=t.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+o)}}},_int:{encode(e){let{Err:t}=ed;if(e<eh)throw new t("integer: negative integers are not allowed");let r=d(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=ed;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return w(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=ed,i=x("signature",e),{v:o,l:s}=n.decode(48,i);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,o),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=ed,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}},eh=BigInt(0),ep=BigInt(1),ef=(BigInt(2),BigInt(3)),eg=BigInt(4),em=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ey=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),eb=BigInt(0),ew=BigInt(1),ev=BigInt(2),eC=(e,t)=>(e+t/ev)/t,eE=Y(em,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),a=BigInt(88),c=e*e*e%em,l=c*c*e%em,u=z(l,t,em)*l%em,d=z(u,t,em)*l%em,h=z(d,ev,em)*c%em,p=z(h,n,em)*h%em,f=z(p,i,em)*p%em,g=z(f,s,em)*f%em,m=z(g,a,em)*g%em,y=z(m,s,em)*f%em,b=z(y,t,em)*l%em,w=z(b,o,em)*p%em,v=z(w,r,em)*c%em,C=z(v,ev,em);if(!eE.eql(eE.sqr(C),e))throw Error("Cannot find square root");return C}}),ex=function(e,t){let r=t=>(function(e){let t=function(e){let t=ec(e);return T(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n,nByteLength:i,nBitLength:o}=t,l=r.BYTES+1,d=2*r.BYTES+1;function h(e){return F(e,n)}let{ProjectivePoint:p,normPrivateKeyToScalar:f,weierstrassEquation:m,isWithinCurveOrder:y}=function(e){var t;let r=function(e){let t=ec(e);T(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=r,i=Y(r.n,r.nBitLength),o=r.toBytes||((e,t,r)=>{let i=t.toAffine();return A(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),l=r.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function d(e){let{a:t,b:i}=r,o=n.sqr(e),s=n.mul(o,e);return n.add(n.add(s,n.mul(e,t)),i)}function h(e,t){let r=n.sqr(t),i=d(e);return n.eql(r,i)}if(!h(r.Gx,r.Gy))throw Error("bad curve params: generator point");let p=n.mul(n.pow(r.a,ef),eg),f=n.mul(n.sqr(r.b),BigInt(27));if(n.is0(n.add(p,f)))throw Error("bad curve params: a or b");function m(e){let t;let{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:o,n:s}=r;if(n&&"bigint"!=typeof e){if(c(e)&&(e=g(e)),"string"!=typeof e||!n.includes(e.length))throw Error("invalid private key");e=e.padStart(2*i,"0")}try{t="bigint"==typeof e?e:w(x("private key",e,i))}catch(t){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof e)}return o&&(t=F(t,s)),I("private key",t,ep,s),t}function y(e){if(!(e instanceof C))throw Error("ProjectivePoint expected")}let b=R((e,t)=>{let{px:r,py:i,pz:o}=e;if(n.eql(o,n.ONE))return{x:r,y:i};let s=e.is0();null==t&&(t=s?n.ONE:n.inv(o));let a=n.mul(r,t),c=n.mul(i,t),l=n.mul(o,t);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(l,n.ONE))throw Error("invZ was invalid");return{x:a,y:c}}),v=R(e=>{if(e.is0()){if(r.allowInfinityPoint&&!n.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:i}=e.toAffine();if(!n.isValid(t)||!n.isValid(i))throw Error("bad point: x or y not FE");if(!h(t,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class C{constructor(e,t,r){if(null==e||!n.isValid(e))throw Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw Error("y required");if(null==r||!n.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error("invalid affine point");if(e instanceof C)throw Error("projective point not allowed");let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?C.ZERO:new C(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=K(n,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(C.fromAffine)}static fromHex(e){let t=C.fromAffine(l(x("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return C.BASE.multiply(m(e))}static msm(e,t){return function(e,t,r,n){!function(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})}(r,e),function(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}(n,t);let i=r.length,o=n.length;if(i!==o)throw Error("arrays of points and scalars must have equal length");let c=e.ZERO,l=function(e){let t;for(t=0;e>s;e>>=a,t+=1);return t}(BigInt(i)),u=1;l>12?u=l-3:l>4?u=l-2:l>0&&(u=2);let d=k(u),h=Array(Number(d)+1).fill(c),p=Math.floor((t.BITS-1)/u)*u,f=c;for(let e=p;e>=0;e-=u){h.fill(c);for(let t=0;t<o;t++){let i=Number(n[t]>>BigInt(e)&d);h[i]=h[i].add(r[t])}let t=c;for(let e=h.length-1,r=c;e>0;e--)r=r.add(h[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<u;e++)f=f.double()}return f}(C,i,e,t)}_setWindowSize(e){O.setWindowSize(this,e)}assertValidity(){v(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){y(e);let{px:t,py:r,pz:i}=this,{px:o,py:s,pz:a}=e,c=n.eql(n.mul(t,a),n.mul(o,i)),l=n.eql(n.mul(r,a),n.mul(s,i));return c&&l}negate(){return new C(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,i=n.mul(t,ef),{px:o,py:s,pz:a}=this,c=n.ZERO,l=n.ZERO,u=n.ZERO,d=n.mul(o,o),h=n.mul(s,s),p=n.mul(a,a),f=n.mul(o,s);return f=n.add(f,f),u=n.mul(o,a),u=n.add(u,u),c=n.mul(e,u),l=n.mul(i,p),l=n.add(c,l),c=n.sub(h,l),l=n.add(h,l),l=n.mul(c,l),c=n.mul(f,c),u=n.mul(i,u),p=n.mul(e,p),f=n.sub(d,p),f=n.mul(e,f),f=n.add(f,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,p),d=n.mul(d,f),l=n.add(l,d),p=n.mul(s,a),p=n.add(p,p),d=n.mul(p,f),c=n.sub(c,d),u=n.mul(p,h),u=n.add(u,u),new C(c,l,u=n.add(u,u))}add(e){y(e);let{px:t,py:i,pz:o}=this,{px:s,py:a,pz:c}=e,l=n.ZERO,u=n.ZERO,d=n.ZERO,h=r.a,p=n.mul(r.b,ef),f=n.mul(t,s),g=n.mul(i,a),m=n.mul(o,c),b=n.add(t,i),w=n.add(s,a);b=n.mul(b,w),w=n.add(f,g),b=n.sub(b,w),w=n.add(t,o);let v=n.add(s,c);return w=n.mul(w,v),v=n.add(f,m),w=n.sub(w,v),v=n.add(i,o),l=n.add(a,c),v=n.mul(v,l),l=n.add(g,m),v=n.sub(v,l),d=n.mul(h,w),l=n.mul(p,m),d=n.add(l,d),l=n.sub(g,d),d=n.add(g,d),u=n.mul(l,d),g=n.add(f,f),g=n.add(g,f),m=n.mul(h,m),w=n.mul(p,w),g=n.add(g,m),m=n.sub(f,m),m=n.mul(h,m),w=n.add(w,m),f=n.mul(g,w),u=n.add(u,f),f=n.mul(v,w),l=n.mul(b,l),l=n.sub(l,f),f=n.mul(b,g),d=n.mul(v,d),new C(l,u,d=n.add(d,f))}subtract(e){return this.add(e.negate())}is0(){return this.equals(C.ZERO)}wNAF(e){return O.wNAFCached(this,e,C.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:i}=r;I("scalar",e,eh,i);let o=C.ZERO;if(e===eh)return o;if(this.is0()||e===ep)return this;if(!t||O.hasPrecomputes(this))return O.wNAFCachedUnsafe(this,e,C.normalizeZ);let{k1neg:s,k1:a,k2neg:c,k2:l}=t.splitScalar(e),u=o,d=o,h=this;for(;a>eh||l>eh;)a&ep&&(u=u.add(h)),l&ep&&(d=d.add(h)),h=h.double(),a>>=ep,l>>=ep;return s&&(u=u.negate()),c&&(d=d.negate()),d=new C(n.mul(d.px,t.beta),d.py,d.pz),u.add(d)}multiply(e){let t,i;let{endo:o,n:s}=r;if(I("scalar",e,ep,s),o){let{k1neg:r,k1:s,k2neg:a,k2:c}=o.splitScalar(e),{p:l,f:u}=this.wNAF(s),{p:d,f:h}=this.wNAF(c);l=O.constTimeNegate(r,l),d=O.constTimeNegate(a,d),d=new C(n.mul(d.px,o.beta),d.py,d.pz),t=l.add(d),i=u.add(h)}else{let{p:r,f:n}=this.wNAF(e);t=r,i=n}return C.normalizeZ([t,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=C.BASE,i=(e,t)=>t!==eh&&t!==ep&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){return b(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===ep)return!0;if(t)return t(C,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===ep?this:t?t(C,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return u("isCompressed",e),this.assertValidity(),o(C,this,e)}toHex(e=!0){return u("isCompressed",e),g(this.toRawBytes(e))}}C.BASE=new C(r.Gx,r.Gy,n.ONE),C.ZERO=new C(n.ZERO,n.ONE,n.ZERO);let{endo:E,nBitLength:S}=r,O=(t=E?Math.ceil(S/2):S,{constTimeNegate:et,hasPrecomputes:e=>1!==ea(e),unsafeLadder(e,t,r=C.ZERO){let n=e;for(;t>Q;)t&ee&&(r=r.add(n)),n=n.double(),t>>=ee;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=en(r,t),o=[],s=e,a=s;for(let e=0;e<n;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,r,n){let i=C.ZERO,o=C.BASE,s=en(e,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:a,isZero:c,isNeg:l,isNegF:u,offsetF:d}=ei(n,e,s);n=t,c?o=o.add(et(u,r[d])):i=i.add(et(l,r[a]))}return{p:i,f:o}},wNAFUnsafe(e,r,n,i=C.ZERO){let o=en(e,t);for(let e=0;e<o.windows&&n!==Q;e++){let{nextN:t,offset:s,isZero:a,isNeg:c}=ei(n,e,o);if(n=t,!a){let e=r[s];i=i.add(c?e.negate():e)}}return i},getPrecomputes(e,t,r){let n=eo.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&eo.set(t,r(n))),n},wNAFCached(e,t,r){let n=ea(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=ea(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){er(r,t),es.set(e,r),eo.delete(e)}});return{CURVE:r,ProjectivePoint:C,normPrivateKeyToScalar:m,weierstrassEquation:d,isWithinCurveOrder:function(e){return _(e,ep,r.n)}}}({...t,toBytes(e,t,n){let i=t.toAffine(),o=r.toBytes(i.x);return(u("isCompressed",n),n)?A(Uint8Array.from([t.hasEvenY()?2:3]),o):A(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes(e){let t=e.length,n=e[0],i=e.subarray(1);if(t===l&&(2===n||3===n)){let e;let t=w(i);if(!_(t,ep,r.ORDER))throw Error("Point is not on curve");let o=m(t);try{e=r.sqrt(o)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&n)==1!=((e&ep)===ep)&&(e=r.neg(e)),{x:t,y:e}}if(t===d&&4===n)return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+l+", or uncompressed "+d+", got "+t)}}),S=(e,t,r)=>w(e.slice(t,r));class P{constructor(e,t,r){I("r",e,ep,n),I("s",t,ep,n),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){return new P(S(e=x("compactSignature",e,2*i),0,i),S(e,i,2*i))}static fromDER(e){let{r:t,s:r}=ed.toSig(x("DER",e));return new P(t,r)}assertValidity(){}addRecoveryBit(e){return new P(this.r,this.s,e)}recoverPublicKey(e){let{r:i,s:o,recovery:s}=this,a=M(x("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let c=2===s||3===s?i+t.n:i;if(c>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let l=(1&s)==0?"02":"03",u=p.fromHex(l+g(C(c,r.BYTES))),d=H(c,n),f=h(-a*d),m=h(o*d),y=p.BASE.multiplyAndAddUnsafe(u,f,m);if(!y)throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>n>>ep}normalizeS(){return this.hasHighS()?new P(this.r,h(-this.s),this.recovery):this}toDERRawBytes(){return b(this.toDERHex())}toDERHex(){return ed.hexFromSig(this)}toCompactRawBytes(){return b(this.toCompactHex())}toCompactHex(){return g(C(this.r,i))+g(C(this.s,i))}}function $(e){if("bigint"==typeof e)return!1;if(e instanceof p)return!0;let n=x("key",e).length,o=r.BYTES,s=o+1;if(!t.allowedPrivateKeyLengths&&i!==s)return n===s||n===2*o+1}let L=t.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=w(e),r=8*e.length-o;return r>0?t>>BigInt(r):t},M=t.bits2int_modN||function(e){return h(L(e))},U=k(o);function j(e){return I("num < 2^"+o,e,eh,U),C(e,i)}let B={lowS:t.lowS,prehash:!1},z={lowS:t.lowS,prehash:!1};return p.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return p.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(!0===$(e))throw Error("first arg must be private key");if(!1===$(t))throw Error("second arg must be public key");return p.fromHex(t).multiply(f(e)).toRawBytes(r)},sign:function(e,i,o=B){let{seed:s,k2sig:a}
24=function(e,i,o=B){if(["recovered","canonical"].some(e=>e in o))throw Error("sign() legacy options not supported");let{hash:s,randomBytes:a}=t,{lowS:c,prehash:l,extraEntropy:u}=o;null==c&&(c=!0),e=x("msgHash",e),el(o),l&&(e=x("prehashed msgHash",s(e)));let d=M(e),g=f(i),m=[j(g),j(d)];if(null!=u&&!1!==u){let e=!0===u?a(r.BYTES):u;m.push(x("extraEntropy",e))}return{seed:A(...m),k2sig:function(e){let t=L(e);if(!y(t))return;let r=H(t,n),i=p.BASE.multiply(t).toAffine(),o=h(i.x);if(o===eh)return;let s=h(r*h(d+o*g));if(s===eh)return;let a=(i.x===o?0:2)|Number(i.y&ep),l=s;if(c&&s>n>>ep)l=s>n>>ep?h(-s):s,a^=1;return new P(o,l,a)}}}(e,i,o);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=O(e),i=O(e),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=O(0))=>{i=a(N([0]),e),n=a(),0!==e.length&&(i=a(N([1]),e),n=a())},l=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=a()).slice();r.push(t),e+=n.length}return A(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(l()));)c();return s(),r}})(t.hash.outputLen,t.nByteLength,t.hmac)(s,a)},verify:function(e,r,i,o=z){let s,a;r=x("msgHash",r),i=x("publicKey",i);let{lowS:l,prehash:u,format:d}=o;if(el(o),"strict"in o)throw Error("options.strict was renamed to lowS");if(void 0!==d&&"compact"!==d&&"der"!==d)throw Error("format must be compact or der");let f="string"==typeof e||c(e),g=!f&&!d&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!f&&!g)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(g&&(a=new P(e.r,e.s)),f){try{"compact"!==d&&(a=P.fromDER(e))}catch(e){if(!(e instanceof ed.Err))throw e}a||"der"===d||(a=P.fromCompact(e))}s=p.fromHex(i)}catch(e){return!1}if(!a||l&&a.hasHighS())return!1;u&&(r=t.hash(r));let{r:m,s:y}=a,b=M(r),w=H(y,n),v=h(b*w),C=h(m*w),E=p.BASE.multiplyAndAddUnsafe(s,v,C)?.toAffine();return!!E&&h(E.x)===m},ProjectivePoint:p,Signature:P,utils:{isValidPrivateKey(e){try{return f(e),!0}catch(e){return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{let e=X(t.n);return function(e,t,r=!1){let n=e.length,i=J(t),o=X(t);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let s=F(r?v(e):w(e),t-D)+D;return r?E(s,i):C(s,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=p.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,hash:t,hmac:(e,...r)=>(0,i.b)(t,e,(0,o.eV)(...r)),randomBytes:o.O6});return{...r(t),create:r}}({a:eb,b:BigInt(7),Fp:eE,n:ey,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ew*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),o=eC(t*e,ey),s=eC(-r*e,ey),a=F(e-o*t-s*n,ey),c=F(-o*r-s*t,ey),l=a>i,u=c>i;if(l&&(a=ey-a),u&&(c=ey-c),a>i||c>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:l,k1:a,k2neg:u,k2:c}}}},n.JQ)},40999:function(e,t,r){"use strict";r.d(t,{$p:function(){return d},EP:function(){return h},FL:function(){return u},Fn:function(){return b},IH:function(){return m},Iq:function(){return a},NI:function(){return s},Ou:function(){return l},SD:function(){return f},Vl:function(){return o},Xb:function(){return w},ac:function(){return y},gm:function(){return p},m_:function(){return c},mk:function(){return g},pp:function(){return E},u8:function(){return v},zP:function(){return C}});let n=BigInt(4294967296-1),i=BigInt(32);function o(e,t=!1){let r=e.length,o=new Uint32Array(r),s=new Uint32Array(r);for(let a=0;a<r;a++){let{h:r,l:c}=function(e,t=!1){return t?{h:Number(e&n),l:Number(e>>i&n)}:{h:0|Number(e>>i&n),l:0|Number(e&n)}}(e[a],t);[o[a],s[a]]=[r,c]}return[o,s]}let s=(e,t,r)=>e>>>r,a=(e,t,r)=>e<<32-r|t>>>r,c=(e,t,r)=>e>>>r|t<<32-r,l=(e,t,r)=>e<<32-r|t>>>r,u=(e,t,r)=>e<<64-r|t>>>r-32,d=(e,t,r)=>e>>>r-32|t<<64-r,h=(e,t,r)=>e<<r|t>>>32-r,p=(e,t,r)=>t<<r|e>>>32-r,f=(e,t,r)=>t<<r-32|e>>>64-r,g=(e,t,r)=>e<<r-32|t>>>64-r;function m(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/4294967296|0)|0,l:0|i}}let y=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),b=(e,t,r,n)=>t+r+n+(e/4294967296|0)|0,w=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),v=(e,t,r,n,i)=>t+r+n+i+(e/4294967296|0)|0,C=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),E=(e,t,r,n,i,o)=>t+r+n+i+o+(e/4294967296|0)|0},21645:function(e,t,r){"use strict";r.d(t,{b:function(){return o}});var n=r(61851);class i extends n.kb{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.z3)(e);let r=(0,n.O0)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),(0,n.ru)(o)}update(e){return(0,n.$h)(this),this.iHash.update(e),this}digestInto(e){(0,n.$h)(this),(0,n.gk)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let o=(e,t,r)=>new i(e,t).update(r).digest();o.create=(e,t)=>
vendor: 4,395 bytes, line 24
24new i(e,t)},32153:function(e,t,r){"use strict";r.d(t,{JQ:function(){return w},iC:function(){return C},o:function(){return v}});var n=r(61851);class i extends n.kb{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=(0,n.GL)(this.buffer)}update(e){(0,n.$h)(this),e=(0,n.O0)(e),(0,n.gk)(e);let{view:t,buffer:r,blockLen:i}=this,o=e.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let t=(0,n.GL)(e);for(;i<=o-s;s+=i)this.process(t,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.$h)(this),(0,n.eB)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:i,isLE:o}=this,{pos:s}=this;t[s++]=128,(0,n.ru)(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,l=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+l,a,n)}(r,i-8,BigInt(8*this.length),o),this.process(r,0);let a=(0,n.GL)(e),c=this.outputLen;if(c%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)a.setUint32(4*e,u[e],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let o=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),a=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var c=r(40999);let l=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),u=new Uint32Array(64);class d extends i{constructor(e=32){super(64,e,8,!1),this.A=0|o[0],this.B=0|o[1],this.C=0|o[2],this.D=0|o[3],this.E=0|o[4],this.F=0|o[5],this.G=0|o[6],this.H=0|o[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=u[e-15],r=u[e-2],i=(0,n.np)(t,7)^(0,n.np)(t,18)^t>>>3,o=(0,n.np)(r,17)^(0,n.np)(r,19)^r>>>10;u[e]=o+u[e-7]+i+u[e-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:c,G:d,H:h}=this;for(let e=0;e<64;e++){var p,f,g,m;let t=h+((0,n.np)(a,6)^(0,n.np)(a,11)^(0,n.np)(a,25))+((p=a)&c^~p&d)+l[e]+u[e]|0,y=((0,n.np)(r,2)^(0,n.np)(r,13)^(0,n.np)(r,22))+((f=r)&(g=i)^f&(m=o)^g&m)|0;h=d,d=c,c=a,a=s+t|0,s=o,o=i,i=r,r=t+y|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,d=d+this.G|0,h=h+this.H|0,this.set(r,i,o,s,a,c,d,h)}roundClean(){(0,n.ru)(u)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,n.ru)(this.buffer)}}let h=c.Vl(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
246f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),p=h[0],f=h[1],g=new Uint32Array(80),m=new Uint32Array(80);class y extends i{constructor(e=64){super(128,e,16,!1),this.Ah=0|a[0],this.Al=0|a[1],this.Bh=0|a[2],this.Bl=0|a[3],this.Ch=0|a[4],this.Cl=0|a[5],this.Dh=0|a[6],this.Dl=0|a[7],this.Eh=0|a[8],this.El=0|a[9],this.Fh=0|a[10],this.Fl=0|a[11],this.Gh=0|a[12],this.Gl=0|a[13],this.Hh=0|a[14],this.Hl=0|a[15]}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,r,n,i,o,s,a,c,l,u,d,h,p,f,g]}set(e,t,r,n,i,o,s,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)g[r]=e.getUint32(t),m[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|g[e-15],r=0|m[e-15],n=c.m_(t,r,1)^c.m_(t,r,8)^c.NI(t,r,7),i=c.Ou(t,r,1)^c.Ou(t,r,8)^c.Iq(t,r,7),o=0|g[e-2],s=0|m[e-2],a=c.m_(o,s,19)^c.FL(o,s,61)^c.NI(o,s,6),l=c.Ou(o,s,19)^c.$p(o,s,61)^c.Iq(o,s,6),u=c.Xb(i,l,m[e-7],m[e-16]),d=c.u8(u,n,a,g[e-7],g[e-16]
vendor: 8,507 bytes, line 24
24);g[e]=0|d,m[e]=0|u}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:l,Dl:u,Eh:d,El:h,Fh:y,Fl:b,Gh:w,Gl:v,Hh:C,Hl:E}=this;for(let e=0;e<80;e++){let t=c.m_(d,h,14)^c.m_(d,h,18)^c.FL(d,h,41),x=c.Ou(d,h,14)^c.Ou(d,h,18)^c.$p(d,h,41),A=d&y^~d&w,S=h&b^~h&v,_=c.zP(E,x,S,f[e],m[e]),I=c.pp(_,C,t,A,p[e],g[e]),k=0|_,O=c.m_(r,n,28)^c.FL(r,n,34)^c.FL(r,n,39),N=c.Ou(r,n,28)^c.$p(r,n,34)^c.$p(r,n,39),P=r&i^r&s^i&s,T=n&o^n&a^o&a;C=0|w,E=0|v,w=0|y,v=0|b,y=0|d,b=0|h,({h:d,l:h}=c.IH(0|l,0|u,0|I,0|k)),l=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let R=c.ac(k,N,T);r=c.Fn(R,I,O,P),n=0|R}({h:r,l:n}=c.IH(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=c.IH(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=c.IH(0|this.Ch,0|this.Cl,0|s,0|a)),({h:l,l:u}=c.IH(0|this.Dh,0|this.Dl,0|l,0|u)),({h:d,l:h}=c.IH(0|this.Eh,0|this.El,0|d,0|h)),({h:y,l:b}=c.IH(0|this.Fh,0|this.Fl,0|y,0|b)),({h:w,l:v}=c.IH(0|this.Gh,0|this.Gl,0|w,0|v)),({h:C,l:E}=c.IH(0|this.Hh,0|this.Hl,0|C,0|E)),this.set(r,n,i,o,s,a,l,u,d,h,y,b,w,v,C,E)}roundClean(){(0,n.ru)(g,m)}destroy(){(0,n.ru)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class b extends y{constructor(){super(48),this.Ah=0|s[0],this.Al=0|s[1],this.Bh=0|s[2],this.Bl=0|s[3],this.Ch=0|s[4],this.Cl=0|s[5],this.Dh=0|s[6],this.Dl=0|s[7],this.Eh=0|s[8],this.El=0|s[9],this.Fh=0|s[10],this.Fl=0|s[11],this.Gh=0|s[12],this.Gl=0|s[13],this.Hh=0|s[14],this.Hl=0|s[15]}}let w=(0,n.V1)(()=>new d),v=(0,n.V1)(()=>new y),C=(0,n.V1)(()=>new b)},42159:function(e,t,r){"use strict";r.d(t,{JQ:function(){return n}});let n=r(32153).JQ},85641:function(e,t,r){"use strict";r.d(t,{fr:function(){return v}});var n=r(40999),i=r(61851);let o=BigInt(0),s=BigInt(1),a=BigInt(2),c=BigInt(7),l=BigInt(256),u=BigInt(113),d=[],h=[],p=[];for(let e=0,t=s,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),h.push((e+1)*(e+2)/2%64);let i=o;for(let e=0;e<7;e++)(t=(t<<s^(t>>c)*u)%l)&a&&(i^=s<<(s<<BigInt(e))-s);p.push(i)}let f=(0,n.Vl)(p,!0),g=f[0],m=f[1],y=(e,t,r)=>r>32?(0,n.SD)(e,t,r):(0,n.EP)(e,t,r),b=(e,t,r)=>r>32?(0,n.mk)(e,t,r):(0,n.gm)(e,t,r);class w extends i.kb{constructor(e,t,r,n=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,(0,i.k8)(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.Jq)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.Ux)(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=y(o,s,1)^r[n],c=b(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=h[r],o=y(t,i,n),s=b(t,i,n),a=d[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=m[n]}(0,i.ru)(r)}(this.state32,this.rounds),(0,i.Ux)(this.state32),this.posOut=0,this.pos=0}update(e){(0,i.$h)(this),e=(0,i.O0)(e),(0,i.gk)(e);let{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){let o=Math.min(t-this.pos,n-i);for(let t=0;t<o;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,i.$h)(this,!1),(0,i.gk)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,i.k8)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.eB)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.ru)(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new w(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}let v=(0,i.V1)(()=>new w(136,1,32))},61851:function(e,t,r){"use strict";r.d(t,{kb:function(){return x},gk:function(){return s},$h:function(){return c},z3:function(){return a},k8:function(){return o},eB:function(){return l},ci:function(){return y},ru:function(){return d},eV:function(){return E},V1:function(){return A},GL:function(){return h},nr:function(){return v},_t:function(){return i},O6:function(){return S},np:function(){return p},Ux:function(){return f},O0:function(){return C},Jq:function(){return u}});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function o(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function s(e,...t){if(!i(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");o(e.outputLen),o(e.blockLen)}function c(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function l(e,t){s(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function u(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function d(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function p(e,t){return e<<32-t|e>>>t}let f=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}return e},g="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,m=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function y(e){if(s(e),g)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=m[e[r]];return t}let b={_0:48,_9:57,A:65,F:70,a:97,f:102};function w(e){return e>=b._0&&e<=b._9?e-b._0:e>=b.A&&e<=b.F?e-(b.A-10):e>=b.a&&e<=b.f?e-(b.a-10):void 0}function v(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(g)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=w(e.charCodeAt(i)),o=w(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function C(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e)),s(e),e}function E(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];s(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}class x{}function A(e){let t=t=>e().update(C(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function S(e=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(e));if(n&&"function"==typeof n.randomBytes)return Uint8Array.from(n.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}},42036:function(e,t,r){"use strict";r.d(t,{b:function(){return i}});var n=r(14224);let i={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CONNECTOR_ID:{WALLET_CONNECT:"walletConnect",INJECTED:"injected",WALLET_STANDARD:"announced",COINBASE:"coinbaseWallet",COINBASE_SDK:"coinbaseWalletSDK",SAFE:"safe",LEDGER:"ledger",OKX:"okx",EIP6963:"eip6963",AUTH:"ID_AUTH"},CONNECTOR_NAMES:{AUTH:"Auth"},AUTH_CONNECTOR_SUPPORTED_CHAINS:["eip155","solana"],LIMITS:{PENDING_TRANSACTIONS:99},CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot",BITCOIN:"bip122"}
24,CHAIN_NAME_MAP:{eip155:"EVM Networks",solana:"Solana",polkadot:"Polkadot",bip122:"Bitcoin",cosmos:"Cosmos",sui:"Sui",stacks:"Stacks"},ADAPTER_TYPES:{BITCOIN:"bitcoin",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"],SOLANA_SPL_TOKEN_ADDRESSES:{SOL:"So11111111111111111111111111111111111111112"},HTTP_STATUS_CODES:{SERVER_ERROR:500,TOO_MANY_REQUESTS:429,SERVICE_UNAVAILABLE:503,FORBIDDEN:403},UNSUPPORTED_NETWORK_NAME:"Unknown Network",SECURE_SITE_SDK_ORIGIN:(void 0!==n&&void 0!==n.env?n.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",REMOTE_FEATURES_ALERTS:{MULTI_WALLET_NOT_ENABLED:{DEFAULT:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com."},CONNECTIONS_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnections hook."},CONNECTION_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnection hook."}}},IS_DEVELOPMENT:void 0!==n&&!1}},97875:function(e,t,r){"use strict";r.d(t,{g:function(){return a}});let n=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],i=[{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],o=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];var s=r(42036);let a={getERC20Abi:e=>s.b.USDT_CONTRACT_ADDRESSES.includes(e)?o:n,getSwapAbi:()=>i}},16444:function(e,t,r){"use strict";r.d(t,{E:function(){return l}});var n=r(16483),i=r(10563),o=r(97148),s=r(7409);n.extend(o),n.extend(s);let a={...i,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}},c=["January","February","March","April","May","June","July","August","September","October","November","December"];n.locale("en-web3-modal",a);let l={getMonthNameByIndex:e=>c[e],getYear:(e=new Date().toISOString())=>n(e).year(),getRelativeDateFromNow:e=>n(e).locale("en-web3-modal").fromNow(!0),formatDate:(e,t="DD MMM")=>n(e).format(t)}},57716:function(e,t,r){"use strict";r.d(t,{U:function(){return n}});let n={URLS:{FAQ:"https://walletconnect.com/faq"}}},9605:function(e,t,r){"use strict";r.d(t,{F:function(){return o},p:function(){return i}});var n=r(42036);let i={caipNetworkIdToNumber:e=>e?Number(e.split(":")[1]):void 0,parseEvmChainId(e){return"string"==typeof e?this.caipNetworkIdToNumber(e):e},getNetworksByNamespace:(e,t)=>e?.filter(e=>e.chainNamespace===t)||[],getFirstNetworkByNamespace(e,t){return this.getNetworksByNamespace(e,t)[0]},getNetworkNameByCaipNetworkId(e,t){if(!t)return;let r=e.find(e=>e.caipNetworkId===t);if(r)return r.name;let[i]=t.split(":");return n.b.CHAIN_NAME_MAP?.[i]||void 0}},o=["eip155","solana","polkadot","bip122","cosmos","sui","stacks"]},35529:function(e,t,r){"use strict";r.d(t,{C:function(){return f}});
24var n="[big.js] ",i=n+"Invalid ",o=i+"decimal places",s=i+"rounding mode",a=n+"Division by zero",c={},l=void 0,u=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function d(e,t,r,n){var i=e.c;if(r===l&&(r=e.constructor.RM),0!==r&&1!==r&&2!==r&&3!==r)throw Error(s);if(t<1)n=3===r&&(n||!!i[0])||0===t&&(1===r&&i[0]>=5||2===r&&(i[0]>5||5===i[0]&&(n||i[1]!==l))),i.length=1,n?(e.e=e.e-t+1,i[0]=1):i[0]=e.e=0;else if(t<i.length){if(n=1===r&&i[t]>=5||2===r&&(i[t]>5||5===i[t]&&(n||i[t+1]!==l||1&i[t-1]))||3===r&&(n||!!i[0]),i.length=t,n){for(;++i[--t]>9;)if(i[t]=0,0===t){++e.e,i.unshift(1);break}}for(t=i.length;!i[--t];)i.pop()}return e}function h(e,t,r){var n=e.e,i=e.c.join(""),o=i.length;if(t)i=i.charAt(0)+(o>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0){if(++n>o)for(n-=o;n--;)i+="0";else n<o&&(i=i.slice(0,n)+"."+i.slice(n))}else o>1&&(i=i.charAt(0)+"."+i.slice(1));return e.s<0&&r?"-"+i:i}c.abs=function(){var e=new this.constructor(this);return e.s=1,e},c.cmp=function(e){var t,r=this.c,n=(e=new this.constructor(e)).c,i=this.s,o=e.s,s=this.e,a=e.e;if(!r[0]||!n[0])return r[0]?i:n[0]?-o:0;if(i!=o)return i;if(t=i<0,s!=a)return s>a^t?1:-1;for(i=-1,o=(s=r.length)<(a=n.length)?s:a;++i<o;)if(r[i]!=n[i])return r[i]>n[i]^t?1:-1;return s==a?0:s>a^t?1:-1},c.div=function(e){var t=this.constructor,r=this.c,n=(e=new t(e)).c,i=this.s==e.s?1:-1,s=t.DP;if(s!==~~s||s<0||s>1e6)throw Error(o);if(!n[0])throw Error(a);if(!r[0])return e.s=i,e.c=[e.e=0],e;var c,u,h,p,f,g=n.slice(),m=c=n.length,y=r.length,b=r.slice(0,c),w=b.length,v=e,C=v.c=[],E=0,x=s+(v.e=this.e-e.e)+1;for(v.s=i,i=x<0?0:x,g.unshift(0);w++<c;)b.push(0);do{for(h=0;h<10;h++){if(c!=(w=b.length))p=c>w?1:-1;else for(f=-1,p=0;++f<c;)if(n[f]!=b[f]){p=n[f]>b[f]?1:-1;break}if(p<0){for(u=w==c?n:g;w;){if(b[--w]<u[w]){for(f=w;f&&!b[--f];)b[f]=9;--b[f],b[w]+=10}b[w]-=u[w]}for(;!b[0];)b.shift()}else break}C[E++]=p?h:++h,b[0]&&p?b[w]=r[m]||0:b=[r[m]]}while((m++<y||b[0]!==l)&&i--);return!C[0]&&1!=E&&(C.shift(),v.e--,x--),E>x&&d(v,x,t.RM,b[0]!==l),v},c.eq=function(e){return 0===this.cmp(e)},c.gt=function(e){return this.cmp(e)>0},c.gte=function(e){return this.cmp(e)>-1},c.lt=function(e){return 0>this.cmp(e)},c.lte=function(e){return 1>this.cmp(e)},c.minus=c.sub=function(e){var t,r,n,i,o=this.constructor,s=this.s,a=(e=new o(e)).s;if(s!=a)return e.s=-a,this.plus(e);var c=this.c.slice(),l=this.e,u=e.c,d=e.e;if(!c[0]||!u[0])return u[0]?e.s=-a:c[0]?e=new o(this):e.s=1,e;if(s=l-d){for((i=s<0)?(s=-s,n=c):(d=l,n=u),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else for(r=((i=c.length<u.length)?c:u).length,s=a=0;a<r;a++)if(c[a]!=u[a]){i=c[a]<u[a];break}if(i&&(n=c,c=u,u=n,e.s=-e.s),(a=(r=u.length)-(t=c.length))>0)for(;a--;)c[t++]=0;for(a=t;r>s;){if(c[--r]<u[r]){for(t=r;t&&!c[--t];)c[t]=9;--c[t],c[r]+=10}c[r]-=u[r]}for(;0===c[--a];)c.pop();for(;0===c[0];)c.shift(),--d;return c[0]||(e.s=1,c=[d=0]),e.c=c,e.e=d,e},c.mod=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(!e.c[0])throw Error(a);return(r.s=e.s=1,t=1==e.cmp(r),r.s=i,e.s=o,t)?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=i,n.RM=o,this.minus(r.times(e)))},c.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e},c.plus=c.add=function(e){var t,r,n,i=this.constructor;if(e=new i(e),this.s!=e.s)return e.s=-e.s,this.minus(e);var o=this.e,s=this.c,a=e.e,c=e.c;if(!s[0]||!c[0])return c[0]||(s[0]?e=new i(this):e.s=this.s),e;if(s=s.slice(),t=o-a){for(t>0?(a=o,n=c):(t=-t,n=s),n.reverse();t--;)n.push(0);n.reverse()}for(s.length-c.length<0&&(n=c,c=s,s=n),t=c.length,r=0;t;s[t]%=10)r=(s[--t]=s[t]+c[t]+r)/10|0;for(r&&(s.unshift(r),++a),t=s.length;0===s[--t];)s.pop();return e.c=s,e.e=a,e},c.pow=function(e){var t=this,r=new t.constructor("1"),n=r,o=e<0;if(e!==~~e||e<-1e6||e>1e6)throw Error(i+"exponent");for(o&&(e=-e);1&e&&(n=n.times(t)),e>>=1;)t=t.times(t);return o?r.div(n):n},c.prec=function(e,t){if(e!==~~e||e<1||e>1e6)throw Error(i+"precision");return d(new this.constructor(this),e,t)},c.round=function(e,t){if(e===l)e=0;else if(e!==~~e||e<-1e6||e>1e6)throw Error(o);return d(new this.constructor(this),e+this.e+1,t)},c.sqrt=function(){var e,t,r,i=this.constructor,o=this.s,s=this.e,a=new i("0.5");
24if(!this.c[0])return new i(this);if(o<0)throw Error(n+"No square root");0===(o=Math.sqrt(+h(this,!0,!0)))||o===1/0?((t=this.c.join("")).length+s&1||(t+="0"),s=((s+1)/2|0)-(s<0||1&s),e=new i(((o=Math.sqrt(t))==1/0?"5e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+s)):e=new i(o+""),s=e.e+(i.DP+=4);do r=e,e=a.times(r.plus(this.div(r)));while(r.c.slice(0,s).join("")!==e.c.slice(0,s).join(""));return d(e,(i.DP-=4)+e.e+1,i.RM)},c.times=c.mul=function(e){var t,r=this.constructor,n=this.c,i=(e=new r(e)).c,o=n.length,s=i.length,a=this.e,c=e.e;if(e.s=this.s==e.s?1:-1,!n[0]||!i[0])return e.c=[e.e=0],e;for(e.e=a+c,o<s&&(t=n,n=i,i=t,c=o,o=s,s=c),t=Array(c=o+s);c--;)t[c]=0;for(a=s;a--;){for(s=0,c=o+a;c>a;)s=t[c]+i[a]*n[c-a-1]+s,t[c--]=s%10,s=s/10|0;t[c]=s}for(s?++e.e:t.shift(),a=t.length;!t[--a];)t.pop();return e.c=t,e},c.toExponential=function(e,t){var r=this,n=r.c[0];if(e!==l){if(e!==~~e||e<0||e>1e6)throw Error(o);for(r=d(new r.constructor(r),++e,t);r.c.length<e;)r.c.push(0)}return h(r,!0,!!n)},c.toFixed=function(e,t){var r=this,n=r.c[0];if(e!==l){if(e!==~~e||e<0||e>1e6)throw Error(o);for(r=d(new r.constructor(r),e+r.e+1,t),e=e+r.e+1;r.c.length<e;)r.c.push(0)}return h(r,!1,!!n)},c[Symbol.for("nodejs.util.inspect.custom")]=c.toJSON=c.toString=function(){var e=this.constructor;return h(this,this.e<=e.NE||this.e>=e.PE,!!this.c[0])},c.toNumber=function(){var e=+h(this,!0,!0);if(!0===this.constructor.strict&&!this.eq(e.toString()))throw Error(n+"Imprecise conversion");return e},c.toPrecision=function(e,t){var r=this,n=r.constructor,o=r.c[0];if(e!==l){if(e!==~~e||e<1||e>1e6)throw Error(i+"precision");for(r=d(new n(r),e,t);r.c.length<e;)r.c.push(0)}return h(r,e<=r.e||r.e<=n.NE||r.e>=n.PE,!!o)},c.valueOf=function(){var e=this.constructor;if(!0===e.strict)throw Error(n+"valueOf disallowed");return h(this,this.e<=e.NE||this.e>=e.PE,!0)};var p=function e(){function t(r){if(!(this instanceof t))return r===l?e():new t(r);if(r instanceof t)this.s=r.s,this.e=r.e,this.c=r.c.slice();else{if("string"!=typeof r){if(!0===t.strict&&"bigint"!=typeof r)throw TypeError(i+"value");r=0===r&&1/r<0?"-0":String(r)}!function(e,t){var r,n,o;if(!u.test(t))throw Error(i+"number");for(e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),o=t.length,n=0;n<o&&"0"==t.charAt(n);)++n;if(n==o)e.c=[e.e=0];else{for(;o>0&&"0"==t.charAt(--o););for(e.e=r-n-1,e.c=[],r=0;n<=o;)e.c[r++]=+t.charAt(n++)}}(this,r)}this.constructor=t}return t.prototype=c,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.strict=!1,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}();let f={bigNumber:e=>new p(e||0),multiply(e,t){if(void 0===e||void 0===t)return new p(0);let r=new p(e),n=new p(t);return r.times(n)},toFixed:(e,t=2)=>void 0===e||""===e?new p(0).toFixed(t):new p(e).toFixed(t),formatNumberToLocalString:(e,t=2)=>void 0===e||""===e?"0.00":"number"==typeof e?e.toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t,roundingMode:"floor"}):parseFloat(e).toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t,roundingMode:"floor"}),parseLocalStringToNumber:e=>void 0===e||""===e?0:new p(e.replace(/,/gu,"")).toNumber()}},77879:function(e,t,r){"use strict";r.d(t,{u:function(){return n}});let n={validateCaipAddress(e){if(e.split(":")?.length!==3)throw Error("Invalid CAIP Address");return e},parseCaipAddress(e){let t=e.split(":");if(3!==t.length)throw Error(`Invalid CAIP-10 address: ${e}`);let[r,n,i]=t;if(!r||!n||!i)throw Error(`Invalid CAIP-10 address: ${e}`);return{chainNamespace:r,chainId:n,address:i}},parseCaipNetworkId(e){let t=e.split(":");if(2!==t.length)throw Error(`Invalid CAIP-2 network id: ${e}`);let[r,n]=t;if(!r||!n)throw Error(`Invalid CAIP-2 network id: ${e}`);return{chainNamespace:r,chainId:n}}}},6026:function(e,t,r){"use strict";r.d(t,{$U:function(){return s},Vk:function(){return i},mr:function(){return o},uJ:function(){return n}});let n={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit-wallet/SOCIAL_USERNAME",RECENT_WALLETS:"@appkit/recent_wallets",DEEPL
24INK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",ACTIVE_NAMESPACE:"@appkit/active_namespace",CONNECTED_NAMESPACES:"@appkit/connected_namespaces",CONNECTION_STATUS:"@appkit/connection_status",SIWX_AUTH_TOKEN:"@appkit/siwx-auth-token",SIWX_NONCE_TOKEN:"@appkit/siwx-nonce-token",TELEGRAM_SOCIAL_PROVIDER:"@appkit/social_provider",NATIVE_BALANCE_CACHE:"@appkit/native_balance_cache",PORTFOLIO_CACHE:"@appkit/portfolio_cache",ENS_CACHE:"@appkit/ens_cache",IDENTITY_CACHE:"@appkit/identity_cache",PREFERRED_ACCOUNT_TYPES:"@appkit/preferred_account_types",CONNECTIONS:"@appkit/connections",DISCONNECTED_CONNECTOR_IDS:"@appkit/disconnected_connector_ids",HISTORY_TRANSACTIONS_CACHE:"@appkit/history_transactions_cache",TOKEN_PRICE_CACHE:"@appkit/token_price_cache",RECENT_EMAILS:"@appkit/recent_emails",LATEST_APPKIT_VERSION:"@appkit/latest_version"};function i(e){if(!e)throw Error("Namespace is required for CONNECTED_CONNECTOR_ID");return`@appkit/${e}:connected_connector_id`}let o={setItem(e,t){s()&&void 0!==t&&localStorage.setItem(e,t)},getItem(e){if(s())return localStorage.getItem(e)||void 0},removeItem(e){s()&&localStorage.removeItem(e)},clear(){s()&&localStorage.clear()}};function s(){return"undefined"!=typeof window&&"undefined"!=typeof localStorage}},79649:function(e,t,r){"use strict";function n(e,t){return"light"===t?{"--w3m-accent":e?.["--w3m-accent"]||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":e?.["--w3m-accent"]||"hsla(230, 100%, 67%, 1)","--w3m-background":"#202020"}}r.d(t,{t:function(){return n}})},83944:function(e,t,r){"use strict";r.d(t,{AccountController:function(){return d}});var n=r(18680),i=r(13565),o=r(23829),s=r(99321),a=r(22754),c=r(39674),l=r(65045);let u=(0,n.sj)({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map}),d=(0,a.P)({state:u,replaceState(e){e&&Object.assign(u,(0,n.iH)(e))},subscribe:e=>c.R.subscribeChainProp("accountState",t=>{if(t)return e(t)}),subscribeKey(e,t,r){let n;return c.R.subscribeChainProp("accountState",r=>{if(r){let i=r[e];n!==i&&(n=i,t(i))}},r)},setStatus(e,t){c.R.setAccountProp("status",e,t)},getCaipAddress(e){if(e)return c.R.state.chains.get(e)?.accountState?.caipAddress},setCaipAddress(e,t){let r=e?s.j.getPlainAddress(e):void 0;t===c.R.state.activeChain&&(c.R.state.activeCaipAddress=e),c.R.setAccountProp("caipAddress",e,t),c.R.setAccountProp("address",r,t)},setBalance(e,t,r){c.R.setAccountProp("balance",e,r),c.R.setAccountProp("balanceSymbol",t,r)},setProfileName(e,t){c.R.setAccountProp("profileName",e,t)},setProfileImage(e,t){c.R.setAccountProp("profileImage",e,t)},setUser(e,t){c.R.setAccountProp("user",e,t)},setAddressExplorerUrl(e,t){c.R.setAccountProp("addressExplorerUrl",e,t)},setSmartAccountDeployed(e,t){c.R.setAccountProp("smartAccountDeployed",e,t)},setCurrentTab(e){c.R.setAccountProp("currentTab",e,c.R.state.activeChain)},setTokenBalance(e,t){e&&c.R.setAccountProp("tokenBalance",e,t)},setShouldUpdateToAddress(e,t){c.R.setAccountProp("shouldUpdateToAddress",e,t)},addAddressLabel(e,t,r){if(!r)return;let n=c.R.state.chains.get(r)?.accountState?.addressLabels||new Map;n.set(e,t),c.R.setAccountProp("addressLabels",n,r)},removeAddressLabel(e,t){if(!t)return;let r=c.R.state.chains.get(t)?.accountState?.addressLabels||new Map;r.delete(e),c.R.setAccountProp("addressLabels",r,t)},setConnectedWalletInfo(e,t){c.R.setAccountProp("connectedWalletInfo",e,t,!1)},setPreferredAccountType(e,t){c.R.setAccountProp("preferredAccountType",e,t)},setSocialProvider(e,t){e&&c.R.setAccountProp("socialProvider",e,t)},setSocialWindow(e,t){c.R.setAccountProp("socialWindow",e?(0,n.iH)(e):void 0,t)},setFarcasterUrl(e,t){c.R.setAccountProp("farcasterUrl",e,t)},async fetchTokenBalance(e){u.balanceLoading=!0;let t=c.R.state.activeCaipNetwork?.caipNetworkId,r=c.R.state.activeCaipNetwork?.chainNamespace,n=c.R.state.activeCaipAddress,a=n?s.j.getPlainAddress(n):void 0;if(u.lastRetry&&!s.j.isAllowedRetry(u.lastRetry,30*o.bq.ONE_SEC_MS))return u.balanceLoading=!1,[];try{if(a&&t&&r){let e=await i.Q.getMyTokensWithBalance();return d.setTokenBalance(e,r),u.lastRetry=void 0,u.balanceLoading=!1,e}}catch(t){u.lastRetry=Date.now(),e?.(t),l.SnackController.showError("Token Balance Unavailable")}finally{u.balanceLoading=!1}return[]},resetAccount(e){c.R.resetAccount(e)}})},6082:function(e,t,r){"use strict";r.d(t,{AlertController:function(){return c}});var n=r(18680),i=r(87170),o=r(22754),s=r(29607);let a=(0,n.sj)({message:"",variant:"info",open:!1}),c=(0,o.P)({state:a,subscribeKey:(e,t)=>(0,i.VW)(a,e,t),open(e,t){let{debug:r}=s.OptionsController.state,{code:n,displayMessage:i,debugMessage:o}=e;i&&r&&(a.message=i,a.variant=t,a.open=!0),o&&console.error("function"==typeof o?o():o,n?{code:n}:void 0)},warn(e,t,r){a.open=!0,a.message=e,a.variant="warning",t&&console.warn(t,r)},close(){a.open=!1,a.message="",a.variant="info"}})},84270:function(e,t,r){"use strict";r.d(t,{ApiController:function(){return w}});var n=r(18680),i=r(87170),o=r(42036),s=r(35143),a=r(99321),c=r(54958),l=r(30353),u=r(33802),d=r(41593),h=r(39674),p=r(20274),f=r(46001),g=r(29607);let m=a.j.getApiUrl(),y=new c.V({baseUrl:m,clientId:null}),b=(0,n.sj)({promises:{},page:1,count:0,featured:[],allFeatured:[],recommended:[],allRecommended:[],wallets:[],filteredWallets:[],search:[],isAnalyticsEnabled:!1,excludedWallets:[],isFetchingRecommendedWallets:!1}),w={state:b,subscribeKey:(e,t)=>(0,i.VW)(b,e,t),_getSdkProperties(){let{projectId:e,sdkType:t,sdkVersion:r}=g.OptionsController.state;return{projectId:e,st:t||"appkit",sv:r||"html-wagmi-4.2.2"}},_filterOutExtensions:e=>g.OptionsController.state.isUniversalProvider?e.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):e,async _fetchWalletImage(e){let t=`${y.baseUrl}/getWalletImage/${e}`,r=await y.getBlob({path:t,params:w._getSdkProperties()});d.W.setWalletImage(e,URL.createObjectURL(r))},async _fetchNetworkImage(e){let t=`${y.baseUrl}/public/getAssetImage/${e}`,r=await y.getBlob({path:t,params:w._getSdkProperties()});d.W.setNetworkImage(e,URL.createObjectURL(r))},async _fetchConnectorImage(e){let t=`${y.baseUrl}/public/getAssetImage/${e}`,r=await y.getBlob({path:t,params:w._getSdkProperties()});d.W.setConnectorImage(e,URL.createObjectURL(r))},async _fetchCurrencyImage(e){let t=`${y.baseUrl}/public/getCurrencyImage/${e}`,r=await y.getBlob({path:t,params:w._getSdkProperties()});d.W.setCurrencyImage(e,URL.createObjectURL(r))},async _fetchTokenImage(e){let t=`${y.baseUrl}/public/getTokenImage/${e}`,r=await y.getBlob({path:t,params:w._getSdkProperties()});d.W.setTokenImage(e,URL.createObjectURL(r))},_filterWalletsByPlatform(e){let t=e.length,r=a.j.isMobile()?e?.filter(e=>!!e.mobile_link||!!e.webapp_link||Object.values(l.m).map(e=>e.id).includes(e.id)):e,n=t-r.length;return{filteredWallets:r,mobileFilteredOutWalletsLength:n}},fetchProjectConfig:async()=>(await y.get({path:"/appkit/v1/config",params:w._getSdkProperties()})).features,async fetchAllowedOrigins(){try{let{allowedOrigins:e}=await y.get({path:"/projects/v1/origins",params:w._getSdkProperties()});return e}catch(e){if(e instanceof Error&&e.cause instanceof Response){let t=e.cause.status;if(t===o.b.HTTP_STATUS_CODES.TOO_MANY_REQUESTS)throw Error("RATE_LIMITED",{cause:e});if(t>=o.b.HTTP_STATUS_CODES.SERVER_ERROR&&t<600)throw Error("SERVER_ERROR",{cause:e})}return[]}},async fetchNetworkImages(){let e=h.R.getAllRequestedCaipNetworks(),t=e?.map(({assets:e})=>
24e?.imageId).filter(Boolean).filter(e=>!s.f.getNetworkImageById(e));t&&await Promise.allSettled(t.map(e=>w._fetchNetworkImage(e)))},async fetchConnectorImages(){let{connectors:e}=p.ConnectorController.state,t=e.map(({imageId:e})=>e).filter(Boolean);await Promise.allSettled(t.map(e=>w._fetchConnectorImage(e)))},async fetchCurrencyImages(e=[]){await Promise.allSettled(e.map(e=>w._fetchCurrencyImage(e)))},async fetchTokenImages(e=[]){await Promise.allSettled(e.map(e=>w._fetchTokenImage(e)))},async fetchWallets(e){let t=e.exclude??[];w._getSdkProperties().sv.startsWith("html-core-")&&t.push(...Object.values(l.m).map(e=>e.id));let r=await y.get({path:"/getWallets",params:{...w._getSdkProperties(),...e,page:String(e.page),entries:String(e.entries),include:e.include?.join(","),exclude:t.join(",")}}),{filteredWallets:n,mobileFilteredOutWalletsLength:i}=w._filterWalletsByPlatform(r?.data);return{data:n||[],count:r?.count,mobileFilteredOutWalletsLength:i}},async fetchFeaturedWallets(){let{featuredWalletIds:e}=g.OptionsController.state;if(e?.length){let t={...w._getSdkProperties(),page:1,entries:e?.length??4,include:e},{data:r}=await w.fetchWallets(t),n=[...r].sort((t,r)=>e.indexOf(t.id)-e.indexOf(r.id)),i=n.map(e=>e.image_id).filter(Boolean);await Promise.allSettled(i.map(e=>w._fetchWalletImage(e))),b.featured=n,b.allFeatured=n}},async fetchRecommendedWallets(){try{b.isFetchingRecommendedWallets=!0;let{includeWalletIds:e,excludeWalletIds:t,featuredWalletIds:r}=g.OptionsController.state,n=[...t??[],...r??[]].filter(Boolean),i=h.R.getRequestedCaipNetworkIds().join(","),{data:o,count:s}=await w.fetchWallets({page:1,entries:4,include:e,exclude:n,chains:i}),a=u.M.getRecentWallets(),c=o.map(e=>e.image_id).filter(Boolean),l=a.map(e=>e.image_id).filter(Boolean);await Promise.allSettled([...c,...l].map(e=>w._fetchWalletImage(e))),b.recommended=o,b.allRecommended=o,b.count=s??0}catch{}finally{b.isFetchingRecommendedWallets=!1}},async fetchWalletsByPage({page:e}){let{includeWalletIds:t,excludeWalletIds:r,featuredWalletIds:n}=g.OptionsController.state,i=h.R.getRequestedCaipNetworkIds().join(","),o=[...b.recommended.map(({id:e})=>e),...r??[],...n??[]].filter(Boolean),{data:s,count:c,mobileFilteredOutWalletsLength:l}=await w.fetchWallets({page:e,entries:40,include:t,exclude:o,chains:i});b.mobileFilteredOutWalletsLength=l+(b.mobileFilteredOutWalletsLength??0);let u=s.slice(0,20).map(e=>e.image_id).filter(Boolean);await Promise.allSettled(u.map(e=>w._fetchWalletImage(e))),b.wallets=a.j.uniqueBy([...b.wallets,...w._filterOutExtensions(s)],"id").filter(e=>e.chains?.some(e=>i.includes(e))),b.count=c>b.count?c:b.count,b.page=e},async initializeExcludedWallets({ids:e}){let t={page:1,entries:e.length,include:e},{data:r}=await w.fetchWallets(t);r&&r.forEach(e=>{b.excludedWallets.push({rdns:e.rdns,name:e.name})})},async searchWallet({search:e,badge:t}){let{includeWalletIds:r,excludeWalletIds:n}=g.OptionsController.state,i=h.R.getRequestedCaipNetworkIds().join(",");b.search=[];let o={page:1,entries:100,search:e?.trim(),badge_type:t,include:r,exclude:n,chains:i},{data:s}=await w.fetchWallets(o);f.X.sendEvent({type:"track",event:"SEARCH_WALLET",properties:{badge:t??"",search:e??""}});let c=s.map(e=>e.image_id).filter(Boolean);await Promise.allSettled([...c.map(e=>w._fetchWalletImage(e)),a.j.wait(300)]),b.search=w._filterOutExtensions(s)},initPromise:(e,t)=>b.promises[e]||(b.promises[e]=t()),prefetch:({fetchConnectorImages:e=!0,fetchFeaturedWallets:t=!0,fetchRecommendedWallets:r=!0,fetchNetworkImages:n=!0}={})=>Promise.allSettled([e&&w.initPromise("connectorImages",w.fetchConnectorImages),t&&w.initPromise("featuredWallets",w.fetchFeaturedWallets),r&&w.initPromise("recommendedWallets",w.fetchRecommendedWallets),n&&w.initPromise("networkImages",w.fetchNetworkImages)].filter(Boolean)),prefetchAnalyticsConfig(){g.OptionsController.state.features?.anal
24ytics&&w.fetchAnalyticsConfig()},async fetchAnalyticsConfig(){try{let{isAnalyticsEnabled:e}=await y.get({path:"/getAnalyticsConfig",params:w._getSdkProperties()});g.OptionsController.setFeatures({analytics:e})}catch(e){g.OptionsController.setFeatures({analytics:!1})}},filterByNamespaces(e){if(!e?.length){b.featured=b.allFeatured,b.recommended=b.allRecommended;return}let t=h.R.getRequestedCaipNetworkIds().join(",");b.featured=b.allFeatured.filter(e=>e.chains?.some(e=>t.includes(e))),b.recommended=b.allRecommended.filter(e=>e.chains?.some(e=>t.includes(e))),b.filteredWallets=b.wallets.filter(e=>e.chains?.some(e=>t.includes(e)))},clearFilterByNamespaces(){b.filteredWallets=[]},setFilterByNamespace(e){if(!e){b.featured=b.allFeatured,b.recommended=b.allRecommended;return}let t=h.R.getRequestedCaipNetworkIds().join(",");b.featured=b.allFeatured.filter(e=>e.chains?.some(e=>t.includes(e))),b.recommended=b.allRecommended.filter(e=>e.chains?.some(e=>t.includes(e))),b.filteredWallets=b.wallets.filter(e=>e.chains?.some(e=>t.includes(e)))}}},41593:function(e,t,r){"use strict";r.d(t,{W:function(){return a}});var n=r(18680),i=r(87170),o=r(22754);let s=(0,n.sj)({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),a=(0,o.P)({state:s,subscribeNetworkImages:e=>(0,n.Ld)(s.networkImages,()=>e(s.networkImages)),subscribeKey:(e,t)=>(0,i.VW)(s,e,t),subscribe:e=>(0,n.Ld)(s,()=>e(s)),setWalletImage(e,t){s.walletImages[e]=t},setNetworkImage(e,t){s.networkImages[e]=t},setChainImage(e,t){s.chainImages[e]=t},setConnectorImage(e,t){s.connectorImages={...s.connectorImages,[e]:t}},setTokenImage(e,t){s.tokenImages[e]=t},setCurrencyImage(e,t){s.currencyImages[e]=t}})},69199:function(e,t,r){"use strict";r.d(t,{L:function(){return g}});var n=r(18680),i=r(23829),o=r(99321),s=r(54958),a=r(33802),c=r(83944),l=r(39674),u=r(29607),d=r(65045);let h={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},p=o.j.getBlockchainApiUrl(),f=(0,n.sj)({clientId:null,api:new s.V({baseUrl:p,clientId:null}),supportedChains:{http:[],ws:[]}}),g={state:f,async get(e){let{st:t,sv:r}=g.getSdkProperties(),n=u.OptionsController.state.projectId,i={...e.params||{},st:t,sv:r,projectId:n};return f.api.get({...e,params:i})},getSdkProperties(){let{sdkType:e,sdkVersion:t}=u.OptionsController.state;return{st:e||"unknown",sv:t||"unknown"}},async isNetworkSupported(e){if(!e)return!1;try{f.supportedChains.http.length||await g.getSupportedNetworks()}catch(e){return!1}return f.supportedChains.http.includes(e)},async getSupportedNetworks(){try{let e=await g.get({path:"v1/supported-chains"});return f.supportedChains=e,e}catch{return f.supportedChains}},async fetchIdentity({address:e}){let t=a.M.getIdentityFromCacheForAddress(e);if(t)return t;let r=await g.get({path:`/v1/identity/${e}`,params:{sender:l.R.state.activeCaipAddress?o.j.getPlainAddress(l.R.state.activeCaipAddress):void 0}});return a.M.updateIdentityCache({address:e,identity:r,timestamp:Date.now()}),r},async fetchTransactions({account:e,cursor:t,signal:r,cache:n,chainId:i}){if(!await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId))return{data:[],next:void 0};let o=a.M.getTransactionsCacheForAddress({address:e,chainId:i});if(o)return o;let s=await g.get({path:`/v1/account/${e}/history`,params:{cursor:t,chainId:i},signal:r,cache:n});return a.M.updateTransactionsCache({address:e,chainId:i,timestamp:Date.now(),transactions:s}),s},fetchSwapQuote:async({amount:e,userAddress:t,from:r,to:n,gasPrice:i})=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?g.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{amount:e,userAddress:t,from:r,to:n,gasPrice:i}}):{quotes:[]},fetchSwapTokens:async({chainId:e})=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?g.get({path:"/v1/convert/tokens",params:{chainId:e}}):{tokens:[]},async fetchTokenPrice({addresses:e}){if(!await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId))return{fungibles:[]};let t=a.M.getTokenPriceCacheForAddresses(e);if(t)return t;let r=await f.api.post({path:"/v1/fungible/price",body:{currency:"usd",addresses:e,projectId:u.OptionsController.state.projectId},headers:{"Content-Type":"application/json"}});return a.M.updateTokenPriceCache({addresses:e,timestamp:Date.now(),tokenPrice:r}),r},fetchSwapAllowance:async({tokenAddress:e,userAddress:t})=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?g.get({path:"/v1/convert/allowance",params:{tokenAddress:e,userAddress:t},headers:{"Content-Type":"application/json"}}):{allowance:"0"},async fetchGasPrice({chainId:e}){let{st:t,sv:r}=g.getSdkProperties();if(!await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId))throw Error("Network not supported for Gas Price");return g.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json"},params:{chainId:e,st:t,sv:r}})},async generateSwapCalldata({amount:e,from:t,to:r,userAddress:n,disableEstimate:o}){if(!await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId))throw Error("Network not supported for Swaps");return f.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:e,eip155:{slippage:i.bq.CONVERT_SLIPPAGE_TOLERANCE},projectId:u.OptionsController.state.projectId,from:t,to:r,userAddress:n,disableEstimate:o}})},async generateApproveCalldata({from:e,to:t,userAddress:r}){let{st:n,sv:i}=g.getSdkProperties();if(!await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId))throw Error("Network not supported for Swaps");return g.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json"}
24,params:{userAddress:r,from:e,to:t,st:n,sv:i}})},async getBalance(e,t,r){let{st:n,sv:i}=g.getSdkProperties();if(!await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId))return d.SnackController.showError("Token Balance Unavailable"),{balances:[]};let o=`${t}:${e}`,s=a.M.getBalanceCacheForCaipAddress(o);if(s)return s;let c=await g.get({path:`/v1/account/${e}/balance`,params:{currency:"usd",chainId:t,forceUpdate:r,st:n,sv:i}});return a.M.updateBalanceCache({caipAddress:o,balance:c,timestamp:Date.now()}),c},lookupEnsName:async e=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?g.get({path:`/v1/profile/account/${e}`,params:{apiVersion:"2"}}):{addresses:{},attributes:[]},reverseLookupEnsName:async({address:e})=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?g.get({path:`/v1/profile/reverse/${e}`,params:{sender:c.AccountController.state.address,apiVersion:"2"}}):[],getEnsNameSuggestions:async e=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?g.get({path:`/v1/profile/suggestions/${e}`,params:{zone:"reown.id"}}):{suggestions:[]},registerEnsName:async({coinType:e,address:t,message:r,signature:n})=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?f.api.post({path:"/v1/profile/account",body:{coin_type:e,address:t,message:r,signature:n},headers:{"Content-Type":"application/json"}}):{success:!1},generateOnRampURL:async({destinationWallets:e,partnerUserId:t,defaultNetwork:r,purchaseAmount:n,paymentAmount:i})=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?(await f.api.post({path:"/v1/generators/onrampurl",params:{projectId:u.OptionsController.state.projectId},body:{destinationWallets:e,defaultNetwork:r,partnerUserId:t,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:i}})).url:"",async getOnrampOptions(){if(!await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId))return{paymentCurrencies:[],purchaseCurrencies:[]};try{return await g.get({path:"/v1/onramp/options"})}catch(e){return h}},async getOnrampQuote({purchaseCurrency:e,paymentCurrency:t,amount:r,network:n}){try{if(!await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId))return null;return await f.api.post({path:"/v1/onramp/quote",params:{projectId:u.OptionsController.state.projectId},body:{purchaseCurrency:e,paymentCurrency:t,amount:r,network:n}})}catch(e){return{networkFee:{amount:r,currency:t.id},paymentSubtotal:{amount:r,currency:t.id},paymentTotal:{amount:r,currency:t.id},purchaseAmount:{amount:r,currency:t.id},quoteId:"mocked-quote-id"}}},getSmartSessions:async e=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?g.get({path:`/v1/sessions/${e}`}):[],revokeSmartSession:async(e,t,r)=>await g.isNetworkSupported(l.R.state.activeCaipNetwork?.caipNetworkId)?f.api.post({path:`/v1/sessions/${e}/revoke`,params:{projectId:u.OptionsController.state.projectId},body:{pci:t,signature:r}}):{success:!1},setClientId(e){f.clientId=e,f.api=new s.V({baseUrl:p,clientId:e})}}},39674:function(e,t,r){"use strict";r.d(t,{R:function(){return A}});var n=r(18680),i=r(87170),o=r(9605),s=r(42036),a=r(23829),c=r(99321),l=r(33802),u=r(22754),d=r(83944),h=r(59449),p=r(20274),f=r(46001),g=r(30397),m=r(29607),y=r(43486),b=r(83764),w=r(25969);let v={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,user:void 0,preferredAccountType:void 0},C={caipNetwork:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},E=(0,n.sj)({chains:(0,i.Yr)(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{networkControllerClient:void 0,connectionControllerClient:void 0},isSwitchingNamespace:!1}),x={state:E,subscribe:e=>(0,n.Ld)(E,()=>{e(E)}),subscribeKey:(e,t)=>(0,i.VW)(E,e,t),subscribeChainProp(e,t,r){let i;return(0,n.Ld)(E.chains,()=>{let n=r||E.activeChain;if(n){let r=E.chains.get(n)?.[e];i!==r&&(i=r,t(r))}})},initialize(e,t,r){let{chainId:i,namespace:o}=l.M.getActiveNetworkProps(),s=t?.find(e=>e.id.toString()===i?.toString()),a=e.find(e=>e?.namespace===o)||e?.[0],c=e.map(e=>e.namespace).filter(e=>void 0!==e),u=new Set(m.OptionsController.state.enableEmbedded?[...c]:[...t?.map(e=>e.chainNamespace)??[]]);e?.length!==0&&a||(E.noAdapters=!0),!E.noAdapters&&(E.activeChain=a?.namespace,E.activeCaipNetwork=s,A.setChainNetworkData(a?.n
24amespace,{caipNetwork:s}),E.activeChain&&y.I.set({activeChain:a?.namespace})),u.forEach(e=>{let i=t?.filter(t=>t.chainNamespace===e),o=l.M.getPreferredAccountTypes()||{},s={...m.OptionsController.state.defaultAccountTypes,...o};A.state.chains.set(e,{namespace:e,networkState:(0,n.sj)({...C,caipNetwork:i?.[0]}),accountState:(0,n.sj)({...v,preferredAccountType:s[e]}),caipNetworks:i??[],...r}),A.setRequestedCaipNetworks(i??[],e)})},removeAdapter(e){if(E.activeChain===e){let t=Array.from(E.chains.entries()).find(([t])=>t!==e);if(t){let e=t[1]?.caipNetworks?.[0];e&&A.setActiveCaipNetwork(e)}}E.chains.delete(e)},addAdapter(e,{networkControllerClient:t,connectionControllerClient:r},n){if(!e.namespace)throw Error("ChainController:addAdapter - adapter must have a namespace");E.chains.set(e.namespace,{namespace:e.namespace,networkState:{...C,caipNetwork:n[0]},accountState:v,caipNetworks:n,connectionControllerClient:r,networkControllerClient:t}),A.setRequestedCaipNetworks(n?.filter(t=>t.chainNamespace===e.namespace)??[],e.namespace)},addNetwork(e){let t=E.chains.get(e.chainNamespace);if(t){let r=[...t.caipNetworks||[]];t.caipNetworks?.find(t=>t.id===e.id)||r.push(e),E.chains.set(e.chainNamespace,{...t,caipNetworks:r}),A.setRequestedCaipNetworks(r,e.chainNamespace),p.ConnectorController.filterByNamespace(e.chainNamespace,!0)}},removeNetwork(e,t){let r=E.chains.get(e);if(r){let n=E.activeCaipNetwork?.id===t,i=[...r.caipNetworks?.filter(e=>e.id!==t)||[]];n&&r?.caipNetworks?.[0]&&A.setActiveCaipNetwork(r.caipNetworks[0]),E.chains.set(e,{...r,caipNetworks:i}),A.setRequestedCaipNetworks(i||[],e),0===i.length&&p.ConnectorController.filterByNamespace(e,!1)}},setAdapterNetworkState(e,t){let r=E.chains.get(e);r&&(r.networkState={...r.networkState||C,...t},E.chains.set(e,r))},setChainAccountData(e,t,r=!0){if(!e)throw Error("Chain is required to update chain account data");let n=E.chains.get(e);if(n){let r={...n.accountState||v,...t};E.chains.set(e,{...n,accountState:r}),(1===E.chains.size||E.activeChain===e)&&(t.caipAddress&&(E.activeCaipAddress=t.caipAddress),d.AccountController.replaceState(r))}},setChainNetworkData(e,t){if(!e)return;let r=E.chains.get(e);if(r){let n={...r.networkState||C,...t};E.chains.set(e,{...r,networkState:n})}},setAccountProp(e,t,r,n=!0){A.setChainAccountData(r,{[e]:t},n)},setActiveNamespace(e){E.activeChain=e;let t=e?E.chains.get(e):void 0,r=t?.networkState?.caipNetwork;r?.id&&e&&(E.activeCaipAddress=t?.accountState?.caipAddress,E.activeCaipNetwork=r,A.setChainNetworkData(e,{caipNetwork:r}),l.M.setActiveCaipNetworkId(r?.caipNetworkId),y.I.set({activeChain:e,selectedNetworkId:r?.caipNetworkId}))},setActiveCaipNetwork(e){if(!e)return;E.activeChain!==e.chainNamespace&&A.setIsSwitchingNamespace(!0);let t=E.chains.get(e.chainNamespace);
24E.activeChain=e.chainNamespace,E.activeCaipNetwork=e,A.setChainNetworkData(e.chainNamespace,{caipNetwork:e}),t?.accountState?.address?E.activeCaipAddress=`${e.chainNamespace}:${e.id}:${t?.accountState?.address}`:E.activeCaipAddress=void 0,A.setAccountProp("caipAddress",E.activeCaipAddress,e.chainNamespace),t&&d.AccountController.replaceState(t.accountState),w.S.resetSend(),y.I.set({activeChain:E.activeChain,selectedNetworkId:E.activeCaipNetwork?.caipNetworkId}),l.M.setActiveCaipNetworkId(e.caipNetworkId),A.checkIfSupportedNetwork(e.chainNamespace)||!m.OptionsController.state.enableNetworkSwitch||m.OptionsController.state.allowUnsupportedChain||h.ConnectionController.state.wcBasic||A.showUnsupportedChainUI()},addCaipNetwork(e){if(!e)return;let t=E.chains.get(e.chainNamespace);t&&t?.caipNetworks?.push(e)},async switchActiveNamespace(e){if(!e)return;let t=e!==A.state.activeChain,r=A.getNetworkData(e)?.caipNetwork,n=A.getCaipNetworkByNamespace(e,r?.id);t&&n&&await A.switchActiveNetwork(n)},async switchActiveNetwork(e,{throwOnFailure:t=!1}={}){let r=A.state.activeChain;if(!r)throw Error("ChainController:switchActiveNetwork - namespace is required");let n=A.state.chains.get(r),i=!n?.caipNetworks?.some(e=>e.id===E.activeCaipNetwork?.id),o=A.getNetworkControllerClient(e.chainNamespace);if(o){try{await o.switchCaipNetwork(e),i&&g.I.close()}catch(e){if(t)throw e;b.RouterController.goBack()}f.X.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:e.caipNetworkId}})}},getNetworkControllerClient(e){let t=e||E.activeChain;if(!t)throw Error("ChainController:getNetworkControllerClient - chain is required");let r=E.chains.get(t);if(!r)throw Error("Chain adapter not found");if(!r.networkControllerClient)throw Error("NetworkController client not set");return r.networkControllerClient},getConnectionControllerClient(e){let t=e||E.activeChain;if(!t)throw Error("Chain is required to get connection controller client");let r=E.chains.get(t);if(!r?.connectionControllerClient)throw Error("ConnectionController client not set");return r.connectionControllerClient},getNetworkProp(e,t){let r=E.chains.get(t)?.networkState;if(r)return r[e]},getRequestedCaipNetworks(e){let t=E.chains.get(e),{approvedCaipNetworkIds:r=[],requestedCaipNetworks:n=[]}=t?.networkState||{};return c.j.sortRequestedNetworks(r,n).filter(e=>e?.id)},getAllRequestedCaipNetworks(){let e=[];return E.chains.forEach(t=>{if(!t.namespace)throw Error("ChainController:getAllRequestedCaipNetworks - chainAdapter must have a namespace");let r=A.getRequestedCaipNetworks(t.namespace);e.push(...r)}),e},setRequestedCaipNetworks(e,t){A.setAdapterNetworkState(t,{requestedCaipNetworks:e});let r=Array.from(new Set(A.getAllRequestedCaipNetworks().map(e=>e.chainNamespace)));p.ConnectorController.filterByNamespaces(r)},getAllApprovedCaipNetworkIds(){let e=[];return E.chains.forEach(t=>{if(!t.namespace)throw Error("ChainController:getAllApprovedCaipNetworkIds - chainAdapter must have a namespace");let r=A.getApprovedCaipNetworkIds(t.namespace);e.push(...r)}),e},getActiveCaipNetwork:e=>e?E.chains.get(e)?.networkState?.caipNetwork:E.activeCaipNetwork,getActiveCaipAddress:()=>E.activeCaipAddress,getApprovedCaipNetworkIds(e){let t=E.chains.get(e);return t?.networkState?.approvedCaipNetworkIds||[]},async setApprovedCaipNetworksData(e){let t=A.getNetworkControllerClient(),r=await t?.getApprovedCaipNetworksData();A.setAdapterNetworkState(e,{approvedCaipNetworkIds:r?.approvedCaipNetworkIds,supportsAllNetworks:r?.supportsAllNetworks})},checkIfSupportedNetwork(e,t){let r=t||E.activeCaipNetwork?.caipNetworkId,n=A.getRequestedCaipNetworks(e);return!n.length||n?.some(e=>e.caipNetworkId===r)},checkIfSupportedChainId(e){if(!E.activeChain)return!0;let t=A.getRequestedCaipNetworks(E.activeChain);return t?.some(t=>t.id===e)},setSmartAccountEnabledNetworks(e,t){A.setAdapterNetworkState(t,{smartAccountEnabledNetworks:e})},checkIfSmartAccountEnabled(){let e=o.p.caipNetworkIdToNumber(E.activeCaipNetwork?.caipNetworkId),t=E.activeChain;if(!t||!e)return!1;let r=A.getNetworkProp("smartAccountEnabledNetworks",t);return!!r?.includes(Number(e))},showUnsupportedChainUI(){g.I.open({view:"UnsupportedChain"})},checkIfNamesSupported(){let e=E.activeCaipNetwork;return!!(e?.chainNamespace&&a.bq.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(e.chainNamespace))},resetNetwork(e){A.setAdapterNetworkState(e,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})},resetAccount(e){if(!e)throw Error("Chain is required to set account prop");let t=A.state.chains.get(e)?.accountState?.preferredAccountType,r=m.OptionsController.state.defaultAccountTypes[e];E.activeCaipAddress=void 0,A.setChainAccountData(e,{smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol
24:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:r||t,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,user:void 0,status:"disconnected"}),p.ConnectorController.removeConnectorId(e)},setIsSwitchingNamespace(e){E.isSwitchingNamespace=e},getFirstCaipNetworkSupportsAuthConnector(){let e=[];if(E.chains.forEach(t=>{s.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>e===t.namespace)&&t.namespace&&e.push(t.namespace)}),e.length>0){let t=e[0];return t?E.chains.get(t)?.caipNetworks?.[0]:void 0}},getAccountData(e){let t=e||E.activeChain;if(t)return A.state.chains.get(t)?.accountState},getNetworkData(e){let t=e||E.activeChain;if(t)return A.state.chains.get(t)?.networkState},getCaipNetworkByNamespace(e,t){if(!e)return;let r=A.state.chains.get(e);return r?.caipNetworks?.find(e=>e.id===t)||r?.networkState?.caipNetwork||r?.caipNetworks?.[0]},getRequestedCaipNetworkIds(){let e=p.ConnectorController.state.filterByNamespace;return(e?[E.chains.get(e)]:Array.from(E.chains.values())).flatMap(e=>e?.caipNetworks||[]).map(e=>e.caipNetworkId)},getCaipNetworks:e=>e?A.getRequestedCaipNetworks(e):A.getAllRequestedCaipNetworks(),getCaipNetworkById:(e,t)=>x.getCaipNetworks(t).find(t=>t.id.toString()===e.toString()||t.caipNetworkId.toString()===e.toString()),setLastConnectedSIWECaipNetwork(e){E.lastConnectedSIWECaipNetwork=e},getLastConnectedSIWECaipNetwork:()=>E.lastConnectedSIWECaipNetwork},A=(0,u.P)(x)},59449:function(e,t,r){"use strict";let n;r.d(t,{ConnectionController:function(){return A}});var i=r(18680),o=r(87170),s=r(42036),a=r(77879),c=r(62250),l=r(95685),u=r(49854),d=r(83944),h=r(39674),p=r(20274),f=r(46001),g=r(30397),m=r(83764),y=r(23829),b=r(99321),w=r(33802);let v={checkNamespaceConnectorId:(e,t)=>p.ConnectorController.getConnectorId(e)===t,isSocialProvider:e=>y.bq.DEFAULT_REMOTE_FEATURES.socials.includes(e),connectWalletConnect:({walletConnect:e,connector:t,closeModalOnConnect:r=!0,redirectViewOnModalClose:n="Connect",onOpen:i,onConnect:o})=>new Promise((s,c)=>{if(e&&p.ConnectorController.setActiveConnector(t),i?.(b.j.isMobile()&&e),n){let e=g.I.subscribeKey("open",t=>{t||(m.RouterController.state.view!==n&&m.RouterController.replace(n),e(),c(Error("Modal closed")))})}let l=h.R.subscribeKey("activeCaipAddress",e=>{e&&(o?.(),r&&g.I.close(),l(),s(a.u.parseCaipAddress(e)))})}),connectExternal:e=>new Promise((t,r)=>{let n=h.R.subscribeKey("activeCaipAddress",e=>{e&&(g.I.close(),n(),t(a.u.parseCaipAddress(e)))});A.connectExternal(e,e.chain).catch(()=>{n(),r(Error("Connection rejected"))})}),connectSocial({social:e,namespace:t,closeModalOnConnect:r=!0,onOpenFarcaster:n,onConnect:i}){let o=d.AccountController.state.socialWindow,c=d.AccountController.state.socialProvider,l=!1,u=null,m=t||h.R.state.activeChain,y=h.R.subscribeKey("activeCaipAddress",e=>{e&&(r&&g.I.close(),y())});return new Promise((t,r)=>{async function y(e){if(e.data?.resultUri){if(e.origin===s.b.SECURE_SITE_SDK_ORIGIN){window.removeEventListener("message",y,!1);try{let n=p.ConnectorController.getAuthConnector(m);if(n&&!l){o&&(o.close(),d.AccountController.setSocialWindow(void 0,m),o=d.AccountController.state.socialWindow),l=!0;let i=e.data.resultUri;if(c&&f.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:c}}),c){w.M.setConnectedSocialProvider(c),await A.connectExternal({id:n.id,type:n.type,socialUri:i},n.chain);let e=h.R.state.activeCaipAddress;if(!e){r(Error("Failed to connect"));return}t(a.u.parseCaipAddress(e)),f.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:c}})}}}catch(e){c&&f.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:c}}),r(Error("Failed to connect"))}}else c&&f.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:c}})}}!async function(){if(e&&(d.AccountController.setSocialProvider(e,m),c=d.AccountController.state.socialProvider,f.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:c}})),"farcaster"===c){n?.();let t=g.I.subscribeKey("open",n=>{n||"farcaster"!==e||(r(Error("Popup closed")),i?.(),t())}),o=p.ConnectorController.getAuthConnector();if(o&&!d.AccountController.state.farcasterUrl)try{let{url:e}=await o.provider.getFarcasterUri();d.AccountController.setFarcasterUrl(e,m)}catch{r(Error("Failed to connect to farcaster"))}}else{let e=p.ConnectorController.getAuthConnector();u=b.j.returnOpenHref(`${s.b.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes");try{if(e&&c){let{uri:t}=await e.provider.getSocialRedirectUri({provider:c});if(u&&t){d.AccountController.setSocialWindow(u,m),o=d.AccountController.state.socialWindow,u.location.href=t;let e=setInterval(()=>{o?.closed&&!l&&(r(Error("Popup closed")),clearInterval(e))},1e3);window.addEventListener("message",y,!1)}else u?.close(),r(Error("Failed to initiate social connection"))}}catch{r(Error("Failed to initiate social connection")),u?.close()}}}()})},connectEmail:({closeModalOnConnect:e=!0,redirectViewOnModalClose:t="Connect",onOpen:r,onConnect:n})=>new Promise((i,o)=>
24{if(r?.(),t){let e=g.I.subscribeKey("open",r=>{r||(m.RouterController.state.view!==t&&m.RouterController.replace(t),e(),o(Error("Modal closed")))})}let s=h.R.subscribeKey("activeCaipAddress",t=>{t&&(n?.(),e&&g.I.close(),s(),i(a.u.parseCaipAddress(t)))})}),async updateEmail(){let e=w.M.getConnectedConnectorId(h.R.state.activeChain),t=p.ConnectorController.getAuthConnector();if(!t)throw Error("No auth connector found");if(e!==s.b.CONNECTOR_ID.AUTH)throw Error("Not connected to email or social");let r=t.provider.getEmail()??"";return await g.I.open({view:"UpdateEmailWallet",data:{email:r,redirectView:void 0}}),new Promise((e,n)=>{let i=setInterval(()=>{let n=t.provider.getEmail()??"";n!==r&&(g.I.close(),clearInterval(i),o(),e({email:n}))},1e3),o=g.I.subscribeKey("open",e=>{e||("Connect"!==m.RouterController.state.view&&m.RouterController.push("Connect"),clearInterval(i),o(),n(Error("Modal closed")))})})},canSwitchToSmartAccount:e=>h.R.checkIfSmartAccountEnabled()&&(0,c.r9)(e)===u.y_.ACCOUNT_TYPES.EOA};var C=r(22754),E=r(52781);let x=(0,i.sj)({connections:new Map,recentConnections:new Map,isSwitchingConnection:!1,wcError:!1,buffering:!1,status:"disconnected"}),A=(0,C.P)({state:x,subscribe:e=>(0,i.Ld)(x,()=>e(x)),subscribeKey:(e,t)=>(0,o.VW)(x,e,t),_getClient:()=>x._client,setClient(e){x._client=(0,i.iH)(e)},initialize(e){let t=e.filter(e=>!!e.namespace).map(e=>e.namespace);A.syncStorageConnections(t)},syncStorageConnections(e){let t=w.M.getConnections();for(let r of e??Array.from(h.R.state.chains.keys())){let e=t[r]??[],n=new Map(x.recentConnections);n.set(r,e),x.recentConnections=n}},getConnections:e=>e?x.connections.get(e)??[]:[],hasAnyConnection:e=>Array.from(A.state.connections.values()).flatMap(e=>e).some(({connectorId:t})=>t===e),async connectWalletConnect({cache:e="auto"}={}){let t=b.j.isTelegram()||b.j.isSafari()&&b.j.isIos();if("always"===e||"auto"===e&&t){if(n){await n,n=void 0;return}if(!b.j.isPairingExpired(x?.wcPairingExpiry)){let e=x.wcUri;x.wcUri=e;return}n=A._getClient()?.connectWalletConnect?.().catch(()=>void 0),A.state.status="connecting",await n,n=void 0,x.wcPairingExpiry=void 0,A.state.status="connected"}else await A._getClient()?.connectWalletConnect?.()},async connectExternal(e,t,r=!0){let n=await A._getClient()?.connectExternal?.(e);return r&&h.R.setActiveNamespace(t),n},async reconnectExternal(e){await A._getClient()?.reconnectExternal?.(e);let t=e.chain||h.R.state.activeChain;t&&p.ConnectorController.setConnectorId(e.id,t)},async setPreferredAccountType(e,t){if(!t)return;g.I.setLoading(!0,h.R.state.activeChain);let r=p.ConnectorController.getAuthConnector();r&&(d.AccountController.setPreferredAccountType(e,t),await r.provider.setPreferredAccount(e),w.M.setPreferredAccountTypes(Object.entries(h.R.state.chains).reduce((e,[t,r])=>{let n=(0,c.r9)(t);return void 0!==n&&(e[t]=n),e},{})),await A.reconnectExternal(r),g.I.setLoading(!1,h.R.state.activeChain),f.X.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:e,network:h.R.state.activeCaipNetwork?.caipNetworkId||""}}))},signMessage:async e=>A._getClient()?.signMessage(e),parseUnits:(e,t)=>A._getClient()?.parseUnits(e,t),formatUnits:(e,t)=>A._getClient()?.formatUnits(e,t),updateBalance:e=>A._getClient()?.updateBalance(e),sendTransaction:async e=>A._getClient()?.sendTransaction(e),getCapabilities:async e=>A._getClient()?.getCapabilities(e),grantPermissions:async e=>A._getClient()?.grantPermissions(e),walletGetAssets:async e=>A._getClient()?.walletGetAssets(e)??{},estimateGas:async e=>A._getClient()?.estimateGas(e),writeContract:async e=>A._getClient()?.writeContract(e),getEnsAddress:async e=>A._getClient()?.getEnsAddress(e),getEnsAvatar:async e=>A._getClient()?.getEnsAvatar(e),checkInstalled:e=>A._getClient()?.checkInstalled?.(e)||!1,resetWcConnection(){x.wcUri=void 0,x.wcPairingExpiry=void 0,x.wcLinking=void 0,x.recentWallet=void 0,x.status="disconnected",E.s.resetTransactions(),w.M.deleteWalletConnectDeepLink()},resetUri(){x.wcUri=void 0,x.wcPairingExpiry=void 0,n=void 0},finalizeWcConnection(e){let{wcLinking:t,recentWallet:r}=A.state;t&&w.M.setWalletConnectDeepLink(t),r&&w.M.setAppKitRecent(r),e&&f.X.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:e,properties:{method:t?"mobile":"qrcode",name:m.RouterController.state.data?.wallet?.name||"Unknown"}})},setWcBasic(e){x.wcBasic=e},setUri(e){x.wcUri=e,x.wcPairingExpiry=b.j.getPairingExpiry()},setWcLinking(e){x.wcLinking=e},setWcError(e){x.wcError=e,x.buffering=!1},setRecentWallet(e){x.recentWallet=e},setBuffering(e){x.buffering=e},setStatus(e){x.status=e},setIsSwitchingConnection(e){x.isSwitchingConnection=e},async disconnect({id:e,namespace:t,initialDisconnect:r}={}){try{await A._getClient()?.disconnect({id:e,chainNamespace:t,initialDisconnect:r})}catch(e){throw new C.g("Failed to disconnect","INTERNAL_SDK_ERROR",e)}},setConnections(e,t){let r=new Map(x.connections);r.set(t,e),x.connections=r},async handleAuthAccountSwitch({address:e,namespace:t}){let r=d.AccountController.state.user?.accounts?.find(e=>"smartAccount"===e.type),n=r&&r.address.toLowerCase()===e.toLowerCase()&&v.canSwitchToSmartAccount(t)?"smartAccount":"eoa";await A.setPreferredAccountType(n,t)},async handleActiveConnection({connection:e,namespace:t,address:r}){let n=p.ConnectorController.getConnectorById(e.connectorId),i=e.connectorId===s.b.CONNECTOR_ID.AUTH;if(!n)throw Error(`No connector found for connection: ${e.connectorId}`);if(i)i&&r&&await A.handleAuthAccountSwitch({address:r,namespace:t});else{let e=await A.connectExternal({id:n.id,type:n.type,provider:n.provider,address:r,chain:t},t);return e?.address}return r},async handleDisconnectedConnection({connection:e,namespace:t,address:r,closeModalOnConnect:n}){let i;let o=p.ConnectorController.getConnectorById(e.connectorId),a=e.auth?.name?.toLowerCase(),c=e.connectorId===s.b.CONNECTOR_ID.AUTH,l=e.connectorId===s.b.CONNECTOR_ID.WALLET_CONNECT;if(!o)throw Error(`No connector found for connection: ${e.connectorId}`);if(c){if(a&&v.isSocialProvider(a)){let{address:e}=await v.connectSocial({social:a,closeModalOnConnect:n,onOpenFarcaster(){g.I.open({view:"ConnectingFarcaster"})},onConnect(){m.RouterController.replace("ProfileWallets")}});i=e}else{let{address:e}=await v.connectEmail({closeModalOnConnect:n,onOpen(){g.I.open({view:"EmailLogin"})},onConnect(){m.RouterController.replace("ProfileWallets")}});i=e}}else if(l){let{address:e}=await v.connectWalletConnect({walletConnect:!0,connector:o,closeModalOnConnect:n,onOpen(e){let t=e?"AllWallets":"ConnectingWalletConnect";g.I.state.open?m.RouterController.push(t):g.I.open({view:t})},onConnect(){m.RouterController.replace("ProfileWallets")}});i=e}else{let e=await A.connectExternal({id:o.id,type:o.type,provider:o.provider,chain:t},t);e&&(i=e.address)}return c&&r&&await A.handleAuthAccountSwitch({address:r,namespace:t}),i},async switchConnection({connection:e,address:t,namespace:r,closeModalOnConnect:n,onChange:i}){let o;let s=d.AccountController.getCaipAddress(r);if(s){let{address:e}=a.u.parseCaipAddress(s);o=e}let c=l.f.getConnectionStatus(e,r);switch(c){case"connected":case"active":{let n=await A.handleActiveConnection({connection:e,namespace:r,address:t});if(o&&n){let e=n.toLowerCase()!==o.toLowerCase();i?.({address:n,namespace:r,hasSwitchedAccount:e,hasSwitchedWallet:"active"===c})}break}case"disconnected":{let o=await A.handleDisconnectedConnection({connection:e,namespace:r,address:t,closeModalOnConnect:n});o&&i?.({address:o,namespace:r,hasSwitchedAccount:!0,hasSwitchedWallet:!0});break}default:throw Error(`Invalid connection status: ${c}`)}}})},20274:function(e,t,r){"use strict";r.d(t,{ConnectorController:function(){return C}});var n=r(18680),i=r(87170),o=r(9605),s=r(42036),a=r(79649),c=r(49854),l=r(62250),u=r(30353),d=r(33802),h=r(22754),p=r(84270),f=r(39674),g=r(29607),m=r(83764),y=r(35763);let b=Object.fromEntries(o.F.map(e=>[e,void 0])),w=Object.fromEntries(o.F.map(e=>[e,!0])),v=(0,n.sj)({allConnectors:[],connectors:[],activeConnector:void 0,filterByNamespace:void 0,activeConnectorIds:b,filterByNamespaceMap:w}),C=(0,h.P)({state:v,subscribe:e=>(0,n.Ld)(v,()=>{e(v)}),subscribeKey:(e,t)=>
24(0,i.VW)(v,e,t),initialize(e){e.forEach(e=>{let t=d.M.getConnectedConnectorId(e);t&&C.setConnectorId(t,e)})},setActiveConnector(e){e&&(v.activeConnector=(0,n.iH)(e))},setConnectors(e){e.filter(e=>!v.allConnectors.some(t=>t.id===e.id&&C.getConnectorName(t.name)===C.getConnectorName(e.name)&&t.chain===e.chain)).forEach(e=>{"MULTI_CHAIN"!==e.type&&v.allConnectors.push((0,n.iH)(e))});let t=C.getEnabledNamespaces(),r=C.getEnabledConnectors(t);v.connectors=C.mergeMultiChainConnectors(r)},filterByNamespaces(e){Object.keys(v.filterByNamespaceMap).forEach(e=>{v.filterByNamespaceMap[e]=!1}),e.forEach(e=>{v.filterByNamespaceMap[e]=!0}),C.updateConnectorsForEnabledNamespaces()},filterByNamespace(e,t){v.filterByNamespaceMap[e]=t,C.updateConnectorsForEnabledNamespaces()},updateConnectorsForEnabledNamespaces(){let e=C.getEnabledNamespaces(),t=C.getEnabledConnectors(e),r=C.areAllNamespacesEnabled();v.connectors=C.mergeMultiChainConnectors(t),r?p.ApiController.clearFilterByNamespaces():p.ApiController.filterByNamespaces(e)},getEnabledNamespaces:()=>Object.entries(v.filterByNamespaceMap).filter(([e,t])=>t).map(([e])=>e),getEnabledConnectors:e=>v.allConnectors.filter(t=>e.includes(t.chain)),areAllNamespacesEnabled:()=>Object.values(v.filterByNamespaceMap).every(e=>e),mergeMultiChainConnectors(e){let t=C.generateConnectorMapByName(e),r=[];return t.forEach(e=>{let t=e[0],n=t?.id===s.b.CONNECTOR_ID.AUTH;e.length>1&&t?r.push({name:t.name,imageUrl:t.imageUrl,imageId:t.imageId,connectors:[...e],type:n?"AUTH":"MULTI_CHAIN",chain:"eip155",id:t?.id||""}):t&&r.push(t)}),r},generateConnectorMapByName(e){let t=new Map;return e.forEach(e=>{let{name:r}=e,n=C.getConnectorName(r);if(!n)return;let i=t.get(n)||[];
24i.find(t=>t.chain===e.chain)||i.push(e),t.set(n,i)}),t},getConnectorName:e=>e&&({"Trust Wallet":"Trust"})[e]||e,getUniqueConnectorsByName(e){let t=[];return e.forEach(e=>{t.find(t=>t.chain===e.chain)||t.push(e)}),t},addConnector(e){if(e.id===s.b.CONNECTOR_ID.AUTH){let t=(0,n.CO)(g.OptionsController.state),r=y.ThemeController.getSnapshot().themeMode,i=y.ThemeController.getSnapshot().themeVariables;e?.provider?.syncDappData?.({metadata:t.metadata,sdkVersion:t.sdkVersion,projectId:t.projectId,sdkType:t.sdkType}),e?.provider?.syncTheme({themeMode:r,themeVariables:i,w3mThemeVariables:a.t(i,r)}),C.setConnectors([e])}else C.setConnectors([e])},getAuthConnector(e){let t=e||f.R.state.activeChain,r=v.connectors.find(e=>e.id===s.b.CONNECTOR_ID.AUTH);return r?r?.connectors?.length?r.connectors.find(e=>e.chain===t):r:void 0},getAnnouncedConnectorRdns:()=>v.connectors.filter(e=>"ANNOUNCED"===e.type).map(e=>e.info?.rdns),getConnectorById:e=>v.allConnectors.find(t=>t.id===e),getConnector({id:e,rdns:t,namespace:r}){let n=r||f.R.state.activeChain;return v.allConnectors.filter(e=>e.chain===n).find(r=>r.explorerId===e||r.info?.rdns===t)},syncIfAuthConnector(e){if("ID_AUTH"!==e.id)return;let t=(0,n.CO)(g.OptionsController.state),r=y.ThemeController.getSnapshot().themeMode,i=y.ThemeController.getSnapshot().themeVariables;e?.provider?.syncDappData?.({metadata:t.metadata,sdkVersion:t.sdkVersion,sdkType:t.sdkType,projectId:t.projectId}),e.provider.syncTheme({themeMode:r,themeVariables:i,w3mThemeVariables:(0,a.t)(i,r)})},getConnectorsByNamespace(e){let t=v.allConnectors.filter(t=>t.chain===e);return C.mergeMultiChainConnectors(t)},canSwitchToSmartAccount:e=>f.R.checkIfSmartAccountEnabled()&&(0,l.r9)(e)===c.y_.ACCOUNT_TYPES.EOA,selectWalletConnector(e){let t=C.getConnector({id:e.id,rdns:e.rdns});u.R.handleMobileDeeplinkRedirect(t?.explorerId||e.id,f.R.state.activeChain),t?m.RouterController.push("ConnectingExternal",{connector:t,wallet:e}):m.RouterController.push("ConnectingWalletConnect",{wallet:e})},getConnectors:e=>e?C.getConnectorsByNamespace(e):C.mergeMultiChainConnectors(v.allConnectors),setFilterByNamespace(e){v.filterByNamespace=e,v.connectors=C.getConnectors(e),p.ApiController.setFilterByNamespace(e)},setConnectorId(e,t){e&&(v.activeConnectorIds={...v.activeConnectorIds,[t]:e},d.M.setConnectedConnectorId(t,e))},removeConnectorId(e){v.activeConnectorIds={...v.activeConnectorIds,[e]:void 0},d.M.deleteConnectedConnectorId(e)},getConnectorId(e){if(e)return v.activeConnectorIds[e]},isConnected:e=>e?!!v.activeConnectorIds[e]:Object.values(v.activeConnectorIds).some(e=>!!e),resetConnectorIds(){v.activeConnectorIds={...b}}})},26330:function(e,t,r){"use strict";r.d(t,{a:function(){return g}});var n=r(18680),i=r(87170);let o={convertEVMChainIdToCoinType(e){if(e>=2147483648)throw Error("Invalid chainId");return(2147483648|e)>>>0}};var s=r(33802),a=r(22754),c=r(83944),l=r(69199),u=r(39674),d=r(59449),h=r(20274),p=r(83764);let f=(0,n.sj)({suggestions:[],loading:!1}),g=(0,a.P)({state:f,subscribe:e=>(0,n.Ld)(f,()=>e(f)),subscribeKey:(e,t)=>(0,i.VW)(f,e,t),async resolveName(e){try{return await l.L.lookupEnsName(e)}catch(e){throw Error(e?.reasons?.[0]?.description||"Error resolving name")}},async isNameRegistered(e){try{return await l.L.lookupEnsName(e),!0}catch{return!1}},async getSuggestions(e){try{f.loading=!0,f.suggestions=[];let t=await l.L.getEnsNameSuggestions(e);return f.suggestions=t.suggestions||[],f.suggestions}catch(e){throw Error(g.parseEnsApiError(e,"Error fetching name suggestions"))}finally{f.loading=!1}},async getNamesForAddress(e){try{if(!u.R.state.activeCaipNetwork)return[];let t=s.M.getEnsFromCacheForAddress(e);if(t)return t;let r=await l.L.reverseLookupEnsName({address:e});return s.M.updateEnsCache({address:e,ens:r,timestamp:Date.now()}),r}catch(e){throw Error(g.parseEnsApiError(e,"Error fetching names for address"))}},async registerName(e){let t=u.R.state.activeCaipNetwork,r=c.AccountController.state.address,n=h.ConnectorController.getAuthConnector();if(!t)throw Error("Network not found");if(!r||!n)throw Error("Address or auth connector not found");f.loading=!0;try{let n=JSON.stringify({name:e,attributes:{},timestamp:Math.floor(Date.now()/1e3)});p.RouterController.pushTransactionStack({onCancel(){p.RouterController.replace("RegisterAccountName")}});let i=await d.ConnectionController.signMessage(n);f.loading=!1;let a=t.id;if(!a)throw Error("Network not found");let u=o.convertEVMChainIdToCoinType(Number(a));await l.L.registerEnsName({coinType:u,address:r,signature:i,message:n}),c.AccountController.setProfileName(e,t.chainNamespace),s.M.updateEnsCache({address:r,ens:[{name:e,registered_at:new Date().toISOString(),updated_at:void 0,addresses:{},attributes:[]}],timestamp:Date.now()}),p.RouterController.replace("RegisterAccountNameSuccess")}catch(r){let t=g.parseEnsApiError(r,`Error registering name ${e}`);throw p.RouterController.replace("RegisterAccountName"),Error(t)}finally{f.loading=!1}},validateName:e=>/^[a-zA-Z0-9-]{4,}$/u.test(e),parseEnsApiError:(e,t)=>
24e?.reasons?.[0]?.description||t})},46001:function(e,t,r){"use strict";r.d(t,{X:function(){return p}});var n=r(18680),i=r(99321),o=r(54958),s=r(83944),a=r(39674),c=r(29607);let l=i.j.getAnalyticsUrl(),u=new o.V({baseUrl:l,clientId:null}),d=["MODAL_CREATED"],h=(0,n.sj)({timestamp:Date.now(),reportedErrors:{},data:{type:"track",event:"MODAL_CREATED"},pendingEvents:[],subscribedToVisibilityChange:!1}),p={state:h,subscribe:e=>(0,n.Ld)(h,()=>e(h)),getSdkProperties(){let{projectId:e,sdkType:t,sdkVersion:r}=c.OptionsController.state;return{projectId:e,st:t,sv:r||"html-wagmi-4.2.2"}},_setPendingEvent(e){try{let t=s.AccountController.state.address;if("address"in e.data&&e.data.address&&(t=e.data.address),d.includes(e.data.event)||"undefined"==typeof window)return;let r=a.R.getActiveCaipNetwork()?.caipNetworkId;this.state.pendingEvents.push({eventId:i.j.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:e.timestamp,props:{...e.data,address:t,properties:{..."properties"in e.data?e.data.properties:{},caipNetworkId:r}}}),h.reportedErrors.FORBIDDEN=!1,JSON.stringify(h.pendingEvents).length/1024>45&&p._submitPendingEvents()}catch(e){console.warn("_setPendingEvent",e)}},sendEvent(e){h.timestamp=Date.now(),h.data=e,(c.OptionsController.state.features?.anal
24ytics||["INITIALIZE","CONNECT_SUCCESS","SOCIAL_LOGIN_SUCCESS"].includes(e.event))&&p._setPendingEvent(h),this._subscribeToVisibilityChange()},_submitPendingEvents(){if(0!==h.pendingEvents.length)try{u.sendBeacon({path:"/batch",params:p.getSdkProperties(),body:h.pendingEvents}),h.reportedErrors.FORBIDDEN=!1,h.pendingEvents=[]}catch(e){h.reportedErrors.FORBIDDEN=!0}},_subscribeToVisibilityChange(){h.subscribedToVisibilityChange||"undefined"==typeof document||(h.subscribedToVisibilityChange=!0,document?.addEventListener?.("visibilitychange",()=>{"hidden"===document.visibilityState&&p._submitPendingEvents()}))}}},30397:function(e,t,r){"use strict";r.d(t,{I:function(){return y}});var n=r(18680),i=r(87170),o=r(99321),s=r(26662),a=r(22754),c=r(84270),l=r(39674),u=r(59449),d=r(20274),h=r(46001),p=r(29607),f=r(43486),g=r(83764);let m=(0,n.sj)({loading:!1,loadingNamespaceMap:new Map,open:!1,shake:!1,namespace:void 0}),y=(0,a.P)({state:m,subscribe:e=>(0,n.Ld)(m,()=>e(m)),subscribeKey:(e,t)=>(0,i.VW)(m,e,t),async open(e){let t=e?.namespace,r=l.R.state.activeChain,n=t&&t!==r,i=l.R.getAccountData(e?.namespace)?.caipAddress,a=l.R.state.noAdapters;if(u.ConnectionController.state.wcBasic?c.ApiController.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1}):await c.ApiController.prefetch(),d.ConnectorController.setFilterByNamespace(e?.namespace),y.setLoading(!0,t),t&&n){let e=l.R.getNetworkData(t)?.caipNetwork||l.R.getRequestedCaipNetworks(t)[0];e&&(a?(await l.R.switchActiveNetwork(e),g.RouterController.push("ConnectingWalletConnectBasic")):s.p.onSwitchNetwork({network:e,ignoreSwitchConfirmation:!0}))}else p.OptionsController.state.manualWCControl||a&&!i?o.j.isMobile()?g.RouterController.reset("AllWallets"):g.RouterController.reset("ConnectingWalletConnectBasic"):e?.view?g.RouterController.reset(e.view,e.data):i?g.RouterController.reset("Account"):g.RouterController.reset("Connect");m.open=!0,f.I.set({open:!0}),h.X.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!i}})},close(){let e=p.OptionsController.state.enableEmbedded,t=!!l.R.state.activeCaipAddress;m.open&&h.X.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:t}}),m.open=!1,g.RouterController.reset("Connect"),y.clearLoading(),e?t?g.RouterController.replace("Account"):g.RouterController.push("Connect"):f.I.set({open:!1}),u.ConnectionController.resetUri()},setLoading(e,t){t&&m.loadingNamespaceMap.set(t,e),m.loading=e,f.I.set({loading:e})},clearLoading(){m.loadingNamespaceMap.clear(),m.loading=!1,f.I.set({loading:!1})},shake(){m.shake||(m.shake=!0,setTimeout(()=>{m.shake=!1},500))}})},61253:function(e,t,r){"use strict";r.d(t,{ph:function(){return m}});var n=r(18680),i=r(87170),o=r(42036),s=r(23829),a=r(22754),c=r(84270),l=r(69199),u=r(39674),d=r(29607);let h={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},p={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},f={providers:s.gy,selectedProvider:null,error:null,purchaseCurrency:h,paymentCurrency:p,purchaseCurrencies:[h],paymentCurrencies:[],quotesLoading:!1},g=(0,n.sj)(f),m=(0,a.P)({state:g,subscribe:e=>(0,n.Ld)(g,()=>e(g)),subscribeKey:(e,t)=>(0,i.VW)(g,e,t),setSelectedProvider(e){if(e&&"meld"===e.name){let t=u.R.state.activeChain,r=t===o.b.CHAIN.SOLANA?"SOL":"USDC",n=t?u.R.state.chains.get(t)?.accountState?.address??"":"",i=new URL(e.url);i.searchParams.append("publicKey",s.a$),i.searchParams.append("destinationCurrencyCode",r),i.searchParams.append("walletAddress",n),i.searchParams.append("externalCustomerId",d.OptionsController.state.projectId),g.selectedProvider={...e,url:i.toString()}}else g.selectedProvider=e},setOnrampProviders(e){if(Array.isArray(e)&&e.every(e=>"string"==typeof e)){let t=s.gy.filter(t=>e.includes(t.name));g.providers=t}else g.providers=[]},setPurchaseCurrency(e){g.purchaseCurrency=e},setPaymentCurrency(e){g.paymentCurrency=e},setPurchaseAmount(e){m.state.purchaseAmount=e},setPaymentAmount(e){m.state.paymentAmount=e},async getAvailableCurrencies(){let e=await l.L.getOnrampOptions();g.purchaseCurrencies=e.purchaseCurrencies,g.paymentCurrencies=e.paymentCurrencies,g.paymentCurrency=e.paymentCurrencies[0]||p,g.purchaseCurrency=e.purchaseCurrencies[0]||h,await c.ApiController.fetchCurrencyImages(e.paymentCurrencies.map(e=>e.id)),await c.ApiController.fetchTokenImages(e.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){g.quotesLoading=!0;try{let e=await l.L.getOnrampQuote({purchaseCurrency:g.purchaseCurrency,paymentCurrency:g.paymentCurrency,amount:g.paymentAmount?.toString()||"0",network:g.purchaseCurrency?.symbol});return g.quotesLoading=!1,g.purchaseAmount=Number(e?.purchaseAmount.amount),e}catch(e){return g.error=e.message,g.quotesLoading=!1,null}finally{g.quotesLoading=!1}},resetState(){g.selectedProvider=null,g.error=null,g.purchaseCurrency=h,g.paymentCurrency=p,g.purchaseCurrencies=[h],g.paymentCurrencies=[],g.paymentAmount=void 0,g.purchaseAmount=void 0,g.quotesLoading=!1}})}
24,29607:function(e,t,r){"use strict";r.d(t,{OptionsController:function(){return l}});var n=r(18680),i=r(87170),o=r(23829),s=r(99321);let a={getFeatureValue(e,t){let r=t?.[e];return void 0===r?o.bq.DEFAULT_FEATURES[e]:r},filterSocialsByPlatform(e){if(!e||!e.length)return e;if(s.j.isTelegram()){if(s.j.isIos())return e.filter(e=>"google"!==e);if(s.j.isMac())return e.filter(e=>"x"!==e);if(s.j.isAndroid())return e.filter(e=>!["facebook","x"].includes(e))}return e}},c=(0,n.sj)({features:o.bq.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined",defaultAccountTypes:o.bq.DEFAULT_ACCOUNT_TYPES,enableNetworkSwitch:!0,experimental_preferUniversalLinks:!1,remoteFeatures:{}}),l={state:c,subscribeKey:(e,t)=>(0,i.VW)(c,e,t),setOptions(e){Object.assign(c,e)},setRemoteFeatures(e){if(!e)return;let t={...c.remoteFeatures,...e};c.remoteFeatures=t,c.remoteFeatures?.socials&&(c.remoteFeatures.socials=a.filterSocialsByPlatform(c.remoteFeatures.socials)),c.features?.pay&&(c.remoteFeatures.email=!1,c.remoteFeatures.socials=!1)},setFeatures(e){if(!e)return;c.features||(c.features=o.bq.DEFAULT_FEATURES);let t={...c.features,...e};c.features=t,c.features?.pay&&c.remoteFeatures&&(c.remoteFeatures.email=!1,c.remoteFeatures.socials=!1)},setProjectId(e){c.projectId=e},setCustomRpcUrls(e){c.customRpcUrls=e},setAllWallets(e){c.allWallets=e},setIncludeWalletIds(e){c.includeWalletIds=e},setExcludeWalletIds(e){c.excludeWalletIds=e},setFeaturedWalletIds(e){c.featuredWalletIds=e},setTokens(e){c.tokens=e},setTermsConditionsUrl(e){c.termsConditionsUrl=e},setPrivacyPolicyUrl(e){c.privacyPolicyUrl=e},setCustomWallets(e){c.customWallets=e},setIsSiweEnabled(e){c.isSiweEnabled=e},setIsUniversalProvider(e){c.isUniversalProvider=e},setSdkVersion(e){c.sdkVersion=e},setMetadata(e){c.metadata=e},setDisableAppend(e){c.disableAppend=e},setEIP6963Enabled(e){c.enableEIP6963=e},setDebug(e){c.debug=e},setEnableWalletConnect(e){c.enableWalletConnect=e},setEnableWalletGuide(e){c.enableWalletGuide=e},setEnableAuthLogger(e){c.enableAuthLogger=e},setEnableWallets(e){c.enableWallets=e},setPreferUniversalLinks(e){c.experimental_preferUniversalLinks=e},setSIWX(e){if(e)for(let[t,r]of Object.entries(o.bq.SIWX_DEFAULTS))e[t]??=r;c.siwx=e},setConnectMethodsOrder(e){c.features={...c.features,connectMethodsOrder:e}},setWalletFeaturesOrder(e){c.features={...c.features,walletFeaturesOrder:e}},setSocialsOrder(e){c.remoteFeatures={...c.remoteFeatures,socials:e}},setCollapseWallets(e){c.features={...c.features,collapseWallets:e}},setEnableEmbedded(e){c.enableEmbedded=e},setAllowUnsupportedChain(e){c.allowUnsupportedChain=e},setManualWCControl(e){c.manualWCControl=e},setEnableNetworkSwitch(e){c.enableNetworkSwitch=e},setEnableReconnect(e){c.enableReconnect=e},setDefaultAccountTypes(e={}){Object.entries(e).forEach(([e,t])=>{t&&(c.defaultAccountTypes[e]=t)})},setUniversalProviderConfigOverride(e){c.universalProviderConfigOverride=e},getUniversalProviderConfigOverride:()=>c.universalProviderConfigOverride,getSnapshot:()=>(0,n.CO)(c)}},13387:function(e,t,r){"use strict";r.d(t,{M:function(){return s}});var n=r(18680),i=r(87170);let o=(0,n.sj)({isLegalCheckboxChecked:!1}
24),s={state:o,subscribe:e=>(0,n.Ld)(o,()=>e(o)),subscribeKey:(e,t)=>(0,i.VW)(o,e,t),setIsLegalCheckboxChecked(e){o.isLegalCheckboxChecked=e}}},87811:function(e,t,r){"use strict";r.d(t,{O:function(){return a}});var n=r(18680),i=r(87170);let o={eip155:void 0,solana:void 0,polkadot:void 0,bip122:void 0,cosmos:void 0,sui:void 0,stacks:void 0},s=(0,n.sj)({providers:{...o},providerIds:{...o}}),a={state:s,subscribeKey:(e,t)=>(0,i.VW)(s,e,t),subscribe:e=>(0,n.Ld)(s,()=>{e(s)}),subscribeProviders:e=>(0,n.Ld)(s.providers,()=>e(s.providers)),setProvider(e,t){e&&t&&(s.providers[e]=(0,n.iH)(t))},getProvider(e){if(e)return s.providers[e]},setProviderId(e,t){t&&(s.providerIds[e]=t)},getProviderId(e){if(e)return s.providerIds[e]},reset(){s.providers={...o},s.providerIds={...o}},resetChain(e){s.providers[e]=void 0,s.providerIds[e]=void 0}}},43486:function(e,t,r){"use strict";r.d(t,{I:function(){return s}});var n=r(18680),i=r(87170);let o=(0,n.sj)({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0,initialized:!1}),s={state:o,subscribe:e=>(0,n.Ld)(o,()=>e(o)),subscribeOpen:e=>(0,i.VW)(o,"open",e),set(e){Object.assign(o,{...o,...e})}}},83764:function(e,t,r){"use strict";r.d(t,{RouterController:function(){return h}});var n=r(18680),i=r(87170),o=r(22754),s=r(83944),a=r(39674),c=r(20274),l=r(30397),u=r(29607);let d=(0,n.sj)({view:"Connect",history:["Connect"],transactionStack:[]}),h=(0,o.P)({state:d,subscribeKey:(e,t)=>(0,i.VW)(d,e,t),pushTransactionStack(e){d.transactionStack.push(e)},popTransactionStack(e){let t=d.transactionStack.pop();if(!t)return;let{onSuccess:r,onError:n,onCancel:i}=t;switch(e){case"success":r?.();break;case"error":n?.(),h.goBack();break;case"cancel":i?.(),h.goBack()}},push(e,t){e!==d.view&&(d.view=e,d.history.push(e),d.data=t)},reset(e,t){d.view=e,d.history=[e],d.data=t},replace(e,t){d.history.at(-1)!==e&&(d.view=e,d.history[d.history.length-1]=e,d.data=t)},goBack(){let e=a.R.state.activeCaipAddress,t="ConnectingFarcaster"===h.state.view,r=!e&&t;if(d.history.length>1){d.history.pop();let[t]=d.history.slice(-1);t&&(e&&"Connect"===t?d.view="Account":d.view=t)}else l.I.close();d.data?.wallet&&(d.data.wallet=void 0),setTimeout(()=>{if(r){s.AccountController.setFarcasterUrl(void 0,a.R.state.activeChain);let e=c.ConnectorController.getAuthConnector();e?.provider?.reload();let t=(0,n.CO)(u.OptionsController.state);e?.provider?.syncDappData?.({metadata:t.metadata,sdkVersion:t.sdkVersion,projectId:t.projectId,sdkType:t.sdkType})}},100)},goBackToIndex(e){if(d.history.length>1){d.history=d.history.slice(0,e+1);let[t]=d.history.slice(-1);t&&(d.view=t)}},goBackOrCloseModal(){h.state.history.length>1?h.goBack():l.I.close()}})},25969:function(e,t,r){"use strict";r.d(t,{S:function(){return E}});var n=r(18680),i=r(87170),o=r(35529),s=r(42036),a=r(97875),c=r(49854),l=r(13565),u=r(62250),d=r(23829),h=r(99321),p=r(1553),f=r(22754),g=r(83944),m=r(39674),y=r(59449),b=r(46001),w=r(83764),v=r(65045);let C=(0,n.sj)({tokenBalances:[],loading:!1}),E=(0,f.P)({state:C,subscribe:e=>(0,n.Ld)(C,()=>e(C)),subscribeKey:(e,t)=>(0,i.VW)(C,e,t),setToken(e){e&&(C.token=(0,n.iH)(e))},setTokenAmount(e){C.sendTokenAmount=e},setReceiverAddress(e){C.receiverAddress=e},setReceiverProfileImageUrl(e){C.receiverProfileImageUrl=e},setReceiverProfileName(e){C.receiverProfileName=e},setNetworkBalanceInUsd(e){C.networkBalanceInUSD=e},setLoading(e){C.loading=e},async sendToken(){try{switch(E.setLoading(!0),m.R.state.activeCaipNetwork?.chainNamespace){case"eip155":await E.sendEvmToken();return;case"solana":await E.sendSolanaToken();return;default:throw Error("Unsupported chain")}}finally{E.setLoading(!1)}},async sendEvmToken(){let e=m.R.state.activeChain;if(!e)throw Error("SendController:sendEvmToken - activeChainNamespace is required");let t=(0,u.r9)(e);if(!E.state.sendTokenAmount||!E.state.receiverAddress)throw Error("An amount and receiver address are required");if(!E.state.token)throw Error("A token is required");if(E.state.token?.address){b.X.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:t===c.y_.ACCOUNT_TYPES.SMART_ACCOUNT,token:E.state.token.address,amount:E.state.sendTokenAmount,network:m.R.state.activeCaipNetwork?.caipNetworkId||""}});let{hash:e}=await E.sendERC20Token({receiverAddress:E.state.receiverAddress,tokenAddress:E.state.token.address,sendTokenAmount:E.state.sendTokenAmount,decimals:E.state.token.quantity.decimals});e&&(C.hash=e)}else{b.X.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:t===c.y_.ACCOUNT_TYPES.SMART_ACCOUNT,token:E.state.token.symbol||"",amount:E.state.sendTokenAmount,network:m.R.state.activeCaipNetwork?.caipNetworkId||""}});let{hash:e}=await E.sendNativeToken({receiverAddress:E.state.receiverAddress,sendTokenAmount:E.state.sendTokenAmount,decimals:E.state.token.quantity.decimals});e&&(C.hash=e)}},async fetchTokenBalance(e){C.loading=!0;let t=m.R.state.activeChain,r=m.R.state.activeCaipNetwork?.caipNetworkId,n=m.R.state.activeCaipNetwork?.chainNamespace,i=g.AccountController.getCaipAddress(t)??m.R.state.activeCaipAddress,o=i?h.j.getPlainAddress(i):void 0;if(C.lastRetry&&!h.j.isAllowedRetry(C.lastRetry,30*d.bq.ONE_SEC_MS))return C.loading=!1,[];try{if(o&&r&&n){let e=await l.Q.getMyTokensWithBalance();return C.tokenBalances=e,C.lastRetry=void 0,e}}catch(t){C.lastRetry=Date.now(),e?.(t),v.SnackController.showError("Token Balance Unavailable")}finally{C.loading=!1}return[]},fetchNetworkBalance(){if(0===C.tokenBalances.length)return;let e=p.n.mapBalancesToSwapTokens(C.tokenBalances);if(!e)return;let t=e.find(e=>e.address===(0,u.EO)());t&&(C.networkBalanceInUSD=t?o.C.multiply(t.quantity.numeric,t.price).toString():"0")},async sendNativeToken(e){w.RouterController.pushTransactionStack({});let t=e.receiverAddress,r=g.AccountController.state.address,n=y.ConnectionController.parseUnits(e.sendTokenAmount.toString(),Number(e.decimals)),i=await y.ConnectionController.sendTransaction({chainNamespace:s.b.CHAIN.EVM,to:t,address:r,data:"0x",value:n??BigInt(0)});return b.X.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:(0,u.r9)("eip155")===c.y_.ACCOUNT_TYPES.SMART_ACCOUNT,token:E.state.token?.symbol||"",amount:e.sendTokenAmount,network:m.R.state.activeCaipNetwork?.caipNetworkId||"",hash:i||""}}),y.ConnectionController._getClient()?.updateBalance("eip155"),E.resetSend(),{hash:i}},async sendERC20Token(e){w.RouterController.pushTransactionStack({onSuccess(){w.RouterController.replace("Account")}});let t=y.ConnectionController.parseUnits(e.sendTokenAmount.toString(),Number(e.decimals));if(g.AccountController.state.address&&e.sendTokenAmount&&e.receiverAddress&&e.tokenAddress){let r=h.j.getPlainAddress(e.tokenAddress);if(!r)throw Error("SendController:sendERC20Token - tokenAddress is required");let n=await y.ConnectionController.writeContract({fromAddress:g.AccountController.state.address,tokenAddress:r,args:[e.receiverAddress,t??BigInt(0)],method:"transfer",abi:a.g.getERC20Abi(r),chainNamespace:s.b.CHAIN.EVM});return b.X.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:(0,u.r9)("eip155")===c.y_.ACCOUNT_TYPES.SMART_ACCOUNT,token:E.state.token?.symbol||"",amount:e.sendTokenAmount,network:m.R.state.activeCaipNetwork?.caipNetworkId||"",hash:n||""}}),E.resetSend(),{hash:n}}return{hash:void 0}},async sendSolanaToken(){let e;if(!E.state.sendTokenAmount||!E.state.receiverAddress)throw Error("An amount and receiver address are required");w.RouterController.pushTransactionStack({onSuccess(){w.RouterController.replace("Account")}}),E.state.token&&E.state.token.address!==d.bq.SOLANA_NATIVE_TOKEN_ADDRESS&&(e=h.j.isCaipAddress(E.state.token.address)?h.j.getPlainAddress(E.state.token.address):E.state.token.address);let t=await y.ConnectionController.sendTransaction({chainNamespace:"solana",tokenMint:e,to:E.state.receiverAddress,value:E.state.sendTokenAmount});t&&(C.hash=t),y.ConnectionController._getClient()?.updateBalance("solana"),E.resetSend()},resetSend(){C.token=void 0,C.sendTokenAmount=void 0,C.receiverAddress=void 0,C.receiverProfileImageUrl=void 0,C.receiverProfileName=void 0,C.loading=!1,C.tokenBalances=[]}})},65045:function(e,t,r){"use strict";r.d(t,{SnackController:function(){return c}});var n=r(18680),i=r(87170),o=r(99321);let s=Object.freeze({message:"",variant:"success",svg:void 0,open:!1,autoClose:!0}),a=(0,n.sj)({...s}),c={state:a,subscribeKey:(e,t)=>(0,i.VW)(a,e,t),showLoading(e,t={}){this._showMessage({message:e,variant:"loading",...t})},showSuccess(e){this._showMessage({message:e,variant:"success"})},showSvg(e,t){this._showMessage({message:e,svg:t})},showError(e){let t=o.j.parseError(e);this._showMessage({message:t,variant:"error"})},hide(){a.message=s.message,a.variant=s.variant,a.svg=s.svg,a.open=s.open,a.autoClose=s.autoClose},_showMessage({message:e,svg:t,variant:r="success",autoClose:n=s.autoClose}){a.open?(a.open=!1,setTimeout(()=>{a.message=e,a.variant=r,a.svg=t,a.open=!0,a.autoClose=n},150)):(a.message=e,a.variant=r,a.svg=t,a.open=!0,a.autoClose=n)}}},35763:function(e,t,r){"use strict";r.d(t,{ThemeController:function(){return l}});var n=r(18680),i=r(79649),o=r(22754),s=r(20274);let a=(0,n.sj)({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),c={state:a,subscribe:e=>(0,n.Ld)(a,()=>e(a)),setThemeMode(e){a.themeMode=e;try{let t=s.ConnectorController.getAuthConnector();
24if(t){let r=c.getSnapshot().themeVariables;t.provider.syncTheme({themeMode:e,themeVariables:r,w3mThemeVariables:(0,i.t)(r,e)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(e){a.themeVariables={...a.themeVariables,...e};try{let e=s.ConnectorController.getAuthConnector();if(e){let t=c.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:t,w3mThemeVariables:(0,i.t)(a.themeVariables,a.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot:()=>(0,n.CO)(a)},l=(0,o.P)(c)},27322:function(e,t,r){"use strict";r.d(t,{f:function(){return a}});var n=r(18680),i=r(87170),o=r(22754);let s=(0,n.sj)({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),a=(0,o.P)({state:s,subscribe:e=>(0,n.Ld)(s,()=>e(s)),subscribeKey:(e,t)=>(0,i.VW)(s,e,t),showTooltip({message:e,triggerRect:t,variant:r}){s.open=!0,s.message=e,s.triggerRect=t,s.variant=r},hide(){s.open=!1,s.message="",s.triggerRect={width:0,height:0,top:0,left:0}}})},52781:function(e,t,r){"use strict";r.d(t,{s:function(){return p}});var n=r(18680),i=r(49854),o=r(62250),s=r(22754),a=r(69199),c=r(39674),l=r(46001),u=r(29607),d=r(65045);let h=(0,n.sj)({transactions:[],transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),p=(0,s.P)({state:h,subscribe:e=>(0,n.Ld)(h,()=>e(h)),setLastNetworkInView(e){h.lastNetworkInView=e},async fetchTransactions(e){if(!e)throw Error("Transactions can't be fetched without an accountAddress");h.loading=!0;try{let t=await a.L.fetchTransactions({account:e,cursor:h.next,chainId:c.R.state.activeCaipNetwork?.caipNetworkId}),r=p.filterSpamTransactions(t.data),n=p.filterByConnectedChain(r),i=[...h.transactions,...n];h.loading=!1,h.transactions=i,h.transactionsByYear=p.groupTransactionsByYearAndMonth(h.transactionsByYear,n),h.empty=0===i.length,h.next=t.next?t.next:void 0}catch(r){let t=c.R.state.activeChain;l.X.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:e,projectId:u.OptionsController.state.projectId,cursor:h.next,isSmartAccount:(0,o.r9)(t)===i.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}),d.SnackController.showError("Failed to fetch transactions"),h.loading=!1,h.empty=!0,h.next=void 0}},groupTransactionsByYearAndMonth:(e={},t=[])=>(t.forEach(t=>{let r=new Date(t.metadata.minedAt).getFullYear(),n=new Date(t.metadata.minedAt).getMonth(),i=e[r]??{},o=(i[n]??[]).filter(e=>e.id!==t.id);e[r]={...i,[n]:[...o,t].sort((e,t)=>new Date(t.metadata.minedAt).getTime()-new Date(e.metadata.minedAt).getTime())}}),e),filterSpamTransactions:e=>e.filter(e=>!e.transfers.every(e=>e.nft_info?.flags.is_spam===!0)),filterByConnectedChain(e){let t=c.R.state.activeCaipNetwork?.caipNetworkId;return e.filter(e=>e.metadata.chain===t)},clearCursor(){h.next=void 0},resetTransactions(){h.transactions=[],h.transactionsByYear={},h.lastNetworkInView=void 0,h.loading=!1,h.empty=!1,h.next=void 0}},"API_ERROR")},35143:function(e,t,r){"use strict";r.d(t,{f:function(){return c}});var n=r(18680),i=r(84270),o=r(41593);let s={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:"",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00",cosmos:"",sui:"",stacks:""},a=(0,n.sj)({networkImagePromises:{}}),c={async fetchWalletImage(e){if(e)return await i.ApiController._fetchWalletImage(e),this.getWalletImageById(e)},async fetchNetworkImage(e){if(e)return this.getNetworkImageById(e)||(a.networkImagePromises[e]||(a.networkImagePromises[e]=i.ApiController._fetchNetworkImage(e)),await a.networkImagePromises[e],this.getNetworkImageById(e))},getWalletImageById(e){if(e)return o.W.state.walletImages[e]},getWalletImage:e=>e?.image_url?e?.image_url:e?.image_id?o.W.state.walletImages[e.image_id]:void 0,getNetworkImage:e=>e?.assets?.imageUrl?e?.assets?.imageUrl:e?.assets?.imageId?o.W.state.networkImages[e.assets.imageId]:void 0,getNetworkImageById(e){if(e)return o.W.state.networkImages[e]},getConnectorImage:e=>e?.imageUrl?e.imageUrl:e?.info?.icon?e.info.icon:e?.imageId?o.W.state.connectorImages[e.imageId]:void 0,getChainImage:e=>o.W.state.networkImages[s[e]],getTokenImage(e){if(e)return o.W.state.tokenImages[e]}}},13565:function(e,t,r){"use strict";let n;r.d(t,{Q:function(){return b}});var i=r(98687),o=r(67407),s=r(42036),a=r(77879),c=r(83944),l=r(69199),u=r(39674),d=r(59449),h=r(20274);let p={createBalance(e,t){let r={name:e.metadata.name||"",symbol
24:e.metadata.symbol||"",decimals:e.metadata.decimals||0,value:e.metadata.value||0,price:e.metadata.price||0,iconUrl:e.metadata.iconUrl||""};return{name:r.name,symbol:r.symbol,chainId:t,address:"native"===e.address?void 0:this.convertAddressToCAIP10Address(e.address,t),value:r.value,price:r.price,quantity:{decimals:r.decimals.toString(),numeric:this.convertHexToBalance({hex:e.balance,decimals:r.decimals})},iconUrl:r.iconUrl}},convertHexToBalance:({hex:e,decimals:t})=>(0,o.b)(BigInt(e),t),convertAddressToCAIP10Address:(e,t)=>`${t}:${e}`,createCAIP2ChainId:(e,t)=>`${t}:${parseInt(e,16)}`,getChainIdHexFromCAIP2ChainId(e){let t=e.split(":");if(t.length<2||!t[1])return"0x0";let r=parseInt(t[1],10);return isNaN(r)?"0x0":`0x${r.toString(16)}`},isWalletGetAssetsResponse(e){return"object"==typeof e&&null!==e&&Object.values(e).every(e=>Array.isArray(e)&&e.every(e=>this.isValidAsset(e)))},isValidAsset:e=>"object"==typeof e&&null!==e&&"string"==typeof e.address&&"string"==typeof e.balance&&("ERC20"===e.type||"NATIVE"===e.type)&&"object"==typeof e.metadata&&null!==e.metadata&&"string"==typeof e.metadata.name&&"string"==typeof e.metadata.symbol&&"number"==typeof e.metadata.decimals&&"number"==typeof e.metadata.price&&"string"==typeof e.metadata.iconUrl};var f=r(33802),g=r(29607);async function m(){if(!n){let{createPublicClient:e,http:t,defineChain:i}=await r.e(3932).then(r.bind(r,83932));n={createPublicClient:e,http:t,defineChain:i}}return n}let y={getBlockchainApiRpcUrl(e,t){let r=new URL("https://rpc.walletconnect.org/v1/");return r.searchParams.set("chainId",e),r.searchParams.set("projectId",t),r.toString()},async getViemChain(e){let{defineChain:t}=await m(),{chainId:r}=a.u.parseCaipNetworkId(e.caipNetworkId);return t({...e,id:Number(r)})},async createViemPublicClient(e){let{createPublicClient:t,http:r}=await m(),n=g.OptionsController.state.projectId,i=await y.getViemChain(e);if(!i)throw Error(`Chain ${e.caipNetworkId} not found in viem/chains`);return t({chain:i,transport:r(y.getBlockchainApiRpcUrl(e.caipNetworkId,n))})}},b={async getMyTokensWithBalance(e){let t=c.AccountController.state.address,r=u.R.state.activeCaipNetwork,n=h.ConnectorController.getConnectorId("eip155")===s.b.CONNECTOR_ID.AUTH;if(!t||!r)return[];let i=`${r.caipNetworkId}:${t}`,o=f.M.getBalanceCacheForCaipAddress(i);if(o)return o.balances;if(r.chainNamespace===s.b.CHAIN.EVM&&n){let e=await this.getEIP155Balances(t,r);if(e)return this.filterLowQualityTokens(e)}let a=await l.L.getBalance(t,r.caipNetworkId,e);return this.filterLowQualityTokens(a.balances)},async getEIP155Balances(e,t){try{let r=p.getChainIdHexFromCAIP2ChainId(t.caipNetworkId),n=await d.ConnectionController.getCapabilities(e);if(!n?.[r]?.assetDiscovery?.supported)return null;let i=await d.ConnectionController.walletGetAssets({account:e,chainFilter:[r]});if(!p.isWalletGetAssetsResponse(i))return null;let o=(i[r]||[]).map(e=>p.createBalance(e,t.caipNetworkId));return f.M.updateBalanceCache({caipAddress:`${t.caipNetworkId}:${e}`,balance:{balances:o},timestamp:Date.now()}),o}catch(e){return null}},filterLowQualityTokens:e=>e.filter(e=>"0"!==e.quantity.decimals),async fetchERC20Balance({caipAddress:e,assetAddress:t,caipNetwork:r}){let n=await y.createViemPublicClient(r),{address:s}=a.u.parseCaipAddress(e),[{result:c},{result:l},{result:u},{result:d}]=await n.multicall({contracts:[{address:t,functionName:"name",args:[],abi:i.Wo},{address:t,functionName:"symbol",args:[],abi:i.Wo},{address:t,functionName:"balanceOf",args:[s],abi:i.Wo},{address:t,functionName:"decimals",args:[],abi:i.Wo}]});return{name:c,symbol:l,decimals:d,balance:u&&d?(0,o.b)(u,d):"0"}}}},62250:function(e,t,r){"use strict";r.d(t,{EO:function(){return o},eq:function(){return a},r9:function(){return s}});var n=r(39674),i=r(23829);function o(){let e=n.R.state.activeCaipNetwork?.chainNamespace||"eip155",t=n.R.state.activeCaipNetwork?.id||1,r=i.bq.NATIVE_TOKEN_ADDRESS[e];return`${e}:${t}:${r}`}function s(e){return n.R.getAccountData(e)?.preferredAccountType}function a(e){return e?n.R.state.chains.get(e)?.networkState?.caipNetwork:n.R.state.activeCaipNetwork}},95685:function(e,t,r){"use strict";r.d(t,{f:function(){return s}});var n=r(59449),i=r(20274),o=r(29607);let s={getConnectionStatus(e,t){let r=i.ConnectorController.state.activeConnectorIds[t],o=n.ConnectionController.getConnections(t);return r&&e.connectorId===r?"connected":o.some(t=>t.connectorId.toLowerCase()===e.connectorId.toLowerCase())?"active":"disconnected"},excludeConnectorAddressFromConnections:({connections:e,connectorId:t,addresses:r})=>e.map(e=>{if(t&&e.connectorId.toLowerCase()===t.toLowerCase()&&r){let t=e.accounts.filter(e=>!r.some(t=>t.toLowerCase()===e.address.toLowerCase()));return{...e,accounts:t}}return e}),excludeExistingConnections(e,t){let r=new Set(e);return t.filter(e=>!r.has(e.connectorId))},getConnectionsByConnectorId:(e,t)=>e.filter(e=>e.connectorId.toLowerCase()===t.toLowerCase()),getConnectionsData(e){let t=!!o.OptionsController.state.remoteFeatures?.multiWallet,r=i.ConnectorController.state.activeConnectorIds[e],a=n.ConnectionController.getConnections(e),c=(n.ConnectionController.state.recentConnections.get(e)??[]).filter(e=>i.ConnectorController.getConnectorById(e.connectorId)),l=s.excludeExistingConnections([...a.map(e=>e.connectorId),...r?[r]:[]],c);return t?{connections:a,recentConnections:l}:{connections:a.filter(e=>e.connectorId.toLowerCase()===r?.toLowerCase()),recentConnections:[]}}}},23829:function(e,t,r){"use strict";r.d(t,{a$:function(){return a},bq:function(){return c},gy:function(){return s}});var n=r(42036),i=r(14224);let o=(void 0!==i&&void 0!==i.env?i.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",s=[{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],a="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",c={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,FIVE_SEC_MS:5e3,THREE_SEC_MS:3e3,ONE_SEC_MS:1e3,SECURE_SITE:o,SECURE_SITE_DASHBOARD:`${o}/dashboard`,SECURE_SITE_FAVICON:`${o}/images/favicon.png`,SOLANA_NATIVE_TOKEN_ADDRESS:"So11111111111111111111111111111111111111111",RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],BALANCE_SUPPORTED_CHAINS:[n.b.CHAIN.EVM,n.b.CHAIN.SOLANA],SEND_PARAMS_SUPPORTED_CHAINS:[n.b.CHAIN.EVM],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:
2456","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:[n.b.CHAIN.EVM],ONRAMP_SUPPORTED_CHAIN_NAMESPACES:[n.b.CHAIN.EVM,n.b.CHAIN.SOLANA],PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES:[n.b.CHAIN.EVM,n.b.CHAIN.SOLANA],ACTIVITY_ENABLED_CHAIN_NAMESPACES:[n.b.CHAIN.EVM],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x",bip122:"0x",cosmos:"0x",sui:"0x",stacks:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,CONNECT_LABELS:{MOBILE:"Open and continue in the wallet app",WEB:"Open and continue in the wallet app"},SEND_SUPPORTED_NAMESPACES:[n.b.CHAIN.EVM,n.b.CHAIN.SOLANA],DEFAULT_REMOTE_FEATURES:{swaps:["1inch"],onramp:["meld"],email:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],activity:!0,reownBranding:!0,multiWallet:!1,emailCapture:!1,payWithExchange:!1,payments:!1,reownAuthentication:!1},DEFAULT_REMOTE_FEATURES_DISABLED:{email:!1,socials:!1,swaps:!1,onramp:!1,activity:!1,reownBranding:!1,emailCapture:!1,reownAuthentication:!1},DEFAULT_FEATURES:{receive:!0,send:!0,emailShowWallets:!0,connectorTypeOrder:["walletConnect","recent","injected","featured","custom","external","recommended"],analytics:!0,allWallets:!0,legalCheckbox:!1,smartSessions:!1,collapseWallets:!1,walletFeaturesOrder:["onramp","swaps","receive","send"],connectMethodsOrder:void 0,pay:!1,reownAuthentication:!1},DEFAULT_SOCIALS:["google","x","farcaster","discord","apple","github","facebook"],DEFAULT_ACCOUNT_TYPES:{bip122:"payment",eip155:"smartAccount",polkadot:"eoa",solana:"eoa"},ADAPTER_TYPES:{UNIVERSAL:"universal",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",BITCOIN:"bitcoin"},SIWX_DEFAULTS:{signOutOnDisconnect:!0}}},99321:function(e,t,r){"use strict";r.d(t,{j:function(){return s}});var n=r(42036),i=r(23829),o=r(33802);let s={isMobile(){return!!this.isClient()&&!!(window?.matchMedia&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer:coarse)")?.matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent))},checkCaipNetwork:(e,t="")=>e?.caipNetworkId.toLocaleLowerCase().includes(t.toLowerCase()),isAndroid(){if(!this.isMobile())return!1;let e=window?.navigator.userAgent.toLowerCase();return s.isMobile()&&e.includes("android")},isIos(){if(!this.isMobile())return!1;let e=window?.navigator.userAgent.toLowerCase();return e.includes("iphone")||e.includes("ipad")},isSafari(){return!!this.isClient()&&(window?.navigator.userAgent.toLowerCase()).includes("safari")},isClient:()=>"undefined"!=typeof window,isPairingExpired:e=>!e||e-Date.now()<=i.bq.TEN_SEC_MS,isAllowedRetry:(e,t=i.bq.ONE_SEC_MS)=>Date.now()-e>=t,copyToClopboard(e){navigator.clipboard.writeText(e)},isIframe(){try{return window?.self!==window?.top}catch(e){return!1}},isSafeApp(){if(s.isClient()&&window.self!==window.top)try{let e=window?.location?.ancestorOrigins?.[0];if(e){let t=new URL(e),r=new URL("https://app.safe.global");return t.hostname===r.hostname}}catch{}return!1},getPairingExpiry:()=>Date.now()+i.bq.FOUR_MINUTES_MS,getNetworkId:e=>e?.split(":")[1],getPlainAddress:e=>e?.split(":")[2],wait:async e=>new Promise(t=>{setTimeout(t,e)}),debounce(e,t=500){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout(function(){e(...n)},t)}},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),formatNativeUrl(e,t,r=null){if(s.isHttpUrl(e))return this.formatUniversalUrl(e,t);let n=e,i=r;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),i&&!i?.endsWith("/")&&(i=`${i}/`),this.isTelegram()&&this.isAndroid()&&(t=encodeURIComponent(t));let o=encodeURIComponent(t);return{redirect:`${n}wc?uri=${o}`,redirectUniversalLink:i?`${i}wc?uri=${o}`:void 0,href:n}},formatUniversalUrl(e,t){if(!s.isHttpUrl(e))return this.formatNativeUrl(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let n=encodeURIComponent(t);return{redirect:`${r}wc?uri=${n}`,href:r}},getOpenTargetForPlatform(e){return"popupWindow"===e?e:this.isTelegram()?o.M.getTelegramSocialProvider()?"_top":"_blank":e},openHref(e,t,r){window?.open(e,this.getOpenTargetForPlatform(t),r||"noreferrer noopener")},returnOpenHref(e,t,r){return window?.open(e,this.getOpenTargetForPlatform(t),r||"noreferrer noopener")},isTelegram:()=>"undefined"!=typeof window&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto),isPWA(){if("undefined"==typeof window)return!1;let e=!!window?.matchMedia&&"function"==typeof window.matchMedia&&window.matchMedia("(display-mode: standalone)")?.matches,t=window?.navigator?.standalone;return!!(e||t)},preloadImage:async e=>Promise.race([new Promise((t,r)=>{let n=new Image;n.onload=t,n.onerror=r,n.crossOrigin="anonymous",n.src=e}),s.wait(2e3)]),parseBalance(e,t){let r="0.000";if("string"==typeof e){let t=Number(e);if(!isNaN(t)){let e=(Math.floor(1e3*t)/1e3).toFixed(3);e&&(r=e)}}let[n,i]=r.split("."),o=n||"0",s=i||"000";return{formattedText:`${o}.${s}${t?` ${t}`:""}`,value:o,decimals:s,symbol:t}},getApiUrl:()=>n.b.W3M_API_URL,getBlockchainApiUrl:()=>n.b.BLOCKCHAIN_API_RPC_URL,getAnalyticsUrl:()=>n.b.PULSE_API_URL,getUUID:()=>crypto?.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),parseError:e=>"string"==typeof e?e:"string"==typeof e?.issues?.[0]?.message?e.issues[0].message:e instanceof Error?e.message:"Unknown error",sortRequestedNetworks(e,t=[]){let r={};return t&&e&&(e.forEach((e,t)=>{r[e]=t}),t.sort((e,t)=>
24{let n=r[e.id],i=r[t.id];return void 0!==n&&void 0!==i?n-i:void 0!==n?-1:void 0!==i?1:0})),t},calculateBalance(e){let t=0;for(let r of e)t+=r.value??0;return t},formatTokenBalance(e){let[t,r]=e.toFixed(2).split(".");return{dollars:t,pennies:r}},isAddress(e,t="eip155"){switch(t){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(e)&&(/^(?:0x)?[0-9a-f]{40}$/iu.test(e)||/^(?:0x)?[0-9A-F]{40}$/iu.test(e)))return!0;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(e);default:return!1}},uniqueBy(e,t){let r=new Set;return e.filter(e=>{let n=e[t];return!r.has(n)&&(r.add(n),!0)})},generateSdkVersion(e,t,r){let n=0===e.length?i.bq.ADAPTER_TYPES.UNIVERSAL:e.map(e=>e.adapterType).join(",");return`${t}-${n}-${r}`},createAccount:(e,t,r,n,i)=>({namespace:e,address:t,type:r,publicKey:n,path:i}),isCaipAddress(e){if("string"!=typeof e)return!1;let t=e.split(":"),r=t[0];return 3===t.filter(Boolean).length&&r in n.b.CHAIN_NAME_MAP},getAccount:e=>e?"string"==typeof e?{address:e,chainId:void 0}:{address:e.address,chainId:e.chainId}:{address:void 0,chainId:void 0},isMac(){let e=window?.navigator.userAgent.toLowerCase();return e.includes("macintosh")&&!e.includes("safari")},formatTelegramSocialLoginUrl(e){let t=`--${encodeURIComponent(window?.location.href)}`,r="state=";if("auth.magic.link"===new URL(e).host){let n="provider_authorization_url=",i=e.substring(e.indexOf(n)+n.length),o=this.injectIntoUrl(decodeURIComponent(i),r,t);return e.replace(i,encodeURIComponent(o))}return this.injectIntoUrl(e,r,t)},injectIntoUrl(e,t,r){let n=e.indexOf(t);if(-1===n)throw Error(`${t} parameter not found in the URL: ${e}`);let i=e.indexOf("&",n),o=t.length,s=-1!==i?i:e.length,a=e.substring(0,n+o);return a+(e.substring(n+o,s)+r)+e.substring(i)}}},3675:function(e,t,r){"use strict";r.d(t,{Cx:function(){return u},Us:function(){return d},YK:function(){return c},ec:function(){return g},kv:function(){return l},r6:function(){return h},vE:function(){return p}});var n=r(77879),i=r(29607);let o={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}};class s extends Error{}async function a(e,t){let r=function(){let{sdkType:e,sdkVersion:t,projectId:r}=i.OptionsController.getSnapshot(),n=new URL("https://rpc.walletconnect.org/v1/json-rpc");return n.searchParams.set("projectId",r),n.searchParams.set("st",e),n.searchParams.set("sv",t),n.searchParams.set("source","fund-wallet"),n.toString()}(),{projectId:n}=i.OptionsController.getSnapshot(),o={jsonrpc:"2.0",id:1,method:e,params:{...t||{},projectId:n}},a=await fetch(r,{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}),c=await a.json();if(c.error)throw new s(c.error.message);return c}async function c(e){return(await a("reown_getExchanges",e)).result}async function l(e){return(await a("reown_getExchangePayUrl",e)).result}async function u(e){return(await a("reown_getExchangeBuyStatus",e)).result}function d(e,t){let{chainNamespace:r,chainId:i}=n.u.parseCaipNetworkId(e),s=o[r];if(!s)throw Error(`Unsupported chain namespace for CAIP-19 formatting: ${r}`);let a=s.native.assetNamespace,c=s.native.assetReference;"native"!==t&&(a=s.defaultTokenNamespace,c=t);let l=`${r}:${i}`;return`${l}/${a}:${c}`}let h={network:"eip155:8453",asset:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},p={network:"eip155:84532",asset:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},f={ethereumETH:{network:"eip155:1",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},baseETH:{network:"eip155:8453",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},baseUSDC:h,baseSepoliaETH:{network:"eip155:84532",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},ethereumUSDC:{network:"eip155:1",asset:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},arbitrumUSDC:{network:"eip155:42161",asset:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},polygonUSDC:{network:"eip155:137",asset:"0x2791bca1f2de4661ed88a30c99a7a9449aa84174",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},solanaUSDC:{network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},ethereumUSDT:{network:"eip155:1",asset:"0xdAC17F958D2ee523a2206206994597C13D831ec7",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},optimismUSDT:{network:"eip155:10",asset:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},arbitrumUSDT:{network:"eip155:42161",asset:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},polygonUSDT:{network:"eip155:137",asset:"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},solanaUSDT:{network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},solanaSOL:{network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"native",metadata:{name:"Solana",symbol:"SOL",decimals:9}}};function g(e){return Object.values(f).filter(t=>t.network===e)}},54958:function(e,t,r){"use strict";async function n(...e){let t=await fetch(...e);if(!t.ok)throw Error(`HTTP status code: ${t.status}`,{cause:t});return t}r.d(t,{V:function(){return i}});class i{constructor({baseUrl:e,clientId:t}){this.baseUrl=e,this.clientId=t}async get({headers:e,signal:t,cache:r,...i}){let o=this.createUrl(i);return(await n(o,{method:"GET",headers:e,signal:t,cache:r})).json()}async getBlob({headers:e,signal:t,...r}){let i=this.createUrl(r);return(await n(i,{method:"GET",headers:e,signal:t})).blob()}async post({body:e,headers:t,signal:r,...i}){let o=this.createUrl(i);return(await n(o,{method:"POST",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}async put({body:e,headers:t,signal:r,...i}){let o=this.createUrl(i);return(await n(o,{method:"PUT",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}async delete({body:e,headers:t,signal:r,...i}){let o=this.createUrl(i);return(await n(o,{method:"DELETE",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}createUrl({path:e,params:t}){let r=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([e,t])=>{t&&r.searchParams.append(e,t)}),this.clientId&&r.searchParams.append("clientId",this.clientId),r}sendBeacon({body:e,...t}){let r=this.createUrl(t);return navigator.sendBeacon(r.toString(),e?JSON.stringify(e):void 0)}}},30353:function(e,t,r){"use strict";r.d(t,{R:function(){return s},m:function(){return o}});var n=r(42036),i=r(39674);let o={PHANTOM:{id:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",url:"https://phantom.app"},SOLFLARE:{id:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",url:"https://solflare.com"},COINBASE:{id:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",url:"https://go.cb-w.com"},BINANCE:{id:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25",appId:"yFK5FCqYprrXDiVFbhyRx7",deeplink:"bnc://app.binance.com/mp/app",url:"https://app.binance.com/en/download"}},s={handleMobileDeeplinkRedirect(e,t){let r=window.location.href,s=encodeURIComponent(r);if(e===o.PHANTOM.id&&!("phantom"in window)){let e=r.startsWith("https")?"https":"http",t=r.split("/")[2],n=encodeURIComponent(`${e}://${t}`);window.location.href=`${o.PHANTOM.url}/ul/browse/${s}?ref=${n}`}if(e!==o.SOLFLARE.id||"solflare"in window||(window.location.href=`${o.SOLFLARE.url}/ul/v1/browse/${s}?ref=${s}`),t!==n.b.CHAIN.SOLANA||e!==o.COINBASE.id||"coinbaseSolana"in window||(window.location.href=`${o.COINBASE.url}/dapp?cb_url=${s}`),t===n.b.CHAIN.BITCOIN&&e===o.BINANCE.id&&!("binancew3w"in window)){let e=i.R.state.activeCaipNetwork,t=window.btoa("/pages/browser/index"),r=window.btoa(`url=${s}&defaultChainId=${e?.id??1}`),n=new URL(o.BINANCE.deeplink);n.searchParams.set("appId",o.BINANCE.appId),n.searchParams.set("startPagePath",t),n.searchParams.set("startPageQuery",r);let a=new URL(o.BINANCE.url);a.searchParams.set("_dp",window.btoa(n.toString())),window.location.href=a.toString()}}}},26662:function(e,t,r){"use strict";r.d(t,{p:function(){return c}});
24var n=r(42036),i=r(83944),o=r(39674),s=r(20274),a=r(83764);let c={onSwitchNetwork({network:e,ignoreSwitchConfirmation:t=!1}){let r=o.R.state.activeCaipNetwork,c=a.RouterController.state.data;if(e.id===r?.id)return;let l=i.AccountController.getCaipAddress(o.R.state.activeChain),u=e.chainNamespace!==o.R.state.activeChain,d=i.AccountController.getCaipAddress(e.chainNamespace),h=s.ConnectorController.getConnectorId(o.R.state.activeChain)===n.b.CONNECTOR_ID.AUTH,p=n.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(t=>t===e.chainNamespace);t||h&&p?a.RouterController.push("SwitchNetwork",{...c,network:e}):l&&u&&!d?a.RouterController.push("SwitchActiveChain",{switchToChain:e.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:e}):a.RouterController.push("SwitchNetwork",{...c,network:e})}}},71384:function(e,t,r){"use strict";r.d(t,{w:function(){return y}}),r(59908);var n=r(42036),i=r(49854),o=r(83944),s=r(39674),a=r(59449),c=r(20274),l=r(46001),u=r(30397),d=r(29607),h=r(83764),p=r(65045),f=r(62250),g=r(99321);let m=null,y={getSIWX:()=>d.OptionsController.state.siwx,async initializeIfEnabled(e=s.R.getActiveCaipAddress()){let t=d.OptionsController.state.siwx;if(!(t&&e))return;let[r,n,i]=e.split(":");if(s.R.checkIfSupportedNetwork(r,`${r}:${n}`))try{if(d.OptionsController.state.remoteFeatures?.emailCapture){let e=s.R.getAccountData(r)?.user;await u.I.open({view:"DataCapture",data:{email:e?.email??void 0}});return}if(m&&await m,(await t.getSessions(`${r}:${n}`,i)).length)return;await u.I.open({view:"SIWXSignMessage"})}catch(e){console.error("SIWXUtil:initializeIfEnabled",e),l.X.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties()}),await a.ConnectionController._getClient()?.disconnect().catch(console.error),h.RouterController.reset("Connect"),p.SnackController.showError("A problem occurred while trying initialize authentication")}},async requestSignMessage(){let e=d.OptionsController.state.siwx,t=g.j.getPlainAddress(s.R.getActiveCaipAddress()),r=(0,f.eq)(),i=a.ConnectionController._getClient();if(!e)throw Error("SIWX is not enabled");if(!t)throw Error("No ActiveCaipAddress found");if(!r)throw Error("No ActiveCaipNetwork or client found");if(!i)throw Error("No ConnectionController client found");try{let o=await e.createMessage({chainId:r.caipNetworkId,accountAddress:t}),a=o.toString();c.ConnectorController.getConnectorId(r.chainNamespace)===n.b.CONNECTOR_ID.AUTH&&h.RouterController.pushTransactionStack({});let d=await i.signMessage(a);await e.addSession({data:o,message:a,signature:d}),s.R.setLastConnectedSIWECaipNetwork(r),u.I.close(),l.X.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:this.getSIWXEventProperties()})}catch(t){let e=this.getSIWXEventProperties();u.I.state.open&&"ApproveTransaction"!==h.RouterController.state.view||await u.I.open({view:"SIWXSignMessage"}),p.SnackController.showError("Error signing message"),l.X.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:e}),console.error("SWIXUtil:requestSignMessage",t)}},async cancelSignMessage(){try{let e=this.getSIWX();if(e?.getRequired?.()){let t=s.R.getLastConnectedSIWECaipNetwork();if(t){let r=await e?.getSessions(t?.caipNetworkId,g.j.getPlainAddress(s.R.getActiveCaipAddress())||"");r&&r.length>0?await s.R.switchActiveNetwork(t):await a.ConnectionController.disconnect()}else await a.ConnectionController.disconnect()}else u.I.close();u.I.close(),l.X.sendEvent({event:"CLICK_CANCEL_SIWX",type:"track",properties:this.getSIWXEventProperties()})}catch(e){console.error("SIWXUtil:cancelSignMessage",e)}},async getAllSessions(){let e=this.getSIWX(),t=s.R.getAllRequestedCaipNetworks(),r=[];return await Promise.all(t.map(async t=>{let n=await e?.getSessions(t.caipNetworkId,g.j.getPlainAddress(s.R.getActiveCaipAddress())||"");n&&r.push(...n)})),r},async getSessions(e){let t=d.OptionsController.state.siwx,r=e?.address;if(!r){let e=s.R.getActiveCaipAddress();r=g.j.getPlainAddress(e)}let n=e?.caipNetworkId;if(!n){let e=s.R.getActiveCaipNetwork();n=e?.caipNetworkId}return t&&r&&n?t.getSessions(n,r):[]},async isSIWXCloseDisabled(){let e=this.getSIWX();if(e){let t="ApproveTransaction"===h.RouterController.state.view,r="SIWXSignMessage"===h.RouterController.state.view;
24if(t||r)return e.getRequired?.()&&0===(await this.getSessions()).length}return!1},async authConnectorAuthenticate({authConnector:e,chainId:t,socialUri:r,preferredAccountType:i,chainNamespace:o}){let a=y.getSIWX(),c=(0,f.eq)();if(!a||!o.includes(n.b.CHAIN.EVM)||d.OptionsController.state.remoteFeatures?.emailCapture){let n=await e.connect({chainId:t,socialUri:r,preferredAccountType:i});return{address:n.address,chainId:n.chainId,accounts:n.accounts}}let l=`${o}:${t}`,u=await a.createMessage({chainId:l,accountAddress:"<<AccountAddress>>"}),h={accountAddress:u.accountAddress,chainId:u.chainId,domain:u.domain,uri:u.uri,version:u.version,nonce:u.nonce,notBefore:u.notBefore,statement:u.statement,resources:u.resources,requestId:u.requestId,issuedAt:u.issuedAt,expirationTime:u.expirationTime,serializedMessage:u.toString()},p=await e.connect({chainId:t,socialUri:r,siwxMessage:h,preferredAccountType:i});if(h.accountAddress=p.address,h.serializedMessage=p.message||"",p.signature&&p.message){let e=y.addEmbeddedWalletSession(h,p.message,p.signature);await e}return s.R.setLastConnectedSIWECaipNetwork(c),{address:p.address,chainId:p.chainId,accounts:p.accounts}},async addEmbeddedWalletSession(e,t,r){if(m)return m;let n=y.getSIWX();return n?m=n.addSession({data:e,message:t,signature:r}).finally(()=>{m=null}):Promise.resolve()},async universalProviderAuthenticate({universalProvider:e,chains:t,methods:r}){let n=y.getSIWX(),i=(0,f.eq)(),a=new Set(t.map(e=>e.split(":")[0]));if(!n||1!==a.size||!a.has("eip155"))return!1;let c=await n.createMessage({chainId:f.eq()?.caipNetworkId||"",accountAddress:""}),u=await e.authenticate({nonce:c.nonce,domain:c.domain,uri:c.uri,exp:c.expirationTime,iat:c.issuedAt,nbf:c.notBefore,requestId:c.requestId,version:c.version,resources:c.resources,statement:c.statement,chainId:c.chainId,methods:r,chains:[c.chainId,...t.filter(e=>e!==c.chainId)]});if(p.SnackController.showLoading("Authenticating...",{autoClose:!1}),o.AccountController.setConnectedWalletInfo({...u.session.peer.metadata,name:u.session.peer.metadata.name,icon:u.session.peer.metadata.icons?.[0],type:"WALLET_CONNECT"},Array.from(a)[0]),u?.auths?.length){let t=u.auths.map(t=>{let r=e.client.formatAuthMessage({request:t.p,iss:t.p.iss});return{data:{...t.p,accountAddress:t.p.iss.split(":").slice(-1).join(""),chainId:t.p.iss.split(":").slice(2,4).join(":"),uri:t.p.aud,version:t.p.version||c.version,expirationTime:t.p.exp,issuedAt:t.p.iat,notBefore:t.p.nbf},message:r,signature:t.s.s,cacao:t}});try{await n.setSessions(t),i&&s.R.setLastConnectedSIWECaipNetwork(i),l.X.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:y.getSIWXEventProperties()})}catch(t){throw console.error("SIWX:universalProviderAuth - failed to set sessions",t),l.X.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:y.getSIWXEventProperties()}),await e.disconnect().catch(console.error),t}finally{p.SnackController.hide()}}return!0},getSIWXEventProperties(){let e=s.R.state.activeChain;if(!e)throw Error("SIWXUtil:getSIWXEventProperties - namespace is required");return{network:s.R.state.activeCaipNetwork?.caipNetworkId||"",isSmartAccount:(0,f.r9)(e)===i.y_.ACCOUNT_TYPES.SMART_ACCOUNT}},async clearSessions(){let e=this.getSIWX();e&&await e.setSessions([])}}},54860:function(e,t,r){"use strict";r.d(t,{y0:function(){return f}});var n=r(42036),i=r(83944),o=r(39674),s=r(20274),a=r(46001),c=r(83764),l=r(65045),u=r(99321),d=r(33802);async function h(){c.RouterController.push("ConnectingFarcaster");let e=s.ConnectorController.getAuthConnector();if(e&&!i.AccountController.state.farcasterUrl)try{let{url:t}=await e.provider.getFarcasterUri();i.AccountController.setFarcasterUrl(t,o.R.state.activeChain)}catch(e){c.RouterController.goBack(),l.SnackController.showError(e)}}async function p(e){c.RouterController.push("ConnectingSocial");let t=s.ConnectorController.getAuthConnector(),r=null;try{let s=setTimeout(()=>{throw Error("Social login timed out. Please try again.")},45e3);if(t&&e){if(u.j.isTelegram()||(r=function(){try{return u.j.returnOpenHref(`${n.b.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch(e){throw Error("Could not open social popup")}}()),r)i.AccountController.setSocialWindow(r,o.R.state.activeChain);else if(!u.j.isTelegram())throw Error("Could not create social popup");let{uri:a}=await t.provider.getSocialRedirectUri({provider:e});if(!a)throw r?.close(),Error("Could not fetch the social redirect uri");if(r&&(r.location.href=a),u.j.isTelegram()){d.M.setTelegramSocialProvider(e);let t=u.j.formatTelegramSocialLoginUrl(a);u.j.openHref(t,"_top")}clearTimeout(s)}}catch(e){r?.close(),l.SnackController.showError(e?.message)}}async function f(e){i.AccountController.setSocialProvider(e,o.R.state.activeChain),a.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}
24),"farcaster"===e?await h():await p(e)}},33802:function(e,t,r){"use strict";r.d(t,{M:function(){return o}});var n=r(6026),i=r(42036);let o={cacheExpiry:{portfolio:3e4,nativeBalance:3e4,ens:3e5,identity:3e5,transactionsHistory:15e3,tokenPrice:15e3,latestAppKitVersion:6048e5},isCacheExpired:(e,t)=>Date.now()-e>t,getActiveNetworkProps(){let e=o.getActiveNamespace(),t=o.getActiveCaipNetworkId(),r=t?t.split(":")[1]:void 0;return{namespace:e,caipNetworkId:t,chainId:r?isNaN(Number(r))?r:Number(r):void 0}},setWalletConnectDeepLink({name:e,href:t}){try{n.mr.setItem(n.uJ.DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{let e=n.mr.getItem(n.uJ.DEEPLINK_CHOICE);if(e)return JSON.parse(e)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{n.mr.removeItem(n.uJ.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setActiveNamespace(e){try{n.mr.setItem(n.uJ.ACTIVE_NAMESPACE,e)}catch{console.info("Unable to set active namespace")}},setActiveCaipNetworkId(e){try{n.mr.setItem(n.uJ.ACTIVE_CAIP_NETWORK_ID,e),o.setActiveNamespace(e.split(":")[0])}catch{console.info("Unable to set active caip network id")}},getActiveCaipNetworkId(){try{return n.mr.getItem(n.uJ.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to get active caip network id");return}},deleteActiveCaipNetworkId(){try{n.mr.removeItem(n.uJ.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to delete active caip network id")}},deleteConnectedConnectorId(e){try{let t=(0,n.Vk)(e);n.mr.removeItem(t)}catch{console.info("Unable to delete connected connector id")}},setAppKitRecent(e){try{let t=o.getRecentWallets();t.find(t=>t.id===e.id)||(t.unshift(e),t.length>2&&t.pop(),n.mr.setItem(n.uJ.RECENT_WALLETS,JSON.stringify(t)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{let e=n.mr.getItem(n.uJ.RECENT_WALLETS);return e?JSON.parse(e):[]}catch{console.info("Unable to get AppKit recent")}return[]},setConnectedConnectorId(e,t){try{let r=(0,n.Vk)(e);n.mr.setItem(r,t)}catch{console.info("Unable to set Connected Connector Id")}},getActiveNamespace(){try{return n.mr.getItem(n.uJ.ACTIVE_NAMESPACE)}catch{console.info("Unable to get active namespace")}},getConnectedConnectorId(e){if(e)try{let t=(0,n.Vk)(e);return n.mr.getItem(t)}catch(t){console.info("Unable to get connected connector id in namespace",e)}},setConnectedSocialProvider(e){try{n.mr.setItem(n.uJ.CONNECTED_SOCIAL,e)}catch{console.info("Unable to set connected social provider")}},getConnectedSocialProvider(){try{return n.mr.getItem(n.uJ.CONNECTED_SOCIAL)}catch{console.info("Unable to get connected social provider")}},deleteConnectedSocialProvider(){try{n.mr.removeItem(n.uJ.CONNECTED_SOCIAL)}catch{console.info("Unable to delete connected social provider")}},getConnectedSocialUsername(){try{return n.mr.getItem(n.uJ.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get connected social username")}},getStoredActiveCaipNetworkId(){let e=n.mr.getItem(n.uJ.ACTIVE_CAIP_NETWORK_ID);return e?.split(":")?.[1]},setConnectionStatus(e){try{n.mr.setItem(n.uJ.CONNECTION_STATUS,e)}catch{console.info("Unable to set connection status")}},getConnectionStatus(){try{return n.mr.getItem(n.uJ.CONNECTION_STATUS)}catch{return}},getConnectedNamespaces(){try{let e=n.mr.getItem(n.uJ.CONNECTED_NAMESPACES);if(!e?.length)return[];return e.split(",")}catch{return[]}},setConnectedNamespaces(e){try{let t=Array.from(new Set(e));n.mr.setItem(n.uJ.CONNECTED_NAMESPACES,t.join(","))}catch{console.info("Unable to set namespaces in storage")}},addConnectedNamespace(e){try{let t=o.getConnectedNamespaces();t.includes(e)||(t.push(e),o.setConnectedNamespaces(t))}catch{console.info("Unable to add connected namespace")}},removeConnectedNamespace(e){try{let t=o.getConnectedNamespaces(),r=t.indexOf(e);r>-1&&(t.splice(r,1),o.setConnectedNamespaces(t))}catch{console.info("Unable to remove connected namespace")}},getTelegramSocialProvider(){try{return n.mr.getItem(n.uJ.TELEGRAM_SOCIAL_PROVIDER)}catch{return console.info("Unable to get telegram social provider"),null}},setTelegramSocialProvider(e){try{n.mr.setItem(n.uJ.TELEGRAM_SOCIAL_PROVIDER,e)}catch{console.info("Unable to set telegram social provider")}},removeTelegramSocialProvider(){try{n.mr.removeItem(n.uJ.TELEGRAM_SOCIAL_PROVIDER)}catch{console.info("Unable to remove telegram social provider")}},getBalanceCache(){let e={};try{let t=n.mr.getItem(n.uJ.PORTFOLIO_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get balance cache")}return e}
24,removeAddressFromBalanceCache(e){try{let t=o.getBalanceCache();n.mr.setItem(n.uJ.PORTFOLIO_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove address from balance cache",e)}},getBalanceCacheForCaipAddress(e){try{let t=o.getBalanceCache()[e];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.portfolio))return t.balance;o.removeAddressFromBalanceCache(e)}catch{console.info("Unable to get balance cache for address",e)}},updateBalanceCache(e){try{let t=o.getBalanceCache();t[e.caipAddress]=e,n.mr.setItem(n.uJ.PORTFOLIO_CACHE,JSON.stringify(t))}catch{console.info("Unable to update balance cache",e)}},getNativeBalanceCache(){let e={};try{let t=n.mr.getItem(n.uJ.NATIVE_BALANCE_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get balance cache")}return e},removeAddressFromNativeBalanceCache(e){try{let t=o.getBalanceCache();n.mr.setItem(n.uJ.NATIVE_BALANCE_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove address from balance cache",e)}},getNativeBalanceCacheForCaipAddress(e){try{let t=o.getNativeBalanceCache()[e];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.nativeBalance))return t;console.info("Discarding cache for address",e),o.removeAddressFromBalanceCache(e)}catch{console.info("Unable to get balance cache for address",e)}},updateNativeBalanceCache(e){try{let t=o.getNativeBalanceCache();t[e.caipAddress]=e,n.mr.setItem(n.uJ.NATIVE_BALANCE_CACHE,JSON.stringify(t))}catch{console.info("Unable to update balance cache",e)}},getEnsCache(){let e={};try{let t=n.mr.getItem(n.uJ.ENS_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get ens name cache")}return e},getEnsFromCacheForAddress(e){try{let t=o.getEnsCache()[e];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.ens))return t.ens;o.removeEnsFromCache(e)}catch{console.info("Unable to get ens name from cache",e)}},updateEnsCache(e){try{let t=o.getEnsCache();t[e.address]=e,n.mr.setItem(n.uJ.ENS_CACHE,JSON.stringify(t))}catch{console.info("Unable to update ens name cache",e)}},removeEnsFromCache(e){try{let t=o.getEnsCache();n.mr.setItem(n.uJ.ENS_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove ens name from cache",e)}},getIdentityCache(){let e={};try{let t=n.mr.getItem(n.uJ.IDENTITY_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get identity cache")}return e},getIdentityFromCacheForAddress(e){try{let t=o.getIdentityCache()[e];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.identity))return t.identity;o.removeIdentityFromCache(e)}catch{console.info("Unable to get identity from cache",e)}},updateIdentityCache(e){try{let t=o.getIdentityCache();t[e.address]={identity:e.identity,timestamp:e.timestamp},n.mr.setItem(n.uJ.IDENTITY_CACHE,JSON.stringify(t))}catch{console.info("Unable to update identity cache",e)}},removeIdentityFromCache(e){try{let t=o.getIdentityCache();n.mr.setItem(n.uJ.IDENTITY_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove identity from cache",e)}},clearAddressCache(){try{n.mr.removeItem(n.uJ.PORTFOLIO_CACHE),n.mr.removeItem(n.uJ.NATIVE_BALANCE_CACHE),n.mr.removeItem(n.uJ.ENS_CACHE),n.mr.removeItem(n.uJ.IDENTITY_CACHE),n.mr.removeItem(n.uJ.HISTORY_TRANSACTIONS_CACHE)}catch{console.info("Unable to clear address cache")}},setPreferredAccountTypes(e){try{n.mr.setItem(n.uJ.PREFERRED_ACCOUNT_TYPES,JSON.stringify(e))}catch{console.info("Unable to set preferred account types",e)}},getPreferredAccountTypes(){try{let e=n.mr.getItem(n.uJ.PREFERRED_ACCOUNT_TYPES);if(!e)return{};return JSON.parse(e)}catch{console.info("Unable to get preferred account types")}return{}},setConnections(e,t){try{let r=o.getConnections(),s=r[t]??[],a=new Map;for(let e of s)a.set(e.connectorId,{...e});for(let t of e){let e=a.get(t.connectorId),r=t.connectorId===i.b.CONNECTOR_ID.AUTH;if(e&&!r){let r=new Set(e.accounts.map(e=>e.address.toLowerCase())),n=t.accounts.filter(e=>!r.has(e.address.toLowerCase()));e.accounts.push(...n)}else a.set(t.connectorId,{...t})}let c={...r,[t]:Array.from(a.values())};n.mr.setItem(n.uJ.CONNECTIONS,JSON.stringify(c))}catch(e){console.error("Unable to sync connections to storage",e)}},getConnections(){try{let e=n.mr.getItem(n.uJ.CONNECTIONS);if(!e)return{};return JSON.parse(e)}catch(e){return console.error("Unable to get connections from storage",e),{}}},deleteAddressFromConnection({connectorId:e,address:t,namespace:r}){try{let i=o.getConnections(),s=i[r]??[],a=new Map(s.map(e=>[e.connectorId,e])),c=a.get(e);if(c){let r=c.accounts.filter(e=>e.address.toLowerCase()!==t.toLowerCase());0===r.length?a.delete(e):a.set(e,{...c,accounts:c.accounts.filter(e=>e.address.toLowerCase()!==t.toLowerCase())})}n.mr.setItem(n.uJ.CONNECTIONS,JSON.stringify({...i,[r]:Array.from(a.values())}))}catch{console.error(`Unable to remove address "${t}" from connector "${e}" in namespace "${r}"`)}},getDisconnectedConnectorIds(){try{let e=n.mr.getItem(n.uJ.DISCONNECTED_CONNECTOR_IDS);if(!e)return{};return JSON.parse(e)}catch{console.info("Unable to get disconnected connector ids")}return{}},addDisconnectedConnectorId(e,t){try{let r=o.getDisconnectedConnectorIds(),i=r[t]??[];i.push(e),n.mr.setItem(n.uJ.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...r,[t]:Array.from(new Set(i))}))}catch{console.error(`Unable to set disconnected connector id "${e}" for namespace "${t}"`)}},removeDisconnectedConnectorId(e,t){try{let r=o.getDisconnectedConnectorIds(),i=r[t]??[];i=i.filter(t=>t.toLowerCase()!==e.toLowerCase()),n.mr.setItem(n.uJ.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...r,[t]:Array.from(new Set(i))}))}catch{console.error(`Unable to remove disconnected connector id "${e}" for namespace "${t}"`)}},isConnectorDisconnected(e,t){try{return(o.getDisconnectedConnectorIds()[t]??[]).some(t=>t.toLowerCase()===e.toLowerCase())}catch{console.info(`Unable to get disconnected connector id "${e}" for namespace "${t}"`)}return!1},getTransactionsCache(){try{let e=n.mr.getItem(n.uJ.HISTORY_TRANSACTIONS_CACHE);return e?JSON.parse(e):{}}catch{console.info("Unable to get transactions cache")}return{}},getTransactionsCacheForAddress({address:e,chainId:t=""}){try{let r=o.getTransactionsCache(),n=r[e]?.[t];if(n&&!this.isCacheExpired(n.timestamp,this.cacheExpiry.transactionsHistory)
24)return n.transactions;o.removeTransactionsCache({address:e,chainId:t})}catch{console.info("Unable to get transactions cache")}},updateTransactionsCache({address:e,chainId:t="",timestamp:r,transactions:i}){try{let s=o.getTransactionsCache();s[e]={...s[e],[t]:{timestamp:r,transactions:i}},n.mr.setItem(n.uJ.HISTORY_TRANSACTIONS_CACHE,JSON.stringify(s))}catch{console.info("Unable to update transactions cache",{address:e,chainId:t,timestamp:r,transactions:i})}},removeTransactionsCache({address:e,chainId:t}){try{let r=o.getTransactionsCache(),{[t]:i,...s}=r?.[e]||{};n.mr.setItem(n.uJ.HISTORY_TRANSACTIONS_CACHE,JSON.stringify({...r,[e]:s}))}catch{console.info("Unable to remove transactions cache",{address:e,chainId:t})}},getTokenPriceCache(){try{let e=n.mr.getItem(n.uJ.TOKEN_PRICE_CACHE);return e?JSON.parse(e):{}}catch{console.info("Unable to get token price cache")}return{}},getTokenPriceCacheForAddresses(e){try{let t=o.getTokenPriceCache()[e.join(",")];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.tokenPrice))return t.tokenPrice;o.removeTokenPriceCache(e)}catch{console.info("Unable to get token price cache for addresses",e)}},updateTokenPriceCache(e){try{let t=o.getTokenPriceCache();t[e.addresses.join(",")]={timestamp:e.timestamp,tokenPrice:e.tokenPrice},n.mr.setItem(n.uJ.TOKEN_PRICE_CACHE,JSON.stringify(t))}catch{console.info("Unable to update token price cache",e)}},removeTokenPriceCache(e){try{let t=o.getTokenPriceCache();n.mr.setItem(n.uJ.TOKEN_PRICE_CACHE,JSON.stringify({...t,[e.join(",")]:void 0}))}catch{console.info("Unable to remove token price cache",e)}},getLatestAppKitVersion(){try{let e=this.getLatestAppKitVersionCache(),t=e?.version;if(t&&!this.isCacheExpired(e.timestamp,this.cacheExpiry.latestAppKitVersion))return t}catch{console.info("Unable to get latest AppKit version")}},getLatestAppKitVersionCache(){try{let e=n.mr.getItem(n.uJ.LATEST_APPKIT_VERSION);return e?JSON.parse(e):{}}catch{console.info("Unable to get latest AppKit version cache")}return{}},updateLatestAppKitVersion(e){try{let t=o.getLatestAppKitVersionCache();t.timestamp=e.timestamp,t.version=e.version,n.mr.setItem(n.uJ.LATEST_APPKIT_VERSION,JSON.stringify(t))}catch{console.info("Unable to update latest AppKit version on local storage",e)}}}},1553:function(e,t,r){"use strict";r.d(t,{n:function(){return l}});var n=r(83944),i=r(69199),o=r(39674),s=r(59449),a=r(13565),c=r(62250);let l={async getTokenList(e){let t=await i.L.fetchSwapTokens({chainId:e});return t?.tokens?.map(e=>({...e,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0}))||[]},async fetchGasPrice(){let e=o.R.state.activeCaipNetwork;if(!e)return null;try{if("solana"===e.chainNamespace){let e=(await s.ConnectionController?.estimateGas({chainNamespace:"solana"}))?.toString();return{standard:e,fast:e,instant:e}}return await i.L.fetchGasPrice({chainId:e.caipNetworkId})}catch{return null}},async fetchSwapAllowance({tokenAddress:e,userAddress:t,sourceTokenAmount:r,sourceTokenDecimals:n}){let o=await i.L.fetchSwapAllowance({tokenAddress:e,userAddress:t});if(o?.allowance&&r&&n){let e=s.ConnectionController.parseUnits(r,n)||0;return BigInt(o.allowance)>=e}return!1},async getMyTokensWithBalance(e){let t=await a.Q.getMyTokensWithBalance(e);return n.AccountController.setTokenBalance(t,o.R.state.activeChain),this.mapBalancesToSwapTokens(t)},mapBalancesToSwapTokens:e=>e?.map(e=>({...e,address:e?.address?e.address:c.EO(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1}))||[]}},22754:function(e,t,r){"use strict";r.d(t,{g:function(){return h},P:function(){return f}});var n=r(18680),i=r(87170),o=r(99321),s=r(54958),a=r(29607);let c=Object.freeze({enabled:!0,events:[]}),l=new s.V({baseUrl:o.j.getAnalyticsUrl(),clientId:null}),u=(0,n.sj)({...c}),d={state:u,subscribeKey:(e,t)=>(0,i.VW)(u,e,t),async sendError(e,t){if(!u.enabled)return;let r=Date.now();if(u.events.filter(e=>r-new Date(e.properties.timestamp||"").getTime()<6e4).length>=5)return;let n={type:"error",event:t,properties:{errorType:e.name,errorMessage:e.message,stackTrace:e.stack,timestamp:new Date().toISOString()}};u.events.push(n);try{if("undefined"==typeof window)return;let{projectId:r,sdkType:n,sdkVersion:i}=a.OptionsController.state;await l.post({path:"/e",params:{projectId:r,st:n,sv:i||"html-wagmi-4.2.2"},body:{eventId:o.j.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:new Date().toISOString(),props:{type:"error",event:t,errorType:e.name,errorMessage:e.message,stackTrace:e.stack}}})}catch{}},enable(){u.enabled=!0},disable(){u.enabled=!1},clearEvents(){u.events=[]}};
24class h extends Error{constructor(e,t,r){super(e),this.name="AppKitError",this.category=t,this.originalError=r,Object.setPrototypeOf(this,h.prototype);let n=!1;if(r instanceof Error&&"string"==typeof r.stack&&r.stack){let e=r.stack,t=e.indexOf("\n");if(t>-1){let r=e.substring(t+1);this.stack=`${this.name}: ${this.message}
25${r}`,n=!0}}n||(Error.captureStackTrace?Error.captureStackTrace(this,h):this.stack||(this.stack=`${this.name}: ${this.message}`))}}function p(e,t){let r="";try{r=e instanceof Error?e.message:"string"==typeof e?e:"object"==typeof e&&null!==e?e?.message||JSON.stringify(e):String(e)}catch(e){r="Unknown error",console.error("Error parsing error message",e)}let n=e instanceof h?e:new h(r,t,e);throw d.sendError(n,n.category),n}function f(e,t="INTERNAL_SDK_ERROR"){let r={};return Object.keys(e).forEach(n=>{let i=e[n];if("function"==typeof i){let e=i;e="AsyncFunction"===i.constructor.name?async(...e)=>{try{return await i(...e)}catch(e){return p(e,t)}}:(...e)=>{try{return i(...e)}catch(e){return p(e,t)}},r[n]=e}else r[n]=i}),r}},74017:function(e,t,r){"use strict";r.r(t),r.d(t,{AppKitAccountButton:function(){return A},AppKitButton:function(){return O},AppKitConnectButton:function(){return L},AppKitNetworkButton:function(){return q},W3mAccountButton:function(){return x},W3mAccountSettingsView:function(){return eu},W3mAccountView:function(){return eG},W3mAllWalletsView:function(){return tR},W3mButton:function(){return k},W3mChooseAccountNameView:function(){return r5},W3mConnectButton:function(){return D},W3mConnectView:function(){return rE},W3mConnectWalletsView:function(){return nr},W3mConnectingExternalView:function(){return rR},W3mConnectingMultiChainView:function(){return rL},W3mConnectingWcBasicView:function(){return rQ},W3mConnectingWcView:function(){return rJ},W3mDownloadsView:function(){return r3},W3mFooter:function(){return K.M},W3mGetWalletView:function(){return r6},W3mNetworkButton:function(){return W},W3mNetworkSwitchView:function(){return na},W3mNetworksView:function(){return nf},W3mProfileWalletsView:function(){return tr},W3mRouter:function(){return V.A},W3mSIWXSignMessageView:function(){return nL},W3mSwitchActiveChainView:function(){return nb},W3mUnsupportedChainView:function(){return nx},W3mWalletCompatibleNetworksView:function(){return nk},W3mWhatIsANetworkView:function(){return nv},W3mWhatIsAWalletView:function(){return r7}});var n=r(19045),i=r(94836),o=r(31756),s=r(29607),a=r(39674),c=r(41593),l=r(35143),u=r(83944),d=r(99321),h=r(30397),p=r(78632);r(92706),r(79086),r(93836),r(18749),r(43845);var f=r(70169),g=r(45182),m=r(66704);r(26842);var y=r(73718),b=(0,y.iv)`
26  :host {
27    display: block;
28  }
29
30  button {
31    border-radius: ${({borderRadius:e})=>e["20"]};
32    background: ${({tokens:e})=>e.theme.foregroundPrimary};
33    display: flex;
34    gap: ${({spacing:e})=>e[1]};
35    padding: ${({spacing:e})=>e[1]};
36    color: ${({tokens:e})=>e.theme.textSecondary};
37    border-radius: ${({borderRadius:e})=>e[16]};
38    height: 32px;
39    transition: box-shadow ${({durations:e})=>e.lg}
40      ${({easings:e})=>e["ease-out-power-2"]};
41    will-change: box-shadow;
42  }
43
44  button wui-flex.avatar-container {
45    width: 28px;
46    height: 24px;
47    position: relative;
48
49    wui-flex.network-image-container {
50      position: absolute;
51      bottom: 0px;
52      right: 0px;
53      width: 12px;
54      height: 12px;
55    }
56
57    wui-avatar {
58      width: 24px;
59      min-width: 24px;
60      height: 24px;
61    }
62
63    wui-icon {
64      width: 12px;
65      height: 12px;
66    }
67  }
68
69  wui-image,
70  wui-icon {
71    border-radius: ${({borderRadius:e})=>e[16]};
72  }
73
74  wui-text {
75    white-space: nowrap;
76  }
77
78  button wui-flex.balance-container {
79    height: 100%;
80    border-radius: ${({borderRadius:e})=>e[16]};
81    padding-left: ${({spacing:e})=>e[1]};
82    padding-right: ${({spacing:e})=>e[1]};
83    background: ${({tokens:e})=>e.theme.foregroundSecondary};
84    color: ${({tokens:e})=>e.theme.textPrimary};
85    transition: background-color ${({durations:e})=>e.lg}
86      ${({easings:e})=>e["ease-out-power-2"]};
87    will-change: background-color;
88  }
89
90  /* -- Hover & Active states ----------------------------------------------------------- */
91  button:hover:enabled,
92  button:focus-visible:enabled,
93  button:active:enabled {
94    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.2);
95
96    wui-flex.balance-container {
97      background: ${({tokens:e})=>e.theme.foregroundTertiary};
98    }
99  }
100
101  /* -- Disabled states --------------------------------------------------- */
102  button:disabled wui-text,
103  button:disabled wui-flex.avatar-container {
104    opacity: 0.3;
105  }
106`,w=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let v=class extends n.oi{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.loading=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return(0,n.dy)`
107      <button
108        ?disabled=${this.disabled}
109        class=${(0,o.o)(this.balance?void 0:"local-no-balance")}
110        data-error=${(0,o.o)(this.isUnsupportedChain)}
111      >
112        ${this.imageTemplate()} ${this.addressTemplate()} ${this.balanceTemplate()}
113      </button>
114    `}imageTemplate(){let e=this.networkSrc?(0,n.dy)`<wui-image src=${this.networkSrc}></wui-image>`:(0,n.dy)` <wui-icon size="inherit" color="inherit" icon="networkPlaceholder"></wui-icon> `;return(0,n.dy)`<wui-flex class="avatar-container">
115      <wui-avatar
116        .imageSrc=${this.avatarSrc}
117        alt=${this.address}
118        address=${this.address}
119      ></wui-avatar>
120
121      <wui-flex class="network-image-container">${e}</wui-flex>
122    </wui-flex>`}addressTemplate(){return(0,n.dy)`<wui-text variant="md-regular" color="inherit">
123      ${this.address?g.H.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null}
124    </wui-text>`}balanceTemplate(){if(this.balance){let e=this.loading?(0,n.dy)`<wui-loading-spinner size="md" color="inherit"></wui-loading-spinner>`:(0,n.dy)`<wui-text variant="md-regular" color="inherit"> ${this.balance}</wui-text>`;return(0,n.dy)`<wui-flex alignItems="center" justifyContent="center" class="balance-container"
125        >${e}</wui-flex
126      >`}return null}};v.styles=[f.ET,f.ZM,b],w([(0,i.Cb)()],v.prototype,"networkSrc",void 0),w([(0,i.Cb)()],v.prototype,"avatarSrc",void 0),w([(0,i.Cb)()],v.prototype,"balance",void 0),w([(0,i.Cb)({type:Boolean})],v.prototype,"isUnsupportedChain",void 0),w([(0,i.Cb)({type:Boolean})],v.prototype,"disabled",void 0),w([(0,i.Cb)({type:Boolean})],v.prototype,"loading",void 0),w([(0,i.Cb)()],v.prototype,"address",void 0),w([(0,i.Cb)()],v.prototype,"profileName",void 0),w([(0,i.Cb)()],v.prototype,"charsStart",void 0),w([(0,i.Cb)()],v.prototype,"charsEnd",void 0),v=w([(0,m.M)("wui-account-button")],v);var C=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};class E extends n.oi{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.isSupported=!!s.OptionsController.state.allowUnsupportedChain||!a.R.state.activeChain||a.R.checkIfSupportedNetwork(a.R.state.activeChain)}connectedCallback(){super.connectedCallback(),this.setAccountData(a.R.getAccountData(this.namespace)),this.setNetworkData(a.R.getNetworkData(this.namespace))}firstUpdated(){let e=this.namespace;e?this.unsubscribe.push(a.R.subscribeChainProp("accountState",e=>{this.setAccountData(e)},e),a.R.subscribeChainProp("networkState",t=>{this.setNetworkData(t),this.isSupported=a.R.checkIfSupportedNetwork(e,t?.caipNetwork?.caipNetworkId)},e)):this.unsubscribe.push(c.W.subscribeNetworkImages(()=>{this.networkImage=l.f.getNetworkImage(this.network)}),a.R.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),u.AccountController.subscribeKey("balance",e=>this.balanceVal=e),u.AccountController.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),u.AccountController.subscribeKey("profileName",e=>this.profileName=e),u.AccountController.subscribeKey("profileImage",e=>this.profileImage=e),a.R.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=l.f.getNetworkImage(e),this.isSupported=!e?.chainNamespace||a.R.checkIfSupportedNetwork(e?.chainNamespace),this.fetchNetworkImage(e)}))}updated(){this.fetchNetworkImage(this.network)}
126disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!a.R.state.activeChain)return null;let e="show"===this.balance,t="string"!=typeof this.balanceVal,{formattedText:r}=d.j.parseBalance(this.balanceVal,this.balanceSymbol);return(0,n.dy)`
127      <wui-account-button
128        .disabled=${!!this.disabled}
129        .isUnsupportedChain=${!s.OptionsController.state.allowUnsupportedChain&&!this.isSupported}
130        address=${(0,o.o)(d.j.getPlainAddress(this.caipAddress))}
131        profileName=${(0,o.o)(this.profileName)}
132        networkSrc=${(0,o.o)(this.networkImage)}
133        avatarSrc=${(0,o.o)(this.profileImage)}
134        balance=${e?r:""}
135        @click=${this.onClick.bind(this)}
136        data-testid=${`account-button${this.namespace?`-${this.namespace}`:""}`}
137        .charsStart=${this.charsStart}
138        .charsEnd=${this.charsEnd}
139        ?loading=${t}
140      >
141      </wui-account-button>
142    `}onClick(){this.isSupported||s.OptionsController.state.allowUnsupportedChain?h.I.open({namespace:this.namespace}):h.I.open({view:"UnsupportedChain"})}async fetchNetworkImage(e){e?.assets?.imageId&&(this.networkImage=await l.f.fetchNetworkImage(e?.assets?.imageId))}setAccountData(e){e&&(this.caipAddress=e.caipAddress,this.balanceVal=e.balance,this.balanceSymbol=e.balanceSymbol,this.profileName=e.profileName,this.profileImage=e.profileImage)}setNetworkData(e){e&&(this.network=e.caipNetwork,this.networkImage=l.f.getNetworkImage(e.caipNetwork))}}C([(0,i.Cb)({type:Boolean})],E.prototype,"disabled",void 0),C([(0,i.Cb)()],E.prototype,"balance",void 0),C([(0,i.Cb)()],E.prototype,"charsStart",void 0),C([(0,i.Cb)()],E.prototype,"charsEnd",void 0),C([(0,i.Cb)()],E.prototype,"namespace",void 0),C([(0,i.SB)()],E.prototype,"caipAddress",void 0),C([(0,i.SB)()],E.prototype,"balanceVal",void 0),C([(0,i.SB)()],E.prototype,"balanceSymbol",void 0),C([(0,i.SB)()],E.prototype,"profileName",void 0),C([(0,i.SB)()],E.prototype,"profileImage",void 0),C([(0,i.SB)()],E.prototype,"network",void 0),C([(0,i.SB)()],E.prototype,"networkImage",void 0),C([(0,i.SB)()],E.prototype,"isSupported",void 0);let x=class extends E{};x=C([(0,p.Mo)("w3m-account-button")],x);let A=class extends E{};A=C([(0,p.Mo)("appkit-account-button")],A);var S=(0,n.iv)`
143  :host {
144    display: block;
145    width: max-content;
146  }
147`,_=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};class I extends n.oi{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.namespace=void 0}firstUpdated(){this.caipAddress=this.namespace?a.R.state.chains.get(this.namespace)?.accountState?.caipAddress:a.R.state.activeCaipAddress,this.namespace?this.unsubscribe.push(a.R.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress},this.namespace)):this.unsubscribe.push(a.R.subscribeKey("activeCaipAddress",e=>this.caipAddress=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress?(0,n.dy)`
148          <appkit-account-button
149            .disabled=${!!this.disabled}
150            balance=${(0,o.o)(this.balance)}
151            .charsStart=${(0,o.o)(this.charsStart)}
152            .charsEnd=${(0,o.o)(this.charsEnd)}
153            namespace=${(0,o.o)(this.namespace)}
154          >
155          </appkit-account-button>
156        `:(0,n.dy)`
157          <appkit-connect-button
158            size=${(0,o.o)(this.size)}
159            label=${(0,o.o)(this.label)}
160            loadingLabel=${(0,o.o)(this.loadingLabel)}
161            namespace=${(0,o.o)(this.namespace)}
162          ></appkit-connect-button>
163        `}}I.styles=S,_([(0,i.Cb)({type:Boolean})],I.prototype,"disabled",void 0),_([(0,i.Cb)()],I.prototype,"balance",void 0),_([(0,i.Cb)()],I.prototype,"size",void 0),_([(0,i.Cb)()],I.prototype,"label",void 0),_([(0,i.Cb)()],I.prototype,"loadingLabel",void 0),_([(0,i.Cb)()],I.prototype,"charsStart",void 0),_([(0,i.Cb)()],I.prototype,"charsEnd",void 0),_([(0,i.Cb)()],I.prototype,"namespace",void 0),_([(0,i.SB)()],I.prototype,"caipAddress",void 0);let k=class extends I{};k=_([(0,p.Mo)("w3m-button")],k);let O=class extends I{};O=_([(0,p.Mo)("appkit-button")],O);var N=(0,y.iv)`
164  :host {
165    position: relative;
166    display: block;
167  }
168
169  button {
170    border-radius: ${({borderRadius:e})=>e[2]};
171  }
172
173  button[data-size='sm'] {
174    padding: ${({spacing:e})=>e[2]};
175  }
176
177  button[data-size='md'] {
178    padding: ${({spacing:e})=>e[3]};
179  }
180
181  button[data-size='lg'] {
182    padding: ${({spacing:e})=>e[4]};
183  }
184
185  button[data-variant='primary'] {
186    background: ${({tokens:e})=>e.core.backgroundAccentPrimary};
187  }
188
189  button[data-variant='secondary'] {
190    background: ${({tokens:e})=>e.core.foregroundAccent010};
191  }
192
193  button:hover:enabled {
194    border-radius: ${({borderRadius:e})=>e[3]};
195  }
196
197  button:disabled {
198    cursor: not-allowed;
199  }
200
201  button[data-loading='true'] {
202    cursor: not-allowed;
203  }
204
205  button[data-loading='true'][data-size='sm'] {
206    border-radius: ${({borderRadius:e})=>e[32]};
207    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]};
208  }
209
210  button[data-loading='true'][data-size='md'] {
211    border-radius: ${({borderRadius:e})=>e[20]};
212    padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[4]};
213  }
214
215  button[data-loading='true'][data-size='lg'] {
216    border-radius: ${({borderRadius:e})=>e[16]};
217    padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[5]};
218  }
219`,P=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let T=class extends n.oi{constructor(){super(...arguments),this.size="md",this.variant="primary",this.loading=!1,this.text="Connect Wallet"}render(){return(0,n.dy)`
220      <button
221        data-loading=${this.loading}
222        data-variant=${this.variant}
223        data-size=${this.size}
224        ?disabled=${this.loading}
225      >
226        ${this.contentTemplate()}
227      </button>
228    `}contentTemplate(){let e={primary:"invert",secondary:"accent-primary"};return this.loading?(0,n.dy)`<wui-loading-spinner
229      color=${e[this.variant]}
230      size=${this.size}
231    ></wui-loading-spinner>`:(0,n.dy)` <wui-text variant=${({lg:"lg-regular",md:"md-regular",sm:"sm-regular"})[this.size]} color=${e[this.variant]}>
232        ${this.text}
233      </wui-text>`}};T.styles=[f.ET,f.ZM,N],P([(0,i.Cb)()],T.prototype,"size",void 0),P([(0,i.Cb)()],T.prototype,"variant",void 0),P([(0,i.Cb)({type:Boolean})],T.prototype,"loading",void 0),P([(0,i.Cb)()],T.prototype,"text",void 0),T=P([(0,m.M)("wui-connect-button")],T);var R=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};class $ extends n.oi{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=h.I.state.open,this.loading=this.namespace?h.I.state.loadingNamespaceMap.get(this.namespace):h.I.state.loading,this.unsubscribe.push(h.I.subscribe(e=>{this.open=e.open,this.loading=this.namespace?e.loadingNamespaceMap.get(this.namespace):e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)`
234      <wui-connect-button
235        size=${(0,o.o)(this.size)}
236        .loading=${this.loading}
237        @click=${this.onClick.bind(this)}
238        data-testid=${`connect-button${this.namespace?`-${this.namespace}`:""}`}
239      >
240        ${this.loading?this.loadingLabel:this.label}
241      </wui-connect-button>
242    `}onClick(){this.open?h.I.close():this.loading||h.I.open({view:"Connect",namespace:this.namespace})}}R([(0,i.Cb)()],$.prototype,"size",void 0),R([(0,i.Cb)()],$.prototype,"label",void 0),R([(0,i.Cb)()],$.prototype,"loadingLabel",void 0),R([(0,i.Cb)()],$.prototype,"namespace",void 0),R([(0,i.SB)()],$.prototype,"open",void 0),R([(0,i.SB)()],$.prototype,"loading",void 0);let D=class extends ${};D=R([(0,p.Mo)("w3m-connect-button")],D);let L=class extends ${};L=R([(0,p.Mo)("appkit-connect-button")],L);var M=r(46001);r(94272);var U=(0,y.iv)`
243  :host {
244    display: block;
245  }
246
247  button {
248    border-radius: ${({borderRadius:e})=>e[32]};
249    display: flex;
250    gap: ${({spacing:e})=>e[1]};
251    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]}
252      ${({spacing:e})=>e[1]} ${({spacing:e})=>e[1]};
253    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
254  }
255
256  button:disabled {
257    opacity: 0.5;
258    cursor: not-allowed;
259  }
260
261  @media (hover: hover) {
262    button:hover:enabled {
263      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
264    }
265  }
266
267  button[data-size='sm'] > wui-icon-box,
268  button[data-size='sm'] > wui-image {
269    width: 16px;
270    height: 16px;
271  }
272
273  button[data-size='md'] > wui-icon-box,
274  button[data-size='md'] > wui-image {
275    width: 20px;
276    height: 20px;
277  }
278
279  button[data-size='lg'] > wui-icon-box,
280  button[data-size='lg'] > wui-image {
281    width: 24px;
282    height: 24px;
283  }
284
285  wui-image,
286  wui-icon-box {
287    border-radius: ${({borderRadius:e})=>e[32]};
288  }
289`,j=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let B=class extends n.oi{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.size="lg"}render(){return(0,n.dy)`
290      <button data-size=${this.size} data-testid="wui-network-button" ?disabled=${this.disabled}>
291        ${this.visualTemplate()}
292        <wui-text variant=${({sm:"sm-regular",md:"md-regular",lg:"lg-regular"})[this.size]} color="primary">
293          <slot></slot>
294        </wui-text>
295      </button>
296    `}visualTemplate(){return this.isUnsupportedChain?(0,n.dy)` <wui-icon-box color="error" icon="warningCircle"></wui-icon-box> `:this.imageSrc?(0,n.dy)`<wui-image src=${this.imageSrc}></wui-image>`:(0,n.dy)` <wui-icon-box color="default" icon="networkPlaceholder"></wui-icon-box> `}};B.styles=[f.ET,f.ZM,U],j([(0,i.Cb)()],B.prototype,"imageSrc",void 0),j([(0,i.Cb)({type:Boolean})],B.prototype,"isUnsupportedChain",void 0),j([(0,i.Cb)({type:Boolean})],B.prototype,"disabled",void 0),j([(0,i.Cb)()],B.prototype,"size",void 0),B=j([(0,m.M)("wui-network-button")],B);var F=(0,n.iv)`
297  :host {
298    display: block;
299    width: max-content;
300  }
301`,z=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};class H extends n.oi{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=a.R.state.activeCaipNetwork,this.networkImage=l.f.getNetworkImage(this.network),this.caipAddress=a.R.state.activeCaipAddress,this.loading=h.I.state.loading,this.isSupported=!!s.OptionsController.state.allowUnsupportedChain||!a.R.state.activeChain||a.R.checkIfSupportedNetwork(a.R.state.activeChain),this.unsubscribe.push(c.W.subscribeNetworkImages(()=>{this.networkImage=l.f.getNetworkImage(this.network)}),a.R.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),a.R.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=l.f.getNetworkImage(e),this.isSupported=!e?.chainNamespace||a.R.checkIfSupportedNetwork(e.chainNamespace),l.f.fetchNetworkImage(e?.assets?.imageId)}),h.I.subscribeKey("loading",e=>this.loading=e))}firstUpdated(){l.f.fetchNetworkImage(this.network?.assets?.imageId)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=!this.network||a.R.checkIfSupportedNetwork(this.network.chainNamespace);return(0,n.dy)`
302      <wui-network-button
303        .disabled=${!!(this.disabled||this.loading)}
304        .isUnsupportedChain=${!s.OptionsController.state.allowUnsupportedChain&&!e}
305        imageSrc=${(0,o.o)(this.networkImage)}
306        @click=${this.onClick.bind(this)}
307        data-testid="w3m-network-button"
308      >
309        ${this.getLabel()}
310        <slot></slot>
311      </wui-network-button>
312    `}getLabel(){return this.network?this.isSupported||s.OptionsController.state.allowUnsupportedChain?this.network.name:"Switch Network":this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(M.X.sendEvent({type:"track",event:"CLICK_NETWORKS"}),h.I.open({view:"Networks"}))}}H.styles=F,z([(0,i.Cb)({type:Boolean})],H.prototype,"disabled",void 0),z([(0,i.Cb)({type:String})],H.prototype,"label",void 0),z([(0,i.SB)()],H.prototype,"network",void 0),z([(0,i.SB)()],H.prototype,"networkImage",void 0),z([(0,i.SB)()],H.prototype,"caipAddress",void 0),z([(0,i.SB)()],H.prototype,"loading",void 0),z([(0,i.SB)()],H.prototype,"isSupported",void 0);let W=class extends H{};W=z([(0,p.Mo)("w3m-network-button")],W);let q=class extends H{};q=z([(0,p.Mo)("appkit-network-button")],q);var V=r(31349),K=r(71897),G=r(42036),Z=r(20274),Y=r(23829),J=r(65045),X=r(62250),Q=r(83764),ee=r(59449),et=r(25969);r(29557),r(19549),r(40135),r(95547);var er=(0,y.iv)`
313  :host {
314    display: block;
315  }
316
317  button {
318    width: 100%;
319    display: flex;
320    align-items: center;
321    justify-content: space-between;
322    gap: ${({spacing:e})=>e[4]};
323    padding: ${({spacing:e})=>e[3]};
324    border-radius: ${({borderRadius:e})=>e[4]};
325    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
326  }
327
328  wui-flex > wui-icon {
329    padding: ${({spacing:e})=>e[2]};
330    color: ${({tokens:e})=>e.theme.textInvert};
331    background-color: ${({tokens:e})=>e.core.backgroundAccentPrimary};
332    border-radius: ${({borderRadius:e})=>e[2]};
333    align-items: normal;
334  }
335
336  @media (hover: hover) {
337    button:hover:enabled {
338      background-color: ${({tokens:e})=>e.core.foregroundAccent020};
339    }
340  }
341`,en=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ei=class extends n.oi{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return(0,n.dy)`
342      <button>
343        <wui-flex gap="2" alignItems="center">
344          <wui-icon weight="fill" size="md" name=${this.icon} color="inherit"></wui-icon>
345          <wui-flex flexDirection="column" gap="1">
346            <wui-text variant="md-medium" color="primary">${this.label}</wui-text>
347            <wui-text variant="md-regular" color="tertiary">${this.description}</wui-text>
348          </wui-flex>
349        </wui-flex>
350        <wui-icon size="lg" color="accent-primary" name="chevronRight"></wui-icon>
351      </button>
352    `}};ei.styles=[f.ET,f.ZM,er],en([(0,i.Cb)()],ei.prototype,"label",void 0),en([(0,i.Cb)()],ei.prototype,"description",void 0),en([(0,i.Cb)()],ei.prototype,"icon",void 0),ei=en([(0,m.M)("wui-notice-card")],ei),r(22939);var eo=r(49854),es=r(33802),ea=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ec=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.socialProvider=es.M.getConnectedSocialProvider(),this.socialUsername=es.M.getConnectedSocialUsername(),this.namespace=a.R.state.activeChain,this.unsubscribe.push(a.R.subscribeKey("activeChain",e=>{this.namespace=e}))}
352disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=Z.ConnectorController.getConnectorId(this.namespace),t=Z.ConnectorController.getAuthConnector();if(!t||e!==G.b.CONNECTOR_ID.AUTH)return this.style.cssText="display: none",null;let r=t.provider.getEmail()??"";return r||this.socialUsername?(0,n.dy)`
353      <wui-list-item
354        ?rounded=${!0}
355        icon=${this.socialProvider??"mail"}
356        data-testid="w3m-account-email-update"
357        ?chevron=${!this.socialProvider}
358        @click=${()=>{this.onGoToUpdateEmail(r,this.socialProvider)}}
359      >
360        <wui-text variant="lg-regular" color="primary">${this.getAuthName(r)}</wui-text>
361      </wui-list-item>
362    `:(this.style.cssText="display: none",null)}onGoToUpdateEmail(e,t){t||Q.RouterController.push("UpdateEmailWallet",{email:e,redirectView:"Account"})}getAuthName(e){return this.socialUsername?"discord"===this.socialProvider&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};ea([(0,i.SB)()],ec.prototype,"namespace",void 0),ec=ea([(0,p.Mo)("w3m-account-auth-button")],ec);var el=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eu=class extends n.oi{constructor(){super(),this.usubscribe=[],this.networkImages=c.W.state.networkImages,this.address=u.AccountController.state.address,this.profileImage=u.AccountController.state.profileImage,this.profileName=u.AccountController.state.profileName,this.network=a.R.state.activeCaipNetwork,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.usubscribe.push(u.AccountController.subscribe(e=>{e.address&&(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName)}),a.R.subscribeKey("activeCaipNetwork",e=>{e?.id&&(this.network=e)}),s.OptionsController.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw Error("w3m-account-settings-view: No account provided");let e=this.networkImages[this.network?.assets?.imageId??""];return(0,n.dy)`
363      <wui-flex
364        flexDirection="column"
365        alignItems="center"
366        gap="4"
367        .padding=${["0","5","3","5"]}
368      >
369        <wui-avatar
370          alt=${this.address}
371          address=${this.address}
372          imageSrc=${(0,o.o)(this.profileImage)}
373          size="lg"
374        ></wui-avatar>
375        <wui-flex flexDirection="column" alignItems="center">
376          <wui-flex gap="1" alignItems="center" justifyContent="center">
377            <wui-text variant="h5-medium" color="primary" data-testid="account-settings-address">
378              ${p.Hg.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
379            </wui-text>
380            <wui-icon-link
381              size="md"
382              icon="copy"
383              iconColor="default"
384              @click=${this.onCopyAddress}
385            ></wui-icon-link>
386          </wui-flex>
387        </wui-flex>
388      </wui-flex>
389      <wui-flex flexDirection="column" gap="4">
390        <wui-flex flexDirection="column" gap="2" .padding=${["6","4","3","4"]}>
391          ${this.authCardTemplate()}
392          <w3m-account-auth-button></w3m-account-auth-button>
393          <wui-list-item
394            imageSrc=${(0,o.o)(e)}
395            ?chevron=${this.isAllowedNetworkSwitch()}
396            ?fullSize=${!0}
397            ?rounded=${!0}
398            @click=${this.onNetworks.bind(this)}
399            data-testid="account-switch-network-button"
400          >
401            <wui-text variant="lg-regular" color="primary">
402              ${this.network?.name??"Unknown"}
403            </wui-text>
404          </wui-list-item>
405          ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()}
406          <wui-list-item
407            ?rounded=${!0}
408            icon="power"
409            iconColor="error"
410            ?chevron=${!1}
411            .loading=${this.disconnecting}
412            @click=${this.onDisconnect.bind(this)}
413            data-testid="disconnect-button"
414          >
415            <wui-text variant="lg-regular" color="primary">Disconnect</wui-text>
416          </wui-list-item>
417        </wui-flex>
418      </wui-flex>
419    `}chooseNameButtonTemplate(){let e=this.network?.chainNamespace,t=Z.ConnectorController.getConnectorId(e),r=Z.ConnectorController.getAuthConnector();return a.R.checkIfNamesSupported()&&r&&t===G.b.CONNECTOR_ID.AUTH&&!this.profileName?(0,n.dy)`
420      <wui-list-item
421        icon="id"
422        ?rounded=${!0}
423        ?chevron=${!0}
424        @click=${this.onChooseName.bind(this)}
425        data-testid="account-choose-name-button"
426      >
427        <wui-text variant="lg-regular" color="primary">Choose account name </wui-text>
428      </wui-list-item>
429    `:null}authCardTemplate(){let e=Z.ConnectorController.getConnectorId(this.network?.chainNamespace),t=Z.ConnectorController.getAuthConnector(),{origin:r}=location;return!t||e!==G.b.CONNECTOR_ID.AUTH||r.includes(Y.bq.SECURE_SITE)?null:(0,n.dy)`
430      <wui-notice-card
431        @click=${this.onGoToUpgradeView.bind(this)}
432        label="Upgrade your wallet"
433        description="Transition to a self-custodial wallet"
434        icon="wallet"
435        data-testid="w3m-wallet-upgrade-card"
436      ></wui-notice-card>
437    `}isAllowedNetworkSwitch(){let e=a.R.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,r=e?.find(({id:e})=>e===this.network?.id);return t||!r}onCopyAddress(){try{this.address&&(d.j.copyToClopboard(this.address),J.SnackController.showSuccess("Address copied"))}catch{J.SnackController.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){let e=this.network?.chainNamespace,t=a.R.checkIfSmartAccountEnabled(),r=Z.ConnectorController.getConnectorId(e);
437return Z.ConnectorController.getAuthConnector()&&r===G.b.CONNECTOR_ID.AUTH&&t?(this.switched||(this.text=(0,X.r9)(e)===eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account"),(0,n.dy)`
438      <wui-list-item
439        icon="swapHorizontal"
440        ?rounded=${!0}
441        ?chevron=${!0}
442        ?loading=${this.loading}
443        @click=${this.changePreferredAccountType.bind(this)}
444        data-testid="account-toggle-preferred-account-type"
445      >
446        <wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
447      </wui-list-item>
448    `):null}onChooseName(){Q.RouterController.push("ChooseAccountName")}async changePreferredAccountType(){let e=this.network?.chainNamespace,t=a.R.checkIfSmartAccountEnabled(),r=(0,X.r9)(e)!==eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT&&t?eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT:eo.y_.ACCOUNT_TYPES.EOA;Z.ConnectorController.getAuthConnector()&&(this.loading=!0,await ee.ConnectionController.setPreferredAccountType(r,e),this.text=r===eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account",this.switched=!0,et.S.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&Q.RouterController.push("Networks")}async onDisconnect(){try{this.disconnecting=!0;let e=this.network?.chainNamespace,t=ee.ConnectionController.getConnections(e).length>0,r=e&&Z.ConnectorController.state.activeConnectorIds[e],n=this.remoteFeatures?.multiWallet;await ee.ConnectionController.disconnect(n?{id:r,namespace:e}:{}),t&&n&&(Q.RouterController.push("ProfileWallets"),J.SnackController.showSuccess("Wallet deleted"))}catch{M.X.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),J.SnackController.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){M.X.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),Q.RouterController.push("UpgradeEmailWallet")}};el([(0,i.SB)()],eu.prototype,"address",void 0),el([(0,i.SB)()],eu.prototype,"profileImage",void 0),el([(0,i.SB)()],eu.prototype,"profileName",void 0),el([(0,i.SB)()],eu.prototype,"network",void 0),el([(0,i.SB)()],eu.prototype,"disconnecting",void 0),el([(0,i.SB)()],eu.prototype,"loading",void 0),el([(0,i.SB)()],eu.prototype,"switched",void 0),el([(0,i.SB)()],eu.prototype,"text",void 0),el([(0,i.SB)()],eu.prototype,"remoteFeatures",void 0),eu=el([(0,p.Mo)("w3m-account-settings-view")],eu),r(86841),r(85302);var ed=(0,y.iv)`
449  :host {
450    flex: 1;
451    height: 100%;
452  }
453
454  button {
455    width: 100%;
456    height: 100%;
457    display: inline-flex;
458    align-items: center;
459    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
460    column-gap: ${({spacing:e})=>e[1]};
461    color: ${({tokens:e})=>e.theme.textSecondary};
462    border-radius: ${({borderRadius:e})=>e[20]};
463    background-color: transparent;
464    transition: background-color ${({durations:e})=>e.lg}
465      ${({easings:e})=>e["ease-out-power-2"]};
466    will-change: background-color;
467  }
468
469  /* -- Hover & Active states ----------------------------------------------------------- */
470  button[data-active='true'] {
471    color: ${({tokens:e})=>e.theme.textPrimary};
472    background-color: ${({tokens:e})=>e.theme.foregroundTertiary};
473  }
474
475  button:hover:enabled:not([data-active='true']),
476  button:active:enabled:not([data-active='true']) {
477    wui-text,
478    wui-icon {
479      color: ${({tokens:e})=>e.theme.textPrimary};
480    }
481  }
482`,eh=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ep={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},ef={lg:"md",md:"sm",sm:"sm"},eg=class extends n.oi{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return(0,n.dy)`
483      <button data-active=${this.active}>
484        ${this.icon?(0,n.dy)`<wui-icon size=${ef[this.size]} name=${this.icon}></wui-icon>`:""}
485        <wui-text variant=${ep[this.size]}> ${this.label} </wui-text>
486      </button>
487    `}};eg.styles=[f.ET,f.ZM,ed],eh([(0,i.Cb)()],eg.prototype,"icon",void 0),eh([(0,i.Cb)()],eg.prototype,"size",void 0),eh([(0,i.Cb)()],eg.prototype,"label",void 0),eh([(0,i.Cb)({type:Boolean})],eg.prototype,"active",void 0),eg=eh([(0,m.M)("wui-tab-item")],eg);var em=(0,y.iv)`
488  :host {
489    display: inline-flex;
490    align-items: center;
491    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
492    border-radius: ${({borderRadius:e})=>e[32]};
493    padding: ${({spacing:e})=>e["01"]};
494    box-sizing: border-box;
495  }
496
497  :host([data-size='sm']) {
498    height: 26px;
499  }
500
501  :host([data-size='md']) {
502    height: 36px;
503  }
504`,ey=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eb=class extends n.oi{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map((e,t)=>{let r=t===this.activeTab;return(0,n.dy)`
505        <wui-tab-item
506          @click=${()=>this.onTabClick(t)}
507          icon=${e.icon}
508          size=${this.size}
509          label=${e.label}
510          ?active=${r}
511          data-active=${r}
512          data-testid="tab-${e.label?.toLowerCase()}"
513        ></wui-tab-item>
514      `})}onTabClick(e){this.activeTab=e,this.onTabChange(e)}};eb.styles=[f.ET,f.ZM,em],ey([(0,i.Cb)({type:Array})],eb.prototype,"tabs",void 0),ey([(0,i.Cb)()],eb.prototype,"onTabChange",void 0),ey([(0,i.Cb)()],eb.prototype,"size",void 0),ey([(0,i.SB)()],eb.prototype,"activeTab",void 0),eb=ey([(0,m.M)("wui-tabs")],eb),r(73316);var ew=(0,y.iv)`
515  button {
516    display: flex;
517    align-items: center;
518    height: 40px;
519    padding: ${({spacing:e})=>e[2]};
520    border-radius: ${({borderRadius:e})=>e[4]};
521    column-gap: ${({spacing:e})=>e[1]};
522    background-color: transparent;
523    transition: background-color ${({durations:e})=>e.lg}
524      ${({easings:e})=>e["ease-out-power-2"]};
525    will-change: background-color;
526  }
527
528  wui-image,
529  .icon-box {
530    width: ${({spacing:e})=>e[6]};
531    height: ${({spacing:e})=>e[6]};
532    border-radius: ${({borderRadius:e})=>e[4]};
533  }
534
535  wui-text {
536    flex: 1;
537  }
538
539  .icon-box {
540    position: relative;
541  }
542
543  .icon-box[data-active='true'] {
544    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
545  }
546
547  .circle {
548    position: absolute;
549    left: 16px;
550    top: 15px;
551    width: 8px;
552    height: 8px;
553    background-color: ${({tokens:e})=>e.core.textSuccess};
554    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.foregroundPrimary};
555    border-radius: 50%;
556  }
557
558  /* -- Hover & Active states ----------------------------------------------------------- */
559  @media (hover: hover) {
560    button:hover:enabled,
561    button:active:enabled {
562      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
563    }
564  }
565`,ev=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eC=class extends n.oi{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,n.dy)`
566      <button>
567        ${this.leftImageTemplate()} ${this.textTemplate()} ${this.rightImageTemplate()}
568      </button>
569    `}leftImageTemplate(){let e=this.icon?(0,n.dy)`<wui-icon
570          size=${(0,o.o)(this.iconSize)}
571          color="default"
572          name=${this.icon}
573          class="icon"
574        ></wui-icon>`:(0,n.dy)`<wui-image src=${this.imageSrc} alt=${this.alt}></wui-image>`;return(0,n.dy)`
575      <wui-flex
576        alignItems="center"
577        justifyContent="center"
578        class="icon-box"
579        data-active=${!!this.icon}
580      >
581        ${e}
582        <wui-flex class="circle"></wui-flex>
583      </wui-flex>
584    `}textTemplate(){return(0,n.dy)`
585      <wui-text variant="lg-regular" color="primary">
586        ${g.H.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
587      </wui-text>
588    `}rightImageTemplate(){return(0,n.dy)`<wui-icon name="chevronBottom" size="sm" color="default"></wui-icon>`}};eC.styles=[f.ET,f.ZM,ew],ev([(0,i.Cb)()],eC.prototype,"address",void 0),ev([(0,i.Cb)()],eC.prototype,"profileName",void 0),ev([(0,i.Cb)()],eC.prototype,"alt",void 0),ev([(0,i.Cb)()],eC.prototype,"imageSrc",void 0),ev([(0,i.Cb)()],eC.prototype,"icon",void 0),ev([(0,i.Cb)()],eC.prototype,"iconSize",void 0),ev([(0,i.Cb)({type:Boolean})],eC.prototype,"loading",void 0),ev([(0,i.Cb)({type:Number})],eC.prototype,"charsStart",void 0),ev([(0,i.Cb)({type:Number})],eC.prototype,"charsEnd",void 0),eC=ev([(0,m.M)("wui-wallet-switch")],eC);var eE=(0,p.iv)`
589  wui-icon-link {
590    margin-right: calc(${({spacing:e})=>e["8"]} * -1);
591  }
592
593  wui-notice-card {
594    margin-bottom: ${({spacing:e})=>e["1"]};
595  }
596
597  wui-list-item > wui-text {
598    flex: 1;
599  }
600
601  w3m-transactions-view {
602    max-height: 200px;
603  }
604
605  .tab-content-container {
606    height: 300px;
607    overflow-y: auto;
608    overflow-x: hidden;
609    scrollbar-width: none;
610  }
611
612  .tab-content-container::-webkit-scrollbar {
613    display: none;
614  }
615
616  .account-button {
617    width: auto;
618    border: none;
619    display: flex;
620    align-items: center;
621    justify-content: center;
622    gap: ${({spacing:e})=>e["3"]};
623    height: 48px;
624    padding: ${({spacing:e})=>e["2"]};
625    padding-right: ${({spacing:e})=>e["3"]};
626    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
627    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
628    border-radius: ${({borderRadius:e})=>e[6]};
629    transition: background-color ${({durations:e})=>e.lg}
630      ${({easings:e})=>e["ease-out-power-2"]};
631  }
632
633  .account-button:hover {
634    background-color: ${({tokens:e})=>e.core.glass010};
635  }
636
637  .avatar-container {
638    position: relative;
639  }
640
641  wui-avatar.avatar {
642    width: 32px;
643    height: 32px;
644    box-shadow: 0 0 0 2px ${({tokens:e})=>e.core.glass010};
645  }
646
647  wui-wallet-switch {
648    margin-top: ${({spacing:e})=>e["2"]};
649  }
650
651  wui-avatar.network-avatar {
652    width: 16px;
653    height: 16px;
654    position: absolute;
655    left: 100%;
656    top: 100%;
657    transform: translate(-75%, -75%);
658    box-shadow: 0 0 0 2px ${({tokens:e})=>e.core.glass010};
659  }
660
661  .account-links {
662    display: flex;
663    justify-content: space-between;
664    align-items: center;
665  }
666
667  .account-links wui-flex {
668    cursor: pointer;
669    display: flex;
670    align-items: center;
671    justify-content: center;
672    flex: 1;
673    background: red;
674    align-items: center;
675    justify-content: center;
676    height: 48px;
677    padding: 10px;
678    flex: 1 0 0;
679    border-radius: var(--XS, 16px);
680    border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
681    background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
682    transition:
683      background-color ${({durations:e})=>e.md}
684        ${({easings:e})=>e["ease-out-power-1"]},
685      opacity ${({durations:e})=>e.md} ${({easings:e})=>e["ease-out-power-1"]};
686    will-change: background-color, opacity;
687  }
688
689  .account-links wui-flex:hover {
690    background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
691  }
692
693  .account-links wui-flex wui-icon {
694    width: var(--S, 20px);
695    height: var(--S, 20px);
696  }
697
698  .account-links wui-flex wui-icon svg path {
699    stroke: #667dff;
700  }
701`,ex=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eA=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.caipAddress=u.AccountController.state.caipAddress,this.address=d.j.getPlainAddress(u.AccountController.state.caipAddress),this.profileImage=u.AccountController.state.profileImage,this.profileName=u.AccountController.state.profileName,this.disconnecting=!1,this.balance=u.AccountController.state.balance,this.balanceSymbol=u.AccountController.state.balanceSymbol,this.features=s.OptionsController.state.features,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.namespace=a.R.state.activeChain,this.activeConnectorIds=Z.ConnectorController.state.activeConnectorIds,this.unsubscribe.push(u.AccountController.subscribeKey("caipAddress",e=>{this.address=d.j.getPlainAddress(e),this.caipAddress=e}),u.AccountController.subscribeKey("balance",e=>this.balance=e),u.AccountController.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),u.AccountController.subscribeKey("profileName",e=>this.profileName=e),u.AccountController.subscribeKey("profileImage",e=>this.profileImage=e),s.OptionsController.subscribeKey("features",e=>this.features=e),s.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),Z.ConnectorController.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),a.R.subscribeKey("activeChain",e=>this.namespace=e),a.R.subscribeKey("activeCaipNetwork",e=>{e?.chainNamespace&&(this.namespace=e?.chainNamespace)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress||!this.namespace)return null;let e=this.activeConnectorIds[this.namespace],t=e?Z.ConnectorController.getConnectorById(e):void 0,r=l.f.getConnectorImage(t),{value:i,decimals:s,symbol:a}=d.j.parseBalance(this.balance,this.balanceSymbol);return(0,n.dy)`<wui-flex
702        flexDirection="column"
703        .padding=${["0","5","4","5"]}
704        alignItems="center"
705        gap="3"
706      >
707        <wui-avatar
708          alt=${(0,o.o)(this.caipAddress)}
709          address=${(0,o.o)(d.j.getPlainAddress(this.caipAddress))}
710          imageSrc=${(0,o.o)(null===this.profileImage?void 0:this.profileImage)}
711          data-testid="single-account-avatar"
712        ></wui-avatar>
713        <wui-wallet-switch
714          profileName=${this.profileName}
715          address=${this.address}
716          imageSrc=${r}
717          alt=${t?.name}
718          @click=${this.onGoToProfileWalletsView.bind(this)}
719          data-testid="wui-wallet-switch"
720        ></wui-wallet-switch>
721        <wui-flex flexDirection="row" alignItems="flex-end" justifyContent="center" gap="1">
722          <wui-text variant="h3-regular" color="primary">${i}</wui-text>
723          <wui-text variant="h3-regular" color="secondary">.${s}</wui-text>
724          <wui-text variant="h6-medium" color="primary">${a}</wui-text>
725        </wui-flex>
726        ${this.explorerBtnTemplate()}
727      </wui-flex>
728
729      <wui-flex flexDirection="column" gap="2" .padding=${["0","3","3","3"]}>
730        ${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button>
731        ${this.orderedFeaturesTemplate()} ${this.activityTemplate()}
732        <wui-list-item
733          .rounded=${!0}
734          icon="power"
735          iconColor="error"
736          ?chevron=${!1}
737          .loading=${this.disconnecting}
738          .rightIcon=${!1}
739          @click=${this.onDisconnect.bind(this)}
740          data-testid="disconnect-button"
741        >
742          <wui-text variant="lg-regular" color="primary">Disconnect</wui-text>
743        </wui-list-item>
744      </wui-flex>`}fundWalletTemplate(){if(!this.namespace)return null;let e=Y.bq.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),t=Y.bq.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),r=!!this.features?.receive,i=this.remoteFeatures?.onramp&&e,o=this.remoteFeatures?.payWithExchange&&t;return i||r||o?(0,n.dy)`
745      <wui-list-item
746        .rounded=${!0}
747        data-testid="w3m-account-default-fund-wallet-button"
748        iconVariant="blue"
749        icon="dollar"
750        ?chevron=${!0}
751        @click=${this.handleClickFundWallet.bind(this)}
752      >
753        <wui-text variant="lg-regular" color="primary">Fund wallet</wui-text>
754      </wui-list-item>
755    `:null}orderedFeaturesTemplate(){return(this.features?.walletFeaturesOrder||Y.bq.DEFAULT_FEATURES.walletFeaturesOrder).map(e=>{switch(e){case"onramp":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}activityTemplate(){return this.namespace&&this.remoteFeatures?.activity&&Y.bq.ACTIVITY_ENABLED_CHAIN_NAMESPACES.includes(this.namespace)?(0,n.dy)` <wui-list-item
756          .rounded=${!0}
757          icon="clock"
758          ?chevron=${!0}
759          @click=${this.onTransactions.bind(this)}
760          data-testid="w3m-account-default-activity-button"
761        >
762          <wui-text variant="lg-regular" color="primary">Activity</wui-text>
763        </wui-list-item>`:null}swapsTemplate(){let e=this.remoteFeatures?.swaps,t=a.R.state.activeChain===G.b.CHAIN.EVM;return e&&t?(0,n.dy)`
764      <wui-list-item
765        .rounded=${!0}
766        icon="recycleHorizontal"
767        ?chevron=${!0}
768        @click=${this.handleClickSwap.bind(this)}
769        data-testid="w3m-account-default-swaps-button"
770      >
771        <wui-text variant="lg-regular" color="primary">Swap</wui-text>
772      </wui-list-item>
773    `:null}sendTemplate(){let e=this.features?.send,t=a.R.state.activeChain;if(!t)throw Error("SendController:sendTemplate - namespace is required");let r=Y.bq.SEND_SUPPORTED_NAMESPACES.includes(t);return e&&r?(0,n.dy)`
774      <wui-list-item
775        .rounded=${!0}
776        icon="send"
777        ?chevron=${!0}
778        @click=${this.handleClickSend.bind(this)}
779        data-testid="w3m-account-default-send-button"
780      >
781        <wui-text variant="lg-regular" color="primary">Send</wui-text>
782      </wui-list-item>
783    `:null}authCardTemplate(){let e=a.R.state.activeChain;if(!e)throw Error("AuthCardTemplate:authCardTemplate - namespace is required");let t=Z.ConnectorController.getConnectorId(e),r=Z.ConnectorController.getAuthConnector(),{origin:i}=location;return!r||t!==G.b.CONNECTOR_ID.AUTH||i.includes(Y.bq.SECURE_SITE)?null:(0,n.dy)`
784      <wui-notice-card
785        @click=${this.onGoToUpgradeView.bind(this)}
786        label="Upgrade your wallet"
787        description="Transition to a self-custodial wallet"
788        icon="wallet"
789        data-testid="w3m-wallet-upgrade-card"
790      ></wui-notice-card>
791    `}handleClickFundWallet(){Q.RouterController.push("FundWallet")}handleClickSwap(){Q.RouterController.push("Swap")}handleClickSend(){Q.RouterController.push("WalletSend")}explorerBtnTemplate(){return u.AccountController.state.addressExplorerUrl?(0,n.dy)`
792      <wui-button size="md" variant="accent-primary" @click=${this.onExplorer.bind(this)}>
793        <wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon>
794        Block Explorer
795        <wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon>
796      </wui-button>
797    `:null}onTransactions(){M.X.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:(0,X.r9)(a.R.state.activeChain)===eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}),Q.RouterController.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0;let e=ee.ConnectionController.getConnections(this.namespace).length>0,t=this.namespace&&Z.ConnectorController.state.activeConnectorIds[this.namespace],r=this.remoteFeatures?.multiWallet;await ee.ConnectionController.disconnect(r?{id:t,namespace:this.namespace}:{}),e&&r&&(Q.RouterController.push("ProfileWallets"),J.SnackController.showSuccess("Wallet deleted"))}catch{M.X.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),J.SnackController.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){let e=u.AccountController.state.addressExplorerUrl;e&&d.j.openHref(e,"_blank")}onGoToUpgradeView(){M.X.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),Q.RouterController.push("UpgradeEmailWallet")}onGoToProfileWalletsView(){Q.RouterController.push("ProfileWallets")}};eA.styles=eE,ex([(0,i.SB)()],eA.prototype,"caipAddress",void 0),ex([(0,i.SB)()],eA.prototype,"address",void 0),ex([(0,i.SB)()],eA.prototype,"profileImage",void 0),ex([(0,i.SB)()],eA.prototype,"profileName",void 0),ex([(0,i.SB)()],eA.prototype,"disconnecting",void 0),ex([(0,i.SB)()],eA.prototype,"balance",void 0),ex([(0,i.SB)()],eA.prototype,"balanceSymbol",void 0),ex([(0,i.SB)()],eA.prototype,"features",void 0),ex([(0,i.SB)()],eA.prototype,"remoteFeatures",void 0),ex([(0,i.SB)()],eA.prototype,"namespace",void 0),ex([(0,i.SB)()],eA.prototype,"activeConnectorIds",void 0),eA=ex([(0,p.Mo)("w3m-account-default-widget")],eA);var eS=(0,y.iv)`
798  span {
799    font-weight: 500;
800    font-size: 38px;
801    color: ${({tokens:e})=>e.theme.textPrimary};
802    line-height: 38px;
803    letter-spacing: -2%;
804    text-align: center;
805    font-family: var(--apkt-fontFamily-regular);
806  }
807
808  .pennies {
809    color: ${({tokens:e})=>e.theme.textSecondary};
810  }
811`,e_=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eI=class extends n.oi{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return(0,n.dy)`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`}};eI.styles=[f.ET,eS],e_([(0,i.Cb)()],eI.prototype,"dollars",void 0),e_([(0,i.Cb)()],eI.prototype,"pennies",void 0),eI=e_([(0,m.M)("wui-balance")],eI);var ek=(0,y.iv)`
812  :host {
813    display: inline-flex;
814    justify-content: center;
815    align-items: center;
816    position: relative;
817  }
818
819  wui-icon {
820    position: absolute;
821    width: 12px !important;
822    height: 4px !important;
823  }
824
825  /* -- Variants --------------------------------------------------------- */
826  :host([data-variant='fill']) {
827    background-color: ${({colors:e})=>e.neutrals100};
828  }
829
830  :host([data-variant='shade']) {
831    background-color: ${({colors:e})=>e.neutrals900};
832  }
833
834  :host([data-variant='fill']) > wui-text {
835    color: ${({colors:e})=>e.black};
836  }
837
838  :host([data-variant='shade']) > wui-text {
839    color: ${({colors:e})=>e.white};
840  }
841
842  :host([data-variant='fill']) > wui-icon {
843    color: ${({colors:e})=>e.neutrals100};
844  }
845
846  :host([data-variant='shade']) > wui-icon {
847    color: ${({colors:e})=>e.neutrals900};
848  }
849
850  /* -- Sizes --------------------------------------------------------- */
851  :host([data-size='sm']) {
852    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
853    border-radius: ${({borderRadius:e})=>e[2]};
854  }
855
856  :host([data-size='md']) {
857    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]};
858    border-radius: ${({borderRadius:e})=>e[3]};
859  }
860
861  /* -- Placements --------------------------------------------------------- */
862  wui-icon[data-placement='top'] {
863    bottom: 0px;
864    left: 50%;
865    transform: translate(-50%, 95%);
866  }
867
868  wui-icon[data-placement='bottom'] {
869    top: 0;
870    left: 50%;
871    transform: translate(-50%, -95%) rotate(180deg);
872  }
873
874  wui-icon[data-placement='right'] {
875    top: 50%;
876    left: 0;
877    transform: translate(-65%, -50%) rotate(90deg);
878  }
879
880  wui-icon[data-placement='left'] {
881    top: 50%;
882    right: 0%;
883    transform: translate(65%, -50%) rotate(270deg);
884  }
885`,eO=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eN={sm:"sm-regular",md:"md-regular"},eP=class extends n.oi{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.size="md",this.message=""}render(){return this.dataset.variant=this.variant,this.dataset.size=this.size,(0,n.dy)`<wui-icon data-placement=${this.placement} size="inherit" name="cursor"></wui-icon>
886      <wui-text variant=${eN[this.size]}>${this.message}</wui-text>`}};eP.styles=[f.ET,f.ZM,ek],eO([(0,i.Cb)()],eP.prototype,"placement",void 0),eO([(0,i.Cb)()],eP.prototype,"variant",void 0),eO([(0,i.Cb)()],eP.prototype,"size",void 0),eO([(0,i.Cb)()],eP.prototype,"message",void 0),eP=eO([(0,m.M)("wui-tooltip")],eP);var eT=r(38510),eR=r(31225);r(7427);var e$=(0,n.iv)`
887  :host {
888    width: 100%;
889    max-height: 280px;
890    overflow: scroll;
891    scrollbar-width: none;
892  }
893
894  :host::-webkit-scrollbar {
895    display: none;
896  }
897`;let eD=class extends n.oi{render(){return(0,n.dy)`<w3m-activity-list page="account"></w3m-activity-list>`}};eD.styles=e$,eD=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-account-activity-widget")],eD),r(84081),r(24996);var eL=(0,p.iv)`
898  .contentContainer {
899    height: 280px;
900  }
901
902  .contentContainer > wui-icon-box {
903    width: 40px;
904    height: 40px;
905    border-radius: ${({borderRadius:e})=>e["3"]};
906  }
907
908  .contentContainer > .textContent {
909    width: 65%;
910  }
911`;let eM=class extends n.oi{render(){return(0,n.dy)`${this.nftTemplate()}`}nftTemplate(){return(0,n.dy)` <wui-flex
912      class="contentContainer"
913      alignItems="center"
914      justifyContent="center"
915      flexDirection="column"
916      gap="5"
917    >
918      <wui-icon-box icon="wallet" size="lg" color="default"></wui-icon-box>
919      <wui-flex
920        class="textContent"
921        gap="2"
922        flexDirection="column"
923        justifyContent="center"
924        flexDirection="column"
925      >
926        <wui-text
927          variant="md-regular"
928          align="center"
929          color="primary"
930          data-testid="nft-template-title"
931          >Coming soon</wui-text
932        >
933        <wui-text
934          variant="sm-regular"
935          align="center"
936          color="secondary"
937          data-testid="nft-template-description"
938          >Stay tuned for our upcoming NFT feature</wui-text
939        >
940      </wui-flex>
941      <wui-link @click=${this.onReceiveClick.bind(this)} data-testid="link-receive-funds"
942        >Receive funds</wui-link
943      >
944    </wui-flex>`}onReceiveClick(){Q.RouterController.push("WalletReceive")}};eM.styles=eL,eM=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-account-nfts-widget")],eM),r(35407);var eU=(0,y.iv)`
945  :host {
946    width: 100%;
947  }
948
949  button {
950    width: 100%;
951    display: flex;
952    justify-content: space-between;
953    align-items: center;
954    gap: ${({spacing:e})=>e[4]};
955    padding: ${({spacing:e})=>e[4]};
956    background-color: transparent;
957    border-radius: ${({borderRadius:e})=>e[4]};
958  }
959
960  wui-text {
961    max-width: 174px;
962  }
963
964  .tag-container {
965    width: fit-content;
966  }
967
968  @media (hover: hover) {
969    button:hover:enabled {
970      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
971    }
972  }
973`,ej=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eB=class extends n.oi{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.disabled=!1}render(){return(0,n.dy)`
974      <button ?disabled=${this.disabled}>
975        <wui-flex alignItems="center" gap="3">
976          <wui-icon-box padding="2" color="secondary" icon=${this.icon} size="lg"></wui-icon-box>
977          <wui-flex flexDirection="column" gap="1">
978            <wui-text variant="md-medium" color="primary">${this.text}</wui-text>
979            ${this.description?(0,n.dy)`<wui-text variant="md-regular" color="secondary">
980                  ${this.description}</wui-text
981                >`:null}
982          </wui-flex>
983        </wui-flex>
984
985        <wui-flex class="tag-container" alignItems="center" gap="1" justifyContent="flex-end">
986          ${this.tag?(0,n.dy)`<wui-tag tagType="main" size="sm">${this.tag}</wui-tag>`:null}
987          <wui-icon size="md" name="chevronRight" color="default"></wui-icon>
988        </wui-flex>
989      </button>
990    `}};eB.styles=[f.ET,f.ZM,eU],ej([(0,i.Cb)()],eB.prototype,"icon",void 0),ej([(0,i.Cb)()],eB.prototype,"text",void 0),ej([(0,i.Cb)()],eB.prototype,"description",void 0),ej([(0,i.Cb)()],eB.prototype,"tag",void 0),ej([(0,i.Cb)({type:Boolean})],eB.prototype,"disabled",void 0),eB=ej([(0,m.M)("wui-list-description")],eB),r(626);var eF=(0,n.iv)`
991  :host {
992    width: 100%;
993  }
994
995  wui-flex {
996    width: 100%;
997  }
998
999  .contentContainer {
1000    max-height: 280px;
1001    overflow: scroll;
1002    scrollbar-width: none;
1003  }
1004
1005  .contentContainer::-webkit-scrollbar {
1006    display: none;
1007  }
1008`,ez=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eH=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tokenBalance=u.AccountController.state.tokenBalance,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.unsubscribe.push(u.AccountController.subscribe(e=>{this.tokenBalance=e.tokenBalance}),s.OptionsController.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)`${this.tokenTemplate()}`}tokenTemplate(){return this.tokenBalance&&this.tokenBalance?.length>0?(0,n.dy)`<wui-flex class="contentContainer" flexDirection="column" gap="2">
1009        ${this.tokenItemTemplate()}
1010      </wui-flex>`:(0,n.dy)` <wui-flex flexDirection="column">
1011      ${this.onRampTemplate()}
1012      <wui-list-description
1013        @click=${this.onReceiveClick.bind(this)}
1014        text="Receive funds"
1015        description="Scan the QR code and receive funds"
1016        icon="qrCode"
1017        iconColor="fg-200"
1018        iconBackgroundColor="fg-200"
1019        data-testid="w3m-account-receive-button"
1020      ></wui-list-description
1021    ></wui-flex>`}onRampTemplate(){return this.remoteFeatures?.onramp?(0,n.dy)`<wui-list-description
1022        @click=${this.onBuyClick.bind(this)}
1023        text="Buy Crypto"
1024        description="Easy with card or bank account"
1025        icon="card"
1026        iconColor="success-100"
1027        iconBackgroundColor="success-100"
1028        tag="popular"
1029        data-testid="w3m-account-onramp-button"
1030      ></wui-list-description>`:(0,n.dy)``}tokenItemTemplate(){return this.tokenBalance?.map(e=>n.dy`<wui-list-token
1031          tokenName=${e.name}
1032          tokenImageUrl=${e.iconUrl}
1033          tokenAmount=${e.quantity.numeric}
1034          tokenValue=${e.value}
1035          tokenCurrency=${e.symbol}
1036        ></wui-list-token>`)}onReceiveClick(){Q.RouterController.push("WalletReceive")}onBuyClick(){M.X.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:(0,X.r9)(a.R.state.activeChain)===eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}),Q.RouterController.push("OnRampProviders")}};eH.styles=eF,ez([(0,i.SB)()],eH.prototype,"tokenBalance",void 0),ez([(0,i.SB)()],eH.prototype,"remoteFeatures",void 0),eH=ez([(0,p.Mo)("w3m-account-tokens-widget")],eH),r(39184),r(69725);var eW=(0,p.iv)`
1037  wui-flex {
1038    width: 100%;
1039  }
1040
1041  wui-promo {
1042    position: absolute;
1043    top: -32px;
1044  }
1045
1046  wui-profile-button {
1047    margin-top: calc(-1 * ${({spacing:e})=>e["4"]});
1048  }
1049
1050  wui-promo + wui-profile-button {
1051    margin-top: ${({spacing:e})=>e["4"]};
1052  }
1053
1054  wui-tabs {
1055    width: 100%;
1056  }
1057
1058  .contentContainer {
1059    height: 280px;
1060  }
1061
1062  .contentContainer > wui-icon-box {
1063    width: 40px;
1064    height: 40px;
1065    border-radius: ${({borderRadius:e})=>e["3"]};
1066  }
1067
1068  .contentContainer > .textContent {
1069    width: 65%;
1070  }
1071`,eq=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eV=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.address=u.AccountController.state.address,this.profileName=u.AccountController.state.profileName,this.network=a.R.state.activeCaipNetwork,this.currentTab=u.AccountController.state.currentTab,this.tokenBalance=u.AccountController.state.tokenBalance,this.features=s.OptionsController.state.features,this.namespace=a.R.state.activeChain,this.activeConnectorIds=Z.ConnectorController.state.activeConnectorIds,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.unsubscribe.push(u.AccountController.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance):h.I.close()}),Z.ConnectorController.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),a.R.subscribeKey("activeChain",e=>this.namespace=e),a.R.subscribeKey("activeCaipNetwork",e=>this.network=e),s.OptionsController.subscribeKey("features",e=>this.features=e),s.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.watchSwapValues()}
1071disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){u.AccountController.fetchTokenBalance()}render(){if(!this.address)throw Error("w3m-account-view: No account provided");if(!this.namespace)return null;let e=this.activeConnectorIds[this.namespace],t=e?Z.ConnectorController.getConnectorById(e):void 0,{icon:r,iconSize:i}=this.getAuthData();return(0,n.dy)`<wui-flex
1072      flexDirection="column"
1073      .padding=${["0","3","4","3"]}
1074      alignItems="center"
1075      gap="4"
1076      data-testid="w3m-account-wallet-features-widget"
1077    >
1078      <wui-flex flexDirection="column" justifyContent="center" alignItems="center" gap="2">
1079        <wui-wallet-switch
1080          profileName=${this.profileName}
1081          address=${this.address}
1082          icon=${r}
1083          iconSize=${i}
1084          alt=${t?.name}
1085          @click=${this.onGoToProfileWalletsView.bind(this)}
1086          data-testid="wui-wallet-switch"
1087        ></wui-wallet-switch>
1088
1089        ${this.tokenBalanceTemplate()}
1090      </wui-flex>
1091      ${this.orderedWalletFeatures()} ${this.tabsTemplate()} ${this.listContentTemplate()}
1092    </wui-flex>`}orderedWalletFeatures(){let e=this.features?.walletFeaturesOrder||Y.bq.DEFAULT_FEATURES.walletFeaturesOrder;if(e.every(e=>"send"===e||"receive"===e?!this.features?.[e]:"swaps"!==e&&"onramp"!==e||!this.remoteFeatures?.[e]))return null;let t=[...new Set(e.map(e=>"receive"===e||"onramp"===e?"fund":e))];return(0,n.dy)`<wui-flex gap="2">
1093      ${t.map(e=>{switch(e){case"fund":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}
1094    </wui-flex>`}fundWalletTemplate(){if(!this.namespace)return null;let e=Y.bq.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),t=Y.bq.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),r=this.features?.receive,i=this.remoteFeatures?.onramp&&e,o=this.remoteFeatures?.payWithExchange&&t;return i||r||o?(0,n.dy)`
1095      <w3m-tooltip-trigger text="Fund wallet">
1096        <wui-button
1097          data-testid="wallet-features-fund-wallet-button"
1098          @click=${this.onFundWalletClick.bind(this)}
1099          variant="accent-secondary"
1100          size="lg"
1101          fullWidth
1102        >
1103          <wui-icon name="dollar"></wui-icon>
1104        </wui-button>
1105      </w3m-tooltip-trigger>
1106    `:null}swapsTemplate(){let e=this.remoteFeatures?.swaps,t=a.R.state.activeChain===G.b.CHAIN.EVM;return e&&t?(0,n.dy)`
1107      <w3m-tooltip-trigger text="Swap">
1108        <wui-button
1109          fullWidth
1110          data-testid="wallet-features-swaps-button"
1111          @click=${this.onSwapClick.bind(this)}
1112          variant="accent-secondary"
1113          size="lg"
1114        >
1115          <wui-icon name="recycleHorizontal"></wui-icon>
1116        </wui-button>
1117      </w3m-tooltip-trigger>
1118    `:null}sendTemplate(){let e=this.features?.send,t=a.R.state.activeChain,r=Y.bq.SEND_SUPPORTED_NAMESPACES.includes(t);return e&&r?(0,n.dy)`
1119      <w3m-tooltip-trigger text="Send">
1120        <wui-button
1121          fullWidth
1122          data-testid="wallet-features-send-button"
1123          @click=${this.onSendClick.bind(this)}
1124          variant="accent-secondary"
1125          size="lg"
1126        >
1127          <wui-icon name="send"></wui-icon>
1128        </wui-button>
1129      </w3m-tooltip-trigger>
1130    `:null}watchSwapValues(){this.watchTokenBalance=setInterval(()=>u.AccountController.fetchTokenBalance(e=>this.onTokenBalanceError(e)),1e4)}onTokenBalanceError(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===G.b.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE&&clearInterval(this.watchTokenBalance)}listContentTemplate(){return 0===this.currentTab?(0,n.dy)`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:1===this.currentTab?(0,n.dy)`<w3m-account-nfts-widget></w3m-account-nfts-widget>`:2===this.currentTab?(0,n.dy)`<w3m-account-activity-widget></w3m-account-activity-widget>`:(0,n.dy)`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){if(this.tokenBalance&&this.tokenBalance?.length>=0){let e=d.j.calculateBalance(this.tokenBalance),{dollars:t="0",pennies:r="00"}=d.j.formatTokenBalance(e);return(0,n.dy)`<wui-balance dollars=${t} pennies=${r}></wui-balance>`}return(0,n.dy)`<wui-balance dollars="0" pennies="00"></wui-balance>`}tabsTemplate(){let e=eR.g.getTabsByNamespace(a.R.state.activeChain);return 0===e.length?null:(0,n.dy)`<wui-tabs
1131      .onTabChange=${this.onTabChange.bind(this)}
1132      .activeTab=${this.currentTab}
1133      .tabs=${e}
1134    ></wui-tabs>`}onTabChange(e){u.AccountController.setCurrentTab(e)}onFundWalletClick(){Q.RouterController.push("FundWallet")}onSwapClick(){this.network?.caipNetworkId&&!Y.bq.SWAP_SUPPORTED_NETWORKS.includes(this.network?.caipNetworkId)?Q.RouterController.push("UnsupportedChain",{swapUnsupportedChain:!0}):(M.X.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:this.network?.caipNetworkId||"",isSmartAccount:(0,X.r9)(a.R.state.activeChain)===eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}),Q.RouterController.push("Swap"))}getAuthData(){let e=es.M.getConnectedSocialProvider(),t=es.M.getConnectedSocialUsername(),r=Z.ConnectorController.getAuthConnector(),n=r?.provider.getEmail()??"";return{name:eT.C.getAuthName({email:n,socialUsername:t,socialProvider:e}),icon:e??"mail",iconSize:e?"xl":"md"}}onGoToProfileWalletsView(){Q.RouterController.push("ProfileWallets")}onSendClick(){M.X.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:this.network?.caipNetworkId||"",isSmartAccount:(0,X.r9)(a.R.state.activeChain)===eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}),Q.RouterController.push("WalletSend")}};eV.styles=eW,eq([(0,i.SB)()],eV.prototype,"watchTokenBalance",void 0),eq([(0,i.SB)()],eV.prototype,"address",void 0),eq([(0,i.SB)()],eV.prototype,"profileName",void 0),eq([(0,i.SB)()],eV.prototype,"network",void 0),eq([(0,i.SB)()],eV.prototype,"currentTab",void 0),eq([(0,i.SB)()],eV.prototype,"tokenBalance",void 0),eq([(0,i.SB)()],eV.prototype,"features",void 0),eq([(0,i.SB)()],eV.prototype,"namespace",void 0),eq([(0,i.SB)()],eV.prototype,"activeConnectorIds",void 0),eq([(0,i.SB)()],eV.prototype,"remoteFeatures",void 0),eV=eq([(0,p.Mo)("w3m-account-wallet-features-widget")],eV);var eK=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let eG=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.namespace=a.R.state.activeChain,this.unsubscribe.push(a.R.subscribeKey("activeChain",e=>{this.namespace=e}))}
1134render(){if(!this.namespace)return null;let e=Z.ConnectorController.getConnectorId(this.namespace),t=Z.ConnectorController.getAuthConnector();return(0,n.dy)`
1135      ${t&&e===G.b.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()}
1136    `}walletFeaturesTemplate(){return(0,n.dy)`<w3m-account-wallet-features-widget></w3m-account-wallet-features-widget>`}defaultTemplate(){return(0,n.dy)`<w3m-account-default-widget></w3m-account-default-widget>`}};eK([(0,i.SB)()],eG.prototype,"namespace",void 0),eG=eK([(0,p.Mo)("w3m-account-view")],eG);var eZ=r(62847),eY=r(77879),eJ=r(95685);r(46550),r(38023);var eX=(0,y.iv)`
1137  wui-image {
1138    width: 24px;
1139    height: 24px;
1140    border-radius: ${({borderRadius:e})=>e[2]};
1141  }
1142
1143  wui-image,
1144  .icon-box {
1145    width: 32px;
1146    height: 32px;
1147    border-radius: ${({borderRadius:e})=>e[2]};
1148  }
1149
1150  wui-icon:not(.custom-icon, .icon-badge) {
1151    cursor: pointer;
1152  }
1153
1154  .icon-box {
1155    position: relative;
1156    border-radius: ${({borderRadius:e})=>e[2]};
1157    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1158  }
1159
1160  .icon-badge {
1161    position: absolute;
1162    top: 18px;
1163    left: 23px;
1164    z-index: 3;
1165    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1166    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
1167    border-radius: 50%;
1168    padding: ${({spacing:e})=>e["01"]};
1169  }
1170
1171  .icon-badge {
1172    width: 8px;
1173    height: 8px;
1174  }
1175`,eQ=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let e0=class extends n.oi{constructor(){super(...arguments),this.address="",this.profileName="",this.content=[],this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadge=void 0,this.iconBadgeSize="md",this.buttonVariant="neutral-primary",this.enableMoreButton=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,n.dy)`
1176      <wui-flex flexDirection="column" rowgap="2">
1177        ${this.topTemplate()} ${this.bottomTemplate()}
1178      </wui-flex>
1179    `}topTemplate(){return(0,n.dy)`
1180      <wui-flex alignItems="flex-start" justifyContent="space-between">
1181        ${this.imageOrIconTemplate()}
1182        <wui-icon-link
1183          variant="secondary"
1184          size="md"
1185          icon="copy"
1186          @click=${this.dispatchCopyEvent}
1187        ></wui-icon-link>
1188        <wui-icon-link
1189          variant="secondary"
1190          size="md"
1191          icon="externalLink"
1192          @click=${this.dispatchExternalLinkEvent}
1193        ></wui-icon-link>
1194        ${this.enableMoreButton?(0,n.dy)`<wui-icon-link
1195              variant="secondary"
1196              size="md"
1197              icon="threeDots"
1198              @click=${this.dispatchMoreButtonEvent}
1199              data-testid="wui-active-profile-wallet-item-more-button"
1200            ></wui-icon-link>`:null}
1201      </wui-flex>
1202    `}bottomTemplate(){return(0,n.dy)` <wui-flex flexDirection="column">${this.contentTemplate()}</wui-flex> `}imageOrIconTemplate(){return this.icon?(0,n.dy)`
1203        <wui-flex flexGrow="1" alignItems="center">
1204          <wui-flex alignItems="center" justifyContent="center" class="icon-box">
1205            <wui-icon size="lg" color="default" name=${this.icon} class="custom-icon"></wui-icon>
1206
1207            ${this.iconBadge?(0,n.dy)`<wui-icon
1208                  color="accent-primary"
1209                  size="inherit"
1210                  name=${this.iconBadge}
1211                  class="icon-badge"
1212                ></wui-icon>`:null}
1213          </wui-flex>
1214        </wui-flex>
1215      `:(0,n.dy)`
1216      <wui-flex flexGrow="1" alignItems="center">
1217        <wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>
1218      </wui-flex>
1219    `}contentTemplate(){return 0===this.content.length?null:(0,n.dy)`
1220      <wui-flex flexDirection="column" rowgap="3">
1221        ${this.content.map(e=>this.labelAndTagTemplate(e))}
1222      </wui-flex>
1223    `}
1223labelAndTagTemplate({address:e,profileName:t,label:r,description:i,enableButton:o,buttonType:s,buttonLabel:a,buttonVariant:c,tagVariant:l,tagLabel:u,alignItems:d="flex-end"}){return(0,n.dy)`
1224      <wui-flex justifyContent="space-between" alignItems=${d} columngap="1">
1225        <wui-flex flexDirection="column" rowgap="01">
1226          ${r?(0,n.dy)`<wui-text variant="sm-medium" color="secondary">${r}</wui-text>`:null}
1227
1228          <wui-flex alignItems="center" columngap="1">
1229            <wui-text variant="md-regular" color="primary">
1230              ${g.H.getTruncateString({string:t||e,charsStart:t?16:this.charsStart,charsEnd:t?0:this.charsEnd,truncate:t?"end":"middle"})}
1231            </wui-text>
1232
1233            ${l&&u?(0,n.dy)`<wui-tag variant=${l} size="sm">${u}</wui-tag>`:null}
1234          </wui-flex>
1235
1236          ${i?(0,n.dy)`<wui-text variant="sm-regular" color="secondary">${i}</wui-text>`:null}
1237        </wui-flex>
1238
1239        ${o?this.buttonTemplate({buttonType:s,buttonLabel:a,buttonVariant:c}):null}
1240      </wui-flex>
1241    `}buttonTemplate({buttonType:e,buttonLabel:t,buttonVariant:r}){return(0,n.dy)`
1242      <wui-button
1243        size="sm"
1244        variant=${r}
1245        @click=${"disconnect"===e?this.dispatchDisconnectEvent.bind(this):this.dispatchSwitchEvent.bind(this)}
1246        data-testid=${"disconnect"===e?"wui-active-profile-wallet-item-disconnect-button":"wui-active-profile-wallet-item-switch-button"}
1247      >
1248        ${t}
1249      </wui-button>
1250    `}dispatchDisconnectEvent(){this.dispatchEvent(new CustomEvent("disconnect",{bubbles:!0,composed:!0}))}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("switch",{bubbles:!0,composed:!0}))}dispatchExternalLinkEvent(){this.dispatchEvent(new CustomEvent("externalLink",{bubbles:!0,composed:!0}))}dispatchMoreButtonEvent(){this.dispatchEvent(new CustomEvent("more",{bubbles:!0,composed:!0}))}dispatchCopyEvent(){this.dispatchEvent(new CustomEvent("copy",{bubbles:!0,composed:!0}))}};e0.styles=[f.ET,f.ZM,eX],eQ([(0,i.Cb)()],e0.prototype,"address",void 0),eQ([(0,i.Cb)()],e0.prototype,"profileName",void 0),eQ([(0,i.Cb)({type:Array})],e0.prototype,"content",void 0),eQ([(0,i.Cb)()],e0.prototype,"alt",void 0),eQ([(0,i.Cb)()],e0.prototype,"imageSrc",void 0),eQ([(0,i.Cb)()],e0.prototype,"icon",void 0),eQ([(0,i.Cb)()],e0.prototype,"iconSize",void 0),eQ([(0,i.Cb)()],e0.prototype,"iconBadge",void 0),eQ([(0,i.Cb)()],e0.prototype,"iconBadgeSize",void 0),eQ([(0,i.Cb)()],e0.prototype,"buttonVariant",void 0),eQ([(0,i.Cb)({type:Boolean})],e0.prototype,"enableMoreButton",void 0),eQ([(0,i.Cb)({type:Number})],e0.prototype,"charsStart",void 0),eQ([(0,i.Cb)({type:Number})],e0.prototype,"charsEnd",void 0),e0=eQ([(0,m.M)("wui-active-profile-wallet-item")],e0);var e1=(0,y.iv)`
1251  wui-image,
1252  .icon-box {
1253    width: 32px;
1254    height: 32px;
1255    border-radius: ${({borderRadius:e})=>e[2]};
1256  }
1257
1258  .right-icon {
1259    cursor: pointer;
1260  }
1261
1262  .icon-box {
1263    position: relative;
1264    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1265  }
1266
1267  .icon-badge {
1268    position: absolute;
1269    top: 18px;
1270    left: 23px;
1271    z-index: 3;
1272    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1273    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
1274    border-radius: 50%;
1275    padding: ${({spacing:e})=>e["01"]};
1276  }
1277
1278  .icon-badge {
1279    width: 8px;
1280    height: 8px;
1281  }
1282`,e2=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let e5=class extends n.oi{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.buttonLabel="",this.buttonVariant="accent-primary",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadgeSize="md",this.rightIcon="signOut",this.rightIconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,n.dy)`
1283      <wui-flex alignItems="center" columngap="2">
1284        ${this.imageOrIconTemplate()} ${this.labelAndDescriptionTemplate()}
1285        ${this.buttonActionTemplate()}
1286      </wui-flex>
1287    `}imageOrIconTemplate(){return this.icon?(0,n.dy)`
1288        <wui-flex alignItems="center" justifyContent="center" class="icon-box">
1289          <wui-flex alignItems="center" justifyContent="center" class="icon-box">
1290            <wui-icon size="lg" color="default" name=${this.icon} class="custom-icon"></wui-icon>
1291
1292            ${this.iconBadge?(0,n.dy)`<wui-icon
1293                  color="default"
1294                  size="inherit"
1295                  name=${this.iconBadge}
1296                  class="icon-badge"
1297                ></wui-icon>`:null}
1298          </wui-flex>
1299        </wui-flex>
1300      `:(0,n.dy)`<wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>`}labelAndDescriptionTemplate(){return(0,n.dy)`
1301      <wui-flex
1302        flexDirection="column"
1303        flexGrow="1"
1304        justifyContent="flex-start"
1305        alignItems="flex-start"
1306      >
1307        <wui-text variant="lg-regular" color="primary">
1308          ${g.H.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
1309        </wui-text>
1310      </wui-flex>
1311    `}buttonActionTemplate(){return(0,n.dy)`
1312      <wui-flex columngap="1" alignItems="center" justifyContent="center">
1313        <wui-button
1314          size="sm"
1315          variant=${this.buttonVariant}
1316          .loading=${this.loading}
1317          @click=${this.handleButtonClick}
1318          data-testid="wui-inactive-profile-wallet-item-button"
1319        >
1320          ${this.buttonLabel}
1321        </wui-button>
1321
1322
1323        <wui-icon-link
1324          variant="secondary"
1325          size="md"
1326          icon=${(0,o.o)(this.rightIcon)}
1327          class="right-icon"
1328          @click=${this.handleIconClick}
1329        ></wui-icon-link>
1330      </wui-flex>
1331    `}handleButtonClick(){this.dispatchEvent(new CustomEvent("buttonClick",{bubbles:!0,composed:!0}))}handleIconClick(){this.dispatchEvent(new CustomEvent("iconClick",{bubbles:!0,composed:!0}))}};e5.styles=[f.ET,f.ZM,e1],e2([(0,i.Cb)()],e5.prototype,"address",void 0),e2([(0,i.Cb)()],e5.prototype,"profileName",void 0),e2([(0,i.Cb)()],e5.prototype,"alt",void 0),e2([(0,i.Cb)()],e5.prototype,"buttonLabel",void 0),e2([(0,i.Cb)()],e5.prototype,"buttonVariant",void 0),e2([(0,i.Cb)()],e5.prototype,"imageSrc",void 0),e2([(0,i.Cb)()],e5.prototype,"icon",void 0),e2([(0,i.Cb)()],e5.prototype,"iconSize",void 0),e2([(0,i.Cb)()],e5.prototype,"iconBadge",void 0),e2([(0,i.Cb)()],e5.prototype,"iconBadgeSize",void 0),e2([(0,i.Cb)()],e5.prototype,"rightIcon",void 0),e2([(0,i.Cb)()],e5.prototype,"rightIconSize",void 0),e2([(0,i.Cb)({type:Boolean})],e5.prototype,"loading",void 0),e2([(0,i.Cb)({type:Number})],e5.prototype,"charsStart",void 0),e2([(0,i.Cb)({type:Number})],e5.prototype,"charsEnd",void 0),e5=e2([(0,m.M)("wui-inactive-profile-wallet-item")],e5),r(31330);var e3=r(33279);let e6={getAuthData(e){let t=e.connectorId===G.b.CONNECTOR_ID.AUTH;if(!t)return{isAuth:!1,icon:void 0,iconSize:void 0,name:void 0};let r=e?.auth?.name??es.M.getConnectedSocialProvider(),n=e?.auth?.username??es.M.getConnectedSocialUsername(),i=Z.ConnectorController.getAuthConnector(),o=i?.provider.getEmail()??"";return{isAuth:!0,icon:r??"mail",iconSize:r?"xl":"md",name:t?eT.C.getAuthName({email:o,socialUsername:n,socialProvider:r}):void 0}}};var e4=(0,p.iv)`
1332  :host {
1333    --connect-scroll--top-opacity: 0;
1334    --connect-scroll--bottom-opacity: 0;
1335  }
1336
1337  .balance-amount {
1338    flex: 1;
1339  }
1340
1341  .wallet-list {
1342    scrollbar-width: none;
1343    overflow-y: scroll;
1344    overflow-x: hidden;
1345    transition: opacity ${({easings:e})=>e["ease-out-power-1"]}
1346      ${({durations:e})=>e.md};
1347    will-change: opacity;
1348    mask-image: linear-gradient(
1349      to bottom,
1350      rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
1351      rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
1352      black 40px,
1353      black calc(100% - 40px),
1354      rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
1355      rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
1356    );
1357  }
1358
1359  .active-wallets {
1360    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1361    border-radius: ${({borderRadius:e})=>e["4"]};
1362  }
1363
1364  .active-wallets-box {
1365    height: 330px;
1366  }
1367
1368  .empty-wallet-list-box {
1369    height: 400px;
1370  }
1371
1372  .empty-box {
1373    width: 100%;
1374    padding: ${({spacing:e})=>e["4"]};
1375    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1376    border-radius: ${({borderRadius:e})=>e["4"]};
1377  }
1378
1379  wui-separator {
1380    margin: ${({spacing:e})=>e["2"]} 0 ${({spacing:e})=>e["2"]} 0;
1381  }
1382
1383  .active-connection {
1384    padding: ${({spacing:e})=>e["2"]};
1385  }
1386
1387  .recent-connection {
1388    padding: ${({spacing:e})=>e["2"]} 0 ${({spacing:e})=>e["2"]} 0;
1389  }
1390
1391  @media (max-width: 430px) {
1392    .active-wallets-box,
1393    .empty-wallet-list-box {
1394      height: auto;
1395      max-height: clamp(360px, 470px, 80vh);
1396    }
1397  }
1398`,e8=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let e9={ADDRESS_DISPLAY:{START:4,END:6},BADGE:{SIZE:"md",ICON:"lightbulb"},SCROLL_THRESHOLD:50,OPACITY_RANGE:[0,1]},e7={eip155:"ethereum",solana:"solana",bip122:"bitcoin"},te=[{namespace:"eip155",icon:e7.eip155,label:"EVM"},{namespace:"solana",icon:e7.solana,label:"Solana"},{namespace:"bip122",icon:e7.bip122,label:"Bitcoin"}],tt={eip155:{title:"Add EVM Wallet",description:"Add your first EVM wallet"},solana:{title:"Add Solana Wallet",description:"Add your first Solana wallet"},bip122:{title:"Add Bitcoin Wallet",description:"Add your first Bitcoin wallet"}},tr=class extends n.oi{constructor(){super(),this.unsubscribers=[],this.currentTab=0,this.namespace=a.R.state.activeChain,this.namespaces=Array.from(a.R.state.chains.keys()),this.caipAddress=void 0,this.profileName=void 0,this.activeConnectorIds=Z.ConnectorController.state.activeConnectorIds,this.lastSelectedAddress="",this.lastSelectedConnectorId="",this.isSwitching=!1,this.caipNetwork=a.R.state.activeCaipNetwork,this.user=u.AccountController.state.user,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.currentTab=this.namespace?this.namespaces.indexOf(this.namespace):0,this.caipAddress=a.R.getAccountData(this.namespace)?.caipAddress,this.profileName=a.R.getAccountData(this.namespace)?.profileName,this.unsubscribers.push(ee.ConnectionController.subscribeKey("connections",()=>this.onConnectionsChange()),ee.ConnectionController.subscribeKey("recentConnections",()=>this.requestUpdate()),Z.ConnectorController.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),a.R.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e),u.AccountController.subscribeKey("user",e=>this.user=e),s.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.chainListener=a.R.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress,this.profileName=e?.profileName},this.namespace)}
1398disconnectedCallback(){this.unsubscribers.forEach(e=>e()),this.resizeObserver?.disconnect(),this.removeScrollListener(),this.chainListener?.()}firstUpdated(){let e=this.shadowRoot?.querySelector(".wallet-list");if(!e)return;let t=()=>this.updateScrollOpacity(e);requestAnimationFrame(t),e.addEventListener("scroll",t),this.resizeObserver=new ResizeObserver(t),this.resizeObserver.observe(e),t()}render(){let e=this.namespace;if(!e)throw Error("Namespace is not set");return(0,n.dy)`
1399      <wui-flex flexDirection="column" .padding=${["0","4","4","4"]} gap="4">
1400        ${this.renderTabs()} ${this.renderHeader(e)} ${this.renderConnections(e)}
1401        ${this.renderAddConnectionButton(e)}
1402      </wui-flex>
1403    `}renderTabs(){let e=te.filter(e=>this.namespaces.includes(e.namespace));return e.length>1?(0,n.dy)`
1404        <wui-tabs
1405          .onTabChange=${e=>this.handleTabChange(e)}
1406          .activeTab=${this.currentTab}
1407          .tabs=${e}
1408        ></wui-tabs>
1409      `:null}renderHeader(e){let t=this.getActiveConnections(e).flatMap(({accounts:e})=>e).length+(this.caipAddress?1:0);return(0,n.dy)`
1410      <wui-flex alignItems="center" columngap="1">
1411        <wui-icon
1412          size="sm"
1413          name=${e7[e]??e7.eip155}
1414        ></wui-icon>
1415        <wui-text color="secondary" variant="lg-regular"
1416          >${t>1?"Wallets":"Wallet"}</wui-text
1417        >
1418        <wui-text
1419          color="primary"
1420          variant="lg-regular"
1421          class="balance-amount"
1422          data-testid="balance-amount"
1423        >
1424          ${t}
1425        </wui-text>
1426        <wui-link
1427          color="secondary"
1428          variant="secondary"
1429          @click=${()=>ee.ConnectionController.disconnect({namespace:e})}
1430          ?disabled=${!this.hasAnyConnections(e)}
1431          data-testid="disconnect-all-button"
1432        >
1433          Disconnect All
1434        </wui-link>
1435      </wui-flex>
1436    `}renderConnections(e){let t=this.hasAnyConnections(e);return(0,n.dy)`
1437      <wui-flex flexDirection="column" class=${(0,eZ.$)({"wallet-list":!0,"active-wallets-box":t,"empty-wallet-list-box":!t})} rowgap="3">
1438        ${t?this.renderActiveConnections(e):this.renderEmptyState(e)}
1439      </wui-flex>
1440    `}renderActiveConnections(e){let t=this.getActiveConnections(e),r=this.activeConnectorIds[e],i=this.getPlainAddress();return(0,n.dy)`
1441      ${i||r||t.length>0?(0,n.dy)`<wui-flex
1442            flexDirection="column"
1443            .padding=${["4","0","4","0"]}
1444            class="active-wallets"
1445          >
1446            ${this.renderActiveProfile(e)} ${this.renderActiveConnectionsList(e)}
1447          </wui-flex>`:null}
1448      ${this.renderRecentConnections(e)}
1449    `}renderActiveProfile(e){let t=this.activeConnectorIds[e];if(!t)return null;let{connections:r}=eJ.f.getConnectionsData(e),i=Z.ConnectorController.getConnectorById(t),o=l.f.getConnectorImage(i),s=this.getPlainAddress();if(!s)return null;let a=e===G.b.CHAIN.BITCOIN,c=e6.getAuthData({connectorId:t,accounts:[]}),u=this.getActiveConnections(e).flatMap(e=>e.accounts).length>0,d=r.find(e=>e.connectorId===t),h=d?.accounts.filter(e=>!e3.g.isLowerCaseMatch(e.address,s));return(0,n.dy)`
1450      <wui-flex flexDirection="column" .padding=${["0","4","0","4"]}>
1451        <wui-active-profile-wallet-item
1452          address=${s}
1453          alt=${i?.name}
1454          .content=${this.getProfileContent({address:s,connections:r,connectorId:t,namespace:e})}
1455          .charsStart=${e9.ADDRESS_DISPLAY.START}
1456          .charsEnd=${e9.ADDRESS_DISPLAY.END}
1457          .icon=${c.icon}
1458          .iconSize=${c.iconSize}
1459          .iconBadge=${this.isSmartAccount(s)?e9.BADGE.ICON:void 0}
1460          .iconBadgeSize=${this.isSmartAccount(s)?e9.BADGE.SIZE:void 0}
1461          imageSrc=${o}
1462          ?enableMoreButton=${c.isAuth}
1463          @copy=${()=>this.handleCopyAddress(s)}
1464          @disconnect=${()=>this.handleDisconnect(e,{id:t})}
1465          @switch=${()=>{a&&d&&h?.[0]&&this.handleSwitchWallet(d,h[0].address,e)}}
1466          @externalLink=${()=>this.handleExternalLink(s)}
1467          @more=${()=>this.handleMore()}
1468          data-testid="wui-active-profile-wallet-item"
1469        ></wui-active-profile-wallet-item>
1470        ${u?(0,n.dy)`<wui-separator></wui-separator>`:null}
1471      </wui-flex>
1472    `}renderActiveConnectionsList(e){let t=this.getActiveConnections(e);return 0===t.length?null:(0,n.dy)`
1473      <wui-flex flexDirection="column" .padding=${["0","2","0","2"]}>
1474        ${this.renderConnectionList(t,!1,e)}
1475      </wui-flex>
1476    `}renderRecentConnections(e){let{recentConnections:t}=eJ.f.getConnectionsData(e);return 0===t.flatMap(e=>e.accounts).length?null:(0,n.dy)`
1477      <wui-flex flexDirection="column" .padding=${["0","2","0","2"]} rowGap="2">
1478        <wui-text color="secondary" variant="sm-medium" data-testid="recently-connected-text"
1479          >RECENTLY CONNECTED</wui-text
1480        >
1481        <wui-flex flexDirection="column" .padding=${["0","2","0","2"]}>
1482          ${this.renderConnectionList(t,!0,e)}
1483        </wui-flex>
1484      </wui-flex>
1485    `}renderConnectionList(e,t,r){return e.filter(e=>e.accounts.length>0).map((e,i)=>{let o=Z.ConnectorController.getConnectorById(e.connectorId),s=l.f.getConnectorImage(o)??"",a=e6.getAuthData(e);return e.accounts.map((o,c)=>{let l=this.isAccountLoading(e.connectorId,o.address);return(0,n.dy)`
1486            <wui-flex flexDirection="column">
1487              ${0!==i||0!==c?(0,n.dy)`<wui-separator></wui-separator>`:null}
1488              <wui-inactive-profile-wallet-item
1489                address=${o.address}
1490                alt=${e.connectorId}
1491                buttonLabel=${t?"Connect":"Switch"}
1492                buttonVariant=${t?"neutral-secondary":"accent-secondary"}
1493                rightIcon=${t?"bin":"power"}
1494                rightIconSize="sm"
1495                class=${t?"recent-connection":"active-connection"}
1496                data-testid=${t?"recent-connection":"active-connection"}
1497                imageSrc=${s}
1498                .iconBadge=${this.isSmartAccount(o.address)?e9.BADGE.ICON:void 0}
1499                .iconBadgeSize=${this.isSmartAccount(o.address)?e9.BADGE.SIZE:void 0}
1500                .icon=${a.icon}
1501                .iconSize=${a.iconSize}
1502                .loading=${l}
1503                .showBalance=${!1}
1504                .charsStart=${e9.ADDRESS_DISPLAY.START}
1505                .charsEnd=${e9.ADDRESS_DISPLAY.END}
1506                @buttonClick=${()=>this.handleSwitchWallet(e,o.address,r)}
1507                @iconClick=${()=>this.handleWalletAction({connection:e,address:o.address,isRecentConnection:t,namespace:r})}
1508              ></wui-inactive-profile-wallet-item>
1509            </wui-flex>
1510          `})})}renderAddConnectionButton(e){if(!this.isMultiWalletEnabled()&&this.caipAddress||!this.hasAnyConnections(e))return null;let{title:t}=this.getChainLabelInfo(e);return(0,n.dy)`
1511      <wui-list-item
1512        variant="icon"
1513        iconVariant="overlay"
1514        icon="plus"
1515        iconSize="sm"
1516        ?chevron=${!0}
1517        @click=${()=>this.handleAddConnection(e)}
1518        data-testid="add-connection-button"
1519      >
1520        <wui-text variant="md-medium" color="secondary">${t}</wui-text>
1521      </wui-list-item>
1522    `}renderEmptyState(e){let{title:t,description:r}=this.getChainLabelInfo(e);return(0,n.dy)`
1523      <wui-flex alignItems="flex-start" class="empty-template" data-testid="empty-template">
1524        <wui-flex
1525          flexDirection="column"
1526          alignItems="center"
1527          justifyContent="center"
1528          rowgap="3"
1529          class="empty-box"
1530        >
1531          <wui-icon-box size="xl" icon="wallet" color="secondary"></wui-icon-box>
1532
1533          <wui-flex flexDirection="column" alignItems="center" justifyContent="center" gap="1">
1534            <wui-text color="primary" variant="lg-regular" data-testid="empty-state-text"
1535              >No wallet connected</wui-text
1536            >
1537            <wui-text color="secondary" variant="md-regular" data-testid="empty-state-description"
1538              >${r}</wui-text
1539            >
1540          </wui-flex>
1541
1542          <wui-link
1543            @click=${()=>this.handleAddConnection(e)}
1544            data-testid="empty-state-button"
1545            icon="plus"
1546          >
1547            ${t}
1548          </wui-link>
1549        </wui-flex>
1550      </wui-flex>
1551    `}handleTabChange(e){let t=this.namespaces[e];t&&(this.chainListener?.(),this.currentTab=this.namespaces.indexOf(t),this.namespace=t,this.caipAddress=a.R.getAccountData(t)?.caipAddress,this.profileName=a.R.getAccountData(t)?.profileName,this.chainListener=a.R.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress},t))}async handleSwitchWallet(e,t,r){try{this.isSwitching=!0,this.lastSelectedConnectorId=e.connectorId,this.lastSelectedAddress=t,await ee.ConnectionController.switchConnection({connection:e,address:t,namespace:r,closeModalOnConnect:!1,onChange({hasSwitchedAccount:e,hasSwitchedWallet:t}){t?J.SnackController.showSuccess("Wallet switched"):e&&J.SnackController.showSuccess("Account switched")}})}catch(e){J.SnackController.showError("Failed to switch wallet")}finally{this.isSwitching=!1}}
1551handleWalletAction(e){let{connection:t,address:r,isRecentConnection:n,namespace:i}=e;n?(es.M.deleteAddressFromConnection({connectorId:t.connectorId,address:r,namespace:i}),ee.ConnectionController.syncStorageConnections(),J.SnackController.showSuccess("Wallet deleted")):this.handleDisconnect(i,{id:t.connectorId})}async handleDisconnect(e,{id:t}){try{await ee.ConnectionController.disconnect({id:t,namespace:e}),J.SnackController.showSuccess("Wallet disconnected")}catch{J.SnackController.showError("Failed to disconnect wallet")}}handleCopyAddress(e){d.j.copyToClopboard(e),J.SnackController.showSuccess("Address copied")}handleMore(){Q.RouterController.push("AccountSettings")}handleExternalLink(e){let t=this.caipNetwork?.blockExplorers?.default.url;t&&d.j.openHref(`${t}/address/${e}`,"_blank")}handleAddConnection(e){Z.ConnectorController.setFilterByNamespace(e),Q.RouterController.push("Connect")}getChainLabelInfo(e){return tt[e]??{title:"Add Wallet",description:"Add your first wallet"}}isSmartAccount(e){if(!this.namespace)return!1;let t=this.user?.accounts?.find(e=>"smartAccount"===e.type);return!!t&&!!e&&e3.g.isLowerCaseMatch(t.address,e)}getPlainAddress(){return this.caipAddress?d.j.getPlainAddress(this.caipAddress):void 0}getActiveConnections(e){let t=this.activeConnectorIds[e],{connections:r}=eJ.f.getConnectionsData(e),[n]=r.filter(e=>e3.g.isLowerCaseMatch(e.connectorId,t));if(!t)return r;let i=e===G.b.CHAIN.BITCOIN,{address:o}=this.caipAddress?eY.u.parseCaipAddress(this.caipAddress):{},s=[...o?[o]:[]];return i&&n&&(s=n.accounts.map(e=>e.address)||[]),eJ.f.excludeConnectorAddressFromConnections({connectorId:t,addresses:s,connections:r})}hasAnyConnections(e){let t=this.getActiveConnections(e),{recentConnections:r}=eJ.f.getConnectionsData(e);return!!this.caipAddress||t.length>0||r.length>0}isAccountLoading(e,t){return e3.g.isLowerCaseMatch(this.lastSelectedConnectorId,e)&&e3.g.isLowerCaseMatch(this.lastSelectedAddress,t)&&this.isSwitching}getProfileContent(e){let{address:t,connections:r,connectorId:n,namespace:i}=e,[o]=r.filter(e=>e3.g.isLowerCaseMatch(e.connectorId,n));if(i===G.b.CHAIN.BITCOIN&&o?.accounts.every(e=>"string"==typeof e.type))return this.getBitcoinProfileContent(o.accounts,t);let s=e6.getAuthData({connectorId:n,accounts:[]});return[{address:t,tagLabel:"Active",tagVariant:"success",enableButton:!0,profileName:this.profileName,buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary",...s.isAuth?{description:this.isSmartAccount(t)?"Smart Account":"EOA Account"}:{}}]}getBitcoinProfileContent(e,t){let r=e.length>1,n=this.getPlainAddress();return e.map(e=>{let i=e3.g.isLowerCaseMatch(e.address,n),o="PAYMENT";return"ordinal"===e.type&&(o="ORDINALS"),{address:e.address,tagLabel:e3.g.isLowerCaseMatch(e.address,t)?"Active":void 0,tagVariant:e3.g.isLowerCaseMatch(e.address,t)?"success":void 0,enableButton:!0,...r?{label:o,alignItems:"flex-end",buttonType:i?"disconnect":"switch",buttonLabel:i?"Disconnect":"Switch",buttonVariant:i?"neutral-secondary":"accent-secondary"}:{alignItems:"center",buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary"}}})}removeScrollListener(){let e=this.shadowRoot?.querySelector(".wallet-list");e&&e.removeEventListener("scroll",()=>this.handleConnectListScroll())}handleConnectListScroll(){let e=this.shadowRoot?.querySelector(".wallet-list");e&&this.updateScrollOpacity(e)}isMultiWalletEnabled(){return!!this.remoteFeatures?.multiWallet}updateScrollOpacity(e){e.style.setProperty("--connect-scroll--top-opacity",p.kj.interpolate([0,e9.SCROLL_THRESHOLD],e9.OPACITY_RANGE,e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",p.kj.interpolate([0,e9.SCROLL_THRESHOLD],e9.OPACITY_RANGE,e.scrollHeight-e.scrollTop-e.offsetHeight).toString())}onConnectionsChange(){if(this.isMultiWalletEnabled()&&this.namespace){let{connections:e}=eJ.f.getConnectionsData(this.namespace);0===e.length&&Q.RouterController.reset("ProfileWallets")}this.requestUpdate()}};tr.styles=e4,e8([(0,i.SB)()],tr.prototype,"currentTab",void 0),e8([(0,i.SB)()],tr.prototype,"namespace",void 0),e8([(0,i.SB)()],tr.prototype,"namespaces",void 0),e8([(0,i.SB)()],tr.prototype,"caipAddress",void 0),e8([(0,i.SB)()],tr.prototype,"profileName",void 0),e8([(0,i.SB)()],tr.prototype,"activeConnectorIds",void 0),e8([(0,i.SB)()],tr.prototype,"lastSelectedAddress",void 0),e8([(0,i.SB)()],tr.prototype,"lastSelectedConnectorId",void 0),e8([(0,i.SB)()],tr.prototype,"isSwitching",void 0),e8([(0,i.SB)()],tr.prototype,"caipNetwork",void 0),e8([(0,i.SB)()],tr.prototype,"user",void 0),e8([(0,i.SB)()],tr.prototype,"remoteFeatures",void 0),tr=e8([(0,p.Mo)("w3m-profile-wallets-view")],tr);var tn=r(53549),ti=(0,y.iv)`
1552  :host {
1553    display: flex;
1554    align-items: center;
1555    justify-content: center;
1556  }
1557
1558  label {
1559    position: relative;
1560    display: inline-block;
1561    user-select: none;
1562    transition:
1563      background-color ${({durations:e})=>e.lg}
1564        ${({easings:e})=>e["ease-out-power-2"]},
1565      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
1566      border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
1567      box-shadow ${({durations:e})=>e.lg}
1568        ${({easings:e})=>e["ease-out-power-2"]},
1569      width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
1570      height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
1571      transform ${({durations:e})=>e.lg}
1572        ${({easings:e})=>e["ease-out-power-2"]},
1573      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
1574    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
1575  }
1576
1577  input {
1578    width: 0;
1579    height: 0;
1580    opacity: 0;
1581  }
1582
1583  span {
1584    position: absolute;
1585    cursor: pointer;
1586    top: 0;
1587    left: 0;
1588    right: 0;
1589    bottom: 0;
1590    background-color: ${({colors:e})=>e.neutrals300};
1591    border-radius: ${({borderRadius:e})=>e.round};
1592    border: 1px solid transparent;
1593    will-change: border;
1594    transition:
1595      background-color ${({durations:e})=>e.lg}
1596        ${({easings:e})=>e["ease-out-power-2"]},
1597      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
1598      border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
1599      box-shadow ${({durations:e})=>e.lg}
1600        ${({easings:e})=>e["ease-out-power-2"]},
1601      width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
1602      height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
1603      transform ${({durations:e})=>e.lg}
1604        ${({easings:e})=>e["ease-out-power-2"]},
1605      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
1606    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
1607  }
1608
1609  span:before {
1610    content: '';
1611    position: absolute;
1612    background-color: ${({colors:e})=>e.white};
1613    border-radius: 50%;
1614  }
1615
1616  /* -- Sizes --------------------------------------------------------- */
1617  label[data-size='lg'] {
1618    width: 48px;
1619    height: 32px;
1620  }
1621
1622  label[data-size='md'] {
1623    width: 40px;
1624    height: 28px;
1625  }
1626
1627  label[data-size='sm'] {
1628    width: 32px;
1629    height: 22px;
1630  }
1631
1632  label[data-size='lg'] > span:before {
1633    height: 24px;
1634    width: 24px;
1635    left: 4px;
1636    top: 3px;
1637  }
1638
1639  label[data-size='md'] > span:before {
1640    height: 20px;
1641    width: 20px;
1642    left: 4px;
1643    top: 3px;
1644  }
1645
1646  label[data-size='sm'] > span:before {
1647    height: 16px;
1648    width: 16px;
1649    left: 3px;
1650    top: 2px;
1651  }
1652
1653  /* -- Focus states --------------------------------------------------- */
1654  input:focus-visible:not(:checked) + span,
1655  input:focus:not(:checked) + span {
1656    border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
1657    background-color: ${({tokens:e})=>e.theme.textTertiary};
1658    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
1659  }
1660
1661  input:focus-visible:checked + span,
1662  input:focus:checked + span {
1663    border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
1664    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
1665  }
1666
1667  /* -- Checked states --------------------------------------------------- */
1668  input:checked + span {
1669    background-color: ${({tokens:e})=>e.core.iconAccentPrimary};
1670  }
1671
1672  label[data-size='lg'] > input:checked + span:before {
1673    transform: translateX(calc(100% - 9px));
1674  }
1675
1676  label[data-size='md'] > input:checked + span:before {
1677    transform: translateX(calc(100% - 9px));
1678  }
1679
1680  label[data-size='sm'] > input:checked + span:before {
1681    transform: translateX(calc(100% - 7px));
1682  }
1683
1684  /* -- Hover states ------------------------------------------------------- */
1685  label:hover > input:not(:checked):not(:disabled) + span {
1686    background-color: ${({colors:e})=>e.neutrals400};
1687  }
1688
1689  label:hover > input:checked:not(:disabled) + span {
1690    background-color: ${({colors:e})=>e.accent080};
1691  }
1692
1693  /* -- Disabled state --------------------------------------------------- */
1694  label:has(input:disabled) {
1695    pointer-events: none;
1696    user-select: none;
1697  }
1698
1699  input:not(:checked):disabled + span {
1700    background-color: ${({colors:e})=>e.neutrals700};
1701  }
1702
1703  input:checked:disabled + span {
1704    background-color: ${({colors:e})=>e.neutrals700};
1705  }
1706
1707  input:not(:checked):disabled + span::before {
1708    background-color: ${({colors:e})=>e.neutrals400};
1709  }
1710
1711  input:checked:disabled + span::before {
1712    background-color: ${({tokens:e})=>e.theme.textTertiary};
1713  }
1714`,to=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ts=class extends n.oi{constructor(){super(...arguments),this.inputElementRef=(0,tn.V)(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return(0,n.dy)`
1715      <label data-size=${this.size}>
1716        <input
1717          ${(0,tn.i)(this.inputElementRef)}
1718          type="checkbox"
1719          ?checked=${this.checked}
1720          ?disabled=${this.disabled}
1721          @change=${this.dispatchChangeEvent.bind(this)}
1722        />
1723        <span></span>
1724      </label>
1725    `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};ts.styles=[f.ET,f.ZM,ti],to([(0,i.Cb)({type:Boolean})],ts.prototype,"checked",void 0),to([(0,i.Cb)({type:Boolean})],ts.prototype,"disabled",void 0),to([(0,i.Cb)()],ts.prototype,"size",void 0),ts=to([(0,m.M)("wui-toggle")],ts);var ta=(0,y.iv)`
1726  :host {
1727    height: auto;
1728  }
1729
1730  :host > wui-flex {
1731    height: 100%;
1732    display: flex;
1733    align-items: center;
1734    justify-content: center;
1735    column-gap: ${({spacing:e})=>e["2"]};
1736    padding: ${({spacing:e})=>e["2"]} ${({spacing:e})=>e["3"]};
1737    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1738    border-radius: ${({borderRadius:e})=>e["4"]};
1739    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
1740    transition: background-color ${({durations:e})=>e.lg}
1741      ${({easings:e})=>e["ease-out-power-2"]};
1742    will-change: background-color;
1743    cursor: pointer;
1744  }
1745
1746  wui-switch {
1747    pointer-events: none;
1748  }
1749`,tc=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tl=class extends n.oi{constructor(){super(...arguments),this.checked=!1}
1749render(){return(0,n.dy)`
1750      <wui-flex>
1751        <wui-icon size="xl" name="walletConnectBrown"></wui-icon>
1752        <wui-toggle
1753          ?checked=${this.checked}
1754          size="sm"
1755          @switchChange=${this.handleToggleChange.bind(this)}
1756        ></wui-toggle>
1757      </wui-flex>
1758    `}handleToggleChange(e){e.stopPropagation(),this.checked=e.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};tl.styles=[f.ET,f.ZM,ta],tc([(0,i.Cb)({type:Boolean})],tl.prototype,"checked",void 0),tl=tc([(0,m.M)("wui-certified-switch")],tl),r(54541);var tu=(0,y.iv)`
1759  :host {
1760    position: relative;
1761    display: inline-block;
1762    width: 100%;
1763  }
1764
1765  wui-icon {
1766    position: absolute;
1767    top: 50%;
1768    transform: translateY(-50%);
1769    right: ${({spacing:e})=>e[3]};
1770    color: ${({tokens:e})=>e.theme.iconDefault};
1771    cursor: pointer;
1772    padding: ${({spacing:e})=>e[2]};
1773    background-color: transparent;
1774    border-radius: ${({borderRadius:e})=>e[4]};
1775    transition: background-color ${({durations:e})=>e.lg}
1776      ${({easings:e})=>e["ease-out-power-2"]};
1777  }
1778
1779  @media (hover: hover) {
1780    wui-icon:hover {
1781      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1782    }
1783  }
1784`,td=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let th=class extends n.oi{constructor(){super(...arguments),this.inputComponentRef=(0,tn.V)(),this.inputValue=""}render(){return(0,n.dy)`
1785      <wui-input-text
1786        ${(0,tn.i)(this.inputComponentRef)}
1787        placeholder="Search wallet"
1788        icon="search"
1789        type="search"
1790        enterKeyHint="search"
1791        size="sm"
1792        @inputChange=${this.onInputChange}
1793      >
1794        ${this.inputValue?(0,n.dy)`<wui-icon
1795              @click=${this.clearValue}
1796              color="inherit"
1797              size="sm"
1798              name="close"
1799            ></wui-icon>`:null}
1800      </wui-input-text>
1801    `}onInputChange(e){this.inputValue=e.detail||""}clearValue(){let e=this.inputComponentRef.value,t=e?.inputElementRef.value;t&&(t.value="",this.inputValue="",t.focus(),t.dispatchEvent(new Event("input")))}};th.styles=[f.ET,tu],td([(0,i.Cb)()],th.prototype,"inputValue",void 0),th=td([(0,m.M)("wui-search-bar")],th);var tp=r(84270),tf=r(8102);r(20958);var tg=(0,y.iv)`
1802  :host {
1803    display: flex;
1804    flex-direction: column;
1805    justify-content: center;
1806    align-items: center;
1807    height: 104px;
1808    width: 104px;
1809    row-gap: ${({spacing:e})=>e[2]};
1810    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1811    border-radius: ${({borderRadius:e})=>e[5]};
1812    position: relative;
1813  }
1814
1815  wui-shimmer[data-type='network'] {
1816    border: none;
1817    -webkit-clip-path: var(--apkt-path-network);
1818    clip-path: var(--apkt-path-network);
1819  }
1820
1821  svg {
1822    position: absolute;
1823    width: 48px;
1824    height: 54px;
1825    z-index: 1;
1826  }
1827
1828  svg > path {
1829    stroke: ${({tokens:e})=>e.theme.foregroundSecondary};
1830    stroke-width: 1px;
1831  }
1832
1833  @media (max-width: 350px) {
1834    :host {
1835      width: 100%;
1836    }
1837  }
1838`,tm=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ty=class extends n.oi{constructor(){super(...arguments),this.type="wallet"}render(){return(0,n.dy)`
1839      ${this.shimmerTemplate()}
1840      <wui-shimmer width="80px" height="20px"></wui-shimmer>
1841    `}shimmerTemplate(){return"network"===this.type?(0,n.dy)` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
1842        ${tf.W}`:(0,n.dy)`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}};ty.styles=[f.ET,f.ZM,tg],tm([(0,i.Cb)()],ty.prototype,"type",void 0),ty=tm([(0,m.M)("wui-card-select-loader")],ty);var tb=(0,n.iv)`
1843  :host {
1844    display: grid;
1845    width: inherit;
1846    height: inherit;
1847  }
1848`,tw=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tv=class extends n.oi{render(){return this.style.cssText=`
1849      grid-template-rows: ${this.gridTemplateRows};
1850      grid-template-columns: ${this.gridTemplateColumns};
1851      justify-items: ${this.justifyItems};
1852      align-items: ${this.alignItems};
1853      justify-content: ${this.justifyContent};
1854      align-content: ${this.alignContent};
1855      column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
1856      row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
1857      gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
1858      padding-top: ${this.padding&&g.H.getSpacingStyles(this.padding,0)};
1859      padding-right: ${this.padding&&g.H.getSpacingStyles(this.padding,1)};
1860      padding-bottom: ${this.padding&&g.H.getSpacingStyles(this.padding,2)};
1861      padding-left: ${this.padding&&g.H.getSpacingStyles(this.padding,3)};
1862      margin-top: ${this.margin&&g.H.getSpacingStyles(this.margin,
18620)};
1863      margin-right: ${this.margin&&g.H.getSpacingStyles(this.margin,1)};
1864      margin-bottom: ${this.margin&&g.H.getSpacingStyles(this.margin,2)};
1865      margin-left: ${this.margin&&g.H.getSpacingStyles(this.margin,3)};
1866    `,(0,n.dy)`<slot></slot>`}};tv.styles=[f.ET,tb],tw([(0,i.Cb)()],tv.prototype,"gridTemplateRows",void 0),tw([(0,i.Cb)()],tv.prototype,"gridTemplateColumns",void 0),tw([(0,i.Cb)()],tv.prototype,"justifyItems",void 0),tw([(0,i.Cb)()],tv.prototype,"alignItems",void 0),tw([(0,i.Cb)()],tv.prototype,"justifyContent",void 0),tw([(0,i.Cb)()],tv.prototype,"alignContent",void 0),tw([(0,i.Cb)()],tv.prototype,"columnGap",void 0),tw([(0,i.Cb)()],tv.prototype,"rowGap",void 0),tw([(0,i.Cb)()],tv.prototype,"gap",void 0),tw([(0,i.Cb)()],tv.prototype,"padding",void 0),tw([(0,i.Cb)()],tv.prototype,"margin",void 0),tv=tw([(0,m.M)("wui-grid")],tv);var tC=r(87313);r(41626),r(65050);var tE=(0,p.iv)`
1867  button {
1868    display: flex;
1869    flex-direction: column;
1870    justify-content: center;
1871    align-items: center;
1872    cursor: pointer;
1873    width: 104px;
1874    row-gap: ${({spacing:e})=>e["2"]};
1875    padding: ${({spacing:e})=>e["3"]} ${({spacing:e})=>e["0"]};
1876    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1877    border-radius: clamp(0px, ${({borderRadius:e})=>e["4"]}, 20px);
1878    transition:
1879      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]},
1880      background-color ${({durations:e})=>e.lg}
1881        ${({easings:e})=>e["ease-out-power-1"]},
1882      border-radius ${({durations:e})=>e.lg}
1883        ${({easings:e})=>e["ease-out-power-1"]};
1884    will-change: background-color, color, border-radius;
1885    outline: none;
1886    border: none;
1887  }
1888
1889  button > wui-flex > wui-text {
1890    color: ${({tokens:e})=>e.theme.textPrimary};
1891    max-width: 86px;
1892    white-space: nowrap;
1893    overflow: hidden;
1894    text-overflow: ellipsis;
1895    justify-content: center;
1896  }
1897
1898  button > wui-flex > wui-text.certified {
1899    max-width: 66px;
1900  }
1901
1902  @media (hover: hover) and (pointer: fine) {
1903    button:hover:enabled {
1904      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1905    }
1906  }
1907
1908  button:disabled > wui-flex > wui-text {
1909    color: ${({tokens:e})=>e.core.glass010};
1910  }
1911
1912  [data-selected='true'] {
1913    background-color: ${({colors:e})=>e.accent020};
1914  }
1915
1916  @media (hover: hover) and (pointer: fine) {
1917    [data-selected='true']:hover:enabled {
1918      background-color: ${({colors:e})=>e.accent010};
1919    }
1920  }
1921
1922  [data-selected='true']:active:enabled {
1923    background-color: ${({colors:e})=>e.accent010};
1924  }
1925
1926  @media (max-width: 350px) {
1927    button {
1928      width: 100%;
1929    }
1930  }
1931`,tx=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tA=class extends n.oi{constructor(){super(),this.observer=new IntersectionObserver(()=>void 0),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){let e=this.wallet?.badge_type==="certified";return(0,n.dy)`
1932      <button>
1933        ${this.imageTemplate()}
1934        <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
1935          <wui-text
1936            variant="md-regular"
1937            color="inherit"
1938            class=${(0,o.o)(e?"certified":void 0)}
1939            >${this.wallet?.name}</wui-text
1940          >
1941          ${e?(0,n.dy)`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
1942        </wui-flex>
1943      </button>
1944    `}imageTemplate(){return(this.visible||this.imageSrc)&&!this.imageLoading?(0,n.dy)`
1945      <wui-wallet-image
1946        size="lg"
1947        imageSrc=${(0,o.o)(this.imageSrc)}
1948        name=${this.wallet?.name}
1949        .installed=${this.wallet?.installed}
1950        badgeSize="sm"
1951      >
1952      </wui-wallet-image>
1953    `:this.shimmerTemplate()}shimmerTemplate(){return(0,n.dy)`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=l.f.getWalletImage(this.wallet),this.imageSrc||(this.imageLoading=!0,this.imageSrc=await l.f.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};tA.styles=tE,tx([(0,i.SB)()],tA.prototype,"visible",void 0),tx([(0,i.SB)()],tA.prototype,"imageSrc",void 0),tx([(0,i.SB)()],tA.prototype,"imageLoading",void 0),tx([(0,i.Cb)()],tA.prototype,"wallet",void 0),tA=tx([(0,p.Mo)("w3m-all-wallets-list-item")],tA);var tS=(0,p.iv)`
1954  wui-grid {
1955    max-height: clamp(360px, 400px, 80vh);
1956    overflow: scroll;
1957    scrollbar-width: none;
1958    grid-auto-rows: min-content;
1959    grid-template-columns: repeat(auto-fill, 104px);
1960  }
1961
1962  @media (max-width: 350px) {
1963    wui-grid {
1964      grid-template-columns: repeat(2, 1fr);
1965    }
1966  }
1967
1968  wui-grid[data-scroll='false'] {
1969    overflow: hidden;
1970  }
1971
1972  wui-grid::-webkit-scrollbar {
1973    display: none;
1974  }
1975
1976  w3m-all-wallets-list-item {
1977    opacity: 0;
1978    animation-duration: ${({durations:e})=>e.xl};
1979    animation-timing-function: ${({easings:e})=>e["ease-inout-power-2"]};
1980    animation-name: fade-in;
1981    animation-fill-mode: forwards;
1982  }
1983
1984  @keyframes fade-in {
1985    from {
1986      opacity: 0;
1987    }
1988    to {
1989      opacity: 1;
1990    }
1991  }
1992
1993  wui-loading-spinner {
1994    padding-top: ${({spacing:e})=>e["4"]};
1995    padding-bottom: ${({spacing:e})=>e["4"]};
1996    justify-content: center;
1997    grid-column: 1 / span 4;
1998  }
1999`,t_=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tI="local-paginator",tk=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!tp.ApiController.state.wallets.length,this.wallets=tp.ApiController.state.wallets,this.recommended=tp.ApiController.state.recommended,this.featured=tp.ApiController.state.featured,this.filteredWallets=tp.ApiController.state.filteredWallets,this.unsubscribe.push(tp.ApiController.subscribeKey("wallets",e=>this.wallets=e),tp.ApiController.subscribeKey("recommended",e=>this.recommended=e),tp.ApiController.subscribeKey("featured",e=>this.featured=e),tp.ApiController.subscribeKey("filteredWallets",e=>this.filteredWallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.paginationObserver?.disconnect()}render(){return(0,n.dy)`
2000      <wui-grid
2001        data-scroll=${!this.loading}
2002        .padding=${["0","3","3","3"]}
2003        gap="2"
2004        justifyContent="space-between"
2005      >
2006        ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
2007        ${this.paginationLoaderTemplate()}
2008      </wui-grid>
2009    `}async initialFetch(){this.loading=!0;let e=this.shadowRoot?.querySelector("wui-grid");e&&(await tp.ApiController.fetchWalletsByPage({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,t){return[...Array(e)].map(()=>(0,n.dy)`
2010        <wui-card-select-loader type="wallet" id=${(0,o.o)(t)}></wui-card-select-loader>
2011      `)}getWallets(){let e=[...this.featured,...this.recommended];this.filteredWallets?.length>0?e.push(...this.filteredWallets):e.push(...this.wallets);let t=d.j.uniqueBy(e,"id"),r=tC.J.markWalletsAsInstalled(t);return tC.J.markWalletsWithDisplayIndex(r)}walletsTemplate(){return this.getWallets().map(e=>(0,n.dy)`
2012        <w3m-all-wallets-list-item
2013          data-testid="wallet-search-item-${e.id}"
2014          @click=${()=>this.onConnectWallet(e)}
2015          .wallet=${e}
2016        ></w3m-all-wallets-list-item>
2017      `)}paginationLoaderTemplate(){let{wallets:e,recommended:t,featured:r,count:n,mobileFilteredOutWalletsLength:i}=tp.ApiController.state,o=window.innerWidth<352?3:4,s=e.length+t.length,a=Math.ceil(s/o)*o-s+o;return(a-=e.length?r.length%o:0,0===n&&r.length>0)?null:0===n||[...r,...e,...t].length<n-(i??0)?this.shimmerTemplate(a,tI):null}createPaginationObserver(){let e=this.shadowRoot?.querySelector(`#${tI}`);e&&(this.paginationObserver=new IntersectionObserver(([e])=>{if(e?.isIntersecting&&!this.loading){let{page:e,count:t,wallets:r}=tp.ApiController.state;r.length<t&&tp.ApiController.fetchWalletsByPage({page:e+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){Z.ConnectorController.selectWalletConnector(e)}};tk.styles=tS,t_([(0,i.SB)()],tk.prototype,"loading",void 0),t_([(0,i.SB)()],tk.prototype,"wallets",void 0),t_([(0,i.SB)()],tk.prototype,"recommended",void 0),t_([(0,i.SB)()],tk.prototype,"featured",void 0),t_([(0,i.SB)()],tk.prototype,"filteredWallets",void 0),tk=t_([(0,p.Mo)("w3m-all-wallets-list")],tk),r(6551);var tO=(0,n.iv)`
2018  wui-grid,
2019  wui-loading-spinner,
2020  wui-flex {
2021    height: 360px;
2022  }
2023
2024  wui-grid {
2025    overflow: scroll;
2026    scrollbar-width: none;
2027    grid-auto-rows: min-content;
2028    grid-template-columns: repeat(auto-fill, 104px);
2029  }
2030
2031  wui-grid[data-scroll='false'] {
2032    overflow: hidden;
2033  }
2034
2035  wui-grid::-webkit-scrollbar {
2036    display: none;
2037  }
2038
2039  wui-loading-spinner {
2040    justify-content: center;
2041    align-items: center;
2042  }
2043
2044  @media (max-width: 350px) {
2045    wui-grid {
2046      grid-template-columns: repeat(2, 1fr);
2047    }
2048  }
2049`,tN=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tP=class extends n.oi{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?(0,n.dy)`<wui-loading-spinner color="accent-primary"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await tp.ApiController.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){let{search:e}=tp.ApiController.state,t=tC.J.markWalletsAsInstalled(e);return e.length?(0,n.dy)`
2050      <wui-grid
2051        data-testid="wallet-list"
2052        .padding=${["0","3","3","3"]}
2053        rowGap="4"
2054        columngap="2"
2055        justifyContent="space-between"
2056      >
2057        ${t.map(e=>(0,n.dy)`
2058            <w3m-all-wallets-list-item
2059              @click=${()=>this.onConnectWallet(e)}
2060              .wallet=${e}
2061              data-testid="wallet-search-item-${e.id}"
2062            ></w3m-all-wallets-list-item>
2063          `)}
2064      </wui-grid>
2065    `:(0,n.dy)`
2066        <wui-flex
2067          data-testid="no-wallet-found"
2068          justifyContent="center"
2069          alignItems="center"
2070          gap="3"
2071          flexDirection="column"
2072        >
2073          <wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
2074          <wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
2075            No Wallet found
2076          </wui-text>
2077        </wui-flex>
2078      `}onConnectWallet(e){Z.ConnectorController.selectWalletConnector(e)}};tP.styles=tO,tN([(0,i.SB)()],tP.prototype,"loading",void 0),tN([(0,i.Cb)()],tP.prototype,"query",void 0),tN([(0,i.Cb)()],tP.prototype,"badge",void 0),tP=tN([(0,p.Mo)("w3m-all-wallets-search")],tP);var tT=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tR=class extends n.oi{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=d.j.debounce(e=>{this.search=e})}render(){let e=this.search.length>=2;return(0,n.dy)`
2079      <wui-flex .padding=${["1","3","3","3"]} gap="2" alignItems="center">
2080        <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
2081        <wui-certified-switch
2082          ?checked=${"certified"===this.badge}
2083          @certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
2084          data-testid="wui-certified-switch"
2085        ></wui-certified-switch>
2086        ${this.qrButtonTemplate()}
2087      </wui-flex>
2088      ${e||this.badge?(0,n.dy)`<w3m-all-wallets-search
2089            query=${this.search}
2090            .badge=${this.badge}
2091          ></w3m-all-wallets-search>`:(0,n.dy)`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
2092    `}onInputChange(e){this.onDebouncedSearch(e.detail)}onCertifiedSwitchChange(e){e.detail?(this.badge="certified",J.SnackController.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return d.j.isMobile()?(0,n.dy)`
2093        <wui-icon-box
2094          size="xl"
2095          iconSize="xl"
2096          color="accent-primary"
2097          icon="qrCode"
2098          border
2099          borderColor="wui-accent-glass-010"
2100          @click=${this.onWalletConnectQr.bind(this)}
2101        ></wui-icon-box>
2102      `:null}onWalletConnectQr(){Q.RouterController.push("ConnectingWalletConnect")}};tT([(0,i.SB)()],tR.prototype,"search",void 0),tT([(0,i.SB)()],tR.prototype,"badge",void 0),tR=tT([(0,p.Mo)("w3m-all-wallets-view")],tR);var t$=r(31382),tD=r(13387),tL=(0,y.iv)`
2103  button {
2104    display: flex;
2105    gap: ${({spacing:e})=>e[1]};
2106    padding: ${({spacing:e})=>e[4]};
2107    width: 100%;
2108    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2109    border-radius: ${({borderRadius:e})=>e[4]};
2110    justify-content: center;
2111    align-items: center;
2112  }
2113
2114  :host([data-size='sm']) button {
2115    padding: ${({spacing:e})=>e[2]};
2116    border-radius: ${({borderRadius:e})=>e[2]};
2117  }
2118
2119  :host([data-size='md']) button {
2120    padding: ${({spacing:e})=>e[3]};
2121    border-radius: ${({borderRadius:e})=>e[3]};
2122  }
2123
2124  button:hover {
2125    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2126  }
2127
2128  button:disabled {
2129    opacity: 0.5;
2130  }
2131`,tM=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tU=class extends n.oi{constructor(){super(...arguments),this.text="",this.disabled=!1,this.size="lg",this.icon="copy",this.tabIdx=void 0}render(){this.dataset.size=this.size;let e=`${this.size}-regular`;return(0,n.dy)`
2132      <button ?disabled=${this.disabled} tabindex=${(0,o.o)(this.tabIdx)}>
2133        <wui-icon name=${this.icon} size=${this.size} color="default"></wui-icon>
2134        <wui-text align="center" variant=${e} color="primary">${this.text}</wui-text>
2135      </button>
2136    `}};tU.styles=[f.ET,f.ZM,tL],tM([(0,i.Cb)()],tU.prototype,"text",void 0),tM([(0,i.Cb)({type:Boolean})],tU.prototype,"disabled",void 0),tM([(0,i.Cb)()],tU.prototype,"size",void 0),tM([(0,i.Cb)()],tU.prototype,"icon",void 0),tM([(0,i.Cb)()],tU.prototype,"tabIdx",void 0),tU=tM([(0,m.M)("wui-list-button")],tU),r(56306);var tj=r(48459),tB=r(6082);r(73741);var tF=r(52726),tz=(0,p.iv)`
2137  wui-separator {
2138    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1);
2139    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
2140  }
2141
2142  wui-email-input {
2143    width: 100%;
2144  }
2145
2146  form {
2147    width: 100%;
2148    display: block;
2149    position: relative;
2150  }
2151
2152  wui-icon-link,
2153  wui-loading-spinner {
2154    position: absolute;
2155    top: 50%;
2156    transform: translateY(-50%);
2157  }
2158
2159  wui-icon-link {
2160    right: ${({spacing:e})=>e["2"]};
2161  }
2162
2163  wui-loading-spinner {
2164    right: ${({spacing:e})=>e["3"]};
2165  }
2166
2167  wui-text {
2168    margin: ${({spacing:e})=>e["2"]} ${({spacing:e})=>e["3"]}
2169      ${({spacing:e})=>e["0"]} ${({spacing:e})=>e["3"]};
2170  }
2171`,tH=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tW=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.formRef=(0,tn.V)(),this.email="",this.loading=!1,this.error="",this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.unsubscribe.push(s.OptionsController.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.formRef.value?.addEventListener("keydown",e=>{"Enter"===e.key&&this.onSubmitEmail(e)})}render(){let e=ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.AUTH);return(0,n.dy)`
2172      <form ${(0,tn.i)(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
2173        <wui-email-input
2174          @focus=${this.onFocusEvent.bind(this)}
2175          .disabled=${this.loading}
2176          @inputChange=${this.onEmailInputChange.bind(this)}
2177          tabIdx=${(0,o.o)(this.tabIdx)}
2178          ?disabled=${e}
2179        >
2180        </wui-email-input>
2181
2182        ${this.submitButtonTemplate()}${this.loadingTemplate()}
2183        <input type="submit" hidden />
2184      </form>
2185      ${this.templateError()}
2186    `}submitButtonTemplate(){return!this.loading&&this.email.length>3?(0,n.dy)`
2187          <wui-icon-link
2188            size="sm"
2189            icon="chevronRight"
2190            iconcolor="accent-100"
2191            @click=${this.onSubmitEmail.bind(this)}
2192          >
2193          </wui-icon-link>
2194        `:null}loadingTemplate(){return this.loading?(0,n.dy)`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:null}templateError(){return this.error?(0,n.dy)`<wui-text variant="sm-medium" color="error">${this.error}</wui-text>`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){if(!eR.g.isValidEmail(this.email)){tB.AlertController.open({displayMessage:tF.j.ALERT_WARNINGS.INVALID_EMAIL.displayMessage},"warning");return}if(!G.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>e===a.R.state.activeChain)){let e=a.R.getFirstCaipNetworkSupportsAuthConnector();if(e){Q.RouterController.push("SwitchNetwork",{network:e});return}}try{if(this.loading)return;this.loading=!0,e.preventDefault();let t=Z.ConnectorController.getAuthConnector();if(!t)throw Error("w3m-email-login-widget: Auth connector not found");let{action:r}=await t.provider.connectEmail({email:this.email});if(M.X.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),"VERIFY_OTP"===r)M.X.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),Q.RouterController.push("EmailVerifyOtp",{email:this.email});
2194else if("VERIFY_DEVICE"===r)Q.RouterController.push("EmailVerifyDevice",{email:this.email});else if("CONNECT"===r){let e=this.remoteFeatures?.multiWallet;await ee.ConnectionController.connectExternal(t,a.R.state.activeChain),e?(Q.RouterController.replace("ProfileWallets"),J.SnackController.showSuccess("New Wallet Added")):Q.RouterController.replace("Account")}}catch(t){let e=d.j.parseError(t);e?.includes("Invalid email")?this.error="Invalid email. Try again.":J.SnackController.showError(t)}finally{this.loading=!1}}onFocusEvent(){M.X.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};tW.styles=tz,tH([(0,i.Cb)()],tW.prototype,"tabIdx",void 0),tH([(0,i.SB)()],tW.prototype,"email",void 0),tH([(0,i.SB)()],tW.prototype,"loading",void 0),tH([(0,i.SB)()],tW.prototype,"error",void 0),tH([(0,i.SB)()],tW.prototype,"remoteFeatures",void 0),tW=tH([(0,p.Mo)("w3m-email-login-widget")],tW),r(69943);var tq=r(54860);r(62281),r(67079);var tV=(0,y.iv)`
2195  :host {
2196    display: block;
2197    width: 100%;
2198  }
2199
2200  button {
2201    width: 100%;
2202    height: 52px;
2203    display: flex;
2204    align-items: center;
2205    justify-content: center;
2206    background: ${({tokens:e})=>e.theme.foregroundPrimary};
2207    border-radius: ${({borderRadius:e})=>e[4]};
2208  }
2209
2210  @media (hover: hover) {
2211    button:hover:enabled {
2212      background: ${({tokens:e})=>e.theme.foregroundSecondary};
2213    }
2214  }
2215
2216  button:disabled {
2217    cursor: not-allowed;
2218    opacity: 0.5;
2219  }
2220
2221  button > wui-icon {
2222    width: 24px;
2223    height: 24px;
2224  }
2225`,tK=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tG=class extends n.oi{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return(0,n.dy)`
2226      <button ?disabled=${this.disabled} tabindex=${(0,o.o)(this.tabIdx)}>
2227        <wui-icon name=${this.logo}></wui-icon>
2228      </button>
2229    `}};tG.styles=[f.ET,f.ZM,tV],tK([(0,i.Cb)()],tG.prototype,"logo",void 0),tK([(0,i.Cb)({type:Boolean})],tG.prototype,"disabled",void 0),tK([(0,i.Cb)()],tG.prototype,"tabIdx",void 0),tG=tK([(0,m.M)("wui-logo-select")],tG);var tZ=r(28503),tY=(0,p.iv)`
2230  wui-separator {
2231    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1)
2232      ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1);
2233    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
2234  }
2235`,tJ=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let tX=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.isPwaLoading=!1,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type)}),s.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)`
2236      <wui-flex
2237        class="container"
2238        flexDirection="column"
2239        gap="2"
2240        data-testid="w3m-social-login-widget"
2241      >
2242        ${this.topViewTemplate()}${this.bottomViewTemplate()}
2243      </wui-flex>
2244    `}topViewTemplate(){let e="explore"===this.walletGuide,t=this.remoteFeatures?.socials;return!t&&e?(t=Y.bq.DEFAULT_SOCIALS,this.renderTopViewContent(t)):t?this.renderTopViewContent(t):null}renderTopViewContent(e){return 2===e.length?(0,n.dy)` <wui-flex gap="2">
2245        ${e.slice(0,2).map(e=>(0,n.dy)`<wui-logo-select
2246              data-testid=${`social-selector-${e}`}
2247              @click=${()=>{this.onSocialClick(e)}}
2248              logo=${e}
2249              tabIdx=${(0,o.o)(this.tabIdx)}
2250              ?disabled=${this.isPwaLoading||this.hasConnection()}
2251            ></wui-logo-select>`)}
2252      </wui-flex>`:(0,n.dy)` <wui-list-button
2253      data-testid=${`social-selector-${e[0]}`}
2254      @click=${()=>{this.onSocialClick(e[0])}}
2255      size="lg"
2256      icon=${(0,o.o)(e[0])}
2257      text=${`Continue with ${e[0]}`}
2258      tabIdx=${(0,o.o)(this.tabIdx)}
2259      ?disabled=${this.isPwaLoading||this.hasConnection()}
2260    ></wui-list-button>`}bottomViewTemplate(){let e=this.remoteFeatures?.socials,t="explore"===this.walletGuide;return(this.authConnector&&e&&0!==e.length||!t||(e=Y.bq.DEFAULT_SOCIALS),!e||e.length<=2)?null:e&&e.length>6?(0,n.dy)`<wui-flex gap="2">
2261        ${e.slice(1,5).map(e=>(0,n.dy)`<wui-logo-select
2262              data-testid=${`social-selector-${e}`}
2263              @click=${()=>{this.onSocialClick(e)}}
2264              logo=${e}
2265              tabIdx=${(0,o.o)(this.tabIdx)}
2266              ?focusable=${void 0!==this.tabIdx&&this.tabIdx>=0}
2267              ?disabled=${this.isPwaLoading||this.hasConnection()}
2268            ></wui-logo-select>`)}
2269        <wui-logo-select
2270          logo="more"
2271          tabIdx=${(0,o.o)(this.tabIdx)}
2272          @click=${this.onMoreSocialsClick.bind(this)}
2273          ?disabled=${this.isPwaLoading||this.hasConnection()}
2274          data-testid="social-selector-more"
2275        ></wui-logo-select>
2276      </wui-flex>`:e?(0,n.dy)`<wui-flex gap="2">
2277      ${e.slice(1,e.length).map(e=>(0,n.dy)`<wui-logo-select
2278            data-testid=${`social-selector-${e}`}
2279            @click=${()=>{this.onSocialClick(e)}}
2280            logo=${e}
2281            tabIdx=${(0,o.o)(this.tabIdx)}
2282            ?focusable=${void 0!==this.tabIdx&&this.tabIdx>=0}
2283            ?disabled=${this.isPwaLoading||this.hasConnection()}
2284          ></wui-logo-select>`)}
2285    </wui-flex>`:null}onMoreSocialsClick(){Q.RouterController.push("ConnectSocials")}async onSocialClick(e){if(!G.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>e===a.R.state.activeChain)){let e=a.R.getFirstCaipNetworkSupportsAuthConnector();if(e){Q.RouterController.push("SwitchNetwork",{network:e});return}}e&&await (0,tq.y0)(e)}async handlePwaFrameLoad(){if(d.j.isPWA()){this.isPwaLoading=!0;try{this.authConnector?.provider instanceof tZ.S&&await this.authConnector.provider.init()}catch(e){tB.AlertController.open({displayMessage:"Error loading embedded wallet in PWA",debugMessage:e.message},"error")}finally{this.isPwaLoading=!1}}}hasConnection(){return ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.AUTH)}};tX.styles=tY,tJ([(0,i.Cb)()],tX.prototype,"walletGuide",void 0),tJ([(0,i.Cb)()],tX.prototype,"tabIdx",void 0),tJ([(0,i.SB)()],tX.prototype,"connectors",void 0),tJ([(0,i.SB)()],tX.prototype,"remoteFeatures",void 0),tJ([(0,i.SB)()],tX.prototype,"authConnector",void 0),tJ([(0,i.SB)()],tX.prototype,"isPwaLoading",void 0),tX=tJ([(0,p.Mo)("w3m-social-login-widget")],tX);var tQ=(0,y.iv)`
2286  :host {
2287    position: relative;
2288    border-radius: ${({borderRadius:e})=>e[2]};
2289    width: 40px;
2290    height: 40px;
2291    overflow: hidden;
2292    background: ${({tokens:e})=>e.theme.foregroundPrimary};
2293    display: flex;
2294    justify-content: center;
2295    align-items: center;
2296    flex-wrap: wrap;
2297    column-gap: ${({spacing:e})=>e[1]};
2298    padding: ${({spacing:e})=>e[1]};
2299  }
2300
2301  :host > wui-wallet-image {
2302    width: 14px;
2303    height: 14px;
2304    border-radius: 2px;
2305  }
2306`,t0=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let t1=class extends n.oi{constructor(){super(...arguments),this.walletImages=[]}render(){let e=this.walletImages.length<4;return(0,n.dy)`${this.walletImages.slice(0,4).map(({src:e,walletName:t})=>(0,n.dy)`
2307          <wui-wallet-image
2308            size="sm"
2309            imageSrc=${e}
2310            name=${(0,o.o)(t)}
2311          ></wui-wallet-image>
2312        `)}
2313    ${e?[...Array(4-this.walletImages.length)].map(()=>(0,n.dy)` <wui-wallet-image size="sm" name=""></wui-wallet-image>`):null} `}};t1.styles=[f.ET,tQ],t0([(0,i.Cb)({type:Array})],t1.prototype,"walletImages",void 0),t1=t0([(0,m.M)("wui-all-wallets-image")],t1);var t2=(0,y.iv)`
2314  :host {
2315    width: 100%;
2316  }
2317
2318  button {
2319    column-gap: ${({spacing:e})=>e[2]};
2320    padding: ${({spacing:e})=>e[3]};
2321    width: 100%;
2322    background-color: transparent;
2323    border-radius: ${({borderRadius:e})=>e[4]};
2324    color: ${({tokens:e})=>e.theme.textPrimary};
2325  }
2326
2327  button > wui-wallet-image {
2328    background: ${({tokens:e})=>e.theme.foregroundSecondary};
2329  }
2330
2331  button > wui-text:nth-child(2) {
2332    display: flex;
2333    flex: 1;
2334  }
2335
2336  button:hover:enabled {
2337    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2338  }
2339
2340  button[data-all-wallets='true'] {
2341    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2342  }
2343
2344  button[data-all-wallets='true']:hover:enabled {
2345    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2346  }
2347
2348  button:focus-visible:enabled {
2349    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2350    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
2351  }
2352
2353  button:disabled {
2354    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2355    opacity: 0.5;
2356    cursor: not-allowed;
2357  }
2358
2359  button:disabled > wui-tag {
2360    background-color: ${({tokens:e})=>e.core.glass010};
2361    color: ${({tokens:e})=>e.theme.foregroundTertiary};
2362  }
2363`,t5=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let t3=class extends n.oi{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.size="md",this.tabIdx=void 0,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return this.dataset.size=this.size,(0,n.dy)`
2364      <button
2365        ?disabled=${this.disabled}
2366        data-all-wallets=${this.showAllWallets}
2367        tabindex=${(0,o.o)(this.tabIdx)}
2368      >
2369        ${this.templateAllWallets()} ${this.templateWalletImage()}
2370        <wui-text variant="lg-regular" color="inherit">${this.name}</wui-text>
2371        ${this.templateStatus()}
2372      </button>
2373    `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?(0,n.dy)` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?(0,n.dy)` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?(0,n.dy)`<wui-wallet-image
2374        size=${(0,o.o)("sm"===this.size?"sm":"md")}
2375        imageSrc=${this.imageSrc}
2376        name=${this.name}
2377      ></wui-wallet-image>`:this.showAllWallets||this.imageSrc?null:(0,n.dy)`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`}templateStatus(){return this.loading?(0,n.dy)`<wui-loading-spinner size="lg" color="accent-primary"></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?(0,n.dy)`<wui-tag size="sm" variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:null}};t3.styles=[f.ET,f.ZM,t2],t5([(0,i.Cb)({type:Array})],t3.prototype,"walletImages",void 0),t5([(0,i.Cb)()],t3.prototype,"imageSrc",void 0),t5([(0,i.Cb)()],t3.prototype,"name",void 0),t5([(0,i.Cb)()],t3.prototype,"size",void 0),t5([(0,i.Cb)()],t3.prototype,"tagLabel",void 0),t5([(0,i.Cb)()],t3.prototype,"tagVariant",void 0),t5([(0,i.Cb)()],t3.prototype,"walletIcon",void 0),t5([(0,i.Cb)()],t3.prototype,"tabIdx",void 0),t5([(0,i.Cb)({type:Boolean})],t3.prototype,"disabled",void 0),t5([(0,i.Cb)({type:Boolean})],t3.prototype,"showAllWallets",void 0),t5([(0,i.Cb)({type:Boolean})],t3.prototype,"loading",void 0),t5([(0,i.Cb)({type:String})],t3.prototype,"loadingSpinnerColor",void 0),t3=t5([(0,m.M)("wui-list-wallet")],t3);var t6=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let t4=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.count=tp.ApiController.state.count,this.filteredCount=tp.ApiController.state.filteredWallets.length,this.isFetchingRecommendedWallets=tp.ApiController.state.isFetchingRecommendedWallets,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>this.connectors=e),tp.ApiController.subscribeKey("count",e=>this.count=e),tp.ApiController.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),tp.ApiController.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}
2377disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.find(e=>"walletConnect"===e.id),{allWallets:t}=s.OptionsController.state;if(!e||"HIDE"===t||"ONLY_MOBILE"===t&&!d.j.isMobile())return null;let r=tp.ApiController.state.featured.length,i=this.count+r,a=this.filteredCount>0?this.filteredCount:i<10?i:10*Math.floor(i/10),c=`${a}`;this.filteredCount>0?c=`${this.filteredCount}`:a<i&&(c=`${a}+`);let l=ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.WALLET_CONNECT);return(0,n.dy)`
2378      <wui-list-wallet
2379        name="Search Wallet"
2380        walletIcon="search"
2381        showAllWallets
2382        @click=${this.onAllWallets.bind(this)}
2383        tagLabel=${c}
2384        tagVariant="info"
2385        data-testid="all-wallets"
2386        tabIdx=${(0,o.o)(this.tabIdx)}
2387        .loading=${this.isFetchingRecommendedWallets}
2388        ?disabled=${l}
2389        size="sm"
2390      ></wui-list-wallet>
2391    `}onAllWallets(){M.X.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),Q.RouterController.push("AllWallets")}};t6([(0,i.Cb)()],t4.prototype,"tabIdx",void 0),t6([(0,i.SB)()],t4.prototype,"connectors",void 0),t6([(0,i.SB)()],t4.prototype,"count",void 0),t6([(0,i.SB)()],t4.prototype,"filteredCount",void 0),t6([(0,i.SB)()],t4.prototype,"isFetchingRecommendedWallets",void 0),t4=t6([(0,p.Mo)("w3m-all-wallets-widget")],t4);var t8=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let t9=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.connections=ee.ConnectionController.state.connections,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>this.connectors=e),ee.ConnectionController.subscribeKey("connections",e=>this.connections=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"ANNOUNCED"===e.type);return e?.length?(0,n.dy)`
2392      <wui-flex flexDirection="column" gap="2">
2393        ${e.filter(eT.C.showConnector).map(e=>{let t=(this.connections.get(e.chain)??[]).some(t=>e3.g.isLowerCaseMatch(t.connectorId,e.id));return(0,n.dy)`
2394            <wui-list-wallet
2395              imageSrc=${(0,o.o)(l.f.getConnectorImage(e))}
2396              name=${e.name??"Unknown"}
2397              @click=${()=>this.onConnector(e)}
2398              tagVariant=${t?"info":"success"}
2399              tagLabel=${t?"connected":"installed"}
2400              size="sm"
2401              data-testid=${`wallet-selector-${e.id}`}
2402              .installed=${!0}
2403              tabIdx=${(0,o.o)(this.tabIdx)}
2404            >
2405            </wui-list-wallet>
2406          `})}
2407      </wui-flex>
2408    `:(this.style.cssText="display: none",null)}onConnector(e){"walletConnect"===e.id?d.j.isMobile()?Q.RouterController.push("AllWallets"):Q.RouterController.push("ConnectingWalletConnect"):Q.RouterController.push("ConnectingExternal",{connector:e})}};t8([(0,i.Cb)()],t9.prototype,"tabIdx",void 0),t8([(0,i.SB)()],t9.prototype,"connectors",void 0),t8([(0,i.SB)()],t9.prototype,"connections",void 0),t9=t8([(0,p.Mo)("w3m-connect-announced-widget")],t9);var t7=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let re=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.loading=!1,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>this.connectors=e)),d.j.isTelegram()&&d.j.isIos()&&(this.loading=!ee.ConnectionController.state.wcUri,this.unsubscribe.push(ee.ConnectionController.subscribeKey("wcUri",e=>this.loading=!e)))}
2408disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{customWallets:e}=s.OptionsController.state;if(!e?.length)return this.style.cssText="display: none",null;let t=this.filterOutDuplicateWallets(e),r=ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.WALLET_CONNECT);return(0,n.dy)`<wui-flex flexDirection="column" gap="2">
2409      ${t.map(e=>(0,n.dy)`
2410          <wui-list-wallet
2411            imageSrc=${(0,o.o)(l.f.getWalletImage(e))}
2412            name=${e.name??"Unknown"}
2413            @click=${()=>this.onConnectWallet(e)}
2414            size="sm"
2415            data-testid=${`wallet-selector-${e.id}`}
2416            tabIdx=${(0,o.o)(this.tabIdx)}
2417            ?loading=${this.loading}
2418            ?disabled=${r}
2419          >
2420          </wui-list-wallet>
2421        `)}
2422    </wui-flex>`}filterOutDuplicateWallets(e){let t=es.M.getRecentWallets(),r=this.connectors.map(e=>e.info?.rdns).filter(Boolean),n=t.map(e=>e.rdns).filter(Boolean),i=r.concat(n);if(i.includes("io.metamask.mobile")&&d.j.isMobile()){let e=i.indexOf("io.metamask.mobile");i[e]="io.metamask"}return e.filter(e=>!i.includes(String(e?.rdns)))}onConnectWallet(e){this.loading||Q.RouterController.push("ConnectingWalletConnect",{wallet:e})}};t7([(0,i.Cb)()],re.prototype,"tabIdx",void 0),t7([(0,i.SB)()],re.prototype,"connectors",void 0),t7([(0,i.SB)()],re.prototype,"loading",void 0),re=t7([(0,p.Mo)("w3m-connect-custom-widget")],re);var rt=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rr=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"EXTERNAL"===e.type).filter(eT.C.showConnector).filter(e=>e.id!==G.b.CONNECTOR_ID.COINBASE_SDK);if(!e?.length)return this.style.cssText="display: none",null;let t=ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.WALLET_CONNECT);return(0,n.dy)`
2423      <wui-flex flexDirection="column" gap="2">
2424        ${e.map(e=>(0,n.dy)`
2425            <wui-list-wallet
2426              imageSrc=${(0,o.o)(l.f.getConnectorImage(e))}
2427              .installed=${!0}
2428              name=${e.name??"Unknown"}
2429              data-testid=${`wallet-selector-external-${e.id}`}
2430              size="sm"
2431              @click=${()=>this.onConnector(e)}
2432              tabIdx=${(0,o.o)(this.tabIdx)}
2433              ?disabled=${t}
2434            >
2435            </wui-list-wallet>
2436          `)}
2437      </wui-flex>
2438    `}onConnector(e){Q.RouterController.push("ConnectingExternal",{connector:e})}};rt([(0,i.Cb)()],rr.prototype,"tabIdx",void 0),rt([(0,i.SB)()],rr.prototype,"connectors",void 0),rr=rt([(0,p.Mo)("w3m-connect-external-widget")],rr);var rn=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ri=class extends n.oi{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){if(!this.wallets.length)return this.style.cssText="display: none",null;let e=ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.WALLET_CONNECT);return(0,n.dy)`
2439      <wui-flex flexDirection="column" gap="2">
2440        ${this.wallets.map(t=>(0,n.dy)`
2441            <wui-list-wallet
2442              data-testid=${`wallet-selector-featured-${t.id}`}
2443              imageSrc=${(0,o.o)(l.f.getWalletImage(t))}
2444              name=${t.name??"Unknown"}
2445              @click=${()=>this.onConnectWallet(t)}
2446              tabIdx=${(0,o.o)(this.tabIdx)}
2447              size="sm"
2448              ?disabled=${e}
2449            >
2450            </wui-list-wallet>
2451          `)}
2452      </wui-flex>
2453    `}onConnectWallet(e){Z.ConnectorController.selectWalletConnector(e)}};rn([(0,i.Cb)()],ri.prototype,"tabIdx",void 0),rn([(0,i.Cb)()],ri.prototype,"wallets",void 0),ri=rn([(0,p.Mo)("w3m-connect-featured-widget")],ri);var ro=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rs=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=[],this.connections=ee.ConnectionController.state.connections,this.unsubscribe.push(ee.ConnectionController.subscribeKey("connections",e=>this.connections=e))}render(){let e=this.connectors.filter(eT.C.showConnector);return 0===e.length?(this.style.cssText="display: none",null):(0,n.dy)`
2454      <wui-flex flexDirection="column" gap="2">
2455        ${e.map(e=>{let t=(this.connections.get(e.chain)??[]).some(t=>e3.g.isLowerCaseMatch(t.connectorId,e.id));return(0,n.dy)`
2456            <wui-list-wallet
2457              imageSrc=${(0,o.o)(l.f.getConnectorImage(e))}
2458              .installed=${!0}
2459              name=${e.name??"Unknown"}
2460              tagVariant=${t?"info":"success"}
2461              tagLabel=${t?"connected":"installed"}
2462              data-testid=${`wallet-selector-${e.id}`}
2463              size="sm"
2464              @click=${()=>this.onConnector(e)}
2465              tabIdx=${(0,o.o)(this.tabIdx)}
2466            >
2467            </wui-list-wallet>
2468          `})}
2469      </wui-flex>
2470    `}onConnector(e){Z.ConnectorController.setActiveConnector(e),Q.RouterController.push("ConnectingExter
2470nal",{connector:e})}};ro([(0,i.Cb)()],rs.prototype,"tabIdx",void 0),ro([(0,i.Cb)()],rs.prototype,"connectors",void 0),ro([(0,i.SB)()],rs.prototype,"connections",void 0),rs=ro([(0,p.Mo)("w3m-connect-injected-widget")],rs);var ra=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rc=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"MULTI_CHAIN"===e.type&&"WalletConnect"!==e.name);return e?.length?(0,n.dy)`
2471      <wui-flex flexDirection="column" gap="2">
2472        ${e.map(e=>(0,n.dy)`
2473            <wui-list-wallet
2474              imageSrc=${(0,o.o)(l.f.getConnectorImage(e))}
2475              .installed=${!0}
2476              name=${e.name??"Unknown"}
2477              tagVariant="info"
2478              tagLabel="multichain"
2479              data-testid=${`wallet-selector-${e.id}`}
2480              size="sm"
2481              @click=${()=>this.onConnector(e)}
2482              tabIdx=${(0,o.o)(this.tabIdx)}
2483            >
2484            </wui-list-wallet>
2485          `)}
2486      </wui-flex>
2487    `:(this.style.cssText="display: none",null)}onConnector(e){Z.ConnectorController.setActiveConnector(e),Q.RouterController.push("ConnectingMultiChain")}};ra([(0,i.Cb)()],rc.prototype,"tabIdx",void 0),ra([(0,i.SB)()],rc.prototype,"connectors",void 0),rc=ra([(0,p.Mo)("w3m-connect-multi-chain-widget")],rc);var rl=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ru=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.loading=!1,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>this.connectors=e)),d.j.isTelegram()&&d.j.isIos()&&(this.loading=!ee.ConnectionController.state.wcUri,this.unsubscribe.push(ee.ConnectionController.subscribeKey("wcUri",e=>this.loading=!e)))}render(){let e=es.M.getRecentWallets().filter(e=>!tC.J.isExcluded(e)).filter(e=>!this.hasWalletConnector(e)).filter(e=>this.isWalletCompatibleWithCurrentChain(e));if(!e.length)return this.style.cssText="display: none",null;let t=ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.WALLET_CONNECT);return(0,n.dy)`
2488      <wui-flex flexDirection="column" gap="2">
2489        ${e.map(e=>(0,n.dy)`
2490            <wui-list-wallet
2491              imageSrc=${(0,o.o)(l.f.getWalletImage(e))}
2492              name=${e.name??"Unknown"}
2493              @click=${()=>this.onConnectWallet(e)}
2494              tagLabel="recent"
2495              tagVariant="info"
2496              size="sm"
2497              tabIdx=${(0,o.o)(this.tabIdx)}
2498              ?loading=${this.loading}
2499              ?disabled=${t}
2500            >
2501            </wui-list-wallet>
2502          `)}
2503      </wui-flex>
2504    `}onConnectWallet(e){this.loading||Z.ConnectorController.selectWalletConnector(e)}hasWalletConnector(e){return this.connectors.some(t=>t.id===e.id||t.name===e.name)}isWalletCompatibleWithCurrentChain(e){let t=a.R.state.activeChain;return!t||!e.chains||e.chains.some(e=>t===e.split(":")[0])}};rl([(0,i.Cb)()],ru.prototype,"tabIdx",void 0),rl([(0,i.SB)()],ru.prototype,"connectors",void 0),rl([(0,i.SB)()],ru.prototype,"loading",void 0),ru=rl([(0,p.Mo)("w3m-connect-recent-widget")],ru);var rd=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rh=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,d.j.isTelegram()&&d.j.isIos()&&(this.loading=!ee.ConnectionController.state.wcUri,this.unsubscribe.push(ee.ConnectionController.subscribeKey("wcUri",e=>this.loading=!e)))}render(){let{connectors:e}=Z.ConnectorController.state,{customWallets:t,featuredWalletIds:r}=s.OptionsController.state,i=e.find(e=>"walletConnect"===e.id),a=e.filter(e=>"INJECTED"===e.type||"ANNOUNCED"===e.type||"MULTI_CHAIN"===e.type);if(!i&&!a.length&&!t?.length)return null;
2504let c=!!(s.OptionsController.state.features?.email||s.OptionsController.state.remoteFeatures?.email),u=Array.isArray(s.OptionsController.state.features?.socials)&&s.OptionsController.state.features?.socials.length>0||Array.isArray(s.OptionsController.state.remoteFeatures?.socials)&&s.OptionsController.state.remoteFeatures?.socials.length>0,d=a.filter(e=>"Browser Wallet"!==e.name),h=r?.length||0,p=h+(t?.length||0)+(d.length||0)+(c?1:0)+(u?1:0);if(p>=4)return this.style.cssText="display: none",null;let f=tC.J.filterOutDuplicateWallets(this.wallets).slice(0,4-p);if(!f.length)return this.style.cssText="display: none",null;let g=ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.WALLET_CONNECT);return(0,n.dy)`
2505      <wui-flex flexDirection="column" gap="2">
2506        ${f.map(e=>(0,n.dy)`
2507            <wui-list-wallet
2508              imageSrc=${(0,o.o)(l.f.getWalletImage(e))}
2509              name=${e?.name??"Unknown"}
2510              @click=${()=>this.onConnectWallet(e)}
2511              size="sm"
2512              tabIdx=${(0,o.o)(this.tabIdx)}
2513              ?loading=${this.loading}
2514              ?disabled=${g}
2515            >
2516            </wui-list-wallet>
2517          `)}
2518      </wui-flex>
2519    `}onConnectWallet(e){if(this.loading)return;let t=Z.ConnectorController.getConnector({id:e.id,rdns:e.rdns});t?Q.RouterController.push("ConnectingExternal",{connector:t}):Q.RouterController.push("ConnectingWalletConnect",{wallet:e})}};rd([(0,i.Cb)()],rh.prototype,"tabIdx",void 0),rd([(0,i.Cb)()],rh.prototype,"wallets",void 0),rd([(0,i.SB)()],rh.prototype,"loading",void 0),rh=rd([(0,p.Mo)("w3m-connect-recommended-widget")],rh);var rp=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rf=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.connectorImages=c.W.state.connectorImages,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>this.connectors=e),c.W.subscribeKey("connectorImages",e=>this.connectorImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(d.j.isMobile())return this.style.cssText="display: none",null;let e=this.connectors.find(e=>"walletConnect"===e.id);if(!e)return this.style.cssText="display: none",null;let t=e.imageUrl||this.connectorImages[e?.imageId??""],r=ee.ConnectionController.hasAnyConnection(G.b.CONNECTOR_ID.WALLET_CONNECT);return(0,n.dy)`
2520      <wui-list-wallet
2521        imageSrc=${(0,o.o)(t)}
2522        name=${e.name??"Unknown"}
2523        @click=${()=>this.onConnector(e)}
2524        tagLabel="qr code"
2525        tagVariant="accent"
2526        tabIdx=${(0,o.o)(this.tabIdx)}
2527        data-testid="wallet-selector-walletconnect"
2528        size="sm"
2529        ?disabled=${r}
2530      >
2531      </wui-list-wallet>
2532    `}onConnector(e){Z.ConnectorController.setActiveConnector(e),Q.RouterController.push("ConnectingWalletConnect")}};rp([(0,i.Cb)()],rf.prototype,"tabIdx",void 0),rp([(0,i.SB)()],rf.prototype,"connectors",void 0),rp([(0,i.SB)()],rf.prototype,"connectorImages",void 0),rf=rp([(0,p.Mo)("w3m-connect-walletconnect-widget")],rf);var rg=(0,p.iv)`
2533  :host {
2534    margin-top: ${({spacing:e})=>e["1"]};
2535  }
2536  wui-separator {
2537    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1)
2538      ${({spacing:e})=>e["2"]} calc(${({spacing:e})=>e["3"]} * -1);
2539    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
2540  }
2541`,rm=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ry=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Z.ConnectorController.state.connectors,this.recommended=tp.ApiController.state.recommended,this.featured=tp.ApiController.state.featured,this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>this.connectors=e),tp.ApiController.subscribeKey("recommended",e=>this.recommended=e),tp.ApiController.subscribeKey("featured",e=>this.featured=e))}
2541disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)`
2542      <wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
2543    `}connectorListTemplate(){let{custom:e,recent:t,announced:r,injected:i,multiChain:s,recommended:a,featured:c,external:l}=eT.C.getConnectorsByType(this.connectors,this.recommended,this.featured);return eT.C.getConnectorTypeOrder({custom:e,recent:t,announced:r,injected:i,multiChain:s,recommended:a,featured:c,external:l}).map(e=>{switch(e){case"injected":return(0,n.dy)`
2544            ${s.length?(0,n.dy)`<w3m-connect-multi-chain-widget
2545                  tabIdx=${(0,o.o)(this.tabIdx)}
2546                ></w3m-connect-multi-chain-widget>`:null}
2547            ${r.length?(0,n.dy)`<w3m-connect-announced-widget
2548                  tabIdx=${(0,o.o)(this.tabIdx)}
2549                ></w3m-connect-announced-widget>`:null}
2550            ${i.length?(0,n.dy)`<w3m-connect-injected-widget
2551                  .connectors=${i}
2552                  tabIdx=${(0,o.o)(this.tabIdx)}
2553                ></w3m-connect-injected-widget>`:null}
2554          `;case"walletConnect":return(0,n.dy)`<w3m-connect-walletconnect-widget
2555            tabIdx=${(0,o.o)(this.tabIdx)}
2556          ></w3m-connect-walletconnect-widget>`;case"recent":return(0,n.dy)`<w3m-connect-recent-widget
2557            tabIdx=${(0,o.o)(this.tabIdx)}
2558          ></w3m-connect-recent-widget>`;case"featured":return(0,n.dy)`<w3m-connect-featured-widget
2559            .wallets=${c}
2560            tabIdx=${(0,o.o)(this.tabIdx)}
2561          ></w3m-connect-featured-widget>`;case"custom":return(0,n.dy)`<w3m-connect-custom-widget
2562            tabIdx=${(0,o.o)(this.tabIdx)}
2563          ></w3m-connect-custom-widget>`;case"external":return(0,n.dy)`<w3m-connect-external-widget
2564            tabIdx=${(0,o.o)(this.tabIdx)}
2565          ></w3m-connect-external-widget>`;case"recommended":return(0,n.dy)`<w3m-connect-recommended-widget
2566            .wallets=${a}
2567            tabIdx=${(0,o.o)(this.tabIdx)}
2568          ></w3m-connect-recommended-widget>`;default:return console.warn(`Unknown connector type: ${e}`),null}})}};ry.styles=rg,rm([(0,i.Cb)()],ry.prototype,"tabIdx",void 0),rm([(0,i.SB)()],ry.prototype,"connectors",void 0),rm([(0,i.SB)()],ry.prototype,"recommended",void 0),rm([(0,i.SB)()],ry.prototype,"featured",void 0),ry=rm([(0,p.Mo)("w3m-connector-list")],ry);var rb=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rw=class extends n.oi{constructor(){super(...arguments),this.tabIdx=void 0}render(){return(0,n.dy)`
2569      <wui-flex flexDirection="column" gap="2">
2570        <w3m-connector-list tabIdx=${(0,o.o)(this.tabIdx)}></w3m-connector-list>
2571        <w3m-all-wallets-widget tabIdx=${(0,o.o)(this.tabIdx)}></w3m-all-wallets-widget>
2572      </wui-flex>
2573    `}};rb([(0,i.Cb)()],rw.prototype,"tabIdx",void 0),rw=rb([(0,p.Mo)("w3m-wallet-login-list")],rw);var rv=(0,p.iv)`
2574  :host {
2575    --connect-scroll--top-opacity: 0;
2576    --connect-scroll--bottom-opacity: 0;
2577    --connect-mask-image: none;
2578  }
2579
2580  .connect {
2581    max-height: clamp(360px, 470px, 80vh);
2582    scrollbar-width: none;
2583    overflow-y: scroll;
2584    overflow-x: hidden;
2585    transition: opacity ${({durations:e})=>e.lg}
2586      ${({easings:e})=>e["ease-out-power-2"]};
2587    will-change: opacity;
2588    mask-image: var(--connect-mask-image);
2589  }
2590
2591  .guide {
2592    transition: opacity ${({durations:e})=>e.lg}
2593      ${({easings:e})=>e["ease-out-power-2"]};
2594    will-change: opacity;
2595  }
2596
2597  .connect::-webkit-scrollbar {
2598    display: none;
2599  }
2600
2601  .all-wallets {
2602    flex-flow: column;
2603  }
2604
2605  .connect.disabled,
2606  .guide.disabled {
2607    opacity: 0.3;
2608    pointer-events: none;
2609    user-select: none;
2610  }
2611
2612  wui-separator {
2613    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1);
2614    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
2615  }
2616`,rC=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rE=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.connectors=Z.ConnectorController.state.connectors,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.features=s.OptionsController.state.features,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.enableWallets=s.OptionsController.state.enableWallets,this.noAdapters=a.R.state.noAdapters,this.walletGuide="get-started",this.checked=tD.M.state.isLegalCheckboxChecked,this.isEmailEnabled=this.remoteFeatures?.email&&!a.R.state.noAdapters,this.isSocialEnabled=this.remoteFeatures?.socials&&this.remoteFeatures.socials.length>0&&!a.R.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(Z.ConnectorController.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),s.OptionsController.subscribeKey("features",e=>{this.features=e}),s.OptionsController.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),s.OptionsController.subscribeKey("enableWallets",e=>this.enableWallets=e),a.R.subscribeKey("noAdapters",e=>this.setEmailAndSocialEnableCheck(e,this.remoteFeatures)),tD.M.subscribeKey("isLegalCheckboxChecked",e=>this.checked=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.resizeObserver?.disconnect();let e=this.shadowRoot?.querySelector(".connect");e?.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){let e=this.shadowRoot?.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e?.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),this.resizeObserver?.observe(e),this.handleConnectListScroll())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=s.OptionsController.state,r=s.OptionsController.state.features?.legalCheckbox,i=!!(e||t)&&!!r&&"get-started"===this.walletGuide&&!this.checked,o=s.OptionsController.state.enableWalletGuide,a=this.enableWallets,c=this.isSocialEnabled||this.authConnector;return(0,n.dy)`
2617      <wui-flex flexDirection="column">
2618        ${this.legalCheckboxTemplate()}
2619        <wui-flex
2620          data-testid="w3m-connect-scroll-view"
2621          flexDirection="column"
2622          .padding=${["0","0","4","0"]}
2623          class=${(0,eZ.$)({connect:!0,disabled:i})}
2624        >
2625          <wui-flex
2626            class="connect-methods"
2627            flexDirection="column"
2628            gap="2"
2629            .padding=${c&&a&&o&&"get-started"===this.walletGuide?["0","3","0","3"]:["0","3","3","3"]}
2630          >
2631            ${this.renderConnectMethod(i?-1:void 0)}
2632          </wui-flex>
2633        </wui-flex>
2634        ${this.reownBrandingTemplate()}
2635      </wui-flex>
2636    `}reownBrandingTemplate(){return eR.g.hasFooter()||!this.remoteFeatures?.reownBranding?null:(0,n.dy)`<wui-ux-by-reown></wui-ux-by-reown>`}setEmailAndSocialEnableCheck(e,t){this.isEmailEnabled=t?.email&&!e,this.isSocialEnabled=t?.socials&&t.socials.length>0&&!e,this.remoteFeatures=t,this.noAdapters=e}checkIfAuthEnabled(e){let t=e.filter(e=>e.type===tj.b.CONNECTOR_TYPE_AUTH).map(e=>e.chain);return G.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(e=>t.includes(e))}renderConnectMethod(e){let t=tC.J.getConnectOrderMethod(this.features,this.connectors);return(0,n.dy)`${t.map((t,r)=>{switch(t){case"email":return(0,n.dy)`${this.emailTemplate(e)} ${this.separatorTemplate(r,"email")}`;case"social":return(0,n.dy)`${this.socialListTemplate(e)}
2637          ${this.separatorTemplate(r,"social")}`;case"wallet":return(0,n.dy)`${this.walletListTemplate(e)}
2638          ${this.separatorTemplate(r,"wallet")}`;default:return null}})}`}checkMethodEnabled(e){switch(e){case"wallet":return this.enableWallets;case"social":return this.isSocialEnabled&&this.isAuthEnabled;case"email":return this.isEmailEnabled&&this.isAuthEnabled;default:return null}}checkIsThereNextMethod(e){let t=tC.J.getConnectOrderMethod(this.features,this.connectors)[e+1];return t?this.checkMethodEnabled(t)?t:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,t){let r=this.checkIsThereNextMethod(e),i="explore"===this.walletGuide;switch(t){case"wallet":return this.enableWallets&&r&&!i?(0,n.dy)`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;case"email":return this.isAuthEnabled&&this.isEmailEnabled&&"social"!==r&&r?(0,n.dy)`<wui-separator
2639              data-testid="w3m-email-login-or-separator"
2640              text="or"
2641            ></wui-separator>`:null;case"social":return this.isAuthEnabled&&this.isSocialEnabled&&"email"!==r&&r?(0,n.dy)`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;default:return null}}emailTemplate(e){return this.isEmailEnabled&&this.isAuthEnabled?(0,n.dy)`<w3m-email-login-widget tabIdx=${(0,o.o)(e)}></w3m-email-login-widget>`:null}socialListTemplate(e){return this.isSocialEnabled&&this.isAuthEnabled?(0,n.dy)`<w3m-social-login-widget
2642      walletGuide=${this.walletGuide}
2643      tabIdx=${(0,o.o)(e)}
2644    ></w3m-social-login-widget>`:null}walletListTemplate(e){let t=this.enableWallets,r=this.features?.emailShowWallets===!1,i=this.features?.collapseWallets;return t?(d.j.isTelegram()&&(d.j.isSafari()||d.j.isIos())&&ee.ConnectionController.connectWalletConnect().catch(e=>({})),"explore"===this.walletGuide)?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&(r||i)?(0,n.dy)`<wui-list-button
2645        data-testid="w3m-collapse-wallets-button"
2646        tabIdx=${(0,o.o)(e)}
2647        @click=${this.onContinueWalletClick.bind(this)}
2648        text="Continue with a wallet"
2649      ></wui-list-button>`:(0,n.dy)`<w3m-wallet-login-list tabIdx=${(0,o.o)(e)}></w3m-wallet-login-list>`:null}legalCheckboxTemplate(){return"explore"===this.walletGuide?null:(0,n.dy)`<w3m-legal-checkbox data-testid="w3m-legal-checkbox"></w3m-legal-checkbox>`}handleConnectListScroll(){let e=this.shadowRoot?.querySelector(".connect");e&&(e.scrollHeight>470?(e.style.setProperty("--connect-mask-image",`linear-gradient(
2650          to bottom,
2651          rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
2652          rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
2653          black 100px,
2654          black calc(100% - 100px),
2655          rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
2656          rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
2657        )`),e.style.setProperty("--connect-scroll--top-opacity",p.kj.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",p.kj.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--connect-mask-image","none"),e.style.setProperty("--connect-scroll--top-opacity","0"),e.style.setProperty("--connect-scroll--bottom-opacity","0")))}onContinueWalletClick(){Q.RouterController.push("ConnectWallets")}};rE.styles=rv,rC([(0,t$.S)()],rE.prototype,"connectors",void 0),rC([(0,t$.S)()],rE.prototype,"authConnector",void 0),rC([(0,t$.S)()],rE.prototype,"features",void 0),rC([(0,t$.S)()],rE.prototype,"remoteFeatures",void 0),rC([(0,t$.S)()],rE.prototype,"enableWallets",void 0),rC([(0,t$.S)()],rE.prototype,"noAdapters",void 0),rC([(0,i.Cb)()],rE.prototype,"walletGuide",void 0),rC([(0,t$.S)()],rE.prototype,"checked",void 0),rC([(0,t$.S)()],rE.prototype,"isEmailEnabled",void 0),rC([(0,t$.S)()],rE.prototype,"isSocialEnabled",void 0),rC([(0,t$.S)()],rE.prototype,"isAuthEnabled",void 0),rE=rC([(0,p.Mo)("w3m-connect-view")],rE);var rx=r(35763);r(20960);var rA=(0,y.iv)`
2658  wui-flex {
2659    width: 100%;
2660    height: 52px;
2661    box-sizing: border-box;
2662    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2663    border-radius: ${({borderRadius:e})=>e[5]};
2664    padding-left: ${({spacing:e})=>e[3]};
2665    padding-right: ${({spacing:e})=>e[3]};
2666    display: flex;
2667    align-items: center;
2668    justify-content: space-between;
2669    gap: ${({spacing:e})=>e[6]};
2670  }
2671
2672  wui-text {
2673    color: ${({tokens:e})=>e.theme.textSecondary};
2674  }
2675
2676  wui-icon {
2677    width: 12px;
2678    height: 12px;
2679  }
2680`,rS=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let r_=class extends n.oi{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return(0,n.dy)`
2681      <wui-flex justifyContent="space-between" alignItems="center">
2682        <wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
2683        <wui-button variant="accent-secondary" size="sm">
2684          ${this.buttonLabel}
2685          <wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
2686        </wui-button>
2686
2687      </wui-flex>
2688    `}};r_.styles=[f.ET,f.ZM,rA],rS([(0,i.Cb)({type:Boolean})],r_.prototype,"disabled",void 0),rS([(0,i.Cb)()],r_.prototype,"label",void 0),rS([(0,i.Cb)()],r_.prototype,"buttonLabel",void 0),r_=rS([(0,m.M)("wui-cta-button")],r_);var rI=(0,p.iv)`
2689  :host {
2690    display: block;
2691    padding: 0 ${({spacing:e})=>e["5"]} ${({spacing:e})=>e["5"]};
2692  }
2693`,rk=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rO=class extends n.oi{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;let{name:e,app_store:t,play_store:r,chrome_store:i,homepage:o}=this.wallet,s=d.j.isMobile(),a=d.j.isIos(),c=d.j.isAndroid(),l=[t,r,o,i].filter(Boolean).length>1,u=p.Hg.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return l&&!s?(0,n.dy)`
2694        <wui-cta-button
2695          label=${`Don't have ${u}?`}
2696          buttonLabel="Get"
2697          @click=${()=>Q.RouterController.push("Downloads",{wallet:this.wallet})}
2698        ></wui-cta-button>
2699      `:!l&&o?(0,n.dy)`
2700        <wui-cta-button
2701          label=${`Don't have ${u}?`}
2702          buttonLabel="Get"
2703          @click=${this.onHomePage.bind(this)}
2704        ></wui-cta-button>
2705      `:t&&a?(0,n.dy)`
2706        <wui-cta-button
2707          label=${`Don't have ${u}?`}
2708          buttonLabel="Get"
2709          @click=${this.onAppStore.bind(this)}
2710        ></wui-cta-button>
2711      `:r&&c?(0,n.dy)`
2712        <wui-cta-button
2713          label=${`Don't have ${u}?`}
2714          buttonLabel="Get"
2715          @click=${this.onPlayStore.bind(this)}
2716        ></wui-cta-button>
2717      `:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&d.j.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&d.j.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&d.j.openHref(this.wallet.homepage,"_blank")}};rO.styles=[rI],rk([(0,i.Cb)({type:Object})],rO.prototype,"wallet",void 0),rO=rk([(0,p.Mo)("w3m-mobile-download-links")],rO);var rN=(0,p.iv)`
2718  @keyframes shake {
2719    0% {
2720      transform: translateX(0);
2721    }
2722    25% {
2723      transform: translateX(3px);
2724    }
2725    50% {
2726      transform: translateX(-3px);
2727    }
2728    75% {
2729      transform: translateX(3px);
2730    }
2731    100% {
2732      transform: translateX(0);
2733    }
2734  }
2735
2736  wui-flex:first-child:not(:only-child) {
2737    position: relative;
2738  }
2739
2740  wui-wallet-image {
2741    width: 56px;
2742    height: 56px;
2743  }
2744
2745  wui-loading-thumbnail {
2746    position: absolute;
2747  }
2748
2749  wui-icon-box {
2750    position: absolute;
2751    right: calc(${({spacing:e})=>e["1"]} * -1);
2752    bottom: calc(${({spacing:e})=>e["1"]} * -1);
2753    opacity: 0;
2754    transform: scale(0.5);
2755    transition-property: opacity, transform;
2756    transition-duration: ${({durations:e})=>e.lg};
2757    transition-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
2758    will-change: opacity, transform;
2759  }
2760
2761  wui-text[align='center'] {
2762    width: 100%;
2763    padding: 0px ${({spacing:e})=>e["4"]};
2764  }
2765
2766  [data-error='true'] wui-icon-box {
2767    opacity: 1;
2768    transform: scale(1);
2769  }
2770
2771  [data-error='true'] > wui-flex:first-child {
2772    animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both;
2773  }
2774
2775  [data-retry='false'] wui-link {
2776    display: none;
2777  }
2778
2779  [data-retry='true'] wui-link {
2780    display: block;
2781    opacity: 1;
2782  }
2783
2784  w3m-mobile-download-links {
2785    padding: 0px;
2786    width: 100%;
2787  }
2788`,rP=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};class rT extends n.oi{constructor(){super(),this.wallet=Q.RouterController.state.data?.wallet,this.connector=Q.RouterController.state.data?.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=l.f.getWalletImage(this.wallet)??l.f.getConnectorImage(this.connector),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=ee.ConnectionController.state.wcUri,this.error=ee.ConnectionController.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(ee.ConnectionController.subscribeKey("wcUri",e=>{this.uri=e,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),ee.ConnectionController.subscribeKey("wcError",e=>this.error=e)),(d.j.isTelegram()||d.j.isSafari())&&d.j.isIos()&&ee.ConnectionController.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}
2788disconnectedCallback(){this.unsubscribe.forEach(e=>e()),ee.ConnectionController.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();let e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel,t="";return this.label?t=this.label:(t=`Continue in ${this.name}`,this.error&&(t="Connection declined")),(0,n.dy)`
2789      <wui-flex
2790        data-error=${(0,o.o)(this.error)}
2791        data-retry=${this.showRetry}
2792        flexDirection="column"
2793        alignItems="center"
2794        .padding=${["10","5","5","5"]}
2795        gap="6"
2796      >
2797        <wui-flex gap="2" justifyContent="center" alignItems="center">
2798          <wui-wallet-image size="lg" imageSrc=${(0,o.o)(this.imageSrc)}></wui-wallet-image>
2799
2800          ${this.error?null:this.loaderTemplate()}
2801
2802          <wui-icon-box
2803            color="error"
2804            icon="close"
2805            size="sm"
2806            border
2807            borderColor="wui-color-bg-125"
2808          ></wui-icon-box>
2809        </wui-flex>
2810
2811        <wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
2812          flexDirection="column"
2813          alignItems="center"
2814          gap="2"
2815          .padding=${["2","0","0","0"]}
2816        >
2817          <wui-text align="center" variant="lg-medium" color=${this.error?"error":"primary"}>
2818            ${t}
2819          </wui-text>
2820          <wui-text align="center" variant="lg-regular" color="secondary">${e}</wui-text>
2821        </wui-flex>
2822
2823        ${this.secondaryBtnLabel?(0,n.dy)`
2824                <wui-button
2825                  variant="neutral-secondary"
2826                  size="md"
2827                  ?disabled=${this.isRetrying||this.isLoading}
2828                  @click=${this.onTryAgain.bind(this)}
2829                  data-testid="w3m-connecting-widget-secondary-button"
2830                >
2831                  <wui-icon
2832                    color="inherit"
2833                    slot="iconLeft"
2834                    name=${this.secondaryBtnIcon}
2835                  ></wui-icon>
2836                  ${this.secondaryBtnLabel}
2837                </wui-button>
2838              `:null}
2839      </wui-flex>
2840
2841      ${this.isWalletConnect?(0,n.dy)`
2842              <wui-flex .padding=${["0","5","5","5"]} justifyContent="center">
2843                <wui-link
2844                  @click=${this.onCopyUri}
2845                  variant="secondary"
2846                  icon="copy"
2847                  data-testid="wui-link-copy"
2848                >
2849                  Copy link
2850                </wui-link>
2851              </wui-flex>
2852            `:null}
2853
2854      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
2855      </wui-flex>
2856    `}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){ee.ConnectionController.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){let e=rx.ThemeController.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,n.dy)`<wui-loading-thumbnail radius=${9*t}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(d.j.copyToClopboard(this.uri),J.SnackController.showSuccess("Link copied"))}catch{J.SnackController.showError("Failed to copy")}}}rT.styles=rN,rP([(0,i.SB)()],rT.prototype,"isRetrying",void 0),rP([(0,i.SB)()],rT.prototype,"uri",void 0),rP([(0,i.SB)()],rT.prototype,"error",void 0),rP([(0,i.SB)()],rT.prototype,"ready",void 0),rP([(0,i.SB)()],rT.prototype,"showRetry",void 0),rP([(0,i.SB)()],rT.prototype,"label",void 0),rP([(0,i.SB)()],rT.prototype,"secondaryBtnLabel",void 0),rP([(0,i.SB)()],rT.prototype,"secondaryLabel",void 0),rP([(0,i.SB)()],rT.prototype,"isLoading",void 0),rP([(0,i.Cb)({type:Boolean})],rT.prototype,"isMobile",void 0),rP([(0,i.Cb)()],rT.prototype,"onRetry",void 0);let rR=class extends rT{constructor(){if(super(),this.externalViewUnsubscribe=[],this.connectionsByNamespace=ee.ConnectionController.getConnections(this.connector?.chain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.currentActiveConnectorId=Z.ConnectorController.state.activeConnectorIds[this.connector?.chain],!this.connector)throw Error("w3m-connecting-view: No connector provided");let e=this.connector?.chain;this.isAlreadyConnected(this.connector)&&(this.secondaryBtnLabel=void 0,this.label=`This account is already linked, change your account in ${this.connector.name}`,this.secondaryLabel=`To link a new account, open ${this.connector.name} and switch to the account you want to link`),M.X.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser",dis
2856playIndex:this.wallet?.display_index}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(Z.ConnectorController.subscribeKey("activeConnectorIds",t=>{let r=t[e],n=this.remoteFeatures?.multiWallet;r!==this.currentActiveConnectorId&&(this.hasMultipleConnections&&n?(Q.RouterController.replace("ProfileWallets"),J.SnackController.showSuccess("New Wallet Added")):h.I.close())}),ee.ConnectionController.subscribeKey("connections",this.onConnectionsChange.bind(this)))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{if(this.error=!1,this.connector){if(this.isAlreadyConnected(this.connector))return;this.connector.id===G.b.CONNECTOR_ID.COINBASE_SDK&&this.error||(await ee.ConnectionController.connectExternal(this.connector,this.connector.chain),M.X.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}}catch(e){M.X.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}onConnectionsChange(e){if(this.connector?.chain&&e.get(this.connector.chain)&&this.isAlreadyConnected(this.connector)){let t=e.get(this.connector.chain)??[],r=this.remoteFeatures?.multiWallet;if(0===t.length)Q.RouterController.replace("Connect");else{let e=eJ.f.getConnectionsByConnectorId(this.connectionsByNamespace,this.connector.id).flatMap(e=>e.accounts),n=eJ.f.getConnectionsByConnectorId(t,this.connector.id).flatMap(e=>e.accounts);0===n.length?this.hasMultipleConnections&&r?(Q.RouterController.replace("ProfileWallets"),J.SnackController.showSuccess("Wallet deleted")):h.I.close():!e.every(e=>n.some(t=>e3.g.isLowerCaseMatch(e.address,t.address)))&&r&&Q.RouterController.replace("ProfileWallets")}}}isAlreadyConnected(e){return!!e&&this.connectionsByNamespace.some(t=>e3.g.isLowerCaseMatch(t.connectorId,e.id))}};rR=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-connecting-external-view")],rR);var r$=(0,n.iv)`
2857  wui-flex,
2858  wui-list-wallet {
2859    width: 100%;
2860  }
2861`,rD=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rL=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.activeConnector=Z.ConnectorController.state.activeConnector,this.unsubscribe.push(Z.ConnectorController.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)`
2862      <wui-flex
2863        flexDirection="column"
2864        alignItems="center"
2865        .padding=${["3","5","5","5"]}
2866        gap="5"
2867      >
2868        <wui-flex justifyContent="center" alignItems="center">
2869          <wui-wallet-image
2870            size="lg"
2871            imageSrc=${(0,o.o)(l.f.getConnectorImage(this.activeConnector))}
2872          ></wui-wallet-image>
2873        </wui-flex>
2874        <wui-flex
2875          flexDirection="column"
2876          alignItems="center"
2877          gap="2"
2878          .padding=${["0","3","0","3"]}
2879        >
2880          <wui-text variant="lg-medium" color="primary">
2881            Select Chain for ${this.activeConnector?.name}
2882          </wui-text>
2883          <wui-text align="center" variant="lg-regular" color="secondary"
2884            >Select which chain to connect to your multi chain wallet</wui-text
2885          >
2886        </wui-flex>
2887        <wui-flex
2888          flexGrow="1"
2889          flexDirection="column"
2890          alignItems="center"
2891          gap="2"
2892          .padding=${["2","0","2","0"]}
2893        >
2894          ${this.networksTemplate()}
2895        </wui-flex>
2896      </wui-flex>
2897    `}networksTemplate(){return this.activeConnector?.connectors?.map(e=>e.name?n.dy`
2898            <wui-list-wallet
2899              imageSrc=${o.o(l.f.getChainImage(e.chain))}
2900              name=${G.b.CHAIN_NAME_MAP[e.chain]}
2901              @click=${()=>this.onConnector(e)}
2902              size="sm"
2903              data-testid="wui-list-chain-${e.chain}"
2904            ></wui-list-wallet>
2905          `:null)}onConnector(e){let t=this.activeConnector?.connectors?.find(t=>t.chain===e.chain);if(!t){J.SnackController.showError("Failed to find connector");return}"walletConnect"===t.id?d.j.isMobile()?Q.RouterController.push("AllWallets"):Q.RouterController.push("ConnectingWalletConnect"):Q.RouterController.push("ConnectingExter
2905nal",{connector:t})}};rL.styles=r$,rD([(0,i.SB)()],rL.prototype,"activeConnector",void 0),rL=rD([(0,p.Mo)("w3m-connecting-multi-chain-view")],rL);var rM=r(92290),rU=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rj=class extends n.oi{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.generateTabs();return(0,n.dy)`
2906      <wui-flex justifyContent="center" .padding=${["0","0","4","0"]}>
2907        <wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
2908      </wui-flex>
2909    `}generateTabs(){let e=this.platforms.map(e=>"browser"===e?{label:"Browser",icon:"extension",platform:"browser"}:"mobile"===e?{label:"Mobile",icon:"mobile",platform:"mobile"}:"qrcode"===e?{label:"Mobile",icon:"mobile",platform:"qrcode"}:"web"===e?{label:"Webapp",icon:"browser",platform:"web"}:"desktop"===e?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:e})=>e),e}onTabChange(e){let t=this.platformTabs[e];t&&this.onSelectPlatfrom?.(t)}};rU([(0,i.Cb)({type:Array})],rj.prototype,"platforms",void 0),rU([(0,i.Cb)()],rj.prototype,"onSelectPlatfrom",void 0),rj=rU([(0,p.Mo)("w3m-connecting-header")],rj);let rB=class extends rT{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),M.X.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index}})}async onConnectProxy(){try{this.error=!1;let{connectors:e}=Z.ConnectorController.state,t=e.find(e=>"ANNOUNCED"===e.type&&e.info?.rdns===this.wallet?.rdns||"INJECTED"===e.type||e.name===this.wallet?.name);if(t)await ee.ConnectionController.connectExternal(t,t.chain);else throw Error("w3m-connecting-wc-browser: No connector found");h.I.close(),M.X.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.wallet?.name||"Unknown"}})}catch(e){M.X.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};rB=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-connecting-wc-browser")],rB);let rF=class extends rT{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),M.X.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:this.wallet?.display_index}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.desktop_link&&this.uri)try{this.error=!1;let{desktop_link:e,name:t}=this.wallet,{redirect:r,href:n}=d.j.formatNativeUrl(e,this.uri);ee.ConnectionController.setWcLinking({name:t,href:n}),ee.ConnectionController.setRecentWallet(this.wallet),d.j.openHref(r,"_blank")}catch{this.error=!0}}};rF=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-connecting-wc-desktop")],rF);var rz=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rH=class extends rT{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=s.OptionsController.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{if(this.wallet?.mobile_link&&this.uri)try{this.error=!1;let{mobile_link:e,link_mode:t,name:r}=this.wallet,{redirect:n,redirectUniversalLink:i,href:o}=d.j.formatNativeUrl(e,this.uri,t);this.redirectDeeplink=n,this.redirectUniversalLink=i,this.target=d.j.isIframe()?"_top":"_self",ee.ConnectionController.setWcLinking({name:r,href:o}),ee.ConnectionController.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?d.j.openHref(this.redirectUniversalLink,this.target):d.j.openHref(this.redirectDeeplink,this.target)}catch(e){M.X.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:e instanceof Error?e.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=Y.bq.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(ee.ConnectionController.subscribeKey("wcUri",()=>{this.onHandleURI()})),M.X.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:this.wallet?.display_index}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){ee.ConnectionController.setWcError(!1),this.onConnect?.()}};rz([(0,i.SB)()],rH.prototype,"redirectDeeplink",void 0),rz([(0,i.SB)()],rH.prototype,"redirectUniversalLink",void 0),rz([(0,i.SB)()],rH.prototype,"target",void 0),rz([(0,i.SB)()],rH.prototype,"preferUniversalLinks",void 0),rz([(0,i.SB)()],rH.prototype,"isLoading",void 0),rH=rz([(0,p.Mo)("w3m-connecting-wc-mobile")],rH),r(98708);var rW=(0,p.iv)`
2910  wui-shimmer {
2911    width: 100%;
2912    aspect-ratio: 1 / 1;
2913    border-radius: ${({borderRadius:e})=>e[4]};
2914  }
2915
2916  wui-qr-code {
2917    opacity: 0;
2918    animation-duration: ${({durations:e})=>e.xl};
2919    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
2920    animation-name: fade-in;
2921    animation-fill-mode: forwards;
2922  }
2923
2924  @keyframes fade-in {
2925    from {
2926      opacity: 0;
2927    }
2928    to {
2929      opacity: 1;
2930    }
2931  }
2932`,rq=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rV=class extends rT{constructor(){super(),this.basic=!1,this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate)}firstUpdated(){this.basic||M.X.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode",dis
2932playIndex:this.wallet?.display_index}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach(e=>e()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),(0,n.dy)`
2933      <wui-flex
2934        flexDirection="column"
2935        alignItems="center"
2936        .padding=${["0","5","5","5"]}
2937        gap="5"
2938      >
2939        <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
2940        <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
2941        ${this.copyTemplate()}
2942      </wui-flex>
2943      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
2944    `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let e=this.getBoundingClientRect().width-40,t=this.wallet?this.wallet.name:void 0;return ee.ConnectionController.setWcLinking(void 0),ee.ConnectionController.setRecentWallet(this.wallet),(0,n.dy)` <wui-qr-code
2945      size=${e}
2946      theme=${rx.ThemeController.state.themeMode}
2947      uri=${this.uri}
2948      imageSrc=${(0,o.o)(l.f.getWalletImage(this.wallet))}
2949      color=${(0,o.o)(rx.ThemeController.state.themeVariables["--w3m-qr-color"])}
2950      alt=${(0,o.o)(t)}
2951      data-testid="wui-qr-code"
2952    ></wui-qr-code>`}copyTemplate(){let e=!this.uri||!this.ready;return(0,n.dy)`<wui-button
2953      .disabled=${e}
2954      @click=${this.onCopyUri}
2955      variant="neutral-secondary"
2956      size="sm"
2957      data-testid="copy-wc2-uri"
2958    >
2959      Copy link
2960      <wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
2961    </wui-button>`}};rV.styles=rW,rq([(0,i.Cb)({type:Boolean})],rV.prototype,"basic",void 0),rV=rq([(0,p.Mo)("w3m-connecting-wc-qrcode")],rV);let rK=class extends n.oi{constructor(){if(super(),this.wallet=Q.RouterController.state.data?.wallet,!this.wallet)throw Error("w3m-connecting-wc-unsupported: No wallet provided");M.X.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index}})}render(){return(0,n.dy)`
2962      <wui-flex
2963        flexDirection="column"
2964        alignItems="center"
2965        .padding=${["10","5","5","5"]}
2966        gap="5"
2967      >
2968        <wui-wallet-image
2969          size="lg"
2970          imageSrc=${(0,o.o)(l.f.getWalletImage(this.wallet))}
2971        ></wui-wallet-image>
2972
2973        <wui-text variant="md-regular" color="primary">Not Detected</wui-text>
2974      </wui-flex>
2975
2976      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
2977    `}};rK=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-connecting-wc-unsupported")],rK);var rG=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rZ=class extends rT{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=Y.bq.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(ee.ConnectionController.subscribeKey("wcUri",()=>{this.updateLoadingState()})),M.X.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:this.wallet?.display_index}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;let{webapp_link:e,name:t}=this.wallet,{redirect:r,href:n}=d.j.formatUniversalUrl(e,this.uri);ee.ConnectionController.setWcLinking({name:t,href:n}),ee.ConnectionController.setRecentWallet(this.wallet),d.j.openHref(r,"_blank")}catch{this.error=!0}}};rG([(0,i.SB)()],rZ.prototype,"isLoading",void 0),rZ=rG([(0,p.Mo)("w3m-connecting-wc-web")],rZ);var rY=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rJ=class extends n.oi{constructor(){super(),this.wallet=Q.RouterController.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!s.OptionsController.state.siwx,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(s.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}
2977disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)`
2978      ${this.headerTemplate()}
2979      <div>${this.platformTemplate()}</div>
2980      ${this.reownBrandingTemplate()}
2981    `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding&&this.displayBranding?(0,n.dy)`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(e=!1){if("browser"!==this.platform&&(!s.OptionsController.state.manualWCControl||e))try{let{wcPairingExpiry:t,status:r}=ee.ConnectionController.state;if(e||s.OptionsController.state.enableEmbedded||d.j.isPairingExpired(t)||"connecting"===r){let e=ee.ConnectionController.getConnections(a.R.state.activeChain),t=this.remoteFeatures?.multiWallet,r=e.length>0;await ee.ConnectionController.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(r&&t?(Q.RouterController.replace("ProfileWallets"),J.SnackController.showSuccess("New Wallet Added")):h.I.close())}}catch(e){if(e instanceof Error&&e.message.includes("An error occurred when attempting to switch chain")&&!s.OptionsController.state.enableNetworkSwitch&&a.R.state.activeChain){a.R.setActiveCaipNetwork(rM.f.getUnsupportedNetwork(`${a.R.state.activeChain}:${a.R.state.activeCaipNetwork?.id}`)),a.R.showUnsupportedChainUI();return}M.X.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),ee.ConnectionController.setWcError(!0),J.SnackController.showError(e.message??"Connection error"),ee.ConnectionController.resetWcConnection(),Q.RouterController.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;let{mobile_link:e,desktop_link:t,webapp_link:r,injected:n,rdns:i}=this.wallet,o=n?.map(({injected_id:e})=>
2981e).filter(Boolean),c=[...i?[i]:o??[]],l=!s.OptionsController.state.isUniversalProvider&&c.length,u=ee.ConnectionController.checkInstalled(c),h=l&&u,p=t&&!d.j.isMobile();h&&!a.R.state.noAdapters&&this.platforms.push("browser"),e&&this.platforms.push(d.j.isMobile()?"mobile":"qrcode"),r&&this.platforms.push("web"),p&&this.platforms.push("desktop"),h||!l||a.R.state.noAdapters||this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return(0,n.dy)`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return(0,n.dy)`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return(0,n.dy)`
2982          <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
2983          </w3m-connecting-wc-desktop>
2984        `;case"mobile":return(0,n.dy)`
2985          <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
2986          </w3m-connecting-wc-mobile>
2987        `;case"qrcode":return(0,n.dy)`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;default:return(0,n.dy)`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?(0,n.dy)`
2988      <w3m-connecting-header
2989        .platforms=${this.platforms}
2990        .onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
2991      >
2992      </w3m-connecting-header>
2993    `:null}async onSelectPlatform(e){let t=this.shadowRoot?.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};rY([(0,i.SB)()],rJ.prototype,"platform",void 0),rY([(0,i.SB)()],rJ.prototype,"platforms",void 0),rY([(0,i.SB)()],rJ.prototype,"isSiwxEnabled",void 0),rY([(0,i.SB)()],rJ.prototype,"remoteFeatures",void 0),rY([(0,i.Cb)({type:Boolean})],rJ.prototype,"displayBranding",void 0),rY([(0,i.Cb)({type:Boolean})],rJ.prototype,"basic",void 0),rJ=rY([(0,p.Mo)("w3m-connecting-wc-view")],rJ);var rX=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let rQ=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.isMobile=d.j.isMobile(),this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.unsubscribe.push(s.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(this.isMobile){let{featured:e,recommended:t}=tp.ApiController.state,{customWallets:r}=s.OptionsController.state,i=es.M.getRecentWallets(),o=e.length||t.length||r?.length||i.length;return(0,n.dy)`<wui-flex flexDirection="column" gap="2" .margin=${["1","3","3","3"]}>
2994        ${o?(0,n.dy)`<w3m-connector-list></w3m-connector-list>`:null}
2995        <w3m-all-wallets-widget></w3m-all-wallets-widget>
2996      </wui-flex>`}return(0,n.dy)`<wui-flex flexDirection="column" .padding=${["0","0","4","0"]}>
2997        <w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
2998        <wui-flex flexDirection="column" .padding=${["0","3","0","3"]}>
2999          <w3m-all-wallets-widget></w3m-all-wallets-widget>
3000        </wui-flex>
3001      </wui-flex>
3002      ${this.reownBrandingTemplate()} `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?(0,n.dy)` <wui-flex flexDirection="column" .padding=${["1","0","1","0"]}>
3003      <wui-ux-by-reown></wui-ux-by-reown>
3004    </wui-flex>`:null}};rX([(0,i.SB)()],rQ.prototype,"isMobile",void 0),rX([(0,i.SB)()],rQ.prototype,"remoteFeatures",void 0),rQ=rX([(0,p.Mo)("w3m-connecting-wc-basic-view")],rQ);var r0=r(57716),r1=(0,n.iv)`
3005  .continue-button-container {
3006    width: 100%;
3007  }
3008`,r2=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let r5=class extends n.oi{constructor(){super(...arguments),this.loading=!1}render(){return(0,n.dy)`
3009      <wui-flex
3010        flexDirection="column"
3011        alignItems="center"
3012        gap="6"
3013        .padding=${["0","0","4","0"]}
3014      >
3015        ${this.onboardingTemplate()} ${this.buttonsTemplate()}
3016        <wui-link
3017          @click=${()=>{d.j.openHref(r0.U.URLS.FAQ,"_blank")}}
3018        >
3019          Learn more about names
3020          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
3021        </wui-link>
3022      </wui-flex>
3023    `}onboardingTemplate(){return(0,n.dy)` <wui-flex
3024      flexDirection="column"
3025      gap="6"
3026      alignItems="center"
3027      .padding=${["0","6","0","6"]}
3028    >
3029      <wui-flex gap="3" alignItems="center" justifyContent="center">
3030        <wui-icon-box icon="id" size="xl" iconSize="xxl" color="default"></wui-icon-box>
3031      </wui-flex>
3032      <wui-flex flexDirection="column" alignItems="center" gap="3">
3033        <wui-text align="center" variant="lg-medium" color="primary">
3034          Choose your account name
3035        </wui-text>
3036        <wui-text align="center" variant="md-regular" color="primary">
3037          Finally say goodbye to 0x addresses, name your account to make it easier to exchange
3038          assets
3039        </wui-text>
3040      </wui-flex>
3041    </wui-flex>`}buttonsTemplate(){return(0,n.dy)`<wui-flex
3042      .padding=${["0","8","0","8"]}
3043      gap="3"
3044      class="continue-button-container"
3045    >
3046      <wui-button
3047        fullWidth
3048        .loading=${this.loading}
3049        size="lg"
3050        borderRadius="xs"
3051        @click=${this.handleContinue.bind(this)}
3052        >Choose name
3053      </wui-button>
3053
3054    </wui-flex>`}handleContinue(){Q.RouterController.push("RegisterAccountName"),M.X.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:(0,X.r9)(a.R.state.activeChain)===eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT}})}};r5.styles=r1,r2([(0,i.SB)()],r5.prototype,"loading",void 0),r5=r2([(0,p.Mo)("w3m-choose-account-name-view")],r5);let r3=class extends n.oi{constructor(){super(...arguments),this.wallet=Q.RouterController.state.data?.wallet}render(){if(!this.wallet)throw Error("w3m-downloads-view");return(0,n.dy)`
3055      <wui-flex gap="2" flexDirection="column" .padding=${["3","3","4","3"]}>
3056        ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
3057        ${this.homepageTemplate()}
3058      </wui-flex>
3059    `}chromeTemplate(){return this.wallet?.chrome_store?(0,n.dy)`<wui-list-item
3060      variant="icon"
3061      icon="chromeStore"
3062      iconVariant="square"
3063      @click=${this.onChromeStore.bind(this)}
3064      chevron
3065    >
3066      <wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
3067    </wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?(0,n.dy)`<wui-list-item
3068      variant="icon"
3069      icon="appStore"
3070      iconVariant="square"
3071      @click=${this.onAppStore.bind(this)}
3072      chevron
3073    >
3074      <wui-text variant="md-medium" color="primary">iOS App</wui-text>
3075    </wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?(0,n.dy)`<wui-list-item
3076      variant="icon"
3077      icon="playStore"
3078      iconVariant="square"
3079      @click=${this.onPlayStore.bind(this)}
3080      chevron
3081    >
3082      <wui-text variant="md-medium" color="primary">Android App</wui-text>
3083    </wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?(0,n.dy)`
3084      <wui-list-item
3085        variant="icon"
3086        icon="browser"
3087        iconVariant="square-blue"
3088        @click=${this.onHomePage.bind(this)}
3089        chevron
3090      >
3091        <wui-text variant="md-medium" color="primary">Website</wui-text>
3092      </wui-list-item>
3093    `:null}onChromeStore(){this.wallet?.chrome_store&&d.j.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){this.wallet?.app_store&&d.j.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&d.j.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&d.j.openHref(this.wallet.homepage,"_blank")}};r3=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-downloads-view")],r3);let r6=class extends n.oi{render(){return(0,n.dy)`
3094      <wui-flex flexDirection="column" .padding=${["0","3","3","3"]} gap="2">
3095        ${this.recommendedWalletsTemplate()}
3096        <wui-list-wallet
3097          name="Explore all"
3098          showAllWallets
3099          walletIcon="allWallets"
3100          icon="externalLink"
3101          size="sm"
3102          @click=${()=>{d.j.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
3103        ></wui-list-wallet>
3104      </wui-flex>
3105    `}recommendedWalletsTemplate(){let{recommended:e,featured:t}=tp.ApiController.state,{customWallets:r}=s.OptionsController.state;return[...t,...r??[],...e].slice(0,4).map(e=>(0,n.dy)`
3106        <wui-list-wallet
3107          name=${e.name??"Unknown"}
3108          tagVariant="accent"
3109          size="sm"
3110          imageSrc=${(0,o.o)(l.f.getWalletImage(e))}
3111          @click=${()=>{d.j.openHref(e.homepage??"https://walletconnect.com/explorer","_blank")}}
3112        ></wui-list-wallet>
3113      `)}};r6=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-get-wallet-view")],r6),r(59675);var r4=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let r8=class extends n.oi{constructor(){super(...arguments),this.data=[]}render(){return(0,n.dy)`
3114      <wui-flex flexDirection="column" alignItems="center" gap="4">
3115        ${this.data.map(e=>(0,n.dy)`
3116            <wui-flex flexDirection="column" alignItems="center" gap="5">
3117              <wui-flex flexDirection="row" justifyContent="center" gap="1">
3118                ${e.images.map(e=>(0,n.dy)`<wui-visual size="sm" name=${e}></wui-visual>`)}
3119              </wui-flex>
3120            </wui-flex>
3121            <wui-flex flexDirection="column" alignItems="center" gap="1">
3122              <wui-text variant="md-regular" color="primary" align="center">${e.title}</wui-text>
3123              <wui-text variant="sm-regular" color="secondary" align="center"
3124                >${e.text}</wui-text
3125              >
3126            </wui-flex>
3127          `)}
3128      </wui-flex>
3129    `}};r4([(0,i.Cb)({type:Array})],r8.prototype,"data",void 0),r8=r4([(0,p.Mo)("w3m-help-widget")],r8);let r9=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}],r7=class extends n.oi{render(){return(0,n.dy)`
3130      <wui-flex
3131        flexDirection="column"
3132        .padding=${["6","5","5","5"]}
3133        alignItems="center"
3134        gap="5"
3135      >
3136        <w3m-help-widget .data=${r9}></w3m-help-widget>
3137        <wui-button variant="accent-primary" size="md" @click=${this.onGetWallet.bind(this)}>
3138          <wui-icon color="inherit" slot="iconLeft" name="wallet"></wui-icon>
3139          Get a wallet
3140        </wui-button>
3140
3141      </wui-flex>
3142    `}onGetWallet(){M.X.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),Q.RouterController.push("GetWallet")}};r7=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-what-is-a-wallet-view")],r7);var ne=(0,p.iv)`
3143  wui-flex {
3144    max-height: clamp(360px, 540px, 80vh);
3145    overflow: scroll;
3146    scrollbar-width: none;
3147    transition: opacity ${({durations:e})=>e.lg}
3148      ${({easings:e})=>e["ease-out-power-2"]};
3149    will-change: opacity;
3150  }
3151  wui-flex::-webkit-scrollbar {
3152    display: none;
3153  }
3154  wui-flex.disabled {
3155    opacity: 0.3;
3156    pointer-events: none;
3157    user-select: none;
3158  }
3159`,nt=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let nr=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.checked=tD.M.state.isLegalCheckboxChecked,this.unsubscribe.push(tD.M.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=s.OptionsController.state,r=s.OptionsController.state.features?.legalCheckbox,i=!!(e||t)&&!!r,a=i&&!this.checked;return(0,n.dy)`
3160      <w3m-legal-checkbox></w3m-legal-checkbox>
3161      <wui-flex
3162        flexDirection="column"
3163        .padding=${i?["0","3","3","3"]:"3"}
3164        gap="2"
3165        class=${(0,o.o)(a?"disabled":void 0)}
3166      >
3167        <w3m-wallet-login-list tabIdx=${(0,o.o)(a?-1:void 0)}></w3m-wallet-login-list>
3168      </wui-flex>
3169    `}};nr.styles=ne,nt([(0,i.SB)()],nr.prototype,"checked",void 0),nr=nt([(0,p.Mo)("w3m-connect-wallets-view")],nr);var nn=(0,y.iv)`
3170  :host {
3171    display: block;
3172    width: 120px;
3173    height: 120px;
3174  }
3175
3176  svg {
3177    width: 120px;
3178    height: 120px;
3179    fill: none;
3180    stroke: transparent;
3181    stroke-linecap: round;
3182  }
3183
3184  use {
3185    stroke: ${e=>e.colors.accent100};
3186    stroke-width: 2px;
3187    stroke-dasharray: 54, 118;
3188    stroke-dashoffset: 172;
3189    animation: dash 1s linear infinite;
3190  }
3191
3192  @keyframes dash {
3193    to {
3194      stroke-dashoffset: 0px;
3195    }
3196  }
3197`;let ni=class extends n.oi{render(){return(0,n.dy)`
3198      <svg viewBox="0 0 54 59">
3199        <path
3200          id="wui-loader-path"
3201          d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"
3202        />
3203        <use xlink:href="#wui-loader-path"></use>
3204      </svg>
3205    `}};ni.styles=[f.ET,nn],ni=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,m.M)("wui-loading-hexagon")],ni),r(86701);var no=(0,n.iv)`
3206  @keyframes shake {
3207    0% {
3208      transform: translateX(0);
3209    }
3210    25% {
3211      transform: translateX(3px);
3212    }
3213    50% {
3214      transform: translateX(-3px);
3215    }
3216    75% {
3217      transform: translateX(3px);
3218    }
3219    100% {
3220      transform: translateX(0);
3221    }
3222  }
3223
3224  wui-flex:first-child:not(:only-child) {
3225    position: relative;
3226  }
3227
3228  wui-loading-hexagon {
3229    position: absolute;
3230  }
3231
3232  wui-icon-box {
3233    position: absolute;
3234    right: 4px;
3235    bottom: 0;
3236    opacity: 0;
3237    transform: scale(0.5);
3238    z-index: 1;
3239  }
3240
3241  wui-button {
3242    display: none;
3243  }
3244
3245  [data-error='true'] wui-icon-box {
3246    opacity: 1;
3247    transform: scale(1);
3248  }
3249
3250  [data-error='true'] > wui-flex:first-child {
3251    animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
3252  }
3253
3254  wui-button[data-retry='true'] {
3255    display: block;
3256    opacity: 1;
3257  }
3258`,ns=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let na=class extends n.oi{constructor(){super(),this.network=Q.RouterController.state.data?.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}
3258disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw Error("w3m-network-switch-view: No network provided");this.onShowRetry();let e=this.getLabel(),t=this.getSubLabel();return(0,n.dy)`
3259      <wui-flex
3260        data-error=${this.error}
3261        flexDirection="column"
3262        alignItems="center"
3263        .padding=${["10","5","10","5"]}
3264        gap="7"
3265      >
3266        <wui-flex justifyContent="center" alignItems="center">
3267          <wui-network-image
3268            size="lg"
3269            imageSrc=${(0,o.o)(l.f.getNetworkImage(this.network))}
3270          ></wui-network-image>
3271
3272          ${this.error?null:(0,n.dy)`<wui-loading-hexagon></wui-loading-hexagon>`}
3273
3274          <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
3275        </wui-flex>
3276
3277        <wui-flex flexDirection="column" alignItems="center" gap="2">
3278          <wui-text align="center" variant="h6-regular" color="primary">${e}</wui-text>
3279          <wui-text align="center" variant="md-regular" color="secondary">${t}</wui-text>
3280        </wui-flex>
3281
3282        <wui-button
3283          data-retry=${this.showRetry}
3284          variant="accent-primary"
3285          size="md"
3286          .disabled=${!this.error}
3287          @click=${this.onSwitchNetwork.bind(this)}
3288        >
3289          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
3290          Try again
3291        </wui-button>
3292      </wui-flex>
3293    `}getSubLabel(){let e=Z.ConnectorController.getConnectorId(a.R.state.activeChain);return Z.ConnectorController.getAuthConnector()&&e===G.b.CONNECTOR_ID.AUTH?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){let e=Z.ConnectorController.getConnectorId(a.R.state.activeChain);return Z.ConnectorController.getAuthConnector()&&e===G.b.CONNECTOR_ID.AUTH?`Switching to ${this.network?.name??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,a.R.state.activeChain!==this.network?.chainNamespace&&a.R.setIsSwitchingNamespace(!0),this.network&&await a.R.switchActiveNetwork(this.network)}catch(e){this.error=!0}}};na.styles=no,ns([(0,i.SB)()],na.prototype,"showRetry",void 0),ns([(0,i.SB)()],na.prototype,"error",void 0),na=ns([(0,p.Mo)("w3m-network-switch-view")],na);var nc=r(26662);r(75026);var nl=(0,y.iv)`
3294  :host {
3295    width: 100%;
3296  }
3297
3298  button {
3299    display: flex;
3300    align-items: center;
3301    justify-content: space-between;
3302    padding: ${({spacing:e})=>e[3]};
3303    width: 100%;
3304    background-color: transparent;
3305    border-radius: ${({borderRadius:e})=>e[4]};
3306  }
3307
3308  wui-text {
3309    text-transform: capitalize;
3310  }
3311
3312  @media (hover: hover) {
3313    button:hover:enabled {
3314      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3315    }
3316  }
3317
3318  button:disabled {
3319    opacity: 0.5;
3320    cursor: not-allowed;
3321  }
3322`,nu=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let nd=class extends n.oi{constructor(){super(...arguments),this.imageSrc="ethereum",this.name="Ethereum",this.disabled=!1}render(){return(0,n.dy)`
3323      <button ?disabled=${this.disabled} tabindex=${(0,o.o)(this.tabIdx)}>
3324        <wui-flex gap="2" alignItems="center">
3325          <wui-image ?boxed=${!0} src=${this.imageSrc}></wui-image>
3326          <wui-text variant="lg-regular" color="primary">${this.name}</wui-text>
3327        </wui-flex>
3328        <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
3329      </button>
3330    `}};nd.styles=[f.ET,f.ZM,nl],nu([(0,i.Cb)()],nd.prototype,"imageSrc",void 0),nu([(0,i.Cb)()],nd.prototype,"name",void 0),nu([(0,i.Cb)()],nd.prototype,"tabIdx",void 0),nu([(0,i.Cb)({type:Boolean})],nd.prototype,"disabled",void 0),nd=nu([(0,m.M)("wui-list-network")],nd);var nh=(0,n.iv)`
3331  .container {
3332    max-height: 360px;
3333    overflow: auto;
3334  }
3335
3336  .container::-webkit-scrollbar {
3337    display: none;
3338  }
3339`,np=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let nf=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.network=a.R.state.activeCaipNetwork,this.requestedCaipNetworks=a.R.getCaipNetworks(),this.search="",this.onDebouncedSearch=d.j.debounce(e=>{this.search=e},100),this.unsubscribe.push(c.W.subscribeNetworkImages(()=>this.requestUpdate()),a.R.subscribeKey("activeCaipNetwork",e=>this.network=e),a.R.subscribe(()=>{this.requestedCaipNetworks=a.R.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)`
3340      ${this.templateSearchInput()}
3341      <wui-flex
3342        class="container"
3343        .padding=${["0","3","3","3"]}
3344        flexDirection="column"
3345        gap="2"
3346      >
3347        ${this.networksTemplate()}
3348      </wui-flex>
3349    `}templateSearchInput(){return(0,n.dy)`
3350      <wui-flex gap="2" .padding=${["0","3","3","3"]}>
3351        <wui-input-text
3352          @inputChange=${this.onInputChange.bind(this)}
3353          class="network-search-input"
3354          size="md"
3355          placeholder="Search network"
3356          icon="search"
3357        ></wui-input-text>
3358      </wui-flex>
3359    `}onInputChange(e){this.onDebouncedSearch(e.detail)}networksTemplate(){let e=a.R.getAllApprovedCaipNetworkIds(),t=d.j.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=t?.filter(e=>e?.name?.toLowerCase().includes(this.search.toLowerCase())):this.filteredNetworks=t,this.filteredNetworks?.map(e=>n.dy`
3360        <wui-list-network
3361          .selected=${this.network?.id===e.id}
3362          imageSrc=${o.o(l.f.getNetworkImage(e))}
3363          type="network"
3364          name=${e.name??e.id}
3365          @click=${()=>this.onSwitchNetwork(e)}
3366          .disabled=${this.getNetworkDisabled(e)}
3367          data-testid=${`w3m-network-switch-${e.name??e.id}`}
3368        ></wui-list-network>
3369      `)}getNetworkDisabled(e){let t=e.chainNamespace,r=u.AccountController.getCaipAddress(t),n=a.R.getAllApprovedCaipNetworkIds(),i=!1!==a.R.getNetworkProp("supportsAllNetworks",t),o=Z.ConnectorController.getConnectorId(t),s=Z.ConnectorController.getAuthConnector(),c=o===G.b.CONNECTOR_ID.AUTH&&s;return!!r&&!i&&!c&&!n?.includes(e.caipNetworkId)}onSwitchNetwork(e){nc.p.onSwitchNetwork({network:e})}};nf.styles=nh,np([(0,i.SB)()],nf.prototype,"network",void 0),np([(0,i.SB)()],nf.prototype,"requestedCaipNetworks",void 0),np([(0,i.SB)()],nf.prototype,"filteredNetworks",void 0),np([(0,i.SB)()],nf.prototype,"search",void 0),nf=np([(0,p.Mo)("w3m-networks-view")],nf);var ng=(0,p.iv)`
3370  @keyframes shake {
3371    0% {
3372      transform: translateX(0);
3373    }
3374    25% {
3375      transform: translateX(3px);
3376    }
3377    50% {
3378      transform: translateX(-3px);
3379    }
3380    75% {
3381      transform: translateX(3px);
3382    }
3383    100% {
3384      transform: translateX(0);
3385    }
3386  }
3387
3388  wui-flex:first-child:not(:only-child) {
3389    position: relative;
3390  }
3391
3392  wui-loading-thumbnail {
3393    position: absolute;
3394  }
3395
3396  wui-visual {
3397    border-radius: calc(
3398      ${({borderRadius:e})=>e["1"]} * 9 - ${({borderRadius:e})=>e["3"]}
3399    );
3400    position: relative;
3401    overflow: hidden;
3402  }
3403
3404  wui-visual::after {
3405    content: '';
3406    display: block;
3407    width: 100%;
3408    height: 100%;
3409    position: absolute;
3410    inset: 0;
3411    border-radius: calc(
3412      ${({borderRadius:e})=>e["1"]} * 9 - ${({borderRadius:e})=>e["3"]}
3413    );
3414    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.core.glass010};
3415  }
3416
3417  wui-icon-box {
3418    position: absolute;
3419    right: calc(${({spacing:e})=>e["1"]} * -1);
3420    bottom: calc(${({spacing:e})=>e["1"]} * -1);
3421    opacity: 0;
3422    transform: scale(0.5);
3423    transition:
3424      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
3425      transform ${({durations:e})=>e.lg}
3426        ${({easings:e})=>e["ease-out-power-2"]};
3427    will-change: opacity, transform;
3428  }
3429
3430  wui-text[align='center'] {
3431    width: 100%;
3432    padding: 0px ${({spacing:e})=>e["4"]};
3433  }
3434
3435  [data-error='true'] wui-icon-box {
3436    opacity: 1;
3437    transform: scale(1);
3438  }
3439
3440  [data-error='true'] > wui-flex:first-child {
3441    animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both;
3442  }
3443
3444  [data-retry='false'] wui-link {
3445    display: none;
3446  }
3447
3448  [data-retry='true'] wui-link {
3449    display: block;
3450    opacity: 1;
3451  }
3452
3453  wui-link {
3454    padding: ${({spacing:e})=>e["01"]} ${({spacing:e})=>e["2"]};
3455  }
3456
3457  .capitalize {
3458    text-transform: capitalize;
3459  }
3460`,nm=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let ny={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0},nb=class extends n.oi{constructor(){super(...arguments),this.unsubscribe=[],this.switchToChain=Q.RouterController.state.data?.switchToChain,this.caipNetwork=Q.RouterController.state.data?.network,this.activeChain=a.R.state.activeChain}firstUpdated(){this.unsubscribe.push(a.R.subscribeKey("activeChain",e=>this.activeChain=e))}
3460disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.switchToChain?G.b.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;let t=G.b.CHAIN_NAME_MAP[this.switchToChain];return(0,n.dy)`
3461      <wui-flex
3462        flexDirection="column"
3463        alignItems="center"
3464        .padding=${["4","2","2","2"]}
3465        gap="4"
3466      >
3467        <wui-flex justifyContent="center" flexDirection="column" alignItems="center" gap="2">
3468          <wui-visual
3469            size="md"
3470            name=${(0,o.o)(ny[this.switchToChain])}
3471          ></wui-visual>
3472          <wui-flex gap="2" flexDirection="column">
3473            <wui-text
3474              data-testid=${`w3m-switch-active-chain-to-${t}`}
3475              variant="lg-regular"
3476              color="primary"
3477              align="center"
3478              >Switch to <span class="capitalize">${t}</span></wui-text
3479            >
3480            <wui-text variant="md-regular" color="secondary" align="center">
3481              Connected wallet doesn't support connecting to ${e} chain. You
3482              need to connect with a different wallet.
3483            </wui-text>
3484          </wui-flex>
3485          <wui-button
3486            data-testid="w3m-switch-active-chain-button"
3487            size="md"
3488            @click=${this.switchActiveChain.bind(this)}
3489            >Switch</wui-button
3490          >
3491        </wui-flex>
3492      </wui-flex>
3493    `}async switchActiveChain(){this.switchToChain&&(a.R.setIsSwitchingNamespace(!0),Z.ConnectorController.setFilterByNamespace(this.switchToChain),this.caipNetwork?await a.R.switchActiveNetwork(this.caipNetwork):a.R.setActiveNamespace(this.switchToChain),Q.RouterController.reset("Connect"))}};nb.styles=ng,nm([(0,i.Cb)()],nb.prototype,"activeChain",void 0),nb=nm([(0,p.Mo)("w3m-switch-active-chain-view")],nb);let nw=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}],nv=class extends n.oi{render(){return(0,n.dy)`
3494      <wui-flex
3495        flexDirection="column"
3496        .padding=${["6","5","5","5"]}
3497        alignItems="center"
3498        gap="5"
3499      >
3500        <w3m-help-widget .data=${nw}></w3m-help-widget>
3501        <wui-button
3502          variant="accent-primary"
3503          size="md"
3504          @click=${()=>{d.j.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
3505        >
3506          Learn more
3507          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
3508        </wui-button>
3509      </wui-flex>
3510    `}};nv=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-what-is-a-network-view")],nv);var nC=(0,n.iv)`
3511  :host > wui-flex {
3512    max-height: clamp(360px, 540px, 80vh);
3513    overflow: scroll;
3514    scrollbar-width: none;
3515  }
3516
3517  :host > wui-flex::-webkit-scrollbar {
3518    display: none;
3519  }
3520`,nE=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let nx=class extends n.oi{constructor(){super(),this.swapUnsupportedChain=Q.RouterController.state.data?.swapUnsupportedChain,this.unsubscribe=[],this.disconnecting=!1,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.unsubscribe.push(c.W.subscribeNetworkImages(()=>this.requestUpdate()),s.OptionsController.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)`
3521      <wui-flex class="container" flexDirection="column" gap="0">
3522        <wui-flex
3523          class="container"
3524          flexDirection="column"
3525          .padding=${["3","5","2","5"]}
3526          alignItems="center"
3527          gap="5"
3528        >
3529          ${this.descriptionTemplate()}
3530        </wui-flex>
3531
3532        <wui-flex flexDirection="column" padding="3" gap="2"> ${this.networksTemplate()} </wui-flex>
3533
3534        <wui-separator text="or"></wui-separator>
3535        <wui-flex flexDirection="column" padding="3" gap="2">
3536          <wui-list-item
3537            variant="icon"
3538            iconVariant="overlay"
3539            icon="signOut"
3540            ?chevron=${!1}
3541            .loading=${this.disconnecting}
3542            @click=${this.onDisconnect.bind(this)}
3543            data-testid="disconnect-button"
3544          >
3545            <wui-text variant="md-medium" color="secondary">Disconnect</wui-text>
3546          </wui-list-item>
3547        </wui-flex>
3548      </wui-flex>
3549    `}descriptionTemplate(){return this.swapUnsupportedChain?(0,n.dy)`
3550        <wui-text variant="sm-regular" color="secondary" align="center">
3551          The swap feature doesn’t support your current network. Switch to an available option to
3552          continue.
3553        </wui-text>
3554      `:(0,n.dy)`
3555      <wui-text variant="sm-regular" color="secondary" align="center">
3556        This app doesn’t support your current network. Switch to an available option to continue.
3557      </wui-text>
3558    `}networksTemplate(){let e=a.R.getAllRequestedCaipNetworks(),t=a.R.getAllApprovedCaipNetworkIds(),r=d.j.sortRequestedNetworks(t,e);return(this.swapUnsupportedChain?r.filter(e=>Y.bq.SWAP_SUPPORTED_NETWORKS.includes(e.caipNetworkId)):r).map(e=>(0,n.dy)`
3559        <wui-list-network
3560          imageSrc=${(0,o.o)(l.f.getNetworkImage(e))}
3561          name=${e.name??"Unknown"}
3562          @click=${()=>this.onSwitchNetwork(e)}
3563        >
3564        </wui-list-network>
3565      `)}async onDisconnect(){try{this.disconnecting=!0;let e=a.R.state.activeChain,t=ee.ConnectionController.getConnections(e).length>0,r=e&&Z.ConnectorController.state.activeConnectorIds[e],n=this.remoteFeatures?.multiWallet;await ee.ConnectionController.disconnect(n?{id:r,namespace:e}:{}),t&&n&&(Q.RouterController.push("ProfileWallets"),J.SnackController.showSuccess("Wallet deleted"))}catch{M.X.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),J.SnackController.showError("Failed to disconnect")}finally{this.disconnecting=!1}}async onSwitchNetwork(e){let t=u.AccountController.state.caipAddress,r=a.R.getAllApprovedCaipNetworkIds(),n=(a.R.getNetworkProp("supportsAllNetworks",e.chainNamespace),Q.RouterController.state.data);t?r?.includes(e.caipNetworkId)?await a.R.switchActiveNetwork(e):Q.RouterController.push("SwitchNetwork",{...n,network:e}
3565):t||(a.R.setActiveCaipNetwork(e),Q.RouterController.push("Connect"))}};nx.styles=nC,nE([(0,i.SB)()],nx.prototype,"disconnecting",void 0),nE([(0,i.SB)()],nx.prototype,"remoteFeatures",void 0),nx=nE([(0,p.Mo)("w3m-unsupported-chain-view")],nx);var nA=(0,y.iv)`
3566  wui-flex {
3567    width: 100%;
3568    display: flex;
3569    align-items: center;
3570    justify-content: center;
3571    gap: ${({spacing:e})=>e[2]};
3572    border-radius: ${({borderRadius:e})=>e[4]};
3573    padding: ${({spacing:e})=>e[3]};
3574  }
3575
3576  /* -- Types --------------------------------------------------------- */
3577  wui-flex[data-type='info'] {
3578    color: ${({tokens:e})=>e.theme.textSecondary};
3579    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3580  }
3581
3582  wui-flex[data-type='success'] {
3583    color: ${({tokens:e})=>e.core.textSuccess};
3584    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
3585  }
3586
3587  wui-flex[data-type='error'] {
3588    color: ${({tokens:e})=>e.core.textError};
3589    background-color: ${({tokens:e})=>e.core.backgroundError};
3590  }
3591
3592  wui-flex[data-type='warning'] {
3593    color: ${({tokens:e})=>e.core.textWarning};
3594    background-color: ${({tokens:e})=>e.core.backgroundWarning};
3595  }
3596
3597  wui-flex[data-type='info'] wui-icon-box {
3598    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
3599  }
3600
3601  wui-flex[data-type='success'] wui-icon-box {
3602    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
3603  }
3604
3605  wui-flex[data-type='error'] wui-icon-box {
3606    background-color: ${({tokens:e})=>e.core.backgroundError};
3607  }
3608
3609  wui-flex[data-type='warning'] wui-icon-box {
3610    background-color: ${({tokens:e})=>e.core.backgroundWarning};
3611  }
3612
3613  wui-text {
3614    flex: 1;
3615  }
3616`,nS=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let n_=class extends n.oi{constructor(){super(...arguments),this.icon="externalLink",this.text="",this.type="info"}render(){return(0,n.dy)`
3617      <wui-flex alignItems="center" data-type=${this.type}>
3618        <wui-icon-box size="sm" color="inherit" icon=${this.icon}></wui-icon-box>
3619        <wui-text variant="md-regular" color="inherit">${this.text}</wui-text>
3620      </wui-flex>
3621    `}};n_.styles=[f.ET,f.ZM,nA],nS([(0,i.Cb)()],n_.prototype,"icon",void 0),nS([(0,i.Cb)()],n_.prototype,"text",void 0),nS([(0,i.Cb)()],n_.prototype,"type",void 0),n_=nS([(0,m.M)("wui-banner")],n_);var nI=(0,n.iv)`
3622  :host > wui-flex {
3623    max-height: clamp(360px, 540px, 80vh);
3624    overflow: scroll;
3625    scrollbar-width: none;
3626  }
3627
3628  :host > wui-flex::-webkit-scrollbar {
3629    display: none;
3630  }
3631`;let nk=class extends n.oi{constructor(){super(),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.dy)` <wui-flex flexDirection="column" .padding=${["2","3","3","3"]} gap="2">
3632      <wui-banner
3633        icon="warningCircle"
3634        text="You can only receive assets on these networks"
3635      ></wui-banner>
3636      ${this.networkTemplate()}
3637    </wui-flex>`}networkTemplate(){let e=a.R.getAllRequestedCaipNetworks(),t=a.R.getAllApprovedCaipNetworkIds(),r=a.R.state.activeCaipNetwork,i=a.R.checkIfSmartAccountEnabled(),s=d.j.sortRequestedNetworks(t,e);if(i&&(0,X.r9)(r?.chainNamespace)===eo.y_.ACCOUNT_TYPES.SMART_ACCOUNT){if(!r)return null;s=[r]}return s.filter(e=>e.chainNamespace===r?.chainNamespace).map(e=>(0,n.dy)`
3638        <wui-list-network
3639          imageSrc=${(0,o.o)(l.f.getNetworkImage(e))}
3640          name=${e.name??"Unknown"}
3641          ?transparent=${!0}
3642        >
3643        </wui-list-network>
3644      `)}};nk.styles=nI,nk=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-wallet-compatible-networks-view")],nk);var nO=r(71384),nN=(0,y.iv)`
3645  :host {
3646    display: flex;
3647    justify-content: center;
3648    align-items: center;
3649    width: 56px;
3650    height: 56px;
3651    box-shadow: 0 0 0 8px ${({tokens:e})=>e.theme.borderPrimary};
3652    border-radius: ${({borderRadius:e})=>e[4]};
3653    overflow: hidden;
3654  }
3655
3656  :host([data-border-radius-full='true']) {
3657    border-radius: 50px;
3658  }
3659
3660  wui-icon {
3661    width: 32px;
3662    height: 32px;
3663  }
3664`,nP=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let nT=class extends n.oi{render(){return this.dataset.borderRadiusFull=this.borderRadiusFull?"true":"false",(0,n.dy)`${this.templateVisual()}`}templateVisual(){return this.imageSrc?(0,n.dy)`<wui-image src=${this.imageSrc} alt=${this.alt??""}></wui-image>`:(0,n.dy)`<wui-icon
3665      data-parent-size="md"
3666      size="inherit"
3667      color="inherit"
3668      name="wallet"
3669    ></wui-icon>`}};nT.styles=[f.ET,nN],nP([(0,i.Cb)()],nT.prototype,"imageSrc",void 0),nP([(0,i.Cb)()],nT.prototype,"alt",void 0),nP([(0,i.Cb)({type:Boolean})],nT.prototype,"borderRadiusFull",void 0),nT=nP([(0,m.M)("wui-visual-thumbnail")],nT);var nR=(0,p.iv)`
3670  :host {
3671    display: flex;
3672    justify-content: center;
3673    gap: ${({spacing:e})=>e["4"]};
3674  }
3675
3676  wui-visual-thumbnail:nth-child(1) {
3677    z-index: 1;
3678  }
3679`;let n$=class extends n.oi{constructor(){super(...arguments),this.dappImageUrl=s.OptionsController.state.metadata?.icons,this.walletImageUrl=u.AccountController.state.connectedWalletInfo?.icon}firstUpdated(){let e=this.shadowRoot?.querySelectorAll("wui-visual-thumbnail");e?.[0]&&this.createAnimation(e[0],"translate(18px)"),e?.[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){return(0,n.dy)`
3680      <wui-visual-thumbnail
3681        ?borderRadiusFull=${!0}
3682        .imageSrc=${this.dappImageUrl?.[0]}
3683      ></wui-visual-thumbnail>
3684      <wui-visual-thumbnail .imageSrc=${this.walletImageUrl}></wui-visual-thumbnail>
3685    `}createAnimation(e,t){e.animate([{transform:"translateX(0px)"},{transform:t}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};n$.styles=nR,n$=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,p.Mo)("w3m-siwx-sign-message-thumbnails")],n$);var nD=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let nL=class extends n.oi{constructor(){super(...arguments),this.dappName=s.OptionsController.state.metadata?.name,this.isCancelling=!1,this.isSigning=!1}render(){return(0,n.dy)`
3686      <wui-flex justifyContent="center" .padding=${["8","0","6","0"]}>
3687        <w3m-siwx-sign-message-thumbnails></w3m-siwx-sign-message-thumbnails>
3688      </wui-flex>
3689      <wui-flex .padding=${["0","20","5","20"]} gap="3" justifyContent="space-between">
3690        <wui-text variant="lg-medium" align="center" color="primary"
3691          >${this.dappName??"Dapp"} needs to connect to your wallet</wui-text
3692        >
3693      </wui-flex>
3694      <wui-flex .padding=${["0","10","4","10"]} gap="3" justifyContent="space-between">
3695        <wui-text variant="md-regular" align="center" color="secondary"
3696          >Sign this message to prove you own this wallet and proceed. Canceling will disconnect
3697          you.</wui-text
3698        >
3699      </wui-flex>
3700      <wui-flex .padding=${["4","5","5","5"]} gap="3" justifyContent="space-between">
3701        <wui-button
3702          size="lg"
3703          borderRadius="xs"
3704          fullWidth
3705          variant="neutral-secondary"
3706          ?loading=${this.isCancelling}
3707          @click=${this.onCancel.bind(this)}
3708          data-testid="w3m-connecting-siwe-cancel"
3709        >
3710          ${this.isCancelling?"Cancelling...":"Cancel"}
3711        </wui-button>
3711
3712        <wui-button
3713          size="lg"
3714          borderRadius="xs"
3715          fullWidth
3716          variant="neutral-primary"
3717          @click=${this.onSign.bind(this)}
3718          ?loading=${this.isSigning}
3719          data-testid="w3m-connecting-siwe-sign"
3720        >
3721          ${this.isSigning?"Signing...":"Sign"}
3722        </wui-button>
3723      </wui-flex>
3724    `}async onSign(){this.isSigning=!0;try{await nO.w.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){J.SnackController.showError({message:"Something went wrong. We need to verify your account again."}),Q.RouterController.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await nO.w.cancelSignMessage().finally(()=>this.isCancelling=!1)}};nD([(0,i.SB)()],nL.prototype,"isCancelling",void 0),nD([(0,i.SB)()],nL.prototype,"isSigning",void 0),nL=nD([(0,p.Mo)("w3m-siwx-sign-message-view")],nL)},37391:function(e,t,r){"use strict";r.d(t,{CR:function(){return n.C},JG:function(){return i.J}});var n=r(38510);r(46849);var i=r(87313)},71897:function(e,t,r){"use strict";r.d(t,{M:function(){return d}});var n=r(19045),i=r(94836),o=r(83764),s=r(46001),a=r(78632);r(10231),r(71932);var c=r(31225),l=(0,a.iv)`
3725  :host {
3726    display: block;
3727  }
3728
3729  div.container {
3730    position: absolute;
3731    bottom: 0;
3732    left: 0;
3733    right: 0;
3734    overflow: hidden;
3735    height: auto;
3736    display: block;
3737  }
3738
3739  div.container[status='hide'] {
3740    animation: fade-out;
3741    animation-duration: var(--apkt-duration-dynamic);
3742    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
3743    animation-fill-mode: both;
3744    animation-delay: 0s;
3745  }
3746
3747  div.container[status='show'] {
3748    animation: fade-in;
3749    animation-duration: var(--apkt-duration-dynamic);
3750    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
3751    animation-fill-mode: both;
3752    animation-delay: var(--apkt-duration-dynamic);
3753  }
3754
3755  @keyframes fade-in {
3756    from {
3757      opacity: 0;
3758      filter: blur(6px);
3759    }
3760    to {
3761      opacity: 1;
3762      filter: blur(0px);
3763    }
3764  }
3765
3766  @keyframes fade-out {
3767    from {
3768      opacity: 1;
3769      filter: blur(0px);
3770    }
3771    to {
3772      opacity: 0;
3773      filter: blur(6px);
3774    }
3775  }
3776`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d=class extends n.oi{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=o.RouterController.state.view}firstUpdated(){this.status=c.g.hasFooter()?"show":"hide",this.unsubscribe.push(o.RouterController.subscribeKey("view",e=>{this.view=e,this.status=c.g.hasFooter()?"show":"hide","hide"===this.status&&document.documentElement.style.setProperty("--apkt-footer-height","0px")})),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target===this.getWrapper()){let e=`${t.contentRect.height}px`;document.documentElement.style.setProperty("--apkt-footer-height",e)}}),this.resizeObserver.observe(this.getWrapper())}render(){return(0,n.dy)`
3777      <div class="container" status=${this.status}>${this.templatePageContainer()}</div>
3778    `}templatePageContainer(){return c.g.hasFooter()?(0,n.dy)` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return(0,n.dy)`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return(0,n.dy)`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return(0,n.dy)` <wui-flex
3779      class="footer-in"
3780      padding="3"
3781      flexDirection="column"
3782      gap="3"
3783      alignItems="center"
3784    >
3785      <wui-text variant="md-regular" color="secondary" align="center">
3786        Your connected wallet may not support some of the networks available for this dApp
3787      </wui-text>
3788      <wui-link @click=${this.onNetworkHelp.bind(this)}>
3789        <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
3790        What is a network
3791      </wui-link>
3792    </wui-flex>`}onNetworkHelp(){s.X.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),o.RouterController.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};d.styles=[l],u([(0,i.SB)()],d.prototype,"status",void 0),u([(0,i.SB)()],d.prototype,"view",void 0),d=u([(0,a.Mo)("w3m-footer")],d)},31349:function(e,t,r){"use strict";r.d(t,{A:function(){return l}});var n=r(19045),i=r(94836),o=r(83764),s=r(78632);r(71897);var a=(0,s.iv)`
3793  :host {
3794    display: block;
3795    width: inherit;
3796  }
3797`,c=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let l=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.viewState=o.RouterController.state.view,this.history=o.RouterController.state.history.join(","),this.unsubscribe.push(o.RouterController.subscribeKey("view",()=>{this.history=o.RouterController.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")}))}
3797disconnectedCallback(){this.unsubscribe.forEach(e=>e()),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return(0,n.dy)`${this.templatePageContainer()}`}templatePageContainer(){return(0,n.dy)`<w3m-router-container
3798      history=${this.history}
3799      .setView=${()=>{this.viewState=o.RouterController.state.view}}
3800    >
3801      ${this.viewTemplate(this.viewState)}
3802    </w3m-router-container>`}viewTemplate(e){switch(e){case"AccountSettings":return(0,n.dy)`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return(0,n.dy)`<w3m-account-view></w3m-account-view>`;case"AllWallets":return(0,n.dy)`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return(0,n.dy)`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return(0,n.dy)`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return(0,n.dy)`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":default:return(0,n.dy)`<w3m-connect-view></w3m-connect-view>`;case"Create":return(0,n.dy)`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return(0,n.dy)`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return(0,n.dy)`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return(0,n.dy)`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return(0,n.dy)`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return(0,n.dy)`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return(0,n.dy)`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return(0,n.dy)`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return(0,n.dy)`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return(0,n.dy)`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return(0,n.dy)`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return(0,n.dy)`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return(0,n.dy)`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return(0,n.dy)`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return(0,n.dy)`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return(0,n.dy)`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return(0,n.dy)`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return(0,n.dy)`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return(0,n.dy)`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return(0,n.dy)`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return(0,n.dy)`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return(0,n.dy)`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return(0,n.dy)`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return(0,n.dy)`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return(0,n.dy)`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return(0,n.dy)`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return(0,n.dy)`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return(0,n.dy)`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return(0,n.dy)`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return(0,n.dy)`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return(0,n.dy)`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return(0,n.dy)`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return(0,n.dy)`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return(0,n.dy)`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return(0,n.dy)`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return(0,n.dy)`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return(0,n.dy)`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return(0,n.dy)`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return(0,n.dy)`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return(0,n.dy)`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return(0,n.dy)`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return(0,n.dy)`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return(0,n.dy)`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return(0,n.dy)`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return(0,n.dy)`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return(0,n.dy)`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return(0,n.dy)`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return(0,n.dy)`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return(0,n.dy)`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"FundWallet":return(0,n.dy)`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return(0,n.dy)`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return(0,n.dy)`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`}}};l.styles=[a],c([(0,i.SB)()],l.prototype,"viewState",void 0),c([(0,i.SB)()],l.prototype,"history",void 0),l=c([(0,s.Mo)("w3m-router")],l)},7427:function(e,t,r){"use strict";var n,i,o=r(19045),s=r(94836),a=r(16444),c=r(39674),l=r(52781),u=r(99321),d=r(83764),h=r(29607),p=r(46001),f=r(62250),g=r(78632);r(29557),r(84081),r(24996),r(22939);var m=r(31756);r(18749);var y=r(70169);(n=i||(i={})).approve="approved",n.bought="bought",n.borrow="borrowed",n.burn="burnt",n.cancel="canceled",n.claim="claimed",n.deploy="deployed",n.deposit="deposited",n.execute="executed",n.mint="minted",
3802n.receive="received",n.repay="repaid",n.send="sent",n.sell="sold",n.stake="staked",n.trade="swapped",n.unstake="unstaked",n.withdraw="withdrawn";var b=r(66704);r(79086),r(94272);var w=r(73718),v=(0,w.iv)`
3803  :host > wui-flex {
3804    display: flex;
3805    justify-content: center;
3806    align-items: center;
3807    position: relative;
3808    width: 40px;
3809    height: 40px;
3810    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.core.glass010};
3811    background-color: ${({tokens:e})=>e.core.glass010};
3812  }
3813
3814  :host([data-no-images='true']) > wui-flex {
3815    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3816    border-radius: ${({borderRadius:e})=>e[3]} !important;
3817  }
3818
3819  :host > wui-flex wui-image {
3820    display: block;
3821  }
3822
3823  :host > wui-flex,
3824  :host > wui-flex wui-image,
3825  .swap-images-container,
3826  .swap-images-container.nft,
3827  wui-image.nft {
3828    border-top-left-radius: var(--local-left-border-radius);
3829    border-top-right-radius: var(--local-right-border-radius);
3830    border-bottom-left-radius: var(--local-left-border-radius);
3831    border-bottom-right-radius: var(--local-right-border-radius);
3832  }
3833
3834  wui-icon {
3835    width: 20px;
3836    height: 20px;
3837  }
3838
3839  .swap-images-container {
3840    position: relative;
3841    width: 40px;
3842    height: 40px;
3843    overflow: hidden;
3844  }
3845
3846  .swap-images-container wui-image:first-child {
3847    position: absolute;
3848    width: 40px;
3849    height: 40px;
3850    top: 0;
3851    left: 0%;
3852    clip-path: inset(0px calc(50% + 2px) 0px 0%);
3853  }
3854
3855  .swap-images-container wui-image:last-child {
3856    clip-path: inset(0px 0px 0px calc(50% + 2px));
3857  }
3858
3859  wui-flex.status-box {
3860    position: absolute;
3861    right: 0;
3862    bottom: 0;
3863    transform: translate(20%, 20%);
3864    border-radius: ${({borderRadius:e})=>e[4]};
3865    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
3866    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.backgroundPrimary};
3867    overflow: hidden;
3868    width: 16px;
3869    height: 16px;
3870  }
3871`,C=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let E=class extends o.oi{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){let[e,t]=this.images;this.images.length||(this.dataset.noImages="true");let r=e?.type==="NFT",n=t?.url?"NFT"===t.type:r;return this.style.cssText=`
3872    --local-left-border-radius: ${r?"var(--apkt-borderRadius-3)":"var(--apkt-borderRadius-5)"};
3873    --local-right-border-radius: ${n?"var(--apkt-borderRadius-3)":"var(--apkt-borderRadius-5)"};
3874    `,(0,o.dy)`<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`}templateVisual(){let[e,t]=this.images,r=e?.type;return 2===this.images.length&&(e?.url||t?.url)?(0,o.dy)`<div class="swap-images-container">
3875        ${e?.url?(0,o.dy)`<wui-image src=${e.url} alt="Transaction image"></wui-image>`:null}
3876        ${t?.url?(0,o.dy)`<wui-image src=${t.url} alt="Transaction image"></wui-image>`:null}
3877      </div>`:e?.url?(0,o.dy)`<wui-image src=${e.url} alt="Transaction image"></wui-image>`:"NFT"===r?(0,o.dy)`<wui-icon size="inherit" color="default" name="nftPlaceholder"></wui-icon>`:(0,o.dy)`<wui-icon size="inherit" color="default" name="coinPlaceholder"></wui-icon>`}templateIcon(){let e,t="accent-primary";return(e=this.getIcon(),this.status&&(t=this.getStatusColor()),e)?(0,o.dy)`
3878      <wui-flex alignItems="center" justifyContent="center" class="status-box">
3879        <wui-icon-box size="sm" color=${t} icon=${e}></wui-icon-box>
3880      </wui-flex>
3881    `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():"trade"===this.type?"swapHorizontal":"approve"===this.type?"checkmark":"cancel"===this.type?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success";case"failed":return"error";
3881case"pending":return"inverse";default:return"accent-primary"}}};E.styles=[v],C([(0,s.Cb)()],E.prototype,"type",void 0),C([(0,s.Cb)()],E.prototype,"status",void 0),C([(0,s.Cb)()],E.prototype,"direction",void 0),C([(0,s.Cb)({type:Boolean})],E.prototype,"onlyDirectionIcon",void 0),C([(0,s.Cb)({type:Array})],E.prototype,"images",void 0),C([(0,s.Cb)({type:Object})],E.prototype,"secondImage",void 0),E=C([(0,b.M)("wui-transaction-visual")],E);var x=(0,w.iv)`
3882  :host {
3883    width: 100%;
3884  }
3885
3886  :host > wui-flex:first-child {
3887    align-items: center;
3888    column-gap: ${({spacing:e})=>e[2]};
3889    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
3890    width: 100%;
3891  }
3892
3893  :host > wui-flex:first-child wui-text:nth-child(1) {
3894    text-transform: capitalize;
3895  }
3896
3897  wui-transaction-visual {
3898    width: 40px;
3899    height: 40px;
3900  }
3901
3902  wui-flex {
3903    flex: 1;
3904  }
3905
3906  :host wui-flex wui-flex {
3907    overflow: hidden;
3908  }
3909
3910  :host .description-container wui-text span {
3911    word-break: break-all;
3912  }
3913
3914  :host .description-container wui-text {
3915    overflow: hidden;
3916  }
3917
3918  :host .description-separator-icon {
3919    margin: 0px 6px;
3920  }
3921
3922  :host wui-text > span {
3923    overflow: hidden;
3924    display: -webkit-box;
3925    -webkit-box-orient: vertical;
3926    -webkit-line-clamp: 1;
3927  }
3928`,A=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let S=class extends o.oi{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[]}render(){return(0,o.dy)`
3929      <wui-flex>
3930        <wui-transaction-visual
3931          .status=${this.status}
3932          direction=${(0,m.o)(this.direction)}
3933          type=${this.type}
3934          .onlyDirectionIcon=${this.onlyDirectionIcon}
3935          .images=${this.images}
3936        ></wui-transaction-visual>
3937        <wui-flex flexDirection="column" gap="1">
3938          <wui-text variant="lg-medium" color="primary">
3939            ${i[this.type]||this.type}
3940          </wui-text>
3941          <wui-flex class="description-container">
3942            ${this.templateDescription()} ${this.templateSecondDescription()}
3943          </wui-flex>
3944        </wui-flex>
3945        <wui-text variant="sm-medium" color="secondary"><span>${this.date}</span></wui-text>
3946      </wui-flex>
3947    `}templateDescription(){let e=this.descriptions?.[0];return e?(0,o.dy)`
3948          <wui-text variant="md-regular" color="secondary">
3949            <span>${e}</span>
3950          </wui-text>
3951        `:null}templateSecondDescription(){let e=this.descriptions?.[1];return e?(0,o.dy)`
3952          <wui-icon class="description-separator-icon" size="sm" name="arrowRight"></wui-icon>
3953          <wui-text variant="md-regular" color="secondary">
3954            <span>${e}</span>
3955          </wui-text>
3956        `:null}};S.styles=[y.ET,x],A([(0,s.Cb)()],S.prototype,"type",void 0),A([(0,s.Cb)({type:Array})],S.prototype,"descriptions",void 0),A([(0,s.Cb)()],S.prototype,"date",void 0),A([(0,s.Cb)({type:Boolean})],S.prototype,"onlyDirectionIcon",void 0),A([(0,s.Cb)()],S.prototype,"status",void 0),A([(0,s.Cb)()],S.prototype,"direction",void 0),A([(0,s.Cb)({type:Array})],S.prototype,"images",void 0),S=A([(0,b.M)("wui-transaction-list-item")],S),r(20958),r(43845),r(92706);var _=(0,w.iv)`
3957  wui-flex {
3958    position: relative;
3959    display: inline-flex;
3960    justify-content: center;
3961    align-items: center;
3962  }
3963
3964  wui-image {
3965    border-radius: ${({borderRadius:e})=>e[128]};
3966  }
3967
3968  .fallback-icon {
3969    color: ${({tokens:e})=>e.theme.iconInverse};
3970    border-radius: ${({borderRadius:e})=>e[3]};
3971    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3972  }
3973
3974  .direction-icon,
3975  .status-image {
3976    position: absolute;
3977    right: 0;
3978    bottom: 0;
3979    border-radius: ${({borderRadius:e})=>e[128]};
3980    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
3981  }
3982
3983  .direction-icon {
3984    padding: ${({spacing:e})=>e["01"]};
3985    color: ${({tokens:e})=>e.core.iconSuccess};
3986
3987    background-color: color-mix(
3988      in srgb,
3989      ${({tokens:e})=>e.core.textSuccess} 30%,
3990      ${({tokens:e})=>e.theme.backgroundPrimary} 70%
3991    );
3992  }
3993
3994  /* -- Sizes --------------------------------------------------- */
3995  :host([data-size='sm']) > wui-image:not(.status-image),
3996  :host([data-size='sm']) > wui-flex {
3997    width: 24px;
3998    height: 24px;
3999  }
4000
4001  :host([data-size='lg']) > wui-image:not(.status-image),
4002  :host([data-size='lg']) > wui-flex {
4003    width: 40px;
4004    height: 40px;
4005  }
4006
4007  :host([data-size='sm']) .fallback-icon {
4008    height: 16px;
4009    width: 16px;
4010    padding: ${({spacing:e})=>e[1]};
4011  }
4012
4013  :host([data-size='lg']) .fallback-icon {
4014    height: 32px;
4015    width: 32px;
4016    padding: ${({spacing:e})=>e[1]};
4017  }
4018
4019  :host([data-size='sm']) .direction-icon,
4020  :host([data-size='sm']) .status-image {
4021    transform: translate(40%, 30%);
4022  }
4023
4024  :host([data-size='lg']) .direction-icon,
4025  :host([data-size='lg']) .status-image {
4026    transform: translate(40%, 10%);
4027  }
4028
4029  :host([data-size='sm']) .status-image {
4030    height: 14px;
4031    width: 14px;
4032  }
4033
4034  :host([data-size='lg']) .status-image {
4035    height: 20px;
4036    width: 20px;
4037  }
4038
4039  /* -- Crop effects --------------------------------------------------- */
4040  .swap-crop-left-image,
4041  .swap-crop-right-image {
4042    position: absolute;
4043    top: 0;
4044    bottom: 0;
4045  }
4046
4047  .swap-crop-left-image {
4048    left: 0;
4049    clip-path: inset(0px calc(50% + 1.5px) 0px 0%);
4050  }
4051
4052  .swap-crop-right-image {
4053    right: 0;
4054    clip-path: inset(0px 0px 0px calc(50% + 1.5px));
4055  }
4056`,I=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let k={sm:"xxs",lg:"md"},O=class extends o.oi{constructor(){super(...arguments),this.type="approve",this.size="lg",this.statusImageUrl="",this.images=[]}render(){return(0,o.dy)`<wui-flex>${this.templateVisual()} ${this.templateIcon()}</wui-flex>`}templateVisual(){switch(this.dataset.size=this.size,this.type){case"trade":return this.swapTemplate();case"fiat":return this.fiatTemplate();case"unknown":return this.unknownTemplate();default:return this.tokenTemplate()}}swapTemplate(){let[e,t]=this.images;return 2===this.images.length&&(e||t)?(0,o.dy)`
4057        <wui-image class="swap-crop-left-image" src=${e} alt="Swap image"></wui-image>
4058        <wui-image class="swap-crop-right-image" src=${t} alt="Swap image"></wui-image>
4059      `:e?(0,o.dy)`<wui-image src=${e} alt="Swap image"></wui-image>`:null}fiatTemplate(){return(0,o.dy)`<wui-icon
4060      class="fallback-icon"
4061      size=${k[this.size]}
4062      name="dollar"
4063    ></wui-icon>`}unknownTemplate(){return(0,o.dy)`<wui-icon
4064      class="fallback-icon"
4065      size=${k[this.size]}
4066      name="questionMark"
4067    ></wui-icon>`}tokenTemplate(){let[e]=this.images;return e?(0,o.dy)`<wui-image src=${e} alt="Token image"></wui-image> `:(0,o.dy)`<wui-icon
4068      class="fallback-icon"
4069      name=${"nft"===this.type?"image":"coinPlaceholder"}
4070    ></wui-icon>`}templateIcon(){return this.statusImageUrl?(0,o.dy)`<wui-image
4071        class="status-image"
4072        src=${this.statusImageUrl}
4073        alt="Status image"
4074      ></wui-image>`:(0,o.dy)`<wui-icon
4075      class="direction-icon"
4076      size=${k[this.size]}
4077      name=${this.getTemplateIcon()}
4078    ></wui-icon>`}getTemplateIcon(){return"trade"===this.type?"arrowClockWise":"arrowBottom"}};O.styles=[_],I([(0,s.Cb)()],O.prototype,"type",void 0),I([(0,s.Cb)()],O.prototype,"size",void 0),I([(0,s.Cb)()],O.prototype,"statusImageUrl",void 0),I([(0,s.Cb)({type:Array})],O.prototype,"images",void 0),O=I([(0,b.M)("wui-transaction-thumbnail")],O);var N=(0,w.iv)`
4079  :host > wui-flex:first-child {
4080    gap: ${({spacing:e})=>e[2]};
4081    padding: ${({spacing:e})=>e[3]};
4082    width: 100%;
4083  }
4084
4085  wui-flex {
4086    display: flex;
4087    flex: 1;
4088  }
4089`;let P=class extends o.oi{render(){return(0,o.dy)`
4090      <wui-flex alignItems="center">
4091        <wui-shimmer width="40px" height="40px" rounded></wui-shimmer>
4092        <wui-flex flexDirection="column" gap="1">
4093          <wui-shimmer width="124px" height="16px" rounded></wui-shimmer>
4094          <wui-shimmer width="60px" height="14px" rounded></wui-shimmer>
4095        </wui-flex>
4096        <wui-shimmer width="24px" height="12px" rounded></wui-shimmer>
4097      </wui-flex>
4098    `}};P.styles=[y.ET,N],P=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([(0,b.M)("wui-transaction-list-item-loader")],P);var T=r(49854),R=(0,g.iv)`
4099  :host {
4100    min-height: 100%;
4101  }
4102
4103  .group-container[last-group='true'] {
4104    padding-bottom: ${({spacing:e})=>e["3"]};
4105  }
4106
4107  .contentContainer {
4108    height: 280px;
4109  }
4110
4111  .contentContainer > wui-icon-box {
4112    width: 40px;
4113    height: 40px;
4114    border-radius: ${({borderRadius:e})=>e["3"]};
4115  }
4116
4117  .contentContainer > .textContent {
4118    width: 65%;
4119  }
4120
4121  .emptyContainer {
4122    height: 100%;
4123  }
4124`,$=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let D="last-transaction",L=class extends o.oi{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.caipAddress=c.R.state.activeCaipAddress,this.transactionsByYear=l.s.state.transactionsByYear,this.loading=l.s.state.loading,this.empty=l.s.state.empty,this.next=l.s.state.next,l.s.clearCursor(
4124),this.unsubscribe.push(c.R.subscribeKey("activeCaipAddress",e=>{e&&this.caipAddress!==e&&(l.s.resetTransactions(),l.s.fetchTransactions(e)),this.caipAddress=e}),c.R.subscribeKey("activeCaipNetwork",()=>{this.updateTransactionView()}),l.s.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.dy)` ${this.empty?null:this.templateTransactionsByYear()}
4125    ${this.loading?this.templateLoading():null}
4126    ${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){l.s.resetTransactions(),this.caipAddress&&l.s.fetchTransactions(u.j.getPlainAddress(this.caipAddress))}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(e=>{let t=parseInt(e,10),r=Array(12).fill(null).map((e,r)=>({groupTitle:g.AI.getTransactionGroupTitle(t,r),transactions:this.transactionsByYear[t]?.[r]})).filter(({transactions:e})=>e).reverse();return r.map(({groupTitle:e,transactions:t},n)=>{let i=n===r.length-1;return t?(0,o.dy)`
4127          <wui-flex
4128            flexDirection="column"
4129            class="group-container"
4130            last-group="${i?"true":"false"}"
4131            data-testid="month-indexes"
4132          >
4133            <wui-flex
4134              alignItems="center"
4135              flexDirection="row"
4136              .padding=${["2","3","3","3"]}
4137            >
4138              <wui-text variant="md-medium" color="secondary" data-testid="group-title">
4139                ${e}
4140              </wui-text>
4141            </wui-flex>
4142            <wui-flex flexDirection="column" gap="2">
4143              ${this.templateTransactions(t,i)}
4144            </wui-flex>
4145          </wui-flex>
4146        `:null})})}templateRenderTransaction(e,t){let{date:r,descriptions:n,direction:i,isAllNFT:s,images:a,status:c,transfers:l,type:u}=this.getTransactionListItemProps(e),d=l?.length>1;return l?.length!==2||s?d?l.map((e,n)=>{let i=g.AI.getTransferDescription(e),s=t&&n===l.length-1;return(0,o.dy)` <wui-transaction-list-item
4147          date=${r}
4148          direction=${e.direction}
4149          id=${s&&this.next?D:""}
4150          status=${c}
4151          type=${u}
4152          .onlyDirectionIcon=${!0}
4153          .images=${[a[n]]}
4154          .descriptions=${[i]}
4155        ></wui-transaction-list-item>`}):(0,o.dy)`
4156      <wui-transaction-list-item
4157        date=${r}
4158        .direction=${i}
4159        id=${t&&this.next?D:""}
4160        status=${c}
4161        type=${u}
4162        .images=${a}
4163        .descriptions=${n}
4164      ></wui-transaction-list-item>
4165    `:(0,o.dy)`
4166        <wui-transaction-list-item
4167          date=${r}
4168          .direction=${i}
4169          id=${t&&this.next?D:""}
4170          status=${c}
4171          type=${u}
4172          .images=${a}
4173          .descriptions=${n}
4174        ></wui-transaction-list-item>
4175      `}templateTransactions(e,t){return e.map((r,n)=>{let i=t&&n===e.length-1;return(0,o.dy)`${this.templateRenderTransaction(r,i)}`})}emptyStateActivity(){return(0,o.dy)`<wui-flex
4176      class="emptyContainer"
4177      flexGrow="1"
4178      flexDirection="column"
4179      justifyContent="center"
4180      alignItems="center"
4181      .padding=${["10","5","10","5"]}
4182      gap="5"
4183      data-testid="empty-activity-state"
4184    >
4185      <wui-icon-box color="default" icon="wallet" size="xl"></wui-icon-box>
4186      <wui-flex flexDirection="column" alignItems="center" gap="2">
4187        <wui-text align="center" variant="lg-medium" color="primary">No Transactions yet</wui-text>
4188        <wui-text align="center" variant="lg-regular" color="secondary"
4189          >Start trading on dApps <br />
4190          to grow your wallet!</wui-text
4191        >
4192      </wui-flex>
4193    </wui-flex>`}emptyStateAccount(){return(0,o.dy)`<wui-flex
4194      class="contentContainer"
4195      alignItems="center"
4196      justifyContent="center"
4197      flexDirection="column"
4198      gap="4"
4199      data-testid="empty-account-state"
4200    >
4201      <wui-icon-box icon="swapHorizontal" size="lg" color="default"></wui-icon-box>
4202      <wui-flex
4203        class="textContent"
4204        gap="2"
4205        flexDirection="column"
4206        justifyContent="center"
4207        flexDirection="column"
4208      >
4209        <wui-text variant="md-regular" align="center" color="primary">No activity yet</wui-text>
4210        <wui-text variant="sm-regular" align="center" color="secondary"
4211          >Your next transactions will appear here</wui-text
4212        >
4213      </wui-flex>
4214      <wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
4215    </wui-flex>`}templateEmpty(){return"account"===this.page?(0,o.dy)`${this.emptyStateAccount()}`:(0,o.dy)`${this.emptyStateActivity()}`}templateLoading(){return"activity"===this.page?Array(7).fill((0,o.dy)` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(e=>e):null}onReceiveClick(){d.RouterController.push("WalletReceive")}createPaginationObserver(){let{projectId:e}=h.OptionsController.state;this.paginationObserver=new IntersectionObserver(([t])=>{t?.isIntersecting&&!this.loading&&(l.s.fetchTransactions(u.j.getPlainAddress(this.caipAddress)),p.X.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:u.j.getPlainAddress(this.caipAddress),projectId:e,cursor:this.next,isSmartAccount:(0,f.r9)(c.R.state.activeChain)===T.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){this.paginationObserver?.disconnect();let e=this.shadowRoot?.querySelector(`#${D}`);e&&this.paginationObserver?.observe(e)}getTransactionListItemProps(e){let t=a.E.formatDate(e?.metadata?.minedAt),r=g.AI.getTransactionDescriptions(e),n=e?.transfers,i=e?.transfers?.[0],o=!!i&&e?.transfers?.every(e=>!!e.nft_info),s=g.AI.getTransactionImages(n);return{date:t,direction:i?.direction,descriptions:r,isAllNFT:o,images:s,status:e.metadata?.status,transfers:n,type:e.metadata?.operationType}}};L.styles=R,$([(0,s.Cb)()],L.prototype,"page",void 0),$([(0,s.SB)()],L.prototype,"caipAddress",void 0),$([(0,s.SB)()],L.prototype,"transactionsByYear",void 0),$([(0,s.SB)()],L.prototype,"loading",void 0),$([(0,s.SB)()],L.prototype,"empty",void 0),$([(0,s.SB)()],L.prototype,"next",void 0),$([(0,g.Mo)("w3m-activity-list")],L)},69943:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(13387),s=r(29607),a=r(78632),c=r(31756),l=r(53549);r(92706),r(18749);var u=r(70169),d=r(66704),h=r(73718),p=(0,h.iv)`
4216  label {
4217    display: inline-flex;
4218    align-items: center;
4219    cursor: pointer;
4220    user-select: none;
4221    column-gap: ${({spacing:e})=>e[2]};
4222  }
4223
4224  label > input[type='checkbox'] {
4225    height: 0;
4226    width: 0;
4227    opacity: 0;
4228    position: absolute;
4229  }
4230
4231  label > span {
4232    display: flex;
4233    align-items: center;
4234    justify-content: center;
4235    height: 100%;
4236    width: 100%;
4237    border: 1px solid ${({colors:e})=>e.neutrals400};
4238    color: ${({colors:e})=>e.white};
4239    background-color: transparent;
4240    will-change: border-color, background-color;
4241  }
4242
4243  label > span > wui-icon {
4244    opacity: 0;
4245    will-change: opacity;
4246  }
4247
4248  label > input[type='checkbox']:checked + span > wui-icon {
4249    color: ${({colors:e})=>e.white};
4250  }
4251
4252  label > input[type='checkbox']:not(:checked) > span > wui-icon {
4253    color: ${({colors:e})=>e.neutrals900};
4254  }
4255
4256  label > input[type='checkbox']:checked + span > wui-icon {
4257    opacity: 1;
4258  }
4259
4260  /* -- Sizes --------------------------------------------------- */
4261  label[data-size='lg'] > span {
4262    width: 24px;
4263    height: 24px;
4264    min-width: 24px;
4265    min-height: 24px;
4266    border-radius: ${({borderRadius:e})=>e[10]};
4267  }
4268
4269  label[data-size='md'] > span {
4270    width: 20px;
4271    height: 20px;
4272    min-width: 20px;
4273    min-height: 20px;
4274    border-radius: ${({borderRadius:e})=>e[2]};
4275  }
4276
4277  label[data-size='sm'] > span {
4278    width: 16px;
4279    height: 16px;
4280    min-width: 16px;
4281    min-height: 16px;
4282    border-radius: ${({borderRadius:e})=>e[1]};
4283  }
4284
4285  /* -- Focus states --------------------------------------------------- */
4286  label > input[type='checkbox']:focus-visible + span,
4287  label > input[type='checkbox']:focus + span {
4288    border: 1px solid ${({tokens:e})=>e.core.borderAccentPrimary};
4289    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
4290  }
4291
4292  /* -- Checked states --------------------------------------------------- */
4293  label > input[type='checkbox']:checked + span {
4294    background-color: ${({tokens:e})=>e.core.iconAccentPrimary};
4295    border: 1px solid transparent;
4296  }
4297
4298  /* -- Hover states --------------------------------------------------- */
4299  input[type='checkbox']:not(:checked):not(:disabled) + span:hover {
4300    border: 1px solid ${({colors:e})=>e.neutrals700};
4301    background-color: ${({colors:e})=>e.neutrals800};
4302    box-shadow: none;
4303  }
4304
4305  input[type='checkbox']:checked:not(:disabled) + span:hover {
4306    border: 1px solid transparent;
4307    background-color: ${({colors:e})=>e.accent080};
4308    box-shadow: none;
4309  }
4310
4311  /* -- Disabled state --------------------------------------------------- */
4312  label > input[type='checkbox']:checked:disabled + span {
4313    border: 1px solid transparent;
4314    opacity: 0.3;
4315  }
4316
4317  label > input[type='checkbox']:not(:checked):disabled + span {
4318    border: 1px solid ${({colors:e})=>e.neutrals700};
4319  }
4320
4321  label:has(input[type='checkbox']:disabled) {
4322    cursor: auto;
4323  }
4324
4325  label > input[type='checkbox']:disabled + span {
4326    cursor: not-allowed;
4327  }
4328`,f=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let g={lg:"md",md:"sm",sm:"sm"},m=class extends n.oi{constructor(){super(...arguments),this.inputElementRef=(0,l.V)(),this.checked=void 0,this.disabled=!1,this.size="md"}render(){let e=g[this.size];return(0,n.dy)`
4329      <label data-size=${this.size}>
4330        <input
4331          ${(0,l.i)(this.inputElementRef)}
4332          ?checked=${(0,c.o)(this.checked)}
4333          ?disabled=${this.disabled}
4334          type="checkbox"
4335          @change=${this.dispatchChangeEvent}
4336        />
4337        <span>
4338          <wui-icon name="checkmarkBold" size=${e}></wui-icon>
4339        </span>
4340        <slot></slot>
4341      </label>
4342    `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("checkboxChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};m.styles=[u.ET,p],f([(0,i.Cb)({type:Boolean})],m.prototype,"checked",void 0),f([(0,i.Cb)({type:Boolean})],m.prototype,"disabled",void 0),f([(0,i.Cb)()],m.prototype,"size",void 0),m=f([(0,d.M)("wui-checkbox")],m),r(22939);var y=(0,a.iv)`
4343  :host {
4344    display: flex;
4345    align-items: center;
4346    justify-content: center;
4347  }
4348  wui-checkbox {
4349    padding: ${({spacing:e})=>e["3"]};
4350  }
4351  a {
4352    text-decoration: none;
4353    color: ${({tokens:e})=>e.theme.textSecondary};
4354    font-weight: 500;
4355  }
4356`,b=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let w=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.checked=o.M.state.isLegalCheckboxChecked,this.unsubscribe.push(o.M.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=s.OptionsController.state,r=s.OptionsController.state.features?.legalCheckbox;return(e||t)&&r?(0,n.dy)`
4357      <wui-checkbox
4358        ?checked=${this.checked}
4359        @checkboxChange=${this.onCheckboxChange.bind(this)}
4360        data-testid="wui-checkbox"
4361      >
4362        <wui-text color="secondary" variant="sm-regular" align="left">
4363          I agree to our ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
4364        </wui-text>
4365      </wui-checkbox>
4366    `:null}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=s.OptionsController.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=s.OptionsController.state;return e?(0,n.dy)`<a rel="noreferrer" target="_blank" href=${e}>terms of service</a>`:null}privacyTemplate(){let{privacyPolicyUrl:e}=s.OptionsController.state;return e?(0,n.dy)`<a rel="noreferrer" target="_blank" href=${e}>privacy policy</a>`:null}onCheckboxChange(){o.M.setIsLegalCheckboxChecked(!this.checked)}};w.styles=[y],b([(0,i.SB)()],w.prototype,"checked",void 0),b([(0,a.Mo)("w3m-legal-checkbox")],w)},10231:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(29607),s=r(78632);r(29557),r(22939),r(56306);var a=(0,s.iv)`
4367  :host wui-ux-by-reown {
4368    padding-top: 0;
4369  }
4370
4371  :host wui-ux-by-reown.branding-only {
4372    padding-top: ${({spacing:e})=>e["3"]};
4373  }
4374
4375  a {
4376    text-decoration: none;
4377    color: ${({tokens:e})=>e.core.textAccentPrimary};
4378    font-weight: 500;
4379  }
4380`,c=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let l=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=o.OptionsController.state.remoteFeatures,this.unsubscribe.push(o.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}
4380disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=o.OptionsController.state,r=o.OptionsController.state.features?.legalCheckbox;return(e||t)&&!r?(0,n.dy)`
4381      <wui-flex flexDirection="column">
4382        <wui-flex .padding=${["4","3","3","3"]} justifyContent="center">
4383          <wui-text color="secondary" variant="md-regular" align="center">
4384            By connecting your wallet, you agree to our <br />
4385            ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
4386          </wui-text>
4387        </wui-flex>
4388        ${this.reownBrandingTemplate()}
4389      </wui-flex>
4390    `:(0,n.dy)`
4391        <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
4392      `}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=o.OptionsController.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=o.OptionsController.state;return e?(0,n.dy)`<a href=${e} target="_blank" rel="noopener noreferrer"
4393      >Terms of Service</a
4394    >`:null}privacyTemplate(){let{privacyPolicyUrl:e}=o.OptionsController.state;return e?(0,n.dy)`<a href=${e} target="_blank" rel="noopener noreferrer"
4395      >Privacy Policy</a
4396    >`:null}reownBrandingTemplate(e=!1){return this.remoteFeatures?.reownBranding?e?(0,n.dy)`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:(0,n.dy)`<wui-ux-by-reown></wui-ux-by-reown>`:null}};l.styles=[a],c([(0,i.SB)()],l.prototype,"remoteFeatures",void 0),c([(0,s.Mo)("w3m-legal-footer")],l)},71932:function(e,t,r){"use strict";var n=r(19045),i=r(29607),o=r(46001),s=r(62250),a=r(39674),c=r(83764),l=r(78632);r(29557),r(85302),r(24996),r(22939);var u=r(49854),d=(0,n.iv)``;let h=class extends n.oi{render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=i.OptionsController.state;return e||t?(0,n.dy)`
4397      <wui-flex
4398        .padding=${["4","3","3","3"]}
4399        flexDirection="column"
4400        alignItems="center"
4401        justifyContent="center"
4402        gap="3"
4403      >
4404        <wui-text color="secondary" variant="md-regular" align="center">
4405          We work with the best providers to give you the lowest fees and best support. More options
4406          coming soon!
4407        </wui-text>
4408
4409        ${this.howDoesItWorkTemplate()}
4410      </wui-flex>
4411    `:null}howDoesItWorkTemplate(){return(0,n.dy)` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
4412      <wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
4413      How does it work?
4414    </wui-link>`}onWhatIsBuy(){o.X.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:(0,s.r9)(a.R.state.activeChain)===u.y_.ACCOUNT_TYPES.SMART_ACCOUNT}}),c.RouterController.push("WhatIsABuy")}};h.styles=[d],function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);o>3&&s&&Object.defineProperty(t,r,s)}([(0,l.Mo)("w3m-onramp-providers-footer")],h)},39184:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(27322),s=r(83764),a=r(30397),c=r(78632),l=(0,n.iv)`
4415  :host {
4416    width: 100%;
4417    display: block;
4418  }
4419`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.text="",this.open=o.f.state.open,this.unsubscribe.push(s.RouterController.subscribeKey("view",()=>{o.f.hide()}),a.I.subscribeKey("open",e=>{e||o.f.hide()}),o.f.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),o.f.hide()}render(){return(0,n.dy)`
4420      <div
4421        @pointermove=${this.onMouseEnter.bind(this)}
4422        @pointerleave=${this.onMouseLeave.bind(this)}
4423      >
4424        ${this.renderChildren()}
4425      </div>
4426    `}renderChildren(){return(0,n.dy)`<slot></slot> `}onMouseEnter(){let e=this.getBoundingClientRect();if(!this.open){let t=document.querySelector("w3m-modal"),r={width:e.width,height:e.height,left:e.left,top:e.top};if(t){let n=t.getBoundingClientRect();r.left=e.left-(window.innerWidth-n.width)/2,r.top=e.top-(window.innerHeight-n.height)/2}o.f.showTooltip({message:this.text,triggerRect:r,variant:"shade"})}}onMouseLeave(e){this.contains(e.relatedTarget)||o.f.hide()}};d.styles=[l],u([(0,i.Cb)()],d.prototype,"text",void 0),u([(0,i.SB)()],d.prototype,"open",void 0),u([(0,c.Mo)("w3m-tooltip-trigger")],d)},69725:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(27322),s=r(78632);r(29557),r(85302),r(22939);var a=(0,s.iv)`
4427  :host {
4428    pointer-events: none;
4429  }
4430
4431  :host > wui-flex {
4432    display: var(--w3m-tooltip-display);
4433    opacity: var(--w3m-tooltip-opacity);
4434    padding: 9px ${({spacing:e})=>e["3"]} 10px ${({spacing:e})=>e["3"]};
4435    border-radius: ${({borderRadius:e})=>e["3"]};
4436    color: ${({tokens:e})=>e.theme.backgroundPrimary};
4437    position: absolute;
4438    top: var(--w3m-tooltip-top);
4439    left: var(--w3m-tooltip-left);
4440    transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
4441    max-width: calc(var(--apkt-modal-width) - ${({spacing:e})=>e["5"]});
4442    transition: opacity ${({durations:e})=>e.lg}
4443      ${({easings:e})=>e["ease-out-power-2"]};
4444    will-change: opacity;
4445    opacity: 0;
4446    animation-duration: ${({durations:e})=>e.xl};
4447    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
4448    animation-name: fade-in;
4449    animation-fill-mode: forwards;
4450  }
4451
4452  :host([data-variant='shade']) > wui-flex {
4453    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4454  }
4455
4456  :host([data-variant='shade']) > wui-flex > wui-text {
4457    color: ${({tokens:e})=>e.theme.textSecondary};
4458  }
4459
4460  :host([data-variant='fill']) > wui-flex {
4461    background-color: ${({tokens:e})=>e.theme.textPrimary};
4462    border: none;
4463  }
4464
4465  wui-icon {
4466    position: absolute;
4467    width: 12px !important;
4468    height: 4px !important;
4469    color: ${({tokens:e})=>e.theme.foregroundPrimary};
4470  }
4471
4472  wui-icon[data-placement='top'] {
4473    bottom: 0px;
4474    left: 50%;
4475    transform: translate(-50%, 95%);
4476  }
4477
4478  wui-icon[data-placement='bottom'] {
4479    top: 0;
4480    left: 50%;
4481    transform: translate(-50%, -95%) rotate(180deg);
4482  }
4483
4484  wui-icon[data-placement='right'] {
4485    top: 50%;
4486    left: 0;
4487    transform: translate(-65%, -50%) rotate(90deg);
4488  }
4489
4490  wui-icon[data-placement='left'] {
4491    top: 50%;
4492    right: 0%;
4493    transform: translate(65%, -50%) rotate(270deg);
4494  }
4495
4496  @keyframes fade-in {
4497    from {
4498      opacity: 0;
4499    }
4500    to {
4501      opacity: 1;
4502    }
4503  }
4504`,c=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let l=class extends n.oi{constructor(){super(),this.unsubscribe=[],this.open=o.f.state.open,this.message=o.f.state.message,this.triggerRect=o.f.state.triggerRect,this.variant=o.f.state.variant,this.unsubscribe.push(o.f.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}
4504disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;let e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=`
4505    --w3m-tooltip-top: ${e}px;
4506    --w3m-tooltip-left: ${t}px;
4507    --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
4508    --w3m-tooltip-display: ${this.open?"flex":"none"};
4509    --w3m-tooltip-opacity: ${this.open?1:0};
4510    `,(0,n.dy)`<wui-flex>
4511      <wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon>
4512      <wui-text color="primary" variant="sm-regular">${this.message}</wui-text>
4513    </wui-flex>`}};l.styles=[a],c([(0,i.SB)()],l.prototype,"open",void 0),c([(0,i.SB)()],l.prototype,"message",void 0),c([(0,i.SB)()],l.prototype,"triggerRect",void 0),c([(0,i.SB)()],l.prototype,"variant",void 0),c([(0,s.Mo)("w3m-tooltip")],l)},38510:function(e,t,r){"use strict";r.d(t,{C:function(){return p}});var n=r(42036),i=r(29607),o=r(33802),s=r(84270),a=r(99321),c=r(59449),l=r(39674),u=r(20274),d=r(33279),h=r(87313);let p={getConnectorsByType(e,t,r){let{customWallets:n}=i.OptionsController.state,s=o.M.getRecentWallets(),a=h.J.filterOutDuplicateWallets(t),c=h.J.filterOutDuplicateWallets(r),l=e.filter(e=>"MULTI_CHAIN"===e.type),u=e.filter(e=>"ANNOUNCED"===e.type),d=e.filter(e=>"INJECTED"===e.type);return{custom:n,recent:s,external:e.filter(e=>"EXTERNAL"===e.type),multiChain:l,announced:u,injected:d,recommended:a,featured:c}},showConnector(e){let t=e.info?.rdns,r=!!t&&s.ApiController.state.excludedWallets.some(e=>!!e.rdns&&e.rdns===t),n=!!e.name&&s.ApiController.state.excludedWallets.some(t=>d.g.isLowerCaseMatch(t.name,e.name));return!("INJECTED"===e.type&&("Browser Wallet"===e.name&&(!a.j.isMobile()||a.j.isMobile()&&!t&&!c.ConnectionController.checkInstalled())||r||n))&&("ANNOUNCED"!==e.type&&"EXTERNAL"!==e.type||!r&&!n)},getIsConnectedWithWC:()=>Array.from(l.R.state.chains.values()).some(e=>u.ConnectorController.getConnectorId(e.namespace)===n.b.CONNECTOR_ID.WALLET_CONNECT),getConnectorTypeOrder({recommended:e,featured:t,custom:r,recent:n,announced:o,injected:s,multiChain:a,external:c,overriddenConnectors:l=i.OptionsController.state.features?.connectorTypeOrder??[]}){let u=[{type:"walletConnect",isEnabled:i.OptionsController.state.enableWalletConnect},{type:"recent",isEnabled:n.length>0},{type:"injected",isEnabled:[...s,...o,...a].length>0},{type:"featured",isEnabled:t.length>0},{type:"custom",isEnabled:r&&r.length>0},{type:"external",isEnabled:c.length>0},{type:"recommended",isEnabled:e.length>0}].filter(e=>e.isEnabled),d=new Set(u.map(e=>e.type)),h=l.filter(e=>d.has(e)).map(e=>({type:e,isEnabled:!0})),p=u.filter(({type:e})=>!h.some(({type:t})=>t===e));return Array.from(new Set([...h,...p].map(({type:e})=>e)))},getAuthName:({email:e,socialUsername:t,socialProvider:r})=>t?r&&"discord"===r&&t.endsWith("0")?t.slice(0,-1):t:e.length>30?`${e.slice(0,-3)}...`:e,async fetchProviderData(e){try{if("Browser Wallet"===e.name&&!a.j.isMobile()||e.id===n.b.CONNECTOR_ID.AUTH)return{accounts:[],chainId:void 0};let[t,r]=await Promise.all([e.provider?.request({method:"eth_accounts"}),e.provider?.request({method:"eth_chainId"}).then(e=>Number(e))]);return{accounts:t,chainId:r}}catch(t){return console.warn(`Failed to fetch provider data for ${e.name}`,t),{accounts:[],chainId:void 0}}}}},46849:function(e,t,r){"use strict";r.d(t,{b:function(){return i}});var n=r(14224);let i={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:(void 0!==n&&void 0!==n.env?n.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},DEFAULT_CONNECT_METHOD_ORDER:["email","social","wallet"],ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]}},31225:function(e,t,r){"use strict";r.d(t,{g:function(){return a}});var n=r(42036),i=r(29607),o=r(83764),s=r(46849);let a={getTabsByNamespace:e=>e&&e===n.b.CHAIN.EVM?i.OptionsController.state.remoteFeatures?.activity===!1?s.b.ACCOUNT_TABS.filter(e=>"Activity"!==e.label):s.b.ACCOUNT_TABS:[],isValidReownName:e=>/^[a-zA-Z0-9]+$/gu.test(e),isValidEmail:e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/gu.test(e),validateReownName:e=>e.replace(/\^/gu,"").toLowerCase().replace(/[^a-zA-Z0-9]/gu,""),hasFooter(){let e=o.RouterController.state.view;if(s.b.VIEWS_WITH_LEGAL_FOOTER.includes(e)){let{termsConditionsUrl:e,privacyPolicyUrl:t}=i.OptionsController.state,r=i.OptionsController.state.features?.legalCheckbox;return(!!e||!!t)&&!r}return s.b.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}}},87313:function(e,t,r){"use strict";r.d(t,{J:function(){return d}});var n=r(29607),i=r(20274),o=r(33802),s=r(99321),a=r(84270),c=r(33279),l=r(38510),u=r(46849);let d={filterOutDuplicatesByRDNS(e){let t=n.OptionsController.state.enableEIP6963?i.ConnectorController.state.connectors:[],r=o.M.getRecentWallets(),a=t.map(e=>
4513e.info?.rdns).filter(Boolean),c=r.map(e=>e.rdns).filter(Boolean),l=a.concat(c);if(l.includes("io.metamask.mobile")&&s.j.isMobile()){let e=l.indexOf("io.metamask.mobile");l[e]="io.metamask"}return e.filter(e=>!(e?.rdns&&l.includes(String(e.rdns))||!e?.rdns&&t.some(t=>t.name===e.name)))},filterOutDuplicatesByIds(e){let t=i.ConnectorController.state.connectors.filter(e=>"ANNOUNCED"===e.type||"INJECTED"===e.type),r=o.M.getRecentWallets(),n=t.map(e=>e.explorerId),s=r.map(e=>e.id),a=n.concat(s);return e.filter(e=>!a.includes(e?.id))},filterOutDuplicateWallets(e){let t=this.filterOutDuplicatesByRDNS(e);return this.filterOutDuplicatesByIds(t)},markWalletsAsInstalled(e){let{connectors:t}=i.ConnectorController.state,{featuredWalletIds:r}=n.OptionsController.state,o=t.filter(e=>"ANNOUNCED"===e.type).reduce((e,t)=>(t.info?.rdns&&(e[t.info.rdns]=!0),e),{});return e.map(e=>({...e,installed:!!e.rdns&&!!o[e.rdns??""]})).sort((e,t)=>{let n=Number(t.installed)-Number(e.installed);if(0!==n)return n;if(r?.length){let n=r.indexOf(e.id),i=r.indexOf(t.id);if(-1!==n&&-1!==i)return n-i;if(-1!==n)return -1;if(-1!==i)return 1}return 0})},getConnectOrderMethod(e,t){let r=e?.connectMethodsOrder||n.OptionsController.state.features?.connectMethodsOrder,o=t||i.ConnectorController.state.connectors;if(r)return r;let{injected:s,announced:c}=l.C.getConnectorsByType(o,a.ApiController.state.recommended,a.ApiController.state.featured),d=s.filter(l.C.showConnector),h=c.filter(l.C.showConnector);return d.length||h.length?["wallet","email","social"]:u.b.DEFAULT_CONNECT_METHOD_ORDER},isExcluded(e){let t=!!e.rdns&&a.ApiController.state.excludedWallets.some(t=>t.rdns===e.rdns),r=!!e.name&&a.ApiController.state.excludedWallets.some(t=>c.g.isLowerCaseMatch(t.name,e.name));return t||r},markWalletsWithDisplayIndex:e=>e.map((e,t)=>({...e,display_index:t}))}},78632:function(e,t,r){"use strict";r.d(t,{kj:function(){return n},AI:function(){return l},Hg:function(){return o.H},iv:function(){return d.iv},Mo:function(){return u.M},n:function(){return i.n},Hs:function(){return i.Hs},R:function(){return i.R}});let n={interpolate(e,t,r){if(2!==e.length||2!==t.length)throw Error("inputRange and outputRange must be an array of length 2");let n=e[0]||0,i=e[1]||0,o=t[0]||0,s=t[1]||0;return r<n?o:r>i?s:(s-o)/(i-n)*(r-n)+o}};var i=r(70169),o=r(45182),s=r(16444);let a=["receive","deposit","borrow","claim"],c=["withdraw","repay","burn"],l={getTransactionGroupTitle(e,t){let r=s.E.getYear(),n=s.E.getMonthNameByIndex(t);return e===r?n:`${n} ${e}`},getTransactionImages(e){let[t,r]=e,n=!!t&&e?.every(e=>!!e.nft_info),i=e?.length>1;return e?.length!==2||n?i?e.map(e=>this.getTransactionImage(e)):[this.getTransactionImage(t)]:[this.getTransactionImage(r),this.getTransactionImage(t)]},getTransactionImage:e=>({type:l.getTransactionTransferTokenType(e),url:l.getTransactionImageURL(e)}),getTransactionImageURL(e){let t;let r=!!e?.nft_info,n=!!e?.fungible_info;return e&&r?t=e?.nft_info?.content?.preview?.url:e&&n&&(t=e?.fungible_info?.icon?.url),t},getTransactionTransferTokenType:e=>e?.fungible_info?"FUNGIBLE":e?.nft_info?"NFT":void 0,getTransactionDescriptions(e){let t=e?.metadata?.operationType,r=e?.transfers,n=e?.transfers?.length>0,i=e?.transfers?.length>1,s=n&&r?.every(e=>!!e?.fungible_info),[l,u]=r,d=this.getTransferDescription(l);if(this.getTransferDescription(u),!n)return("send"===t||"receive"===t)&&s?[d=o.H.getTruncateString({string:e?.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),o.H.getTruncateString({string:e?.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"})]:[e.metadata.status];if(i)return r.map(e=>this.getTransferDescription(e)).reverse();let h="";return a.includes(t)?h="+":c.includes(t)&&(h="-"),[d=h.concat(d)]},getTransferDescription(e){let t="";return e&&(e?.nft_info?t=e?.nft_info?.name||"-":e?.fungible_info&&(t=this.getFungibleTransferDescription(e)||"-")),t},getFungibleTransferDescription(e){return e?[this.getQuantityFixedValue(e?.quantity.numeric),e?.fungible_info?.symbol].join(" ").trim():null},getQuantityFixedValue:e=>e?parseFloat(e).toFixed(3):null};var u=r(66704);r(37307);var d=r(73718)},86841:function(e,t,r){"use strict";r(95547)},73741:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(31756);r(92706),r(18749);var s=r(70169),a=r(66704);r(54541);var c=(0,n.iv)`
4514  :host {
4515    position: relative;
4516    display: inline-block;
4517    width: 100%;
4518  }
4519`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{constructor(){super(...arguments),this.disabled=!1}render(){return(0,n.dy)`
4520      <wui-input-text
4521        type="email"
4522        placeholder="Email"
4523        icon="mail"
4524        size="lg"
4525        .disabled=${this.disabled}
4526        .value=${this.value}
4527        data-testid="wui-email-input"
4528        tabIdx=${(0,o.o)(this.tabIdx)}
4529      ></wui-input-text>
4530      ${this.templateError()}
4531    `}templateError(){return this.errorMessage?(0,n.dy)`<wui-text variant="sm-regular" color="error">${this.errorMessage}</wui-text>`:null}};u.styles=[s.ET,c],l([(0,i.Cb)()],u.prototype,"errorMessage",void 0),l([(0,i.Cb)({type:Boolean})],u.prototype,"disabled",void 0),l([(0,i.Cb)()],u.prototype,"value",void 0),l([(0,i.Cb)()],u.prototype,"tabIdx",void 0),l([(0,a.M)("wui-email-input")],u)},29557:function(e,t,r){"use strict";r(43845)},84081:function(e,t,r){"use strict";r(94272)},19549:function(e,t,r){"use strict";r(46550)},85302:function(e,t,r){"use strict";r(92706)},75026:function(e,t,r){"use strict";r(54541)},24996:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(92706),r(18749);
4531var o=r(70169),s=r(66704),a=r(73718),c=(0,a.iv)`
4532  button {
4533    border: none;
4534    background: transparent;
4535    height: 20px;
4536    padding: ${({spacing:e})=>e[2]};
4537    column-gap: ${({spacing:e})=>e[1]};
4538    border-radius: ${({borderRadius:e})=>e[1]};
4539    padding: 0 ${({spacing:e})=>e[1]};
4540    border-radius: ${({spacing:e})=>e[1]};
4541  }
4542
4543  /* -- Variants --------------------------------------------------------- */
4544  button[data-variant='accent'] {
4545    color: ${({tokens:e})=>e.core.textAccentPrimary};
4546  }
4547
4548  button[data-variant='secondary'] {
4549    color: ${({tokens:e})=>e.theme.textSecondary};
4550  }
4551
4552  /* -- Focus states --------------------------------------------------- */
4553  button:focus-visible:enabled {
4554    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
4555  }
4556
4557  button[data-variant='accent']:focus-visible:enabled {
4558    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
4559  }
4560
4561  button[data-variant='secondary']:focus-visible:enabled {
4562    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4563  }
4564
4565  /* -- Hover & Active states ----------------------------------------------------------- */
4566  button[data-variant='accent']:hover:enabled {
4567    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
4568  }
4569
4570  button[data-variant='secondary']:hover:enabled {
4571    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4572  }
4573
4574  button[data-variant='accent']:focus-visible {
4575    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
4576  }
4577
4578  button[data-variant='secondary']:focus-visible {
4579    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4580    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
4581  }
4582
4583  button[disabled] {
4584    opacity: 0.5;
4585    cursor: not-allowed;
4586  }
4587`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u={sm:"sm-medium",md:"md-medium"},d={accent:"accent-primary",secondary:"secondary"},h=class extends n.oi{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.variant="accent",this.icon=void 0}render(){return(0,n.dy)`
4588      <button ?disabled=${this.disabled} data-variant=${this.variant}>
4589        <slot name="iconLeft"></slot>
4590        <wui-text
4591          color=${d[this.variant]}
4592          variant=${u[this.size]}
4593        >
4594          <slot></slot>
4595        </wui-text>
4596        ${this.iconTemplate()}
4597      </button>
4598    `}iconTemplate(){return this.icon?(0,n.dy)`<wui-icon name=${this.icon} size="sm"></wui-icon>`:null}};h.styles=[o.ET,o.ZM,c],l([(0,i.Cb)()],h.prototype,"size",void 0),l([(0,i.Cb)({type:Boolean})],h.prototype,"disabled",void 0),l([(0,i.Cb)()],h.prototype,"variant",void 0),l([(0,i.Cb)()],h.prototype,"icon",void 0),l([(0,s.M)("wui-link")],h)},40135:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(31756);r(93836),r(18749);var s=r(70169),a=r(66704),c=r(73718),l=(0,c.iv)`
4599  :host {
4600    width: 100%;
4601  }
4602
4603  button {
4604    display: flex;
4605    align-items: center;
4606    justify-content: space-between;
4607    padding: ${({spacing:e})=>e[3]};
4608    width: 100%;
4609    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
4610    border-radius: ${({borderRadius:e})=>e[4]};
4611    transition:
4612      background-color ${({durations:e})=>e.lg}
4613        ${({easings:e})=>e["ease-out-power-2"]},
4614      scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
4615    will-change: background-color, scale;
4616  }
4617
4618  wui-text {
4619    text-transform: capitalize;
4620  }
4621
4622  wui-image {
4623    color: ${({tokens:e})=>e.theme.textPrimary};
4624  }
4625
4626  @media (hover: hover) {
4627    button:hover:enabled {
4628      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4629    }
4630  }
4631
4632  button:disabled {
4633    opacity: 0.5;
4634    cursor: not-allowed;
4635  }
4636`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d=class extends n.oi{constructor(){super(...arguments),this.imageSrc="google",this.loading=!1,this.disabled=!1,this.rightIcon=!0,this.rounded=!1,this.fullSize=!1}render(){return this.dataset.rounded=this.rounded?"true":"false",(0,n.dy)`
4637      <button
4638        ?disabled=${!!this.loading||!!this.disabled}
4639        data-loading=${this.loading}
4640        tabindex=${(0,o.o)(this.tabIdx)}
4641      >
4642        <wui-flex gap="2" alignItems="center">
4643          ${this.templateLeftIcon()}
4644          <wui-flex gap="1">
4645            <slot></slot>
4646          </wui-flex>
4647        </wui-flex>
4648        ${this.templateRightIcon()}
4649      </button>
4650    `}templateLeftIcon(){return this.icon?(0,n.dy)`<wui-image
4651        icon=${this.icon}
4652        iconColor=${(0,o.o)(this.iconColor)}
4653        ?boxed=${!0}
4654        ?rounded=${this.rounded}
4655      ></wui-image>`:(0,n.dy)`<wui-image
4656      ?boxed=${!0}
4657      ?rounded=${this.rounded}
4658      ?fullSize=${this.fullSize}
4659      src=${this.imageSrc}
4660    ></wui-image>`}templateRightIcon(){return this.rightIcon?this.loading?(0,n.dy)`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:(0,n.dy)`<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>`:null}};d.styles=[s.ET,s.ZM,l],u([(0,i.Cb)()],d.prototype,"imageSrc",void 0),u([(0,i.Cb)()],d.prototype,"icon",void 0),u([(0,i.Cb)()],d.prototype,"iconColor",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"loading",void 0),u([(0,i.Cb)()],d.prototype,"tabIdx",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"disabled",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"rightIcon",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"rounded",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"fullSize",void 0),u([(0,a.M)("wui-list-item")],d)},62281:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(31756);r(18749);var s=r(70169),a=r(66704);r(67079);var c=r(73718),l=(0,c.iv)`
4661  :host {
4662    width: 100%;
4663  }
4664
4665  button {
4666    display: flex;
4667    align-items: center;
4668    justify-content: space-between;
4669    padding: ${({spacing:e})=>e[3]};
4670    width: 100%;
4671    background-color: transparent;
4672    border-radius: ${({borderRadius:e})=>e[4]};
4673  }
4674
4675  wui-text {
4676    text-transform: capitalize;
4677  }
4678
4679  @media (hover: hover) {
4680    button:hover:enabled {
4681      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4682    }
4683  }
4684
4685  button:disabled {
4686    opacity: 0.5;
4687    cursor: not-allowed;
4688  }
4689`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d=class extends n.oi{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.disabled=!1}render(){return(0,n.dy)`
4690      <button ?disabled=${this.disabled} tabindex=${(0,o.o)(this.tabIdx)}>
4691        <wui-flex gap="2" alignItems="center">
4692          <wui-image ?boxed=${!0} logo=${this.logo}></wui-image>
4693          <wui-text variant="lg-regular" color="primary">${this.name}</wui-text>
4694        </wui-flex>
4695        <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
4696      </button>
4697    `}};d.styles=[s.ET,s.ZM,l],u([(0,i.Cb)()],d.prototype,"logo",void 0),u([(0,i.Cb)()],d.prototype,"name",void 0),u([(0,i.Cb)()],d.prototype,"tabIdx",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"disabled",void 0),u([(0,a.M)("wui-list-social")],d)},626:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(35529);r(92706),r(79086),r(18749),r(43845);var s=r(70169),a=r(66704),c=r(73718),l=(0,c.iv)`
4698  :host {
4699    width: 100%;
4700  }
4701
4702  button {
4703    padding: ${({spacing:e})=>e[3]};
4704    display: flex;
4705    justify-content: space-between;
4706    width: 100%;
4707    border-radius: ${({borderRadius:e})=>e[4]};
4708    background-color: transparent;
4709  }
4710
4711  @media (hover: hover) {
4712    button:hover:enabled {
4713      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4714    }
4715  }
4716
4717  button:focus-visible:enabled {
4718    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4719    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
4720  }
4721
4722  button[data-clickable='false'] {
4723    pointer-events: none;
4724    background-color: transparent;
4725  }
4726
4727  wui-image,
4728  wui-icon {
4729    width: ${({spacing:e})=>e[10]};
4730    height: ${({spacing:e})=>e[10]};
4731  }
4732
4733  wui-image {
4734    border-radius: ${({borderRadius:e})=>e[16]};
4735  }
4736`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d=class extends n.oi{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return(0,n.dy)`
4737      <button data-clickable=${String(this.clickable)}>
4738        <wui-flex gap="2" alignItems="center">
4739          ${this.visualTemplate()}
4740          <wui-flex flexDirection="column" justifyContent="space-between" gap="1">
4741            <wui-text variant="md-regular" color="primary">${this.tokenName}</wui-text>
4742            <wui-text variant="sm-regular-mono" color="secondary">
4743              ${o.C.formatNumberToLocalString(this.tokenAmount,4)} ${this.tokenCurrency}
4744            </wui-text>
4745          </wui-flex>
4746        </wui-flex>
4747        <wui-flex
4748          flexDirection="column"
4749          justifyContent="space-between"
4750          gap="1"
4751          alignItems="flex-end"
4752        >
4753          <wui-text variant="md-regular-mono" color="primary"
4754            >$${this.tokenValue.toFixed(2)}</wui-text
4755          >
4756          <wui-text variant="sm-regular-mono" color="secondary">
4757            ${o.C.formatNumberToLocalString(this.tokenAmount,4)}
4758          </wui-text>
4759        </wui-flex>
4760      </button>
4761    `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?(0,n.dy)`<wui-image alt=${this.tokenName} src=${this.tokenImageUrl}></wui-image>`:(0,n.dy)`<wui-icon name="coinPlaceholder" color="default"></wui-icon>`}};d.styles=[s.ET,s.ZM,l],u([(0,i.Cb)()],d.prototype,"tokenName",void 0),u([(0,i.Cb)()],d.prototype,"tokenImageUrl",void 0),u([(0,i.Cb)({type:Number})],d.prototype,"tokenValue",void 0),u([(0,i.Cb)()],d.prototype,"tokenAmount",void 0),u([(0,i.Cb)()],d.prototype,"tokenCurrency",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"clickable",void 0),u([(0,a.M)("wui-list-token")],d)},6551:function(e,t,r){"use strict";r(93836)},20960:function(e,t,r){"use strict";
4761var n=r(19045),i=r(94836),o=r(70169),s=r(66704),a=r(73718),c=(0,a.iv)`
4762  :host {
4763    display: block;
4764    width: 100px;
4765    height: 100px;
4766  }
4767
4768  svg {
4769    width: 100px;
4770    height: 100px;
4771  }
4772
4773  rect {
4774    fill: none;
4775    stroke: ${e=>e.colors.accent100};
4776    stroke-width: 3px;
4777    stroke-linecap: round;
4778    animation: dash 1s linear infinite;
4779  }
4780
4781  @keyframes dash {
4782    to {
4783      stroke-dashoffset: 0px;
4784    }
4785  }
4786`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){let e=this.radius>50?50:this.radius,t=36-e;return(0,n.dy)`
4787      <svg viewBox="0 0 110 110" width="110" height="110">
4788        <rect
4789          x="2"
4790          y="2"
4791          width="106"
4792          height="106"
4793          rx=${e}
4794          stroke-dasharray="${116+t} ${245+t}"
4795          stroke-dashoffset=${360+1.75*t}
4796        />
4797      </svg>
4798    `}};u.styles=[o.ET,c],l([(0,i.Cb)({type:Number})],u.prototype,"radius",void 0),l([(0,s.M)("wui-loading-thumbnail")],u)},86701:function(e,t,r){"use strict";var n=r(19045),i=r(94836);let o=(0,n.YP)`<svg width="86" height="96" fill="none">
4799  <path
4800    d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
4801  />
4802</svg>`;var s=r(8102);let a=(0,n.YP)`
4803  <svg fill="none" viewBox="0 0 36 40">
4804    <path
4805      d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z"
4806    />
4807  </svg>
4808`;r(92706),r(79086);var c=r(70169),l=r(66704),u=r(73718),d=(0,u.iv)`
4809  :host {
4810    position: relative;
4811    border-radius: inherit;
4812    display: flex;
4813    justify-content: center;
4814    align-items: center;
4815    width: var(--local-width);
4816    height: var(--local-height);
4817  }
4818
4819  :host([data-round='true']) {
4820    background: ${({tokens:e})=>e.theme.foregroundPrimary};
4821    border-radius: 100%;
4822    outline: 1px solid ${({tokens:e})=>e.core.glass010};
4823  }
4824
4825  svg {
4826    position: absolute;
4827    top: 0;
4828    left: 0;
4829    width: 100%;
4830    height: 100%;
4831    z-index: 1;
4832  }
4833
4834  svg > path {
4835    stroke: var(--local-stroke);
4836  }
4837
4838  wui-image {
4839    width: 100%;
4840    height: 100%;
4841    -webkit-clip-path: var(--local-path);
4842    clip-path: var(--local-path);
4843    background: ${({tokens:e})=>e.theme.foregroundPrimary};
4844  }
4845
4846  wui-icon {
4847    transform: translateY(-5%);
4848    width: var(--local-icon-size);
4849    height: var(--local-icon-size);
4850  }
4851`,h=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let p=class extends n.oi{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:a,md:s.W,lg:o},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=`
4852      --local-width: var(--apkt-spacing-10);
4853      --local-height: var(--apkt-spacing-10);
4854      --local-icon-size: var(--apkt-spacing-4);
4855    `):this.style.cssText=`
4856
4857      --local-path: var(--apkt-path-network-${this.size});
4858      --local-width:  var(--apkt-width-network-${this.size});
4859      --local-height:  var(--apkt-height-network-${this.size});
4860      --local-icon-size:  var(--apkt-spacing-${({sm:"4",md:"6",lg:"10"})[this.size]});
4861    `,(0,n.dy)`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?(0,n.dy)`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:(0,n.dy)`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};p.styles=[c.ET,d],h([(0,i.Cb)()],p.prototype,"size",void 0),h([(0,i.Cb)()],p.prototype,"name",void 0),h([(0,i.Cb)({type:Object})],p.prototype,"networkImagesBySize",void 0),h([(0,i.Cb)()],p.prototype,"imageSrc",void 0),h([(0,i.Cb)({type:Boolean})],p.prototype,"selected",void 0),h([(0,i.Cb)({type:Boolean})],p.prototype,"round",void 0),h([(0,l.M)("wui-network-image")],p)},98708:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(92706),r(79086),r(43845);var o=r(68119);function s(e,t,r){return e!==t&&(e-t<0?t-e:e-t)<=r+.1}let a={generate({uri:e,size:t,logoSize:r,padding:i=8,dotColor:a="var(--apkt-tokens-theme-textInvert)"}){let c=[],l=function(e,t){let r=Array.prototype.slice.call(o.create(e,{errorCorrectionLevel:"Q"}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((e,t,r)=>(r%n==0?e.push([t]):e[e.length-1].push(t))&&e,[])}(e,0),u=(t-2*i)/l.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:e,y:t})=>{let r=(l.length-7)*u*e+i,o=(l.length-7)*u*t+i;for(let e=0;e<d.length;e+=1){let t=u*(7-2*e);c.push((0,n.YP)`
4862            <rect
4863              fill=${2===e?"var(--apkt-tokens-theme-textInvert)":"var(--apkt-tokens-theme-textPrimary)"}
4864              width=${0===e?t-10:t}
4865              rx= ${0===e?(t-10)*.45:.45*t}
4866              ry= ${0===e?(t-10)*.45:.45*t}
4867              stroke=${a}
4868              stroke-width=${0===e?10:0}
4869              height=${0===e?t-10:t}
4870              x= ${0===e?o+u*e+5:o+u*e}
4871              y= ${0===e?r+u*e+5:r+u*e}
4872            />
4873          `)}});let h=Math.floor((r+25)/u),p=l.length/2-h/2,f=l.length/2+h/2-1,g=[];l.forEach((e,t)=>{e.forEach((e,r)=>{!l[t][r]||t<7&&r<7||t>l.length-8&&r<7||t<7&&r>l.length-8||t>p&&t<f&&r>
4873p&&r<f||g.push([t*u+u/2+i,r*u+u/2+i])})});let m={};return g.forEach(([e,t])=>{m[e]?m[e]?.push(t):m[e]=[t]}),Object.entries(m).map(([e,t])=>{let r=t.filter(e=>t.every(t=>!s(e,t,u)));return[Number(e),r]}).forEach(([e,t])=>{t.forEach(t=>{c.push((0,n.YP)`<circle cx=${e} cy=${t} fill=${a} r=${u/2.5} />`)})}),Object.entries(m).filter(([e,t])=>t.length>1).map(([e,t])=>{let r=t.filter(e=>t.some(t=>s(e,t,u)));return[Number(e),r]}).map(([e,t])=>{t.sort((e,t)=>e<t?-1:1);let r=[];for(let e of t){let t=r.find(t=>t.some(t=>s(e,t,u)));t?t.push(e):r.push([e])}return[e,r.map(e=>[e[0],e[e.length-1]])]}).forEach(([e,t])=>{t.forEach(([t,r])=>{c.push((0,n.YP)`
4874              <line
4875                x1=${e}
4876                x2=${e}
4877                y1=${t}
4878                y2=${r}
4879                stroke=${a}
4880                stroke-width=${u/1.25}
4881                stroke-linecap="round"
4882              />
4883            `)})}),c}};var c=r(70169),l=r(66704),u=r(73718),d=(0,u.iv)`
4884  :host {
4885    position: relative;
4886    user-select: none;
4887    display: block;
4888    overflow: hidden;
4889    aspect-ratio: 1 / 1;
4890    width: 100%;
4891    height: 100%;
4892    background-color: ${({tokens:e})=>e.theme.backgroundInvert};
4893    color: ${({tokens:e})=>e.theme.textInvert};
4894  }
4895
4896  :host {
4897    border-radius: ${({borderRadius:e})=>e[4]};
4898    display: flex;
4899    align-items: center;
4900    justify-content: center;
4901  }
4902
4903  :host([data-clear='true']) > wui-icon {
4904    display: none;
4905  }
4906
4907  svg:first-child,
4908  wui-image,
4909  wui-icon {
4910    position: absolute;
4911    top: 50%;
4912    left: 50%;
4913    transform: translateY(-50%) translateX(-50%);
4914    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
4915    box-shadow: inset 0 0 0 4px ${({tokens:e})=>e.theme.backgroundPrimary};
4916    border-radius: ${({borderRadius:e})=>e[6]};
4917  }
4918
4919  wui-image {
4920    width: 25%;
4921    height: 25%;
4922    border-radius: ${({borderRadius:e})=>e[2]};
4923  }
4924
4925  wui-icon {
4926    width: 100%;
4927    height: 100%;
4928    color: #3396ff !important;
4929    transform: translateY(-50%) translateX(-50%) scale(0.25);
4930  }
4931
4932  wui-icon > svg {
4933    width: inherit;
4934    height: inherit;
4935  }
4936`,h=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let p=class extends n.oi{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`--local-size: ${this.size}px`,(0,n.dy)`<wui-flex
4937      alignItems="center"
4938      justifyContent="center"
4939      class="wui-qr-code"
4940      direction="column"
4941      gap="4"
4942      width="100%"
4943      style="height: 100%"
4944    >
4945      ${this.templateVisual()} ${this.templateSvg()}
4946    </wui-flex>`}templateSvg(){return(0,n.YP)`
4947      <svg height=${this.size} width=${this.size}>
4948        ${a.generate({uri:this.uri,size:this.size,logoSize:this.arenaClear?0:this.size/4})}
4949      </svg>
4950    `}templateVisual(){return this.imageSrc?(0,n.dy)`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?(0,n.dy)`<wui-icon
4951        class="farcaster"
4952        size="inherit"
4953        color="inherit"
4954        name="farcaster"
4955      ></wui-icon>`:(0,n.dy)`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};p.styles=[c.ET,d],h([(0,i.Cb)()],p.prototype,"uri",void 0),h([(0,i.Cb)({type:Number})],p.prototype,"size",void 0),h([(0,i.Cb)()],p.prototype,"theme",void 0),h([(0,i.Cb)()],p.prototype,"imageSrc",void 0),h([(0,i.Cb)()],p.prototype,"alt",void 0),h([(0,i.Cb)({type:Boolean})],p.prototype,"arenaClear",void 0),h([(0,i.Cb)({type:Boolean})],p.prototype,"farcaster",void 0),h([(0,l.M)("wui-qr-code")],p)},31330:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(18749);var o=r(70169),s=r(66704),a=r(73718),c=(0,a.iv)`
4956  :host {
4957    position: relative;
4958    display: flex;
4959    width: 100%;
4960    height: 1px;
4961    background-color: ${({tokens:e})=>e.theme.borderPrimary};
4962    justify-content: center;
4963    align-items: center;
4964  }
4965
4966  :host > wui-text {
4967    position: absolute;
4968    padding: 0px 8px;
4969    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
4970    transition: background-color ${({durations:e})=>e.lg}
4971      ${({easings:e})=>e["ease-out-power-2"]};
4972    will-change: background-color;
4973  }
4974`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{constructor(){super(...arguments),this.text=""}render(){return(0,n.dy)`${this.template()}`}template(){return this.text?(0,n.dy)`<wui-text variant="md-regular" color="secondary">${this.text}</wui-text>`:null}};u.styles=[o.ET,c],l([(0,i.Cb)()],u.prototype,"text",void 0),l([(0,s.M)("wui-separator")],u)},41626:function(e,t,r){"use strict";r(20958)},73316:function(e,t,r){"use strict";r(35407)},22939:function(e,t,r){"use strict";r(18749)},56306:function(e,t,r){"use strict";var n=r(19045);r(92706),r(18749),r(43845);var i=r(92784),o=r(70169),s=r(66704),a=r(73718),c=(0,a.iv)`
4975  .reown-logo {
4976    height: 24px;
4977  }
4978
4979  a {
4980    text-decoration: none;
4981    cursor: pointer;
4982    color: ${({tokens:e})=>e.theme.textSecondary};
4983  }
4984
4985  a:hover {
4986    opacity: 0.9;
4987  }
4988`;let l=class extends n.oi{render(){return(0,n.dy)`
4989      <a
4990        data-testid="ux-branding-reown"
4991        href=${i.Ub}
4992        rel="noreferrer"
4993        target="_blank"
4994        style="text-decoration: none;"
4995      >
4996        <wui-flex
4997          justifyContent="center"
4998          alignItems="center"
4999          gap="1"
5000          .padding=${["01","0","3","0"]}
5001        >
5002          <wui-text variant="sm-regular" color="inherit"> UX by </wui-text>
5003          <wui-icon name="reown" size="inherit" class="reown-logo"></wui-icon>
5004        </wui-flex>
5005      </a>
5006    `}};l.styles=[o.ET,o.ZM,c],function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);o>3&&s&&Object.defineProperty(t,r,s)}([(0,s.M)("wui-ux-by-reown")],l)},59675:function(e,t,r){"use strict";var n=r(19045),i=r(94836);let o=(0,n.YP)`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
5007  <rect width="64" height="64" fill="#F7931A"/>
5008  <g clip-path="url(#clip0_1045_17)">
5009    <path d="M63.0394 39.7409C58.7654 56.8839 41.4024 67.3169 24.2574 63.0419C7.11937 58.7679 -3.31363 41.4039 0.962367 24.2619C5.23437 7.11686 22.5974 -3.31714 39.7374 0.956863C56.8814 5.23086 67.3134 22.5969 63.0394 39.7409Z" fill="#F7931A"/>
5010    <path d="M46.1092 27.4409C46.7462 23.1829 43.5042 20.8939 39.0712 19.3669L40.5092 13.5989L36.9982 12.7239L35.5982 18.3399C34.6752 18.1099 33.7272 17.8929 32.7852 17.6779L34.1952 12.0249L30.6862 11.1499L29.2472 16.9159C28.4832 16.7419 27.7332 16.5699 27.0052 16.3889L27.0092 16.3709L22.1672 15.1619L21.2332 18.9119C21.2332 18.9119 23.8382 19.5089 23.7832 19.5459C25.2052 19.9009 25.4622 20.8419 25.4192 21.5879L23.7812 28.1589C23.8792 28.1839 24.0062 28.2199 24.1462 28.2759C24.0292 28.2469 23.9042 28.2149 23.7752 28.1839L21.4792 37.3889C21.3052 37.8209 20.8642 38.4689 19.8702 38.2229C19.9052 38.2739 17.3182 37.5859 17.3182 37.5859L15.5752 41.6049L20.1442 42.7439C20.9942 42.9569 21.8272 43.1799 22.6472 43.3899L21.1942 49.2239L24.7012 50.0989L26.1402 44.3269C27.0982 44.5869 28.0282 44.8269 28.9382 45.0529L27.5042 50.7979L31.0152 51.6729L32.4682 45.8499C38.4552 46.9829 42.9572 46.5259 44.8522 41.1109C46.3792 36.7509 44.7762 34.2359 41.6262 32.5959C43.9202 32.0669 45.6482 30.5579 46.1092 27.4409ZM38.0872 38.6899C37.0022 43.0499 29.6612 40.6929 27.2812 40.1019L29.2092 32.3729C31.5892 32.9669 39.2212 34.1429 38.0872 38.6899ZM39.1732 27.3779C38.1832 31.3439 32.0732 29.3289 30.0912 28.8349L31.8392 21.8249C33.8212 22.3189 40.2042 23.2409 39.1732 27.3779Z" fill="white"/>
5011  </g>
5012  <defs>
5013    <clipPath id="clip0_1045_17">
5014      <rect width="64" height="64" fill="white"/>
5015    </clipPath>
5016  </defs>
5017</svg>
5018`,s=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5019  <rect width="60" height="60" fill="#1DC956" rx="30" />
5020  <circle cx="30" cy="30" r="3" fill="#fff" />
5021  <path
5022    fill="#2BEE6C"
5023    stroke="#fff"
5024    stroke-width="2"
5025    d="m45.32 17.9-.88-.42.88.42.02-.05c.1-.2.21-.44.26-.7l-.82-.15.82.16a2 2 0 0 0-.24-1.4c-.13-.23-.32-.42-.47-.57a8.42 8.42 0 0 1-.04-.04l-.04-.04a2.9 2.9 0 0 0-.56-.47l-.51.86.5-.86a2 2 0 0 0-1.4-.24c-.26.05-.5.16-.69.26l-.05.02-15.05 7.25-.1.05c-1.14.55-1.85.89-2.46 1.37a7 7 0 0 0-1.13 1.14c-.5.6-.83 1.32-1.38 2.45l-.05.11-7.25 15.05-.02.05c-.1.2-.21.43-.26.69a2 2 0 0 0 .24 1.4l.85-.5-.85.5c.13.23.32.42.47.57l.04.04.04.04c.15.15.34.34.56.47a2 2 0 0 0 1.41.24l-.2-.98.2.98c.25-.05.5-.17.69-.26l.05-.02-.42-.87.42.87 15.05-7.25.1-.05c1.14-.55 1.85-.89 2.46-1.38a7 7 0 0 0 1.13-1.13 12.87 12.87 0 0 0 1.43-2.56l7.25-15.05Z"
5026  />
5027  <path
5028    fill="#1DC956"
5029    d="M33.38 32.72 30.7 29.3 15.86 44.14l.2.2a1 1 0 0 0 1.14.2l15.1-7.27a3 3 0 0 0 1.08-4.55Z"
5030  />
5031  <path
5032    fill="#86F999"
5033    d="m26.62 27.28 2.67 3.43 14.85-14.85-.2-.2a1 1 0 0 0-1.14-.2l-15.1 7.27a3 3 0 0 0-1.08 4.55Z"
5034  />
5035  <circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)" />
5036  <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
5037</svg> `,a=(0,n.YP)`<svg viewBox="0 0 60 60" fill="none">
5038  <g clip-path="url(#clip0_7734_50402)">
5039    <path
5040      d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
5041      fill="#EB8B47"
5042    />
5043    <path
5044      d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
5045      stroke="#062B2B"
5046      stroke-opacity="0.1"
5047    />
5048    <path
5049      d="M19 52C24.5228 52 29 47.5228 29 42C29 36.4772 24.5228 32 19 32C13.4772 32 9 36.4772 9 42C9 47.5228 13.4772 52 19 52Z"
5050      fill="#FF974C"
5051      stroke="white"
5052      stroke-width="2"
5053    />
5054    <path
5055      fill-rule="evenodd"
5056      clip-rule="evenodd"
5057      d="M42.8437 8.3264C42.4507 7.70891 41.5493 7.70891 41.1564 8.32641L28.978 27.4638C28.5544 28.1295 29.0326 29.0007 29.8217 29.0007H54.1783C54.9674 29.0007 55.4456 28.1295 55.022 27.4638L42.8437 8.3264Z"
5058      fill="white"
5059    />
5060    <path
5061      fill-rule="evenodd"
5062      clip-rule="evenodd"
5063      d="M42.3348 11.6456C42.659 11.7608 42.9061 12.1492 43.4005 12.926L50.7332 24.4488C51.2952 25.332 51.5763 25.7737 51.5254 26.1382C51.4915 26.3808 51.3698 26.6026 51.1833 26.7614C50.9031 27 50.3796 27 49.3327 27H34.6673C33.6204 27 33.0969 27 32.8167 26.7614C32.6302 26.6026 32.5085 26.3808 32.4746 26.1382C32.4237 25.7737 32.7048 25.332 33.2669 24.4488L40.5995 12.926C41.0939 12.1492 41.341 11.7608 41.6652 11.6456C41.8818 11.5687 42.1182 11.5687 42.3348 11.6456ZM35.0001 26.999C38.8661 26.999 42.0001 23.865 42.0001 19.999C42.0001 23.865 45.1341 26.999 49.0001 26.999H35.0001Z"
5064      fill="#FF974C"
5065    />
5066    <path
5067      d="M10.1061 9.35712C9.9973 9.67775 9.99867 10.0388 9.99978 10.3323C9.99989 10.3611 10 10.3893 10 10.4167V25.5833C10 25.6107 9.99989 25.6389 9.99978 25.6677C9.99867 25.9612 9.9973 26.3222 10.1061 26.6429C10.306 27.2317 10.7683 27.694 11.3571 27.8939C11.6777 28.0027 12.0388 28.0013 12.3323 28.0002C12.3611 28.0001 12.3893 28 12.4167 28H19C24.5228 28 29 23.5228 29 18C29 12.4772 24.5228 8 19 8H12.4167C12.3893 8 12.3611 7.99989 12.3323 7.99978C12.0388 7.99867 11.6778 7.9973 11.3571 8.10614C10.7683 8.306 10.306 8.76834 10.1061 9.35712Z"
5068      fill="#FF974C"
5069      stroke="white"
5070      stroke-width="2"
5071    />
5072    <circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
5073    <circle cx="19" cy="42" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
5074  </g>
5075  <defs>
5076    <clipPath id="clip0_7734_50402">
5077      <rect width="60" height="60" fill="white" />
5078    </clipPath>
5079  </defs>
5080</svg> `,c=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5081  <g clip-path="url(#a)">
5082    <path
5083      fill="#1DC956"
5084      d="M0 25.01c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02.11 15.65.11 24.9.11h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.13 60 15.76 60 25v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-3.45 1.97-8.08 1.97-17.33 1.97H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 49.1 0 44.46 0 35.21v-10.2Z"
5085    />
5086    <path
5087      fill="#2BEE6C"
5088      d="M16.1 60c-3.82-.18-6.4-.64-8.53-1.86a15 15 0 0 1-5.6-5.6C.55 50.06.16 46.97.04 41.98L4.2 40.6a4 4 0 0 0 2.48-2.39l4.65-12.4a2 2 0 0 1 2.5-1.2l2.53.84a2 2 0 0 0 2.43-1l2.96-5.94a2 2 0 0 1 3.7.32l3.78 12.58a2 2 0 0 0 3.03 1.09l3.34-2.23a2 2 0 0 0 .65-.7l5.3-9.72a2 2 0 0 1 1.42-1.01l4.14-.69a2 2 0 0 1 1.6.44l3.9 3.24a2 2 0 0 0 2.7-.12l4.62-4.63c.08 2.2.08 4.8.08 7.93v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-2.13 1.22-4.7 1.68-8.54 1.86H16.11Z"
5089    />
5090    <path
5091      fill="#fff"
5092      d="m.07 43.03-.05-2.1 3.85-1.28a3 3 0 0 0 1.86-1.79l4.66-12.4a3 3 0 0 1 3.75-1.8l2.53.84a1 1 0 0 0 1.21-.5l2.97-5.94a3 3 0 0 1 5.56.48l3.77 12.58a1 1 0 0 0 1.51.55l3.34-2.23a1 1 0 0 0 .33-.35l5.3-9.71a3 3 0 0 1 2.14-1.53l4.13-.69a3 3 0 0 1 2.41.66l3.9 3.24a1 1 0 0 0 1.34-.06l5.28-5.28c.05.85.08 1.75.1 2.73L56 22.41a3 3 0 0 1-4.04.19l-3.9-3.25a1 1 0 0 0-.8-.21l-4.13.69a1 1 0 0 0-.72.5l-5.3 9.72a3 3 0 0 1-.97 1.05l-3.34 2.23a3 3 0 0 1-4.53-1.63l-3.78-12.58a1 1 0 0 0-1.85-.16l-2.97 5.94a3 3 0 0 1-3.63 1.5l-2.53-.84a1 1 0 0 0-1.25.6l-4.65 12.4a5 5 0 0 1-3.1 3L.07 43.02Z"
5093    />
5094    <path
5095      fill="#fff"
5096      fill-rule="evenodd"
5097      d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
5098      clip-rule="evenodd"
5099    />
5100    <path fill="#fff" d="M45 .28v59.66l-2 .1V.19c.7.02 1.37.05 2 .1Z" />
5101    <path fill="#2BEE6C" d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
5102    <path
5103      stroke="#fff"
5104      stroke-opacity=".1"
5105      d="M.5 25.01c0-4.63 0-8.08.24-10.8.25-2.7.73-4.64 1.66-6.28a14.5 14.5 0 0 1 5.42-5.41C9.46 1.58 11.39 1.1 14.1.85A133 133 0 0 1 24.9.61h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.67a14.5 14.5 0 0 1 5.42 5.4c.93 1.65 1.41 3.58 1.66 6.3.24 2.71.24 6.16.24 10.79v10.2c0 4.64 0 8.08-.24 10.8-.25 2.7-.73 4.65-1.66 6.28a14.5 14.5 0 0 1-5.42 5.42c-1.63.93-3.57 1.41-6.28 1.66-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.66a14.5 14.5 0 0 1-5.42-5.42C1.47 50.66 1 48.72.74 46.01A133 133 0 0 1 .5 35.2v-10.2Z"
5106    />
5107  </g>
5108  <defs>
5109    <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
5110  </defs>
5111</svg>`,l=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5112  <g clip-path="url(#a)">
5113    <rect width="60" height="60" fill="#C653C6" rx="30" />
5114    <path
5115      fill="#E87DE8"
5116      d="M57.98.01v19.5a4.09 4.09 0 0 0-2.63 2.29L50.7 34.2a2 2 0 0 1-2.5 1.2l-2.53-.84a2 2 0 0 0-2.42 1l-2.97 5.94a2 2 0 0 1-3.7-.32L32.8 28.6a2 2 0 0 0-3.02-1.09l-3.35 2.23a2 2 0 0 0-.64.7l-5.3 9.72a2 2 0 0 1-1.43 1.01l-4.13.69a2 2 0 0 1-1.61-.44l-3.9-3.24a2 2 0 0 0-2.69.12L2.1 42.93.02 43V.01h57.96Z"
5117    />
5118    <path
5119      fill="#fff"
5120      d="m61.95 16.94.05 2.1-3.85 1.28a3 3 0 0 0-1.86 1.79l-4.65 12.4a3 3 0 0 1-3.76 1.8l-2.53-.84a1 1 0 0 0-1.2.5l-2.98 5.94a3 3 0 0 1-5.55-.48l-3.78-12.58a1 1 0 0 0-1.5-.55l-3.35 2.23a1 1 0 0 0-.32.35l-5.3 9.72a3 3 0 0 1-2.14 1.52l-4.14.69a3 3 0 0 1-2.41-.66l-3.9-3.24a1 1 0 0 0-1.34.06l-5.28 5.28c-.05-.84-.08-1.75-.1-2.73l3.97-3.96a3 3 0 0 1 4.04-.19l3.89 3.25a1 1 0 0 0 .8.21l4.14-.68a1 1 0 0 0 .71-.51l5.3-9.71a3 3 0 0 1 .97-1.06l3.34-2.23a3 3 0 0 1 4.54 1.63l3.77 12.58a1 1 0 0 0 1.86.16l2.96-5.93a3 3 0 0 1 3.64-1.5l2.52.83a1 1 0 0 0 1.25-.6l4.66-12.4a5 5 0 0 1 3.1-2.99l4.43-1.48Z"
5121    />
5122    <path
5123      fill="#fff"
5124      fill-rule="evenodd"
5125      d="M35.5 27a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
5126      clip-rule="evenodd"
5127    />
5128    <path fill="#fff" d="M31 0v60h-2V0h2Z" />
5129    <path fill="#E87DE8" d="M33.5 27a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
5130  </g>
5131  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
5132  <defs>
5133    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
5134  </defs>
5135</svg> `,u=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5136  <g clip-path="url(#a)">
5137    <rect width="60" height="60" fill="#987DE8" rx="30" />
5138    <path
5139      fill="#fff"
5140      fill-rule="evenodd"
5141      d="m15.48 28.37 11.97-19.3a3 3 0 0 1 5.1 0l11.97 19.3a6 6 0 0 1 .9 3.14v.03a6 6 0 0 1-1.16 3.56L33.23 50.2a4 4 0 0 1-6.46 0L15.73 35.1a6 6 0 0 1-1.15-3.54v-.03a6 6 0 0 1 .9-3.16Z"
5142      clip-rule="evenodd"
5143    />
5144    <path
5145      fill="#643CDD"
5146      d="M30.84 10.11a1 1 0 0 0-.84-.46V24.5l12.6 5.53a2 2 0 0 0-.28-1.4L30.84 10.11Z"
5147    />
5148    <path
5149      fill="#BDADEB"
5150      d="M30 9.65a1 1 0 0 0-.85.46L17.66 28.64a2 2 0 0 0-.26 1.39L30 24.5V9.65Z"
5151    />
5152    <path
5153      fill="#643CDD"
5154      d="M30 50.54a1 1 0 0 0 .8-.4l11.24-15.38c.3-.44-.2-1-.66-.73l-9.89 5.68a3 3 0 0 1-1.5.4v10.43Z"
5155    />
5156    <path
5157      fill="#BDADEB"
5158      d="m17.97 34.76 11.22 15.37c.2.28.5.41.8.41V40.11a3 3 0 0 1-1.49-.4l-9.88-5.68c-.47-.27-.97.3-.65.73Z"
5159    />
5160    <path
5161      fill="#401AB3"
5162      d="M42.6 30.03 30 24.5v13.14a3 3 0 0 0 1.5-.4l10.14-5.83a2 2 0 0 0 .95-1.38Z"
5163    />
5164    <path
5165      fill="#7C5AE2"
5166      d="M30 37.64V24.46l-12.6 5.57a2 2 0 0 0 .97 1.39l10.13 5.82a3 3 0 0 0 1.5.4Z"
5167    />
5168  </g>
5169  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
5170  <defs>
5171    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
5172  </defs>
5173</svg> `,d=(0,n.YP)`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
5174  <rect width="64" height="64" rx="30" fill="#1DC956"/>
5175  <rect x="0.5" y="0.5" width="63" height="63" rx="29.5" stroke="#141414" stroke-opacity="0.1"/>
5176  <path d="M32.4053 19.8031C35.3901 19.8031 38.0431 20.8349 40.1619 22.8247L45.9656 17.0211C42.4465 13.7416 37.8773 11.7333 32.4053 11.7333C24.4829 11.7333 17.6475 16.2841 14.3127 22.9168L21.056 28.1493C22.6589 23.359 27.136 19.8031 32.4053 19.8031Z" fill="#1DC956" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5177  <path d="M32.4053 52.2667C37.8773 52.2667 42.465 50.4611 45.8182 47.3658L39.2407 42.2623C37.4351 43.4783 35.1321 44.2153 32.4053 44.2153C27.136 44.2153 22.6589 40.6594 21.056 35.8691L14.3127 41.1016C17.6475 47.7159 24.4829 52.2667 32.4053 52.2667Z" fill="#2BEE6C"/>
5178  <path d="M21.056 35.8507L19.5636 36.993L14.3127 41.0832M39.2407 42.2623L45.8182 47.3658C42.465 50.4611 37.8773 52.2667 32.4053 52.2667C24.4829 52.2667 17.6475 47.7159 14.3127 41.1016L21.056 35.8691C22.6589 40.6594 27.136 44.2153 32.4053 44.2153C35.1321 44.2153 37.4351 43.4783 39.2407 42.2623Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5179  <path d="M51.8613 32.4606C51.8613 31.0235 51.7323 29.6417 51.4928 28.3151H32.4053V36.1638H43.3124C42.8334 38.688 41.3963 40.8252 39.2407 42.2623L45.8181 47.3658C49.6503 43.8283 51.8613 38.6327 51.8613 32.4606Z" fill="#1FAD7E" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5180  <path d="M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" fill="#86F999"/>
5181  <path d="M21.056 35.8691L14.3127 41.1016M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5182</svg>
5183`,h=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5184  <rect width="60" height="60" fill="#1DC956" rx="3" />
5185  <path
5186    fill="#1FAD7E"
5187    stroke="#fff"
5188    stroke-width="2"
5189    d="m30.49 29.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
5190  />
5191  <path
5192    fill="#2BEE6C"
5193    stroke="#fff"
5194    stroke-width="2"
5195    d="m30.49 19.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
5196  />
5197  <path
5198    fill="#86F999"
5199    stroke="#fff"
5200    stroke-width="2"
5201    d="m46.69 21.06-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-6.32-3.51-.18-.1c-2.33-1.3-3.72-2.06-5.22-2.33a9 9 0 0 0-3.08 0c-1.5.27-2.9 1.04-5.22 2.33l-.17.1-6.33 3.51-.05.03c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18
5201-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45Z"
5202  />
5203  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
5204</svg>`,p=(0,n.YP)`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
5205  <g clip-path="url(#clip0_241_31636)">
5206    <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58318 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58318 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9269C60.4784 58.4159 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4159 2.1019 55.9269C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#794CFF"/>
5207    <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
5208    <path d="M40 39.4595C44.7824 36.693 48 31.5222 48 25.6C48 16.7634 40.8366 9.59998 32 9.59998C23.1634 9.59998 16 16.7634 16 25.6C16 31.5222 19.2176 36.693 24 39.4595V45.8144H40V39.4595Z" fill="#906EF7"/>
5209    <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#906EF7"/>
5210    <path d="M24 45.8144V39.4595C19.2176 36.693 16 31.5222 16 25.6C16 16.7634 23.1634 9.59998 32 9.59998C40.8366 9.59998 48 16.7634 48 25.6C48 31.5222 44.7824 36.693 40 39.4595V45.8144M24 45.8144H40M24 45.8144V49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5211    <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#643CDD" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5212    <path d="M29.6735 26.9101V29.1109H34.0753V26.9101C34.0753 25.6945 35.0607 24.7092 36.2762 24.7092C37.4917 24.7092 38.4771 25.6945 38.4771 26.9101C38.4771 28.1256 37.4917 29.1109 36.2762 29.1109H34.0753H29.6735H27.4726C26.2571 29.1109 25.2717 28.1256 25.2717 26.9101C25.2717 25.6945 26.2571 24.7092 27.4726 24.7092C28.6881 24.7092 29.6735 25.6945 29.6735 26.9101Z" fill="#906EF7"/>
5213    <path d="M29.6735 45.3183V26.9101C29.6735 25.6945 28.6881 24.7092 27.4726 24.7092V24.7092C26.2571 24.7092 25.2717 25.6945 25.2717 26.9101V26.9101C25.2717 28.1256 26.2571 29.1109 27.4726 29.1109H36.2762C37.4917 29.1109 38.4771 28.1256 38.4771 26.9101V26.9101C38.4771 25.6945 37.4917 24.7092 36.2762 24.7092V24.7092C35.0607 24.7092 34.0753 25.6945 34.0753 26.9101V45.3183" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5214  </g>
5215  <defs>
5216    <clipPath id="clip0_241_31636">
5217      <rect width="64" height="64" fill="white"/>
5218    </clipPath>
5219  </defs>
5220</svg>
5221`,f=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5222  <rect width="60" height="60" fill="#C653C6" rx="3" />
5223  <path
5224    fill="#fff"
5225    d="M20.03 15.22C20 15.6 20 16.07 20 17v2.8c0 1.14 0 1.7-.2 2.12-.15.31-.3.5-.58.71-.37.28-1.06.42-2.43.7-.59.12-1.11.29-1.6.51a9 9 0 0 0-4.35 4.36C10 30 10 32.34 10 37c0 4.66 0 7 .84 8.8a9 9 0 0 0 4.36 4.36C17 51 19.34 51 24 51h12c4.66 0 7 0 8.8-.84a9 9 0 0 0 4.36-4.36C50 44 50 41.66 50 37c0-4.66 0-7-.84-8.8a9 9 0 0 0-4.36-4.36c-.48-.22-1-.39-1.6-.5-1.36-.29-2.05-.43-2.42-.7-.27-.22-.43-.4-.58-.72-.2-.42-.2-.98-.2-2.11V17c0-.93 0-1.4-.03-1.78a9 9 0 0 0-8.19-8.19C31.4 7 30.93 7 30 7s-1.4 0-1.78.03a9 9 0 0 0-8.19 8.19Z"
5226  />
5227  <path
5228    fill="#E87DE8"
5229    d="M22 17c0-.93 0-1.4.04-1.78a7 7 0 0 1 6.18-6.18C28.6 9 29.07 9 30 9s1.4 0 1.78.04a7 7 0 0 1 6.18 6.18c.04.39.04.85.04 1.78v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.4-.08-1.78a4 4 0 0 0-3.14-3.14C31.39 12 30.93 12 30 12s-1.4 0-1.78.08a4 4 0 0 0-3.14 3.14c-.08.39-.08.85-.08 1.78v4.5a1.5 1.5 0 0 1-3 0V17Z"
5230  />
5231  <path
5232    fill="#E87DE8"
5233    fill-rule="evenodd"
5234    d="M12 36.62c0-4.32 0-6.48.92-8.09a7 7 0 0 1 2.61-2.61C17.14 25 19.3 25 23.62 25h6.86c.46 0 .7 0 .9.02 2.73.22 4.37 2.43 4.62 4.98.27-2.7 2.11-5 5.02-5A6.98 6.98 0 0 1 48 31.98v5.4c0 4.32 0 6.48-.92 8.09a7 7 0 0 1-2.61 2.61c-1.61.92-3.77.92-8.09.92h-5.86c-.46 0-.7 0-.9-.02-2.73-.22-4.37-2.43-4.62-4.98-.26 2.58-1.94 4.82-4.71 4.99l-.7.01c-.55 0-.82 0-1.05-.02a7 7 0 0 1-6.52-6.52c-.02-.23-.02-.5-.02-1.05v-4.79Zm21.24-.27a4 4 0 1 0-6.48 0 31.28 31.28 0 0 1 1.57 2.23c.17.4.17.81.17 1.24V42.5a1.5 1.5 0 0 0 3 0V39.82c0-.43 0-.85.17-1.24.09-.2.58-.87 1.57-2.23Z"
5235    clip-rule="evenodd"
5236  />
5237  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
5238</svg>`,g=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5239  <g clip-path="url(#a)">
5240    <path
5241      fill="#EB8B47"
5242      d="M0 24.9c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02 0 15.65 0 24.9 0h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.02 60 15.65 60 24.9v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6C48.98 60 44.35 60 35.1 60H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 48.98 0 44.35 0 35.1V24.9Z"
5243    />
5244    <path
5245      stroke="#062B2B"
5246      stroke-opacity=".1"
5247      d="M.5 24.9c0-4.64 0-8.08.24-10.8.25-2.7.73-4.65 1.66-6.28A14.5 14.5 0 0 1 7.82 2.4C9.46 1.47 11.39 1 14.1.74A133 133 0 0 1 24.9.5h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.66a14.5 14.5 0 0 1 5.42 5.42c.93 1.63 1.41 3.57 1.66 6.28.24 2.72.24 6.16.24 10.8v10.2c0 4.63 0 8.08-.24 10.8-.25 2.7-.73 4.64-1.66 6.28a14.5 14.5 0 0 1-5.42 5.41c-1.63.94-3.57 1.42-6.28 1.67-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.67a14.5 14.5 0 0 1-5.42-5.4C1.47 50.53 1 48.6.74 45.88A133 133 0 0 1 .5 35.1V24.9Z"
5248    />
5249    <path
5250      fill="#FF974C"
5251      stroke="#fff"
5252      stroke-width="2"
5253      d="M39.2 29.2a13 13 0 1 0-18.4 0l1.3 1.28a12.82 12.82 0 0 1 2.1 2.39 6 6 0 0 1 .6 1.47c.2.76.2 1.56.2 3.17v11.24c0 1.08 0 1.61.13 2.12a4 4 0 0 0 .41.98c.26.45.64.83 1.4 1.6l.3.29c.65.65.98.98 1.36 1.09.26.07.54.07.8 0 .38-.11.7-.44 1.36-1.1l3.48-3.47c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.47-.48c-.
525365-.65-.98-.98-1.09-1.36a1.5 1.5 0 0 1 0-.8c.1-.38.44-.7 1.1-1.36l.47-.48c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.48-.5c-.65-.64-.98-.97-1.08-1.35a1.5 1.5 0 0 1 0-.79c.1-.38.42-.7 1.06-1.36l5.46-5.55Z"
5254    />
5255    <circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2" />
5256  </g>
5257  <defs>
5258    <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
5259  </defs>
5260</svg> `,m=(0,n.YP)`<svg width="40" height="42" viewBox="0 0 40 42" fill="none">
5261<path opacity="0.7" d="M19.9526 41.9076L7.3877 34.655V26.1226L19.9526 33.3751V41.9076Z" fill="url(#paint0_linear_2113_32117)"/>
5262<path opacity="0.7" d="M19.9521 41.9076L32.5171 34.655V26.1226L19.9521 33.3751V41.9076Z" fill="url(#paint1_linear_2113_32117)"/>
5263<path opacity="0.7" d="M39.9095 7.34521V21.8562L32.5166 26.1225V11.6114L39.9095 7.34521Z" fill="url(#paint2_linear_2113_32117)"/>
5264<path d="M39.9099 7.34536L27.345 0.0927734L19.9521 4.359L32.5171 11.6116L39.9099 7.34536Z" fill="url(#paint3_linear_2113_32117)"/>
5265<path d="M0 7.34536L12.5649 0.0927734L19.9519 4.359L7.387 11.6116L0 7.34536Z" fill="#F969D3"/>
5266<path opacity="0.7" d="M0 7.34521V21.8562L7.387 26.1225V11.6114L0 7.34521Z" fill="url(#paint4_linear_2113_32117)"/>
5267<defs>
5268<linearGradient id="paint0_linear_2113_32117" x1="18.6099" y1="41.8335" x2="7.73529" y2="8.31842" gradientUnits="userSpaceOnUse">
5269<stop stop-color="#E98ADA"/>
5270<stop offset="1" stop-color="#7E4DBD"/>
5271</linearGradient>
5272<linearGradient id="paint1_linear_2113_32117" x1="26.2346" y1="26.1226" x2="26.2346" y2="41.9076" gradientUnits="userSpaceOnUse">
5273<stop stop-color="#719DED"/>
5274<stop offset="1" stop-color="#2545BE"/>
5275</linearGradient>
5276<linearGradient id="paint2_linear_2113_32117" x1="36.213" y1="7.34521" x2="36.213" y2="26.1225" gradientUnits="userSpaceOnUse">
5277<stop stop-color="#93EBFF"/>
5278<stop offset="1" stop-color="#197DDB"/>
5279</linearGradient>
5280<linearGradient id="paint3_linear_2113_32117" x1="29.931" y1="0.0927734" x2="38.2156" y2="14.8448" gradientUnits="userSpaceOnUse">
5281<stop stop-color="#F969D3"/>
5282<stop offset="1" stop-color="#4F51C0"/>
5283</linearGradient>
5284<linearGradient id="paint4_linear_2113_32117" x1="18.1251" y1="44.2539" x2="-7.06792" y2="15.2763" gradientUnits="userSpaceOnUse">
5285<stop stop-color="#E98ADA"/>
5286<stop offset="1" stop-color="#7E4DBD"/>
5287</linearGradient>
5288</defs>
5289</svg>`,y=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5290  <g clip-path="url(#a)">
5291    <rect width="60" height="60" fill="#00ACE6" rx="30" />
5292    <circle cx="64" cy="39" r="50" fill="#1AC6FF" stroke="#fff" stroke-width="2" />
5293    <circle cx="78" cy="30" r="50" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
5294    <circle cx="72" cy="15" r="35" fill="#80DFFF" stroke="#fff" stroke-width="2" />
5295    <circle cx="34" cy="-17" r="45" stroke="#fff" stroke-width="2" />
5296    <circle cx="34" cy="-5" r="50" stroke="#fff" stroke-width="2" />
5297    <circle cx="30" cy="45" r="4" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
5298    <circle cx="39.5" cy="27.5" r="4" fill="#80DFFF" stroke="#fff" stroke-width="2" />
5299    <circle cx="16" cy="24" r="4" fill="#19C6FF" stroke="#fff" stroke-width="2" />
5300  </g>
5301  <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
5302  <defs>
5303    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
5304  </defs>
5305</svg>`,b=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5306  <g clip-path="url(#a)">
5307    <rect width="60" height="60" fill="#C653C6" rx="3" />
5308    <path
5309      fill="#E87DE8"
5310      stroke="#fff"
5311      stroke-width="2"
5312      d="M52.1 47.34c0-4.24-1.44-9.55-5.9-12.4a2.86 2.86 0 0 0-1.6-3.89v-.82c0-1.19-.52-2.26-1.35-3a4.74 4.74 0 0 0-2.4-6.26v-5.5a11.31 11.31 0 1 0-22.63 0v2.15a3.34 3.34 0 0 0-1.18 5.05 4.74 4.74 0 0 0-.68 6.44A5.22 5.22 0 0 0 14 35.92c-3.06 4.13-6.1 8.3-6.1 15.64 0 2.67.37 4.86.74 6.39a20.3 20.3 0 0 0 .73 2.39l.02.04v.01l.92-.39-.92.4.26.6h38.26l.3-.49-.87-.51.86.5.02-.01.03-.07a16.32 16.32 0 0 0 .57-1.05c.36-.72.85-1.74 1.33-2.96a25.51 25.51 0 0 0 1.94-9.07Z"
5313    />
5314    <path
5315      fill="#fff"
5316      fill-rule="evenodd"
5317      d="M26.5 29.5c-3-.5-5.5-3-5.5-7v-7c0-.47 0-.7.03-.9a3 3 0 0 1 2.58-2.57c.2-.03.42-.03.89-.03 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.4 0 2.1 0 2.65.23a3 3 0 0 1 1.62 1.62c.23.55.23 1.25.23 2.65v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.5 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z"
5318      clip-rule="evenodd"
5319    />
5320  </g>
5321  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
5322  <defs>
5323    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="3" /></clipPath>
5324  </defs>
5325</svg> `,w=(0,n.YP)`<svg fill="none" viewBox="0 0 60 60">
5326  <rect width="60" height="60" fill="#794CFF" rx="3" />
5327  <path
5328    fill="#987DE8"
5329    stroke="#fff"
5330    stroke-width="2"
5331    d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"
5332  />
5333  <path fill="#fff" d="M37.5 25h10v10h-10z" />
5334  <path fill="#4019B2" d="M42.5 25h5v10h-5z" />
5335  <path fill="#fff" d="M19.5 25h10v10h-10z" />
5336  <path fill="#4019B2" d="M24.5 25h5v10h-5z" />
5337  <path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z" />
5338  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
5339</svg>
5339`,v=(0,n.YP)`<svg width="60" height="60" viewBox="0 0 60 60" fill="none">
5340<g clip-path="url(#clip0_13859_31161)">
5341  <path d="M0 24.8995C0 15.6481 0 11.0223 1.97053 7.56763C3.3015 5.2342 5.23468 3.30101 7.56812 1.97004C11.0228 -0.000488281 15.6485 -0.000488281 24.9 -0.000488281H35.1C44.3514 -0.000488281 48.9772 -0.000488281 52.4319 1.97004C54.7653 3.30101 56.6985 5.2342 58.0295 7.56763C60 11.0223 60 15.6481 60 24.8995V35.0995C60 44.351 60 48.9767 58.0295 52.4314C56.6985 54.7648 54.7653 56.698 52.4319 58.029C48.9772 59.9995 44.3514 59.9995 35.1 59.9995H24.9C15.6485 59.9995 11.0228 59.9995 7.56812 58.029C5.23468 56.698 3.3015 54.7648 1.97053 52.4314C0 48.9767 0 44.351 0 35.0995V24.8995Z" fill="#EB8B47"/>
5342  <path d="M0.5 24.8995C0.5 20.2647 0.50047 16.8216 0.744315 14.1045C0.987552 11.3941 1.46987 9.45455 2.40484 7.81536C3.69145 5.55971 5.56019 3.69096 7.81585 2.40435C9.45504 1.46938 11.3946 0.987064 14.105 0.743826C16.8221 0.499981 20.2652 0.499512 24.9 0.499512H35.1C39.7348 0.499512 43.1779 0.499981 45.895 0.743826C48.6054 0.987064 50.545 1.46938 52.1841 2.40435C54.4398 3.69096 56.3086 5.55971 57.5952 7.81536C58.5301 9.45455 59.0124 11.3941 59.2557 14.1045C59.4995 16.8216 59.5 20.2647 59.5 24.8995V35.0995C59.5 39.7343 59.4995 43.1774 59.2557 45.8945C59.0124 48.6049 58.5301 50.5445 57.5952 52.1837C56.3086 54.4393 54.4398 56.3081 52.1841 57.5947C50.545 58.5296 48.6054 59.012 45.895 59.2552C43.1779 59.499 39.7348 59.4995 35.1 59.4995H24.9C20.2652 59.4995 16.8221 59.499 14.105 59.2552C11.3946 59.012 9.45504 58.5296 7.81585 57.5947C5.56019 56.3081 3.69145 54.4393 2.40484 52.1837C1.46987 50.5445 0.987552 48.6049 0.744315 45.8945C0.50047 43.1774 0.5 39.7343 0.5 35.0995V24.8995Z" stroke="#141414" stroke-opacity="0.1"/>
5343  <path d="M13 26.0335C13 21.7838 13 19.659 14.0822 18.1694C14.4318 17.6883 14.8548 17.2653 15.3359 16.9157C16.8255 15.8335 18.9503 15.8335 23.2 15.8335H36.8C41.0497 15.8335 43.1745 15.8335 44.6641 16.9157C45.1452 17.2653 45.5682 17.6883 45.9178 18.1694C47 19.659 47 21.7838 47 26.0335V33.9668C47 38.2165 47 40.3414 45.9178 41.831C45.5682 42.312 45.1452 42.7351 44.6641 43.0846C43.1745 44.1668 41.0497 44.1668 36.8 44.1668H23.2C18.9503 44.1668 16.8255 44.1668 15.3359 43.0846C14.8548 42.7351 14.4318 42.312 14.0822 41.831C13 40.3414 13 38.2165 13 33.9668V26.0335Z" fill="#FF974C" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5344  <path d="M39.5 36.667H36.6666" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
5345  <path d="M45.2 23.0645H14.8C14.0501 23.0645 13.6751 23.0645 13.4122 23.2554C13.3273 23.3171 13.2527 23.3918 13.191 23.4767C13 23.7395 13 24.1145 13 24.8645V27.2645C13 28.0144 13 28.3894 13.191 28.6522C13.2527 28.7371 13.3273 28.8118 13.4122 28.8735C13.6751 29.0645 14.0501 29.0645 14.8 29.0645H45.2C45.9499 29.0645 46.3249 29.0645 46.5878 28.8735C46.6727 28.8118 46.7473 28.7371 46.809 28.6522C47 28.3894 47 28.0144 47 27.2645V24.8645C47 24.1145 47 23.7395 46.809 23.4767C46.7473 23.3918 46.6727 23.3171 46.5878 23.2554C46.3249 23.0645 45.9499 23.0645 45.2 23.0645Z" fill="white" fill-opacity="0.4" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5346</g>
5347<defs>
5348  <clipPath id="clip0_13859_31161">
5349    <rect width="60" height="60" fill="white"/>
5350  </clipPath>
5351</defs>
5352</svg>`,C=(0,n.YP)`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
5353  <g clip-path="url(#clip0_241_31635)">
5354    <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58317 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58317 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9268C60.4784 58.4158 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4158 2.1019 55.9268C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#EB8B47"/>
5355    <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199
5355C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
5356    <path d="M28.1042 49.2329L13.1024 51.2077L15.0772 36.2059L37.1015 14.1815C39.2441 12.039 40.3154 10.9677 41.5718 10.624C42.4205 10.3918 43.3159 10.3918 44.1645 10.624C45.421 10.9677 46.4922 12.039 48.6348 14.1815L50.1286 15.6753C52.2711 17.8179 53.3424 18.8891 53.6861 20.1456C53.9183 20.9942 53.9183 21.8896 53.6861 22.7383C53.3424 23.9947 52.2711 25.066 50.1286 27.2086L28.1042 49.2329Z" fill="#FF974C" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5357    <path d="M38.5962 20.5376L22.4199 36.7139" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5358    <path d="M43.7727 25.714L27.5964 41.8903" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5359    <path d="M22.3703 36.7635C19.3258 39.808 16.0198 36.6395 16.2616 35.0324" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5360    <path d="M27.5466 41.9399C24.5034 44.9831 28.155 48.7098 29.2738 48.0475" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5361    <path d="M27.5468 41.9398C23.428 46.0586 18.2516 40.8822 22.3704 36.7634" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5362    <path d="M15.8191 50.5214C15.4711 49.5823 14.728 48.8392 13.7889 48.4912" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5363    <path d="M49.2862 29.5805L34.7275 15.0219" stroke="#E4E7E7" stroke-width="2" stroke-linejoin="round"/>
5364  </g>
5365  <defs>
5366    <clipPath id="clip0_241_31635">
5367      <rect width="64" height="64" fill="white"/>
5368    </clipPath>
5369  </defs>
5370</svg>
5371`,E=(0,n.YP)`<svg
5372  viewBox="0 0 60 60"
5373  fill="none"
5374>
5375  <g clip-path="url(#1)">
5376    <rect width="60" height="60" rx="30" fill="#00ACE6" />
5377    <path
5378      d="M59 73C59 89.0163 46.0163 102 30 102C13.9837 102 1 89.0163 1 73C1 56.9837 12 44 30 44C48 44 59 56.9837 59 73Z"
5379      fill="#1AC6FF"
5380      stroke="white"
5381      stroke-width="2"
5382    />
5383    <path
5384      d="M18.6904 19.9015C19.6264 15.3286 23.3466 11.8445 27.9708 11.2096C29.3231 11.024 30.6751 11.0238 32.0289 11.2096C36.6532 11.8445 40.3733 15.3286 41.3094 19.9015C41.4868 20.7681 41.6309 21.6509 41.7492 22.5271C41.8811 23.5041 41.8811 24.4944 41.7492 25.4715C41.6309 26.3476 41.4868 27.2304 41.3094 28.097C40.3733 32.6699 36.6532 36.154 32.0289 36.7889C30.6772 36.9744 29.3216 36.9743 27.9708 36.7889C23.3466 36.154 19.6264 32.6699 18.6904 28.097C18.513 27.2304 18.3689 26.3476 18.2506 25.4715C18.1186 24.4944 18.1186 23.5041 18.2506 22.5271C18.3689 21.6509 18.513 20.7681 18.6904 19.9015Z"
5385      fill="#1AC6FF"
5386      stroke="white"
5387      stroke-width="2"
5388    />
5389    <circle cx="24.5" cy="23.5" r="1.5" fill="white" />
5390    <circle cx="35.5" cy="23.5" r="1.5" fill="white" />
5391    <path
5392      d="M31 20L28 28H32"
5393      stroke="white"
5394      stroke-width="2"
5395      stroke-linecap="round"
5396      stroke-linejoin="round"
5397    />
5398  </g>
5399  <rect x="0.5" y="0.5" width="59" height="59" rx="29.5" stroke="white" stroke-opacity="0.1" />
5400  <defs>
5401    <clipPath id="1">
5402      <rect width="60" height="60" rx="30" fill="white" />
5403    </clipPath>
5404  </defs>
5405</svg> `,x=(0,n.YP)`<svg fill="none" viewBox="0 0 80 80">
5406  <g clip-path="url(#a)">
5407    <path fill="url(#b)" d="M40 80a40 40 0 1 0 0-80 40 40 0 0 0 0 80Z" />
5408    <path
5409      stroke="#fff"
5410      stroke-opacity=".1"
5411      d="M79.5 40a39.5 39.5 0 1 1-79 0 39.5 39.5 0 0 1 79 0Z"
5412    />
5413    <path
5414      fill="#fff"
5415      d="m62.62 51.54-7.54 7.91a1.75 1.75 0 0 1-1.29.55H18.02a.9.9 0 0 1-.8-.52.84.84 0 0 1 .16-.92l7.55-7.92a1.75 1.75 0 0 1 1.28-.55h35.77a.87.87 0 0 1 .8.52.84.84 0 0 1-.16.93Zm-7.54-15.95a1.75 1.75 0 0 0-1.29-.54H18.02a.89.89 0 0 0-.8.51.84.84 0 0 0 .16.93l7.55 7.92a1.75 1.75 0 0 0 1.28.54h35.77a.89.89 0 0 0 .8-.51.84.84 0 0 0-.16-.93l-7.54-7.92ZM18.02 29.9h35.77a1.79 1.79 0 0 0 1.29-.54l7.54-7.92a.85.85 0 0 0 .16-.93.87.87 0 0 0-.8-.51H26.21a1.79 1.79 0 0 0-1.28.54l-7.55 7.92a.85.85 0 0 0-.16.93.89.89 0 0 0 .8.52Z"
5416    />
5417  </g>
5418  <defs>
5419    <linearGradient id="b" x1="6.75" x2="80.68" y1="81.91" y2="7.37" gradientUnits="userSpaceOnUse">
5420      <stop offset=".08" stop-color="#9945FF" />
5421      <stop offset=".3" stop-color="#8752F3" />
5422      <stop offset=".5" stop-color="#5497D5" />
5423      <stop offset=".6" stop-color="#43B4CA" />
5424      <stop offset=".72" stop-color="#28E0B9" />
5425      <stop offset=".97" stop-color="#19FB9B" />
5426    </linearGradient>
5427    <clipPath id="a"><path fill="#fff" d="M0 0h80v80H0z" /></clipPath>
5428  </defs>
5429</svg> `,A=(0,n.YP)`<svg viewBox="0 0 60 60" fill="none">
5430  <g clip-path="url(#1)">
5431    <path
5432      d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
5433      fill="#794CFF"
5434    />
5435    <path
5436      d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
5437      stroke="#062B2B"
5438      stroke-opacity="0.1"
5439    />
5440    <path
5441      d="M35.1403 31.5016C35.1193 30.9637 35.388 30.4558 35.8446 30.1707C36.1207 29.9982 36.4761 29.8473 36.7921 29.7685C37.3143 29.6382 37.8664 29.7977 38.2386 30.1864C38.8507 30.8257 39.3004 31.6836 39.8033 32.408C40.2796 33.0942 41.4695 33.2512 41.9687 32.5047C42.4839 31.7341 42.9405 30.8229 43.572 30.1399C43.9375 29.7447 44.4866 29.5756 45.0111 29.6967C45.3283 29.7701 45.6863 29.9147 45.9655 30.0823C46.4269 30.3595 46.7045 30.8626 46.6928 31.4008C46.6731 32.3083 46.3764 33.2571 46.2158 34.1473C46.061 35.0048 46.9045 35.8337 47.7592 35.664C48.6464 35.4878 49.5899 35.1747 50.497 35.1391C51.0348 35.1181 51.5427 35.3868 51.8279 35.8433C52.0004 36.1195 52.1513 36.4749 52.2301 36.7908C52.3604 37.3131 52.2009 37.8651 51.8121 38.2374C51.1729 38.8495 50.3151 39.2991 49.5908 39.8019C48.9046 40.2782 48.7473 41.4683 49.4939 41.9675C50.2644 42.4827 51.1757 42.9393 51.8587 43.5708C52.2539 43.9362 52.423 44.4854 52.3018 45.0099C52.2285 45.3271 52.0839 45.6851 51.9162 45.9642C51.6391 46.4257 51.1359 46.7032 50.5978 46.6916C49.6903 46.6719 48.7417 46.3753 47.8516 46.2146C46.9939 46.0598 46.1648 46.9035 46.3346 47.7583C46.5108 48.6454 46.8239 49.5888 46.8594 50.4958C46.8805 51.0336 46.6117 51.5415 46.1552 51.8267C45.879 51.9992 45.5236 52.15 45.2077 52.2289C44.6854 52.3592 44.1334 52.1997 43.7611 51.8109C43.1491 51.1718 42.6996 50.314 42.1968 49.5897C41.7203 48.9034 40.5301 48.7463 40.0309 49.493C39.5157 50.2634 39.0592 51.1746 38.4278 51.8574C38.0623 52.2527 37.5132 52.4218 36.9887 52.3006C36.6715 52.2273 36.3135 52.0826 36.0343 51.915C35.5729 51.6379 35.2953 51.1347 35.307 50.5966C35.3267 49.6891 35.6233 48.7405 35.7839 47.8505C35.9388 46.9928 35.0951 46.1636 34.2402 46.3334C33.3531 46.5096 32.4098 46.8227 31.5028 46.8582C30.9649 46.8793 30.457 46.6105 30.1719 46.154C29.9994 45.8778 29.8485 45.5224 29.7697 45.2065C29.6394 44.6842 29.7989 44.1322 30.1877 43.7599C30.8269 43.1479 31.6847 42.6982 32.4091 42.1954C33.0954 41.7189 33.2522 40.5289 32.5056 40.0297C31.7351 39.5145 30.824 39.058 30.1411 38.4265C29.7459 38.0611 29.5768 37.5119 29.698 36.9875C29.7713 36.6702 29.9159 36.3122 30.0836 36.0331C30.3607 35.5
5441717 30.8638 35.2941 31.402 35.3058C32.3095 35.3255 33.2583 35.6221 34.1485 35.7828C35.006 35.9376 35.8349 35.094 35.6652 34.2393C35.489 33.3521 35.1759 32.4087 35.1403 31.5016Z"
5442      fill="#906EF7"
5443      stroke="white"
5444      stroke-width="2"
5445    />
5446    <path
5447      d="M20.7706 8.22357C20.9036 7.51411 21.5231 7 22.2449 7H23.7551C24.4769 7 25.0964 7.51411 25.2294 8.22357C25.5051 9.69403 25.4829 11.6321 27.1202 12.2606C27.3092 12.3331 27.4958 12.4105 27.6798 12.4926C29.2818 13.2072 30.6374 11.8199 31.8721 10.9752C32.4678 10.5676 33.2694 10.6421 33.7798 11.1525L34.8477 12.2204C35.3581 12.7308 35.4326 13.5323 35.025 14.128C34.1802 15.3627 32.7931 16.7183 33.5077 18.3202C33.5898 18.5043 33.6672 18.6909 33.7398 18.88C34.3683 20.5171 36.3061 20.4949 37.7764 20.7706C38.4859 20.9036 39 21.5231 39 22.2449V23.7551C39 24.4769 38.4859 25.0964 37.7764 25.2294C36.3061 25.5051 34.3685 25.483 33.7401 27.1201C33.6675 27.3093 33.59 27.4961 33.5079 27.6803C32.7934 29.282 34.1803 30.6374 35.025 31.8719C35.4326 32.4677 35.3581 33.2692 34.8477 33.7796L33.7798 34.8475C33.2694 35.3579 32.4678 35.4324 31.8721 35.0248C30.6376 34.1801 29.2823 32.7934 27.6806 33.508C27.4962 33.5903 27.3093 33.6678 27.12 33.7405C25.483 34.3688 25.5051 36.3062 25.2294 37.7764C25.0964 38.4859 24.4769 39 23.7551 39H22.2449C21.5231 39 20.9036 38.4859 20.7706 37.7764C20.4949 36.3062 20.517 34.3688 18.88 33.7405C18.6908 33.6678 18.5039 33.5903 18.3196 33.5081C16.7179 32.7936 15.3625 34.1804 14.1279 35.0251C13.5322 35.4327 12.7307 35.3582 12.2203 34.8478L11.1524 33.7799C10.642 33.2695 10.5675 32.4679 10.9751 31.8722C11.8198 30.6376 13.2067 29.2822 12.4922 27.6804C12.41 27.4962 12.3325 27.3093 12.2599 27.1201C11.6315 25.483 9.69392 25.5051 8.22357 25.2294C7.51411 25.0964 7 24.4769 7 23.7551V22.2449C7 21.5231 7.51411 20.9036 8.22357 20.7706C9.69394 20.4949 11.6317 20.5171 12.2602 18.88C12.3328 18.6909 12.4103 18.5042 12.4924 18.3201C13.207 16.7181 11.8198 15.3625 10.975 14.1278C10.5674 13.5321 10.6419 12.7305 11.1523 12.2201L12.2202 11.1522C12.7306 10.6418 13.5322 10.5673 14.1279 10.9749C15.3626 11.8197 16.7184 13.2071 18.3204 12.4925C18.5044 12.4105 18.6909 12.3331 18.8799 12.2606C20.5171 11.6321 20.4949 9.69403 20.7706 8.22357Z"
5448      fill="#906EF7"
5449      stroke="white"
5450      stroke-width="2"
5451    />
5452    <circle cx="23" cy="23" r="6" fill="#794CFF" stroke="white" stroke-width="2" />
5453    <circle cx="41" cy="41" r="4" fill="#794CFF" stroke="white" stroke-width="2" />
5454  </g>
5455  <defs>
5456    <clipPath id="1">
5457      <rect width="60" height="60" fill="white" />
5458    </clipPath>
5459  </defs>
5460</svg> `;var S=r(70169),_=r(66704),I=(0,n.iv)`
5461  :host {
5462    display: block;
5463    width: var(--local-size);
5464    height: var(--local-size);
5465  }
5466
5467  :host svg {
5468    width: 100%;
5469    height: 100%;
5470  }
5471`,k=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let O={browser:s,dao:a,defi:c,defiAlt:l,eth:u,layers:h,lock:f,login:g,network:y,nft:b,noun:w,profile:E,system:A,meld:m,onrampCard:v,google:d,pencil:C,lightbulb:p,solana:x,bitcoin:o},N=class extends n.oi{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=`
5472       --local-size: var(--apkt-visual-size-${this.size});
5473   `,(0,n.dy)`${O[this.name]}`}};N.styles=[S.ET,I],k([(0,i.Cb)()],N.prototype,"name",void 0),k([(0,i.Cb)()],N.prototype,"size",void 0),k([(0,_.M)("wui-visual")],N)},65050:function(e,t,r){"use strict";r(38023)},8102:function(e,t,r){"use strict";r.d(t,{W:function(){return i}});var n=r(19045);let i=(0,n.YP)`<svg  viewBox="0 0 48 54" fill="none">
5474  <path
5475    d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
5476  />
5477</svg>`},92706:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(77859);let s=Symbol.for(""),a=e=>{if(e?.r===s)return e?._$litStatic$},c=e=>({_$litStatic$:e,r:s}),l=new Map,u=e=>(t,...r)=>{let n,i;let o=r.length,s=[],c=[],u,d=0,h=!1;for(;d<o;){for(u=t[d];d<o&&void 0!==(n=a(i=r[d]));)u+=n+t[++d],h=!0;d!==o&&c.push(i),s.push(u),d++}if(d===o&&s.push(t[o]),h){let e=s.join("$$lit$$");void 0===(t=l.get(e))&&(s.raw=s,l.set(e,t=s)),r=c}return e(t,...r)},d=u(o.dy);u(o.YP),u(o.cV);let h=(0,n.YP)`<svg width="30" height="30" viewBox="0 0 30 30" fill="none">
5478  <g clip-path="url(#clip0_87_33)">
5479    <path d="M23.9367 2.29447e-07H6.05917C5.26333 -0.000218805 4.47526 0.156384 3.73997 0.46086C3.00469 0.765337 2.33661 1.21172 1.77391 1.7745C1.21121 2.33727 0.7649
547917 3.00542 0.460542 3.74074C0.156167 4.47607 -0.000327963 5.26417 5.16031e-07 6.06V23.9433C4.48257e-07 24.7389 0.156744 25.5267 0.461276 26.2617C0.765808 26.9967 1.21216 27.6645 1.77484 28.2269C2.33752 28.7894 3.0055 29.2355 3.74061 29.5397C4.47573 29.8439 5.26358 30.0003 6.05917 30H23.9417C25.5486 29.9996 27.0895 29.3609 28.2257 28.2245C29.3618 27.0881 30 25.5469 30 23.94V6.06C29.9993 4.45241 29.3602 2.91091 28.2232 1.77449C27.0861 0.638064 25.5443 -0.000220881 23.9367 2.29447e-07Z" fill="url(#paint0_linear_87_33)"/>
5480    <path d="M14.8708 6.89259L15.4783 5.84259C15.5679 5.68703 15.6873 5.55064 15.8296 5.44122C15.9719 5.3318 16.1344 5.25148 16.3078 5.20486C16.4812 5.15824 16.662 5.14622 16.8401 5.1695C17.0181 5.19277 17.1898 5.25088 17.3453 5.34051C17.5009 5.43013 17.6373 5.54952 17.7467 5.69186C17.8561 5.83419 17.9364 5.99669 17.9831 6.17006C18.0297 6.34344 18.0417 6.5243 18.0184 6.70232C17.9952 6.88034 17.9371 7.05203 17.8474 7.20759L11.9949 17.3401H16.2283C17.5999 17.3401 18.3691 18.9526 17.7724 20.0701H5.36159C5.18215 20.0707 5.00436 20.0359 4.83845 19.9675C4.67254 19.8992 4.5218 19.7986 4.39492 19.6718C4.26803 19.5449 4.16751 19.3941 4.09915 19.2282C4.03079 19.0623 3.99593 18.8845 3.99659 18.7051C3.99659 17.9476 4.60492 17.3401 5.36159 17.3401H8.84159L13.2958 9.61926L11.9041 7.20426C11.738 6.89096 11.7 6.52543 11.7982 6.18469C11.8963 5.84395 12.1229 5.5546 12.4301 5.37763C12.7374 5.20065 13.1014 5.14987 13.4454 5.23599C13.7893 5.3221 14.0864 5.53838 14.2741 5.83926L14.8708 6.89259ZM9.60659 21.4759L8.29409 23.7526C8.20446 23.9082 8.08506 24.0446 7.94271 24.1541C7.80035 24.2636 7.63783 24.344 7.46441 24.3906C7.291 24.4373 7.11009 24.4493 6.93202 24.4261C6.75395 24.4028 6.58221 24.3447 6.42659 24.2551C6.27097 24.1655 6.13454 24.0461 6.02506 23.9037C5.91559 23.7613 5.83523 23.5988 5.78857 23.4254C5.74191 23.252 5.72986 23.0711 5.75311 22.893C5.77637 22.715 5.83446 22.5432 5.92409 22.3876L6.89909 20.7001C8.00159 20.3584 8.89742 20.6209 9.60659 21.4759ZM20.9066 17.3476H24.4583C25.2158 17.3476 25.8233 17.9551 25.8233 18.7126C25.8233 19.4701 25.2149 20.0776 24.4583 20.0776H22.4858L23.8166 22.3876C24.1916 23.0443 23.9708 23.8726 23.3149 24.2551C23.0006 24.4359 22.6274 24.4845 22.2772 24.3903C21.927 24.2961 21.6286 24.0667 21.4474 23.7526C19.2058 19.8643 17.5216 16.9534 16.4041 15.0151C15.2608 13.0426 16.0783 11.0626 16.8841 10.3909C17.7799 11.9293 19.1191 14.2501 20.9074 17.3476H20.9066Z" fill="white"/>
5481  </g>
5482  <defs>
5483    <linearGradient id="paint0_linear_87_33" x1="15" y1="2.29447e-07" x2="15" y2="30" gradientUnits="userSpaceOnUse">
5484      <stop stop-color="#18BFFB"/>
5485      <stop offset="1" stop-color="#2072F3"/>
5486    </linearGradient>
5487    <clipPath id="clip0_87_33">
5488      <rect width="30" height="30" fill="white"/>
5489    </clipPath>
5490  </defs>
5491</svg>`,p=(0,n.YP)`<svg fill="none" viewBox="0 0 40 40">
5492  <g clip-path="url(#a)">
5493    <g clip-path="url(#b)">
5494      <circle cx="20" cy="19.89" r="20" fill="#000" />
5495      <g clip-path="url(#c)">
5496        <path
5497          fill="#fff"
5498          d="M28.77 23.3c-.69 1.99-2.75 5.52-4.87 5.56-1.4.03-1.86-.84-3.46-.84-1.61 0-2.12.81-3.45.86-2.25.1-5.72-5.1-5.72-9.62 0-4.15 2.9-6.2 5.42-6.25 1.36-.02 2.64.92 3.47.92.83 0 2.38-1.13 4.02-.97.68.03 2.6.28 3.84 2.08-3.27 2.14-2.76 6.61.75 8.25ZM24.2 7.88c-2.47.1-4.49 2.69-4.2 4.84 2.28.17 4.47-2.39 4.2-4.84Z"
5499        />
5500      </g>
5501    </g>
5502  </g>
5503  <defs>
5504    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
5505    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
5506    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
5507  </defs>
5508</svg>`,f=(0,n.YP)`
5509  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 8 11">
5510    <path
5511      fill="var(--apkt-tokens-theme-textPrimary)"
5512      d="M7.862 4.86c.159-1.064-.652-1.637-1.76-2.018l.36-1.443-.879-.218-.35 1.404c-.23-.058-.468-.112-.703-.166l.352-1.413-.877-.219-.36 1.442a29.02 29.02 0 0 1-.56-.132v-.005l-1.21-.302-.234.938s.652.15.638.158c.356.089.42.324.41.51l-.41 1.644a.715.715 0 0 1 .09.03l-.092-.024-.574 2.302c-.044.108-.154.27-.402.208.008.013-.639-.16-.639-.16L.227 8.403l1.142.285c.213.053.42.109.626.161l-.363 1.459.877.218.36-1.443c.239.065.472.125.7.
5512182l-.36 1.436.879.219.363-1.456c1.497.283 2.623.17 3.097-1.185.381-1.09-.02-1.719-.807-2.129.574-.132 1.006-.51 1.12-1.289ZM5.856 7.673c-.272 1.09-2.107.5-2.702.353l.482-1.933c.595.149 2.503.443 2.22 1.58Zm.271-2.829c-.247.992-1.775.488-2.27.365l.436-1.753c.496.124 2.092.354 1.834 1.388Z"
5513    />
5514  </svg>
5515`,g=(0,n.YP)`<svg width="30" height="30" viewBox="0 0 30 30" fill="none">
5516<path d="M14.9978 7.80003H27.4668C26.2032 5.61107 24.3857 3.79333 22.1968 2.52955C20.008 1.26577 17.525 0.600485 14.9975 0.600586C12.47 0.600687 9.98712 1.26617 7.79838 2.53012C5.60964 3.79408 3.79221 5.61197 2.52881 7.80103L8.76281 18.599L8.76881 18.598C8.13412 17.5044 7.79906 16.2628 7.79743 14.9983C7.79579 13.7339 8.12764 12.4914 8.7595 11.3961C9.39136 10.3008 10.3009 9.39159 11.3963 8.76005C12.4918 8.12851 13.7344 7.79702 14.9988 7.79903L14.9978 7.80003Z" fill="url(#paint0_linear_87_32)"/>
5517<path d="M21.237 18.5981L15.003 29.3961C17.5305 29.3961 20.0134 28.7308 22.2022 27.467C24.391 26.2032 26.2086 24.3854 27.4721 22.1965C28.7356 20.0075 29.4006 17.5245 29.4003 14.997C29.3999 12.4695 28.7342 9.9867 27.47 7.7981H15.002L15 7.8041C16.2642 7.80168 17.5067 8.13257 18.6022 8.76342C19.6977 9.39428 20.6076 10.3028 21.2401 11.3974C21.8726 12.492 22.2053 13.734 22.2048 14.9982C22.2042 16.2623 21.8704 17.504 21.237 18.5981Z" fill="url(#paint1_linear_87_32)"/>
5518<path d="M8.76502 18.601L2.53102 7.80298C1.26664 9.99172 0.600848 12.4748 0.600586 15.0025C0.600324 17.5302 1.2656 20.0134 2.52953 22.2024C3.79345 24.3914 5.61145 26.209 7.80071 27.4725C9.98998 28.736 12.4733 29.4008 15.001 29.4L21.236 18.602L21.232 18.598C20.6022 19.6941 19.6944 20.6049 18.6003 21.2383C17.5062 21.8717 16.2644 22.2055 15.0002 22.2059C13.7359 22.2063 12.4939 21.8733 11.3994 21.2406C10.3049 20.6079 9.39657 19.6977 8.76602 18.602L8.76502 18.601Z" fill="url(#paint2_linear_87_32)"/>
5519<path d="M14.9998 22.2C16.9094 22.2 18.7407 21.4415 20.091 20.0912C21.4412 18.741 22.1998 16.9096 22.1998 15C22.1998 13.0905 21.4412 11.2591 20.091 9.90888C18.7407 8.55862 16.9094 7.80005 14.9998 7.80005C13.0902 7.80005 11.2589 8.55862 9.90864 9.90888C8.55837 11.2591 7.7998 13.0905 7.7998 15C7.7998 16.9096 8.55837 18.741 9.90864 20.0912C11.2589 21.4415 13.0902 22.2 14.9998 22.2Z" fill="white"/>
5520<path d="M14.9998 20.7C16.5115 20.7 17.9614 20.0995 19.0303 19.0306C20.0993 17.9616 20.6998 16.5118 20.6998 15C20.6998 13.4883 20.0993 12.0385 19.0303 10.9695C17.9614 9.90058 16.5115 9.30005 14.9998 9.30005C13.4881 9.30005 12.0383 9.90058 10.9693 10.9695C9.90034 12.0385 9.2998 13.4883 9.2998 15C9.2998 16.5118 9.90034 17.9616 10.9693 19.0306C12.0383 20.0995 13.4881 20.7 14.9998 20.7Z" fill="#1A73E8"/>
5521<defs>
5522  <linearGradient id="paint0_linear_87_32" x1="3.29381" y1="2.99503" x2="38.0998" y2="2.99503" gradientUnits="userSpaceOnUse">
5523    <stop stop-color="#D93025"/>
5524    <stop offset="1" stop-color="#EA4335"/>
5525  </linearGradient>
5526  <linearGradient id="paint1_linear_87_32" x1="17.953" y1="29.1431" x2="34.194" y2="-0.298904" gradientUnits="userSpaceOnUse">
5527    <stop stop-color="#FCC934"/>
5528    <stop offset="1" stop-color="#FBBC04"/>
5529  </linearGradient>
5530  <linearGradient id="paint2_linear_87_32" x1="22.873" y1="28.2" x2="6.63202" y2="-1.24102" gradientUnits="userSpaceOnUse">
5531    <stop stop-color="#1E8E3E"/>
5532    <stop offset="1" stop-color="#34A853"/>
5533  </linearGradient>
5534</defs>
5535</svg>`,m=(0,n.YP)` <svg fill="none" viewBox="0 0 13 4">
5536  <path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
5537</svg>`,y=(0,n.YP)`<svg fill="none" viewBox="0 0 40 40">
5538  <g clip-path="url(#a)">
5539    <g clip-path="url(#b)">
5540      <circle cx="20" cy="19.89" r="20" fill="#5865F2" />
5541      <path
5542        fill="#fff"
5543        fill-rule="evenodd"
5544        d="M25.71 28.15C30.25 28 32 25.02 32 25.02c0-6.61-2.96-11.98-2.96-11.98-2.96-2.22-5.77-2.15-5.77-2.15l-.29.32c3.5 1.07 5.12 2.61 5.12 2.61a16.75 16.75 0 0 0-10.34-1.93l-.35.04a15.43 15.43 0 0 0-5.88 1.9s1.71-1.63 5.4-2.7l-.2-.24s-2.81-.07-5.77 2.15c0 0-2.96 5.37-2.96 11.98 0 0 1.73 2.98 6.27 3.13l1.37-1.7c-2.6-.79-3.6-2.43-3.6-2.43l.58.35.09.06.08.04.02.01.08.05a17.25 17.25 0 0 0 4.52 1.58 14.4 14.4 0 0 0 8.3-.86c.72-.27 1.52-.66 2.37-1.21 0 0-1.03 1.68-3.72 2.44.61.78 1.35 1.67 1.35 1.67Zm-9.55-9.6c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28.01-1.25-.93-2.28-2.1-2.28Zm7.5 0c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28 0-1.25-.93-2.28-2.1-2.28Z"
5545        clip-rule="evenodd"
5546      />
5547    </g>
5548  </g>
5549  <defs>
5550    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
5551    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
5552  </defs>
5553</svg>`,b=(0,n.YP)`<svg
5554  xmlns="http://www.w3.org/2000/svg"
5555  fill="none"
5556  viewBox="0 0 9 12"
5557>
5558  <path
5559    fill="var(--apkt-tokens-theme-textPrimary)"
5560    d="M4.666.001v4.435l3.748 1.675L4.666.001Zm0 0L.917 6.111l3.749-1.675V.001Zm0 8.984V12l3.75-5.19-3.75 2.176Zm0 3.014V8.985L.917 6.81 4.666 12Zm0-3.712 3.748-2.176-3.748-1.675v3.851Z"
5561  />
5562  <path fill="var(--apkt-tokens-theme-textPrimary)" d="m.917 6.111 3.749 2.176v-3.85L.917 6.11Z" />
5563</svg>`,w=(0,n.YP)`<svg fill="none" viewBox="0 0 16 16">
5564  <path
5565    fill="currentColor"
5566    d="M4.25 7a.63.63 0 0 0-.63.63v3.97c0 .28-.2.51-.47.54l-.75.07a.93.93 0 0 1-.9-.47A7.51 7.51 0 0 1 5.54.92a7.5 7.5 0 0 1 9.54 4.62c.12.35.06.72-.16 1-.74.97-1.68 1.78-2.6 2.44V4.44a.64.64 0 0 0-.63-.64h-1.06c-.35 0-.63.3-.63.64v5.5c0 .23-.12.42-.32.5l-.52.23V6.05c0-.36-.3-.64-.64-.64H7.45c-.35 0-.64.3-.64.64v4.97c0 .25-.17.46-.4.52a5.8 5.8 0 0 0-.45.11v-4c0-.36-.3-.65-.64-.65H4.25ZM14.07 12.4A7.49 7.49 0 0 1 3.6 14.08c4.09-.58 9.14-2.5 11.87-6.6v.03a7.56 7.56 0 0 1-1.41 4.91Z"
5567  />
5568</svg>`,v=(0,n.YP)`<svg fill="none" viewBox="0 0 40 40">
5569  <g clip-path="url(#a)">
5570    <g clip-path="url(#b)">
5571      <circle cx="20" cy="19.89" r="20" fill="#1877F2" />
5572      <g clip-path="url(#c)">
5573        <path
5574          fill="#fff"
5575          d="M26 12.38h-2.89c-.92 0-1.61.38-1.61 1.34v1.66H26l-.36 4.5H2
55751.5v12H17v-12h-3v-4.5h3V12.5c0-3.03 1.6-4.62 5.2-4.62H26v4.5Z"
5576        />
5577      </g>
5578    </g>
5579    <path
5580      fill="#1877F2"
5581      d="M40 20a20 20 0 1 0-23.13 19.76V25.78H11.8V20h5.07v-4.4c0-5.02 3-7.79 7.56-7.79 2.19 0 4.48.4 4.48.4v4.91h-2.53c-2.48 0-3.25 1.55-3.25 3.13V20h5.54l-.88 5.78h-4.66v13.98A20 20 0 0 0 40 20Z"
5582    />
5583    <path
5584      fill="#fff"
5585      d="m27.79 25.78.88-5.78h-5.55v-3.75c0-1.58.78-3.13 3.26-3.13h2.53V8.2s-2.3-.39-4.48-.39c-4.57 0-7.55 2.77-7.55 7.78V20H11.8v5.78h5.07v13.98a20.15 20.15 0 0 0 6.25 0V25.78h4.67Z"
5586    />
5587  </g>
5588  <defs>
5589    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
5590    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
5591    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
5592  </defs>
5593</svg>`,C=(0,n.YP)`<svg style="border-radius: 9999px; overflow: hidden;"  fill="none" viewBox="0 0 1000 1000">
5594  <rect width="1000" height="1000" rx="9999" ry="9999" fill="#855DCD"/>
5595  <path fill="#855DCD" d="M0 0h1000v1000H0V0Z" />
5596  <path
5597    fill="#fff"
5598    d="M320 248h354v504h-51.96V521.13h-.5c-5.76-63.8-59.31-113.81-124.54-113.81s-118.78 50-124.53 113.81h-.5V752H320V248Z"
5599  />
5600  <path
5601    fill="#fff"
5602    d="m225 320 21.16 71.46h17.9v289.09a16.29 16.29 0 0 0-16.28 16.24v19.49h-3.25a16.3 16.3 0 0 0-16.28 16.24V752h182.26v-19.48a16.22 16.22 0 0 0-16.28-16.24h-3.25v-19.5a16.22 16.22 0 0 0-16.28-16.23h-19.52V320H225Zm400.3 360.55a16.3 16.3 0 0 0-15.04 10.02 16.2 16.2 0 0 0-1.24 6.22v19.49h-3.25a16.29 16.29 0 0 0-16.27 16.24V752h182.24v-19.48a16.23 16.23 0 0 0-16.27-16.24h-3.25v-19.5a16.2 16.2 0 0 0-10.04-15 16.3 16.3 0 0 0-6.23-1.23v-289.1h17.9L775 320H644.82v360.55H625.3Z"
5603  />
5604</svg>`,E=(0,n.YP)`<svg fill="none" viewBox="0 0 40 40">
5605  <g clip-path="url(#a)">
5606    <g clip-path="url(#b)">
5607      <circle cx="20" cy="19.89" r="20" fill="#1B1F23" />
5608      <g clip-path="url(#c)">
5609        <path
5610          fill="#fff"
5611          d="M8 19.89a12 12 0 1 1 15.8 11.38c-.6.12-.8-.26-.8-.57v-3.3c0-1.12-.4-1.85-.82-2.22 2.67-.3 5.48-1.31 5.48-5.92 0-1.31-.47-2.38-1.24-3.22.13-.3.54-1.52-.12-3.18 0 0-1-.32-3.3 1.23a11.54 11.54 0 0 0-6 0c-2.3-1.55-3.3-1.23-3.3-1.23a4.32 4.32 0 0 0-.12 3.18 4.64 4.64 0 0 0-1.24 3.22c0 4.6 2.8 5.63 5.47 5.93-.34.3-.65.83-.76 1.6-.69.31-2.42.84-3.5-1 0 0-.63-1.15-1.83-1.23 0 0-1.18-.02-.09.73 0 0 .8.37 1.34 1.76 0 0 .7 2.14 4.03 1.41v2.24c0 .31-.2.68-.8.57A12 12 0 0 1 8 19.9Z"
5612        />
5613      </g>
5614    </g>
5615  </g>
5616  <defs>
5617    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
5618    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
5619    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
5620  </defs>
5621</svg>`,x=(0,n.YP)`<svg fill="none" viewBox="0 0 40 40">
5622  <path
5623    fill="#4285F4"
5624    d="M32.74 20.3c0-.93-.08-1.81-.24-2.66H20.26v5.03h7a6 6 0 0 1-2.62 3.91v3.28h4.22c2.46-2.27 3.88-5.6 3.88-9.56Z"
5625  />
5626  <path
5627    fill="#34A853"
5628    d="M20.26 33a12.4 12.4 0 0 0 8.6-3.14l-4.22-3.28a7.74 7.74 0 0 1-4.38 1.26 7.76 7.76 0 0 1-7.28-5.36H8.65v3.36A12.99 12.99 0 0 0 20.26 33Z"
5629  />
5630  <path
5631    fill="#FBBC05"
5632    d="M12.98 22.47a7.79 7.79 0 0 1 0-4.94v-3.36H8.65a12.84 12.84 0 0 0 0 11.66l3.37-2.63.96-.73Z"
5633  />
5634  <path
5635    fill="#EA4335"
5636    d="M20.26 12.18a7.1 7.1 0 0 1 4.98 1.93l3.72-3.72A12.47 12.47 0 0 0 20.26 7c-5.08 0-9.47 2.92-11.6 7.17l4.32 3.36a7.76 7.76 0 0 1 7.28-5.35Z"
5637  />
5638</svg>`,A=(0,n.YP)` <svg width="27" height="30" viewBox="0 0 27 30" fill="none">
5639  <path d="M12.5395 14.3237L0.116699 27.5049V27.5188C0.251527 28.0177 0.49972 28.4788 0.841941 28.866C1.18416 29.2533 1.61117 29.5563 2.0897 29.7515C2.56823 29.9467 3.08536 30.0287 3.60081 29.9913C4.11625 29.9538 4.61609 29.7979 5.06139 29.5356L5.0975 29.512L19.0718 21.4519L12.5395 14.3237Z" fill="#EA4335"/>
5640  <path d="M25.103 12.0833L25.0919 12.0722L19.0611 8.57202L12.2607 14.6279L19.0847 21.4504L25.0919 17.9864C25.6229 17.6983 26.0665 17.2725 26.376 16.7537C26.6854 16.2349 26.8493 15.6422 26.8505 15.0381C26.8516 14.434 26.6899 13.8408 26.3824 13.3208C26.0749 12.8008 25.633 12.3734 25.103 12.0833Z" fill="#FBBC04"/>
5641  <path d="M0.116672 2.49553C0.047224 2.7761 0 3.05528 0 3.35946V26.6537C0 26.9565 0.0347234 27.237 0.116672 27.5162L12.959 14.6725L0.116672 2.49553Z" fill="#4285F4"/>
5642  <path d="M12.634 15.0001L19.0607 8.57198L5.0975 0.477133C4.65115 0.210463 4.14916 0.0506574 3.63079 0.0102139C3.11242 -0.0302296 2.59172 0.0497852 2.10941 0.244001C1.6271 0.438216 1.19625 0.741368 0.850556 1.12975C0.504864 1.51813 
56420.253698 1.98121 0.116699 2.48279L12.634 15.0001Z" fill="#34A853"/>
5643</svg>`,S=(0,n.YP)`<svg width="75" height="20" viewBox="0 0 75 20" fill="none" xmlns="http://www.w3.org/2000/svg">
5644<path d="M11.6666 5.83334C11.6666 2.61168 14.2783 0 17.5 0H25.8334C29.055 0 31.6666 2.61168 31.6666 5.83334V14.1666C31.6666 17.3883 29.055 20 25.8334 20H17.5C14.2783 20 11.6666 17.3883 11.6666 14.1666V5.83334Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
5645<path d="M19.5068 13.7499L22.4309 5.83331H23.2895L20.3654 13.7499H19.5068Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5646<path d="M0 5.41666C0 2.42513 2.42513 0 5.41666 0C8.40821 0 10.8334 2.42513 10.8334 5.41666V14.5833C10.8334 17.5748 8.40821 20 5.41666 20C2.42513 20 0 17.5748 0 14.5833V5.41666Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
5647<path d="M4.89581 12.4997V11.458H5.93747V12.4997H4.89581Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5648<path d="M32.5 10C32.5 4.47715 36.6896 0 41.8578 0H65.6422C70.8104 0 75 4.47715 75 10C75 15.5229 70.8104 20 65.6422 20H41.8578C36.6896 20 32.5 15.5229 32.5 10Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
5649<path d="M61.7108 12.4475V7.82751H62.5266V8.52418C62.8199 8.01084 63.4157 7.70834 64.0757 7.70834C65.0749 7.70834 65.7715 8.34084 65.7715 9.56918V12.4475H64.9649V9.61503C64.9649 8.80831 64.5066 8.38668 63.8374 8.38668C63.1132 8.38668 62.5266 8.9642 62.5266 9.78001V12.4475H61.7108Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5650<path d="M56.5671 12.4475L55.7147 7.82748H56.4846L57.0896 11.6409L57.8871 9.12916H58.6479L59.4363 11.6134L60.0505 7.82748H60.8204L59.9679 12.4475H59.0513L58.2721 10.0458L57.4838 12.4475H56.5671Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5651<path d="M52.9636 12.5666C51.5611 12.5666 50.7361 11.5217 50.7361 10.1375C50.7361 8.76254 51.5611 7.70834 52.9636 7.70834C54.3661 7.70834 55.1911 8.76254 55.1911 10.1375C55.1911 11.5217 54.3661 12.5666 52.9636 12.5666ZM52.9636 11.8883C53.9719 11.8883 54.357 11.0266 54.357 10.1283C54.357 9.23914 53.9719 8.38668 52.9636 8.38668C51.9552 8.38668 51.5702 9.23914 51.5702 10.1283C51.5702 11.0266 51.9552 11.8883 52.9636 11.8883Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5652<path d="M47.8507 12.5666C46.494 12.5666 45.6415 11.5308 45.6415 10.1375C45.6415 8.75337 46.494 7.70834 47.8507 7.70834C48.9965 7.70834 50.0048 8.35917 49.8948 10.3483H46.4756C46.5398 11.2009 46.934 11.8975 47.8507 11.8975C48.4648 11.8975 48.8681 11.5217 49.0057 11.0908H49.8123C49.684 11.8609 48.9598 12.5666 47.8507 12.5666ZM46.494 9.73416H49.1065C49.0423 8.80831 48.6114 8.37751 47.8507 8.37751C47.0165 8.37751 46.604 8.98254 46.494 9.73416Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5653<path d="M41.7284 12.4475V7.82748H42.5625V8.60665C42.8559 8.09332 43.3601 7.82748 43.8825 7.82748H44.9917V8.60665H43.8184C43.0851 8.60665 42.5625 9.08331 42.5625 10.0092V12.4475H41.7284Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5654</svg>
5655
5656`,_=(0,n.YP)`
5657  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 8">
5658    <path
5659      fill="var(--apkt-tokens-theme-textPrimary)"
5660      d="m9.524 6.307-1.51 1.584A.35.35 0 0 1 7.76 8H.604a.178.178 0 0 1-.161-.103.168.168 0 0 1 .033-.186l1.51-1.583a.35.35 0 0 1 .256-.11h7.154c.034 0 .068.01.096.029a.168.168 0 0 1 .032.26Zm-1.51-3.189a.35.35 0 0 0-.255-.109H.604a.178.178 0 0 0-.161.103.168.168 0 0 0 .033.186l1.51 1.583a.35.35 0 0 0 .256.11h7.154a.178.178 0 0 0 .16-.104.168.168 0 0 0-.032-.185l-1.51-1.584ZM.605 1.981H7.76a.357.357 0 0 0 .256-.11L9.525.289a.17.17 0 0 0 .032-.185.173.173 0 0 0-.16-.103H2.241a.357.357 0 0 0-.256.109L.476 1.692a.17.17 0 0 0-.033.185.178.178 0 0 0 .16.103Z"
5661    />
5662  </svg>
5663`,I=(0,n.YP)`<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
5664  <g clip-path="url(#a)">
5665    <path fill="url(#b)" d="M0 0h32v32H0z"/>
5666    <path fill-rule="evenodd" clip-rule="evenodd" d="M7.034 15.252c4.975-2.167 8.293-3.596 9.953-4.287 4.74-1.971 5.725-2.314 6.366-2.325.142-.002.457.033.662.198.172.14.22.33.243.463.022.132.05.435.028.671-.257 2.7-1.368 9.248-1.933 12.27-.24 1.28-.71 1.708-1.167 1.75-.99.091-1.743-.655-2.703-1.284-1.502-.985-2.351-1.598-3.81-2.558-1.684-1.11-.592-1.721.368-2.718.252-.261 4.619-4.233 4.703-4.594.01-.045.02-.213-.08-.301-.1-.09-.246-.059-.353-.035-.15.034-2.55 1.62-7.198 4.758-.682.468-1.298.696-1.851.684-.61-.013-1.782-.344-2.653-.628-1.069-.347-1.918-.53-1.845-1.12.039-.308.462-.623 1.27-.944Z" fill="#fff"/>
5667  </g>
5668  <path d="M.5 16C.5 7.44 7.44.5 16 .5 24.56.5 31.5 7.44 31.5 16c0 8.56-6.94 15.5-15.5 15.5C7.44 31.5.5 24.56.5 16Z" stroke="#141414" stroke-opacity=".05"/>
5669  <defs>
5670    <linearGradient id="b" x1="1600" y1="0" x2="1600" y2="3176.27" gradientUnits="userSpaceOnUse">
5671      <stop stop-color="#2AABEE"/>
5672      <stop offset="1" stop-color="#229ED9"/>
5673    </linearGradient>
5674    <clipPath id="a">
5675      <path d="M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16Z" fill="#fff"/>
5676    </clipPath>
5677  </defs>
5678</svg>`,k=(0,n.YP)`<svg fill="none" viewBox="0 0 40 40">
5679  <g clip-path="url(#a)">
5680    <g clip-path="url(#b)">
5681      <circle cx="20" cy="19.89" r="20" fill="#5A3E85" />
5682      <g clip-path="url(#c)">
5683        <path
5684          fill="#fff"
5685          d="M18.22 25.7 20 23.91h3.34l2.1-2.1v-6.68H15.4v8.78h2.82v1.77Zm3.87-8.16h1.25v3.66H22.1v-3.66Zm-3.34 0H20v3.66h-1.25v-3.66ZM20 7.9a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.69 14.56-3.66 3.66h-2.72l-1.77 1.78h-1.88V26.1H13.3v-9.82l.94-2.4H26.7v8.56Z"
5686        />
5687      </g>
5688    </g>
5689  </g>
5690  <defs>
5691    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
5692    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
5693    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
5694  </defs>
5695</svg>`,O=(0,n.YP)`<svg fill="none" viewBox="0 0 16 16">
5696  <path
5697    fill="currentColor"
5698    d="m14.36 4.74.01.42c0 4.34-3.3 9.34-9.34 9.34A9.3 9.3 0 0 1 0 13.03a6.6 6.6 0 0 0 4.86-1.36 3.29 3.29 0 0 1-3.07-2.28c.5.1 1 .07 1.48-.06A3.28 3.28 0 0 1 .64 6.11v-.04c.46.26.97.4 1.49.41A3.29 3.29 0 0 1 1.11 2.1a9.32 9.32 0 0 0 6.77 3.43 3.28 3.28 0 0 1 5.6-3 6.59 6.59 0 0 0 2.08-.8 3.3 3.3 0 0 1-1.45 1.82A6.53 6.53 0 0 0 16 3.04c-.44.66-1 1.23-1.64 1.7Z"
5699  />
5700</svg>`,N=(0,n.YP)`<svg fill="none" viewBox="0 0 20 20">
5701  <path
5702    fill="currentColor"
5703    fill-rule="evenodd"
5704    d="M0 5.5c0-1.8 1.46-3.25 3.25-3.25H14.5c1.8 0 3.25 1.46 3.25 3.25v.28A3.25 3.25 0 0 1 20 8.88v2.24c0 1.45-.94 2.68-2.25 3.1v.28c0 1.8-1.46 3.25-3.25 3.25H3.25A3.25 3.25 0 0 1 0 14.5v-9Zm15.75 8.88h-2.38a4.38 4.38 0 0 1 0-8.76h2.38V5.5c0-.69-.56-1.25-1.25-1.25H3.25C2.56 4.25 2 4.81 2 5.5v9c0 .69.56 1.25 1.25 1.25H14.5c.69 0 1.25-.56 1.25-1.25v-.13Zm-2.38-6.76a2.37 2.37 0 1 0 0 4.75h3.38c.69 0 1.25-.55 1.25-1.24V8.87c0-.69-.56-1.24-1.25-1.24h-3.38Z"
5705    clip-rule="evenodd"
5706  />
5707</svg>`,P=(0,n.YP)`
5708<svg xmlns="http://www.w3.org/2000/svg" width="89" height="89" viewBox="0 0 89 89" fill="none">
5709<path d="M60.0468 39.2502L65.9116 33.3854C52.6562 20.13 36.1858 20.13 22.9304 33.3854L28.7952 39.2502C38.8764 29.169 49.9725 29.169 60.0536 39.2502H60.0468Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5710<path d="M58.0927 52.9146L44.415 39.2369L30.7373 52.9146L17.0596 39.2369L11.2017 45.0949L30.7373 64.6374L44.415 50.9597L58.0927 64.6374L77.6284 45.0949L71.7704 39.2369L58.0927 52.9146Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
5711</svg>`,T=(0,n.YP)`
5712<svg xmlns="http://www.w3.org/2000/svg" width="89" height="89" viewBox="0 0 89 89" fill="none">
5713<path d="M60.0468 39.2502L65.9116 33.3854C52.6562 20.13 36.1858 20.13 22.9304 33.3854L28.7952 39.2502C38.8764 29.169 49.9725 29.169 60.0536 39.2502H60.0468Z" fill="var(--apkt-tokens-theme-textInvert)"/>
5714<path d="M58.0927 52.9146L44.415 39.2369L30.7373 52.9146L17.0596 39.2369L11.2017 45.0949L30.7373 64.6374L44.415 50.9597L58.0927 64.6374L77.6284 45.0949L71.7704 39.2369L58.0927 52.9146Z" fill="var(--apkt-tokens-theme-textInvert)"/>
5715</svg>`,R=(0,n.YP)`
5716<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
5717<g clip-path="url(#clip0_22274_4692)">
5718<path d="M0 6.64C0 4.17295 0 2.93942 0.525474 2.01817C0.880399 1.39592 1.39592 0.880399 2.01817 0.525474C2.93942 0 4.17295 0 6.64 0H9.36C11.8271 0 13.0606 0 13.9818 0.525474C14.6041 0.880399 15.1196 1.39592 15.4745 2.01817C16 2.93942 16 4.17295 16 6.64V9.36C16 11.8271 16 13.0606 15.4745 13.9818C15.1196 14.6041 14.6041 15.1196 13.9818 15.4745C13.0606 16 11.8271 16 9.36 16H6.64C4.17295 16 2.93942 16 2.01817 15.4745C1.39592 15.1196 0.880399 14.6041 0.525474 13.9818C0 13.0606 0 11.8271 0 9.36V6.64Z" fill="#C7B994"/>
5719<path d="M4.49038 5.76609C6.42869 3.86833 9.5713 3.86833 11.5096 5.76609L11.7429 5.99449C11.8398 6.08938 11.8398 6.24323 11.7429 6.33811L10.9449 7.11942C10.8964 7.16686 10.8179 7.16686 10.7694 7.11942L10.4484 6.80512C9.09617 5.48119 6.90381 5.48119 5.5516 6.80512L5.20782 7.14171C5.15936 7.18915 5.08079 7.18915 5.03234 7.14171L4.23434 6.3604C4.13742 6.26552 4.13742 6.11167 4.23434 6.01678L4.49038 5.76609ZM13.1599 7.38192L13.8702 8.07729C13.9671 8.17217 13.9671 8.32602 13.8702 8.4209L10.6677 11.5564C10.5708 11.6513 10.4137 11.6513 10.3168 11.5564L8.04388 9.33105C8.01965 9.30733 7.98037 9.30733 7.95614 9.33105L5.6833 11.5564C5.58638 11.6513 5.42925 11.6513 5.33234 11.5564L2.12982 8.42087C2.0329 8.32598 2.0329 8.17213 2.12982 8.07724L2.84004 7.38188C2.93695 7.28699 3.09408 7.28699 3.191 7.38188L5.46392 9.60726C5.48815 9.63098 5.52743 9.63098 5.55166 9.60726L7.82447 7.38188C7.92138 7.28699 8.07851 7.28699 8.17543 7.38187L10.4484 9.60726C10.4726 9.63098 10.5119 9.63098 10.5361 9.60726L12.809 7.38192C12.9059 7.28703 13.063 7.28703 13.1599 7.38192Z" fill="currentColor"/>
5720</g>
5721<defs>
5722<clipPath id="clip0_22274_4692">
5723<path d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8Z" fill="white"/>
5724</clipPath>
5725</defs>
5726</svg>
5727`,$=(0,n.YP)`
5728<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
5729<circle cx="11" cy="11" r="11" transform="matrix(-1 0 0 1 23 1)" fill="#202020"/>
5730<circle cx="11" cy="11" r="11.5" transform="matrix(-1 0 0 1 23 1)" stroke="#C7B994" stroke-opacity="0.7"/>
5731<path d="M15.4523 11.0686L16.7472 9.78167C13.8205 6.87297 10.1838 6.87297 7.25708 9.78167L8.55201 11.0686C10.7779 8.85645 13.2279 8.85645 15.4538 11.0686H15.4523Z" fill="#C7B994"/>
5732<path d="M15.0199 14.067L12 11.0656L8.98 14.067L5.96004 11.0656L4.66663 12.3511L8.98 16.6393L12 13.638L15.0199 16.6393L19.3333 12.3511L18.0399 11.0656L15.0199 14.067Z" fill="#C7B994"/>
5733</svg>
5734`,D=(0,n.YP)`<svg fill="none" viewBox="0 0 41 40">
5735  <g clip-path="url(#a)">
5736    <path fill="#000" d="M.8 0h40v40H.8z" />
5737    <path
5738      fill="#fff"
5739      d="m22.63 18.46 7.14-8.3h-1.69l-6.2 7.2-4.96-7.2H11.2l7.5 10.9-7.5 8.71h1.7l6.55-7.61 5.23 7.61h5.72l-7.77-11.31Zm-9.13-7.03h2.6l11.98 17.13h-2.6L13.5 11.43Z"
5740    />
5741  </g>
5742  <defs>
5743    <clipPath id="a"><path fill="#fff" d="M.8 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z" /></clipPath>
5744  </defs>
5745</svg>`;var L=r(73718),M=r(70169),U=r(66704),j=(0,n.iv)`
5746  :host {
5747    display: flex;
5748    justify-content: center;
5749    align-items: center;
5750    aspect-ratio: 1 / 1;
5751    color: var(--local-color);
5752    width: var(--local-width);
5753  }
5754
5755  svg {
5756    height: inherit;
5757    width: inherit;
5758    object-fit: contain;
5759    object-position: center;
5760  }
5761`,B=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let F={add:"ph-plus",allWallets:"ph-dots-three",arrowBottom:"ph-arrow-down",arrowBottomCircle:"ph-arrow-circle-down",arrowClockWise:"ph-arrow-clockwise",arrowLeft:"ph-arrow-left",arrowRight:"ph-arrow-right",arrowTop:"ph-arrow-up",arrowTopRight:"ph-arrow-up-right",bank:"ph-bank",bin:"ph-trash",browser:"ph-browser",card:"ph-credit-card",checkmark:"ph-check",checkmarkBold:"ph-check",chevronBottom:"ph-caret-down",chevronLeft:"ph-caret-left",chevronRight:"ph-caret-right",chevronTop:"ph-caret-up",clock:"ph-clock",close:"ph-x",coinPlaceholder:"ph-circle-half",compass:"ph-compass",copy:"ph-copy",desktop:"ph-desktop",dollar:"ph-currency-dollar",download:"ph-vault",exclamationCircle:"ph-warning-circle",extension:"ph-puzzle-piece",externalLink:"ph-arrow-square-out",filters:"ph-funnel-simple",helpCircle:"ph-question",id:"ph-identification-card",image:"ph-image",info:"ph-info",lightbulb:"ph-lightbulb",mail:"ph-envelope",mobile:"ph-device-mobile",more:"ph-dots-three",networkPlaceholder:"ph-globe",nftPlaceholder:"ph-image",plus:"ph-plus",power:"ph-power",qrCode:"ph-qr-code",questionMark:"ph-question",refresh:"ph-arrow-clockwise",recycleHorizontal:"ph-arrows-clockwise",search:"ph-magnifying-glass",sealCheck:"ph-seal-check",send:"ph-paper-plane-right",signOut:"ph-sign-out",spinner:"ph-spinner",swapHorizontal:"ph-arrows-left-right",swapVertical:"ph-arrows-down-up",threeDots:"ph-dots-three",user:"ph-user",verify:"ph-seal-check",verifyFilled:"ph-seal-check",warning:"ph-warning",warningCircle:"ph-warning-circle",appStore:"",apple:"",bitcoin:"",chromeStore:"",cursor:"",discord:"",ethereum:"",etherscan:"",facebook:"",farcaster:"",github:"",google:"",playStore:"",reown:"",solana:"",telegram:"",twitch:"",twitterIcon:"",twitter:"",walletConnect:"",walletConnectBrown:"",walletConnectLightBrown:"",x:"",wallet:""},z={"ph-arrow-circle-down":()=>Promise.all([r.e(4455),r.e(7799)]).then(r.bind(r,57799)),"ph-arrow-clockwise":()=>Promise.all([r.e(4455),r.e(5200)]).then(r.bind(r,5200)),"ph-arrow-down":()=>Promise.all([r.e(4455),r.e(1003)]).then(r.bind(r,21003)),"ph-arrow-left":()=>Promise.all([r.e(4455),r.e(7136)]).then(r.bind(r,27136)),"ph-arrow-right":()=>Promise.all([r.e(4455),r.e(7619)]).then(r.bind(r,97619)),"ph-arrow-square-out":()=>Promise.all([r.e(4455),r.e(5493)]).then(r.bind(r,75493)),"ph-arrows-down-up":()=>Promise.all([r.e(4455),r.e(2947)]).then(r.bind(r,92947)),"ph-arrows-left-right":()=>Promise.all([r.e(4455),r.e(6336)]).then(r.bind(r,56336)),"ph-arrow-up":()=>Promise.all([r.e(4455),r.e(4488)]).then(r.bind(r,14488)),"ph-arrow-up-right":()=>Promise.all([r.e(4455),r.e(5762)]).then(r.bind(r,85762)),"ph-arrows-clockwise":()=>Promise.all([r.e(4455),r.e(8957)]).then(r.bind(r,18957)),"ph-bank":()=>Promise.all([r.e(4455),r.e(1261)]).then(r.bind(r,41261)),"ph-browser":()=>Promise.all([r.e(4455),r.e(6477)]).then(r.bind(r,86477)),"ph-caret-down":()=>Promise.all([r.e(4455),r.e(9769)]).then(r.bind(r,19769)),"ph-caret-left":()=>Promise.all([r.e(4455),r.e(1011)]).then(r.bind(r,81011)),"ph-caret-right":()=>Promise.all([r.e(4455),r.e(9496)]).then(r.bind(r,19496)),"ph-caret-up":()=>Promise.all([r.e(4455),r.e(3866)]).then(r.bind(r,33866)),"ph-check":()=>Promise.all([r.e(4455),r.e(8325)]).then(r.bind(r,88325)),"ph-circle-half":()=>Promise.all([r.e(4455),r.e(3422)]).then(r.bind(r,43422)),"ph-clock":()=>Promise.all([r.e(4455),r.e(3655)]).then(r.bind(r,3655)),"ph-compass":()=>Promise.all([r.e(4455),r.e(7348)]).then(r.bind(r,37348)),"ph-copy":()=>Promise.all([r.e(4455),r.e(5602)]).then(r.bind(r,35602)),"ph-credit-card":()=>Promise.all([r.e(4455),r.e(1756)]).then(r.bind(r,81756)),"ph-currency-dollar":()=>Promise.all([r.e(4455),r.e(2331)]).then(r.bind(r,92331)),"ph-desktop":()=>Promise.all([r.e(4455),r.e(302)]).then(r.bind(r,60302)),"ph-device-mobile":()=>Promise.all([r.e(4455),r.e(6738)]).then(r.bind(r,46738)),"ph-dots-three":()=>Promise.all([r.e(4455),r.e(956)]).then(r.bind(r,20956)),"ph-vault":()=>Promise.all([r.e(4455),r.e(5617)]).then(r.bind(r,65617)),"ph-envelope":()=>Promise.all([r.e(4455),r.e(9104)]).then(r.bind(r,59104)),"ph-funnel-simple":()=>Promise.all([r.e(4455),r.e(6113)]).then(r.bind(r,56113)),"ph-globe":()=>Promise.all([r.e(4455),r.e(1278)]).then(r.bind(r,41278)),"ph-identification-card":()=>Promise.all([r.e(4455),r.e(9224)]).then(r.bind(r,19224)),"ph-image":()=>Promise.all([r.e(4455),r.e(3267)]).then(r.bind(r,23267)),"ph-info":()=>Promise.all([r.e(4455),r.e(6089)]).then(r.bind(r,46089)),"ph-lightbulb":()=>Promise.all([r.e(4455),r.e(8870)]).then(r.bind(r,68870)),"ph-magnifying-glass":()=>Promise.all([r.e(4455),r.e(5999)]).then(r.bind(r,62764)),"ph-paper-plane-right":()=>Promise.all([r.e(4455),r.e(7154)]).then(r.bind(r,17154)),"ph-plus":()=>Promise.all([r.e(4455),r.e(7470)]).then(r.bind(r,67470)),"ph-power":()=>Promise.all([r.e(4455),r.e(6685)]).then(r.bind(r,46685)),"ph-puzzle-piece":()=>Promise.all([r.e(4455),r.e(7932)]).then(r.bind(r,7932)),"ph-qr-code":()=>Promise.all([r.e(4455),r.e(2941)]).then(r.bind(r,22941)),"ph-question":()=>Promise.all([r.e(4455),r.e(1811)]).then(r.bind(r,11453)),"ph-question-circle":()=>Promise.all([r.e(4455),r.e(1207)]).then(r.bind(r,51207)),"ph-seal-check":()=>Promise.all([r.e(4455),r.e(9210)]).then(r.bind(r,69210)),"ph-sign-out":()=>Promise.all([r.e(4455),r.e(8942)]).then(r.bind(r,48942)),"ph-spinner":()=>Promise.all([r.e(4455),r.e(3632)]).then(r.bind(r,13632)),"ph-trash":()=>Promise.all([r.e(4455),r.e(845)]).then(r.bind(r,20845)),"ph-user":()=>Promise.all([r.e(4455),r.e(497)]).then(r.bind(r,40497)),"ph-warning":()=>Promise.all([r.e(4455),r.e(387)]).then(r.bind(r,30387)),"ph-warning-circle":()=>Promise.all([r.e(4455),r.e(746)]).then(r.bind(r,20746)),"ph-x":()=>Promise.all([r.e(4455),r.e(7620)]).then(r.bind(r,39745))},H={appStore:h,apple:p,bitcoin:f,chromeStore:g,cursor:m,discord:y,ethereum:b,etherscan:w,facebook:v,farcaster:C,github:E,google:x,playStore:A,reown:S,solana:_,telegram:I,twitch:k,twitter:D,twitterIcon:O,walletConnect:P,walletConnectInvert:T,walletConnectBrown:$,walletConnectLightBrown:R,x:D,wallet:N},W={"accent-primary":L.gR.tokens.core.iconAccentPrimary,"accent-certified":L.gR.tokens.core.iconAccentCertified,default:L.gR.tokens.theme.iconDefault,success:L.gR.tokens.core.iconSuccess,error:L.gR.tokens.core.iconError,warning:L.gR.tokens.core.iconWarning,inverse:L.gR.tokens.theme.iconInverse},q=class extends n.oi{constructor(){super(...arguments),this.size="md",this.name="copy",this.weight="bold",this.color="inherit"}render(){this.style.cssText=`
5762      --local-width: ${"inherit"===this.size?"inherit":`var(--apkt-spacing-${({xxs:"2",xs:"3",sm:"3",md:"4",mdl:"5",lg:"5",xl:"6",xxl:"7",inherit:"inherit"})[this.size]})`};
5763      --local-color: ${"inherit"===this.color?"inherit":W[this.color]}
5764    `;let e=F[this.name];if(e&&""!==e){let t=z[e];t&&t();let r=c(e);return d`<${r} size=${({xxs:"0.5em",xs:"0.75em",sm:"0.75em",md:"1em",mdl:"1.25em",lg:"1.25em",xl:"1.5em",xxl:"1.75em"})[this.size]} weight="${this.weight}"></${r}>`}return H[this.name]||d``}};q.styles=[M.ET,j],B([(0,i.Cb)()],q.prototype,"size",void 0),B([(0,i.Cb)()],q.prototype,"name",void 0),B([(0,i.Cb)()],q.prototype,"weight",void 0),B([(0,i.Cb)()],q.prototype,"color",void 0),B([(0,U.M)("wui-icon")],q)},79086:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(31756),s=r(70169),a=r(66704),c=r(73718),l=(0,c.iv)`
5765  :host {
5766    display: block;
5767    width: var(--local-width);
5768    height: var(--local-height);
5769  }
5770
5771  img {
5772    display: block;
5773    width: 100%;
5774    height: 100%;
5775    object-fit: cover;
5776    object-position: center center;
5777    border-radius: inherit;
5778    user-select: none;
5779    user-drag: none;
5780    -webkit-user-drag: none;
5781    -khtml-user-drag: none;
5782    -moz-user-drag: none;
5783    -o-user-drag: none;
5784  }
5785
5786  :host([data-boxed='true']) {
5787    width: 40px;
5788    height: 40px;
5789    display: flex;
5790    align-items: center;
5791    justify-content: center;
5792    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5793    border-radius: ${({borderRadius:e})=>e[2]};
5794  }
5795
5796  :host([data-boxed='true']) img {
5797    width: 20px;
5798    height: 20px;
5799    border-radius: ${({borderRadius:e})=>e[16]};
5800  }
5801
5802  :host([data-full='true']) img {
5803    width: 100%;
5804    height: 100%;
5805  }
5806
5807  :host([data-boxed='true']) wui-icon {
5808    width: 20px;
5809    height: 20px;
5810  }
5811
5812  :host([data-icon='error']) {
5813    background-color: ${({tokens:e})=>e.core.backgroundError};
5814  }
5815
5816  :host([data-rounded='true']) {
5817    border-radius: ${({borderRadius:e})=>e[16]};
5818  }
5819`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d=class extends n.oi{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0,this.boxed=!1,this.rounded=!1,this.fullSize=!1}render(){let e={inherit:"inherit",xxs:"2",xs:"3",sm:"4",md:"4",mdl:"5",lg:"5",xl:"6",xxl:"7","3xl":"8","4xl":"9","5xl":"10"};return(this.style.cssText=`
5820      --local-width: ${this.size?`var(--apkt-spacing-${e[this.size]});`:"100%"};
5821      --local-height: ${this.size?`var(--apkt-spacing-${e[this.size]});`:"100%"};
5822      `,this.dataset.boxed=this.boxed?"true":"false",this.dataset.rounded=this.rounded?"true":"false",this.dataset.full=this.fullSize?"true":"false",this.dataset.icon=this.iconColor||"inherit",this.icon)?(0,n.dy)`<wui-icon
5823        color=${this.iconColor||"inherit"}
5824        name=${this.icon}
5825        size="lg"
5826      ></wui-icon> `:this.logo?(0,n.dy)`<wui-icon size="lg" color="inherit" name=${this.logo}></wui-icon> `:(0,n.dy)`<img src=${(0,o.o)(this.src)} alt=${this.alt} @error=${this.handleImageError} />`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};d.styles=[s.ET,l],u([(0,i.Cb)()],d.prototype,"src",void 0),u([(0,i.Cb)()],d.prototype,"logo",void 0),u([(0,i.Cb)()],d.prototype,"icon",void 0),u([(0,i.Cb)()],d.prototype,"iconColor",void 0),u([(0,i.Cb)()],d.prototype,"alt",void 0),u([(0,i.Cb)()],d.prototype,"size",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"boxed",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"rounded",void 0),u([(0,i.Cb)({type:Boolean})],d.prototype,"fullSize",void 0),u([(0,a.M)("wui-image")],d)},93836:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(73718),s=r(70169),a=r(66704),c=(0,n.iv)`
5827  :host {
5828    display: flex;
5829  }
5830
5831  :host([data-size='sm']) > svg {
5832    width: 12px;
5833    height: 12px;
5834  }
5835
5836  :host([data-size='md']) > svg {
5837    width: 16px;
5838    height: 16px;
5839  }
5840
5841  :host([data-size='lg']) > svg {
5842    width: 24px;
5843    height: 24px;
5844  }
5845
5846  :host([data-size='xl']) > svg {
5847    width: 32px;
5848    height: 32px;
5849  }
5850
5851  svg {
5852    animation: rotate 1.4s linear infinite;
5853    color: var(--local-color);
5854  }
5855
5856  :host([data-size='md']) > svg > circle {
5857    stroke-width: 6px;
5858  }
5859
5860  :host([data-size='sm']) > svg > circle {
5861    stroke-width: 8px;
5862  }
5863
5864  @keyframes rotate {
5865    100% {
5866      transform: rotate(360deg);
5867    }
5868  }
5869`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{constructor(){super(...arguments),this.color="primary",this.size="lg"}render(){let e={primary:o.gR.tokens.theme.textPrimary,secondary:o.gR.tokens.theme.textSecondary,tertiary:o.gR.tokens.theme.textTertiary,invert:o.gR.tokens.theme.textInvert,error:o.gR.tokens.core.textError,warning:o.gR.tokens.core.textWarning,"accent-primary":o.gR.tokens.core.textAccentPrimary};return this.style.cssText=`
5870      --local-color: ${"inherit"===this.color?"inherit":e[this.color]};
5871      `,this.dataset.size=this.size,(0,n.dy)`<svg viewBox="0 0 16 17" fill="none">
5872      <path
5873        d="M8.75 2.65625V4.65625C8.75 4.85516 8.67098 5.04593 8.53033 5.18658C8.38968 5.32723 8.19891 5.40625 8 5.40625C7.80109 5.40625 7.61032 5.32723 7.46967 5.18658C7.32902 5.04593 7.25 4.85516 7.25 4.65625V2.65625C7.25 2.45734 7.32902 2.26657 7.46967 2.12592C7.61032 1.98527 7.80109 1.90625 8 1.90625C8.19891 1.90625 8.38968 1.98527 8.53033 2.12592C8.67098 2.26657 8.75 2.45734 8.75 2.65625ZM14 7.90625H12C11.8011 7.90625 11.6103 7.98527 11.4697 8.12592C11.329 8.26657 11.25 8.45734 11.25 8.65625C11.25 8.85516 11.329 9.04593 11.4697 9.18658C11.6103 9.32723 11.8011 9.40625 12 9.40625H14C14.1989 9.40625 14.3897 9.32723 14.5303 9.18658C14.671 9.04593 14.75 8.85516 14.75 8.65625C14.75 8.45734 14.671 8.26657 14.5303 8.12592C14.3897 7.98527 14.1989 7.90625 14 7.90625ZM11.3588 10.9544C11.289 10.8846 11.2062 10.8293 11.115 10.7915C11.0239 10.7538 10.9262 10.7343 10.8275 10.7343C10.7288 10.7343 10.6311 10.7538 10.54 10.7915C10.4488 10.8293 10.366 10.8846 10.2963 10.9544C10.2265 11.0241 10.1711 11.107 10.1334 11.1981C10.0956 11.2893 10.0762 11.387 10.0762 11.4856C10.0762 11.5843 10.0956 11.682 10.1334 11.7731C10.1711 11.8643 10.2265 11.9471 10.2963 12.0169L11.7106 13.4312C11.8515 13.5721 12.0426 13.6513 12.2419 13.6513C12.4411 13.6513 12.6322 13.5721 12.7731 13.4312C12.914 13.2904 12.9932 13.0993 12.9932 12.9C12.9932 12.7007 12.914 12.5096 12.7731 12.3687L11.3588 10.9544ZM8 11.9062C7.80109 11.9062 7.61032 11.9853 7.46967 12.1259C7.32902 12.2666 7.25 12.4573 7.25 12.6562V14.6562C7.25 14.8552 7.32902 15.0459 7.46967 15.1866C7.61032 15.3272 7.80109 15.4062 8 15.4062C8.19891 15.4062 8.38968 15.3272 8.53033 15.1866C8.67098 15.0459 8.75 14.8552 8.75 14.6562V12.6562C8.75 12.4573 8.67098 12.2666 8.53033 12.1259C8.38968 11.9853 8.19891 11.9062 8 11.9062ZM4.64125 10.9544L3.22688 12.3687C3.08598 12.5096 3.00682 12.7007 3.00682 12.9C3.00682 13.0993 3.08598 13.2904 3.22688 13.4312C3.36777 13.5721 3.55887 13.6513 3.75813 13.6513C3.95738 13.6513 4.14848 13.5721 4.28937 13.4312L5.70375 12.0169C5.84465 11.876 5.9238 11.6849 5.9238 11.4856C5.9238 11.2864 5.84465 11.0953 5.70375 10.9544C5.56285 10.8135 5.37176 10.7343 5.1725 10.7343C4.97324 10.7343 4.78215 10.8135 4.64125 10.9544ZM4.75 8.65625C4.75 8.45734 4.67098 8.26657 4.53033 8.12592C4.38968 7.98527 4.19891 7.90625 4 7.90625H2C1.80109 7.90625 1.61032 7.98527 1.46967 8.12592C1.32902 8.26657 1.25 8.45734 1.25 8.65625C1.25 8.85516 1.32902 9.04593 1.46967 9.18658C1.61032 9.32723 1.80109 9.40625 2 9.40625H4C4.19891 9.40625 4.38968 9.32723 4.53033 9.18658C4.67098 9.04593 4.75 8.85516 4.75 8.65625ZM4.2875 3.88313C4.1466 3.74223 3.95551 3.66307 3.75625 3.66307C3.55699 3.66307 3.3659 3.74223 3.225 3.88313C3.0841 4.02402 3.00495 4.21512 3.00495 4.41438C3.00495 4.61363 3.0841 4.80473 3.225 4.94562L4.64125 6.35813C4.78215 6.49902 4.97324 6.57818 5.1725 6.57818C5.37176 6.57818 5.56285 6.49902 5.70375 6.35813C5.84465 6.21723 5.9238 6.02613 5.9238 5.82688C5.9238 5.62762 5.84465 5.43652 5.70375 5.29563L4.2875 3.88313Z"
5874        fill="currentColor"
5875      />
5876    </svg>`}};
5876u.styles=[s.ET,c],l([(0,i.Cb)()],u.prototype,"color",void 0),l([(0,i.Cb)()],u.prototype,"size",void 0),l([(0,a.M)("wui-loading-spinner")],u)},20958:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(66704),s=r(73718),a=(0,s.iv)`
5877  :host {
5878    display: block;
5879    background: linear-gradient(
5880      90deg,
5881      ${({tokens:e})=>e.theme.foregroundSecondary} 0%,
5882      ${({tokens:e})=>e.theme.foregroundTertiary} 50%,
5883      ${({tokens:e})=>e.theme.foregroundSecondary} 100%
5884    );
5885    background-size: 200% 100%;
5886    animation: shimmer 1s ease-in-out infinite;
5887    border-radius: ${({borderRadius:e})=>e[2]};
5888  }
5889
5890  :host([data-rounded='true']) {
5891    border-radius: ${({borderRadius:e})=>e[16]};
5892  }
5893
5894  @keyframes shimmer {
5895    0% {
5896      background-position: 200% 0;
5897    }
5898    100% {
5899      background-position: -200% 0;
5900    }
5901  }
5902`,c=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let l=class extends n.oi{constructor(){super(...arguments),this.width="",this.height="",this.variant="default",this.rounded=!1}render(){return this.style.cssText=`
5903      width: ${this.width};
5904      height: ${this.height};
5905    `,this.dataset.rounded=this.rounded?"true":"false",(0,n.dy)`<slot></slot>`}};l.styles=[a],c([(0,i.Cb)()],l.prototype,"width",void 0),c([(0,i.Cb)()],l.prototype,"height",void 0),c([(0,i.Cb)()],l.prototype,"variant",void 0),c([(0,i.Cb)({type:Boolean})],l.prototype,"rounded",void 0),c([(0,o.M)("wui-shimmer")],l)},18749:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(62847),s=r(73718),a=r(70169),c=r(66704),l=(0,s.iv)`
5906  :host {
5907    display: inline-flex !important;
5908  }
5909
5910  slot {
5911    width: 100%;
5912    display: inline-block;
5913    font-style: normal;
5914    overflow: inherit;
5915    text-overflow: inherit;
5916    text-align: var(--local-align);
5917    color: var(--local-color);
5918  }
5919
5920  .wui-line-clamp-1 {
5921    overflow: hidden;
5922    display: -webkit-box;
5923    -webkit-box-orient: vertical;
5924    -webkit-line-clamp: 1;
5925  }
5926
5927  .wui-line-clamp-2 {
5928    overflow: hidden;
5929    display: -webkit-box;
5930    -webkit-box-orient: vertical;
5931    -webkit-line-clamp: 2;
5932  }
5933
5934  /* -- Headings --------------------------------------------------- */
5935  .wui-font-h1-regular-mono {
5936    font-size: ${({textSize:e})=>e.h1};
5937    line-height: ${({typography:e})=>e["h1-regular-mono"].lineHeight};
5938    letter-spacing: ${({typography:e})=>e["h1-regular-mono"].letterSpacing};
5939    font-weight: ${({fontWeight:e})=>e.regular};
5940    font-family: ${({fontFamily:e})=>e.mono};
5941  }
5942
5943  .wui-font-h1-regular {
5944    font-size: ${({textSize:e})=>e.h1};
5945    line-height: ${({typography:e})=>e["h1-regular"].lineHeight};
5946    letter-spacing: ${({typography:e})=>e["h1-regular"].letterSpacing};
5947    font-weight: ${({fontWeight:e})=>e.regular};
5948    font-family: ${({fontFamily:e})=>e.regular};
5949    font-feature-settings:
5950      'liga' off,
5951      'clig' off;
5952  }
5953
5954  .wui-font-h1-medium {
5955    font-size: ${({textSize:e})=>e.h1};
5956    line-height: ${({typography:e})=>e["h1-medium"].lineHeight};
5957    letter-spacing: ${({typography:e})=>e["h1-medium"].letterSpacing};
5958    font-weight: ${({fontWeight:e})=>e.medium};
5959    font-family: ${({fontFamily:e})=>e.regular};
5960    font-feature-settings:
5961      'liga' off,
5962      'clig' off;
5963  }
5964
5965  .wui-font-h2-regular-mono {
5966    font-size: ${({textSize:e})=>e.h2};
5967    line-height: ${({typography:e})=>e["h2-regular-mono"].lineHeight};
5968    letter-spacing: ${({typography:e})=>e["h2-regular-mono"].letterSpacing};
5969    font-weight: ${({fontWeight:e})=>e.regular};
5970    font-family: ${({fontFamily:e})=>e.mono};
5971  }
5972
5973  .wui-font-h2-regular {
5974    font-size: ${({textSize:e})=>e.h2};
5975    line-height: ${({typography:e})=>e["h2-regular"].lineHeight};
5976    letter-spacing: ${({typography:e})=>e["h2-regular"].letterSpacing};
5977    font-weight: ${({fontWeight:e})=>e.regular};
5978    font-family: ${({fontFamily:e})=>e.regular};
5979    font-feature-settings:
5980      'liga' off,
5981      'clig' off;
5982  }
5983
5984  .wui-font-h2-medium {
5985    font-size: ${({textSize:e})=>e.h2};
5986    line-height: ${({typography:e})=>e["h2-medium"].lineHeight};
5987    letter-spacing: ${({typography:e})=>e["h2-medium"].letterSpacing};
5988    font-weight: ${({fontWeight:e})=>e.medium};
5989    font-family: ${({fontFamily:e})=>e.regular};
5990    font-feature-settings:
5991      'liga' off,
5992      'clig' off;
5993  }
5994
5995  .wui-font-h3-regular-mono {
5996    font-size: ${({textSize:e})=>e.h3};
5997    line-height: ${({typography:e})=>e["h3-regular-mono"].lineHeight};
5998    letter-spacing: ${({typography:e})=>e["h3-regular-mono"].letterSpacing};
5999    font-weight: ${({fontWeight:e})=>e.regular};
6000    font-family: ${({fontFamily:e})=>e.mono};
6001  }
6002
6003  .wui-font-h3-regular {
6004    font-size: ${({textSize:e})=>e.h3};
6005    line-height: ${({typography:e})=>e["h3-regular"].lineHeight};
6006    letter-spacing: ${({typography:e})=>e["h3-regular"].letterSpacing};
6007    font-weight: ${({fontWeight:e})=>e.regular};
6008    font-family: ${({fontFamily:e})=>e.regular};
6009    font-feature-settings:
6010      'liga' off,
6011      'clig' off;
6012  }
6013
6014  .wui-font-h3-medium {
6015    font-size: ${({textSize:e})=>e.h3};
6016    line-height: ${({typography:e})=>e["h3-medium"].lineHeight};
6017    letter-spacing: ${({typography:e})=>e["h3-medium"].letterSpacing};
6018    font-weight: ${({fontWeight:e})=>e.medium};
6019    font-family: ${({fontFamily:e})=>e.regular};
6020    font-feature-settings:
6021      'liga' off,
6022      'clig' off;
6023  }
6024
6025  .wui-font-h4-regular-mono {
6026    font-size: ${({textSize:e})=>e.h4};
6027    line-height: ${({typography:e})=>e["h4-regular-mono"].lineHeight};
6028    letter-spacing: ${({typography:e})=>e["h4-regular-mono"].letterSpacing};
6029    font-weight: ${({fontWeight:e})=>e.regular};
6030    font-family: ${({fontFamily:e})=>e.mono};
6031  }
6032
6033  .wui-font-h4-regular {
6034    font-size: ${({textSize:e})=>e.h4};
6035    line-height: ${({typography:e})=>e["h4-regular"].lineHeight};
6036    letter-spacing: ${({typography:e})=>e["h4-regular"].letterSpacing};
6037    font-weight: ${({fontWeight:e})=>e.regular};
6038    font-family: ${({fontFamily:e})=>e.regular};
6039    font-feature-settings:
6040      'liga' off,
6041      'clig' off;
6042  }
6043
6044  .wui-font-h4-medium {
6045    font-size: ${({textSize:e})=>e.h4};
6046    line-height: ${({typography:e})=>e["h4-medium"].lineHeight};
6047    letter-spacing: ${({typography:e})=>e["h4-medium"].letterSpacing};
6048    font-weight: ${({fontWeight:e})=>e.medium};
6049    font-family: ${({fontFamily:e})=>e.regular};
6050    font-feature-settings:
6051      'liga' off,
6052      'clig' off;
6053  }
6054
6055  .wui-font-h5-regular-mono {
6056    font-size: ${({textSize:e})=>e.h5};
6057    line-height: ${({typography:e})=>e["h5-regular-mono"].lineHeight};
6058    letter-spacing: ${({typography:e})=>e["h5-regular-mono"].letterSpacing};
6059    font-weight: ${({fontWeight:e})=>e.regular};
6060    font-family: ${({fontFamily:e})=>e.mono};
6061  }
6062
6063  .wui-font-h5-regular {
6064    font-size: ${({textSize:e})=>e.h5};
6065    line-height: ${({typography:e})=>e["h5-regular"].lineHeight};
6066    letter-spacing: ${({typography:e})=>e["h5-regular"].letterSpacing};
6067    font-weight: ${({fontWeight:e})=>e.regular};
6068    font-family: ${({fontFamily:e})=>e.regular};
6069    font-feature-settings:
6070      'liga' off,
6071      'clig' off;
6072  }
6073
6074  .wui-font-h5-medium {
6075    font-size: ${({textSize:e})=>e.h5};
6076    line-height: ${({typography:e})=>e["h5-medium"].lineHeight};
6077    letter-spacing: ${({typography:e})=>e["h5-medium"].letterSpacing};
6078    font-weight: ${({fontWeight:e})=>e.medium};
6079    font-family: ${({fontFamily:e})=>e.regular};
6080    font-feature-settings:
6081      'liga' off,
6082      'clig' off;
6083  }
6084
6085  .wui-font-h6-regular-mono {
6086    font-size: ${({textSize:e})=>e.h6};
6087    line-height: ${({typography:e})=>e["h6-regular-mono"].lineHeight};
6088    letter-spacing: ${({typography:e})=>e["h6-regular-mono"].letterSpacing};
6089    font-weight: ${({fontWeight:e})=>e.regular};
6090    font-family: ${({fontFamily:e})=>e.mono};
6091  }
6092
6093  .wui-font-h6-regular {
6094    font-size: ${({textSize:e})=>e.h6};
6095    line-height: ${({typography:e})=>e["h6-regular"].lineHeight};
6096    letter-spacing: ${({typography:e})=>e["h6-regular"].letterSpacing};
6097    font-weight: ${({fontWeight:e})=>e.regular};
6098    font-family: ${({fontFamily:e})=>e.regular};
6099    font-feature-settings:
6100      'liga' off,
6101      'clig' off;
6102  }
6103
6104  .wui-font-h6-medium {
6105    font-size: ${({textSize:e})=>e.h6};
6106    line-height: ${({typography:e})=>e["h6-medium"].lineHeight};
6107    letter-spacing: ${({typography:e})=>e["h6-medium"].letterSpacing};
6108    font-weight: ${({fontWeight:e})=>e.medium};
6109    font-family: ${({fontFamily:e})=>e.regular};
6110    font-feature-settings:
6111      'liga' off,
6112      'clig' off;
6113  }
6114
6115  .wui-font-lg-regular-mono {
6116    font-size: ${({textSize:e})=>e.large};
6117    line-height: ${({typography:e})=>e["lg-regular-mono"].lineHeight};
6118    letter-spacing: ${({typography:e})=>e["lg-regular-mono"].letterSpacing};
6119    font-weight: ${({fontWeight:e})=>e.regular};
6120    font-family: ${({fontFamily:e})=>e.mono};
6121  }
6122
6123  .wui-font-lg-regular {
6124    font-size: ${({textSize:e})=>e.large};
6125    line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
6126    letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
6127    font-weight: ${({fontWeight:e})=>e.regular};
6128    font-family: ${({fontFamily:e})=>e.regular};
6129    font-feature-settings:
6130      'liga' off,
6131      'clig' off;
6132  }
6133
6134  .wui-font-lg-medium {
6135    font-size: ${({textSize:e})=>e.large};
6136    line-height: ${({typography:e})=>e["lg-medium"].lineHeight};
6137    letter-spacing: ${({typography:e})=>e["lg-medium"].letterSpacing};
6138    font-weight: ${({fontWeight:e})=>e.medium};
6139    font-family: ${({fontFamily:e})=>e.regular};
6140    font-feature-settings:
6141      'liga' off,
6142      'clig' off;
6143  }
6144
6145  .wui-font-md-regular-mono {
6146    font-size: ${({textSize:e})=>e.medium};
6147    line-height: ${({typography:e})=>e["md-regular-mono"].lineHeight};
6148    letter-spacing: ${({typography:e})=>e["md-regular-mono"].letterSpacing};
6149    font-weight: ${({fontWeight:e})=>e.regular};
6150    font-family: ${({fontFamily:e})=>e.mono};
6151  }
6152
6153  .wui-font-md-regular {
6154    font-size: ${({textSize:e})=>e.medium};
6155    line-height: ${({typography:e})=>e["md-regular"].lineHeight};
6156    letter-spacing: ${({typography:e})=>e["md-regular"].letterSpacing};
6157    font-weight: ${({fontWeight:e})=>e.regular};
6158    font-family: ${({fontFamily:e})=>e.regular};
6159    font-feature-settings:
6160      'liga' off,
6161      'clig' off;
6162  }
6163
6164  .wui-font-md-medium {
6165    font-size: ${({textSize:e})=>e.medium};
6166    line-height: ${({typography:e})=>e["md-medium"].lineHeight};
6167    letter-spacing: ${({typography:e})=>e["md-medium"].letterSpacing};
6168    font-weight: ${({fontWeight:e})=>e.medium};
6169    font-family: ${({fontFamily:e})=>e.regular};
6170    font-feature-settings:
6171      'liga' off,
6172      'clig' off;
6173  }
6174
6175  .wui-font-sm-regular-mono {
6176    font-size: ${({textSize:e})=>e.small};
6177    line-height: ${({typography:e})=>e["sm-regular-mono"].lineHeight};
6178    letter-spacing: ${({typography:e})=>e["sm-regular-mono"].letterSpacing};
6179    font-weight: ${({fontWeight:e})=>e.regular};
6180    font-family: ${({fontFamily:e})=>e.mono};
6181  }
6182
6183  .wui-font-sm-regular {
6184    font-size: ${({textSize:e})=>e.small};
6185    line-height: ${({typography:e})=>e["sm-regular"].lineHeight};
6186    letter-spacing: ${({typography:e})=>e["sm-regular"].letterSpacing};
6187    font-weight: ${({fontWeight:e})=>e.regular};
6188    font-family: ${({fontFamily:e})=>e.regular};
6189    font-feature-settings:
6190      'liga' off,
6191      'clig' off;
6192  }
6193
6194  .wui-font-sm-medium {
6195    font-size: ${({textSize:e})=>e.small};
6196    line-height: ${({typography:e})=>e["sm-medium"].lineHeight};
6197    letter-spacing: ${({typography:e})=>e["sm-medium"].letterSpacing};
6198    font-weight: ${({fontWeight:e})=>e.medium};
6199    font-family: ${({fontFamily:e})=>e.regular};
6200    font-feature-settings:
6201      'liga' off,
6202      'clig' off;
6203  }
6204`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d={primary:s.gR.tokens.theme.textPrimary,secondary:s.gR.tokens.theme.textSecondary,tertiary:s.gR.tokens.theme.textTertiary,invert:s.gR.tokens.theme.textInvert,error:s.gR.tokens.core.textError,warning:s.gR.tokens.core.textWarning,"accent-primary":s.gR.tokens.core.textAccentPrimary},h=class extends n.oi{constructor(){super(...arguments),this.variant="md-regular",this.color="inherit",this.align="left",this.lineClamp=void 0}render(){let e={[`wui-font-${this.variant}
6204`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=`
6205      --local-align: ${this.align};
6206      --local-color: ${"inherit"===this.color?"inherit":d[this.color??"primary"]};
6207      `,(0,n.dy)`<slot class=${(0,o.$)(e)}></slot>`}};h.styles=[a.ET,l],u([(0,i.Cb)()],h.prototype,"variant",void 0),u([(0,i.Cb)()],h.prototype,"color",void 0),u([(0,i.Cb)()],h.prototype,"align",void 0),u([(0,i.Cb)()],h.prototype,"lineClamp",void 0),u([(0,c.M)("wui-text")],h)},26842:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(79086);var o=r(70169),s=r(45182),a=r(66704),c=r(73718),l=(0,c.iv)`
6208  :host {
6209    display: block;
6210    width: var(--local-width);
6211    height: var(--local-height);
6212    border-radius: ${({borderRadius:e})=>e[16]};
6213    overflow: hidden;
6214    position: relative;
6215  }
6216
6217  :host([data-variant='generated']) {
6218    --mixed-local-color-1: var(--local-color-1);
6219    --mixed-local-color-2: var(--local-color-2);
6220    --mixed-local-color-3: var(--local-color-3);
6221    --mixed-local-color-4: var(--local-color-4);
6222    --mixed-local-color-5: var(--local-color-5);
6223  }
6224
6225  :host([data-variant='generated']) {
6226    background: radial-gradient(
6227      var(--local-radial-circle),
6228      #fff 0.52%,
6229      var(--mixed-local-color-5) 31.25%,
6230      var(--mixed-local-color-3) 51.56%,
6231      var(--mixed-local-color-2) 65.63%,
6232      var(--mixed-local-color-1) 82.29%,
6233      var(--mixed-local-color-4) 100%
6234    );
6235  }
6236
6237  :host([data-variant='default']) {
6238    background: radial-gradient(
6239      75.29% 75.29% at 64.96% 24.36%,
6240      #fff 0.52%,
6241      #f5ccfc 31.25%,
6242      #dba4f5 51.56%,
6243      #9a8ee8 65.63%,
6244      #6493da 82.29%,
6245      #6ebdea 100%
6246    );
6247  }
6248`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d=class extends n.oi{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){let e={inherit:"inherit",xxs:"3",xs:"5",sm:"6",md:"8",mdl:"8",lg:"10",xl:"16",xxl:"20"};return this.style.cssText=`
6249    --local-width: var(--apkt-spacing-${e[this.size??"xl"]});
6250    --local-height: var(--apkt-spacing-${e[this.size??"xl"]});
6251    `,(0,n.dy)`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",(0,n.dy)`<wui-image src=${this.imageSrc} alt=${this.alt??"avatar"}></wui-image>`;if(this.address){this.dataset.variant="generated";let e=s.H.generateAvatarColors(this.address);return this.style.cssText+=`
6252 ${e}`,null}return this.dataset.variant="default",null}};d.styles=[o.ET,l],u([(0,i.Cb)()],d.prototype,"imageSrc",void 0),u([(0,i.Cb)()],d.prototype,"alt",void 0),u([(0,i.Cb)()],d.prototype,"address",void 0),u([(0,i.Cb)()],d.prototype,"size",void 0),u([(0,a.M)("wui-avatar")],d)},95547:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(92706),r(93836),r(18749);var o=r(70169),s=r(66704),a=r(73718),c=(0,a.iv)`
6253  :host {
6254    width: var(--local-width);
6255  }
6256
6257  button {
6258    width: var(--local-width);
6259    white-space: nowrap;
6260    column-gap: ${({spacing:e})=>e[2]};
6261    transition:
6262      scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]},
6263      background-color ${({durations:e})=>e.lg}
6264        ${({easings:e})=>e["ease-out-power-2"]},
6265      border-radius ${({durations:e})=>e.lg}
6266        ${({easings:e})=>e["ease-out-power-1"]};
6267    will-change: scale, background-color, border-radius;
6268    cursor: pointer;
6269  }
6270
6271  /* -- Sizes --------------------------------------------------- */
6272  button[data-size='sm'] {
6273    border-radius: ${({borderRadius:e})=>e[2]};
6274    padding: 0 ${({spacing:e})=>e[2]};
6275    height: 28px;
6276  }
6277
6278  button[data-size='md'] {
6279    border-radius: ${({borderRadius:e})=>e[3]};
6280    padding: 0 ${({spacing:e})=>e[4]};
6281    height: 38px;
6282  }
6283
6284  button[data-size='lg'] {
6285    border-radius: ${({borderRadius:e})=>e[4]};
6286    padding: 0 ${({spacing:e})=>e[5]};
6287    height: 48px;
6288  }
6289
6290  /* -- Variants --------------------------------------------------------- */
6291  button[data-variant='accent-primary'] {
6292    background-color: ${({tokens:e})=>e.core.backgroundAccentPrimary};
6293    color: ${({tokens:e})=>e.theme.textInvert};
6294  }
6295
6296  button[data-variant='accent-secondary'] {
6297    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
6298    color: ${({tokens:e})=>e.core.textAccentPrimary};
6299  }
6300
6301  button[data-variant='neutral-primary'] {
6302    background-color: ${({tokens:e})=>e.theme.backgroundInvert};
6303    color: ${({tokens:e})=>e.theme.textInvert};
6304  }
6305
6306  button[data-variant='neutral-secondary'] {
6307    background-color: transparent;
6308    border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
6309    color: ${({tokens:e})=>e.theme.textPrimary};
6310  }
6311
6312  button[data-variant='neutral-tertiary'] {
6313    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
6314    color: ${({tokens:e})=>e.theme.textPrimary};
6315  }
6316
6317  button[data-variant='error-primary'] {
6318    background-color: ${({tokens:e})=>e.core.textError};
6319    color: ${({tokens:e})=>e.theme.textInvert};
6320  }
6321
6322  button[data-variant='error-secondary'] {
6323    background-color: ${({tokens:e})=>e.core.backgroundError};
6324    color: ${({tokens:e})=>e.core.textError};
6325  }
6326
6327  button[data-variant='shade'] {
6328    background: var(--wui-color-gray-glass-002);
6329    color: var(--wui-color-fg-200);
6330    border: none;
6331    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
6332  }
6333
6334  /* -- Focus states --------------------------------------------------- */
6335  button[data-size='sm']:focus-visible:enabled {
6336    border-radius: 28px;
6337  }
6338
6339  button[data-size='md']:focus-visible:enabled {
6340    border-radius: 38px;
6341  }
6342
6343  button[data-size='lg']:focus-visible:enabled {
6344    border-radius: 48px;
6345  }
6346  button[data-variant='shade']:focus-visible:enabled {
6347    background: var(--wui-color-gray-glass-005);
6348    box-shadow:
6349      inset 0 0 0 1px var(--wui-color-gray-glass-010),
6350      0 0 0 4px var(--wui-color-gray-glass-002);
6351  }
6352
6353  /* -- Hover & Active states ----------------------------------------------------------- */
6354  @media (hover: hover) {
6355    button[data-size='sm']:hover:enabled {
6356      border-radius: 28px;
6357    }
6358
6359    button[data-size='md']:hover:enabled {
6360      border-radius: 38px;
6361    }
6362
6363    button[data-size='lg']:hover:enabled {
6364      border-radius: 48px;
6365    }
6366
6367    button[data-variant='shade']:hover:enabled {
6368      background: var(--wui-color-gray-glass-002);
6369    }
6370
6371    button[data-variant='shade']:active:enabled {
6372      background: var(--wui-color-gray-glass-005);
6373    }
6374  }
6375
6376  button[data-size='sm']:active:enabled {
6377    border-radius: 28px;
6378  }
6379
6380  button[data-size='md']:active:enabled {
6381    border-radius: 38px;
6382  }
6383
6384  button[data-size='lg']:active:enabled {
6385    border-radius: 48px;
6386  }
6387
6388  /* -- Disabled states --------------------------------------------------- */
6389  button:disabled {
6390    opacity: 0.3;
6391  }
6392`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u={lg:"lg-regular-mono",md:"md-regular-mono",sm:"sm-regular-mono"},d={lg:"md",md:"md",sm:"sm"},h=class extends n.oi{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="accent-primary"}render(){this.style.cssText=`
6393    --local-width: ${this.fullWidth?"100%":"auto"};
6394     `;let e=this.textVariant??u[this.size];return(0,n.dy)`
6395      <button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}>
6396        ${this.loadingTemplate()}
6397        <slot name="iconLeft"></slot>
6398        <wui-text variant=${e} color="inherit">
6399          <slot></slot>
6400        </wui-text>
6401        <slot name="iconRight"></slot>
6402      </button>
6403    `}loadingTemplate(){if(this.loading){let e=d[this.size],t="neutral-primary"===this.variant||"accent-primary"===this.variant?"invert":"primary";return(0,n.dy)`<wui-loading-spinner color=${t} size=${e}></wui-loading-spinner>`}return null}};h.styles=[o.ET,o.ZM,c],l([(0,i.Cb)()],h.prototype,"size",void 0),l([(0,i.Cb)({type:Boolean})],h.prototype,"disabled",void 0),l([(0,i.Cb)({type:Boolean})],h.prototype,"fullWidth",void 0),l([(0,i.Cb)({type:Boolean})],h.prototype,"loading",void 0),l([(0,i.Cb)()],h.prototype,"variant",void 0),l([(0,i.Cb)()],h.prototype,"textVariant",void 0),l([(0,s.M)("wui-button")],h)},94272:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(31756);r(92706);var s=r(70169),a=r(66704),c=r(73718),l=(0,c.iv)`
6404  :host {
6405    display: inline-flex;
6406    justify-content: center;
6407    align-items: center;
6408    border-radius: ${({borderRadius:e})=>e[2]};
6409    padding: ${({spacing:e})=>e[1]} !important;
6410    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
6411    position: relative;
6412  }
6413
6414  :host([data-padding='2']) {
6415    padding: ${({spacing:e})=>e[2]} !important;
6416  }
6417
6418  :host:after {
6419    content: '';
6420    position: absolute;
6421    top: 0;
6422    left: 0;
6423    width: 100%;
6424    height: 100%;
6425    border-radius: ${({borderRadius:e})=>e[2]};
6426  }
6427
6428  :host > wui-icon {
6429    z-index: 10;
6430  }
6431
6432  /* -- Colors --------------------------------------------------- */
6433  :host([data-color='accent-primary']) {
6434    color: ${({tokens:e})=>e.core.iconAccentPrimary};
6435  }
6436
6437  :host([data-color='accent-primary']):after {
6438    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
6439  }
6440
6441  :host([data-color='default']),
6442  :host([data-color='secondary']) {
6443    color: ${({tokens:e})=>e.theme.iconDefault};
6444  }
6445
6446  :host([data-color='default']):after {
6447    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
6448  }
6449
6450  :host([data-color='secondary']):after {
6451    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
6452  }
6453
6454  :host([data-color='success']) {
6455    color: ${({tokens:e})=>e.core.iconSuccess};
6456  }
6457
6458  :host([data-color='success']):after {
6459    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
6460  }
6461
6462  :host([data-color='error']) {
6463    color: ${({tokens:e})=>e.core.iconError};
6464  }
6465
6466  :host([data-color='error']):after {
6467    background-color: ${({tokens:e})=>e.core.backgroundError};
6468  }
6469
6470  :host([data-color='warning']) {
6471    color: ${({tokens:e})=>e.core.iconWarning};
6472  }
6473
6474  :host([data-color='warning']):after {
6475    background-color: ${({tokens:e})=>e.core.backgroundWarning};
6476  }
6477
6478  :host([data-color='inverse']) {
6479    color: ${({tokens:e})=>e.theme.iconInverse};
6480  }
6481
6482  :host([data-color='inverse']):after {
6483    background-color: transparent;
6484  }
6485`,u=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let d=class extends n.oi{constructor(){super(...arguments),this.icon="copy",this.size="md",this.padding="1",this.color="default"}render(){return this.dataset.padding=this.padding,this.dataset.color=this.color,(0,n.dy)`
6486      <wui-icon size=${(0,o.o)(this.size)} name=${this.icon} color="inherit"></wui-icon>
6487    `}};d.styles=[s.ET,s.ZM,l],u([(0,i.Cb)()],d.prototype,"icon",void 0),u([(0,i.Cb)()],d.prototype,"size",void 0),u([(0,i.Cb)()],d.prototype,"padding",void 0),u([(0,i.Cb)()],d.prototype,"color",void 0),u([(0,a.M)("wui-icon-box")],d)},46550:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(92706);var o=r(70169),s=r(66704),a=r(73718),c=(0,a.iv)`
6488  button {
6489    background-color: transparent;
6490    padding: ${({spacing:e})=>e[1]};
6491  }
6492
6493  button:focus-visible {
6494    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
6495  }
6496
6497  button[data-variant='accent']:hover:enabled,
6498  button[data-variant='accent']:focus-visible {
6499    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
6500  }
6501
6502  button[data-variant='primary']:hover:enabled,
6503  button[data-variant='primary']:focus-visible,
6504  button[data-variant='secondary']:hover:enabled,
6505  button[data-variant='secondary']:focus-visible {
6506    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
6507  }
6508
6509  button[data-size='xs'] > wui-icon {
6510    width: 8px;
6511    height: 8px;
6512  }
6513
6514  button[data-size='sm'] > wui-icon {
6515    width: 12px;
6516    height: 12px;
6517  }
6518
6519  button[data-size='xs'],
6520  button[data-size='sm'] {
6521    border-radius: ${({borderRadius:e})=>e[1]};
6522  }
6523
6524  button[data-size='md'],
6525  button[data-size='lg'] {
6526    border-radius: ${({borderRadius:e})=>e[2]};
6527  }
6528
6529  button[data-size='md'] > wui-icon {
6530    width: 16px;
6531    height: 16px;
6532  }
6533
6534  button[data-size='lg'] > wui-icon {
6535    width: 20px;
6536    height: 20px;
6537  }
6538
6539  button:disabled {
6540    background-color: transparent;
6541    cursor: not-allowed;
6542    opacity: 0.5;
6543  }
6544
6545  button:hover:not(:disabled) {
6546    background-color: var(--wui-color-accent-glass-015);
6547  }
6548
6549  button:focus-visible:not(:disabled) {
6550    background-color: var(--wui-color-accent-glass-015);
6551    box-shadow:
6552      inset 0 0 0 1px var(--wui-color-accent-100),
6553      0 0 0 4px var(--wui-color-accent-glass-020);
6554  }
6555`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="default",this.variant="accent"}render(){return(0,n.dy)`
6556      <button data-variant=${this.variant} ?disabled=${this.disabled} data-size=${this.size}>
6557        <wui-icon
6558          color=${({accent:"accent-primary",primary:"inverse",secondary:"default"})[this.variant]||this.iconColor}
6559          size=${this.size}
6560          name=${this.icon}
6561        ></wui-icon>
6562      </button>
6563    `}};u.styles=[o.ET,o.ZM,c],l([(0,i.Cb)()],u.prototype,"size",void 0),l([(0,i.Cb)({type:Boolean})],u.prototype,"disabled",void 0),l([(0,i.Cb)()],u.prototype,"icon",void 0),l([(0,i.Cb)()],u.prototype,"iconColor",void 0),l([(0,i.Cb)()],u.prototype,"variant",void 0),l([(0,s.M)("wui-icon-link")],u)},54541:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(31756),s=r(53549);r(92706),r(18749);var a=r(70169),c=r(66704),l=r(73718),u=(0,l.iv)`
6564  :host {
6565    position: relative;
6566    width: 100%;
6567    display: inline-flex;
6568    flex-direction: column;
6569    gap: ${({spacing:e})=>e[3]};
6570    color: ${({tokens:e})=>e.theme.textPrimary};
6571    caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
6572  }
6573
6574  .wui-input-text-container {
6575    position: relative;
6576    display: flex;
6577  }
6578
6579  input {
6580    width: 100%;
6581    border-radius: ${({borderRadius:e})=>e[4]};
6582    color: inherit;
6583    background: transparent;
6584    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
6585    caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
6586    padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[3]}
6587      ${({spacing:e})=>e[3]} ${({spacing:e})=>e[10]};
6588    font-size: ${({textSize:e})=>e.large};
6589    line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
6590    letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
6591    font-weight: ${({fontWeight:e})=>e.regular};
6592    font-family: ${({fontFamily:e})=>e.regular};
6593  }
6594
6595  input[data-size='lg'] {
6596    padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]}
6597      ${({spacing:e})=>e[4]} ${({spacing:e})=>e[10]};
6598  }
6599
6600  @media (hover: hover) and (pointer: fine) {
6601    input:hover:enabled {
6602      border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
6603    }
6604  }
6605
6606  input:disabled {
6607    cursor: unset;
6608    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
6609  }
6610
6611  input::placeholder {
6612    color: ${({tokens:e})=>e.theme.textSecondary};
6613  }
6614
6615  input:focus:enabled {
6616    border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
6617    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
6618    -webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
6619    -moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
6620    box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
6621  }
6622
6623  div.wui-input-text-container:has(input:disabled) {
6624    opacity: 0.5;
6625  }
6626
6627  wui-icon.wui-input-text-left-icon {
6628    position: absolute;
6629    top: 50%;
6630    transform: translateY(-50%);
6631    pointer-events: none;
6632    left: ${({spacing:e})=>e[4]};
6633    color: ${({tokens:e})=>e.theme.iconDefault};
6634  }
6635
6636  button.wui-input-text-submit-button {
6637    position: absolute;
6638    top: 50%;
6639    transform: translateY(-50%);
6640    right: ${({spacing:e})=>e[3]};
6641    width: 24px;
6642    height: 24px;
6643    border: none;
6644    background: transparent;
6645    border-radius: ${({borderRadius:e})=>e[2]};
6646    color: ${({tokens:e})=>e.core.textAccentPrimary};
6647  }
6648
6649  button.wui-input-text-submit-button:disabled {
6650    opacity: 1;
6651  }
6652
6653  button.wui-input-text-submit-button.loading wui-icon {
6654    animation: spin 1s linear infinite;
6655  }
6656
6657  button.wui-input-text-submit-button:hover {
6658    background: ${({tokens:e})=>e.core.foregroundAccent010};
6659  }
6660
6661  input:has(+ .wui-input-text-submit-button) {
6662    padding-right: ${({spacing:e})=>e[12]};
6663  }
6664
6665  input[type='number'] {
6666    -moz-appearance: textfield;
6667  }
6668
6669  input[type='search']::-webkit-search-decoration,
6670  input[type='search']::-webkit-search-cancel-button,
6671  input[type='search']::-webkit-search-results-button,
6672  input[type='search']::-webkit-search-results-decoration {
6673    -webkit-appearance: none;
6674  }
6675
6676  /* -- Keyframes --------------------------------------------------- */
6677  @keyframes spin {
6678    from {
6679      transform: rotate(0deg);
6680    }
6681    to {
6682      transform: rotate(360deg);
6683    }
6684  }
6685`,d=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let h=class extends n.oi{constructor(){super(...arguments),this.inputElementRef=(0,s.V)(),this.disabled=!1,this.loading=!1,this.placeholder="",this.type="text",this.value="",this.size="md"}render(){return(0,n.dy)` <div class="wui-input-text-container">
6686        ${this.templateLeftIcon()}
6687        <input
6688          data-size=${this.size}
6689          ${(0,s.i)(this.inputElementRef)}
6690          data-testid="wui-input-text"
6691          type=${this.type}
6692          enterkeyhint=${(0,o.o)(this.enterKeyHint)}
6693          ?disabled=${this.disabled}
6694          placeholder=${this.placeholder}
6695          @input=${this.dispatchInputChangeEvent.bind(this)}
6696          @keydown=${this.onKeyDown}
6697          .value=${this.value||""}
6698        />
6699        ${this.templateSubmitButton()}
6700        <slot class="wui-input-text-slot"></slot>
6701      </div>
6702      ${this.templateError()} ${this.templateWarning()}`}templateLeftIcon(){return this.icon?(0,n.dy)`<wui-icon
6703        class="wui-input-text-left-icon"
6704        size="md"
6705        data-size=${this.size}
6706        color="inherit"
6707        name=${this.icon}
6708      ></wui-icon>`:null}templateSubmitButton(){return this.onSubmit?(0,n.dy)`<button
6709        class="wui-input-text-submit-button ${this.loading?"loading":""}"
6710        @click=${this.onSubmit?.bind(this)}
6711        ?disabled=${this.disabled||this.loading}
6712      >
6713        ${this.loading?(0,n.dy)`<wui-icon name="spinner" size="md"></wui-icon>`:(0,n.dy)`<wui-icon name="chevronRight" size="md"></wui-icon>`}
6714      </button>`:null}templateError(){return this.errorText?(0,n.dy)`<wui-text variant="sm-regular" color="error">${this.errorText}</wui-text>`:null}templateWarning(){return this.warningText?(0,n.dy)`<wui-text variant="sm-regular" color="warning">${this.warningText}</wui-text>`:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};h.styles=[a.ET,a.ZM,u],d([(0,i.Cb)()],h.prototype,"icon",void 0),d([(0,i.Cb)({type:Boolean})],h.prototype,"disabled",void 0),d([(0,i.Cb)({type:Boolean})],h.prototype,"loading",void 0),d([(0,i.Cb)()],h.prototype,"placeholder",void 0),d([(0,i.Cb)()],h.prototype,"type",void 0),d([(0,i.Cb)()],h.prototype,"value",void 0),d([(0,i.Cb)()],h.prototype,"errorText",void 0),d([(0,i.Cb)()],h.prototype,"warningText",void 0),d([(0,i.Cb)()],h.prototype,"onSubmit",void 0),d([(0,i.Cb)()],h.prototype,"size",void 0),d([(0,i.Cb)({attribute:!1})],h.prototype,"onKeyDown",void 0),d([(0,c.M)("wui-input-text")],h)},67079:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(92706);var o=r(70169),s=r(66704),a=r(73718),c=(0,a.iv)`
6715  :host {
6716    display: flex;
6717    justify-content: center;
6718    align-items: center;
6719    width: 40px;
6720    height: 40px;
6721    border-radius: ${({borderRadius:e})=>e["20"]};
6722    overflow: hidden;
6723  }
6724
6725  wui-icon {
6726    width: 100%;
6727    height: 100%;
6728  }
6729`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{constructor(){super(...arguments),this.logo="google"}render(){return(0,n.dy)`<wui-icon color="inherit" size="inherit" name=${this.logo}></wui-icon> `}};u.styles=[o.ET,c],l([(0,i.Cb)()],u.prototype,"logo",void 0),l([(0,s.M)("wui-logo")],u)},35407:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(92706),r(18749);var o=r(70169),s=r(66704),a=r(73718),c=(0,a.iv)`
6730  :host {
6731    display: flex;
6732    justify-content: center;
6733    align-items: center;
6734    gap: ${({spacing:e})=>e[1]};
6735    text-transform: uppercase;
6736  }
6737
6738  :host([data-variant='accent']) {
6739    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
6740    color: ${({tokens:e})=>e.core.textAccentPrimary};
6741  }
6742
6743  :host([data-variant='info']) {
6744    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
6745    color: ${({tokens:e})=>e.theme.textSecondary};
6746  }
6747
6748  :host([data-variant='success']) {
6749    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
6750    color: ${({tokens:e})=>e.core.textSuccess};
6751  }
6752
6753  :host([data-variant='warning']) {
6754    background-color: ${({tokens:e})=>e.core.backgroundWarning};
6755    color: ${({tokens:e})=>e.core.textWarning};
6756  }
6757
6758  :host([data-variant='error']) {
6759    background-color: ${({tokens:e})=>e.core.backgroundError};
6760    color: ${({tokens:e})=>e.core.textError};
6761  }
6762
6763  :host([data-variant='certified']) {
6764    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
6765    color: ${({tokens:e})=>e.theme.textSecondary};
6766  }
6767
6768  :host([data-size='md']) {
6769    height: 30px;
6770    padding: 0 ${({spacing:e})=>e[2]};
6771    border-radius: ${({borderRadius:e})=>e[2]};
6772  }
6773
6774  :host([data-size='sm']) {
6775    height: 20px;
6776    padding: 0 ${({spacing:e})=>e[1]};
6777    border-radius: ${({borderRadius:e})=>e[1]};
6778  }
6779`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{constructor(){super(...arguments),this.variant="accent",this.size="md",this.icon=void 0}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;let e="md"===this.size?"md-medium":"sm-medium",t="md"===this.size?"md":"sm";return(0,n.dy)`
6780      ${this.icon?(0,n.dy)`<wui-icon size=${t} name=${this.icon}></wui-icon>`:null}
6781      <wui-text data-variant=${this.variant} variant=${e} color="inherit">
6782        <slot></slot>
6783      </wui-text>
6784    `}};u.styles=[o.ET,c],l([(0,i.Cb)()],u.prototype,"variant",void 0),l([(0,i.Cb)()],u.prototype,"size",void 0),l([(0,i.Cb)()],u.prototype,"icon",void 0),l([(0,s.M)("wui-tag")],u)},38023:function(e,t,r){"use strict";var n=r(19045),i=r(94836);r(92706),r(79086);var o=r(70169),s=r(66704);r(94272);var a=r(73718),c=(0,a.iv)`
6785  :host {
6786    position: relative;
6787    background-color: ${({tokens:e})=>e.theme.foregroundTertiary};
6788    display: flex;
6789    justify-content: center;
6790    align-items: center;
6791    border-radius: inherit;
6792    border-radius: var(--local-border-radius);
6793  }
6794
6795  :host([data-image='true']) {
6796    background-color: transparent;
6797  }
6798
6799  :host > wui-flex {
6800    overflow: hidden;
6801    border-radius: inherit;
6802    border-radius: var(--local-border-radius);
6803  }
6804
6805  :host([data-size='sm']) {
6806    width: 32px;
6807    height: 32px;
6808  }
6809
6810  :host([data-size='md']) {
6811    width: 40px;
6812    height: 40px;
6813  }
6814
6815  :host([data-size='lg']) {
6816    width: 56px;
6817    height: 56px;
6818  }
6819
6820  :host([name='Extension'])::after {
6821    border: 1px solid ${({colors:e})=>e.accent010};
6822  }
6823
6824  :host([data-wallet-icon='allWallets'])::after {
6825    border: 1px solid ${({colors:e})=>e.accent010};
6826  }
6827
6828  wui-icon[data-parent-size='inherit'] {
6829    width: 75%;
6830    height: 75%;
6831    align-items: center;
6832  }
6833
6834  wui-icon[data-parent-size='sm'] {
6835    width: 32px;
6836    height: 32px;
6837  }
6838
6839  wui-icon[data-parent-size='md'] {
6840    width: 40px;
6841    height: 40px;
6842  }
6843
6844  :host > wui-icon-box {
6845    position: absolute;
6846    overflow: hidden;
6847    right: -1px;
6848    bottom: -2px;
6849    z-index: 1;
6850    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
6851    padding: 1px;
6852  }
6853`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="1";return"lg"===this.size?e="4":"md"===this.size?e="2":"sm"===this.size&&(e="1"),this.style.cssText=`
6854       --local-border-radius: var(--apkt-borderRadius-${e});
6855   `,this.dataset.size=this.size,this.imageSrc&&(this.dataset.image="true"),this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),(0,n.dy)`
6856      <wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex>
6857    `}templateVisual(){return this.imageSrc?(0,n.dy)`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?(0,n.dy)`<wui-icon size="md" color="default" name=${this.walletIcon}></wui-icon>`:(0,n.dy)`<wui-icon
6858      data-parent-size=${this.size}
6859      size="inherit"
6860      color="inherit"
6861      name="wallet"
6862    ></wui-icon>`}};u.styles=[o.ET,c],l([(0,i.Cb)()],u.prototype,"size",void 0),l([(0,i.Cb)()],u.prototype,"name",void 0),l([(0,i.Cb)()],u.prototype,"imageSrc",void 0),l([(0,i.Cb)()],u.prototype,"walletIcon",void 0),l([(0,i.Cb)({type:Boolean})],u.prototype,"installed",void 0),l([(0,i.Cb)()],u.prototype,"badgeSize",void 0),l([(0,s.M)("wui-wallet-image")],u)},43845:function(e,t,r){"use strict";var n=r(19045),i=r(94836),o=r(70169),s=r(45182),a=r(66704),c=(0,n.iv)`
6863  :host {
6864    display: flex;
6865    width: inherit;
6866    height: inherit;
6867    box-sizing: border-box;
6868  }
6869`,l=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let u=class extends n.oi{render(){return this.style.cssText=`
6870      flex-direction: ${this.flexDirection};
6871      flex-wrap: ${this.flexWrap};
6872      flex-basis: ${this.flexBasis};
6873      flex-grow: ${this.flexGrow};
6874      flex-shrink: ${this.flexShrink};
6875      align-items: ${this.alignItems};
6876      justify-content: ${this.justifyContent};
6877      column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
6878      row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
6879      gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
6880      padding-top: ${this.padding&&s.H.getSpacingStyles(this.padding,0)};
6881      padding-right: ${this.padding&&s.H.getSpacingStyles(this.padding,1)};
6882      padding-bottom: ${this.padding&&s.H.getSpacingStyles(this.padding,2)};
6883      padding-left: ${this.padding&&s.H.getSpacingStyles(this.padding,3)};
6884      margin-top: ${this.margin&&s.H.getSpacingStyles(this.margin,
68840)};
6885      margin-right: ${this.margin&&s.H.getSpacingStyles(this.margin,1)};
6886      margin-bottom: ${this.margin&&s.H.getSpacingStyles(this.margin,2)};
6887      margin-left: ${this.margin&&s.H.getSpacingStyles(this.margin,3)};
6888      width: ${this.width};
6889    `,(0,n.dy)`<slot></slot>`}};u.styles=[o.ET,c],l([(0,i.Cb)()],u.prototype,"flexDirection",void 0),l([(0,i.Cb)()],u.prototype,"flexWrap",void 0),l([(0,i.Cb)()],u.prototype,"flexBasis",void 0),l([(0,i.Cb)()],u.prototype,"flexGrow",void 0),l([(0,i.Cb)()],u.prototype,"flexShrink",void 0),l([(0,i.Cb)()],u.prototype,"alignItems",void 0),l([(0,i.Cb)()],u.prototype,"justifyContent",void 0),l([(0,i.Cb)()],u.prototype,"columnGap",void 0),l([(0,i.Cb)()],u.prototype,"rowGap",void 0),l([(0,i.Cb)()],u.prototype,"gap",void 0),l([(0,i.Cb)()],u.prototype,"padding",void 0),l([(0,i.Cb)()],u.prototype,"margin",void 0),l([(0,i.Cb)()],u.prototype,"width",void 0),l([(0,a.M)("wui-flex")],u)},92784:function(e,t,r){"use strict";r.d(t,{Cv:function(){return n},Ub:function(){return o},ee:function(){return i}});let n=/[.*+?^${}()|[\]\\]/gu,i=/[0-9,.]/u,o="https://reown.com"},37307:function(e,t,r){"use strict";r.d(t,{TV:function(){return n},W2:function(){return i}});let n={core:{backgroundAccentPrimary:"#0988F0",backgroundAccentCertified:"#C7B994",backgroundWalletKit:"#FFB800",backgroundAppKit:"#FF573B",backgroundCloud:"#0988F0",backgroundDocumentation:"#008847",backgroundSuccess:"rgba(48, 164, 107, 0.20)",backgroundError:"rgba(223, 74, 52, 0.20)",backgroundWarning:"rgba(243, 161, 63, 0.20)",textAccentPrimary:"#0988F0",textAccentCertified:"#C7B994",textWalletKit:"#FFB800",textAppKit:"#FF573B",textCloud:"#0988F0",textDocumentation:"#008847",textSuccess:"#30A46B",textError:"#DF4A34",textWarning:"#F3A13F",borderAccentPrimary:"#0988F0",borderSecondary:"#C7B994",borderSuccess:"#30A46B",borderError:"#DF4A34",borderWarning:"#F3A13F",foregroundAccent010:"rgba(9, 136, 240, 0.1)",foregroundAccent020:"rgba(9, 136, 240, 0.2)",foregroundAccent040:"rgba(9, 136, 240, 0.4)",foregroundAccent060:"rgba(9, 136, 240, 0.6)",foregroundSecondary020:"rgba(199, 185, 148, 0.2)",foregroundSecondary040:"rgba(199, 185, 148, 0.4)",foregroundSecondary060:"rgba(199, 185, 148, 0.6)",iconAccentPrimary:"#0988F0",iconAccentCertified:"#C7B994",iconSuccess:"#30A46B",iconError:"#DF4A34",iconWarning:"#F3A13F",glass010:"rgba(255, 255, 255, 0.1)",zIndex:"9999"},dark:{overlay:"rgba(0, 0, 0, 0.50)",backgroundPrimary:"#202020",backgroundInvert:"#FFFFFF",textPrimary:"#FFFFFF",textSecondary:"#9A9A9A",textTertiary:"#BBBBBB",textInvert:"#202020",borderPrimary:"#2A2A2A",borderPrimaryDark:"#363636",borderSecondary:"#4F4F4F",foregroundPrimary:"#252525",foregroundSecondary:"#2A2A2A",foregroundTertiary:"#363636",iconDefault:"#9A9A9A",iconInverse:"#FFFFFF"},light:{overlay:"rgba(230 , 230, 230, 0.5)",backgroundPrimary:"#FFFFFF",borderPrimaryDark:"#E9E9E9",backgroundInvert:"#202020",textPrimary:"#202020",textSecondary:"#9A9A9A",textTertiary:"#6C6C6C",textInvert:"#FFFFFF",borderPrimary:"#E9E9E9",borderSecondary:"#D0D0D0",foregroundPrimary:"#F3F3F3",foregroundSecondary:"#E9E9E9",foregroundTertiary:"#D0D0D0",iconDefault:"#9A9A9A",iconInverse:"#202020"}},i={colors:{black:"#202020",white:"#FFFFFF",white010:"rgba(255, 255, 255, 0.1)",accent010:"rgba(9, 136, 240, 0.1)",accent020:"rgba(9, 136, 240, 0.2)",accent030:"rgba(9, 136, 240, 0.3)",accent040:"rgba(9, 136, 240, 0.4)",accent050:"rgba(9, 136, 240, 0.5)",accent060:"rgba(9, 136, 240, 0.6)",accent070:"rgba(9, 136, 240, 0.7)",accent080:"rgba(9, 136, 240, 0.8)",accent090:"rgba(9, 136, 240, 0.9)",accent100:"rgba(9, 136, 240, 1.0)",accentSecondary010:"rgba(199, 185, 148, 0.1)",accentSecondary020:"rgba(199, 185, 148, 0.2)",accentSecondary030:"rgba(199, 185, 148, 0.3)",accentSecondary040:"rgba(199, 185, 148, 0.4)",accentSecondary050:"rgba(199, 185, 148, 0.5)",accentSecondary060:"rgba(199, 185, 148, 0.6)",accentSecondary070:"rgba(199, 185, 148, 0.7)",accentSecondary080:"rgba(199, 185, 148, 0.8)",accentSecondary090:"rgba(199, 185, 148, 0.9)",accentSecondary100:"rgba(199, 185, 148, 1.0)",productWalletKit:"#FFB800",productAppKit:"#FF573B",productCloud:"#0988F0",productDocumentation:"#008847",neutrals050:"#F6F6F6",neutrals100:"#F3F3F3",neutrals200:"#E9E9E9",neutrals300:"#D0D0D0",neutrals400:"#BBB",neutrals500:"#9A9A9A",neutrals600:"#6C6C6C",neutrals700:"#4F4F4F",neutrals800:"#363636",neutrals900:"#2A2A2A",neutrals1000:"#252525",semanticSuccess010:"rgba(48, 164, 107, 0.1)",semanticSuccess020:"rgba(48, 164, 107, 0.2)",semanticSuccess030:"rgba(48, 164, 107, 0.3)",semanticSuccess040:"rgba(48, 164, 107, 0.4)",semanticSuccess050:"rgba(48, 164, 107, 0.5)",semanticSuccess060:"rgba(48, 164, 107, 0.6)",semanticSuccess070:"rgba(48, 164, 107, 0.7)",semanticSuccess080:"rgba(48, 164, 107, 0.8)",semanticSuccess090:"rgba(48, 164, 107, 0.9)",semanticSuccess100:"rgba(48, 164, 107, 1.0)",semanticError010:"rgba(223, 74, 52, 0.1)",semanticError020:"rgba(223, 74, 52, 0.2)",semanticError030:"rgba(223, 74, 52, 0.3)",semanticError040:"rgba(223, 74, 52, 0.4)",semanticError050:"rgba(223, 74, 52, 0.5)",semanticError060:"rgba(223, 74, 52, 0.6)",semanticError070:"rgba(223, 74, 52, 0.7)",semanticError080:"rgba(223, 74, 52, 0.8)",semanticError090:"rgba(223, 74, 52, 0.9)",semanticError100:"rgba(223, 74, 52, 1.0)",semanticWarning010:"rgba(243, 161, 63, 0.1)",semanticWarning020:"rgba(243, 161, 63, 0.2)",semanticWarning030:"rgba(243, 161, 63, 0.3)",semanticWarning040:"rgba(243, 161, 63, 0.4)",semanticWarning050:"rgba(243, 161, 63, 0.5)",semanticWarning060:"rgba(243, 161, 63, 0.6)",semanticWarning070:"rgba(243, 161, 63, 0.7)",semanticWarning080:"rgba(243, 161, 63, 0.8)",semanticWarning090:"rgba(243, 161, 63, 0.9)",semanticWarning100:"rgba(243, 161, 63, 1.0)"},fontFamily:{regular:"KHTeka",mono:"KHTekaMono"},fontWeight:{regular:"400",medium:"500"},textSize:{h1:"50px",h2:"44px",h3:"38px",h4:"32px",h5:"26px",h6:"20px",large:"16px",medium:"14px",small:"12px"},typography:{"h1-regular-mono":{lineHeight:"50px",letterSpacing:"-3px"},"h1-regular":{lineHeight:"50px",letterSpacing:"-1px"},"h1-medium":{lineHeight:"50px",letterSpacing:"-0.84px"},"h2-regular-mono":{lineHeight:"44px",letterSpacing:"-2.64px"},"h2-regular":{lineHeight:"44px",letterSpacing:"-0.88px"},"h2-medium":{lineHeight:"44px",letterSpacing:"-0.88px"},"h3-regular-mono":{lineHeight:"38px",letterSpacing:"-2.28px"},"h3-regular":{lineHeight:"38px",letterSpacing:"-0.76px"},"h3-medium":{lineHeight:"38px",letterSpacing:"-0.76px"},"h4-regular-mono":{lineHeight:"32px",letterSpacing:"-1.92px"},"h4-regular":{lineHeight:"32px",letterSpacing:"-0.32px"},"h4-medium":{lineHeight:"32px",letterSpacing:"-0.32px"},"h5-regular-mono":{lineHeight:"26px",letterSpacing:"-1.56px"},"h5-regular":{lineHeight:"26px",letterSpacing:"-0.26px"},"h5-medium":{lineHeight:"26px",letterSpacing:"-0.26px"},"h6-regular-mono":{lineHeight:"20px",letterSpacing:"-1.2px"},"h6-regular":{lineHeight:"20px",letterSpacing:"-0.6px"},"h6-medium":{lineHeight:"20px",letterSpacing:"-0.6px"},"lg-regular-mono":{lineHeight:"16px",letterSpacing:"-0.96px"},"lg-regular":{lineHeight:"18px",letterSpacing:"-0.16px"},"lg-medium":{lineHeight:"18px",letterSpacing:"-0.16px"},"md-regular-mono":{lineHeight:"14px",letterSpacing:"-0.84px"},"md-regular":{lineHeight:"16px",letterSpacing:"-0.14px"},"md-medium":{lineHeight:"16px",letterSpacing:"-0.14px"},"sm-regular-mono":{lineHeight:"12px",letterSpacing:"-0.72px"},"sm-regular":{lineHeight:"14px",letterSpacing:"-0.12px"},"sm-medium":{lineHeight:"14px",letterSpacing:"-0.12px"}},tokens:{core:n.core,theme:n.dark},borderRadius:{1:"4px",2:"8px",10:"10px",3:"12px",4:"16px",6:"24px",5:"20px",8:"32px",16:"64px",20:"80px",32:"128px",64:"256px",128:"512px",round:"9999px"},spacing:{0:"0px","01":"2px",1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",12:"48px",14:"56px",16:"64px",20:"80px",32:"128px",64:"256px"},durations:{xl:"400ms",lg:"200ms",md:"125ms",sm:"75ms"}
6889,easings:{"ease-out-power-2":"cubic-bezier(0.23, 0.09, 0.08, 1.13)","ease-out-power-1":"cubic-bezier(0.12, 0.04, 0.2, 1.06)","ease-in-power-2":"cubic-bezier(0.92, -0.13, 0.77, 0.91)","ease-in-power-1":"cubic-bezier(0.88, -0.06, 0.8, 0.96)","ease-inout-power-2":"cubic-bezier(0.77, 0.09, 0.23, 1.13)","ease-inout-power-1":"cubic-bezier(0.88, 0.04, 0.12, 1.06)"}}},73718:function(e,t,r){"use strict";r.d(t,{e5:function(){return s},gR:function(){return a},iv:function(){return c}});var n=r(19045),i=r(37307);let o="--apkt",s={createCSSVariables(e){let t={},r={};return!function e(t,r,n=""){for(let[i,s]of Object.entries(t)){let t=n?`${n}-${i}`:i;s&&"object"==typeof s&&Object.keys(s).length?(r[i]={},e(s,r[i],t)):"string"==typeof s&&(r[i]=`${o}-${t}`)}}(e,t),!function e(t,r){for(let[n,i]of Object.entries(t))i&&"object"==typeof i?(r[n]={},e(i,r[n])):"string"==typeof i&&(r[n]=`var(${i})`)}(t,r),{cssVariables:t,cssVariablesVarPrefix:r}},assignCSSVariables(e,t){let r={};return!function e(t,n,i){for(let[s,a]of Object.entries(t)){let t=i?`${i}-${s}`:s,c=n[s];a&&"object"==typeof a?e(a,c,t):"string"==typeof c&&(r[`${o}-${t}`]=c)}}(e,t),r},createRootStyles(e,t){let r={...i.W2,tokens:{...i.W2.tokens,theme:"light"===e?i.TV.light:i.TV.dark}},{cssVariables:n}=s.createCSSVariables(r),o=s.assignCSSVariables(n,r),a=s.generateW3MVariables(t),c=s.generateW3MOverrides(t),l=s.generateScaledVariables(t),u=s.generateBaseVariables(o),d={...o,...u,...a,...c,...l},h=s.applyColorMixToVariables(t,d),p=Object.entries({...d,...h}).map(([e,t])=>`${e}:${t.replace("/[:;{}</>]/g","")};`).join("");return`:root {${p}}`},generateW3MVariables(e){if(!e)return{};let t={};return t["--w3m-font-family"]=e["--w3m-font-family"]||"KHTeka",t["--w3m-accent"]=e["--w3m-accent"]||"#0988F0",t["--w3m-color-mix"]=e["--w3m-color-mix"]||"#000",t["--w3m-color-mix-strength"]=`${e["--w3m-color-mix-strength"]||0}%`,t["--w3m-font-size-master"]=e["--w3m-font-size-master"]||"10px",t["--w3m-border-radius-master"]=e["--w3m-border-radius-master"]||"4px",t},generateW3MOverrides(e){if(!e)return{};let t={};if(e["--w3m-accent"]){let r=e["--w3m-accent"];t["--apkt-tokens-core-iconAccentPrimary"]=r,t["--apkt-tokens-core-borderAccentPrimary"]=r,t["--apkt-tokens-core-textAccentPrimary"]=r,t["--apkt-tokens-core-backgroundAccentPrimary"]=r}return e["--w3m-font-family"]&&(t["--apkt-fontFamily-regular"]=e["--w3m-font-family"]),e["--w3m-z-index"]&&(t["--apkt-tokens-core-zIndex"]=`${e["--w3m-z-index"]}`),t},generateScaledVariables(e){if(!e)return{};let t={};if(e["--w3m-font-size-master"]){let r=parseFloat(e["--w3m-font-size-master"].replace("px",""));t["--apkt-textSize-h1"]=`${5*Number(r)}px`,t["--apkt-textSize-h2"]=`${4.4*Number(r)}px`,t["--apkt-textSize-h3"]=`${3.8*Number(r)}px`,t["--apkt-textSize-h4"]=`${3.2*Number(r)}px`,t["--apkt-textSize-h5"]=`${2.6*Number(r)}px`,t["--apkt-textSize-h6"]=`${2*Number(r)}px`,t["--apkt-textSize-large"]=`${1.6*Number(r)}px`,t["--apkt-textSize-medium"]=`${1.4*Number(r)}px`,t["--apkt-textSize-small"]=`${1.2*Number(r)}px`}if(e["--w3m-border-radius-master"]){let r=parseFloat(e["--w3m-border-radius-master"].replace("px",""));t["--apkt-borderRadius-1"]=`${Number(r)}px`,t["--apkt-borderRadius-2"]=`${2*Number(r)}px`,t["--apkt-borderRadius-3"]=`${3*Number(r)}px`,t["--apkt-borderRadius-4"]=`${4*Number(r)}px`,t["--apkt-borderRadius-5"]=`${5*Number(r)}px`,t["--apkt-borderRadius-6"]=`${6*Number(r)}px`,t["--apkt-borderRadius-8"]=`${8*Number(r)}px`,t["--apkt-borderRadius-16"]=`${16*Number(r)}px`,t["--apkt-borderRadius-20"]=`${20*Number(r)}px`,t["--apkt-borderRadius-32"]=`${32*Number(r)}px`,t["--apkt-borderRadius-64"]=`${64*Number(r)}px`,t["--apkt-borderRadius-128"]=`${128*Number(r)}px`}return t},generateColorMixCSS(e,t){if(!e?.["--w3m-color-mix"]||!e["--w3m-color-mix-strength"])return"";let r=e["--w3m-color-mix"],n=e["--w3m-color-mix-strength"];if(!n||0===n)return"";let i=Object.keys(t||{}).filter(e=>{let t=e.includes("-tokens-core-background")||e.includes("-tokens-core-text")||e.includes("-tokens-core-border")||e.includes("-tokens-core-foreground")||e.includes("-tokens-core-icon")||e.includes("-tokens-theme-background")||e.includes("-tokens-theme-text")||e.includes("-tokens-theme-border")||e.includes("-tokens-theme-foreground")||e.includes("-tokens-theme-icon"),r=e.includes("-borderRadius-")||e.includes("-spacing-")||e.includes("-textSize-")||e.includes("-fontFamily-")||e.includes("-fontWeight-")||e.includes("-typography-")||e.includes("-duration-")||e.includes("-ease-")||e.includes("-path-")||e.includes("-width-")||e.includes("-height-")||e.includes("-visual-size-")||e.includes("-modal-width")||e.includes("-cover");return t&&!r});if(0===i.length)return"";let o=i.map(e=>{let i=t?.[e]||"";return i.includes("color-mix")||i.startsWith("#")||i.startsWith("rgb")?`${e}: color-mix(in srgb, ${r} ${n}%, ${i});`:`${e}: color-mix(in srgb, ${r} ${n}%, var(${e}-base, ${i}));`}).join("");return` @supports (background: color-mix(in srgb, white 50%, black)) {
6890      :root {
6891        ${o}
6892      }
6893    }`},generateBaseVariables(e){let t={},r=e["--apkt-tokens-theme-backgroundPrimary"];r&&(t["--apkt-tokens-theme-backgroundPrimary-base"]=r);let n=e["--apkt-tokens-core-backgroundAccentPrimary"];return n&&(t["--apkt-tokens-core-backgroundAccentPrimary-base"]=n),t},applyColorMixToVariables(e,t){let r={};if(t?.["--apkt-tokens-theme-backgroundPrimary"]&&(r["--apkt-tokens-theme-backgroundPrimary"]="var(--apkt-tokens-theme-backgroundPrimary-base)"),t?.["--apkt-tokens-core-backgroundAccentPrimary"]&&(r["--apkt-tokens-core-backgroundAccentPrimary"]="var(--apkt-tokens-core-backgroundAccentPrimary-base)"),!e?.["--w3m-color-mix"]||!e["--w3m-color-mix-strength"])return r;let n=e["--w3m-color-mix"],i=e["--w3m-color-mix-strength"];if(!i||0===i)return r;let o=Object.keys(t||{}).filter(e=>{let t=e.includes("-tokens-core-background")||e.includes("-tokens-core-text")||e.includes("-tokens-core-border")||e.includes("-tokens-core-foreground")||e.includes("-tokens-core-icon")||e.includes("-tokens-theme-background")||e.includes("-tokens-theme-text")||e.includes("-tokens-theme-border")||e.includes("-tokens-theme-foreground")||e.includes("-tokens-theme-icon")||e.includes("-tokens-theme-overlay"),r=e.includes("-borderRadius-")||e.includes("-spacing-")||e.includes("-textSize-")||e.includes("-fontFamily-")||e.includes("-fontWeight-")||e.includes("-typography-")||e.includes("-duration-")||e.includes("-ease-")||e.includes("-path-")||e.includes("-width-")||e.includes("-height-")||e.includes("-visual-size-")||e.includes("-modal-width")||e.includes("-cover");return t&&!r});
6893return 0===o.length||o.forEach(e=>{let o=t?.[e]||"";e.endsWith("-base")||("--apkt-tokens-theme-backgroundPrimary"===e||"--apkt-tokens-core-backgroundAccentPrimary"===e?r[e]=`color-mix(in srgb, ${n} ${i}%, var(${e}-base))`:o.includes("color-mix")||o.startsWith("#")||o.startsWith("rgb")?r[e]=`color-mix(in srgb, ${n} ${i}%, ${o})`:r[e]=`color-mix(in srgb, ${n} ${i}%, var(${e}-base, ${o}))`)}),r}},{cssVariablesVarPrefix:a}=s.createCSSVariables(i.W2);function c(e,...t){return(0,n.iv)(e,...t.map(e=>"function"==typeof e?(0,n.$m)(e(a)):(0,n.$m)(e)))}},70169:function(e,t,r){"use strict";let n,i,o,s,a;r.d(t,{ET:function(){return m},Hs:function(){return p},R:function(){return f},ZM:function(){return y},n:function(){return h}});var c=r(19045),l=r(73718);let u={"KHTeka-500-woff2":"https://fonts.reown.com/KHTeka-Medium.woff2","KHTeka-400-woff2":"https://fonts.reown.com/KHTeka-Regular.woff2","KHTeka-300-woff2":"https://fonts.reown.com/KHTeka-Light.woff2","KHTekaMono-400-woff2":"https://fonts.reown.com/KHTekaMono-Regular.woff2","KHTeka-500-woff":"https://fonts.reown.com/KHTeka-Light.woff","KHTeka-400-woff":"https://fonts.reown.com/KHTeka-Regular.woff","KHTeka-300-woff":"https://fonts.reown.com/KHTeka-Light.woff","KHTekaMono-400-woff":"https://fonts.reown.com/KHTekaMono-Regular.woff"};function d(e,t="dark"){n&&document.head.removeChild(n),(n=document.createElement("style")).textContent=l.e5.createRootStyles(t,e),document.head.appendChild(n)}function h(e,t="dark"){if(a=e,i=document.createElement("style"),o=document.createElement("style"),s=document.createElement("style"),i.textContent=g(e).core.cssText,o.textContent=g(e).dark.cssText,s.textContent=g(e).light.cssText,document.head.appendChild(i),document.head.appendChild(o),document.head.appendChild(s),d(e,t),p(t),!e?.["--w3m-font-family"])for(let[e,t]of Object.entries(u)){let r=document.createElement("link");r.rel="preload",r.href=t,r.as="font",r.type=e.includes("woff2")?"font/woff2":"font/woff",r.crossOrigin="anonymous",document.head.appendChild(r)}p(t)}function p(e="dark"){o&&s&&n&&("light"===e?(d(a,e),o.removeAttribute("media"),s.media="enabled"):(d(a,e),s.removeAttribute("media"),o.media="enabled"))}function f(e){if(a=e,i&&o&&s&&(i.textContent=g(e).core.cssText,o.textContent=g(e).dark.cssText,s.textContent=g(e).light.cssText,e?.["--w3m-font-family"])){let t=e["--w3m-font-family"];i.textContent=i.textContent?.replace("font-family: KHTeka",`font-family: ${t}`),o.textContent=o.textContent?.replace("font-family: KHTeka",`font-family: ${t}`),s.textContent=s.textContent?.replace("font-family: KHTeka",`font-family: ${t}`)}n&&d(e,s?.media==="enabled"?"light":"dark")}function g(e){let t=!!e?.["--w3m-font-family"];return{core:(0,c.iv)`
6894      ${t?(0,c.iv)``:(0,c.iv)`
6895            @font-face {
6896              font-family: 'KHTeka';
6897              src:
6898                url(${(0,c.$m)(u["KHTeka-400-woff2"])}) format('woff2'),
6899                url(${(0,c.$m)(u["KHTeka-400-woff"])}) format('woff');
6900              font-weight: 400;
6901              font-style: normal;
6902              font-display: swap;
6903            }
6904
6905            @font-face {
6906              font-family: 'KHTeka';
6907              src:
6908                url(${(0,c.$m)(u["KHTeka-300-woff2"])}) format('woff2'),
6909                url(${(0,c.$m)(u["KHTeka-300-woff"])}) format('woff');
6910              font-weight: 300;
6911              font-style: normal;
6912            }
6913
6914            @font-face {
6915              font-family: 'KHTekaMono';
6916              src:
6917                url(${(0,c.$m)(u["KHTekaMono-400-woff2"])}) format('woff2'),
6918                url(${(0,c.$m)(u["KHTekaMono-400-woff"])}) format('woff');
6919              font-weight: 400;
6920              font-style: normal;
6921            }
6922
6923            @font-face {
6924              font-family: 'KHTeka';
6925              src:
6926                url(${(0,c.$m)(u["KHTeka-400-woff2"])}) format('woff2'),
6927                url(${(0,c.$m)(u["KHTeka-400-woff"])}) format('woff');
6928              font-weight: 400;
6929              font-style: normal;
6930            }
6931          `}
6932
6933      @keyframes w3m-shake {
6934        0% {
6935          transform: scale(1) rotate(0deg);
6936        }
6937        20% {
6938          transform: scale(1) rotate(-1deg);
6939        }
6940        40% {
6941          transform: scale(1) rotate(1.5deg);
6942        }
6943        60% {
6944          transform: scale(1) rotate(-1.5deg);
6945        }
6946        80% {
6947          transform: scale(1) rotate(1deg);
6948        }
6949        100% {
6950          transform: scale(1) rotate(0deg);
6951        }
6952      }
6953      @keyframes w3m-iframe-fade-out {
6954        0% {
6955          opacity: 1;
6956        }
6957        100% {
6958          opacity: 0;
6959        }
6960      }
6961      @keyframes w3m-iframe-zoom-in {
6962        0% {
6963          transform: translateY(50px);
6964          opacity: 0;
6965        }
6966        100% {
6967          transform: translateY(0px);
6968          opacity: 1;
6969        }
6970      }
6971      @keyframes w3m-iframe-zoom-in-mobile {
6972        0% {
6973          transform: scale(0.95);
6974          opacity: 0;
6975        }
6976        100% {
6977          transform: scale(1);
6978          opacity: 1;
6979        }
6980      }
6981      :root {
6982        --apkt-modal-width: 370px;
6983
6984        --apkt-visual-size-inherit: inherit;
6985        --apkt-visual-size-sm: 40px;
6986        --apkt-visual-size-md: 55px;
6987        --apkt-visual-size-lg: 80px;
6988
6989        --apkt-path-network-sm: path(
6990          'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.
699061 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z'
6991        );
6992
6993        --apkt-path-network-md: path(
6994          'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z'
6995        );
6996
6997        --apkt-path-network-lg: path(
6998          'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z'
6999        );
7000
7001        --apkt-width-network-sm: 36px;
7002        --apkt-width-network-md: 48px;
7003        --apkt-width-network-lg: 86px;
7004
7005        --apkt-duration-dynamic: 0ms;
7006        --apkt-height-network-sm: 40px;
7007        --apkt-height-network-md: 54px;
7008        --apkt-height-network-lg: 96px;
7009      }
7010    `,dark:(0,c.iv)`
7011      :root {
7012      }
7013    `,light:(0,c.iv)`
7014      :root {
7015      }
7016    `}}let m=(0,c.iv)`
7017  div,
7018  span,
7019  iframe,
7020  a,
7021  img,
7022  form,
7023  button,
7024  label,
7025  *::after,
7026  *::before {
7027    margin: 0;
7028    padding: 0;
7029    box-sizing: border-box;
7030    font-style: normal;
7031    text-rendering: optimizeSpeed;
7032    -webkit-font-smoothing: antialiased;
7033    -moz-osx-font-smoothing: grayscale;
7034    -webkit-tap-highlight-color: transparent;
7035    backface-visibility: hidden;
7036  }
7037
7038  :host {
7039    font-family: var(--apkt-fontFamily-regular);
7040  }
7041`,y=(0,c.iv)`
7042  button,
7043  a {
7044    cursor: pointer;
7045    display: flex;
7046    justify-content: center;
7047    align-items: center;
7048    position: relative;
7049
7050    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
7051    outline: none;
7052    border: none;
7053    text-decoration: none;
7054    transition:
7055      background-color var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7056      color var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7057      border var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7058      box-shadow var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7059      width var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7060      height var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7061      transform var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7062      opacity var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7063      scale var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7064      border-radius var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2);
7065    will-change:
7066      background-color, color, border, box-shadow, width, height, transform, opacity, scale,
7067      border-radius;
7068  }
7069
7070  a:active:not([disabled]),
7071  button:active:not([disabled]) {
7072    scale: 0.975;
7073    transform-origin: center;
7074  }
7075
7076  button:disabled {
7077    cursor: default;
7078  }
7079
7080  input {
7081    border: none;
7082    outline: none;
7083    appearance: none;
7084  }
7085`},45182:function(e,t,r){"use strict";r.d(t,{H:function(){return n}});let n={getSpacingStyles:(e,t)=>Array.isArray(e)?e[t]?`var(--apkt-spacing-${e[t]})`:void 0:"string"==typeof e?`var(--apkt-spacing-${e})`:void 0,getFormattedDate:e=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(e),formatCurrency(e=0,t={}){let r=Number(e);return isNaN(r)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...t}).format(r)},getHostName(e){try{return new URL(e).hostname}catch(e){return""}},getTruncateString:({string:e,charsStart:t,charsEnd:r,truncate:n})=>e.length<=t+r?e:"end"===n?`${e.substring(0,t)}...`:"start"===n?`...${e.substring(e.length-r)}`:`${e.substring(0,Math.floor(t))}...${e.substring(e.length-Math.floor(r))}`,generateAvatarColors(e){let t=e.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),r=this.hexToRgb(t),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),i=100-3*Number(n?.replace("px","")),o=`${i}% ${i}% at 65% 40%`,s=[];for(let e=0;e<5;e+=1){let t=this.tintColor(r,.15*e);s.push(`rgb(${t[0]}, ${t[1]}, ${t[2]})`)}return`
7086    --local-color-1: ${s[0]};
7087    --local-color-2: ${s[1]};
7088    --local-color-3: ${s[2]};
7089    --local-color-4: ${s[3]};
7090    --local-color-5: ${s[4]};
7091    --local-radial-circle: ${o}
7092   `},hexToRgb(e){let t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t]},tintColor(e,t){let[r,n,i]=e;return[Math.round(r+(255-r)*t),Math.round(n+(255-n)*t),Math.round(i+(255-i)*t)]},isNumber:e=>/^[0-9]+$/u.test(e),getColorTheme:e=>e||("undefined"!=typeof window&&window.matchMedia&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)")?.matches?"dar
7092k":"light":"dark"),splitBalance(e){let t=e.split(".");return 2===t.length?[t[0],t[1]]:["0","00"]},roundNumber:(e,t,r)=>e.toString().length>=t?Number(e).toFixed(r):e,cssDurationToNumber:e=>e.endsWith("s")?1e3*Number(e.replace("s","")):e.endsWith("ms")?Number(e.replace("ms","")):0}},66704:function(e,t,r){"use strict";function n(e){return function(t){return"function"==typeof t?(customElements.get(e)||customElements.define(e,t),t):function(e,t){let{kind:r,elements:n}=t;return{kind:r,elements:n,finisher(t){customElements.get(e)||customElements.define(e,t)}}}(e,t)}}r.d(t,{M:function(){return n}})},92290:function(e,t,r){"use strict";r.d(t,{f:function(){return m}});var n=r(94650),i=r(88002),o=r(78612),s=r(46611),a=r(92179);function c(e,t={}){let{key:r="fallback",name:n="Fallback",rank:i=!1,shouldThrow:o=l,retryCount:c,retryDelay:u}=t;return({chain:t,pollingInterval:l=4e3,timeout:d,...h})=>{let p=e,f=()=>{},g=(0,a.q)({key:r,name:n,async request({method:e,params:r}){let n;let i=async(s=0)=>{let a=p[s]({...h,chain:t,retryCount:0,timeout:d});try{let t=await a.request({method:e,params:r});return f({method:e,params:r,response:t,transport:a,status:"success"}),t}catch(c){if(f({error:c,method:e,params:r,transport:a,status:"error"}),o(c)||s===p.length-1||!(n??=p.slice(s+1).some(r=>{let{include:n,exclude:i}=r({chain:t}).config.methods||{};return n?n.includes(e):!i||!i.includes(e)})))throw c;return i(s+1)}};return i()},retryCount:c,retryDelay:u,type:"fallback"},{onResponse:e=>f=e,transports:p.map(e=>e({chain:t,retryCount:0}))});if(i){let e="object"==typeof i?i:{};!function({chain:e,interval:t=4e3,onTransports:r,ping:n,sampleCount:i=10,timeout:o=1e3,transports:a,weights:c={}}){let{stability:l=.7,latency:u=.3}=c,d=[],h=async()=>{let c=await Promise.all(a.map(async t=>{let r,i;let s=t({chain:e,retryCount:0,timeout:o}),a=Date.now();try{await (n?n({transport:s}):s.request({method:"net_listening"})),i=1}catch{i=0}finally{r=Date.now()}return{latency:r-a,success:i}}));d.push(c),d.length>i&&d.shift();let p=Math.max(...d.map(e=>Math.max(...e.map(({latency:e})=>e))));r(a.map((e,t)=>{let r=d.map(e=>e[t].latency),n=r.reduce((e,t)=>e+t,0)/r.length,i=d.map(e=>e[t].success),o=i.reduce((e,t)=>e+t,0)/i.length;return 0===o?[0,t]:[u*(1-n/p)+l*o,t]}).sort((e,t)=>t[0]-e[0]).map(([,e])=>a[e])),await (0,s.D)(t),h()};h()}({chain:t,interval:e.interval??l,onTransports:e=>p=e,ping:e.ping,sampleCount:e.sampleCount,timeout:e.timeout,transports:p,weights:e.weights})}return g}}function l(e){return!!("code"in e&&"number"==typeof e.code&&(e.code===o.KB.code||e.code===o.ab.code||i.M_.nodeMessage.test(e.message)||5e3===e.code))}var u=r(42036),d=r(33802),h=r(39674),p=r(41248);function f(e,t){let r=new URL("https://rpc.walletconnect.org/v1/");return r.searchParams.set("chainId",e),r.searchParams.set("projectId",t),r.toString()}let g=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:56","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301","eip155:80094","eip155:80069","eip155:560048","eip155:31","eip155:2818","eip155:57054","eip155:911867","eip155:534351","eip155:1112","eip155:534352","eip155:1111","eip155:146","eip155:130","eip155:1284","eip155:30","eip155:2810","bip122:000000000019d6689c085ae165831e93","bip122:000000000933ea01ad0ee984209779ba"],m={extendRpcUrlWithProjectId(e,t){let r=!1;try{r="rpc.walletconnect.org"===new URL(e).host}catch(e){r=!1}if(r){let r=new URL(e);return r.searchParams.has("projectId")||r.searchParams.set("projectId",t),r.toString()}return e},isCaipNetwork:e=>"chainNamespace"in e&&"caipNetworkId"in e,getChainNamespace(e){return this.isCaipNetwork(e)?e.chainNamespace:u.b.CHAIN.EVM},getCaipNetworkId(e){return this.isCaipNetwork(e)?e.caipNetworkId:`${u.b.CHAIN.EVM}:${e.id}`},getDefaultRpcUrl(e,t,r){let n=e.rpcUrls?.default?.http?.[0];return g.includes(t)?f(t,r):n||""},extendCaipNetwork(e,{customNetworkImageUrls:t,projectId:r,customRpcUrls:n}){let i=this.getChainNamespace(e),o=this.getCaipNetworkId(e),s=e.rpcUrls?.default?.http?.[0],a=this.getDefaultRpcUrl(e,o,r),c=e?.rpcUrls?.chainDefault?.http?.[0]||s,l=n?.[o]?.map(e=>e.url)||[],u=[...l,...a?[a]:[]],d=[...l];return c&&!d.includes(c)&&d.push(c),{...e,chainNamespace:i,caipNetworkId:o,assets:{imageId:p.C.NetworkImageIds[e.id],imageUrl:t?.[e.id]},rpcUrls:{...e.rpcUrls,default:{http:u},chainDefault:{http:d}}}},extendCaipNetworks:(e,{customNetworkImageUrls:t,projectId:r,customRpcUrls:n})=>e.map(e=>m.extendCaipNetwork(e,{customNetworkImageUrls:t,customRpcUrls:n,projectId:r}
7092)),getViemTransport(e,t,r){let i=[];return r?.forEach(e=>{i.push(n.d(e.url,e.config))}),g.includes(e.caipNetworkId)&&i.push((0,n.d)(f(e.caipNetworkId,t),{fetchOptions:{headers:{"Content-Type":"text/plain"}}})),e?.rpcUrls?.default?.http?.forEach(e=>{i.push(n.d(e))}),c(i)},extendWagmiTransports(e,t,r){if(g.includes(e.caipNetworkId)){let i=this.getDefaultRpcUrl(e,e.caipNetworkId,t);return c([r,(0,n.d)(i)])}return r},getUnsupportedNetwork:e=>({id:e.split(":")[1],caipNetworkId:e,name:u.b.UNSUPPORTED_NETWORK_NAME,chainNamespace:e.split(":")[0],nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}}),getCaipNetworkFromStorage(e){let t=d.M.getActiveCaipNetworkId(),r=h.R.getAllRequestedCaipNetworks(),n=Array.from(h.R.state.chains?.keys()||[]),i=t?.split(":")[0],o=!!i&&n.includes(i),s=r?.find(e=>e.caipNetworkId===t);return o&&!s&&t?this.getUnsupportedNetwork(t):s||e||r?.[0]}}},48459:function(e,t,r){"use strict";r.d(t,{b:function(){return n}});let n={METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",OKX_CONNECTOR_NAME:"OKX Wallet",EIP155:r(42036).b.CHAIN.EVM,ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"ID_AUTH",getSDKVersionWarningMessage:(e,t)=>`
7093     @@@@@@@           @@@@@@@@@@@@@@@@@@      
7094   @@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@   
7095  @@@@@@@@@@@@@    @@@@@@@@@@@@@@@@@@@@@@@@@@  
7096 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@  
7097 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@   @@@@@@@@@@@ 
7098 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@   @@@@@@@@@@@@ 
7099 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@  @@@@@@@@@@@@@
7100 @@@@@@@@@@@@@@@  @@@@@@@@@@@@   @@@@@@@@@@@@@    
7101 @@@@@@   @@@@@@  @@@@@@@@@@@   @@@@@@@@@@@@@@    
7102 @@@@@@   @@@@@@  @@@@@@@@@@@  @@@@@@@@@@@@@@@ 
7103 @@@@@@@@@@@@@@@  @@@@@@@@@@   @@@@@@@@@@@@@@@ 
7104 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@  
7105  @@@@@@@@@@@@@    @@@@@@@@@@@@@@@@@@@@@@@@@@  
7106   @@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@   
7107      @@@@@            @@@@@@@@@@@@@@@@@@  
7108      
7109AppKit SDK version ${e} is outdated. Latest version is ${t}. Please update to the latest version for bug fixes and new features.
7110            
7111Changelog: https://github.com/reown-com/appkit/releases
7112NPM Registry: https://www.npmjs.com/package/@reown/appkit`}},52726:function(e,t,r){"use strict";r.d(t,{j:function(){return i}});var n=r(6026);let i={EmbeddedWalletAbortController:new AbortController,UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:{message:"Unauthorized: origin not allowed",alertErrorKey:"ORIGIN_NOT_ALLOWED"},JWT_VALIDATION_ERROR:{message:"JWT validation error: JWT Token is not yet valid",alertErrorKey:"JWT_TOKEN_NOT_VALID"},INVALID_KEY:{message:"Unauthorized: invalid key",alertErrorKey:"INVALID_PROJECT_ID"}},ALERT_ERRORS:{SWITCH_NETWORK_NOT_FOUND:{code:"APKT001",displayMessage:"Network Not Found",debugMessage:"The specified network is not recognized. Please ensure it is included in the `networks` array of your `createAppKit` configuration."},ORIGIN_NOT_ALLOWED:{code:"APKT002",displayMessage:"Invalid App Configuration",debugMessage:()=>`The origin ${(0,n.$U)()?window.origin:"unknown"} is not in your allow list. Please update your allowed domains at https://dashboard.reown.com.`},IFRAME_LOAD_FAILED:{code:"APKT003",displayMessage:"Network Error: Wallet Load Failed",debugMessage:()=>"Failed to load the embedded wallet. This may be due to network issues or server downtime. Please check your network connection and try again shortly. Contact support if the issue persists."},IFRAME_REQUEST_TIMEOUT:{code:"APKT004",displayMessage:"Wallet Request Timeout",debugMessage:()=>"The request to the embedded wallet timed out. Please check your network connection and try again shortly. Contact support if the issue persists."},UNVERIFIED_DOMAIN:{code:"APKT005",displayMessage:"Unverified Domain",debugMessage:()=>"Embedded wallet load failed. Ensure your domain is verified in https://dashboard.reown.com."},JWT_TOKEN_NOT_VALID:{code:"APKT006",displayMessage:"Session Expired",debugMessage:"Your session is invali
7112d or expired. Please check your system’s date and time settings, then reconnect."},INVALID_PROJECT_ID:{code:"APKT007",displayMessage:"Invalid Project ID",debugMessage:"The specified project ID is invalid. Please visit https://dashboard.reown.com to obtain a valid project ID."},PROJECT_ID_NOT_CONFIGURED:{code:"APKT008",displayMessage:"Project ID Missing",debugMessage:"No project ID is configured. You can create and configure a project ID at https://dashboard.reown.com."},SERVER_ERROR_APP_CONFIGURATION:{code:"APKT009",displayMessage:"Server Error",debugMessage:e=>`Unable to fetch App Configuration. ${e}. Please check your network connection and try again shortly. Contact support if the issue persists.`},RATE_LIMITED_APP_CONFIGURATION:{code:"APKT010",displayMessage:"Rate Limited",debugMessage:"You have been rate limited while retrieving App Configuration. Please wait a few minutes and try again. Contact support if the issue persists."}},ALERT_WARNINGS:{LOCAL_CONFIGURATION_IGNORED:{debugMessage:e=>`[Reown Config Notice] ${e}`},INACTIVE_NAMESPACE_NOT_CONNECTED:{code:"APKTW001",displayMessage:"Inactive Namespace Not Connected",debugMessage:(e,t)=>`An error occurred while connecting an inactive namespace ${e}: "${t}"`},INVALID_EMAIL:{code:"APKTW002",displayMessage:"Invalid Email Address",debugMessage:"Please enter a valid email address"}}}},33279:function(e,t,r){"use strict";r.d(t,{g:function(){return c}});var n=r(42036),i=r(39674),o=r(20274),s=r(33802),a=r(48459);let c={getCaipTokens(e){if(!e)return;let t={};return Object.entries(e).forEach(([e,r])=>{t[`${a.b.EIP155}:${e}`]=r}),t},isLowerCaseMatch:(e,t)=>e?.toLowerCase()===t?.toLowerCase(),getActiveNamespaceConnectedToAuth(){let e=i.R.state.activeChain;return n.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(t=>o.ConnectorController.getConnectorId(t)===n.b.CONNECTOR_ID.AUTH&&t===e)},withRetry({conditionFn:e,intervalMs:t,maxRetries:r}){let n=0;return new Promise(i=>{async function o(){return(n+=1,await e())?i(!0):n>=r?i(!1):(setTimeout(o,t),null)}o()})},userChainIdToChainNamespace(e){if("number"==typeof e)return n.b.CHAIN.EVM;let[t]=e.split(":");return t},getOtherAuthNamespaces:e=>e?n.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.filter(t=>t!==e):[],getConnectorStorageInfo(e,t){let r=s.M.getConnections()[t]??[];return{hasDisconnected:s.M.isConnectorDisconnected(e,t),hasConnected:r.some(t=>c.isLowerCaseMatch(t.connectorId,e))}}}},41248:function(e,t,r){"use strict";r.d(t,{C:function(){return o}});var n=r(42036),i=r(48459);let o={ConnectorExplorerIds:{[n.b.CONNECTOR_ID.COINBASE]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[n.b.CONNECTOR_ID.COINBASE_SDK]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[n.b.CONNECTOR_ID.SAFE]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[n.b.CONNECTOR_ID.LEDGER]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927",[n.b.CONNECTOR_ID.OKX]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[i.b.METMASK_CONNECTOR_NAME]:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",[i.b.TRUST_CONNECTOR_NAME]:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",[i.b.SOLFLARE_CONNECTOR_NAME]:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",[i.b.PHANTOM_CONNECTOR_NAME]:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",[i.b.COIN98_CONNECTOR_NAME]:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",[i.b.MAGIC_EDEN_CONNECTOR_NAME]:"8b830a2b724a9c3fbab63af6f55ed29c9dfa8a55e732dc88c80a196a2ba136c6",[i.b.BACKPACK_CONNECTOR_NAME]:"2bd8c14e035c2d48f184aaa168559e86b0e3433228d3c4075900a221785019b0",[i.b.BITGET_CONNECTOR_NAME]:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",[i.b.FRONTIER_CONNECTOR_NAME]:"85db431492aa2e8672e93f4ea7acf10c88b97b867b0d373107af63dc4880f041",[i.b.XVERSE_CONNECTOR_NAME]:"2a87d74ae02e10bdd1f51f7ce6c4e1cc53cd5f2c0b6b5ad0d7b3007d2b13de7b",[i.b.LEATHER_CONNECTOR_NAME]:"483afe1df1df63daf313109971ff3ef8356ddf1cc4e45877d205eee0b7893a13",[i.b.OKX_CONNECTOR_NAME]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496
7112a09c0faed0709"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",11155111:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200","00000008819873e925422c1ff0f99f7c":"b3406e4a-bbfc-44fb-e3a6-89673c78b700"},ConnectorImageIds:{[n.b.CONNECTOR_ID.COINBASE]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[n.b.CONNECTOR_ID.COINBASE_SDK]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[n.b.CONNECTOR_ID.SAFE]:"461db637-8616-43ce-035a-d89b8a1d5800",[n.b.CONNECTOR_ID.LEDGER]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[n.b.CONNECTOR_ID.WALLET_CONNECT]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[n.b.CONNECTOR_ID.INJECTED]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[n.b.CONNECTOR_ID.INJECTED]:"Browser Wallet",[n.b.CONNECTOR_ID.WALLET_CONNECT]:"WalletConnect",[n.b.CONNECTOR_ID.COINBASE]:"Coinbase",[n.b.CONNECTOR_ID.COINBASE_SDK]:"Coinbase",[n.b.CONNECTOR_ID.LEDGER]:"Ledger",[n.b.CONNECTOR_ID.SAFE]:"Safe"},ConnectorTypesMap:{[n.b.CONNECTOR_ID.INJECTED]:"INJECTED",[n.b.CONNECTOR_ID.WALLET_CONNECT]:"WALLET_CONNECT",[n.b.CONNECTOR_ID.EIP6963]:"ANNOUNCED",[n.b.CONNECTOR_ID.AUTH]:"AUTH",[i.b.CONNECTOR_TYPE_AUTH]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]}},49854:function(e,t,r){"use strict";r.d(t,{$0:function(){return a},Dr:function(){return i},jd:function(){return o},y_:function(){return c},zN:function(){return s}});var n=r(14224);let i=(void 0!==n&&void 0!==n.env?n.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL:void 0)||"https://secure.walletconnect.org/sdk",o=(void 0!==n&&void 0!==n.env?n.env.NEXT_PUBLIC_DEFAULT_LOG_LEVEL:void 0)||"error",s=(void 0!==n&&void 0!==n.env?n.env.NEXT_PUBLIC_SECURE_SITE_SDK_VERSION:void 0)||"4",a={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",APP_RELOAD:"@w3m-app/RELOAD",APP_RPC_ABORT:"@w3m-app/RPC_ABORT",FRAME_SWITCH_NETWORK_E
7112RROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",FRAME_RELOAD_SUCCESS:"@w3m-frame/RELOAD_SUCCESS",FRAME_RELOAD_ERROR:"@w3m-frame/RELOAD_ERROR",FRAME_RPC_ABORT_SUCCESS:"@w3m-frame/RPC_ABORT_SUCCESS",FRAME_RPC_ABORT_ERROR:"@w3m-frame/RPC_ABORT_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},c={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints","wallet_getAssets"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","wallet_revokePermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RP
7112C_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}}},70288:function(e,t,r){"use strict";r.d(t,{$:function(){return s}});let n={transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u};var i=r(49854),o=r(76311);let s={checkIfAllowedToTriggerEmail(){let e=o.e.get(i.$0.LAST_EMAIL_LOGIN_TIME);if(e){let t=Date.now()-Number(e);if(t<3e4)throw Error(`Please try again after ${Math.ceil((3e4-t)/1e3)} seconds`)}},getTimeToNextEmailLogin(){let e=o.e.get(i.$0.LAST_EMAIL_LOGIN_TIME);if(e){let t=Date.now()-Number(e);if(t<3e4)return Math.ceil((3e4-t)/1e3)}return 0},checkIfRequestExists:e=>i.y_.NOT_SAFE_RPC_METHODS.includes(e.method)||i.y_.SAFE_RPC_METHODS.includes(e.method),getResponseType:e=>"string"==typeof e&&(e?.match(n.transactionHash)||e?.match(n.signedMessage))?i.$0.RPC_RESPONSE_TYPE_TX:i.$0.RPC_RESPONSE_TYPE_OBJECT,checkIfRequestIsSafe:e=>i.y_.SAFE_RPC_METHODS.includes(e.method),isClient:"undefined"!=typeof window}},28503:function(e,t,r){"use strict";let n;r.d(t,{S:function(){return rx}});var i,o,s,a,c,l,u,d=r(77879),h=r(42036),p=r(49854),f=r(70288);(i=a||(a={})).assertEqual=e=>e,i.assertIs=function(e){},i.assertNever=function(e){throw Error()},i.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},i.getValidEnumValues=e=>{let t=i.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return i.objectValues(r)},i.objectValues=e=>i.objectKeys(e).map(function(t){return e[t]}),i.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},i.find=(e,t)=>{for(let r of e)if(t(r))return r},i.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,i.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},i.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(c||(c={})).mergeShapes=(e,t)=>({...e,...t});let g=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),m=e=>{switch(typeof e){case"undefined":return g.undefined;case"string":return g.string;case"number":return isNaN(e)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":if(Array.isArray(e))return g.array;if(null===e)return g.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return g.promise;if("undefined"!=typeof Map&&e instanceof Map)return g.map;if("undefined"!=typeof Set&&e instanceof Set)return g.set;if("undefined"!=typeof Date&&e instanceof Date)return g.date;return g.object;default:return g.unknown}}
7112,y=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class b extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){let r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}b.create=e=>new b(e);let w=(e,t)=>{let r;switch(e.code){case y.invalid_type:r=e.received===g.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,a.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:r=`Unrecognized key(s) in object: ${a.joinValues(e.keys,", ")}`;break;case y.invalid_union:r="Invalid input";break;case y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${a.joinValues(e.options)}`;break;case y.invalid_enum_value:r=`Invalid enum value. Expected ${a.joinValues(e.options)}, received '${e.received}'`;break;case y.invalid_arguments:r="Invalid function arguments";break;case y.invalid_return_type:r="Invalid function return type";break;case y.invalid_date:r="Invalid date";break;case y.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:a.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case y.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case y.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case y.custom:r="Invalid input";break;case y.invalid_intersection_types:r="Intersection results could not be merged";break;case y.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case y.not_finite:r="Number must be finite";break;default:r=t.defaultError,a.assertNever(e)}return{message:r}},v=w;function C(){return v}let E=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o},a="";for(let e of n.filter(e=>!!e).slice().reverse())a=e(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}};function x(e,t){let r=E({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,C(),w].filter(e=>!!e)});e.common.issues.push(r)}class A{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return S;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t)r.push({key:await e.key,value:await e.value});return A.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:i}=n;if("aborted"===t.status||"aborted"===i.status)return S;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||n.alwaysSet)&&(r[t.value]=i.value)}return{status:e.value,value:r}}}let S=Object.freeze({status:"aborted"}),_=e=>({status:"dirty",value:e}),I=e=>
7112({status:"valid",value:e}),k=e=>"aborted"===e.status,O=e=>"dirty"===e.status,N=e=>"valid"===e.status,P=e=>"undefined"!=typeof Promise&&e instanceof Promise;(o=l||(l={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},o.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class T{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let R=(e,t)=>{if(N(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new b(e.common.issues);return this._error=t,this._error}}};function $(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError},description:i}}class D{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return m(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:m(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:m(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(P(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)},i=this._parseSync({data:e,path:n.path,parent:n});return R(n,i)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)},n=this._parse({data:e,path:r.path,parent:r});return R(r,await (P(n)?n:Promise.resolve(n)))}refine(e,t){let r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{let i=e(t),o=()=>n.addIssue({code:y.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(o(),!1)):!!i||(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new ew({schema:this,typeName:u.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ev.create(this,this._def)}nullable(){return eC.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return er.create(this,this._def)}promise(){return eb.create(this,this._def)}or(e){return ei.create([this,e],this._def)}and(e){return ea.create(this,e,this._def)}transform(e){return new ew({...$(this._def),schema:this,typeName:u.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new eE({...$(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:u.ZodDefault})}brand(){return new e_({typeName:u.ZodBranded,type:this,...$(this._def)})}catch(e){return new ex({...$(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:u.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eI.create(this,e)}readonly(){return ek.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let L=/^c[^\s-]{8,}
7112$/i,M=/^[a-z][a-z0-9]*$/,U=/^[0-9A-HJKMNP-TV-Z]{26}$/,j=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,B=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,F=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,z=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,H=e=>e.precision?e.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");class W extends D{_parse(e){let t;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.string,received:t.parsedType}),S}let r=new A;for(let s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(x(t=this._getOrReturnCtx(e,t),{code:y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if("max"===s.kind)e.data.length>s.value&&(x(t=this._getOrReturnCtx(e,t),{code:y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if("length"===s.kind){let n=e.data.length>s.value,i=e.data.length<s.value;(n||i)&&(t=this._getOrReturnCtx(e,t),n?x(t,{code:y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):i&&x(t,{code:y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if("email"===s.kind)B.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"email",code:y.invalid_string,message:s.message}),r.dirty());else if("emoji"===s.kind)n||(n=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),n.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"emoji",code:y.invalid_string,message:s.message}),r.dirty());else if("uuid"===s.kind)j.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"uuid",code:y.invalid_string,message:s.message}),r.dirty());else if("cuid"===s.kind)L.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"cuid",code:y.invalid_string,message:s.message}),r.dirty());else if("cuid2"===s.kind)M.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"cuid2",code:y.invalid_string,message:s.message}),r.dirty());else if("ulid"===s.kind)U.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"ulid",code:y.invalid_string,message:s.message}),r.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(n){x(t=this._getOrReturnCtx(e,t),{validation:"url",code:y.invalid_string,message:s.message}),r.dirty()}else if("regex"===s.kind)s.regex.lastIndex=0,s.regex.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"regex",code:y.invalid_string,message:s.message}),r.dirty());else if("trim"===s.kind)e.data=e.data.trim();else if("includes"===s.kind)e.data.includes(s.value,s.position)||(x(t=this._getOrReturnCtx(e,t),{code:y.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty());else if("toLowerCase"===s.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===s.kind)e.data=e.data.toUpperCase();else if("startsWith"===s.kind)e.data.startsWith(s.value)||(x(t=this._getOrReturnCtx(e,t),{code:y.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty());else if("endsWith"===s.kind)e.data.endsWith(s.value)||(x(t=this._getOrReturnCtx(e,t),{code:y.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty());else if("datetime"===s.kind)H(s).test(e.data)||(x(t=this._getOrReturnCtx(e,t),{code:y.invalid_string,validation:"datetime",message:s.message}),r.dirty());else if("ip"===s.kind){var i,o;i=e.data,("v4"===(o=s.version)||!o)&&F.test(i)||("v6"===o||!o)&&z.test(i)||(x(t=this._getOrReturnCtx(e,t),{validation:"ip",code:y.invalid_string,message:s.message}),r.dirty())}else a.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:y.invalid_string,...l.errToObj(r)})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...l.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...l.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new W({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}
7112get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}W.create=e=>{var t;return new W({checks:[],typeName:u.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$(e)})};class q extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.number,received:t.parsedType}),S}let r=new A;for(let n of this._def.checks)"int"===n.kind?a.isInteger(e.data)||(x(t=this._getOrReturnCtx(e,t),{code:y.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:y.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:y.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}(e.data,n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:y.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(x(t=this._getOrReturnCtx(e,t),{code:y.not_finite,message:n.message}),r.dirty()):a.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}q.create=e=>new q({checks:[],typeName:u.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...$(e)});class V extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==g.bigint){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.bigint,received:t.parsedType}),S}let r=new A;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:y.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:y.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(x(t=this._getOrReturnCtx(e,t),{code:y.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):a.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}
7112positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}V.create=e=>{var t;return new V({checks:[],typeName:u.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$(e)})};class K extends D{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.boolean,received:t.parsedType}),S}return I(e.data)}}K.create=e=>new K({typeName:u.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...$(e)});class G extends D{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.date,received:t.parsedType}),S}if(isNaN(e.data.getTime()))return x(this._getOrReturnCtx(e),{code:y.invalid_date}),S;let r=new A;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(x(t=this._getOrReturnCtx(e,t),{code:y.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(x(t=this._getOrReturnCtx(e,t),{code:y.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):a.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}G.create=e=>new G({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:u.ZodDate,...$(e)});class Z extends D{_parse(e){if(this._getType(e)!==g.symbol){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.symbol,received:t.parsedType}),S}return I(e.data)}}Z.create=e=>new Z({typeName:u.ZodSymbol,...$(e)});class Y extends D{_parse(e){if(this._getType(e)!==g.undefined){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.undefined,received:t.parsedType}),S}return I(e.data)}}Y.create=e=>new Y({typeName:u.ZodUndefined,...$(e)});class J extends D{_parse(e){if(this._getType(e)!==g.null){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.null,received:t.parsedType}),S}return I(e.data)}}J.create=e=>new J({typeName:u.ZodNull,...$(e)});class X extends D{constructor(){super(...arguments),this._any=!0}_parse(e){return I(e.data)}}X.create=e=>new X({typeName:u.ZodAny,...$(e)});class Q extends D{constructor(){super(...arguments),this._unknown=!0}_parse(e){return I(e.data)}}Q.create=e=>new Q({typeName:u.ZodUnknown,...$(e)});class ee extends D{_parse(e){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.never,received:t.parsedType}),S}}ee.create=e=>new ee({typeName:u.ZodNever,...$(e)});class et extends D{_parse(e){if(this._getType(e)!==g.undefined){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.void,received:t.parsedType}),S}return I(e.data)}}et.create=e=>new et({typeName:u.ZodVoid,...$(e)});class er extends D{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==g.array)return x(t,{code:y.invalid_type,expected:g.array,received:t.parsedType}),S;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(e||i)&&(x(t,{code:e?y.too_big:y.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(x(t,{code:y.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(x(t,{code:y.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new T(t,e,t.path,r)))).then(e=>A.mergeArray(r,e));let i=[...t.data].map((e,r)=>n.type._parseSync(new T(t,e,t.path,r)));return A.mergeArray(r,i)}
7112get element(){return this._def.type}min(e,t){return new er({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new er({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new er({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}er.create=(e,t)=>new er({type:e,minLength:null,maxLength:null,exactLength:null,typeName:u.ZodArray,...$(t)});class en extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=a.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==g.object){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.object,received:t.parsedType}),S}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ee&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||o.push(e);let s=[];for(let e of i){let t=n[e],i=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new T(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ee){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of o)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)o.length>0&&(x(r,{code:y.unrecognized_keys,keys:o}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of o){let n=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new T(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>A.mergeObjectSync(t,e)):A.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new en({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,o,s;let a=null!==(o=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==o?o:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=l.errToObj(e).message)&&void 0!==s?s:a}:{message:a}}}:{}})}strip(){return new en({...this._def,unknownKeys:"strip"})}passthrough(){return new en({...this._def,unknownKeys:"passthrough"})}extend(e){return new en({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new en({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:u.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new en({...this._def,catchall:e})}pick(e){let t={};return a.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new en({...this._def,shape:()=>t})}omit(e){let t={};return a.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new en({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof en){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=ev.create(e(i))}return new en({...t._def,shape:()=>r})}return t instanceof er?new er({...t._def,type:e(t.element)}):t instanceof ev?ev.create(e(t.unwrap())):t instanceof eC?eC.create(e(t.unwrap())):t instanceof ec?ec.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};return a.objectKeys(this.shape).forEach(r=>{let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new en({...this._def,shape:()=>t})}required(e){let t={};return a.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ev;)e=e._def.innerType;t[r]=e}}),new en({...this._def,shape:()=>t})}keyof(){return eg(a.objectKeys(this.shape))}}en.create=(e,t)=>new en({shape:()=>e,unknownKeys:"strip",catchall:ee.create(),typeName:u.ZodObject,...$(t)}),en.strictCreate=(e,t)=>new en({shape:()=>e,unknownKeys:"strict",catchall:ee.create(),typeName:u.ZodObject,...$(t)}),en.lazycreate=(e,t)=>new en({shape:e,unknownKeys:"strip",catchall:ee.create(),typeName:u.ZodObject,...$(t)});class ei extends D{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new b(e.ctx.common.issues));return x(t,{code:y.invalid_union,unionErrors:r}),S});{let e;let n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=n.map(e=>new b(e));return x(t,{code:y.invalid_union,unionErrors:i}),S}}get options(){return this._def.options}}ei.create=(e,t)=>
7112new ei({options:e,typeName:u.ZodUnion,...$(t)});let eo=e=>{if(e instanceof ep)return eo(e.schema);if(e instanceof ew)return eo(e.innerType());if(e instanceof ef)return[e.value];if(e instanceof em)return e.options;if(e instanceof ey)return Object.keys(e.enum);if(e instanceof eE)return eo(e._def.innerType);if(e instanceof Y)return[void 0];else if(e instanceof J)return[null];else return null};class es extends D{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.object)return x(t,{code:y.invalid_type,expected:g.object,received:t.parsedType}),S;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(x(t,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),S)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=eo(r.shape[e]);if(!t)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new es({typeName:u.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...$(r)})}}class ea extends D{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(k(e)||k(n))return S;let i=function e(t,r){let n=m(t),i=m(r);if(t===r)return{valid:!0,data:t};if(n===g.object&&i===g.object){let n=a.objectKeys(r),i=a.objectKeys(t).filter(e=>-1!==n.indexOf(e)),o={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};o[n]=i.data}return{valid:!0,data:o}}if(n===g.array&&i===g.array){if(t.length!==r.length)return{valid:!1};let n=[];for(let i=0;i<t.length;i++){let o=e(t[i],r[i]);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===g.date&&i===g.date&&+t==+r?{valid:!0,data:t}:{valid:!1}}(e.value,n.value);return i.valid?((O(e)||O(n))&&t.dirty(),{status:t.value,value:i.data}):(x(r,{code:y.invalid_intersection_types}),S)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ea.create=(e,t,r)=>new ea({left:e,right:t,typeName:u.ZodIntersection,...$(r)});class ec extends D{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.array)return x(r,{code:y.invalid_type,expected:g.array,received:r.parsedType}),S;if(r.data.length<this._def.items.length)return x(r,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&r.data.length>this._def.items.length&&(x(r,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new T(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>A.mergeArray(t,e)):A.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ec({...this._def,rest:e})}}ec.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ec({items:e,typeName:u.ZodTuple,rest:null,...$(t)})};class el extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.object)return x(r,{code:y.invalid_type,expected:g.object,received:r.parsedType}),S;let n=[],i=this._def.keyType,o=this._def.valueType;for(let e in r.data)n.push({key:i._parse(new T(r,e,r.path,e)),value:o._parse(new T(r,r.data[e],r.path,e))});return r.common.async?A.mergeObjectAsync(t,n):A.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new el(t instanceof D?{keyType:e,valueType:t,typeName:u.ZodRecord,...$(r)}:{keyType:W.create(),valueType:e,typeName:u.ZodRecord,...$(t)})}}class eu extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.map)return x(r,{code:y.invalid_type,expected:g.map,received:r.parsedType}),S;let n=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([e,t],o)=>({key:n._parse(new T(r,e,r.path,[o,"key"])),value:i._parse(new T(r,t,r.path,[o,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of o){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return S;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of o){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return S;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}eu.create=(e,t,r)=>new eu({valueType:t,keyType:e,typeName:u.ZodMap,...$(r)});class ed extends D{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.set)return x(r,{code:y.invalid_type,expected:g.set,received:r.parsedType}),S;let n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(x(r,{code:y.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(x(r,{code:y.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let i=this._def.valueType;function o(e){let r=new Set;for(let n of e){if("aborted"===n.status)return S;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let s=[...r.data.values()].map((e,t)=>i._parse(new T(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>o(e)):o(s)}min(e,t){return new ed({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new ed({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ed.create=(e,t)=>
7112new ed({valueType:e,minSize:null,maxSize:null,typeName:u.ZodSet,...$(t)});class eh extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.function)return x(t,{code:y.invalid_type,expected:g.function,received:t.parsedType}),S;function r(e,r){return E({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,C(),w].filter(e=>!!e),issueData:{code:y.invalid_arguments,argumentsError:r}})}function n(e,r){return E({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,C(),w].filter(e=>!!e),issueData:{code:y.invalid_return_type,returnTypeError:r}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof eb){let e=this;return I(async function(...t){let s=new b([]),a=await e._def.args.parseAsync(t,i).catch(e=>{throw s.addIssue(r(t,e)),s}),c=await Reflect.apply(o,this,a);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw s.addIssue(n(c,e)),s})})}{let e=this;return I(function(...t){let s=e._def.args.safeParse(t,i);if(!s.success)throw new b([r(t,s.error)]);let a=Reflect.apply(o,this,s.data),c=e._def.returns.safeParse(a,i);if(!c.success)throw new b([n(a,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eh({...this._def,args:ec.create(e).rest(Q.create())})}returns(e){return new eh({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new eh({args:e||ec.create([]).rest(Q.create()),returns:t||Q.create(),typeName:u.ZodFunction,...$(r)})}}class ep extends D{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ep.create=(e,t)=>new ep({getter:e,typeName:u.ZodLazy,...$(t)});class ef extends D{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:y.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}}function eg(e,t){return new em({values:e,typeName:u.ZodEnum,...$(t)})}ef.create=(e,t)=>new ef({value:e,typeName:u.ZodLiteral,...$(t)});class em extends D{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return x(t,{expected:a.joinValues(r),received:t.parsedType,code:y.invalid_type}),S}if(-1===this._def.values.indexOf(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return x(t,{received:t.data,code:y.invalid_enum_value,options:r}),S}return I(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return em.create(e)}exclude(e){return em.create(this.options.filter(t=>!e.includes(t)))}}em.create=eg;class ey extends D{_parse(e){let t=a.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==g.string&&r.parsedType!==g.number){let e=a.objectValues(t);return x(r,{expected:a.joinValues(e),received:r.parsedType,code:y.invalid_type}),S}if(-1===t.indexOf(e.data)){let e=a.objectValues(t);return x(r,{received:r.data,code:y.invalid_enum_value,options:e}),S}return I(e.data)}get enum(){return this._def.values}}ey.create=(e,t)=>new ey({values:e,typeName:u.ZodNativeEnum,...$(t)});class eb extends D{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==g.promise&&!1===t.common.async?(x(t,{code:y.invalid_type,expected:g.promise,received:t.parsedType}),S):I((t.parsedType===g.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}eb.create=(e,t)=>new eb({type:e,typeName:u.ZodPromise,...$(t)});class ew extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===u.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{x(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then(e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r})):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?S:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?S:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>N(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!N(e))return e;let o=n.transform(e.value,i);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}}a.assertNever(n)}}ew.create=(e,t,r)=>new ew({schema:e,typeName:u.ZodEffects,effect:t,...$(r)}),ew.createWithPreprocess=(e,t,r)=>new ew({schema:t,effect:{type:"preprocess",transform:e},typeName:u.ZodEffects,...$(r)});class ev extends D{_parse(e){return this._getType(e)===g.undefined?I(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ev.create=(e,t)=>
7112new ev({innerType:e,typeName:u.ZodOptional,...$(t)});class eC extends D{_parse(e){return this._getType(e)===g.null?I(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eC.create=(e,t)=>new eC({innerType:e,typeName:u.ZodNullable,...$(t)});class eE extends D{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===g.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eE.create=(e,t)=>new eE({innerType:e,typeName:u.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$(t)});class ex extends D{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return P(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new b(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new b(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ex.create=(e,t)=>new ex({innerType:e,typeName:u.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$(t)});class eA extends D{_parse(e){if(this._getType(e)!==g.nan){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:g.nan,received:t.parsedType}),S}return{status:"valid",value:e.data}}}eA.create=e=>new eA({typeName:u.ZodNaN,...$(e)});let eS=Symbol("zod_brand");class e_ extends D{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eI extends D{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?S:"dirty"===e.status?(t.dirty(),_(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?S:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eI({in:e,out:t,typeName:u.ZodPipeline})}}class ek extends D{_parse(e){let t=this._def.innerType._parse(e);return N(t)&&(t.value=Object.freeze(t.value)),t}}ek.create=(e,t)=>new ek({innerType:e,typeName:u.ZodReadonly,...$(t)});let eO=(e,t={},r)=>e?X.create().superRefine((n,i)=>{var o,s;if(!e(n)){let e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,a=null===(s=null!==(o=e.fatal)&&void 0!==o?o:r)||void 0===s||s;i.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:a})}}):X.create(),eN={object:en.lazycreate};(s=u||(u={})).ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly";let eP=W.create,eT=q.create,eR=eA.create,e$=V.create,eD=K.create,eL=G.create,eM=Z.create,eU=Y.create,ej=J.create,eB=X.create,eF=Q.create,ez=ee.create,eH=et.create,eW=er.create,eq=en.create,eV=en.strictCreate,eK=ei.create,eG=es.create,eZ=ea.create,eY=ec.create,eJ=el.create,eX=eu.create,eQ=ed.create,e0=eh.create,e1=ep.create,e2=ef.create,e5=em.create,e3=ey.create,e6=eb.create,e4=ew.create,e8=ev.create,e9=eC.create,e7=ew.createWithPreprocess,te=eI.create;var tt=Object.freeze({__proto__:null,defaultErrorMap:w,setErrorMap:function(e){v=e},getErrorMap:C,makeIssue:E,EMPTY_PATH:[],addIssueToContext:x,ParseStatus:A,INVALID:S,DIRTY:_,OK:I,isAborted:k,isDirty:O,isValid:N,isAsync:P,get util(){return a},get objectUtil(){return c},ZodParsedType:g,getParsedType:m,ZodType:D,ZodString:W,ZodNumber:q,ZodBigInt:V,ZodBoolean:K,ZodDate:G,ZodSymbol:Z,ZodUndefined:Y,ZodNull:J,ZodAny:X,ZodUnknown:Q,ZodNever:ee,ZodVoid:et,ZodArray:er,ZodObject:en,ZodUnion:ei,ZodDiscriminatedUnion:es,ZodIntersection:ea,ZodTuple:ec,ZodRecord:el,ZodMap:eu,ZodSet:ed,ZodFunction:eh,ZodLazy:ep,ZodLiteral:ef,ZodEnum:em,ZodNativeEnum:ey,ZodPromise:eb,ZodEffects:ew,ZodTransformer:ew,ZodOptional:ev,ZodNullable:eC,ZodDefault:eE,ZodCatch:ex,ZodNaN:eA,BRAND:eS,ZodBranded:e_,ZodPipeline:eI,ZodReadonly:ek,custom:eO,Schema:D,ZodSchema:D,late:eN,get ZodFirstPartyTypeKind(){return u},coerce:{string:e=>W.create({...e,coerce:!0}),number:e=>q.create({...e,coerce:!0}),boolean:e=>K.create({...e,coerce:!0}),bigint:e=>V.create({...e,coerce:!0}),date:e=>G.create({...e,coerce:!0})},any:eB,array:eW,bigint:e$,boolean:eD,date:eL,discriminatedUnion:eG,effect:e4,enum:e5,function:e0,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>eO(t=>t instanceof e,t),intersection:eZ,lazy:e1,literal:e2,map:eX,nan:eR,nativeEnum:e3,never:ez,null:ej,nullable:e9,number:eT,object:eq,oboolean:()=>eD().optional(),onumber:()=>eT().optional(),optional:e8,ostring:()=>eP().optional(),pipeline:te,preprocess:e7,promise:e6,record:eJ,set:eQ,strictObject:eV,str
7112ing:eP,symbol:eM,transformer:e4,tuple:eY,undefined:eU,union:eK,unknown:eF,void:eH,NEVER:S,ZodIssueCode:y,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:b});let tr=tt.object({message:tt.string()});function tn(e){return tt.literal(p.$0[e])}let ti=tt.object({serializedMessage:tt.string().optional(),accountAddress:tt.string(),chainId:tt.string(),notBefore:tt.string().optional(),domain:tt.string(),uri:tt.string(),version:tt.string(),nonce:tt.string(),statement:tt.string().optional(),resources:tt.array(tt.string()).optional(),requestId:tt.string().optional(),issuedAt:tt.string().optional(),expirationTime:tt.string().optional()});tt.object({accessList:tt.array(tt.string()),blockHash:tt.string().nullable(),blockNumber:tt.string().nullable(),chainId:tt.string().or(tt.number()),from:tt.string(),gas:tt.string(),hash:tt.string(),input:tt.string().nullable(),maxFeePerGas:tt.string(),maxPriorityFeePerGas:tt.string(),nonce:tt.string(),r:tt.string(),s:tt.string(),to:tt.string(),transactionIndex:tt.string().nullable(),type:tt.string(),v:tt.string(),value:tt.string()});let to=tt.object({chainId:tt.string().or(tt.number()),rpcUrl:tt.optional(tt.string())}),ts=tt.object({email:tt.string().email()}),ta=tt.object({otp:tt.string()}),tc=tt.object({uri:tt.string(),preferredAccountType:tt.optional(tt.string()),chainId:tt.optional(tt.string().or(tt.number())),siwxMessage:tt.optional(ti),rpcUrl:tt.optional(tt.string())}),tl=tt.object({chainId:tt.optional(tt.string().or(tt.number())),preferredAccountType:tt.optional(tt.string()),socialUri:tt.optional(tt.string()),siwxMessage:tt.optional(ti),rpcUrl:tt.optional(tt.string())}),tu=tt.object({provider:tt.enum(["google","github","apple","facebook","x","discord"])}),td=tt.object({email:tt.string().email()}),th=tt.object({otp:tt.string()}),tp=tt.object({otp:tt.string()}),tf=tt.object({themeMode:tt.optional(tt.enum(["light","dark"])),themeVariables:tt.optional(tt.record(tt.string(),tt.string().or(tt.number()))),w3mThemeVariables:tt.optional(tt.record(tt.string(),tt.string()))}),tg=tt.object({metadata:tt.object({name:tt.string(),description:tt.string(),url:tt.string(),icons:tt.array(tt.string())}).optional(),sdkVersion:tt.string().optional(),sdkType:tt.string().optional(),projectId:tt.string()}),tm=tt.object({type:tt.string()}),ty=tt.object({action:tt.enum(["VERIFY_DEVICE","VERIFY_OTP","CONNECT"])}),tb=tt.object({url:tt.string()}),tw=tt.object({userName:tt.string()}),tv=tt.object({email:tt.string().optional().nullable(),address:tt.string(),chainId:tt.string().or(tt.number()),accounts:tt.array(tt.object({address:tt.string(),type:tt.enum([p.y_.ACCOUNT_TYPES.EOA,p.y_.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:tt.string().optional().nullable(),preferredAccountType:tt.optional(tt.string()),signature:tt.string().optional(),message:tt.string().optional(),siwxMessage:tt.optional(ti)}),tC=tt.object({action:tt.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),tE=tt.object({email:tt.string().email().optional().nullable(),address:tt.string(),chainId:tt.string().or(tt.number()),smartAccountDeployed:tt.optional(tt.boolean()),accounts:tt.array(tt.object({address:tt.string(),type:tt.enum([p.y_.ACCOUNT_TYPES.EOA,p.y_.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:tt.optional(tt.string()),signature:tt.string().optional(),message:tt.string().optional(),siwxMessage:tt.optional(ti)}),tx=tt.object({uri:tt.string()}),tA=tt.object({isConnected:tt.boolean()}),tS=tt.object({chainId:tt.string().or(tt.number())}),t_=tt.object({chainId:tt.string().or(tt.number())}),tI=tt.object({newEmail:tt.string().email()}),tk=tt.object({smartAccountEnabledNetworks:tt.array(tt.number())});tt.object({address:tt.string(),isDeployed:tt.boolean()});let tO=tt.object({version:tt.string().optional()}),tN=tt.object({type:tt.string(),address:tt.string()}),tP=tt.any(),tT=tt.object({method:tt.literal("eth_accounts")}),tR=tt.object({method:tt.literal("eth_blockNumber")}),t$=tt.object({method:tt.literal("eth_call"),params:tt.array(tt.any())}),tD=tt.object({method:tt.literal("eth_chainId")}),tL=tt.object({method:tt.literal("eth_estimateGas"),params:tt.array(tt.any())}),tM=tt.object({method:tt.literal("eth_feeHistory"),params:tt.array(tt.any())}),tU=tt.object({method:tt.literal("eth_gasPrice")}),tj=tt.object({method:tt.literal("eth_getAccount"),params:tt.array(tt.any())}),tB=tt.object({method:tt.literal("eth_getBalance"),params:tt.array(tt.any())}),tF=tt.object({method:tt.literal("eth_getBlockByHash"),params:tt.array(tt.any())}),tz=tt.object({method:tt.literal("eth_getBlockByNumber"),params:tt.array(tt.any())}),tH=tt.object({method:tt.literal("eth_getBlockReceipts"),params:tt.array(tt.any())}),tW=tt.object({method:tt.literal("eth_getBlockTransactionCountByHash"),params:tt.array(tt.any())}),tq=tt.object({method:tt.literal("eth_getBlockTransactionCountByNumber"),params:tt.array(tt.any())}),tV=tt.object({method:tt.literal("eth_getCode"),params:tt.array(tt.any())}),tK=tt.object({method:tt.literal("eth_getFilterChanges"),params:tt.array(tt.any())}),tG=tt.object({method:tt.literal("eth_getFilterLogs"),params:tt.array(tt.any())}),tZ=tt.object({method:tt.literal("eth_getLogs"),params:tt.array(tt.any())}),tY=tt.object({method:tt.literal("eth_getProof"),params:tt.array(tt.any())}),tJ=tt.object({method:tt.literal("eth_getStorageAt"),params:tt.array(tt.any())}),tX=tt.object({method:tt.literal("eth_getTransactionByBlockHashAndIndex"),params:tt.array(tt.any())}),tQ=tt.object({method:tt.literal("eth_getTransactionByBlockNumberAndIndex"),params:tt.array(tt.any())}),t0=tt.object({method:tt.literal("eth_getTransactionByHash"),params:tt.array(tt.any())}),t1=tt.object({method:tt.literal("eth_getTransactionCount"),params:tt.array(tt.any())}
7112),t2=tt.object({method:tt.literal("eth_getTransactionReceipt"),params:tt.array(tt.any())}),t5=tt.object({method:tt.literal("eth_getUncleCountByBlockHash"),params:tt.array(tt.any())}),t3=tt.object({method:tt.literal("eth_getUncleCountByBlockNumber"),params:tt.array(tt.any())}),t6=tt.object({method:tt.literal("eth_maxPriorityFeePerGas")}),t4=tt.object({method:tt.literal("eth_newBlockFilter")}),t8=tt.object({method:tt.literal("eth_newFilter"),params:tt.array(tt.any())}),t9=tt.object({method:tt.literal("eth_newPendingTransactionFilter")}),t7=tt.object({method:tt.literal("eth_sendRawTransaction"),params:tt.array(tt.any())}),re=tt.object({method:tt.literal("eth_syncing"),params:tt.array(tt.any())}),rt=tt.object({method:tt.literal("eth_uninstallFilter"),params:tt.array(tt.any())}),rr=tt.object({method:tt.literal("personal_sign"),params:tt.array(tt.any())}),rn=tt.object({method:tt.literal("eth_signTypedData_v4"),params:tt.array(tt.any())}),ri=tt.object({method:tt.literal("eth_sendTransaction"),params:tt.array(tt.any())}),ro=tt.object({method:tt.literal("solana_signMessage"),params:tt.object({message:tt.string(),pubkey:tt.string()})}),rs=tt.object({method:tt.literal("solana_signTransaction"),params:tt.object({transaction:tt.string()})}),ra=tt.object({method:tt.literal("solana_signAllTransactions"),params:tt.object({transactions:tt.array(tt.string())})}),rc=tt.object({method:tt.literal("solana_signAndSendTransaction"),params:tt.object({transaction:tt.string(),options:tt.object({skipPreflight:tt.boolean().optional(),preflightCommitment:tt.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:tt.number().optional(),minContextSlot:tt.number().optional()}).optional()})}),rl=tt.object({method:tt.literal("wallet_sendCalls"),params:tt.array(tt.object({chainId:tt.string().or(tt.number()).optional(),from:tt.string().optional(),version:tt.string().optional(),capabilities:tt.any().optional(),calls:tt.array(tt.object({to:tt.string().startsWith("0x"),data:tt.string().startsWith("0x").optional(),value:tt.string().optional()}))}))}),ru=tt.object({method:tt.literal("wallet_getCallsStatus"),params:tt.array(tt.string())}),rd=tt.object({method:tt.literal("wallet_getCapabilities"),params:tt.array(tt.string().or(tt.number()).optional()).optional()}),rh=tt.object({method:tt.literal("wallet_grantPermissions"),params:tt.array(tt.any())}),rp=tt.object({method:tt.literal("wallet_revokePermissions"),params:tt.any()}),rf=tt.object({method:tt.literal("wallet_getAssets"),params:tt.any()}),rg=tt.object({token:tt.string()}),rm=tt.object({id:tt.string().optional()}),ry={appEvent:rm.extend({type:tn("APP_SWITCH_NETWORK"),payload:to}).or(rm.extend({type:tn("APP_CONNECT_EMAIL"),payload:ts})).or(rm.extend({type:tn("APP_CONNECT_DEVICE")})).or(rm.extend({type:tn("APP_CONNECT_OTP"),payload:ta})).or(rm.extend({type:tn("APP_CONNECT_SOCIAL"),payload:tc})).or(rm.extend({type:tn("APP_GET_FARCASTER_URI")})).or(rm.extend({type:tn("APP_CONNECT_FARCASTER")})).or(rm.extend({type:tn("APP_GET_USER"),payload:tt.optional(tl)})).or(rm.extend({type:tn("APP_GET_SOCIAL_REDIRECT_URI"),payload:tu})).or(rm.extend({type:tn("APP_SIGN_OUT")})).or(rm.extend({type:tn("APP_IS_CONNECTED"),payload:tt.optional(rg)})).or(rm.extend({type:tn("APP_GET_CHAIN_ID")})).or(rm.extend({type:tn("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(rm.extend({type:tn("APP_INIT_SMART_ACCOUNT")})).or(rm.extend({type:tn("APP_SET_PREFERRED_ACCOUNT"),payload:tm})).or(rm.extend({type:tn("APP_RPC_REQUEST"),payload:rr.or(rf).or(tT).or(tR).or(t$).or(tD).or(tL).or(tM).or(tU).or(tj).or(tB).or(tF).or(tz).or(tH).or(tW).or(tq).or(tV).or(tK).or(tG).or(tZ).or(tY).or(tJ).or(tX).or(tQ).or(t0).or(t1).or(t2).or(t5).or(t3).or(t6).or(t4).or(t8).or(t9).or(t7).or(re).or(rt).or(rr).or(rn).or(ri).or(ro).or(rs).or(ra).or(rc).or(ru).or(rl).or(rd).or(rh).or(rp).and(tt.object({chainId:tt.string().or(tt.number()).optional(),chainNamespace:tt.enum(["eip155","solana","polkadot","bip122","cosmos"]).optional(),rpcUrl:tt.string().optional()}))})).or(rm.extend({type:tn("APP_UPDATE_EMAIL"),payload:td})).or(rm.extend({type:tn("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:th})).or(rm.extend({type:tn("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:tp})).or(rm.extend({type:tn("APP_SYNC_THEME"),payload:tf})).or(rm.extend({type:tn("APP_SYNC_DAPP_DATA"),payload:tg})).or(rm.extend({type:tn("APP_RELOAD")})).or(rm.extend({type:tn("APP_RPC_ABORT")}
7112)),frameEvent:rm.extend({type:tn("FRAME_SWITCH_NETWORK_ERROR"),payload:tr}).or(rm.extend({type:tn("FRAME_SWITCH_NETWORK_SUCCESS"),payload:t_})).or(rm.extend({type:tn("FRAME_CONNECT_EMAIL_SUCCESS"),payload:ty})).or(rm.extend({type:tn("FRAME_CONNECT_EMAIL_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:tb})).or(rm.extend({type:tn("FRAME_GET_FARCASTER_URI_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:tw})).or(rm.extend({type:tn("FRAME_CONNECT_FARCASTER_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_CONNECT_OTP_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_CONNECT_OTP_SUCCESS")})).or(rm.extend({type:tn("FRAME_CONNECT_DEVICE_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_CONNECT_DEVICE_SUCCESS")})).or(rm.extend({type:tn("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:tv})).or(rm.extend({type:tn("FRAME_CONNECT_SOCIAL_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_GET_USER_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_GET_USER_SUCCESS"),payload:tE})).or(rm.extend({type:tn("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:tx})).or(rm.extend({type:tn("FRAME_SIGN_OUT_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_SIGN_OUT_SUCCESS")})).or(rm.extend({type:tn("FRAME_IS_CONNECTED_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_IS_CONNECTED_SUCCESS"),payload:tA})).or(rm.extend({type:tn("FRAME_GET_CHAIN_ID_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_GET_CHAIN_ID_SUCCESS"),payload:tS})).or(rm.extend({type:tn("FRAME_RPC_REQUEST_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_RPC_REQUEST_SUCCESS"),payload:tP})).or(rm.extend({type:tn("FRAME_SESSION_UPDATE"),payload:rg})).or(rm.extend({type:tn("FRAME_UPDATE_EMAIL_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_UPDATE_EMAIL_SUCCESS"),payload:tC})).or(rm.extend({type:tn("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(rm.extend({type:tn("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:tI})).or(rm.extend({type:tn("FRAME_SYNC_THEME_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_SYNC_THEME_SUCCESS")})).or(rm.extend({type:tn("FRAME_SYNC_DAPP_DATA_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(rm.extend({type:tn("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:tk})).or(rm.extend({type:tn("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:tN})).or(rm.extend({type:tn("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_READY"),payload:tO})).or(rm.extend({type:tn("FRAME_RELOAD_ERROR"),payload:tr})).or(rm.extend({type:tn("FRAME_RELOAD_SUCCESS")}))};function rb(e,t={}){return"string"==typeof t?.type&&t?.type?.includes(e)}class rw{constructor({projectId:e,isAppClient:t=!1,chainId:r="eip155:1",enableLogger:n=!0,enableCloudAuthAccount:i=!1,rpcUrl:o=h.b.BLOCKCHAIN_API_RPC_URL}){if(this.iframe=null,this.iframeIsReady=!1,this.initFrame=()=>{let e=document.getElementById("w3m-iframe");this.iframe&&!e&&document.body.appendChild(this.iframe)},this.events={registerFrameEventHandler:(e,t,r)=>{function n({data:r}){if(!rb(p.$0.FRAME_EVENT_KEY,r))return;let i=ry.frameEvent.safeParse(r);if(!i.success){console.warn("W3mFrame: invalid frame event",i.error.message);return}i.data?.id===e&&(t(i.data),window.removeEventListener("message",n))}f.$.isClient&&(window.addEventListener("message",n),r.addEventListener("abort",()=>{window.removeEventListener("message",n)}))},onFrameEvent:e=>{f.$.isClient&&window.addEventListener("message",({data:t})=>{if(!rb(p.$0.FRAME_EVENT_KEY,t))return;let r=ry.frameEvent.safeParse(t);r.success?e(r.data):console.warn("W3mFrame: invalid frame event",r.error.message)})},onAppEvent:e=>{f.$.isClient&&window.addEventListener("message",({data:t})=>{if(!rb(p.$0.APP_EVENT_KEY,t))return;let r=ry.appEvent.safeParse(t);r.success||console.warn("W3mFrame: invalid app event",r.error.message),e(t)})},postAppEvent:e=>{if(f.$.isClient){if(!this.iframe?.contentWindow)throw Error("W3mFrame: iframe is not set");this.iframe.contentWindow.postMessage(e,"*")}},postFrameEvent:e=>{if(f.$.isClient){if(!parent)throw Error("W3mFrame: parent is not set");parent.postMessage(e,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((e,t)=>
7112{this.frameLoadPromiseResolver={resolve:e,reject:t}}),this.rpcUrl=o,t&&(this.frameLoadPromise=new Promise((e,t)=>{this.frameLoadPromiseResolver={resolve:e,reject:t}}),f.$.isClient)){let t=document.createElement("iframe");t.id="w3m-iframe",t.src=function({projectId:e,chainId:t,enableLogger:r,rpcUrl:n=h.b.BLOCKCHAIN_API_RPC_URL,enableCloudAuthAccount:i=!1}){let o=new URL(p.Dr);return o.searchParams.set("projectId",e),o.searchParams.set("chainId",String(t)),o.searchParams.set("version",p.zN),o.searchParams.set("enableLogger",String(r)),o.searchParams.set("rpcUrl",n),i&&o.searchParams.set("enableCloudAuthAccount","true"),o.toString()}({projectId:e,chainId:r,enableLogger:n,rpcUrl:this.rpcUrl,enableCloudAuthAccount:i}),t.name="w3m-secure-iframe",t.style.position="fixed",t.style.zIndex="999999",t.style.display="none",t.style.border="none",t.style.animationDelay="0s, 50ms",t.style.borderBottomLeftRadius="clamp(0px, var(--apkt-borderRadius-8), 44px)",t.style.borderBottomRightRadius="clamp(0px, var(--apkt-borderRadius-8), 44px)",this.iframe=t,this.iframe.onerror=()=>{this.frameLoadPromiseResolver?.reject("Unable to load email login dependency")},this.events.onFrameEvent(e=>{"@w3m-frame/READY"===e.type&&(this.iframeIsReady=!0,this.frameLoadPromiseResolver?.resolve(void 0))})}}get networks(){return Object.assign({},...["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(e=>({[e]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${e}&projectId=${this.projectId}`,chainId:e}})))}}var rv=r(56526);class rC{constructor(e){let t=(0,rv.jI)({level:p.jd}),{logger:r,chunkLoggerController:n}=(0,rv.Rt)({opts:t});this.logger=(0,rv.Ep)(r,this.constructor.name),this.chunkLoggerController=n,"undefined"!=typeof window&&this.chunkLoggerController?.downloadLogsBlobInBrowser&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{this.chunkLoggerController?.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}var rE=r(76311);class rx{constructor({projectId:e,chainId:t,enableLogger:r=!0,onTimeout:n,abortController:i,getActiveCaipNetwork:o,getCaipNetworks:s,enableCloudAuthAccount:a}){this.openRpcRequests=new Map,this.isInitialized=!1,r&&(this.w3mLogger=new rC(e)),this.abortController=i,this.getActiveCaipNetwork=o,this.getCaipNetworks=s;let c=this.getRpcUrl(t);this.w3mFrame=new rw({projectId:e,isAppClient:!0,chainId:t,enableLogger:r,rpcUrl:c,enableCloudAuthAccount:a}),this.onTimeout=n,this.getLoginEmailUsed()&&this.createFrame()}async createFrame(){this.w3mFrame.initFrame(),this.initPromise=new Promise(e=>{this.w3mFrame.events.onFrameEvent(t=>{t.type===p.$0.FRAME_READY&&setTimeout(()=>{e()},500)})}),await this.initPromise,this.isInitialized=!0,this.initPromise=void 0}
7112async init(){if(!this.isInitialized){if(this.initPromise){await this.initPromise;return}await this.createFrame()}}getLoginEmailUsed(){return!!rE.e.get(p.$0.EMAIL_LOGIN_USED_KEY)}getEmail(){return rE.e.get(p.$0.EMAIL)}getUsername(){return rE.e.get(p.$0.SOCIAL_USERNAME)}async reload(){try{await this.appEvent({type:p.$0.APP_RELOAD})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error reloading iframe"),e}}async connectEmail(e){try{f.$.checkIfAllowedToTriggerEmail(),await this.init();let t=await this.appEvent({type:p.$0.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),t}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting email"),e}}async connectDevice(){try{return this.appEvent({type:p.$0.APP_CONNECT_DEVICE})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting device"),e}}async connectOtp(e){try{return this.appEvent({type:p.$0.APP_CONNECT_OTP,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting otp"),e}}async isConnected(){try{if(!this.getLoginEmailUsed())return{isConnected:!1};let e=await this.appEvent({type:p.$0.APP_IS_CONNECTED});return e?.isConnected||this.deleteAuthLoginCache(),e}catch(e){throw this.deleteAuthLoginCache(),this.w3mLogger?.logger.error({error:e},"Error checking connection"),e}}async getChainId(){try{let e=await this.appEvent({type:p.$0.APP_GET_CHAIN_ID});return this.setLastUsedChainId(e.chainId),e}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error getting chain id"),e}}async getSocialRedirectUri(e){try{return await this.init(),this.appEvent({type:p.$0.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error getting social redirect uri"),e}}async updateEmail(e){try{let t=await this.appEvent({type:p.$0.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),t}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error updating email"),e}}async updateEmailPrimaryOtp(e){try{return this.appEvent({type:p.$0.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error updating email primary otp"),e}}async updateEmailSecondaryOtp(e){try{let t=await this.appEvent({type:p.$0.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(t.newEmail),t}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error updating email secondary otp"),e}}async syncTheme(e){try{return this.appEvent({type:p.$0.APP_SYNC_THEME,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error syncing theme"),e}}async syncDappData(e){try{return this.appEvent({type:p.$0.APP_SYNC_DAPP_DATA,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error syncing dapp data"),e}}async getSmartAccountEnabledNetworks(){try{let e=await this.appEvent({type:p.$0.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(e.smartAccountEnabledNetworks),e}catch(e){throw this.persistSmartAccountEnabledNetworks([]),this.w3mLogger?.logger.error({error:e},"Error getting smart account enabled networks"),e}}async setPreferredAccount(e){try{return this.appEvent({type:p.$0.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error setting preferred account"),e}}async connect(e){if(e?.socialUri)try{await this.init();let t=this.getRpcUrl(e.chainId),r=await this.appEvent({type:p.$0.APP_CONNECT_SOCIAL,payload:{uri:e.socialUri,preferredAccountType:e.preferredAccountType,chainId:e.chainId,siwxMessage:e.siwxMessage,rpcUrl:t}});return r.userName&&this.setSocialLoginSuccess(r.userName),this.setLoginSuccess(r.email),this.setLastUsedChainId(r.chainId),this.user=r,r}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting social"),e}else try{let t=e?.chainId||this.getLastUsedChainId()||1,r=await this.getUser({chainId:t,preferredAccountType:e?.preferredAccountType,siwxMessage:e?.siwxMessage,rpcUrl:this.getRpcUrl(t)});return this.setLoginSuccess(r.email),this.setLastUsedChainId(r.chainId),this.user=r,r}catch(e){throw this.w3mLogger?.logger.error({error:e}
7112,"Error connecting"),e}}async getUser(e){try{await this.init();let t=e?.chainId||this.getLastUsedChainId()||1,r=await this.appEvent({type:p.$0.APP_GET_USER,payload:{...e,chainId:t,rpcUrl:this.getRpcUrl(t)}});return this.user=r,r}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting"),e}}async connectSocial({uri:e,chainId:t,preferredAccountType:r}){try{await this.init();let n=this.getRpcUrl(t),i=await this.appEvent({type:p.$0.APP_CONNECT_SOCIAL,payload:{uri:e,chainId:t,rpcUrl:n,preferredAccountType:r}});return i.userName&&this.setSocialLoginSuccess(i.userName),i}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting social"),e}}async getFarcasterUri(){try{return await this.init(),await this.appEvent({type:p.$0.APP_GET_FARCASTER_URI})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error getting farcaster uri"),e}}async connectFarcaster(){try{let e=await this.appEvent({type:p.$0.APP_CONNECT_FARCASTER});return e.userName&&this.setSocialLoginSuccess(e.userName),e}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting farcaster"),e}}async switchNetwork({chainId:e}){try{let t=this.getRpcUrl(e),r=await this.appEvent({type:p.$0.APP_SWITCH_NETWORK,payload:{chainId:e,rpcUrl:t}});return this.setLastUsedChainId(r.chainId),r}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error switching network"),e}}async disconnect(){try{return this.deleteAuthLoginCache(),await new Promise(async e=>{let t=setTimeout(()=>{e()},3e3);await this.appEvent({type:p.$0.APP_SIGN_OUT}),clearTimeout(t),e()})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error disconnecting"),e}}async request(e){try{if(p.y_.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();let t=e.chainNamespace||"eip155",r=this.getActiveCaipNetwork(t)?.id;e.chainNamespace=t,e.chainId=r,e.rpcUrl=this.getRpcUrl(r),this.rpcRequestHandler?.(e);let n=await this.appEvent({type:p.$0.APP_RPC_REQUEST,payload:e});return this.rpcSuccessHandler?.(n,e),n}catch(t){throw this.rpcErrorHandler?.(t,e),this.w3mLogger?.logger.error({error:t},"Error requesting"),t}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.$0.FRAME_IS_CONNECTED_SUCCESS&&t.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.$0.FRAME_IS_CONNECTED_ERROR&&e(),t.type!==p.$0.FRAME_IS_CONNECTED_SUCCESS||t.payload.isConnected||e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.$0.FRAME_GET_USER_SUCCESS&&e(t.payload)})}onSocialConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.$0.FRAME_CONNECT_SOCIAL_SUCCESS&&e(t.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.$0.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(t.payload):t.type===p.$0.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:p.y_.ACCOUNT_TYPES.EOA})})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}async rejectRpcRequests(){try{await Promise.all(Array.from(this.openRpcRequests.values()).map(async({abortController:e,method:t})=>{p.y_.SAFE_RPC_METHODS.includes(t)||e.abort(),await this.appEvent({type:p.$0.APP_RPC_ABORT})})),this.openRpcRequests.clear()}catch(e){this.w3mLogger?.logger.error({error:e},"Error aborting RPC request")}}async appEvent(e){let t,r;function n(e){return e.replace("@w3m-app/","")}let i=[p.$0.APP_SYNC_DAPP_DATA,p.$0.APP_SYNC_THEME,p.$0.APP_SET_PREFERRED_ACCOUNT],o=n(e.type);return this.w3mFrame.iframeIsReady||i.includes(e.type)||(r=setTimeout(()=>{this.onTimeout?.("iframe_load_failed"),this.abortController.abort()},2e4)),await this.w3mFrame.frameLoadPromise,clearTimeout(r),[p.$0.APP_CONNECT_EMAIL,p.$0.APP_CONNECT_DEVICE,p.$0.APP_CONNECT_OTP,p.$0.APP_CONNECT_SOCIAL,p.$0.APP_GET_SOCIAL_REDIRECT_URI].map(n).includes(o)&&(t=setTimeout(()=>{this.onTimeout?.("iframe_request_timeout"),this.abortController.abort()},12e4)),new Promise((n,i)=>{let s=Math.random().toString(36).substring(7);this.w3mLogger?.logger.info?.({event:e,id:s},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:s});let a=new AbortController;"RPC_REQUEST"===o&&this.openRpcRequests.set(s,{...e.payload,abortController:a}),a.signal.addEventListener("abort",()=>{"RPC_REQUEST"===o?i(Error("Request was aborted")):"GET_FARCASTER_URI"!==o&&i(Error("Something went wrong"))});let c=(e,a)=>{e.id===s&&(a?.logger.info?.({framEvent:e,id:s},"Received frame response"),this.openRpcRequests.delete(e.id),e.type===`@w3m-frame/${o}_SUCCESS`?(t&&clearTimeout(t),r&&clearTimeout(r),"payload"in e&&n(e.payload),n(void 0)):e.type===`@w3m-frame/${o}_ERROR`&&(t&&clearTimeout(t),r&&clearTimeout(r),"payload"in e&&i(Error(e.payload?.message||"An error occurred")),i(Error("An error occurred"))))};this.w3mFrame.events.registerFrameEventHandler(s,e=>c(e,this.w3mLogger),this.abortController.signal)}
7112)}setNewLastEmailLoginTime(){rE.e.set(p.$0.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){rE.e.set(p.$0.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&rE.e.set(p.$0.EMAIL,e),rE.e.set(p.$0.EMAIL_LOGIN_USED_KEY,"true"),rE.e.delete(p.$0.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){rE.e.delete(p.$0.EMAIL_LOGIN_USED_KEY),rE.e.delete(p.$0.EMAIL),rE.e.delete(p.$0.LAST_USED_CHAIN_KEY),rE.e.delete(p.$0.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&rE.e.set(p.$0.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){let e=rE.e.get(p.$0.LAST_USED_CHAIN_KEY)??void 0,t=Number(e);return isNaN(t)?e:t}persistSmartAccountEnabledNetworks(e){rE.e.set(p.$0.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}getRpcUrl(e){let t=void 0===e?void 0:"eip155";"string"==typeof e&&(t=e.includes(":")?d.u.parseCaipNetworkId(e)?.chainNamespace:Number.isInteger(Number(e))?"eip155":"solana");let r=this.getCaipNetworks(t),n=e?r.find(t=>String(t.id)===String(e)||t.caipNetworkId===e):r[0];return n?.rpcUrls.default.http?.[0]}}},76311:function(e,t,r){"use strict";r.d(t,{e:function(){return o}});var n=r(49854),i=r(70288);let o={set(e,t){i.$.isClient&&localStorage.setItem(`${n.$0.STORAGE_KEY}${e}`,t)},get:e=>i.$.isClient?localStorage.getItem(`${n.$0.STORAGE_KEY}${e}`):null,delete(e,t){i.$.isClient&&(t?localStorage.removeItem(e):localStorage.removeItem(`${n.$0.STORAGE_KEY}${e}`))}}},73203:function(e,t,r){"use strict";let n,i;r.d(t,{cz:function(){return S},Ig:function(){return c},Tj:function(){return w}});var o=r(99321),s=r(67654),a=r(50959);function c(){if(!n)throw Error('Please call "createAppKit" before using "useAppKit" hook');return{open:async function(e){return n?.open(e)},close:async function(){await n?.close()}}}r(63583);var l=r(86471),u=r(18680);let d=(e,t)=>{let r=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{r.current=(0,l.h8)(e,t,!0)}),(0,a.useDebugValue)(r.current)},h=new WeakMap;function p(e,t){let r=null==t?void 0:t.sync,n=(0,a.useMemo)(()=>e&&new WeakMap,[e]),i=(0,a.useRef)(void 0),o=!0,s=(0,a.useSyncExternalStore)((0,a.useCallback)(t=>{let n=(0,u.Ld)(e,t,r);return t(),n},[e,r]),()=>{let t=(0,u.CO)(e);try{if(!o&&i.current&&!(0,l.ln)(i.current,t,n,new WeakMap))return i.current}catch(e){}return t},()=>(0,u.CO)(e));o=!1,(0,a.useLayoutEffect)(()=>{i.current=s}),d(s,n);let c=(0,a.useMemo)(()=>new WeakMap,[]);return(0,l.DM)(s,n,c,h)}var f=r(42036),g=r(39674),m=r(59449),y=r(20274),b=r(33802);function w(e){let t=p(g.R.state),{activeConnectorIds:r}=p(y.ConnectorController.state),n=e?.namespace||t.activeChain;if(!n)return{allAccounts:[],address:void 0,caipAddress:void 0,status:void 0,isConnected:!1,embeddedWalletInfo:void 0};let i=t.chains.get(n)?.accountState,s=y.ConnectorController.getAuthConnector(n),a=r[n];return{allAccounts:m.ConnectionController.getConnections(n).flatMap(e=>e.accounts.map(({address:e,type:t,publicKey:r})=>o.j.createAccount(n,e,t||"eoa",r))),caipAddress:i?.caipAddress,address:o.j.getPlainAddress(i?.caipAddress),isConnected:!!i?.caipAddress,status:i?.status,embeddedWalletInfo:s&&a===f.b.CONNECTOR_ID.AUTH?{user:i?.user?{...i.user,username:b.M.getConnectedSocialUsername()}:void 0,authProvider:i?.socialProvider||"email",accountType:i?.preferredAccountType,isSmartAccountDeployed:!!i?.smartAccountDeployed}:void 0}}let v=new Set(["children","localName","ref","style","className"]),C=new WeakMap,E=(e,t,r,n,i)=>{let o,s;let a=i?.[t];void 0===a?(e[t]=r,null==r&&t in HTMLElement.prototype&&e.removeAttribute(t)):r!==n&&(void 0===(o=C.get(e))&&C.set(e,o=new Map),s=o.get(a),void 0!==r?void 0===s?(o.set(a,s={handleEvent:r}),e.addEventListener(a,s)):s.handleEvent=r:void 0!==s&&(o.delete(a),e.removeEventListener(a,s)))},x=({react:e,tagName:t,elementClass:r,events:n,displayName:i})=>{let o=new Set(Object.keys(n??{})),s=e.forwardRef((i,s)=>{let a=e.useRef(new Map),c=e.useRef(null),l={},u={};for(let[e,t]of Object.entries(i))v.has(e)?l["className"===e?"class":e]=t:o.has(e)||e in r.prototype?u[e]=t:l[e]=t;return e.useLayoutEffect(()=>{if(null===c.current)return;let e=new Map;for(let t in u)E(c.current,t,i[t],a.current.get(t),n),a.current.delete(t),e.set(t,i[t]);for(let[e,t]of a.current)E(c.current,e,void 0,t,n);a.current=e}),e.useLayoutEffect(()=>{c.current?.removeAttribute("defer-hydration")},[]),l.suppressHydrationWarning=!0,e.createElement(t,{...l,ref:e.useCallback(e=>{c.current=e,"function"==typeof s?s(e):null!==s&&(s.current=e)},[s])})});return s.displayName=i??r.name,s};var A=r(74017);function S(e){return!i&&(n=i=new s.b({...e,sdkVersion:o.j.generateSdkVersion(e.adapters??[],"react","1.8.2")})),i}x({tagName:"appkit-button",elementClass:A.AppKitButton,react:a}),x({tagName:"appkit-network-button",elementClass:A.AppKitNetworkButton,react:a}),x({tagName:"appkit-connect-button",elementClass:A.AppKitConnectButton,react:a}),x({tagName:"appkit-account-button",elementClass:A.AppKitAccountButton,react:a})},83847:function(e,t,r){"use strict";r.d(t,{q:function(){return b}}),r(59908);
7112var n=r(42036),i=r(39674),o=r(20274),s=r(83944),a=r(62250),c=r(99321),l=r(41248),u=r(33279);let d={hexStringToNumber:e=>parseInt(e.startsWith("0x")?e.slice(2):e,16),numberToHexString:e=>`0x${e.toString(16)}`,async getUserInfo(e){let[t,r]=await Promise.all([d.getAddresses(e),d.getChainId(e)]);return{chainId:r,addresses:t}},getChainId:async e=>Number(await e.request({method:"eth_chainId"})),async getAddress(e){let[t]=await e.request({method:"eth_accounts"});return t},getAddresses:async e=>await e.request({method:"eth_accounts"}),async addEthereumChain(e,t){let r=t.rpcUrls.chainDefault?.http||[];await e.request({method:"wallet_addEthereumChain",params:[{chainId:d.numberToHexString(t.id),rpcUrls:[...r],chainName:t.name,nativeCurrency:{name:t.nativeCurrency.name,decimals:t.nativeCurrency.decimals,symbol:t.nativeCurrency.symbol},blockExplorerUrls:[t.blockExplorers?.default.url],iconUrls:[l.C.NetworkImageIds[t.id]]}]})}};var h=r(37391);let p={ACCOUNT_INDEXES:{PAYMENT:0,ORDINAL:1}};var f=r(29447);class g{constructor(e){this.namespace=e.namespace}async syncConnections(e){switch(this.namespace){case n.b.CHAIN.EVM:await this.syncEVMConnections(e);break;case n.b.CHAIN.SOLANA:await this.syncSolanaConnections(e);break;case n.b.CHAIN.BITCOIN:await this.syncBitcoinConnections(e);break;default:throw Error(`Unsupported chain namespace: ${this.namespace}`)}}async syncEVMConnections({connectors:e,caipNetworks:t,universalProvider:r,onConnection:i,onListenProvider:o}){await Promise.all(e.filter(e=>{let{hasDisconnected:t,hasConnected:r}=u.g.getConnectorStorageInfo(e.id,this.namespace);return!t&&r}).map(async e=>{if(e.id===n.b.CONNECTOR_ID.WALLET_CONNECT){let n=f.s.getWalletConnectAccounts(r,this.namespace),o=t.find(e=>e.chainNamespace===this.namespace&&e.id.toString()===n[0]?.chainId?.toString());n.length>0&&i({connectorId:e.id,accounts:n.map(e=>({address:e.address})),caipNetwork:o})}else{let{accounts:r,chainId:s}=await h.CR.fetchProviderData(e);if(r.length>0&&s){let a=t.find(e=>e.chainNamespace===this.namespace&&e.id.toString()===s.toString());i({connectorId:e.id,accounts:r.map(e=>({address:e})),caipNetwork:a}),e.provider&&e.id!==n.b.CONNECTOR_ID.AUTH&&e.id!==n.b.CONNECTOR_ID.WALLET_CONNECT&&o(e.id,e.provider)}}}))}async syncSolanaConnections({connectors:e,caipNetwork:t,universalProvider:r,onConnection:i,onListenProvider:o}){await Promise.all(e.filter(e=>{let{hasDisconnected:t,hasConnected:r}=u.g.getConnectorStorageInfo(e.id,this.namespace);return!t&&r}).map(async e=>{if(e.id===n.b.CONNECTOR_ID.WALLET_CONNECT){let n=f.s.getWalletConnectAccounts(r,this.namespace);n.length>0&&i({connectorId:e.id,accounts:n.map(e=>({address:e.address})),caipNetwork:t})}else{let r=await e.connect({chainId:t?.id});r&&(i({connectorId:e.id,accounts:[{address:r}],caipNetwork:t}),o(e.id,e.provider))}}))}async syncBitcoinConnections({connectors:e,caipNetwork:t,universalProvider:r,onConnection:i,onListenProvider:o}){await Promise.all(e.filter(e=>{let{hasDisconnected:t,hasConnected:r}=u.g.getConnectorStorageInfo(e.id,this.namespace);return!t&&r}).map(async e=>{if(e.id===n.b.CONNECTOR_ID.WALLET_CONNECT){let n=f.s.getWalletConnectAccounts(r,this.namespace);n.length>0&&i({connectorId:e.id,accounts:n.map(e=>({address:e.address})),caipNetwork:t});return}let s=await e.connect(),a=await e.getAccountAddresses(),l=a?.map(e=>c.j.createAccount(n.b.CHAIN.BITCOIN,e.address,e.purpose||"payment",e.publicKey,e.path));if(l&&l.length>1&&(l=[{namespace:n.b.CHAIN.BITCOIN,publicKey:l[p.ACCOUNT_INDEXES.PAYMENT]?.publicKey??"",path:l[p.ACCOUNT_INDEXES.PAYMENT]?.path??"",address:l[p.ACCOUNT_INDEXES.PAYMENT]?.address??"",type:"payment"},{namespace:n.b.CHAIN.BITCOIN,publicKey:l[p.ACCOUNT_INDEXES.ORDINAL]?.publicKey??"",path:l[p.ACCOUNT_INDEXES.ORDINAL]?.path??"",address:l[p.ACCOUNT_INDEXES.ORDINAL]?.address??"",type:"ordinal"}]),!(e.chains.find(e=>e.id===t?.id)||e.chains[0]))throw Error("The connector does not support any of the requested chains");s&&(o(e.id,e.provider),i({connectorId:e.id,accounts:l.map(e=>({address:e.address,type:e.type,publicKey:e.publicKey,path:e.path})),caipNetwork:t}))}))}getConnection({address:e,connectorId:t,connections:r,connectors:n}){if(t){let i=r.find(e=>u.g.isLowerCaseMatch(e.connectorId,t));if(!i)return null;let o=n.find(e=>u.g.isLowerCaseMatch(e.id,i.connectorId)),s=e?i.accounts.find(t=>u.g.isLowerCaseMatch(t.address,e)):i.accounts[0];return{...i,account:s,connector:o}}let i=r.find(e=>e.accounts.length>0&&n.some(t=>u.g.isLowerCaseMatch(t.id,e.connectorId)));if(i){let[e]=i.accounts,t=n.find(e=>u.g.isLowerCaseMatch(e.id,i.connectorId));return{...i,account:e,connector:t}}return null}}var m=r(21220);let y=[n.b.CONNECTOR_ID.AUTH,n.b.CONNECTOR_ID.WALLET_CONNECT];class b{constructor(e){this.availableConnectors=[],this.availableConnections=[],this.providerHandlers={},this.eventListeners=new Map,this.getCaipNetworks=e=>i.R.getCaipNetworks(e),this.getConnectorId=e=>o.ConnectorController.getConnectorId(e),e&&this.construct(e),e?.namespace&&(this.connectionManager=new g({namespace:e.namespace}))}construct(e){this.projectId=e.projectId,this.namespace=e.namespace,this.adapterType=e.adapterType}get connectors(){return this.availableConnectors}get connections(){return this.availableConnections}get networks(){return this.getCaipNetworks(this.namespace)}onAuthConnected({accounts:e,chainId:t}){let r=this.getCaipNetworks().filter(e=>e.chainNamespace===this.namespace).find(e=>e.id.toString()===t?.toString());e&&r&&this.addConnection({connectorId:n.b.CONNECTOR_ID.AUTH,accounts:e,caipNetwork:r})}setAuthProvider(e){e.onConnect(this.onAuthConnected.bind(this)),e.onSocialConnected(this.onAuthConnected.bind(this)),this.addConnector({id:n.b.CONNECTOR_ID.AUTH,type:"AUTH",
7112name:n.b.CONNECTOR_NAMES.AUTH,provider:e,imageId:l.C.ConnectorImageIds[n.b.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}addConnector(...e){let t=new Set;this.availableConnectors=[...e,...this.availableConnectors].filter(e=>!t.has(e.id)&&(t.add(e.id),!0)),this.emit("connectors",this.availableConnectors)}addConnection(...e){let t=new Set;this.availableConnections=[...e,...this.availableConnections].filter(e=>!t.has(e.connectorId.toLowerCase())&&(t.add(e.connectorId.toLowerCase()),!0)),this.emit("connections",this.availableConnections)}deleteConnection(e){this.availableConnections=this.availableConnections.filter(t=>!u.g.isLowerCaseMatch(t.connectorId,e)),this.emit("connections",this.availableConnections)}clearConnections(e=!1){this.availableConnections=[],e&&this.emit("connections",this.availableConnections)}setStatus(e,t){s.AccountController.setStatus(e,t)}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e)?.add(t)}off(e,t){let r=this.eventListeners.get(e);r&&r.delete(t)}removeAllEventListeners(){this.eventListeners.forEach(e=>{e.clear()})}emit(e,t){let r=this.eventListeners.get(e);r&&r.forEach(e=>e(t))}async connectWalletConnect(e){let t=this.getWalletConnectConnector();return{clientId:(await t.connectWalletConnect()).clientId}}async switchNetwork(e){let{caipNetwork:t,providerType:r}=e;if(!e.provider)return;let n="provider"in e.provider?e.provider.provider:e.provider;if("WALLET_CONNECT"===r){n.setDefaultChain(t.caipNetworkId);return}if(n&&"AUTH"===r){let e=(0,a.r9)(t.chainNamespace);await n.switchNetwork({chainId:t.caipNetworkId});let r=await n.getUser({chainId:t.caipNetworkId,preferredAccountType:e});this.emit("switchNetwork",r)}}getWalletConnectConnector(){let e=this.connectors.find(e=>e instanceof m.z);if(!e)throw Error("WalletConnectConnector not found");return e}onConnect(e,t){if(e.length>0){let{address:r,chainId:n}=c.j.getAccount(e[0]),i=this.getCaipNetworks().filter(e=>e.chainNamespace===this.namespace).find(e=>e.id.toString()===n?.toString()),o=this.connectors.find(e=>e.id===t);
7112r&&(this.emit("accountChanged",{address:r,chainId:n,connector:o}),this.addConnection({connectorId:t,accounts:e.map(e=>{let{address:t}=c.j.getAccount(e);return{address:t}}),caipNetwork:i}))}}onAccountsChanged(e,t,r=!0){if(e.length>0){let{address:r}=c.j.getAccount(e[0]),i=this.connectionManager?.getConnection({connectorId:t,connections:this.connections,connectors:this.connectors});r&&u.g.isLowerCaseMatch(this.getConnectorId(n.b.CHAIN.EVM),t)&&this.emit("accountChanged",{address:r,chainId:i?.caipNetwork?.id,connector:i?.connector}),this.addConnection({connectorId:t,accounts:e.map(e=>{let{address:t}=c.j.getAccount(e);return{address:t}}),caipNetwork:i?.caipNetwork})}else r&&this.onDisconnect(t)}onDisconnect(e){this.removeProviderListeners(e),this.deleteConnection(e),u.g.isLowerCaseMatch(this.getConnectorId(n.b.CHAIN.EVM),e)&&this.emitFirstAvailableConnection(),0===this.connections.length&&this.emit("disconnect")}onChainChanged(e,t){let r="string"==typeof e&&e.startsWith("0x")?d.hexStringToNumber(e).toString():e.toString(),i=this.connectionManager?.getConnection({connectorId:t,connections:this.connections,connectors:this.connectors}),o=this.getCaipNetworks().filter(e=>e.chainNamespace===this.namespace).find(e=>e.id.toString()===r);i&&this.addConnection({connectorId:t,accounts:i.accounts,caipNetwork:o}),u.g.isLowerCaseMatch(this.getConnectorId(n.b.CHAIN.EVM),t)&&this.emit("switchNetwork",{chainId:r})}listenProviderEvents(e,t){if(y.includes(e))return;let r=t=>this.onAccountsChanged(t,e),n=t=>this.onChainChanged(t,e),i=()=>this.onDisconnect(e);this.providerHandlers[e]||(t.on("disconnect",i),t.on("accountsChanged",r),t.on("chainChanged",n),this.providerHandlers[e]={provider:t,disconnect:i,accountsChanged:r,chainChanged:n})}removeProviderListeners(e){if(this.providerHandlers[e]){let{provider:t,disconnect:r,accountsChanged:n,chainChanged:i}=this.providerHandlers[e];t.removeListener("disconnect",r),t.removeListener("accountsChanged",n),t.removeListener("chainChanged",i),this.providerHandlers[e]=null}}emitFirstAvailableConnection(){let e=this.connectionManager?.getConnection({connections:this.connections,connectors:this.connectors});if(e){let[t]=e.accounts;this.emit("accountChanged",{address:t?.address,chainId:e.caipNetwork?.id,connector:e.connector})}}}},29283:function(e,t,r){"use strict";r.d(t,{D:function(){return o}});var n=r(29607),i=r(28503);class o{constructor(){}static getInstance({projectId:e,chainId:t,enableLogger:r,onTimeout:s,abortController:a,getActiveCaipNetwork:c,getCaipNetworks:l}){return o.instance||(o.instance=new i.S({projectId:e,chainId:t,enableLogger:r,onTimeout:s,abortController:a,getActiveCaipNetwork:c,getCaipNetworks:l,enableCloudAuthAccount:!!n.OptionsController.state.remoteFeatures?.emailCapture})),o.instance}}},67654:function(e,t,r){"use strict";r.d(t,{b:function(){return eo}});var n=r(42036),i=r(79649),o=r(71384),s=r(62250),a=r(20274),c=r(46001),l=r(59449),u=r(43486),d=r(84270),h=r(23829),p=r(29607),f=r(83944),g=r(39674),m=r(35763),y=r(33802),b=r(99321),w=r(6082),v=r(87811),C=r(33279),E=r(48459),x=r(52726),A=r(70288),S=r(49854),_=r(29283),I=r(59908),k=r(77879),O=r(9605),N=r(69199),P=r(26330),T=r(35143),R=r(95685),$=r(61253),D=r(30397),L=r(25969),M=r(65045),U=r(83764),j=r(37391),B=r(78632);let F={extractVersion(e){if(!e||"string"!=typeof e)return null;let t=e.match(/(?<version>\d+(?:\.\d+){0,2})(?:-[a-zA-Z]+\.\d+)?/u);return t?.groups?.version||null},checkSDKVersion(e){let t=this.extractVersion(e),r=n.b.IS_DEVELOPMENT;if(!t||!r)return;let i=y.M.getLatestAppKitVersion();if(this.isValidVersion(i)&&this.isOlder(t,i)){console.warn(E.b.getSDKVersionWarningMessage(t,i));return}try{fetch("https://registry.npmjs.org/@reown/appkit/latest").then(e=>e.json()).then(e=>{let r=e.version;this.isOlder(t,r)&&(y.M.updateLatestAppKitVersion({timestamp:Date.now(),version:r}),console.warn(E.b.getSDKVersionWarningMessage(t,r)))})}catch(e){}},isValidVersion:e=>"string"==typeof e&&/^\d+\.\d+\.\d+$/u.test(e),isOlder(e,t){let r=this.extractVersion(e),n=this.extractVersion(t);if(!r||!n)return!1;function i(e){let t=e.split(".").map(Number);for(;t.length<3;)t.push(0);return t}let o=i(r),s=i(n);for(let e=0;e<Math.max(o.length,s.length);
7112e+=1){let t=o[e]||0,r=s[e]||0;if(t<r)return!0;if(t>r)break}return!1}};var z=r(3675);let H={TOKEN_ADDRESSES_BY_SYMBOL:{USDC:{8453:z.r6.asset,84532:z.vE.asset}},getTokenSymbolByAddress(e){if(!e)return;let[t]=Object.entries(H.TOKEN_ADDRESSES_BY_SYMBOL).find(([t,r])=>Object.values(r).includes(e))??[];return t}};var W=r(92290),q=r(56526);let V={createLogger(e,t="error"){let r=(0,q.jI)({level:t}),{logger:n}=(0,q.Rt)({opts:r});return n.error=(...t)=>{for(let r of t)if(r instanceof Error){e(r,...t);return}e(void 0,...t)},n}};var K=r(96884),G=r(72490),Z=r(83847),Y=r(21220),J=r(29059);class X extends Z.q{async setUniversalProvider(e){if(!this.namespace)throw Error("UniversalAdapter:setUniversalProvider - namespace is required");return this.addConnector(new Y.z({provider:e,caipNetworks:this.getCaipNetworks(),namespace:this.namespace})),Promise.resolve()}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){try{let e=this.getWalletConnectConnector();await e.disconnect(),this.emit("disconnect")}catch(e){console.warn("UniversalAdapter:disconnect - error",e)}return{connections:[]}}syncConnections(){return Promise.resolve()}async getAccounts({namespace:e}){let t=this.provider;return Promise.resolve({accounts:(t?.session?.namespaces?.[e]?.accounts?.map(e=>{let[,,t]=e.split(":");return t}).filter((e,t,r)=>r.indexOf(e)===t)||[]).map(t=>b.j.createAccount(e,t,"bip122"===e?"payment":"eoa"))})}async syncConnectors(){return Promise.resolve()}async getBalance(e){if(!(e.caipNetwork&&h.bq.BALANCE_SUPPORTED_CHAINS.includes(e.caipNetwork?.chainNamespace))||e.caipNetwork?.testnet)return{balance:"0.00",symbol:e.caipNetwork?.nativeCurrency.symbol||""};if(f.AccountController.state.balanceLoading&&e.chainId===g.R.state.activeCaipNetwork?.id)return{balance:f.AccountController.state.balance||"0.00",symbol:f.AccountController.state.balanceSymbol||""};let t=(await f.AccountController.fetchTokenBalance()).find(t=>t.chainId===`${e.caipNetwork?.chainNamespace}:${e.chainId}`&&t.symbol===e.caipNetwork?.nativeCurrency.symbol);return{balance:t?.quantity.numeric||"0.00",symbol:t?.symbol||e.caipNetwork?.nativeCurrency.symbol||""}}async signMessage(e){let{provider:t,message:r,address:i}=e;if(!t)throw Error("UniversalAdapter:signMessage - provider is undefined");return{signature:g.R.state.activeCaipNetwork?.chainNamespace===n.b.CHAIN.SOLANA?(await t.request({method:"solana_signMessage",params:{message:K.Z.encode(new TextEncoder().encode(r)),pubkey:i}},g.R.state.activeCaipNetwork?.caipNetworkId)).signature:await t.request({method:"personal_sign",params:[r,i]},g.R.state.activeCaipNetwork?.caipNetworkId)}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(e){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}emitFirstAvailableConnection(){}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){let{caipNetwork:t}=e,r=this.getWalletConnectConnector();if(t.chainNamespace===n.b.CHAIN.EVM)try{await r.provider?.request({method:"wallet_switchEthereumChain",params:[{chainId:G.NC(t.id)}]})}catch(e){if(e.code===J.T.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||e.code===J.T.ERROR_INVALID_CHAIN_ID||e.code===J.T.ERROR_CODE_DEFAULT||e?.data?.originalError?.code===J.T.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await r.provider?.request({method:"wallet_addEthereumChain",params:[{chainId:G.NC(t.id),rpcUrls:[t?.rpcUrls.chainDefault?.http],chainName:t.name,nativeCurrency:t.nativeCurrency,blockExplorerUrls:[t.blockExplorers?.default.url]}]})}catch(e){throw Error("Chain is not supported")}}r.provider.setDefaultChain(t.caipNetworkId)}getWalletConnectProvider(){let e=this.connectors.find(e=>"WALLET_CONNECT"===e.type);return e?.provider}}let Q=["email","socials","swaps","onramp","activity","reownBranding","multiWallet","emailCapture","payWithExchange","payments","reownAuthentication"],ee={email:{apiFeatureName:"social_login",localFeatureName:"email",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.includes("email")},processFallback:e=>void 0===e?h.bq.DEFAULT_REMOTE_FEATURES.email:!!e},socials:{apiFeatureName:"social_login",localFeatureName:"socials",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t.filter(e=>"email"!==e)},processFallback:e=>void 0===e?h.bq.DEFAULT_REMOTE_FEATURES.socials:"boolean"==typeof e?!!e&&h.bq.DEFAULT_REMOTE_FEATURES.socials:e},swaps:{apiFeatureName:"swap",localFeatureName:"swaps",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t},processFallback:e=>void 0===e?h.bq.DEFAULT_REMOTE_FEATURES.swaps:"boolean"==typeof e?!!e&&h.bq.DEFAULT_REMOTE_FEATURES.swaps:e},onramp:{apiFeatureName:"onramp",localFeatureName:"onramp",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t},processFallback:e=>void 0===e?h.bq.DEFAULT_REMOTE_FEATURES.onramp:"boolean"==typeof e?!!e&&h.bq.DEFAULT_REMOTE_FEATURES.onramp:e},activity:{apiFeatureName:"activity",localFeatureName:"history",returnType:!1,isLegacy:!0,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?h.bq.DEFAULT_REMOTE_FEATURES.activity:!!e},reownBranding:{apiFeatureName:"reown_branding",localFeatureName:"reownBranding",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?h.bq.DEFAULT_REMOTE_FEATURES.reownBranding:!!e},emailCapture:{apiFeatureName:"email_capture",localFeatureName:"emailCapture",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>e.isEnabled&&(e.config??[]),processFallback:e=>!1},multiWallet:{apiFeatureName:"multi_wallet",localFeatureName:"multiWallet",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>h.bq.DEFAULT_REMOTE_FEATURES.multiWallet},payWithExchange:{apiFeatureName:"fund_from_exchange",localFeatureName:"payWithExchange",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>h.bq.DEFAULT_REMOTE_FEATURES.payWithExchange},payments:{apiFeatureName:"payments",localFeatureName:"payments",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>h.bq.DEFAULT_REMOTE_FEATURES.payments},reownAuthentication:{apiFeatureName:"reown_authentication",localFeatureName:"reownAuthentication",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?h.bq.DEFAULT_REMOTE_FEATURES.reownAuthentication:!!e}},et={localSettingsOverridden:new Set,getApiConfig:(e,t)=>
7112t?.find(t=>t.id===e),addWarning(e,t){if(void 0!==e){let e=ee[t],r=e.isLegacy?`"features.${e.localFeatureName}" (now "${t}")`:`"features.${t}"`;this.localSettingsOverridden.add(r)}},processFeature(e,t,r,n,i){let o=ee[e],s=t[o.localFeatureName];if(i&&!o.isAvailableOnBasic)return!1;if(n){let t=this.getApiConfig(o.apiFeatureName,r);return t?.config===null?this.processFallbackFeature(e,s):!!t?.config&&(void 0!==s&&this.addWarning(s,e),this.processApiFeature(e,t))}return this.processFallbackFeature(e,s)},processApiFeature:(e,t)=>ee[e].processApi(t),processFallbackFeature:(e,t)=>ee[e].processFallback(t),async fetchRemoteFeatures(e){let t=e.basic??!1,r=e.features||{};this.localSettingsOverridden.clear();let n=null,i=!1;try{i=null!=(n=await d.ApiController.fetchProjectConfig())}catch(e){console.warn("[Reown Config] Failed to fetch remote project configuration. Using local/default values.",e)}let o=i&&!t?h.bq.DEFAULT_REMOTE_FEATURES:h.bq.DEFAULT_REMOTE_FEATURES_DISABLED;try{for(let e of Q){let s=this.processFeature(e,r,n,i,t);Object.assign(o,{[e]:s})}}catch(e){return console.warn("[Reown Config] Failed to process the configuration from Cloud. Using default values.",e),h.bq.DEFAULT_REMOTE_FEATURES}if(i&&this.localSettingsOverridden.size>0){let e=`Your local configuration for ${Array.from(this.localSettingsOverridden).join(", ")} was ignored because a remote configuration was successfully fetched. Please manage these features via your project dashboard on dashboard.reown.com.`;w.AlertController.open({debugMessage:x.j.ALERT_WARNINGS.LOCAL_CONFIGURATION_IGNORED.debugMessage(e)},"warning")}return o}};var er=r(63583);class en{constructor(e){this.chainNamespaces=[],this.features={},this.remoteFeatures={},this.reportedAlertErrors={},this.getCaipNetwork=(e,t)=>{if(e){let r=g.R.getCaipNetworks(e)?.find(e=>e.id===t);if(r)return r;let n=g.R.getNetworkData(e)?.caipNetwork;if(n)return n;let i=g.R.getRequestedCaipNetworks(e);return i.filter(t=>t.chainNamespace===e)?.[0]}return g.R.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{let e=this.getCaipNetwork();if(e)return e.id},this.getCaipNetworks=e=>g.R.getCaipNetworks(e),this.getActiveChainNamespace=()=>g.R.state.activeChain,this.setRequestedCaipNetworks=(e,t)=>{g.R.setRequestedCaipNetworks(e,t)},this.getApprovedCaipNetworkIds=()=>g.R.getAllApprovedCaipNetworkIds(),this.getCaipAddress=e=>g.R.state.activeChain!==e&&e?g.R.state.chains.get(e)?.accountState?.caipAddress:g.R.state.activeCaipAddress,this.setClientId=e=>{N.L.setClientId(e)},this.getProvider=e=>v.O.getProvider(e),this.getProviderType=e=>v.O.getProviderId(e),this.getPreferredAccountType=e=>(0,s.r9)(e),this.setCaipAddress=(e,t)=>{f.AccountController.setCaipAddress(e,t)},this.setBalance=(e,t,r)=>{f.AccountController.setBalance(e,t,r)},this.setProfileName=(e,t)=>{f.AccountController.setProfileName(e,t)},this.setProfileImage=(e,t)=>{f.AccountController.setProfileImage(e,t)},this.setUser=(e,t)=>{f.AccountController.setUser(e,t)},this.resetAccount=e=>{f.AccountController.resetAccount(e)},this.setCaipNetwork=e=>{g.R.setActiveCaipNetwork(e)},this.setCaipNetworkOfNamespace=(e,t)=>{g.R.setChainNetworkData(t,{caipNetwork:e})},this.setStatus=(e,t)=>{f.AccountController.setStatus(e,t),a.ConnectorController.isConnected()?y.M.setConnectionStatus("connected"):y.M.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=e=>g.R.state.chains.get(e)?.accountState?.address,this.setConnectors=e=>{let t=[...a.ConnectorController.state.allConnectors,...e];a.ConnectorController.setConnectors(t)},this.setConnections=(e,t)=>{y.M.setConnections(e,t),l.ConnectionController.setConnections(e,t)},this.fetchIdentity=e=>N.L.fetchIdentity(e),this.getReownName=e=>P.a.getNamesForAddress(e),this.getConnectors=()=>a.ConnectorController.getConnectors(),this.getConnectorImage=e=>T.f.getConnectorImage(e),this.getConnections=e=>this.remoteFeatures.multiWallet?R.f.getConnectionsData(e).connections:(w.AlertController.open(n.b.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.getRecentConnections=e=>this.remoteFeatures.multiWallet?R.f.getConnectionsData(e).recentConnections:(w.AlertController.open(n.b.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.switchConnection=async e=>{if(!this.remoteFeatures.multiWallet){w.AlertController.open(n.b.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");return}await l.ConnectionController.switchConnection(e)},this.deleteConnection=e=>{if(!this.remoteFeatures.multiWallet){w.AlertController.open(n.b.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");return}y.M.deleteAddressFromConnection(e),l.ConnectionController.syncStorageConnections()},this.setConnectedWalletInfo=(e,t)=>{let r=v.O.getProviderId(t),n=e?{...e,type:r}:void 0;f.AccountController.setConnectedWalletInfo(n,t)},this.getIsConnectedState=()=>!!g.R.state.activeCaipAddress,this.addAddressLabel=(e,t,r)=>{f.AccountController.addAddressLabel(e,t,r)},this.removeAddressLabel=(e,t)=>
7112{f.AccountController.removeAddressLabel(e,t)},this.getAddress=e=>g.R.state.activeChain!==e&&e?g.R.state.chains.get(e)?.accountState?.address:f.AccountController.state.address,this.setApprovedCaipNetworksData=e=>g.R.setApprovedCaipNetworksData(e),this.resetNetwork=e=>{g.R.resetNetwork(e)},this.addConnector=e=>{a.ConnectorController.addConnector(e)},this.resetWcConnection=()=>{l.ConnectionController.resetWcConnection()},this.setAddressExplorerUrl=(e,t)=>{f.AccountController.setAddressExplorerUrl(e,t)},this.setSmartAccountDeployed=(e,t)=>{f.AccountController.setSmartAccountDeployed(e,t)},this.setPreferredAccountType=(e,t)=>{g.R.setAccountProp("preferredAccountType",e,t)},this.setEIP6963Enabled=e=>{p.OptionsController.setEIP6963Enabled(e)},this.handleUnsafeRPCRequest=()=>{this.isOpen()?this.isTransactionStackEmpty()||this.redirect("ApproveTransaction"):this.open({view:"ApproveTransaction"})},this.options=e,this.version=e.sdkVersion,this.caipNetworks=this.extendCaipNetworks(e),this.chainNamespaces=this.getChainNamespacesSet(e.adapters,this.caipNetworks),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),this.chainAdapters=this.createAdapters(e.adapters),this.readyPromise=this.initialize(e),F.checkSDKVersion(e.sdkVersion)}getChainNamespacesSet(e,t){let r=e?.map(e=>e.namespace).filter(e=>!!e);return r?.length?[...new Set(r)]:[...new Set(t?.map(e=>e.chainNamespace))]}async initialize(e){if(this.initializeProjectSettings(e),this.initControllers(e),await this.initChainAdapters(),this.sendInitializeEvent(e),p.OptionsController.state.enableReconnect?(await this.syncExistingConnection(),await this.syncAdapterConnections()):await this.unSyncExistingConnection(),this.remoteFeatures=await et.fetchRemoteFeatures(e),p.OptionsController.setRemoteFeatures(this.remoteFeatures),this.remoteFeatures.onramp&&$.ph.setOnrampProviders(this.remoteFeatures.onramp),(p.OptionsController.state.remoteFeatures?.email||Array.isArray(p.OptionsController.state.remoteFeatures?.socials)&&p.OptionsController.state.remoteFeatures?.socials.length>0)&&await this.checkAllowedOrigins(),p.OptionsController.state.features?.reownAuthentication||p.OptionsController.state.remoteFeatures?.reownAuthentication){let{ReownAuthentication:e}=await r.e(7764).then(r.bind(r,7764)),t=p.OptionsController.state.siwx;t instanceof e||(t&&console.warn("ReownAuthentication option is enabled, SIWX configuration will be overridden."),p.OptionsController.setSIWX(new e))}}async openSend(e){let t=e.namespace||g.R.state.activeChain,r=this.getCaipAddress(t),n=this.getCaipNetwork(t)?.id;if(!r)throw Error("openSend: caipAddress not found");if(n?.toString()!==e.chainId.toString()){let r=g.R.getCaipNetworkById(e.chainId,t);if(!r)throw Error(`openSend: caipNetwork with chainId ${e.chainId} not found`);await this.switchNetwork(r,{throwOnFailure:!0})}try{let t=H.getTokenSymbolByAddress(e.assetAddress);t&&await d.ApiController.fetchTokenImages([t])}catch{}return await D.I.open({view:"WalletSend",data:{send:e}}),new Promise((e,t)=>{let r=L.S.subscribeKey("hash",t=>{t&&(i(),e({hash:t}))}),n=D.I.subscribe(e=>{e.open||(i(),t(Error("Modal closed")))}),i=this.createCleanupHandler([r,n])})}toModalOptions(){return{isSwap:function(e){return e?.view==="Swap"},isSend:function(e){return e?.view==="WalletSend"}}}async checkAllowedOrigins(){try{let e=await d.ApiController.fetchAllowedOrigins();if(!b.j.isClient())return;let t=window.location.origin;er.sQ.isOriginAllowed(t,e,er.Tz.DEFAULT_ALLOWED_ANCESTORS)||w.AlertController.open(x.j.ALERT_ERRORS.ORIGIN_NOT_ALLOWED,"error")}catch(e){if(!(e instanceof Error))return;switch(e.message){case"RATE_LIMITED":w.AlertController.open(x.j.ALERT_ERRORS.RATE_LIMITED_APP_CONFIGURATION,"error");break;case"SERVER_ERROR":{let t=e.cause instanceof Error?e.cause:e;w.AlertController.open({displayMessage:x.j.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.displayMessage,debugMessage:x.j.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.debugMessage(t.message)},"error")}}}}createCleanupHandler(e){return()=>{e.forEach(e=>{try{e()}catch{}})}}sendInitializeEvent(e){let{...t}=e;delete t.adapters,delete t.universalProvider,c.X.sendEvent({type:"track",event:"INITIALIZE",properties:{...t,networks:e.networks.map(e=>e.id),siweConfig:{options:e.siweConfig?.options||{}}}})}initControllers(e){this.initializeOptionsController(e),this.initializeChainController(e),this.initializeThemeController(e),this.initializeConnectionController(e),this.initializeConnectorController()}initializeThemeController(e){e.themeMode&&m.ThemeController.setThemeMode(e.themeMode),e.themeVariables&&m.ThemeController.setThemeVariables(e.themeVariables)}initializeChainController(e){if(!this.connectionControllerClient||!this.networkControllerClient)throw Error("ConnectionControllerClient and NetworkControllerClient must be set");g.R.initialize(e.adapters??[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient});let t=this.getDefaultNetwork();t&&g.R.setActiveCaipNetwork(t)}initializeConnectionController(e){l.ConnectionController.initialize(e.adapters??[]),l.ConnectionController.setWcBasic(e.basic??!1)}initializeConnectorController(){a.ConnectorController.initialize(this.chainNamespaces)}initializeProjectSettings(e){p.OptionsController.setProjectId(e.projectId),p.OptionsController.setSdkVersion(e.sdkVersion)}initializeOptionsController(e){p.OptionsController.setDebug(!1!==e.debug),p.OptionsController.setEnableWalletConnect(!1!==e.enableWalletConnect),p.OptionsController.setEnableWalletGuide(!1!==e.enableWalletGuide),p.OptionsController.setEnableWallets(!1!==e.enableWallets),p.OptionsController.setEIP6963Enabled(!1!==e.enableEIP6963),p.OptionsController.setEnableNetworkSwitch(!1!==e.enableNetworkSwitch),p.OptionsController.setEnableReconnect(!1!==e.enableReconnect),p.OptionsController.setEnableAuthLogger(!1!==e.enableAuthLogger),p.OptionsController.setCustomRpcUrls(e.customRpcUrls),p.OptionsController.setEnableEmbedded(e.enableEmbedded),p.OptionsController.setAllWallets(e.allWallets),p.OptionsController.setIncludeWalletIds(e.includeWalletIds),p.OptionsController.setExcludeWalletIds(e.excludeWalletIds),p.OptionsController.setFeaturedWalletIds(e.featuredWalletIds),p.OptionsController.setTokens(e.tokens),p.OptionsController.setTermsConditionsUrl(e.termsConditionsUrl),p.OptionsController.setPrivacyPolicyUrl(e.privacyPolicyUrl),p.OptionsController.setCustomWallets(e.customWallets),p.OptionsController.setFeatures(e.features),p.OptionsController.setAllowUnsupportedChain(e.allowUnsupportedChain),p.OptionsController.setUniversalProviderConfigOverride(e.universalProviderConfigOverride),p.OptionsController.setPreferUniversalLinks(e.experimental_preferUniversalLinks),p.OptionsController.setDefaultAccountTypes(e.defaultAccountTypes);let t=this.getDefaultMetaData();if(!e.metadata&&t&&(e.metadata=t),p.OptionsController.setMetadata(e.metadata),p.OptionsController.setDisableAppend(e.disableAppend),p.OptionsController.setEnableEmbedded(e.enableEmbedded),p.OptionsController.setSIWX(e.siwx),this.features=p.OptionsController.state.features??{},!e.projectId){w.AlertController.open(x.j.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(e.adapters?.find(e=>e.namespace===n.b.CHAIN.EVM)&&e.siweConfig){if(e.siwx)throw Error("Cannot set both `siweConfig` and `siwx` options");p.OptionsController.setSIWX(e.siweConfig.mapToSIWX())}}getDefaultMetaData(){return b.j.isClient()?{name:document.getElementsByTagName("title")?.[0]?.textContent||"",description:document.querySelector('meta[property="og:description"]')?.content||"",url:window.location.origin,icons:[document.querySelector('link[rel~="icon"]')?.href||""]}:null}setUnsupportedNetwork(e){let t=this.getActiveChainNamespace();if(t){let r=W.f.getUnsupportedNetwork(`${t}:${e}`);g.R.setActiveCaipNetwork(r)}}getDefaultNetwork(){return W.f.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(e,t){return W.f.extendCaipNetwork(e,{customNetworkImageUrls:t.chainImages,projectId:t.projectId})}extendCaipNetworks(e){return W.f.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId})}extendDefaultCaipNetwork(e){let t=e.networks.find(t=>
7112t.id===e.defaultNetwork?.id);return t?W.f.extendCaipNetwork(t,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId}):void 0}async disconnectNamespace(e,t){try{this.setLoading(!0,e);let r={connections:[]},n=this.getAdapter(e);return(g.R.state.chains.get(e)?.accountState?.caipAddress||!p.OptionsController.state.enableReconnect)&&n?.disconnect&&(r=await n.disconnect({id:t})),this.setLoading(!1,e),r}catch(t){throw this.setLoading(!1,e),Error(`Failed to disconnect chains: ${t.message}`)}}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{let e=g.R.state.activeChain,t=this.getAdapter(e),r=this.getCaipNetwork(e)?.id,n=l.ConnectionController.getConnections(e),i=this.remoteFeatures.multiWallet,s=n.length>0;if(!t)throw Error("Adapter not found");let a=await t.connectWalletConnect(r);s&&i||this.close(),this.setClientId(a?.clientId||null),y.M.setConnectedNamespaces([...g.R.state.chains.keys()]),await this.syncWalletConnectAccount(),await o.w.initializeIfEnabled()},connectExternal:async e=>{let t=await this.onConnectExternal(e);return await this.connectInactiveNamespaces(e,t),t?{address:t.address}:void 0},reconnectExternal:async({id:e,info:t,type:r,provider:n})=>{let i=g.R.state.activeChain,o=this.getAdapter(i);if(!i)throw Error("reconnectExternal: namespace not found");if(!o)throw Error("reconnectExternal: adapter not found");o?.reconnect&&(await o?.reconnect({id:e,info:t,type:r,provider:n,chainId:this.getCaipNetwork()?.id}),y.M.addConnectedNamespace(i),this.syncConnectedWalletInfo(i))},disconnect:async e=>{let{id:t,chainNamespace:r,initialDisconnect:i}=e||{},s=r||g.R.state.activeChain,u=a.ConnectorController.getConnectorId(s),d=t===n.b.CONNECTOR_ID.AUTH||u===n.b.CONNECTOR_ID.AUTH,h=t===n.b.CONNECTOR_ID.WALLET_CONNECT||u===n.b.CONNECTOR_ID.WALLET_CONNECT;try{let e=Array.from(g.R.state.chains.keys()),n=r?[r]:e;(h||d)&&(n=e);let s=n.map(async e=>{let r=a.ConnectorController.getConnectorId(e),n=await this.disconnectNamespace(e,t||r);n&&(d&&y.M.deleteConnectedSocialProvider(),n.connections.forEach(t=>{y.M.addDisconnectedConnectorId(t.connectorId,e)})),i&&this.onDisconnectNamespace({chainNamespace:e,closeModal:!1})}),u=await Promise.allSettled(s);L.S.resetSend(),l.ConnectionController.resetWcConnection(),o.w.getSIWX()?.signOutOnDisconnect&&await o.w.clearSessions(),a.ConnectorController.setFilterByNamespace(void 0),l.ConnectionController.syncStorageConnections();let p=u.filter(e=>"rejected"===e.status);if(p.length>0)throw Error(p.map(e=>e.reason.message).join(", "));c.X.sendEvent({type:"track",event:"DISCONNECT_SUCCESS",properties:{namespace:r||"all"}})}catch(e){throw Error(`Failed to disconnect chains: ${e.message}`)}},checkInstalled:e=>e?e.some(e=>!!window.ethereum?.[String(e)]):!!window.ethereum,signMessage:async e=>{let t=g.R.state.activeChain,r=this.getAdapter(g.R.state.activeChain);if(!t)throw Error("signMessage: namespace not found");if(!r)throw Error("signMessage: adapter not found");let n=await r?.signMessage({message:e,address:f.AccountController.state.address,provider:v.O.getProvider(t)});return n?.signature||""},sendTransaction:async e=>{let t=e.chainNamespace;if(!t)throw Error("sendTransaction: namespace not found");if(h.bq.SEND_SUPPORTED_NAMESPACES.includes(t)){let r=this.getAdapter(t);if(!r)throw Error("sendTransaction: adapter not found");let n=v.O.getProvider(t),i=await r?.sendTransaction({...e,caipNetwork:this.getCaipNetwork(),provider:n});return i?.hash||""}return""},estimateGas:async e=>{let t=e.chainNamespace;if(t===n.b.CHAIN.EVM){let r=this.getAdapter(t);if(!r)throw Error("estimateGas: adapter is required but got undefined");let n=v.O.getProvider(t),i=this.getCaipNetwork();if(!i)throw Error("estimateGas: caipNetwork is required but got undefined");let o=await r?.estimateGas({...e,provider:n,caipNetwork:i});return o?.gas||0n}return 0n},getEnsAvatar:async()=>{let e=g.R.state.activeChain;if(!e)throw Error("getEnsAvatar: namespace is required but got undefined");return await this.syncIdentity({address:f.AccountController.state.address,chainId:Number(this.getCaipNetwork()?.id),chainNamespace:e}),f.AccountController.state.profileImage||!1},getEnsAddress:async e=>await er.sQ.resolveReownName(e),writeContract:async e=>{let t=g.R.state.activeChain,r=this.getAdapter(t);if(!t)throw Error("writeContract: namespace is required but got undefined");if(!r)throw Error("writeContract: adapter is required but got undefined");let n=this.getCaipNetwork(),i=this.getCaipAddress(),o=v.O.getProvider(t);if(!n||!i)throw Error("writeContract: caipNetwork or caipAddress is required but got undefined");let s=await r?.writeContract({...e,caipNetwork:n,provider:o,caipAddress:i});return s?.hash},parseUnits:(e,t)=>{let r=this.getAdapter(g.R.state.activeChain);if(!r)throw Error("parseUnits: adapter is required but got undefined");return r?.parseUnits({value:e,decimals:t})??0n},formatUnits:(e,t)=>{let r=this.getAdapter(g.R.state.activeChain);if(!r)throw Error("formatUnits: adapter is required but got undefined");return r?.formatUnits({value:e,decimals:t})??"0"},getCapabilities:async e=>{let t=this.getAdapter(g.R.state.activeChain);if(!t)throw Error("getCapabilities: adapter is required but got undefined");return await t?.getCapabilities(e)},grantPermissions:async e=>{let t=this.getAdapter(g.R.state.activeChain);if(!t)throw Error("grantPermissions: adapter is required but got undefined");return await t?.grantPermissions(e)},revokePermissions:async e=>{let t=this.getAdapter(g.R.state.activeChain);if(!t)throw Error("revokePermissions: adapter is required but got undefined");return t?.revokePermissions?await t.revokePermissions(e):"0x"},walletGetAssets:async e=>{let t=this.getAdapter(g.R.state.activeChain);if(!t)throw Error("walletGetAssets: adapter is required but got undefined");return await t?.walletGetAssets(e)??{}},updateBalance:e=>{let t=this.getCaipNetwork(e);t&&f.AccountController.state.address&&this.updateNativeBalance(f.AccountController.state.address,t?.id,e)}},this.networkControllerClient={switchCaipNetwork:async e=>await this.switchCaipNetwork(e),getApprovedCaipNetworksData:async()=>this.getApprovedCaipNetworksData()},l.ConnectionController.setClient(this.connectionControllerClient)}async onConnectExternal(e){let t=g.R.state.activeChain,r=e.chain||t,i=this.getAdapter(r),o=!0;if(e.type===E.b.CONNECTOR_TYPE_AUTH&&n.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(e=>a.ConnectorController.getConnectorId(e)===n.b.CONNECTOR_ID.AUTH)&&e.chain!==t&&(o=!1),e.chain&&e.chain!==t&&!e.caipNetwork){let t=this.getCaipNetworks().find(t=>t.chainNamespace===e.chain);t&&o&&this.setCaipNetwork(t)}if(!r)throw Error("connectExternal: namespace not found");if(!i)throw Error("connectExternal: adapter not found");let s=this.getCaipNetwork(r),c=e.caipNetwork||s,l=await i.connect({id:e.id,address:e.address,info:e.info,type:e.type,provider:e.provider,socialUri:e.socialUri,chainId:e.caipNetwork?.id||s?.id,rpcUrl:e.caipNetwork?.rpcUrls?.default?.http?.[0]||s?.rpcUrls?.default?.http?.[0]});if(l)return y.M.addConnectedNamespace(r),this.syncProvider({...l,chainNamespace:r}),this.setStatus("connected",r),this.syncConnectedWalletInfo(r),y.M.removeDisconnectedConnectorId(e.id,r),{address:l.address,connectedCaipNetwork:c}}async connectInactiveNamespaces(e,t){let r=e.type===E.b.CONNECTOR_TYPE_AUTH,n=C.g.getOtherAuthNamespaces(t?.connectedCaipNetwork?.chainNamespace),i=g.R.state.activeCaipNetwork,o=this.getAdapter(i?.chainNamespace),s=v.O.getProvider(i?.chainNamespace);r&&(await Promise.all(n.map(async t=>{try{let r=v.O.getProvider(t),n=this.getCaipNetwork(t),i=this.getAdapter(t);await i?.connect({...e,provider:r,socialUri:void 0,chainId:n?.id,rpcUrl:n?.rpcUrls?.default?.http?.[0]})&&(y.M.addConnectedNamespace(t),y.M.removeDisconnectedConnectorId(e.id,t),this.setStatus("connected",t),this.syncConnectedWalletInfo(t))}catch(e){w.AlertController.warn(x.j.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.displayMessage,x.j.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.debugMessage(t,e instanceof Error?e.message:void 0),x.j.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.code)}})),i&&await o?.switchNetwork({caipNetwork:i,provider:s,providerType:e.type}))}getApprovedCaipNetworksData(){if(v.O.getProviderId(g.R.state.activeChain)===E.b.CONNECTOR_TYPE_WALLET_CONNECT){let e=this.universalProvider?.session?.namespaces;return{supportsAllNetworks:this.universalProvider?.session?.peer?.metadata.name==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(e)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(e){if(!e)return;let t=e.chainNamespace;if(this.getAddressByChainNamespace(e.chainNamespace)){let r=v.O.getProvider(t),n=v.O.getProviderId(t);if(e.chainNamespace===g.R.state.activeChain){let i=this.getAdapter(t);await i?.switchNetwork({caipNetwork:e,provider:r,providerType:n})}else if(this.setCaipNetwork(e),n===E.b.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{let r=this.getAddressByChainNamespace(t);r&&this.syncAccount({address:r,chainId:e.id,chainNamespace:t})}}else this.setCaipNetwork(e)}
7112getChainsFromNamespaces(e={}){return Object.values(e).flatMap(e=>Array.from(new Set([...e.chains||[],...e.accounts.map(e=>{let{chainId:t,chainNamespace:r}=k.u.parseCaipAddress(e);return`${r}:${t}`})])))}createAdapters(e){return this.createClients(),this.chainNamespaces.reduce((t,r)=>{let n=e?.find(e=>e.namespace===r);return n?(n.construct({namespace:r,projectId:this.options?.projectId,networks:this.getCaipNetworks()}),t[r]=n):t[r]=new X({namespace:r,networks:this.getCaipNetworks()}),t},{})}async initChainAdapter(e){this.onConnectors(e),this.listenAdapter(e),await this.chainAdapters?.[e].syncConnectors(this.options,this),await this.createUniversalProviderForAdapter(e)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{await this.initChainAdapter(e)}))}onConnectors(e){let t=this.getAdapter(e);t?.on("connectors",this.setConnectors.bind(this))}listenAdapter(e){let t=this.getAdapter(e);if(!t)return;let r=y.M.getConnectionStatus();!1===p.OptionsController.state.enableReconnect?this.setStatus("disconnected",e):"connected"===r?this.setStatus("connecting",e):("disconnected"===r&&y.M.clearAddressCache(),this.setStatus(r,e)),t.on("switchNetwork",({address:t,chainId:r})=>{let n=this.getCaipNetworks().find(e=>e.id.toString()===r.toString()||e.caipNetworkId.toString()===r.toString()),i=g.R.state.activeChain===e,o=g.R.state.chains.get(e)?.accountState?.address;if(n){let r=i&&t?t:o;r&&this.syncAccount({address:r,chainId:n.id,chainNamespace:e})}else this.setUnsupportedNetwork(r)}),t.on("disconnect",()=>{let t=this.remoteFeatures.multiWallet,r=Array.from(l.ConnectionController.state.connections.values()).flat();this.onDisconnectNamespace({chainNamespace:e,closeModal:!t||0===r.length})}),t.on("connections",t=>{this.setConnections(t,e)}),t.on("pendingTransactions",()=>{let e=f.AccountController.state.address,t=g.R.state.activeCaipNetwork;e&&t?.id&&this.updateNativeBalance(e,t.id,t.chainNamespace)}),t.on("accountChanged",({address:t,chainId:r,connector:n})=>{let i=g.R.state.activeChain===e;n?.provider&&(this.syncProvider({id:n.id,type:n.type,provider:n.provider,chainNamespace:e}),this.syncConnectedWalletInfo(e));let o=g.R.getNetworkData(e)?.caipNetwork?.id,s=r||o;i&&s?this.syncAccount({address:t,chainId:s,chainNamespace:e}):!i&&s?(this.syncAccountInfo(t,s,e),this.syncBalance({address:t,chainId:s,chainNamespace:e})):this.syncAccountInfo(t,r,e),y.M.addConnectedNamespace(e)})}async createUniversalProviderForAdapter(e){await this.getUniversalProvider(),this.universalProvider&&await this.chainAdapters?.[e]?.setUniversalProvider?.(this.universalProvider)}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(e=>this.syncNamespaceConnection(e)))}async unSyncExistingConnection(){try{await Promise.allSettled(this.chainNamespaces.map(e=>l.ConnectionController.disconnect({namespace:e,initialDisconnect:!0})))}catch(e){console.error("Error disconnecting existing connections:",e)}}async reconnectWalletConnect(){await this.syncWalletConnectAccount();let e=this.getAddress();c.X.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:e,properties:{method:b.j.isMobile()?"mobile":"qrcode",name:this.universalProvider?.session?.peer?.metadata?.name||"Unknown",reconnect:!0}})}async syncNamespaceConnection(e){try{e===n.b.CHAIN.EVM&&b.j.isSafeApp()&&a.ConnectorController.setConnectorId(n.b.CONNECTOR_ID.SAFE,e);let t=a.ConnectorController.getConnectorId(e);switch(this.setStatus("connecting",e),t){case n.b.CONNECTOR_ID.WALLET_CONNECT:await this.reconnectWalletConnect();break;case n.b.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(e)}}catch(t){console.warn("AppKit couldn't sync existing connection",t),this.setStatus("disconnected",e)}}onDisconnectNamespace(e){let{chainNamespace:t,closeModal:r}=e||{};g.R.resetAccount(t),g.R.resetNetwork(t),y.M.removeConnectedNamespace(t);let n=Array.from(g.R.state.chains.keys());(t?[t]:n).forEach(e=>y.M.addDisconnectedConnectorId(a.ConnectorController.getConnectorId(e)||"",e)),a.ConnectorController.removeConnectorId(t),v.O.resetChain(t),this.setUser(void 0,t),this.setStatus("disconnected",t),this.setConnectedWalletInfo(void 0,t),!1!==r&&D.I.close()}async syncAdapterConnections(){await Promise.allSettled(this.chainNamespaces.map(e=>{let t=this.getAdapter(e),r=this.getCaipAddress(e),n=this.getCaipNetwork(e);return t?.syncConnections({connectToFirstConnector:!r,caipNetwork:n})}))}async syncAdapterConnection(e){let t=this.getAdapter(e),r=this.getCaipNetwork(e),n=a.ConnectorController.getConnectorId(e),i=a.ConnectorController.getConnectors(e).find(e=>e.id===n);try{if(!t||!i)throw Error(`Adapter or connector not found for namespace ${e}`);if(!r?.id)throw Error("CaipNetwork not found");let n=await t?.syncConnection({namespace:e,id:i.id,chainId:r.id,rpcUrl:r?.rpcUrls?.default?.http?.[0]});n?(this.syncProvider({...n,chainNamespace:e}),await this.syncAccount({...n,chainNamespace:e}),this.setStatus("connected",e),c.X.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:n.address,properties:{method:"browser",name:i.info?.name||i.name||"Unknown",re
7112connect:!0}})):this.setStatus("disconnected",e)}catch(t){this.onDisconnectNamespace({chainNamespace:e,closeModal:!1})}}async syncWalletConnectAccount(){let e=Object.keys(this.universalProvider?.session?.namespaces||{}),t=this.chainNamespaces.map(async t=>{let r=this.getAdapter(t);if(!r)return;let i=this.universalProvider?.session?.namespaces?.[t]?.accounts||[],o=g.R.state.activeCaipNetwork?.id,s=i.find(e=>{let{chainId:t}=k.u.parseCaipAddress(e);return t===o?.toString()})||i[0];if(s){let e=k.u.validateCaipAddress(s),{chainId:i,address:o}=k.u.parseCaipAddress(e);if(v.O.setProviderId(t,E.b.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&g.R.state.activeCaipNetwork&&r.namespace!==n.b.CHAIN.EVM){let e=r.getWalletConnectProvider({caipNetworks:this.getCaipNetworks(),provider:this.universalProvider,activeCaipNetwork:g.R.state.activeCaipNetwork});v.O.setProvider(t,e)}else v.O.setProvider(t,this.universalProvider);a.ConnectorController.setConnectorId(n.b.CONNECTOR_ID.WALLET_CONNECT,t),y.M.addConnectedNamespace(t),await this.syncAccount({address:o,chainId:i,chainNamespace:t})}else e.includes(t)&&this.setStatus("disconnected",t);this.syncConnectedWalletInfo(t),await g.R.setApprovedCaipNetworksData(t)});await Promise.all(t)}syncProvider({type:e,provider:t,id:r,chainNamespace:n}){v.O.setProviderId(n,e),v.O.setProvider(n,t),a.ConnectorController.setConnectorId(r,n)}async syncAccount(e){let t=e.chainNamespace===g.R.state.activeChain,r=g.R.getCaipNetworkByNamespace(e.chainNamespace,e.chainId),{address:i,chainId:o,chainNamespace:s}=e,{chainId:a}=y.M.getActiveNetworkProps(),c=o||a,l=g.R.state.activeCaipNetwork?.name===n.b.UNSUPPORTED_NETWORK_NAME,u=g.R.getNetworkProp("supportsAllNetworks",s);if(this.setStatus("connected",s),(!l||u)&&c){let e=this.getCaipNetworks().find(e=>e.id.toString()===c.toString()),a=this.getCaipNetworks().find(e=>e.chainNamespace===s);if(!u&&!e&&!a){let t=this.getApprovedCaipNetworkIds()||[],r=t.find(e=>k.u.parseCaipNetworkId(e)?.chainId===c.toString()),n=t.find(e=>k.u.parseCaipNetworkId(e)?.chainNamespace===s);e=this.getCaipNetworks().find(e=>e.caipNetworkId===r),a=this.getCaipNetworks().find(e=>e.caipNetworkId===n||"deprecatedCaipNetworkId"in e&&e.deprecatedCaipNetworkId===n)}let l=e||a;l?.chainNamespace===g.R.state.activeChain?p.OptionsController.state.enableNetworkSwitch&&!p.OptionsController.state.allowUnsupportedChain&&g.R.state.activeCaipNetwork?.name===n.b.UNSUPPORTED_NETWORK_NAME?g.R.showUnsupportedChainUI():this.setCaipNetwork(l):!t&&r&&this.setCaipNetworkOfNamespace(r,s),this.syncConnectedWalletInfo(s),C.g.isLowerCaseMatch(i,f.AccountController.state.address)||this.syncAccountInfo(i,l?.id,s),t?await this.syncBalance({address:i,chainId:l?.id,chainNamespace:s}):await this.syncBalance({address:i,chainId:r?.id,chainNamespace:s}),this.syncIdentity({address:i,chainId:o,chainNamespace:s})}}async syncAccountInfo(e,t,r){let n=this.getCaipAddress(r),i=t||n?.split(":")[1];if(!i)return;let o=`${r}:${i}:${e}`;this.setCaipAddress(o,r),await this.syncIdentity({address:e,chainId:i,chainNamespace:r})}async syncReownName(e,t){try{let r=await this.getReownName(e);if(r[0]){let e=r[0];this.setProfileName(e.name,t)}else this.setProfileName(null,t)}catch{this.setProfileName(null,t)}}syncConnectedWalletInfo(e){let t=a.ConnectorController.getConnectorId(e),r=v.O.getProviderId(e);if(r===E.b.CONNECTOR_TYPE_ANNOUNCED||r===E.b.CONNECTOR_TYPE_INJECTED){if(t){let r=this.getConnectors().find(e=>{let r=e.id===t,n=e.info?.rdns===t,i=e.connectors?.some(e=>e.id===t||e.info?.rdns===t);return r||n||!!i});if(r){let{info:t,name:n,imageUrl:i}=r,o=i||this.getConnectorImage(r);this.setConnectedWalletInfo({name:n,icon:o,...t},e)}}}else if(r===E.b.CONNECTOR_TYPE_WALLET_CONNECT){let t=v.O.getProvider(e);t?.session&&this.setConnectedWalletInfo({...t.session.peer.metadata,name:t.session.peer.metadata.name,icon:t.session.peer.metadata.icons?.[0]},e)}else if(t&&(t===n.b.CONNECTOR_ID.COINBASE_SDK||t===n.b.CONNECTOR_ID.COINBASE)){let r=this.getConnectors().find(e=>e.id===t),n=r?.name||"Coinbase Wallet",i=r?.imageUrl||this.getConnectorImage(r),o=r?.info;this.setConnectedWalletInfo({...o,name:n,icon:i},e)}}async syncBalance(e){O.p.getNetworksByNamespace(this.getCaipNetworks(),e.chainNamespace).find(t=>
7112t.id.toString()===e.chainId?.toString())&&e.chainId&&await this.updateNativeBalance(e.address,e.chainId,e.chainNamespace)}async ready(){await this.readyPromise}async updateNativeBalance(e,t,r){let n=this.getAdapter(r),i=g.R.getCaipNetworkByNamespace(r,t);if(n){let o=await n.getBalance({address:e,chainId:t,caipNetwork:i,tokens:this.options.tokens});return this.setBalance(o.balance,o.symbol,r),o}}async initializeUniversalAdapter(){let e=V.createLogger((e,...t)=>{e&&this.handleAlertError(e),console.error(...t)}),t={projectId:this.options?.projectId,metadata:{name:this.options?.metadata?this.options?.metadata.name:"",description:this.options?.metadata?this.options?.metadata.description:"",url:this.options?.metadata?this.options?.metadata.url:"",icons:this.options?.metadata?this.options?.metadata.icons:[""]},logger:e};p.OptionsController.setManualWCControl(!!this.options?.manualWCControl),this.universalProvider=this.options.universalProvider??await I.Z.init(t),!1===p.OptionsController.state.enableReconnect&&this.universalProvider.session&&await this.universalProvider.disconnect(),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&this.chainNamespaces.forEach(e=>{er.sQ.listenWcProvider({universalProvider:this.universalProvider,namespace:e,onDisplayUri:e=>{l.ConnectionController.setUri(e)},onConnect:e=>{let{address:t}=b.j.getAccount(e[0]);l.ConnectionController.finalizeWcConnection(t)},onDisconnect:()=>{g.R.state.noAdapters&&this.resetAccount(e),l.ConnectionController.resetWcConnection()},onChainChanged:t=>{let r=g.R.state.activeChain,i=r&&a.ConnectorController.state.activeConnectorIds[r]===n.b.CONNECTOR_ID.WALLET_CONNECT;if(r===e&&(g.R.state.noAdapters||i)){let e=this.getCaipNetworks().find(e=>e.id.toString()===t.toString()||e.caipNetworkId.toString()===t.toString()),r=this.getCaipNetwork();if(!e){this.setUnsupportedNetwork(t);return}r?.id.toString()!==e?.id.toString()&&r?.chainNamespace===e?.chainNamespace&&this.setCaipNetwork(e)}},onAccountsChanged:t=>{let r=g.R.state.activeChain,i=r&&a.ConnectorController.state.activeConnectorIds[r]===n.b.CONNECTOR_ID.WALLET_CONNECT;if(r===e&&(g.R.state.noAdapters||i)){let e=t?.[0];e&&this.syncAccount({address:e.address,chainId:e.chainId,chainNamespace:e.chainNamespace})}}})})}createUniversalProvider(){return!this.universalProviderInitPromise&&b.j.isClient()&&this.options?.projectId&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}
7112async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){c.X.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:e instanceof Error?e.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",e)}return this.universalProvider}handleAlertError(e){let[t,r]=Object.entries(x.j.UniversalProviderErrors).find(([,{message:t}])=>e.message.includes(t))??[],{message:n,alertErrorKey:i}=r??{};if(t&&n&&!this.reportedAlertErrors[t]){let e=x.j.ALERT_ERRORS[i];e&&(w.AlertController.open(e,"error"),this.reportedAlertErrors[t]=!0)}}getAdapter(e){if(e)return this.chainAdapters?.[e]}createAdapter(e){if(!e)return;let t=e.namespace;t&&(this.createClients(),e.namespace=t,e.construct({namespace:t,projectId:this.options?.projectId,networks:this.getCaipNetworks()}),this.chainNamespaces.includes(t)||this.chainNamespaces.push(t),this.chainAdapters&&(this.chainAdapters[t]=e))}async open(e){await this.injectModalUi(),e?.uri&&l.ConnectionController.setUri(e.uri);let{isSwap:t,isSend:r}=this.toModalOptions();return t(e)?D.I.open({...e,data:{swap:e.arguments}}):r(e)&&e.arguments?this.openSend(e.arguments):D.I.open(e)}async close(){await this.injectModalUi(),D.I.close()}setLoading(e,t){D.I.setLoading(e,t)}async disconnect(e){await l.ConnectionController.disconnect({namespace:e})}getSIWX(){return p.OptionsController.state.siwx}getError(){return""}getChainId(){return g.R.state.activeCaipNetwork?.id}async switchNetwork(e,{throwOnFailure:t=!1}={}){let r=this.getCaipNetworks().find(t=>t.id===e.id);if(!r){w.AlertController.open(x.j.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");return}await g.R.switchActiveNetwork(r,{throwOnFailure:t})}getWalletProvider(){return g.R.state.activeChain?v.O.state.providers[g.R.state.activeChain]:null}getWalletProviderType(){return v.O.getProviderId(g.R.state.activeChain)}subscribeProviders(e){return v.O.subscribeProviders(e)}getThemeMode(){return m.ThemeController.state.themeMode}getThemeVariables(){return m.ThemeController.state.themeVariables}setThemeMode(e){m.ThemeController.setThemeMode(e),(0,B.Hs)(m.ThemeController.state.themeMode)}setTermsConditionsUrl(e){p.OptionsController.setTermsConditionsUrl(e)}setPrivacyPolicyUrl(e){p.OptionsController.setPrivacyPolicyUrl(e)}setThemeVariables(e){m.ThemeController.setThemeVariables(e),(0,B.R)(m.ThemeController.state.themeVariables)}subscribeTheme(e){return m.ThemeController.subscribe(e)}subscribeConnections(e){return this.remoteFeatures.multiWallet?l.ConnectionController.subscribe(e):(w.AlertController.open(n.b.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),()=>void 0)}getWalletInfo(e){return e?g.R.state.chains.get(e)?.accountState?.connectedWalletInfo:f.AccountController.state.connectedWalletInfo}getAccount(e){let t=e||g.R.state.activeChain,r=a.ConnectorController.getAuthConnector(t),i=g.R.getAccountData(t),o=y.M.getConnectedConnectorId(g.R.state.activeChain),c=l.ConnectionController.getConnections(t);if(!t)throw Error("AppKit:getAccount - namespace is required");let u=c.flatMap(e=>e.accounts.map(({address:e,type:r,publicKey:n})=>b.j.createAccount(t,e,r||"eoa",n)));if(i)return{allAccounts:u,caipAddress:i.caipAddress,address:b.j.getPlainAddress(i.caipAddress),isConnected:!!i.caipAddress,status:i.status,embeddedWalletInfo:r&&o===n.b.CONNECTOR_ID.AUTH?{user:i.user?{...i.user,username:y.M.getConnectedSocialUsername()}:void 0,authProvider:i.socialProvider||"email",accountType:(0,s.r9)(t),isSmartAccountDeployed:!!i.smartAccountDeployed}:void 0}}subscribeAccount(e,t){let r=()=>{let r=this.getAccount(t);r&&e(r)};t?g.R.subscribeChainProp("accountState",r,t):g.R.subscribe(r),a.ConnectorController.subscribe(r)}subscribeNetwork(e){return g.R.subscribe(({activeCaipNetwork:t})=>{e({caipNetwork:t,chainId:t?.id,caipNetworkId:t?.caipNetworkId})})}subscribeWalletInfo(e,t){return t?f.AccountController.subscribeKey("connectedWalletInfo",e,t):f.AccountController.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){f.AccountController.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){g.R.subscribeKey("activeCaipNetwork",e)}getState(){return u.I.state}getRemoteFeatures(){return p.OptionsController.state.remoteFeatures}subscribeState(e){return u.I.subscribe(e)}subscribeRemoteFeatures(e){return p.OptionsController.subscribeKey("remoteFeatures",e)}showErrorMessage(e){M.SnackController.showError(e)}showSuccessMessage(e){M.SnackController.showSuccess(e)}getEvent(){return{...c.X.state}}subscribeEvents(e){return c.X.subscribe(e)}replace(e){U.RouterController.replace(e)}redirect(e){U.RouterController.push(e)}popTransactionStack(e){U.RouterController.popTransactionStack(e)}isOpen(){return D.I.state.open}isTransactionStackEmpty(){return 0===U.RouterController.state.transactionStack.length}static getInstance(){return this.instance}updateFeatures(e){p.OptionsController.setFeatures(e)}updateRemoteFeatures(e){p.OptionsController.setRemoteFeatures(e)}updateOptions(e){let t={...p.OptionsController.state||{},...e};p.OptionsController.setOptions(t)}setConnectMethodsOrder(e){p.OptionsController.setConnectMethodsOrder(e)}setWalletFeaturesOrder(e){p.OptionsController.setWalletFeaturesOrder(e)}setCollapseWallets(e){p.OptionsController.setCollapseWallets(e)}setSocialsOrder(e){p.OptionsController.setSocialsOrder(e)}getConnectMethodsOrder(){return j.JG.getConnectOrderMethod(p.OptionsController.state.features,a.ConnectorController.getConnectors())}addNetwork(e,t){if(this.chainAdapters&&!this.chainAdapters[e])throw Error(`Adapter for namespace ${e} doesn't exist`);let r=this.extendCaipNetwork(t,this.options);this.getCaipNetworks().find(e=>e.id===r.id)||g.R.addNetwork(r)}removeNetwork(e,t){if(this.chainAdapters&&!this.chainAdapters[e])throw Error(`Adapter for namespace ${e} doesn't exist`);this.getCaipNetworks().find(e=>e.id===t)&&g.R.removeNetwork(e,t)}}let ei=!1;class eo extends en{async onAuthProviderConnected(e){let t=C.g.userChainIdToChainNamespace(e?.chainId);if(e.message&&e.signature&&e.siwxMessage&&await o.w.addEmbeddedWalletSession({chainId:e.siwxMessage.chainId,accountAddress:e.address,notBefore:e.siwxMessage.notBefore,statement:e.siwxMessage.statement,resources:e.siwxMessage.resources,requestId:e.siwxMessage.requestId,issuedAt:e.siwxMessage.issuedAt,domain:e.siwxMessage.domain,uri:e.siwxMessage.uri,version:e.siwxMessage.version,nonce:e.siwxMessage.nonce},e.message,e.signature),!t)throw Error("AppKit:onAuthProviderConnected - namespace is required");let r=t===n.b.CHAIN.EVM?`eip155:${e.chainId}:${e.address}`:`${e.chainId}:${e.address}`,i=p.OptionsController.state.defaultAccountTypes[t],a=(0,s.r9)(t),c=e.preferredAccountType||a||i;this.setCaipAddress(r,t);let{signature:l,siwxMessage:u,message:d,...h}=e;this.setUser({...f.AccountController.state.user||{},...h},t),this.setSmartAccountDeployed(!!e.smartAccountDeployed,t),this.setPreferredAccountType(c,t),this.setLoading(!1,t)}setupAuthConnectorListeners(e){e.onRpcRequest(t=>{A.$.checkIfRequestExists(t)?A.$.checkIfRequestIsSafe(t)||this.handleUnsafeRPCRequest():(this.open(),console.error(S.y_.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:t.method}),setTimeout(()=>{this.showErrorMessage(S.y_.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),e.rejectRpcRequests())}),e.onRpcError(()=>{this.isOpen()&&(this.isTransactionStackEmpty()?this.close():this.popTransactionStack("error"))}),e.onRpcSuccess((e,t)=>{let r=A.$.checkIfRequestIsSafe(t),n=f.AccountController.state.address,i=g.R.state.activeCaipNetwork;r||(n&&i?.id&&this.updateNativeBalance(n,i.id,i.chainNamespace),this.isTransactionStackEmpty()?this.close():this.popTransactionStack("success"))}),e.onNotConnected(()=>{let e=g.R.state.activeChain;if(!e)throw Error("AppKit:onNotConnected - namespace is required");a.ConnectorController.getConnectorId(e)===n.b.CONNECTOR_ID.AUTH&&(this.setCaipAddress(void 0,e),this.setLoading(!1,e))}),e.onConnect(this.onAuthProviderConnected.bind(this)),e.onSocialConnected(this.onAuthProviderConnected.bind(this)),e.onSetPreferredAccount(({address:e,type:t})=>{let r=g.R.state.activeChain;if(!r)throw Error("AppKit:onSetPreferredAccount - namespace is required");e&&this.setPreferredAccountType(t,r)})}async syncAuthConnectorTheme(e){if(!e)return;let t=m.ThemeController.getSnapshot(),r=p.OptionsController.getSnapshot();await Promise.all([e.syncDappData({metadata:r.metadata,sdkVersion:r.sdkVersion,projectId:r.projectId,sdkType:r.s
7112dkType}),e.syncTheme({themeMode:t.themeMode,themeVariables:t.themeVariables,w3mThemeVariables:(0,i.t)(t.themeVariables,t.themeMode)})])}async syncAuthConnector(e,t){let r=n.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(t),i=t===g.R.state.activeChain;if(!r)return;this.setLoading(!0,t);let o=e.getLoginEmailUsed();this.setLoading(o,t),o&&this.setStatus("connecting",t);let s=e.getEmail(),l=e.getUsername();this.setUser({...f.AccountController.state?.user||{},username:l,email:s},t),this.setupAuthConnectorListeners(e);let{isConnected:u}=await e.isConnected();if(await this.syncAuthConnectorTheme(e),t&&r&&i){let r=await e.getSmartAccountEnabledNetworks();if(g.R.setSmartAccountEnabledNetworks(r?.smartAccountEnabledNetworks||[],t),u&&this.connectionControllerClient?.connectExternal){await this.connectionControllerClient?.connectExternal({id:n.b.CONNECTOR_ID.AUTH,info:{name:n.b.CONNECTOR_ID.AUTH},type:E.b.CONNECTOR_TYPE_AUTH,provider:e,chainId:g.R.getNetworkData(t)?.caipNetwork?.id,chain:t}),this.setStatus("connected",t);let r=y.M.getConnectedSocialProvider();r?c.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",address:f.AccountController.state.address,properties:{provider:r,reconnect:!0}}):c.X.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:f.AccountController.state.address,properties:{method:"email",name:this.universalProvider?.session?.peer?.metadata?.name||"Unknown",reconnect:!0}})}else a.ConnectorController.getConnectorId(t)===n.b.CONNECTOR_ID.AUTH&&(this.setStatus("disconnected",t),y.M.removeConnectedNamespace(t))}this.setLoading(!1,t)}async checkExistingTelegramSocialConnection(e){try{if(!b.j.isTelegram())return;let t=y.M.getTelegramSocialProvider();if(!t||!b.j.isClient())return;let r=new URL(window.location.href).searchParams.get("result_uri");if(!r)return;f.AccountController.setSocialProvider(t,e),await this.authProvider?.init();let n=a.ConnectorController.getAuthConnector();t&&n&&(this.setLoading(!0,e),await l.ConnectionController.connectExternal({id:n.id,type:n.type,socialUri:r},n.chain),y.M.setConnectedSocialProvider(t),y.M.removeTelegramSocialProvider(),c.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:t}}))}catch(t){this.setLoading(!1,e),console.error("checkExistingSTelegramocialConnection error",t)}try{let e=new URL(window.location.href);e.searchParams.delete("result_uri"),window.history.replaceState({},document.title,e.toString())}catch(e){console.error("tma social login failed",e)}}createAuthProvider(e){if(!n.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(e))return;let t=this.remoteFeatures?.email,r=Array.isArray(this.remoteFeatures?.socials)&&this.remoteFeatures.socials.length>0,i=C.g.getActiveNamespaceConnectedToAuth()||e;!this.authProvider&&this.options?.projectId&&(t||r)&&(this.authProvider=_.D.getInstance({projectId:this.options.projectId,enableLogger:this.options.enableAuthLogger,chainId:this.getCaipNetwork(i)?.caipNetworkId,abortController:x.j.EmbeddedWalletAbortController,onTimeout:e=>{"iframe_load_failed"===e?w.AlertController.open(x.j.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):"iframe_request_timeout"===e?w.AlertController.open(x.j.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):"unverified_domain"===e&&w.AlertController.open(x.j.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:e=>(0,s.eq)(e),getCaipNetworks:e=>g.R.getCaipNetworks(e)}),u.I.subscribeOpen(e=>{!e&&this.isTransactionStackEmpty()&&this.authProvider?.rejectRpcRequests()}));let o=e===g.R.state.activeChain&&p.OptionsController.state.enableReconnect;!1===p.OptionsController.state.enableReconnect?this.syncAuthConnectorTheme(this.authProvider):this.authProvider&&o&&(this.syncAuthConnector(this.authProvider,e),this.checkExistingTelegramSocialConnection(e))}createAuthProviderForAdapter(e){this.createAuthProvider(e),this.authProvider&&this.chainAdapters?.[e]?.setAuthProvider?.(this.authProvider)}initControllers(e){super.initControllers(e),this.options.excludeWalletIds&&d.ApiController.initializeExcludedWallets({ids:this.options.excludeWalletIds})}async switchCaipNetwork(e){if(!e)return;let t=g.R.state.activeChain,r=e.chainNamespace,i=this.getAddressByChainNamespace(r);if(r===t&&i){let t=this.getAdapter(r),n=v.O.getProvider(r),i=v.O.getProviderId(r);await t?.switchNetwork({caipNetwork:e,provider:n,providerType:i}),this.setCaipNetwork(e)}else{let o=v.O.getProviderId(t)===E.b.CONNECTOR_TYPE_AUTH,s=v.O.getProviderId(r),a=s===E.b.CONNECTOR_TYPE_AUTH,c=n.b.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(r);if(!r)throw Error("AppKit:switchCaipNetwork - networkNamespace is required");
7112if((o&&void 0===s||a)&&c)try{if(g.R.state.activeChain=e.chainNamespace,i){let t=this.getAdapter(r);await t?.switchNetwork({caipNetwork:e,provider:this.authProvider,providerType:s})}else await this.connectionControllerClient?.connectExternal?.({id:n.b.CONNECTOR_ID.AUTH,provider:this.authProvider,chain:r,chainId:e.id,type:E.b.CONNECTOR_TYPE_AUTH,caipNetwork:e});this.setCaipNetwork(e)}catch(n){let t=this.getAdapter(r);await t?.switchNetwork({caipNetwork:e,provider:this.authProvider,providerType:s})}else if(s===E.b.CONNECTOR_TYPE_WALLET_CONNECT){if(!g.R.state.noAdapters){let t=this.getAdapter(r),n=v.O.getProvider(r),i=v.O.getProviderId(r);await t?.switchNetwork({caipNetwork:e,provider:n,providerType:i})}this.setCaipNetwork(e),this.syncWalletConnectAccount()}else this.setCaipNetwork(e),i&&this.syncAccount({address:i,chainId:e.id,chainNamespace:r})}}async initialize(e){await super.initialize(e),this.chainNamespaces?.forEach(e=>{this.createAuthProviderForAdapter(e)}),await this.injectModalUi(),u.I.set({initialized:!0})}async syncIdentity({address:e,chainId:t,chainNamespace:r}){let i=`${r}:${t}`,o=this.caipNetworks?.find(e=>e.caipNetworkId===i);if(o?.testnet){this.setProfileName(null,r),this.setProfileImage(null,r);return}let s=a.ConnectorController.getConnectorId(r)===n.b.CONNECTOR_ID.AUTH;try{let{name:t,avatar:n}=await this.fetchIdentity({address:e});!t&&s?await this.syncReownName(e,r):(this.setProfileName(t,r),this.setProfileImage(n,r))}catch{1!==t&&this.setProfileImage(null,r)}}syncConnectedWalletInfo(e){let t=v.O.getProviderId(e);if(t===E.b.CONNECTOR_TYPE_AUTH){let r=this.authProvider;if(r){let n=y.M.getConnectedSocialProvider()??"email",i=r.getEmail()??r.getUsername();this.setConnectedWalletInfo({name:t,identifier:i,social:n},e)}}else super.syncConnectedWalletInfo(e)}async injectModalUi(){if(b.j.isClient()&&!ei)try{let e={...h.bq.DEFAULT_FEATURES,...this.options.features},t=this.remoteFeatures;if(await this.loadModalComponents(e,t),b.j.isClient()&&!document.querySelector("w3m-modal")){let e=document.createElement("w3m-modal");p.OptionsController.state.disableAppend||p.OptionsController.state.enableEmbedded||document.body.insertAdjacentElement("beforeend",e)}ei=!0}catch(e){console.error("Error injecting modal UI:",e)}}async loadModalComponents(e,t){if(!b.j.isClient())return;let n=[];(t.email||t.socials&&t.socials.length>0)&&n.push(r.e(2128).then(r.bind(r,72128))),t.email&&n.push(r.e(3493).then(r.bind(r,13493))),t.socials&&n.push(r.e(8101).then(r.bind(r,98101))),t.swaps&&t.swaps.length>0&&n.push(Promise.all([r.e(2467),r.e(3190)]).then(r.bind(r,33190))),e.send&&n.push(Promise.all([r.e(2467),r.e(930)]).then(r.bind(r,40930))),e.receive&&n.push(r.e(7082).then(r.bind(r,17082))),t.onramp&&t.onramp.length>0&&n.push(r.e(645).then(r.bind(r,70645))),t.payWithExchange&&n.push(r.e(6736).then(r.bind(r,66736))),t.activity&&n.push(r.e(6768).then(r.bind(r,46768))),(e.pay||t.payments)&&n.push(r.e(8778).then(r.bind(r,88778))),t.emailCapture&&n.push(r.e(8746).then(r.bind(r,58746))),await Promise.all([...n,Promise.resolve().then(r.bind(r,74017)),Promise.all([r.e(2467),r.e(4998)]).then(r.bind(r,84998))])}}},21220:function(e,t,r){"use strict";r.d(t,{z:function(){return l}}),r(59908);var n=r(42036),i=r(39674),o=r(29607),s=r(71384),a=r(41248),c=r(63583);class l{constructor({provider:e,namespace:t}){this.id=n.b.CONNECTOR_ID.WALLET_CONNECT,this.name=a.C.ConnectorNamesMap[n.b.CONNECTOR_ID.WALLET_CONNECT],this.type="WALLET_CONNECT",this.imageId=a.C.ConnectorImageIds[n.b.CONNECTOR_ID.WALLET_CONNECT],this.getCaipNetworks=i.R.getCaipNetworks.bind(i.R),this.caipNetworks=this.getCaipNetworks(),this.provider=e,this.chain=t}get chains(){return this.getCaipNetworks()}async connectWalletConnect(){if(!await this.authenticate()){let e=this.getCaipNetworks(),t=o.OptionsController.state.universalProviderConfigOverride,r=c.sQ.createNamespaces(e,t);await this.provider.connect({optionalNamespaces:r})}return{clientId:await this.provider.client.core.crypto.getClientId(),session:this.provider.session}}async disconnect(){await this.provider.disconnect()}async authenticate(){let e=this.chains.map(e=>e.caipNetworkId);return s.w.universalProviderAuthenticate({universalProvider:this.provider,chains:e,methods:u})}}let u=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"]},29059:function(e,t,r){"use strict";r.d(t,{T:function(){return n}});let n={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603,DEFAULT_ALLOWED_ANCESTORS:["http://localhost:*","https://localhost:*","http://127.0.0.1:*","https://127.0.0.1:*","https://*.pages.dev","https://*.vercel.app","https://*.ngrok-free.app","https://secure-mobile.walletconnect.com","https://secure-mobile.walletconnect.org"]}},29447:function(e,t,r){"use strict";r.d(t,{s:function(){return l}});var n=r(77879),i=r(26330);function o(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}let s=o({id:"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",name:"Solana",network:"solana-mainnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!1,chainNamespace:"solana",caipNetworkId:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",deprecatedCaipNetworkId:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"}
7112),a=o({id:"EtWTRABZaYq6iMfeYKouRu166VU2xqa1",name:"Solana Devnet",network:"solana-devnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",deprecatedCaipNetworkId:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"});o({id:"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",name:"Solana Testnet",network:"solana-testnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"}),o({id:"000000000019d6689c085ae165831e93",caipNetworkId:"bip122:000000000019d6689c085ae165831e93",chainNamespace:"bip122",name:"Bitcoin",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}}),o({id:"000000000933ea01ad0ee984209779ba",caipNetworkId:"bip122:000000000933ea01ad0ee984209779ba",chainNamespace:"bip122",name:"Bitcoin Testnet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},testnet:!0}),o({id:"00000008819873e925422c1ff0f99f7c",caipNetworkId:"bip122:00000008819873e925422c1ff0f99f7c",chainNamespace:"bip122",name:"Bitcoin Signet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},testnet:!0});let c={solana:["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"],eip155:["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_showCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],bip122:["sendTransfer","signMessage","signPsbt","getAccountAddresses"]},l={getMethodsByChainNamespace:e=>c[e]||[],createDefaultNamespace(e){return{methods:this.getMethodsByChainNamespace(e),events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}}},applyNamespaceOverrides(e,t){if(!t)return{...e};let r={...e},n=new Set;if(t.methods&&Object.keys(t.methods).forEach(e=>n.add(e)),t.chains&&Object.keys(t.chains).forEach(e=>n.add(e)),t.events&&Object.keys(t.events).forEach(e=>n.add(e)),t.rpcMap&&Object.keys(t.rpcMap).forEach(e=>{let[t]=e.split(":");t&&n.add(t)}),n.forEach(e=>{r[e]||(r[e]=this.createDefaultNamespace(e))}),t.methods&&Object.entries(t.methods).forEach(([e,t])=>{r[e]&&(r[e].methods=t)}),t.chains&&Object.entries(t.chains).forEach(([e,t])=>{r[e]&&(r[e].chains=t)}),t.events&&Object.entries(t.events).forEach(([e,t])=>{r[e]&&(r[e].events=t)}),t.rpcMap){let e=new Set;Object.entries(t.rpcMap).forEach(([t,n])=>{let[i,o]=t.split(":");i&&o&&r[i]&&(r[i].rpcMap||(r[i].rpcMap={}),e.has(i)||(r[i].rpcMap={},e.add(i)),r[i].rpcMap[o]=n)})}return r},createNamespaces(e,t){let r=e.reduce((e,t)=>{let{id:r,chainNamespace:n,rpcUrls:i}=t,o=i.default.http[0];e[n]||(e[n]=this.createDefaultNamespace(n));let c=`${n}:${r}`,l=e[n];switch(l.chains.push(c),c){case s.caipNetworkId:l.chains.push(s.deprecatedCaipNetworkId);break;case a.caipNetworkId:l.chains.push(a.deprecatedCaipNetworkId)}return l?.rpcMap&&o&&(l.rpcMap[r]=o),e},{});return this.applyNamespaceOverrides(r,t)},resolveReownName:async e=>{let t=await i.a.resolveName(e),r=Object.values(t?.addresses)||[];return r[0]?.address||!1},getChainsFromNamespaces:(e={})=>Object.values(e).flatMap(e=>Array.from(new Set([...e.chains||[],...e.accounts.map(e=>{let[t,r]=e.split(":");return`${t}:${r}`})]))),isSessionEventData:e=>"object"==typeof e&&null!==e&&"id"in e&&"topic"in e&&"params"in e&&"object"==typeof e.params&&null!==e.params&&"chainId"in e.params&&"event"in e.params&&"object"==typeof e.params.event&&null!==e.params.event,isOriginAllowed(e,t,r){for(let n of[...t,...r])if(n.includes("*")){let t=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");if(RegExp(`^${t.replace(/\\\*/gu,".*")}$`,"u").test(e))return!0}
7112else try{if(new URL(n).origin===e)return!0}catch(t){if(n===e)return!0}return!1},listenWcProvider({universalProvider:e,namespace:t,onConnect:r,onDisconnect:i,onAccountsChanged:o,onChainChanged:s,onDisplayUri:a}){r&&e.on("connect",()=>{r(l.getWalletConnectAccounts(e,t))}),i&&e.on("disconnect",()=>{i()}),o&&e.on("accountsChanged",r=>{try{let i=e.session?.namespaces?.[t]?.accounts||[],s=e.rpcProviders?.[t]?.getDefaultChain(),a=r.map(e=>{let r=i.find(r=>r.includes(`${t}:${s}:${e}`));if(!r)return;let{chainId:o,chainNamespace:a}=n.u.parseCaipAddress(r);return{address:e,chainId:o,chainNamespace:a}}).filter(e=>void 0!==e);a.length>0&&o(a)}catch(e){console.warn("Failed to parse accounts for namespace on accountsChanged event",t,r,e)}}),s&&e.on("chainChanged",e=>{s(e)}),a&&e.on("display_uri",e=>{a(e)})},getWalletConnectAccounts(e,t){let r=new Set,i=e?.session?.namespaces?.[t]?.accounts?.map(e=>n.u.parseCaipAddress(e)).filter(({address:e})=>!r.has(e.toLowerCase())&&(r.add(e.toLowerCase()),!0));return i&&i.length>0?i:[]}}},63583:function(e,t,r){"use strict";r.d(t,{Tz:function(){return n.T},sQ:function(){return i.s}});var n=r(29059),i=r(29447)},91284:function(e,t,r){"use strict";r.d(t,{j:function(){return o}});var n=r(33270),i=r(47768),o=new class extends n.l{#h;#p;#f;constructor(){super(),this.#f=e=>{if(!i.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#p||this.setEventListener(this.#f)}onUnsubscribe(){this.hasListeners()||(this.#p?.(),this.#p=void 0)}setEventListener(e){this.#f=e,this.#p?.(),this.#p=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#h!==e&&(this.#h=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#h?this.#h:globalThis.document?.visibilityState!=="hidden"}}},42701:function(e,t,r){"use strict";r.d(t,{Gm:function(){return i},Qy:function(){return a},ZF:function(){return c}});var n=r(47768);function i(e){return{onFetch:(t,r)=>{let i=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],l=t.state.data?.pageParams||[],u={pages:[],pageParams:[]},d=0,h=async()=>{let r=!1,h=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},p=(0,n.cG)(t.options,t.fetchOptions),f=async(e,i,o)=>{if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let s=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:o?"backward":"forward",meta:t.options.meta};return h(e),e})(),a=await p(s),{maxPages:c}=t.options,l=o?n.Ht:n.VX;return{pages:l(e.pages,a,c),pageParams:l(e.pageParams,i,c)}};if(a&&c.length){let e="backward"===a,t={pages:c,pageParams:l},r=(e?s:o)(i,t);u=await f(t,r,e)}else{let t=e??c.length;do{let e=0===d?l[0]??i.initialPageParam:o(i,u);if(d>0&&null==e)break;u=await f(u,e),d++}while(d<t)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=h}}}function o(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function s(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function a(e,t){return!!t&&null!=o(e,t)}function c(e,t){return!!t&&!!e.getPreviousPageParam&&null!=s(e,t)}},43310:function(e,t,r){"use strict";r.d(t,{R:function(){return a},m:function(){return s}});var n=r(50521),i=r(3909),o=r(17421),s=class extends i.F{#g;#o;#m;constructor(e){super(),this.mutationId=e.mutationId,this.#o=e.mutationCache,this.#g=[],this.state=e.state||a(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#g.includes(e)||(this.#g.push(e),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#g=this.#g.filter(t=>t!==e),this.scheduleGc(),this.#o.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#g.length||("pending"===this.state.status?this.scheduleGc():this.#o.remove(this))}continue(){return this.#m?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#y({type:"continue"})};this.#m=(0,o.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#y({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#y({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#o.canRun(this)});let r="pending"===this.state.status,n=!this.#m.canStart();try{if(r)t();else{this.#y({type:"pending",variables:e,isPaused:n}),await this.#o.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#y({type:"pending",context:t,variables:e,isPaused:n})}let i=await this.#m.start();return await this.#o.config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await this.#o.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),this.#y({type:"success",data:i}),i}catch(t){try{throw await this.#o.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#o.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#y({type:"error",error:t})}}finally{this.#o.runNext(this)}}#y(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};
7112case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#g.forEach(t=>{t.onMutationUpdate(e)}),this.#o.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},50521:function(e,t,r){"use strict";r.d(t,{Vr:function(){return i}});var n=r(71649).Hp,i=function(){let e=[],t=0,r=e=>{e()},i=e=>{e()},o=n,s=n=>{t?e.push(n):o(()=>{r(n)})},a=()=>{let t=e;e=[],t.length&&o(()=>{i(()=>{t.forEach(e=>{r(e)})})})};return{batch:e=>{let r;t++;try{r=e()}finally{--t||a()}return r},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{o=e}}}()},74392:function(e,t,r){"use strict";r.d(t,{N:function(){return o}});var n=r(33270),i=r(47768),o=new class extends n.l{#b=!0;#p;#f;constructor(){super(),this.#f=e=>{if(!i.sk&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#p||this.setEventListener(this.#f)}onUnsubscribe(){this.hasListeners()||(this.#p?.(),this.#p=void 0)}setEventListener(e){this.#f=e,this.#p?.(),this.#p=e(this.setOnline.bind(this))}setOnline(e){this.#b!==e&&(this.#b=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#b}}},16126:function(e,t,r){"use strict";r.d(t,{A:function(){return a},z:function(){return c}});var n=r(47768),i=r(50521),o=r(17421),s=r(3909),a=class extends s.F{#w;#v;#C;#E;#m;#s;#x;constructor(e){super(),this.#x=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#E=e.client,this.#C=this.#E.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#w=l(this.options),this.state=e.state??this.#w,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#m?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=l(this.options);void 0!==e.data&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#w=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#C.remove(this)}setData(e,t){let r=(0,n.oE)(this.state.data,e,this.options);return this.#y({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#y({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#m?.promise;return this.#m?.cancel(e),t?t.then(n.ZT).catch(n.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#w)}isActive(){return this.observers.some(e=>!1!==(0,n.Nc)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,n.KC)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,n.Kp)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#m?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#m?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#C.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#m&&(this.#x?this.#m.cancel({revert:!0}):this.#m.cancelRetry()),this.scheduleGc()),this.#C.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#y({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&this.#m?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#m)return this.#m.continueRetry(),this.#m.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#x=!0,r.signal)}
7112)},s=()=>{let e=(0,n.cG)(this.options,t),r=(()=>{let e={client:this.#E,queryKey:this.queryKey,meta:this.meta};return i(e),e})();return(this.#x=!1,this.options.persister)?this.options.persister(e,r,this):e(r)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#E,state:this.state,fetchFn:s};return i(e),e})();this.options.behavior?.onFetch(a,this),this.#v=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#y({type:"fetch",meta:a.fetchOptions?.meta}),this.#m=(0,o.Mz)({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof o.p8&&e.revert&&this.setState({...this.#v,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#y({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#y({type:"pause"})},onContinue:()=>{this.#y({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#m.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#C.config.onSuccess?.(e,this),this.#C.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof o.p8){if(e.silent)return this.#m.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#y({type:"error",error:e}),this.#C.config.onError?.(e,this),this.#C.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#y(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...c(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#v=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),i.Vr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#C.notify({query:this,type:"updated",action:e})})}};function c(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,o.Kw)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function l(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},3909:function(e,t,r){"use strict";r.d(t,{F:function(){return o}});var n=r(71649),i=r(47768),o=class{#A;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.PN)(this.gcTime)&&(this.#A=n.mr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(i.sk?1/0:3e5))}clearGcTimeout(){this.#A&&(n.mr.clearTimeout(this.#A),this.#A=void 0)}}},17421:function(e,t,r){"use strict";r.d(t,{Kw:function(){return c},Mz:function(){return u},p8:function(){return l}});var n=r(91284),i=r(74392),o=r(31512),s=r(47768);function a(e){return Math.min(1e3*2**e,3e4)}function c(e){return(e??"online")!=="online"||i.N.isOnline()}var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function u(e){let t,r=!1,u=0,d=(0,o.O)(),h=()=>"pending"!==d.status,p=()=>n.j.isFocused()&&("always"===e.networkMode||i.N.isOnline())&&e.canRun(),f=()=>c(e.networkMode)&&e.canRun(),g=e=>{h()||(t?.(),d.resolve(e))},m=e=>{h()||(t?.(),d.reject(e))},y=()=>new Promise(r=>{t=e=>{(h()||p())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,h()||e.onContinue?.()}),b=()=>{let t;if(h())return;let n=0===u?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(g).catch(t=>{if(h())return;let n=e.retry??(s.sk?0:3),i=e.retryDelay??a,o="function"==typeof i?i(u,t):i,c=!0===n||"number"==typeof n&&u<n||"function"==typeof n&&n(u,t);if(r||!c){m(t);return}u++,e.onFail?.(u,t),(0,s._v)(o).then(()=>p()?void 0:y()).then(()=>{r?m(t):b()})})};return{promise:d,status:()=>d.status,cancel:t=>
7112{if(!h()){let r=new l(t);m(r),e.onCancel?.(r)}},continue:()=>(t?.(),d),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:f,start:()=>(f()?b():y().then(b),d)}}},33270:function(e,t,r){"use strict";r.d(t,{l:function(){return n}});var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},31512:function(e,t,r){"use strict";function n(){let e,t;let r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}r.d(t,{O:function(){return n}})},71649:function(e,t,r){"use strict";r.d(t,{Hp:function(){return o},mr:function(){return i}});var n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},i=new class{#S=n;#_=!1;setTimeoutProvider(e){this.#S=e}setTimeout(e,t){return this.#S.setTimeout(e,t)}clearTimeout(e){this.#S.clearTimeout(e)}setInterval(e,t){return this.#S.setInterval(e,t)}clearInterval(e){this.#S.clearInterval(e)}};function o(e){setTimeout(e,0)}},47768:function(e,t,r){"use strict";r.d(t,{CN:function(){return S},Ht:function(){return A},KC:function(){return l},Kp:function(){return c},L3:function(){return I},Nc:function(){return u},PN:function(){return a},Rm:function(){return p},SE:function(){return s},VS:function(){return y},VX:function(){return x},X7:function(){return h},Ym:function(){return f},ZT:function(){return o},_v:function(){return C},_x:function(){return d},cG:function(){return _},oE:function(){return E},sk:function(){return i},to:function(){return g}});var n=r(71649),i="undefined"==typeof window||"Deno"in globalThis;function o(){}function s(e,t){return"function"==typeof e?e(t):e}function a(e){return"number"==typeof e&&e>=0&&e!==1/0}function c(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function u(e,t){return"function"==typeof e?e(t):e}function d(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(n){if(t.queryHash!==p(s,t.options))return!1}else if(!g(t.queryKey,s))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(!i||i===t.state.fetchStatus)&&(!o||!!o(t))}function h(e,t){let{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(f(t.options.mutationKey)!==f(o))return!1}else if(!g(t.options.mutationKey,o))return!1}return(!n||t.state.status===n)&&(!i||!!i(t))}function p(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>g(e[r],t[r]))}var m=Object.prototype.hasOwnProperty;function y(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!v(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(v(r)&&r.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function v(e){return"[object Object]"===Object.prototype.toString.call(e)}function C(e){return new Promise(t=>{n.mr.setTimeout(t,e)})}function E(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=b(t)&&b(r);if(!n&&!(w(t)&&w(r)))return r;let i=(n?t:Object.keys(t)).length,o=n?r:Object.keys(r),s=o.length,a=n?Array(s):{},c=0;for(let l=0;l<s;l++){let s=n?l:o[l],u=t[s],d=r[s];if(u===d){a[s]=u,(n?l<i:m.call(t,s))&&c++;continue}if(null===u||null===d||"object"!=typeof u||"object"!=typeof d){a[s]=d;continue}let h=e(u,d);a[s]=h,h===u&&c++}return i===s&&c===i?t:a}(e,t):t}function x(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}function A(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var S=Symbol();function _(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==S?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function I(e,t){return"function"==typeof e?e(...t):!!e}},98850:function(e,t,r){"use strict";r.d(t,{NL:function(){return s},aH:function(){return a}});var n=r(50959),i=r(11527),o=n.createContext(void 0),s=e=>{let t=n.useContext(o);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},a=({client:e,children:t})=>(n.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(o.Provider,{value:e,children:t}))},27169:function(e,t,r){"use strict";r.d(t,{Dr:function(){return i},jx:function(){return o}});var n=r(71906);let i={getItem:e=>"undefined"==typeof window?null:s(document.cookie,e)??null,setItem(e,t){"undefined"!=typeof window&&(document.cookie=`${e}=${t};path=/;samesite=Lax`)},removeItem(e){"undefined"!=typeof window&&(document.cookie=`${e}=;max-age=-1;path=/`)}};function o(e,t){if(!t)return;let r=s(t,`${e.storage?.key}.store`);if(r)return(0,n.v)(r).state}function s(e,t){let r=e.split("; ").find(e=>e.startsWith(`${t}=`));if(r)return r.substring(t.length+1)}},71906:function(e,t,r){"use strict";function n(e,t){return JSON.parse(e,(e,r)=>{let n=r;return n?.__type==="bigint"&&(n=BigInt(n.value)),n?.__type==="Map"&&(n=new Map(n.value)),t?.(e,n)??n})}r.d(t,{v:function(){return n}})},12442:function(e,t,r){"use strict";function n(e){let t=e.state.current,r=e.state.connections.get(t),n=r?.accounts,i=n?.[0],o=e.chains.find(e=>e.id===r?.chainId),s=e.state.status;switch(s){case"connected":return{address:i,addresses:n,chain:o,chainId:r?.chainId,connector:r?.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:s};
7112case"reconnecting":return{address:i,addresses:n,chain:o,chainId:r?.chainId,connector:r?.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:s};case"connecting":return{address:i,addresses:n,chain:o,chainId:r?.chainId,connector:r?.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:s};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:s}}}r.d(t,{D:function(){return n}})},23887:function(e,t,r){"use strict";r.d(t,{e:function(){return c}});var n=r(92476),i=r(92179),o=r(3902),s=r(74823),a=r(75265);async function c(e,t={}){let r;if(t.connector){let{connector:n}=t;if("reconnecting"===e.state.status&&!n.getAccounts&&!n.getChainId)throw new a.$S({connector:n});let[i,o]=await Promise.all([n.getAccounts().catch(e=>{if(null===t.account)return[];throw e}),n.getChainId()]);r={accounts:i,chainId:o,connector:n}}else r=e.state.connections.get(e.state.current);if(!r)throw new a.aH;let c=t.chainId??r.chainId,l=await r.connector.getChainId();if(l!==c)throw new a.XZ({connectionChainId:c,connectorChainId:l});let u=r.connector;if(u.getClient)return u.getClient({chainId:c});let d=(0,o.T)(t.account??r.accounts[0]);if(d&&(d.address=(0,s.K)(d.address)),t.account&&!r.accounts.some(e=>e.toLowerCase()===d.address.toLowerCase()))throw new a.JK({address:d.address,connector:u});let h=e.chains.find(e=>e.id===c),p=await r.connector.getProvider({chainId:c});return(0,n.e)({account:d,chain:h,name:"Connector Client",transport:e=>(function(e,t={}){let{key:r="custom",methods:n,name:o="Custom Provider",retryDelay:s}=t;return({retryCount:a})=>(0,i.q)({key:r,methods:n,name:o,request:e.request.bind(e),retryCount:t.retryCount??a,retryDelay:s,type:"custom"})})(p)({...e,retryCount:0})})}},16334:function(e,t,r){"use strict";r.d(t,{l:function(){return l}});var n=r(3902),i=r(8811),o=r(72490);async function s(e,{account:t=e.account,message:r}){if(!t)throw new i.o({docsPath:"/docs/actions/wallet/signMessage"});let s=(0,n.T)(t);if(s.signMessage)return s.signMessage({message:r});let a="string"==typeof r?(0,o.$G)(r):r.raw instanceof Uint8Array?(0,o.NC)(r.raw):r.raw;return e.request({method:"personal_sign",params:[a,s.address]},{retryCount:0})}var a=r(25006),c=r(23887);async function l(e,t){let r;let{account:n,connector:i,...o}=t;return r="object"==typeof n&&"local"===n.type?e.getClient():await (0,c.e)(e,{account:n,connector:i}),(0,a.s)(r,s,"signMessage")({...o,...n?{account:n}:{}})}},78260:function(e,t,r){"use strict";function n(e){return e}r.d(t,{K:function(){return n}})},82565:function(e,t,r){"use strict";r.d(t,{G:function(){return c}});var n,i,o=r(44198);let s=()=>`@wagmi/core@${o.i}`;var a=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class c extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return s()}constructor(e,t={}){super(),n.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});let r=t.cause instanceof c?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof c&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=i,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return a(this,n,"m",i).call(this,this,e)}}n=new WeakSet,i=function e(t,r){return r?.(t)?t:t.cause?a(this,n,"m",e).call(this,t.cause,r):t}},75265:function(e,t,r){"use strict";r.d(t,{$S:function(){return l},JK:function(){return a},X4:function(){return i},XZ:function(){return c},aH:function(){return s},wi:function(){return o}});var n=r(82565);class i extends n.G{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class o extends n.G{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class s extends n.G{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class a extends n.G{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class c extends n.G{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID:  ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class l extends n.G{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:"During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`. All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored. This error commonly occurs for connectors that asynchronously inject after reconnection has already started."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}},72354:function(e,t,r){"use strict";r.d(t,{M:function(){return i},O:function(){return o}});var n=r(82565);class i extends n.G{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class o extends n.G{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}},25006:function(e,t,r){"use strict";function n(e,t,r){let n=e[t.name];if("function"==typeof n)return n;let i=e[r];return"function"==typeof i?i:r=>t(e,r)}r.d(t,{s:function(){return n}})},44198:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="2.20.3"},18029:function(e,t,r){"use strict";r.d(t,{G:function(){return n}});
7112class n extends Error{constructor(e,t={}){let r=t.cause instanceof n?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof n&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],"Version: [email protected]"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=i,this.metaMessages=t.metaMessages,this.shortMessage=e}}},82985:function(e,t,r){"use strict";r.d(t,{F:function(){return o},Hk:function(){return s},a_:function(){return i}});var n=r(18029);class i extends n.G{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class o extends n.G{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class s extends n.G{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}},37810:function(e,t,r){"use strict";r.d(t,{$r:function(){return i},TT:function(){return s},_D:function(){return c},aZ:function(){return l},jO:function(){return o},zL:function(){return a}});var n=r(18029);class i extends n.G{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class o extends n.G{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class s extends n.G{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class a extends n.G{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class c extends n.G{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class l extends n.G{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}},81949:function(e,t,r){"use strict";r.d(t,{H6:function(){return s},Vs:function(){return o},wn:function(){return i}});var n=r(18029);class i extends n.G{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class o extends n.G{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class s extends n.G{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}},1330:function(e,t,r){"use strict";r.d(t,{t:function(){return i}});var n=r(31630);function i(e){return"function"===e.type?`function ${e.name}(${(0,n.P)(e.inputs)})${e.stateMutability&&"nonpayable"!==e.stateMutability?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${(0,n.P)(e.outputs)})`:""}`:"event"===e.type?`event ${e.name}(${(0,n.P)(e.inputs)})`:"error"===e.type?`error ${e.name}(${(0,n.P)(e.inputs)})`:"constructor"===e.type?`constructor(${(0,n.P)(e.inputs)})${"payable"===e.stateMutability?" payable":""}`:"fallback"===e.type?`fallback() external${"payable"===e.stateMutability?" payable":""}`:"receive() external payable"}},31630:function(e,t,r){"use strict";r.d(t,{P:function(){return o}});var n=r(60597);let i=/^tuple(?<array>(\[(\d*)\])*)$/;function o(e){let t="",r=e.length;for(let o=0;o<r;o++)t+=function e(t){let r=t.type;if(i.test(t.type)&&"components"in t){r="(";let o=t.components.length;for(let n=0;n<o;
7112n++)r+=e(t.components[n]),n<o-1&&(r+=", ");let s=(0,n.Zw)(i,t.type);return r+=`)${s?.array??""}`,e({...t,type:r})}return("indexed"in t&&t.indexed&&(r=`${r} indexed`),t.name)?`${r} ${t.name}`:r}(e[o]),o!==r-1&&(t+=", ");return t}},4728:function(e,t,r){"use strict";r.d(t,{V:function(){return s}});var n=r(91178),i=r(52379),o=r(68954);function s(e){let t=(0,i.D)(e),r=[],s=e.length;for(let i=0;i<s;i++){let s=e[i];(0,n.N0)(s)||r.push((0,o.cK)(s,t))}return r}},91178:function(e,t,r){"use strict";r.d(t,{Dt:function(){return _},EC:function(){return v},LY:function(){return A},N0:function(){return f},PI:function(){return b},QM:function(){return x},SA:function(){return s},Wg:function(){return S},_c:function(){return o},a4:function(){return y},c3:function(){return c},g1:function(){return g},l$:function(){return h},qm:function(){return C},rh:function(){return d},wA:function(){return l}});var n=r(60597);let i=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function o(e){return i.test(e)}function s(e){return(0,n.Zw)(i,e)}let a=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function c(e){return a.test(e)}function l(e){return(0,n.Zw)(a,e)}let u=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function d(e){return u.test(e)}function h(e){return(0,n.Zw)(u,e)}let p=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function f(e){return p.test(e)}function g(e){return(0,n.Zw)(p,e)}let m=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function y(e){return m.test(e)}function b(e){return(0,n.Zw)(m,e)}let w=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function v(e){return w.test(e)}function C(e){return(0,n.Zw)(w,e)}let E=/^receive\(\) external payable$/;function x(e){return E.test(e)}let A=new Set(["memory","indexed","storage","calldata"]),S=new Set(["indexed"]),_=new Set(["calldata","memory","storage"])},52379:function(e,t,r){"use strict";r.d(t,{D:function(){return d}});var n=r(60597),i=r(82985),o=r(37810),s=r(81949),a=r(18029);class c extends a.G{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}var l=r(91178),u=r(68954);function d(e){let t={},r=e.length;for(let n=0;n<r;n++){let r=e[n];if(!(0,l.N0)(r))continue;let i=(0,l.g1)(r);if(!i)throw new s.wn({signature:r,type:"struct"});let o=i.properties.split(";"),a=[],c=o.length;for(let e=0;e<c;e++){let t=o[e].trim();if(!t)continue;let r=(0,u.C$)(t,{type:"struct"});a.push(r)}if(!a.length)throw new s.H6({signature:r});t[i.name]=a}let a={},d=Object.entries(t),p=d.length;for(let e=0;e<p;e++){let[r,s]=d[e];a[r]=function e(t,r,s=new Set){let a=[],l=t.length;for(let d=0;d<l;d++){let l=t[d];if(n.cN.test(l.type))a.push(l);else{let t=(0,n.Zw)(h,l.type);if(!t?.type)throw new o.aZ({abiParameter:l});let{array:d,type:p}=t;if(p in r){if(s.has(p))throw new c({type:p});a.push({...l,type:`tuple${d??""}`,components:e(r[p]??[],r,new Set([...s,p]))})}else if((0,u.uN)(p))a.push(l);else throw new i.F({type:p})}}return a}(s,t)}return a}let h=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/},68954:function(e,t,r){"use strict";r.d(t,{uN:function(){return y},C$:function(){return g},cK:function(){return d},Q4:function(){return m}});var n=r(60597),i=r(82985),o=r(37810),s=r(81949),a=r(18029);class c extends a.G{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let l=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);var u=r(91178);function d(e,t={}){if((0,u.rh)(e))return function(e,t={}){let r=(0,u.l$)(e);if(!r)throw new s.wn({signature:e,type:"function"});let n=m(r.parameters),i=[],o=n.length;for(let e=0;e<o;e++)i.push(g(n[e],{modifiers:u.Dt,structs:t,type:"function"}));let a=[];if(r.returns){let e=m(r.returns),n=e.length;for(let r=0;r<n;r++)a.push(g(e[r],{modifiers:u.Dt,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:i,outputs:a}}(e,t);if((0,u.c3)(e))return function(e,t={}){let r=(0,u.wA)(e);if(!r)throw new s.wn({signature:e,type:"event"});let n=m(r.parameters),i=[],o=n.length;for(let e=0;e<o;e++)i.push(g(n[e],{modifiers:u.Wg,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:i}}(e,t);if((0,u._c)(e))return function(e,t={}){let r=(0,u.SA)(e);if(!r)throw new s.wn({signature:e,type:"error"});let n=m(r.parameters),i=[],o=n.length;for(let e=0;e<o;e++)i.push(g(n[e],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:i}}(e,t);if((0,u.a4)(e))return function(e,t={}){let r=(0,u.PI)(e);if(!r)throw new s.wn({signature:e,type:"constructor"});let n=m(r.parameters),i=[],o=n.length;for(let e=0;e<o;e++)i.push(g(n[e],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:i}}(e,t);if((0,u.EC)(e))return function(e){let t=(0,u.qm)(e);if(!t)throw new s.wn({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}(e);if((0,u.QM)(e))return{type:"receive",stateMutability:"payable"};throw new s.Vs({signature:e})}let h=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,p=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,f=/^u?int$/;function g(e,t){var r,s;let a;let c=function(e,t,r){let n="";if(r)for(let e of Object.entries(r)){if(!e)continue;let t="";for(let r of e[1])t+=`[${r.type}${r.name?`:${r.name}`:""}]`;n+=`(${e[0]}{${t}})`}return t?`${t}:${e}${n}`:e}(e,t?.type,t?.structs);if(l.has(c))return l.get(c);let d=n.cN.test(e),w=(0,n.Zw)(d?p:h,e);if(!w)throw new o.jO({param:e});if(w.name&&("address"===(r=w.name)||"bool"===r||"function"===r||"string"===r||"tuple"===r||n.eL.test(r)||n.lh.test(r)||b.test(r)))throw new o.TT({param:e,name:w.name});let v=w.name?{name:w.name}:{},C="indexed"===w.modifier?{indexed:!0}:{},E=t?.structs??{},x={};if(d){a="tuple";let e=m(w.type),t=[],r=e.length;for(let n=0;n<r;n++)t.push(g(e[n],{structs:E}));x={components:t}}else if(w.type in E)a="tuple",x={components:E[w.type]};else if(f.test(w.type))a=`${w.type}256`;else if("address payable"===w.type)a="address";else if(a=w.type,t?.type!=="struct"&&!y(a))throw new i.Hk({type:a});if(w.modifier){if(!t?.modifiers?.has?.(w.modifier))throw new o.zL({param:e,type:t?.type,modifier:w.modifier});if(u.Dt.has(w.modifier)&&(s=a,!w.array&&"bytes"!==s&&"string"!==s&&"tuple"!==s))throw new o._D({param:e,type:t?.type,modifier:w.modifier})}let A={type:`${a}${w.array??""}`,...v,...C,...x};return l.set(c,A),A}function m(e,t=[],r="",n=0){let i=e.trim().length;for(let o=0;o<i;o++){let i=e[o],s=e.slice(o+1);switch(i){case",":return 0===n?m(s,[...t,r.trim()]):m(s,t,`${r}${i}`,n);case"(":return m(s,t,`${r}${i}`,n+1);case")":return m(s,t,`${r}${i}`,n-1);default:return m(s,t,`${r}${i}`,n)}}if(""===r)return t;if(0!==n)throw new c({current:r,depth:n});return t.push(r.trim()),t}function y(e){return"address"===e||"bool"===e||"function"===e||"string"===e||n.eL.test(e)||n.lh.test(e)}let b=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/},60597:function(e,t,r){"use strict";function n(e,t){let r=e.exec(t);return r?.groups}r.d(t,{Zw:function(){return n},cN:function(){return s},eL:function(){return i},lh:function(){return o}});let i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,o=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,s=/^\(.+?\).*?$/},96884:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var n=function(e){if(e.length>=255)throw TypeError("Alphabet too long");let t=new Uint8Array(256);for(let e=0;e<t.length;e++)t[e]=255;for(let r=0;r<e.length;r++){let n=e.charAt(r),i=n.charCodeAt(0);if(255!==t[i])throw TypeError(n+" is ambiguous");t[i]=r}let r=e.length,n=e.charAt(0),i=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function s(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;let o=0,s=0,a=0;for(;e[o]===n;)s++,o++;let c=(e.length-o)*i+1>>>0,l=new Uint8Array(c);for(;o<e.length;){let n=e.charCodeAt(o);if(n>255)return;let i=t[n];if(255===i)return;let s=0;for(let e=c-1;(0!==i||s<a)&&-1!==e;e--,s++)i+=r*l[e]>>>0,l[e]=i%256>>>0,i=i/256>>>0;if(0!==i)throw Error("Non-zero carry");a=s,o++}let u=c-a;for(;u!==c&&0===l[u];)u++;let d=new Uint8Array(s+(c-u)),h=s;for(;u!==c;
7112)d[h++]=l[u++];return d}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";let i=0,s=0,a=0,c=t.length;for(;a!==c&&0===t[a];)a++,i++;let l=(c-a)*o+1>>>0,u=new Uint8Array(l);for(;a!==c;){let e=t[a],n=0;for(let t=l-1;(0!==e||n<s)&&-1!==t;t--,n++)e+=256*u[t]>>>0,u[t]=e%r>>>0,e=e/r>>>0;if(0!==e)throw Error("Non-zero carry");s=n,a++}let d=l-s;for(;d!==l&&0===u[d];)d++;let h=n.repeat(i);for(;d<l;++d)h+=e.charAt(u[d]);return h},decodeUnsafe:s,decode:function(e){let t=s(e);if(t)return t;throw Error("Non-base"+r+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},73983:function(e,t,r){"use strict";r.d(t,{v:function(){return n}});var n=r(2337)},13822:function(e,t,r){"use strict";r.d(t,{XM:function(){return i},Xe:function(){return o},pX:function(){return n}});let n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},i=e=>(...t)=>({_$litDirective$:e,values:t});class o{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}},77859:function(e,t,r){"use strict";r.d(t,{Jb:function(){return I},Ld:function(){return k},YP:function(){return S},_$LH:function(){return z},cV:function(){return _},dy:function(){return A},sY:function(){return W}});let n=globalThis,i=n.trustedTypes,o=i?i.createPolicy("lit-html",{createHTML:e=>e}):void 0,s="$lit$",a=`lit$${Math.random().toFixed(9).slice(2)}$`,c="?"+a,l=`<${c}>`,u=document,d=()=>u.createComment(""),h=e=>null===e||"object"!=typeof e&&"function"!=typeof e,p=Array.isArray,f=e=>p(e)||"function"==typeof e?.[Symbol.iterator],g="[ 	\n\f\r]",m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,b=/>/g,w=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ 	
7113\f\r"'\`<>=]|("|')|))|$)`,"g"),v=/'/g,C=/"/g,E=/^(?:script|style|textarea|title)$/i,x=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),A=x(1),S=x(2),_=x(3),I=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),O=new WeakMap,N=u.createTreeWalker(u,129);function P(e,t){if(!p(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==o?o.createHTML(t):t}let T=(e,t)=>{let r=e.length-1,n=[],i,o=2===t?"<svg>":3===t?"<math>":"",c=m;for(let t=0;t<r;t++){let r=e[t],u,d,h=-1,p=0;for(;p<r.length&&(c.lastIndex=p,null!==(d=c.exec(r)));)p=c.lastIndex,c===m?"!--"===d[1]?c=y:void 0!==d[1]?c=b:void 0!==d[2]?(E.test(d[2])&&(i=RegExp("</"+d[2],"g")),c=w):void 0!==d[3]&&(c=w):c===w?">"===d[0]?(c=i??m,h=-1):void 0===d[1]?h=-2:(h=c.lastIndex-d[2].length,u=d[1],c=void 0===d[3]?w:'"'===d[3]?C:v):c===C||c===v?c=w:c===y||c===b?c=m:(c=w,i=void 0);let f=c===w&&e[t+1].startsWith("/>")?" ":"";o+=c===m?r+l:h>=0?(n.push(u),r.slice(0,h)+s+r.slice(h)+a+f):r+a+(-2===h?t:f)}return[P(e,o+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]};class R{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,l=0,u=e.length-1,h=this.parts,[p,f]=T(e,t);if(this.el=R.createElement(p,r),N.currentNode=this.el.content,2===t||3===t){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=N.nextNode())&&h.length<u;){if(1===n.nodeType){if(n.hasAttributes())for(let e of n.getAttributeNames())if(e.endsWith(s)){let t=f[l++],r=n.getAttribute(e).split(a),i=/([.?@])?(.*)/.exec(t);h.push({type:1,index:o,name:i[2],strings:r,ctor:"."===i[1]?U:"?"===i[1]?j:"@"===i[1]?B:M}),n.removeAttribute(e)}else e.startsWith(a)&&(h.push({type:6,index:o}),n.removeAttribute(e));if(E.test(n.tagName)){let e=n.textContent.split(a),t=e.length-1;if(t>0){n.textContent=i?i.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],d()),N.nextNode(),h.push({type:2,index:++o});n.append(e[t],d())}}}else if(8===n.nodeType){if(n.data===c)h.push({type:2,index:o});else{let e=-1;for(;-1!==(e=n.data.indexOf(a,e+1));)h.push({type:7,index:o}),e+=a.length-1}}o++}}static createElement(e,t){let r=u.createElement("template");return r.innerHTML=e,r}}function $(e,t,r=e,n){if(t===I)return t;let i=void 0!==n?r._$Co?.[n]:r._$Cl,o=h(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(e))._$AT(e,r,n),void 0!==n?(r._$Co??=[])[n]=i:r._$Cl=i),void 0!==i&&(t=$(e,i._$AS(e,t.values),i,n)),t}class D{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??u).importNode(t,!0);N.currentNode=n;let i=N.nextNode(),o=0,s=0,a=r[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new L(i,i.nextSibling,this,e):1===a.type?t=new a.ctor(i,a.name,a.strings,this,e):6===a.type&&(t=new F(i,this,e)),this._$AV.push(t),a=r[++s]}o!==a?.index&&(i=N.nextNode(),o++)}return N.currentNode=u,n}p(e){let t=0;for(let r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class L{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){h(e=$(this,e,t))?e===k||null==e||""===e?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==I&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):f(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==k&&h(this._$AH)?this._$AA.nextSibling.data=e:this.T(u.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=R.createElement(P(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let e=new D(n,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=O.get(e.strings);return void 0===t&&O.set(e.strings,t=new R(e)),t}k(e){p(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let i of e)n===t.length?t.push(r=new L(this.O(d()),this.O(d()),this,this.options)):r=t[n],r._$AI(i),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class M{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=k}_$AI(e,t=this,r,n){let i=this.strings,o=!1;if(void 0===i)(o=!h(e=$(this,e,t,0))||e!==this._$AH&&e!==I)&&(this._$AH=e);else{let n,s;let a=e;for(e=i[0],n=0;n<i.length-1;n++)(s=$(this,a[r+n],t,n))===I&&(s=this._$AH[n]),o||=!h(s)||s!==this._$AH[n],s===k?e=k:e!==k&&(e+=(s??"")+i[n+1]
7113),this._$AH[n]=s}o&&!n&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class U extends M{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}}class j extends M{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}}class B extends M{constructor(e,t,r,n,i){super(e,t,r,n,i),this.type=5}_$AI(e,t=this){if((e=$(this,e,t,0)??k)===I)return;let r=this._$AH,n=e===k&&r!==k||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==k&&(r===k||n);n&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class F{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){$(this,e)}}let z={M:s,P:a,A:c,C:1,L:T,R:D,D:f,V:$,I:L,H:M,N:j,U:B,B:U,F:F},H=n.litHtmlPolyfillSupport;H?.(R,L),(n.litHtmlVersions??=[]).push("3.3.1");let W=(e,t,r)=>{let n=r?.renderBefore??t,i=n._$litPart$;if(void 0===i){let e=r?.renderBefore??null;n._$litPart$=i=new L(t.insertBefore(d(),e),e,void 0,r??{})}return i._$AI(e),i}},94836:function(e,t,r){"use strict";r.d(t,{Cb:function(){return n.C},SB:function(){return i.S}});var n=r(34647),i=r(31382)},62847:function(e,t,r){"use strict";r.d(t,{$:function(){return o}});var n=r(77859),i=r(13822);let o=(0,i.XM)(class extends i.Xe{constructor(e){if(super(e),e.type!==i.pX.ATTRIBUTE||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){for(let r in this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e))),t)t[r]&&!this.nt?.has(r)&&this.st.add(r);return this.render(t)}let r=e.element.classList;for(let e of this.st)e in t||(r.remove(e),this.st.delete(e));for(let e in t){let n=!!t[e];n===this.st.has(e)||this.nt?.has(e)||(n?(r.add(e),this.st.add(e)):(r.remove(e),this.st.delete(e)))}return n.Jb}})},31756:function(e,t,r){"use strict";r.d(t,{o:function(){return i}});var n=r(77859);let i=e=>e??n.Ld},53549:function(e,t,r){"use strict";r.d(t,{V:function(){return f},i:function(){return y}});var n=r(77859);let{I:i}=n._$LH,o=e=>void 0===e.strings;var s=r(13822);let a=(e,t)=>{let r=e._$AN;if(void 0===r)return!1;for(let e of r)e._$AO?.(t,!1),a(e,t);return!0},c=e=>{let t,r;do{if(void 0===(t=e._$AM))break;(r=t._$AN).delete(e),e=t}while(0===r?.size)},l=e=>{for(let t;t=e._$AM;e=t){let r=t._$AN;if(void 0===r)t._$AN=r=new Set;else if(r.has(e))break;r.add(e),h(t)}};function u(e){void 0!==this._$AN?(c(this),this._$AM=e,l(this)):this._$AM=e}function d(e,t=!1,r=0){let n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size){if(t){if(Array.isArray(n))for(let e=r;e<n.length;e++)a(n[e],!1),c(n[e]);else null!=n&&(a(n,!1),c(n))}else a(this,e)}}let h=e=>{e.type==s.pX.CHILD&&(e._$AP??=d,e._$AQ??=u)};class p extends s.Xe{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),l(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(a(this,e),c(this))}setValue(e){if(o(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}let f=()=>new g;class g{}let m=new WeakMap,y=(0,s.XM)(class extends p{render(e){return n.Ld}update(e,[t]){let r=t!==this.G;return r&&void 0!==this.G&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),n.Ld}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){let t=this.ht??globalThis,r=m.get(t);void 0===r&&(r=new WeakMap,m.set(t,r)),void 0!==r.get(this.G)&&this.G.call(this.ht,void 0),r.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?m.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})},19045:function(e,t,r){"use strict";r.d(t,{oi:function(){return s},iv:function(){return n.iv},dy:function(){return i.dy},YP:function(){return i.YP},$m:function(){return n.$m}});var n=r(2377),i=r(77859);let o=globalThis;class s extends n.fl{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=(0,i.sY)(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return i.Jb}}s._$litElement$=!0,s.finalized=!0,o.litElementHydrateSupport?.({LitElement:s});let a=o.litElementPolyfillSupport;a?.({LitElement:s}),(o.litElementVersions??=[]).push("4.2.1")},47388:function(e,t,r){"use strict";r.d(t,{R:function(){return l},YW:function(){return h},Z0:function(){return d},ZK:function(){return s},cX:function(){return p},fF:function(){return o},l9:function(){return f},vU:function(){return c}});var n=r(50959);let i=function(){try{let e="nuqs-localStorage-test";if("undefined"==typeof localStorage)return!1;localStorage.setItem(e,e);let t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}();function o(e,...t){if(!i)return;let r=function(e,...t){return e.replace(/%[sfdO]/g,e=>{let r=t.shift();return"%O"===e&&r?JSON.stringify(r).replace(/"([^"]+)":/g,"$1:"):String(r)})}(e,...t);performance.mark(r);try{console.log(e,...t)}catch{console.log(r)}}function s(e,...t){i&&console.warn(e,...t)}let a={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cac
7113he. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function c(e){return`[nuqs] ${a[e]}
7114  See https://err.47ng.com/NUQS-${e}`}function l(e){if(0===e.size)return"";let t=[];for(let[r,n]of e.entries()){let e=r.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${e}=${n.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}`)}return"?"+t.join("&")}let u=(0,n.createContext)({useAdapter(){throw Error(c(404))}});function d(e){return({children:t,defaultOptions:r,processUrlSearchParams:i,...o})=>(0,n.createElement)(u.Provider,{...o,value:{useAdapter:e,defaultOptions:r,processUrlSearchParams:i}},t)}function h(e){let t=(0,n.useContext)(u);if(!("useAdapter"in t))throw Error(c(404));return t.useAdapter(e)}u.displayName="NuqsAdapterContext",i&&"undefined"!=typeof window&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==u&&console.error(c(303)),window.__NuqsAdapterContext=u);let p=()=>(0,n.useContext)(u).defaultOptions,f=()=>(0,n.useContext)(u).processUrlSearchParams},63713:function(e,t,r){"use strict";r.d(t,{KG:function(){return d},ob:function(){return p},u6:function(){return o},z5:function(){return s}});var n=r(47388),i=r(50959);let o={method:"throttle",timeMs:function(){if("undefined"==typeof window||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}()};function s(){let e=new Map;return{all:e,on(t,r){let n=e.get(t)||[];return n.push(r),e.set(t,n),()=>this.off(t,r)},off(t,r){let n=e.get(t);n&&e.set(t,n.filter(e=>e!==r))},emit(t,r){let n=e.get(t);n?.forEach(e=>e(r))}}}function a(e,t,r){let n=setTimeout(function(){e(),r.removeEventListener("abort",i)},t);function i(){clearTimeout(n),r.removeEventListener("abort",i)}r.addEventListener("abort",i)}function c(){let e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},r=()=>{};return{promise:new e((e,n)=>{t=e,r=n}),resolve:t,reject:r}}function l(){return new URLSearchParams(location.search)}var u=class{updateMap=new Map;options={history:"replace",scroll:!1,shallow:!0};timeMs=o.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;push({key:e,query:t,options:r},i=o.timeMs){(0,n.fF)("[nuqs gtq] Enqueueing %s=%s %O",e,t,r),this.updateMap.set(e,t),"push"===r.history&&(this.options.history="push"),r.scroll&&(this.options.scroll=!0),!1===r.
7114shallow&&(this.options.shallow=!1),r.startTransition&&this.transitions.add(r.startTransition),(!Number.isFinite(this.timeMs)||i>this.timeMs)&&(this.timeMs=i)}getQueuedQuery(e){return this.updateMap.get(e)}flush({getSearchParamsSnapshot:e=l,rateLimitFactor:t=1,...r},i){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return(0,n.fF)("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=c();let o=()=>{this.lastFlushedAt=performance.now();let[t,n]=this.applyPendingUpdates({...r,autoResetQueueOnUpdate:r.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},i);null===n?this.resolvers.resolve(t):this.resolvers.reject(t),this.resolvers=null};return a(()=>{let e=performance.now()-this.lastFlushedAt,r=this.timeMs,i=t*Math.max(0,r-e);(0,n.fF)("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",i,r,t),0===i?o():a(o,i,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return(0,n.fF)("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=o.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:r,getSearchParamsSnapshot:i}=e,o=i();if((0,n.fF)("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,o.toString()),0===this.updateMap.size)return[o,null];let s=Array.from(this.updateMap.entries()),a={...this.options},c=Array.from(this.transitions);for(let[t,r]of(e.autoResetQueueOnUpdate&&this.reset(),(0,n.fF)("[nuqs gtq] Flushing queue %O with options %O",s,a),s))null===r?o.delete(t):o.set(t,r);t&&(o=t(o));try{return!function(e,t){let r=t;for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n)continue;let i=r;r=()=>n(i)}r()}(c,()=>{r(o,a)}),[o,null]}catch(e){return console.error((0,n.vU)(429),s.map(([e])=>e).join(),e),[o,e]}}};let d=new u;var h=class{callback;resolvers=c();controller=new AbortController;queuedValue=void 0;constructor(e){this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,a(()=>{let t=this.resolvers;try{(0,n.fF)("[nuqs dq] Flushing debounce queue",e);let r=this.callback(e);(0,n.fF)("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=c(),r.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}};let p=new class{throttleQueue;queues=new Map;queuedQuerySync=s();constructor(e=new u){this.throttleQueue=e}useQueuedQueries(e){return function(e,t,r){let n=(0,i.useCallback)(()=>{let t=Object.fromEntries(e.map(e=>[e,r(e)]));return[JSON.stringify(t),t]},[e.join(","),r]),o=(0,i.useRef)(null);null===o.current&&(o.current=n());let s=(0,i.useCallback)(r=>{let n=e.map(e=>t(e,r));return()=>n.forEach(e=>e())},[e.join(","),t]);return(0,i.useSyncExternalStore)(s,()=>{let[e,t]=n();return o.current[0]===e?o.current[1]:(o.current=[e,t],t)},()=>o.current[1])}(e,(e,t)=>this.queuedQuerySync.on(e,t),e=>this.getQueuedQuery(e))}push(e,t,r){if(!Number.isFinite(t))return Promise.resolve((r.getSearchParamsSnapshot??l)());let i=e.key;if(!this.queues.has(i)){(0,n.fF)("[nuqs dqc] Creating debounce queue for `%s`",i);let e=new h(e=>(this.throttleQueue.push(e),this.throttleQueue.flush(r).finally(()=>{void 0===this.queues.get(e.key)?.queuedValue&&((0,n.fF)("[nuqs dqc] Cleaning up empty queue for `%s`",e.key),this.queues.delete(e.key)),this.queuedQuerySync.emit(e.key)})));this.queues.set(i,e)}(0,n.fF)("[nuqs dqc] Enqueueing debounce update %O",e);let o=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),o}abort(e){let t=this.queues.get(e);return t?((0,n.fF)("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())(0,n.fF)("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return void 0!==t?t:this.throttleQueue.getQueuedQuery(e)}}(d)},53624:function(e,t,r){"use strict";r.d(t,{o:function(){return o}});var n=r(68547);function i(e){return{address:e.address,amount:n.xS(e.amount),index:n.xS(e.index),validatorIndex:n.xS(e.validatorIndex)}}function o(e){return{..."bigint"==typeof e.baseFeePerGas&&{baseFeePerGas:n.xS(e.baseFeePerGas)},..."bigint"==typeof e.blobBaseFee&&{blobBaseFee:n.xS(e.blobBaseFee)},..."string"==typeof e.feeRecipient&&{feeRecipient:e.feeRecipient}
vendor: 4,102 bytes, line 7114
7114,..."bigint"==typeof e.gasLimit&&{gasLimit:n.xS(e.gasLimit)},..."bigint"==typeof e.number&&{number:n.xS(e.number)},..."bigint"==typeof e.prevRandao&&{prevRandao:n.xS(e.prevRandao)},..."bigint"==typeof e.time&&{time:n.xS(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(i)}}}},13636:function(e,t,r){"use strict";r.d(t,{G:function(){return n}});class n extends Error{constructor(e,t={}){let r=(()=>{if(t.cause instanceof n){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof n&&t.cause.docsPath||t.docsPath,o=`https://oxlib.sh${i??""}`;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||i?["",r?`Details: ${r}`:void 0,i?`See: ${o}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"[email protected]"}),this.cause=t.cause,this.details=r,this.docs=o,this.docsPath=i,this.shortMessage=e}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}},68547:function(e,t,r){"use strict";r.d(t,{$s:function(){return _},Dp:function(){return l},Gh:function(){return b},Gu:function(){return v},He:function(){return w},J5:function(){return C},M6:function(){return A},O3:function(){return u},Q_:function(){return f},dp:function(){return y},eh:function(){return g},mL:function(){return p},mV:function(){return S},tP:function(){return m},xS:function(){return h},xv:function(){return d},zo:function(){return c}});var n=r(13636),i=r(64427),o=r(90748);let s=new TextEncoder,a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function c(...e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}function l(e){return e instanceof Uint8Array?d(e):Array.isArray(e)?d(new Uint8Array(e)):e}function u(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(i.Yf(r,t.size),f(r,t.size)):r}function d(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=a[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(i.Yf(n,t.size),g(n,t.size)):n}function h(e,t={}){let r;let{signed:n,size:i}=t,o=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let s="bigint"==typeof r&&n?-r-1n:0;if(r&&o>r||o<s){let t="bigint"==typeof e?"n":"";throw new C({max:r?`${r}${t}`:void 0,min:`${s}${t}`,signed:n,size:i,value:`${e}${t}`})}let a=(n&&o<0?(1n<<BigInt(8*i))+BigInt(o):o).toString(16),c=`0x${a}`;return i?f(c,i):c}function p(e,t={}){return d(s.encode(e),t)}function f(e,t){return i.vk(e,{dir:"left",size:t})}function g(e,t){return i.vk(e,{dir:"right",size:t})}function m(e,t,r,n={}){let{strict:o}=n;i.EM(e,t);let s=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return o&&i.Ro(s,t,r),s}function y(e){return Math.ceil((e.length-2)/2)}function b(e,t={}){let{signed:r}=t;t.size&&i.Yf(e,t.size);let n=BigInt(e);if(!r)return n;let o=(1n<<8n*BigInt((e.length-2)/2))-1n;return n<=o>>1n?n:n-o-1n}function w(e,t={}){let{signed:r,size:n}=t;return r||n?Number(b(e,t)):Number(e)}function v(e,t={}){let{strict:r=!1}=t;try{return!function(e,t={}){let{strict:r=!1}=t;if(!e||"string"!=typeof e)throw new E(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith("0x"))throw new x(e)}(e,{strict:r}),!0}catch{return!1}}class C extends n.G{constructor({max:e,min:t,signed:r,size:n,value:i}
7114){super(`Number \`${i}\` is not in safe${n?` ${8*n}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class E extends n.G{constructor(e){super(`Value \`${"object"==typeof e?o.P(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class x extends n.G{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class A extends n.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class S extends n.G{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class _ extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}},90748:function(e,t,r){"use strict";function n(e,t,r){return JSON.stringify(e,(e,r)=>"function"==typeof t?t(e,r):"bigint"==typeof r?r.toString()+"#__bigint":r,r)}r.d(t,{P:function(){return n}})},64427:function(e,t,r){"use strict";r.d(t,{EM:function(){return o},Ro:function(){return s},Yf:function(){return i},vk:function(){return a}});var n=r(68547);function i(e,t){if(n.dp(e)>t)throw new n.M6({givenSize:n.dp(e),maxSize:t})}function o(e,t){if("number"==typeof t&&t>0&&t>n.dp(e)-1)throw new n.mV({offset:t,position:"start",size:n.dp(e)})}function s(e,t,r){if("number"==typeof t&&"number"==typeof r&&n.dp(e)!==r-t)throw new n.mV({offset:r,position:"end",size:n.dp(e)})}function a(e,t={}){let{dir:r,size:i=32}=t;if(0===i)return e;let o=e.replace("0x","");if(o.length>2*i)throw new n.$s({size:Math.ceil(o.length/2),targetSize:i,type:"Hex"});return`0x${o["right"===r?"padEnd":"padStart"](2*i,"0")}`}},86471:function(e,t,r){"use strict";r.d(t,{DM:function(){return f},h8:function(){return w},jc:function(){return b},ln:function(){return m},o5:function(){return y}});let n=Symbol(),i=Symbol(),o=(e,t)=>new Proxy(e,t),s=Object.getPrototypeOf,a=new WeakMap,c=e=>e&&(a.has(e)?a.get(e):s(e)===Object.prototype||s(e)===Array.prototype),l=e=>"object"==typeof e&&null!==e,u=e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.configurable&&!e.writable),d=e=>{if(Array.isArray(e))return Array.from(e);let t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(e=>{e.configurable=!0}),Object.create(s(e),t)},h=(e,t)=>{let r={f:t},o=!1,s=(t,n)=>{if(!o){let i=r.a.get(e);if(i||(i={},r.a.set(e,i)),"w"===t)i.w=!0;else{let e=i[t];e||(e=new Set,i[t]=e),e.add(n)}}},a=()=>{o=!0,r.a.delete(e)},c={get:(t,n)=>n===i?e:(s("k",n),f(Reflect.get(t,n),r.a,r.c,r.t)),has:(e,t)=>t===n?(a(),!0):(s("h",t),Reflect.has(e,t)),getOwnPropertyDescriptor:(e,t)=>(s("o",t),Reflect.getOwnPropertyDescriptor(e,t)),ownKeys:e=>(s("w"),Reflect.ownKeys(e))};return t&&(c.set=c.deleteProperty=()=>!1),[c,r]},p=e=>e[i]||e,f=(e,t,r,n)=>{if(!c(e))return e;let i=n&&n.get(e);if(!i){let t=p(e);i=u(t)?[t,d(t)]:[t],null==n||n.set(e,i)}let[s,a]=i,l=r&&r.get(s);return(!l||!!a!==l[1].f)&&((l=h(s,!!a))[1].p=o(a||s,l[0]),r&&r.set(s,l)),l[1].a=t,l[1].c=r,l[1].t=n,l[1].p},g=(e,t)=>{let r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((e,t)=>e!==n[t])},m=(e,t,r,n,i=Object.is)=>{if(i(e,t))return!1;if(!l(e)||!l(t))return!0;let o=r.get(p(e));if(!o)return!0;
7114if(n){if(n.get(e)===t)return!1;n.set(e,t)}let s=null;for(let r of o.h||[])if(s=Reflect.has(e,r)!==Reflect.has(t,r))return s;if(!0===o.w){if(s=g(e,t))return s}else for(let r of o.o||[]){let n=!!Reflect.getOwnPropertyDescriptor(e,r);if(s=!!Reflect.getOwnPropertyDescriptor(t,r)!==n)return s}for(let a of o.k||[])if(s=m(e[a],t[a],r,n,i))return s;if(null===s)throw Error("invalid used");return s},y=e=>c(e)&&e[i]||null,b=(e,t=!0)=>{a.set(e,t)},w=(e,t,r)=>{let n=[],i=new WeakSet,o=(e,s)=>{var a,c,u;if(i.has(e))return;l(e)&&i.add(e);let d=l(e)&&t.get(p(e));if(d){if(null===(a=d.h)||void 0===a||a.forEach(e=>{let t=`:has(${String(e)})`;n.push(s?[...s,t]:[t])}),!0===d.w){let e=":ownKeys";n.push(s?[...s,e]:[e])}else null===(c=d.o)||void 0===c||c.forEach(e=>{let t=`:hasOwn(${String(e)})`;n.push(s?[...s,t]:[t])});null===(u=d.k)||void 0===u||u.forEach(t=>{(!r||"value"in(Object.getOwnPropertyDescriptor(e,t)||{}))&&o(e[t],s?[...s,t]:[t])})}else s&&n.push(s)};return o(e),n}},18680:function(e,t,r){"use strict";r.d(t,{CO:function(){return y},Ld:function(){return m},WX:function(){return w},iH:function(){return b},sj:function(){return g}});var n=r(86471);let i=e=>"object"==typeof e&&null!==e,o=(e,t)=>{let r=c.get(e);if((null==r?void 0:r[0])===t)return r[1];let i=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return(0,n.jc)(i,!0),c.set(e,[t,i]),Reflect.ownKeys(e).forEach(t=>{if(Object.getOwnPropertyDescriptor(i,t))return;let r=Reflect.get(e,t),{enumerable:c}=Reflect.getOwnPropertyDescriptor(e,t),l={value:r,enumerable:c,configurable:!0};if(a.has(r))(0,n.jc)(r,!1);else if(s.has(r)){let[e,t]=s.get(r);l.value=o(e,t())}Object.defineProperty(i,t,l)}),Object.preventExtensions(i)},s=new WeakMap,a=new WeakSet,c=new WeakMap,l=[1],u=new WeakMap,d=Object.is,h=(e,t)=>new Proxy(e,t),p=e=>i(e)&&!a.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise),f=(e,t,r,o)=>({deleteProperty(e,t){let n=Reflect.get(e,t);r(t);let i=Reflect.deleteProperty(e,t);return i&&o(["delete",[t],n]),i},set(a,c,l,h){let f=!e()&&Reflect.has(a,c),m=Reflect.get(a,c,h);if(f&&(d(m,l)||u.has(l)&&d(m,u.get(l))))return!0;r(c),i(l)&&(l=(0,n.o5)(l)||l);let y=!s.has(l)&&p(l)?g(l):l;return t(c,y),Reflect.set(a,c,y,h),o(["set",[c],l,m]),!0}});function g(e={}){if(!i(e))throw Error("object required");let t=u.get(e);if(t)return t;let r=l[0],n=new Set,o=(e,t=++l[0])=>{r!==t&&(c=r=t,n.forEach(r=>r(e,t)))},c=r,d=e=>(t,r)=>{let n=[...t];n[1]=[e,...n[1]],o(n,r)},p=new Map,g=!0,m=h(e,f(()=>g,(e,t)=>{let r=!a.has(t)&&s.get(t);if(r){if(p.has(e))throw Error("prop listener already exists");if(n.size){let t=r[2](d(e));p.set(e,[r,t])}else p.set(e,[r])}},e=>{var t;let r=p.get(e);r&&(p.delete(e),null==(t=r[1])||t.call(r))},o));u.set(e,m);let y=[e,(e=l[0])=>(c!==e&&(c=e,p.forEach(([t])=>{let n=t[1](e);n>r&&(r=n)})),r),e=>(n.add(e),1===n.size&&p.forEach(([e,t],r)=>{if(t)throw Error("remove already exists");let n=e[2](d(r));p.set(r,[e,n])}),()=>{n.delete(e),0===n.size&&p.forEach(([e,t],r)=>{t&&(t(),p.set(r,[e]))})})];return s.set(m,y),Reflect.ownKeys(e).forEach(t=>{let r=Object.getOwnPropertyDescriptor(e,t);"value"in r&&r.writable&&(m[t]=e[t])}),g=!1,m}function m(e,t,r){let n;let i=s.get(e);i||console.warn("Please use proxy object");let o=[],a=i[2],c=!1,l=a(e=>{if(o.push(e),r){t(o.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,c&&t(o.splice(0))}))});return c=!0,()=>{c=!1,l()}}function y(e){let t=s.get(e);t||console.warn("Please use proxy object");let[r,n]=t;return o(r,n())}function b(e){return a.add(e),e}function w(){return{proxyStateMap:s,refSet:a,snapCache:c,versionHolder:l,proxyCache:u}}},87170:function(e,t,r){"use strict";r.d(t,{VW:function(){return i},Yr:function(){return c}});var n=r(18680);function i(e,t,r,i){let o=e[t];return(0,n.Ld)(e,()=>{let n=e[t];Object.is(o,n)||r(o=n)},i)}Symbol();let{proxyStateMap:o,snapCache:s}=(0,n.WX)(),a=e=>o.has(e);function c(e){let t=[],r=0,i=new Map,o=new WeakMap,c=()=>{let e=s.get(u),t=null==e?void 0:e[1];if(t&&!o.has(t)){let e=new Map(i);o.set(t,e)}},l=e=>o.get(e)||i;if(e){if("function"!=typeof e[Symbol.iterator])throw TypeError("proxyMap:\n	initial state must be iterable\n		tip: structure should be [[key, value]]");for(let[n,o]of e)i.set(n,r),t[r++]=o}let u={data:t,index:r,epoch:0,get size(){return a(this)||c(),l(this).size},get(e){let t=l(this).get(e);if(void 0===t){this.epoch;return}return this.data[t]},has(e){let t=l(this);return this.epoch,t.has(e)},set(e,t){if(!a(this))throw Error("Cannot perform mutations on a snapshot");let r=i.get(e);return void 0===r?(i.set(e,this.index),this.data[this.index++]=t):this.data[r]=t,this.epoch++,this},delete(e){if(!a(this))throw Error("Cannot perform mutations on a snapshot");let t=i.get(e);return void 0!==t&&(delete this.data[t],i.delete(e),this.epoch++,!0)},clear(){if(!a(this))throw Error("Cannot perform mutations on a snapshot");this.data.length=0,this.index=0,this.epoch++,i.clear()}
7114,forEach(e){this.epoch,l(this).forEach((t,r)=>{e(this.data[t],r,this)})},*entries(){for(let[e,t]of(this.epoch,l(this)))yield[e,this.data[t]]},*keys(){for(let e of(this.epoch,l(this).keys()))yield e},*values(){for(let e of(this.epoch,l(this).values()))yield this.data[e]},[Symbol.iterator](){return this.entries()},get[Symbol.toStringTag](){return"Map"},toJSON(){return new Map(this.entries())}},d=(0,n.sj)(u);return Object.defineProperties(d,{size:{enumerable:!1},index:{enumerable:!1},epoch:{enumerable:!1},data:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(d),d}let{proxyStateMap:l,snapCache:u}=(0,n.WX)()},3902:function(e,t,r){"use strict";function n(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}r.d(t,{T:function(){return n}})},85904:function(e,t,r){"use strict";r.d(t,{R:function(){return E}});var n=r(4728),i=r(53624),o=r(3902),s=r(98687),a=r(99602),c=r(55166),l=r(11598),u=r(57903),d=r(75669),h=r(88401),p=r(73924),f=r(29176),g=r(72490),m=r(29070),y=r(43813),b=r(23605),w=r(65215),v=r(57194),C=r(21328);async function E(e,t){let{account:s=e.account,authorizationList:d,batch:p=!!e.batch?.multicall,blockNumber:f,blockTag:w=e.experimental_blockTag??"latest",accessList:E,blobs:S,blockOverrides:_,code:I,data:k,factory:O,factoryData:N,gas:P,gasPrice:T,maxFeePerBlobGas:R,maxFeePerGas:$,maxPriorityFeePerGas:D,nonce:L,to:M,value:U,stateOverride:j,...B}=t,F=s?(0,o.T)(s):void 0;if(I&&(O||N))throw new c.G("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(I&&M)throw new c.G("Cannot provide both `code` & `to` as parameters.");let z=I&&k,H=O&&N&&M&&k,W=z||H,q=z?A({code:I,data:k}):H?function(e){let{data:t,factory:r,factoryData:i,to:o}=e;return(0,h.w)({abi:(0,n.V)(["constructor(address, bytes, address, bytes)"]),bytecode:a.pG,args:[o,t,r,i]})}({data:k,factory:O,factoryData:N,to:M}):k;try{(0,C.F)(t);let r=("bigint"==typeof f?(0,g.eC)(f):void 0)||w,n=_?i.o(_):void 0,o=(0,v.mF)(j),s=e.chain?.formatters?.transactionRequest?.format,a=(s||b.tG)({...(0,y.K)(B,{format:s}),from:F?.address,accessList:E,authorizationList:d,blobs:S,data:q,gas:P,gasPrice:T,maxFeePerBlobGas:R,maxFeePerGas:$,maxPriorityFeePerGas:D,nonce:L,to:W?void 0:M,value:U});if(p&&function({request:e}){let{data:t,to:r,...n}=e;return!(!t||t.startsWith("0x82ad56cb"))&&!!r&&!(Object.values(n).filter(e=>void 0!==e).length>0)}({request:a})&&!o&&!n)try{return await x(e,{...a,blockNumber:f,blockTag:w})}catch(e){if(!(e instanceof l.pZ)&&!(e instanceof l.mm))throw e}let c=(()=>{let e=[a,r];return o&&n?[...e,o,n]:o?[...e,o]:n?[...e,{},n]:e})(),u=await e.request({method:"eth_call",params:c});if("0x"===u)return{data:void 0};return{data:u}}catch(s){let n=function(e){if(!(e instanceof c.G))return;let t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(s),{offchainLookup:i,offchainLookupSignature:o}=await r.e(6441).then(r.bind(r,96441));if(!1!==e.ccipRead&&n?.slice(0,10)===o&&M)return{data:await i(e,{data:n,to:M})};if(W&&n?.slice(0,10)==="0x101bb98d")throw new u.Mo({factory:O});throw(0,m.P)(s,{...t,account:F,chain:e.chain})}}async function x(e,t){let{batchSize:r=1024,deployless:n=!1,wait:i=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:o,blockTag:c=e.experimental_blockTag??"latest",data:h,to:m}=t,y=(()=>{if(n)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return(0,f.L)({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new l.pZ})(),b=("bigint"==typeof o?(0,g.eC)(o):void 0)||c,{schedule:v}=(0,w.S)({id:`${e.uid}.${b}`,wait:i,shouldSplitBatch:e=>e.reduce((e,{data:t})=>e+(t.length-2),0)>2*r,fn:async t=>{let r=t.map(e=>({allowFailure:!0,callData:e.data,target:e.to})),n=(0,p.R)({abi:s.F8,args:[r],functionName:"aggregate3"}),i=await e.request({method:"eth_call",params:[{...null===y?{data:A({code:a.xd,data:n})}:{to:y,data:n}},b]});return(0,d.k)({abi:s.F8,args:[r],functionName:"aggregate3",data:i||"0x"})}}),[{returnData:C,success:E}]=await v({data:h,to:m});if(!E)throw new u.VQ({data:C});return"0x"===C?{data:void 0}:{data:C}}
7114function A(e){let{code:t,data:r}=e;return(0,h.w)({abi:(0,n.V)(["constructor(bytes, bytes)"]),bytecode:a.NO,args:[t,r]})}},73914:function(e,t,r){"use strict";r.d(t,{W:function(){return i}});var n=r(15571);async function i(e){let t=(0,n.g)(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}},32093:function(e,t,r){"use strict";r.d(t,{C:function(){return l},X:function(){return c}});var n=r(74994),i=r(47429),o=r(58177),s=r(73785),a=r(81524);async function c(e,t){return l(e,t)}async function l(e,t){let{block:r,chain:c=e.chain,request:l,type:u="eip1559"}=t||{},d=await (async()=>"function"==typeof c?.fees?.baseFeeMultiplier?c.fees.baseFeeMultiplier({block:r,client:e,request:l}):c?.fees?.baseFeeMultiplier??1.2)();if(d<1)throw new n.Fz;let h=10**(d.toString().split(".")[1]?.length??0),p=e=>e*BigInt(Math.ceil(d*h))/BigInt(h),f=r||await (0,i.s)(e,s.Q,"getBlock")({});if("function"==typeof c?.fees?.estimateFeesPerGas){let t=await c.fees.estimateFeesPerGas({block:r,client:e,multiply:p,request:l,type:u});if(null!==t)return t}if("eip1559"===u){if("bigint"!=typeof f.baseFeePerGas)throw new n.e5;let t="bigint"==typeof l?.maxPriorityFeePerGas?l.maxPriorityFeePerGas:await (0,o.h)(e,{block:f,chain:c,request:l}),r=p(f.baseFeePerGas);return{maxFeePerGas:l?.maxFeePerGas??r+t,maxPriorityFeePerGas:t}}return{gasPrice:l?.gasPrice??p(await (0,i.s)(e,a.o,"getGasPrice")({}))}}},14628:function(e,t,r){"use strict";r.d(t,{Q:function(){return w}});var n=r(3902),i=r(55166),o=r(46967),s=r(72490),a=r(38578),c=r(59703),l=r(61373);class u extends i.G{constructor(e,{account:t,docsPath:r,chain:n,data:i,gas:o,gasPrice:s,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,to:p,value:f}){super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",(0,l.xr)({from:t?.address,to:p,value:void 0!==f&&`${(0,a.d)(f)} ${n?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:o,gasPrice:void 0!==s&&`${(0,c.o)(s)} gwei`,maxFeePerGas:void 0!==u&&`${(0,c.o)(u)} gwei`,maxPriorityFeePerGas:void 0!==d&&`${(0,c.o)(d)} gwei`,nonce:h})].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}var d=r(88002),h=r(74282),p=r(43813),f=r(23605),g=r(57194),m=r(21328),y=r(68208),b=r(24104);async function w(e,t){let{account:r=e.account}=t,a=r?(0,n.T)(r):void 0;try{let{accessList:r,authorizationList:n,blobs:l,blobVersionedHashes:u,blockNumber:d,blockTag:h,data:w,gas:v,gasPrice:C,maxFeePerBlobGas:E,maxFeePerGas:x,maxPriorityFeePerGas:A,nonce:S,value:_,stateOverride:I,...k}=await (0,y.ZE)(e,{...t,parameters:a?.type==="local"?void 0:["blobVersionedHashes"]}),O=("bigint"==typeof d?(0,s.eC)(d):void 0)||h,N=(0,g.mF)(I),P=await (async()=>k.to?k.to:n&&n.length>0?await (0,o.z)({authorization:n[0]}).catch(()=>{throw new i.G("`to` is required. Could not infer from `authorizationList`")}):void 0)();(0,m.F)(t);let T=e.chain?.formatters?.transactionRequest?.format,R=(T||f.tG)({...(0,p.K)(k,{format:T}),from:a?.address,accessList:r,authorizationList:n,blobs:l,blobVersionedHashes:u,data:w,gas:v,gasPrice:C,maxFeePerBlobGas:E,maxFeePerGas:x,maxPriorityFeePerGas:A,nonce:S,to:P,value:_});function c(t){let{block:r,request:n,rpcStateOverride:i}=t;return e.request({method:"eth_estimateGas",params:i?[n,r??e.experimental_blockTag??"latest",i]:r?[n,r]:[n]})}let $=BigInt(await c({block:O,request:R,rpcStateOverride:N}));if(n){let t=await (0,b.s)(e,{address:R.from}),r=await Promise.all(n.map(async e=>{let{address:r}=e,n=await c({block:O,request:{authorizationList:void 0,data:w,from:a?.address,to:r,value:(0,s.eC)(t)},rpcStateOverride:N}).catch(()=>100000n);return 2n*BigInt(n)}));$+=r.reduce((e,t)=>e+t,0n)}return $}catch(r){throw function(e,{docsPath:t,...r}){return new u((()=>{let t=(0,h.k)(e,r);return t instanceof d.cj?e:t})(),{docsPath:t,...r})}(r,{...t,account:a,chain:e.chain})}}},58177:function(e,t,r){"use strict";r.d(t,{_:function(){return c},h:function(){return l}});var n=r(74994),i=r(96274),o=r(47429),s=r(73785),a=r(81524);async function c(e,t){return l(e,t)}async function l(e,t){let{block:r,chain:c=e.chain,request:l}=t||{};try{let t=c?.fees?.maxPriorityFeePerGas??c?.fees?.defaultPriorityFee;if("function"==typeof t){let n=r||await (0,o.s)(e,s.Q,"getBlock")({}),i=await t({block:n,client:e,request:l});if(null===i)throw Error();return i}if(void 0!==t)return t;let n=await e.request({method:"eth_maxPriorityFeePerGas"});return(0,i.y_)(n)}catch{let[t,i]=await Promise.all([r?Promise.resolve(r):(0,o.s)(e,s.Q,"getBlock")({}),(0,o.s)(e,a.o,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new n.e5;let c=i-t.baseFeePerGas;if(c<0n)return 0n;return c}}},24104:function(e,t,r){"use strict";r.d(t,{s:function(){return i}});var n=r(72490);async function i(e,{address:t,blockNumber:r,blockTag:i=e.experimental_blockTag??"latest"}){let o="bigint"==typeof r?(0,n.eC)(r):void 0;return BigInt(await e.request({method:"eth_getBalance",params:[t,o||i]}))}},73785:function(e,t,r){"use strict";r.d(t,{Q:function(){return s}});var n=r(25335),i=r(72490),o=r(39047);async function s(e,{blockHash:t,blockNumber:r,blockTag:s=e.experimental_blockTag??"latest",includeTransactions:a}={}){let c=a??!1,l=void 0!==r?(0,i.eC)(r):void 0,u=null;if(!(u=t?await e.request({method:"eth_getBlockByHash",params:[t,c]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[l||s,c]},{dedupe:!!l})))throw new n.f({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||o.Z)(u)}},84411:function(e,t,r){"use strict";r.d(t,{z:function(){return a}});let n=new Map,i=new Map;async function o(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){let o=function(e){let t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:r=>t.set(e,r)}),r=t(e,n),o=t(e,i);return{clear:()=>{r.clear(),o.clear()},promise:r,response:o}}(t),s=o.response.get();if(s&&r>0&&Date.now()-s.created.getTime()<r)return s.data;let a=o.promise.get();a||(a=e(),o.promise.set(a));try{let e=await a;return o.response.set({created:new Date,data:e}),e}finally{o.promise.clear()}}let s=e=>`blockNumber.${e}`;async function a(e,{cacheTime:t=e.cacheTime}={}){return BigInt(await o(()=>e.request({method:"eth_blockNumber"}),{cacheKey:s(e.uid),cacheTime:t}))}},97414:function(e,t,r){"use strict";r.d(t,{L:function(){return i}});var n=r(96274);async function i(e){let t=await e.request({method:"eth_chainId"},{dedupe:!0});return(0,n.ly)(t)}},33773:function(e,t,r){"use strict";r.d(t,{C:function(){return i}});var n=r(72490);async function i(e,{address:t,blockNumber:r,blockTag:i="latest"}){let o=void 0!==r?(0,n.eC)(r):void 0,s=await e.request({method:"eth_getCode",params:[t,o||i]},{dedupe:!!o});if("0x"!==s)return s}},15274:function(e,t,r){"use strict";r.d(t,{K:function(){return o}});var n=r(56580),i=r(53619);async function o(e,{filter:t}){let r="strict"in t&&t.strict,o=await t.request({method:"eth_getFilterChanges",params:[t.id]});if("string"==typeof o[0])return o;let s=o.map(e=>(0,i.U)(e));return"abi"in t&&t.abi?(0,n.h)({abi:t.abi,logs:s,strict:r}):s}},81524:function(e,t,r){"use strict";async function n(e){return BigInt(await e.request({method:"eth_gasPrice"}))}r.d(t,{o:function(){return n}})},70752:function(e,t,r){"use strict";r.d(t,{f:function(){return s}});var n=r(61373),i=r(72490),o=r(77076);async function s(e,{blockHash:t,blockNumber:r,blockTag:s,hash:a,index:c}){let l=s||"latest",u=void 0!==r?(0,i.eC)(r):void 0,d=null;if(a?d=await e.request({method:"eth_getTransactionByHash",params:[a]},{dedupe:!0}):t?d=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,i.eC)(c)]},{dedupe:!0}):(u||l)&&(d=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||l,(0,i.eC)(c)]},{dedupe:!!u})),!d)throw new n.Bh({blockHash:t,blockNumber:r,blockTag:l,hash:a,index:c});return(e.chain?.formatters?.transaction?.format||o.Tr)(d)}},32924:function(e,t,r){"use strict";r.d(t,{K:function(){return o}});var n=r(96274),i=r(72490);async function o(e,{address:t,blockTag:r="latest",blockNumber:o}){let s=await e.request({method:"eth_getTransactionCount",params:[t,"bigint"==typeof o?(0,i.eC)(o):r]},{dedupe:!!o});return(0,n.ly)(s)}},81157:function(e,t,r){"use strict";r.d(t,{a:function(){return o}});var n=r(61373),i=r(53406);async function o(e,{hash:t}){let r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new n.Yb({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||i.fA)(r)}},1153:function(e,t,r){"use strict";r.d(t,{A:function(){return f}});var n=r(98687),i=r(99602),o=r(87196),s=r(55166),a=r(57903),c=r(75669),l=r(73924),u=r(29176),d=r(66574),h=r(47429),p=r(76894);async function f(e,t){let{account:r,authorizationList:f,allowFailure:g=!0,blockNumber:m,blockOverrides:y,blockTag:b,stateOverride:w}=t,v=t.contracts,{batchSize:C=t.batchSize??1024,deployless:E=t.deployless??!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},x=(()=>
7114{if(t.multicallAddress)return t.multicallAddress;if(E)return null;if(e.chain)return(0,u.L)({blockNumber:m,chain:e.chain,contract:"multicall3"});throw Error("client chain not configured. multicallAddress is required.")})(),A=[[]],S=0,_=0;for(let e=0;e<v.length;e++){let{abi:t,address:n,args:i,functionName:o}=v[e];try{let e=(0,l.R)({abi:t,args:i,functionName:o});_+=(e.length-2)/2,C>0&&_>C&&A[S].length>0&&(S++,_=(e.length-2)/2,A[S]=[]),A[S]=[...A[S],{allowFailure:!0,callData:e,target:n}]}catch(s){let e=(0,d.S)(s,{abi:t,address:n,args:i,docsPath:"/docs/contract/multicall",functionName:o,sender:r});if(!g)throw e;A[S]=[...A[S],{allowFailure:!0,callData:"0x",target:n}]}}let I=await Promise.allSettled(A.map(t=>(0,h.s)(e,p.L,"readContract")({...null===x?{code:i.xd}:{address:x},abi:n.F8,account:r,args:[t],authorizationList:f,blockNumber:m,blockOverrides:y,blockTag:b,functionName:"aggregate3",stateOverride:w}))),k=[];for(let e=0;e<I.length;e++){let t=I[e];if("rejected"===t.status){if(!g)throw t.reason;for(let r=0;r<A[e].length;r++)k.push({status:"failure",error:t.reason,result:void 0});continue}let r=t.value;for(let t=0;t<r.length;t++){let{returnData:n,success:i}=r[t],{callData:s}=A[e][t],{abi:l,address:u,functionName:h,args:p}=v[k.length];try{if("0x"===s)throw new o.wb;if(!i)throw new a.VQ({data:n});let e=(0,c.k)({abi:l,args:p,data:n,functionName:h});k.push(g?{result:e,status:"success"}:e)}catch(t){let e=(0,d.S)(t,{abi:l,address:u,args:p,docsPath:"/docs/contract/multicall",functionName:h});if(!g)throw e;k.push({error:e,result:void 0,status:"failure"})}}}if(k.length!==v.length)throw new s.G("multicall results mismatch");return k}},76894:function(e,t,r){"use strict";r.d(t,{L:function(){return c}});var n=r(75669),i=r(73924),o=r(66574),s=r(47429),a=r(85904);async function c(e,t){let{abi:r,address:c,args:l,functionName:u,...d}=t,h=(0,i.R)({abi:r,args:l,functionName:u});try{let{data:t}=await (0,s.s)(e,a.R,"call")({...d,data:h,to:c});return(0,n.k)({abi:r,args:l,functionName:u,data:t||"0x"})}catch(e){throw(0,o.S)(e,{abi:r,address:c,args:l,docsPath:"/docs/contract/readContract",functionName:u})}}},64603:function(e,t,r){"use strict";async function n(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}r.d(t,{W:function(){return n}})},5436:function(e,t,r){"use strict";r.d(t,{e:function(){return f}});var n=r(25335),i=r(61373),o=r(47429),s=r(48478),a=r(66353),c=r(85889),l=r(25750),u=r(73785),d=r(70752),h=r(81157),p=r(2060);async function f(e,t){let r,f,g,m,y;let{checkReplacement:b=!0,confirmations:w=1,hash:v,onReplaced:C,retryCount:E=6,retryDelay:x=({count:e})=>200*~~(1<<e),timeout:A=18e4}=t,S=(0,l.P)(["waitForTransactionReceipt",e.uid,v]),_=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval,I=!1,{promise:k,resolve:O,reject:N}=(0,a.n)(),P=A?setTimeout(()=>{y?.(),m?.(),N(new i.mc({hash:v}))},A):void 0;return m=(0,s.N7)(S,{onReplaced:C,resolve:O,reject:N},async t=>{if((g=await (0,o.s)(e,h.a,"getTransactionReceipt")({hash:v}).catch(()=>void 0))&&w<=1){clearTimeout(P),t.resolve(g),m?.();return}y=(0,o.s)(e,p.q,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:_,async onBlockNumber(s){let a=e=>{clearTimeout(P),y?.(),e(),m?.()},l=s;if(!I)try{if(g){if(w>1&&(!g.blockNumber||l-g.blockNumber+1n<w))return;a(()=>t.resolve(g));return}if(b&&!r&&(I=!0,await (0,c.J)(async()=>{(r=await (0,o.s)(e,d.f,"getTransaction")({hash:v})).blockNumber&&(l=r.blockNumber)},{delay:x,retryCount:E}),I=!1),g=await (0,o.s)(e,h.a,"getTransactionReceipt")({hash:v}),w>1&&(!g.blockNumber||l-g.blockNumber+1n<w))return;a(()=>t.resolve(g))}catch(s){if(s instanceof i.Bh||s instanceof i.Yb){if(!r){I=!1;return}try{f=r,I=!0;let i=await (0,c.J)(()=>(0,o.s)(e,u.Q,"getBlock")({blockNumber:l,includeTransactions:!0}),{delay:x,retryCount:E,shouldRetry:({error:e})=>e instanceof n.f});I=!1;let s=i.transactions.find(({from:e,nonce:t})=>e===f.from&&t===f.nonce);if(!s||(g=await (0,o.s)(e,h.a,"getTransactionReceipt")({hash:s.hash}),w>1&&(!g.blockNumber||l-g.blockNumber+1n<w)))return;let d="replaced";s.to===f.to&&s.value===f.value&&s.input===f.input?d="repriced":s.from===s.to&&0n===s.value&&(d="cancelled"),a(()=>{t.onReplaced?.({reason:d,replacedTransaction:f,transaction:s,transactionReceipt:g}),t.resolve(g)})}catch(e){a(()=>t.reject(e))}}else a(()=>t.reject(s))}}})}),k}},2060:function(e,t,r){"use strict";r.d(t,{q:function(){return l}});
7114var n=r(96274),i=r(47429),o=r(48478),s=r(60252),a=r(25750),c=r(84411);function l(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:l,onError:u,poll:d,pollingInterval:h=e.pollingInterval}){let p;return(void 0!==d?d:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{let n=(0,a.P)(["watchBlockNumber",e.uid,t,r,h]);return(0,o.N7)(n,{onBlockNumber:l,onError:u},n=>(0,s.$)(async()=>{try{let t=await (0,i.s)(e,c.z,"getBlockNumber")({cacheTime:0});if(void 0!==p){if(t===p)return;if(t-p>1&&r)for(let e=p+1n;e<t;e++)n.onBlockNumber(e,p),p=e}(void 0===p||t>p)&&(n.onBlockNumber(t,p),p=t)}catch(e){n.onError?.(e)}},{emitOnBegin:t,interval:h}))})():(()=>{let i=(0,a.P)(["watchBlockNumber",e.uid,t,r]);return(0,o.N7)(i,{onBlockNumber:l,onError:u},t=>{let r=!0,i=()=>r=!1;return(async()=>{try{let o=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:s}=await o.subscribe({params:["newHeads"],onData(e){if(!r)return;let i=(0,n.y_)(e.result?.number);t.onBlockNumber(i,p),p=i},onError(e){t.onError?.(e)}});i=s,r||i()}catch(e){u?.(e)}})(),()=>i()})})()}},61154:function(e,t,r){"use strict";r.d(t,{O:function(){return u}});var n=r(47429),i=r(48478),o=r(60252),s=r(25750),a=r(73914),c=r(15274),l=r(64603);function u(e,{batch:t=!0,onError:r,onTransactions:u,poll:d,pollingInterval:h=e.pollingInterval}){let p,f;return(void 0!==d?d:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?(()=>{let d=(0,s.P)(["watchPendingTransactions",e.uid,t,h]);return(0,i.N7)(d,{onTransactions:u,onError:r},r=>{let i;let s=(0,o.$)(async()=>{try{if(!i)try{i=await (0,n.s)(e,a.W,"createPendingTransactionFilter")({});return}catch(e){throw s(),e}let o=await (0,n.s)(e,c.K,"getFilterChanges")({filter:i});if(0===o.length)return;if(t)r.onTransactions(o);else for(let e of o)r.onTransactions([e])}catch(e){r.onError?.(e)}},{emitOnBegin:!0,interval:h});return async()=>{i&&await (0,n.s)(e,l.W,"uninstallFilter")({filter:i}),s()}})})():(p=!0,f=()=>p=!1,(async()=>{try{let{unsubscribe:t}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!p)return;let t=e.result;u([t])},onError(e){r?.(e)}});f=t,p||f()}catch(e){r?.(e)}})(),()=>f())}},68208:function(e,t,r){"use strict";r.d(t,{QZ:function(){return A},ZE:function(){return _}});var n=r(3902),i=r(32093),o=r(14628),s=r(73785),a=r(32924),c=r(74994),l=r(3293),u=r(72490);function d(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),n="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,l.nr)(e)):e.blobs,i=[];for(let e of n)i.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===r?i:i.map(e=>(0,u.ci)(e))}function h(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),n="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,l.nr)(e)):e.blobs,i="string"==typeof e.commitments[0]?e.commitments.map(e=>(0,l.nr)(e)):e.commitments,o=[];for(let e=0;e<n.length;e++){let r=n[e],s=i[e];o.push(Uint8Array.from(t.computeBlobKzgProof(r,s)))}return"bytes"===r?o:o.map(e=>(0,u.ci)(e))}var p=r(42159),f=r(9326),g=r(55166);class m extends g.G{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class y extends g.G{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}var b=r(26674),w=r(80205),v=r(47429),C=r(21328),E=r(61373),x=r(97414);let A=["blobVersionedHashes","chainId","fees","gas","nonce","type"],S=new Map;async function _(e,t){let r,g;let{account:_=e.account,blobs:I,chain:k,gas:O,kzg:N,nonce:P,nonceManager:T,parameters:R=A,type:$}=t,D=_?(0,n.T)(_):_,L={...t,...D?{from:D?.address}:{}};async function M(){return r||(r=await (0,v.s)(e,s.Q,"getBlock")({blockTag:"latest"}))}async function U(){return g||(k?k.id:void 0!==t.chainId?t.chainId:g=await (0,v.s)(e,x.L,"getChainId")({}))}if(R.includes("nonce")&&void 0===P&&D){if(T){let t=await U();L.nonce=await T.consume({address:D.address,chainId:t,client:e})}else L.nonce=await (0,v.s)(e,a.K,"getTransactionCount")({address:D.address,blockTag:"pending"})}if((R.includes("blobVersionedHashes")||R.includes("sidecars"))&&I&&N){let e=d({blobs:I,kzg:N});
7114if(R.includes("blobVersionedHashes")){let t=function(e){let{commitments:t,version:r}=e,n=e.to??("string"==typeof t[0]?"hex":"bytes"),i=[];for(let e of t)i.push(function(e){let{commitment:t,version:r=1}=e,n=e.to??("string"==typeof t?"hex":"bytes"),i=function(e,t){let r=(0,p.JQ)((0,f.v)(e,{strict:!1})?(0,l.O0)(e):e);return"bytes"===(t||"hex")?r:(0,u.NC)(r)}(t,"bytes");return i.set([r],0),"bytes"===n?i:(0,u.ci)(i)}({commitment:e,to:n,version:r}));return i}({commitments:e,to:"hex"});L.blobVersionedHashes=t}if(R.includes("sidecars")){let t=h({blobs:I,commitments:e,kzg:N}),r=function(e){let{data:t,kzg:r,to:n}=e,i=e.blobs??function(e){let t=e.to??("string"==typeof e.data?"hex":"bytes"),r="string"==typeof e.data?(0,l.nr)(e.data):e.data,n=(0,w.d)(r);if(!n)throw new y;if(n>761855)throw new m({maxSize:761855,size:n});let i=[],o=!0,s=0;for(;o;){let e=(0,b.q)(new Uint8Array(131072)),t=0;for(;t<4096;){let n=r.slice(s,s+31);if(e.pushByte(0),e.pushBytes(n),n.length<31){e.pushByte(128),o=!1;break}t++,s+=31}i.push(e)}return"bytes"===t?i.map(e=>e.bytes):i.map(e=>(0,u.ci)(e.bytes))}({data:t,to:n}),o=e.commitments??d({blobs:i,kzg:r,to:n}),s=e.proofs??h({blobs:i,commitments:o,kzg:r,to:n}),a=[];for(let e=0;e<i.length;e++)a.push({blob:i[e],commitment:o[e],proof:s[e]});return a}({blobs:I,commitments:e,proofs:t,to:"hex"});L.sidecars=r}}if(R.includes("chainId")&&(L.chainId=await U()),(R.includes("fees")||R.includes("type"))&&void 0===$)try{L.type=function(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new E.j3({transaction:e})}(L)}catch{let t=S.get(e.uid);if(void 0===t){let r=await M();t="bigint"==typeof r?.baseFeePerGas,S.set(e.uid,t)}L.type=t?"eip1559":"legacy"}if(R.includes("fees")){if("legacy"!==L.type&&"eip2930"!==L.type){if(void 0===L.maxFeePerGas||void 0===L.maxPriorityFeePerGas){let r=await M(),{maxFeePerGas:n,maxPriorityFeePerGas:o}=await (0,i.C)(e,{block:r,chain:k,request:L});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<o)throw new c.ld({maxPriorityFeePerGas:o});L.maxPriorityFeePerGas=o,L.maxFeePerGas=n}}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new c.e5;if(void 0===t.gasPrice){let t=await M(),{gasPrice:r}=await (0,i.C)(e,{block:t,chain:k,request:L,type:"legacy"});L.gasPrice=r}}}return R.includes("gas")&&void 0===O&&(L.gas=await (0,v.s)(e,o.Q,"estimateGas")({...L,account:D?{address:D.address,type:"json-rpc"}:D})),(0,C.F)(L),delete L.parameters,L}},8330:function(e,t,r){"use strict";async function n(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}r.d(t,{p:function(){return n}})},92476:function(e,t,r){"use strict";r.d(t,{e:function(){return o}});var n=r(3902),i=r(91086);function o(e){let{batch:t,chain:r,ccipRead:o,key:s="base",name:a="Base Client",type:c="base"}=e,l=e.experimental_blockTag??("number"==typeof r?.experimental_preconfirmationTime?"pending":void 0),u=r?.blockTime??12e3,d=e.pollingInterval??Math.min(Math.max(Math.floor(u/2),500),4e3),h=e.cacheTime??d,p=e.account?(0,n.T)(e.account):void 0,{config:f,request:g,value:m}=e.transport({chain:r,pollingInterval:d}),y={account:p,batch:t,cacheTime:h,ccipRead:o,chain:r,key:s,name:a,pollingInterval:d,request:g,transport:{...f,...m},type:c,uid:(0,i.h)(),...l?{experimental_blockTag:l}:{}};return Object.assign(y,{extend:function e(t){return r=>{let n=r(t);for(let e in y)delete n[e];let i={...t,...n};return Object.assign(i,{extend:e(i)})}}(y)})}},8150:function(e,t,r){"use strict";r.d(t,{v:function(){return rD}});var n=r(92476),i=r(98687),o=r(75669),s=r(73924),a=r(29176),c=r(50875),l=r(72490),u=r(55166),d=r(57903);function h(e){if(!(e instanceof u.G))return!1;let t=e.walk(e=>e instanceof d.Lu);return t instanceof d.Lu&&(t.data?.errorName==="HttpError"||t.data?.errorName==="ResolverError"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ReverseAddressMismatch"||t.data?.errorName==="UnsupportedResolverProfile")}var p=r(55001),f=r(16340),g=r(3293),m=r(31416),y=r(9326);function b(e){if(66!==e.length||0!==e.indexOf("[")||65!==e.indexOf("]"))return null;let t=`0x${e.slice(1,65)}`;return(0,y.v)(t)?t:null}function w(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,l.ci)(t);let r=e.split(".");for(let e=r.length-1;e>=0;e-=1){let n=b(r[e]),i=n?(0,g.O0)(n):(0,m.w)((0,g.qX)(r[e]),"bytes");t=(0,m.w)((0,f.zo)([t,i]),"bytes")}return(0,l.ci)(t)}function v(e){let t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);let r=new Uint8Array((0,g.qX)(t).byteLength+2),n=0,i=t.split(".");for(let e=0;e<i.length;e++){let t=(0,g.qX)(i[e]);if(t.byteLength>255){var o;t=(0,g.qX)((o=function(e){let t=new Uint8Array(32).fill(0);return e?b(e)||(0,m.w)((0,g.qX)(e)):(0,l.ci)(t)}(i[e]),`[${o.slice(2)}]`))}r[n]=t.length,r.set(t,n+1),n+=t.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}var C=r(47429),E=r(76894);async function x(e,t){let{blockNumber:r,blockTag:n,coinType:u,name:d,gatewayUrls:f,strict:g}=t,{chain:m}=e,y=(()=>
vendor: 4,095 bytes, line 7114
7114{if(t.universalResolverAddress)return t.universalResolverAddress;if(!m)throw Error("client chain not configured. universalResolverAddress is required.");return(0,a.L)({blockNumber:r,chain:m,contract:"ensUniversalResolver"})})(),b=m?.ensTlds;if(b&&!b.some(e=>d.endsWith(e)))return null;let x=null!=u?[w(d),BigInt(u)]:[w(d)];try{let t=(0,s.R)({abi:i.X$,functionName:"addr",args:x}),a={address:y,abi:i.k3,functionName:"resolveWithGateways",args:[(0,l.NC)(v(d)),t,f??[p.M]],blockNumber:r,blockTag:n},u=(0,C.s)(e,E.L,"readContract"),h=await u(a);if("0x"===h[0])return null;let g=(0,o.k)({abi:i.X$,args:x,functionName:"addr",data:h[0]});if("0x"===g||"0x00"===(0,c.f)(g))return null;return g}catch(e){if(g)throw e;if(h(e))return null;throw e}}class A extends u.G{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class S extends u.G{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class _ extends u.G{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class I extends u.G{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}let k=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,O=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,N=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,P=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function T(e){try{let t=await fetch(e,{method:"HEAD"});if(200===t.status){let e=t.headers.get("content-type");return e?.startsWith("image/")}return!1}catch(t){if("object"==typeof t&&void 0!==t.response||!Object.hasOwn(globalThis,"Image"))return!1;return new Promise(t=>{let r=new Image;r.onload=()=>{t(!0)},r.onerror=()=>{t(!1)},r.src=e})}}function R(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function $({uri:e,gatewayUrls:t}){let r=N.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};let n=R(t?.ipfs,"https://ipfs.io"),i=R(t?.arweave,"https://arweave.net"),o=e.match(k),{protocol:s,subpath:a,target:c,subtarget:l=""}=o?.groups||{},u="ipns:/"===s||"ipns/"===a,d="ipfs:/"===s||"ipfs/"===a||O.test(e);if(e.startsWith("http")&&!u&&!d){let r=e;return t?.arweave&&(r=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:r,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===s&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(P,"");if(h.startsWith("<svg")&&(h=`data:image/svg+xml;base64,${btoa(h)}`),h.startsWith("data:")||h.startsWith("{"))return{uri:h,isOnChain:!0,isEncoded:!1};throw new _({uri:e})}function D(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new A({data:e});return e.image||e.image_url||e.image_data}async function L({gatewayUrls:e,uri:t}){try{let r=await fetch(t).then(e=>e.json());return await M({gatewayUrls:e,uri:D(r)})}catch{throw new _({uri:t})}}async function M({gatewayUrls:e,uri:t}){let{uri:r,isOnChain:n}=$({uri:t,gatewayUrls:e});if(n||await T(r))return r;throw new _({uri:t})}async function U(e,{nft:t}){if("erc721"===t.namespace)return(0,E.L)(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return(0,E.L)(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}
vendor: 1,266 bytes, line 7114
7114],functionName:"uri",args:[BigInt(t.tokenID)]});throw new I({namespace:t.namespace})}async function j(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?B(e,{gatewayUrls:t,record:r}):M({uri:r,gatewayUrls:t})}async function B(e,{gatewayUrls:t,record:r}){let n=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));let[r,n,i]=t.split("/"),[o,s]=r.split(":"),[a,c]=n.split(":");if(!o||"eip155"!==o.toLowerCase())throw new S({reason:"Only EIP-155 supported"});if(!s)throw new S({reason:"Chain ID not found"});if(!c)throw new S({reason:"Contract address not found"});if(!i)throw new S({reason:"Token ID not found"});if(!a)throw new S({reason:"ERC namespace not found"});return{chainID:Number.parseInt(s,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}(r),{uri:i,isOnChain:o,isEncoded:s}=$({uri:await U(e,{nft:n}),gatewayUrls:t});if(o&&(i.includes("data:application/json;base64,")||i.startsWith("{")))return M({uri:D(JSON.parse(s?atob(i.replace("data:application/json;base64,","")):i)),gatewayUrls:t});let a=n.tokenID;return"erc1155"===n.namespace&&(a=a.replace("0x","").padStart(64,"0")),L({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,a)})}async function F(e,t){let{blockNumber:r,blockTag:n,key:c,name:u,gatewayUrls:d,str
vendor: 6,065 bytes, line 7114
7114ict:f}=t,{chain:g}=e,m=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!g)throw Error("client chain not configured. universalResolverAddress is required.");return(0,a.L)({blockNumber:r,chain:g,contract:"ensUniversalResolver"})})(),y=g?.ensTlds;if(y&&!y.some(e=>u.endsWith(e)))return null;try{let t={address:m,abi:i.k3,args:[(0,l.NC)(v(u)),(0,s.R)({abi:i.nZ,functionName:"text",args:[w(u),c]}),d??[p.M]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},a=(0,C.s)(e,E.L,"readContract"),h=await a(t);if("0x"===h[0])return null;let f=(0,o.k)({abi:i.nZ,functionName:"text",data:h[0]});return""===f?null:f}catch(e){if(f)throw e;if(h(e))return null;throw e}}async function z(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:o,strict:s,universalResolverAddress:a}){let c=await (0,C.s)(e,F,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:o,strict:s});if(!c)return null;try{return await j(e,{record:c,gatewayUrls:n})}catch{return null}}async function H(e,t){let{address:r,blockNumber:n,blockTag:o,coinType:s=60n,gatewayUrls:c,strict:l}=t,{chain:u}=e,d=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!u)throw Error("client chain not configured. universalResolverAddress is required.");return(0,a.L)({blockNumber:n,chain:u,contract:"ensUniversalResolver"})})();try{let t={address:d,abi:i.du,args:[r,s,c??[p.M]],functionName:"reverseWithGateways",blockNumber:n,blockTag:o},a=(0,C.s)(e,E.L,"readContract"),[l]=await a(t);return l||null}catch(e){if(l)throw e;if(h(e))return null;throw e}}async function W(e,t){let{blockNumber:r,blockTag:n,name:i}=t,{chain:o}=e,s=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw Error("client chain not configured. universalResolverAddress is required.");return(0,a.L)({blockNumber:r,chain:o,contract:"ensUniversalResolver"})})(),c=o?.ensTlds;if(c&&!c.some(e=>i.endsWith(e)))throw Error(`${i} is not a valid ENS TLD (${c?.join(", ")}) for chain "${o.name}" (id: ${o.id}).`);let[u]=await (0,C.s)(e,E.L,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,l.NC)(v(i))],blockNumber:r,blockTag:n});return u}var q=r(85904),V=r(3902),K=r(29070),G=r(43813),Z=r(23605),Y=r(21328);async function J(e,t){let{account:r=e.account,blockNumber:n,blockTag:i="latest",blobs:o,data:s,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,to:p,value:f,...g}=t,m=r?(0,V.T)(r):void 0;try{(0,Y.F)(t);let r="bigint"==typeof n?(0,l.eC)(n):void 0,y=e.chain?.formatters?.transactionRequest?.format,b=(y||Z.tG)({...(0,G.K)(g,{format:y}),from:m?.address,blobs:o,data:s,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,to:p,value:f}),w=await e.request({method:"eth_createAccessList",params:[b,r||i]});return{accessList:w.accessList,gasUsed:BigInt(w.gasUsed)}}catch(r){throw(0,K.P)(r,{...t,account:m,chain:e.chain})}}var X=r(15571);async function Q(e){let t=(0,X.g)(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}var ee=r(87196);class et extends u.G{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}var er=r(99552),en=r(98814),ei=r(521),eo=r(27698);let es="/docs/contract/encodeEventTopics";function ea(e){let{abi:t,eventName:r,args:n}=e,i=t[0];if(r){let e=(0,eo.mE)({abi:t,name:r});if(!e)throw new ee.mv(r,{docsPath:es});i=e}if("event"!==i.type)throw new ee.mv(void 0,{docsPath:es});let o=(0,ei.t)(i),s=(0,er.n)(o),a=[];if(n&&"inputs"in i){let e=i.inputs?.filter(e=>"indexed"in e&&e.indexed),t=Array.isArray(n)?n:Object.values(n).length>0?e?.map(e=>n[e.name])??[]:[];t.length>0&&(a=e?.map((e,r)=>Array.isArray(t[r])?t[r].map((n,i)=>ec({param:e,value:t[r][i]})):void 0!==t[r]&&null!==t[r]?ec({param:e,value:t[r]}):null)??[])}return[s,...a]}function ec({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return(0,m.w)((0,g.O0)(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new et(e.type);return(0,en.E)([e],[t])}async function el(e,t){let{address:r,abi:n,args:i,eventName:o,fromBlock:s,strict:a,toBlock:c}=t,u=(0,X.g)(e,{method:"eth_newFilter"}),d=o?ea({abi:n,args:i,eventName:o}):void 0,h=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:"bigint"==typeof s?(0,l.eC)(s):s,toBlock:"bigint"==typeof c?(0,l.eC)(c):c,topics:d}]});return{abi:n,args:i,eventName:o,id:h,request:u(h),strict:!!a,type:"event"}}async function eu(e,{address:t,args:r,event:n,events:i,fromBlock:o,strict:s,toBlock:a}={}){let c=i??(n?[n]:void 0),u=(0,X.g)(e,{method:"eth_newFilter"}),d=[];c&&(d=[c.flatMap(e=>ea({abi:[e],eventName:e.name,args:r}))],n&&(d=d[0]));let h=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof o?(0,l.eC)(o):o,toBlock:"bigint"==typeof a?(0,l.eC)(a):a,...d.length?{topics:d}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:o,id:h,request:u(h),strict:!!s,toBlock:a,type:"event"}}var ed=r(73914),eh=r(66574),ep=r(14628);async function ef(e,t){let{abi:r,address:n,args:i,functionName:o,dataSuffix:a,...c}=t,l=(0,s.R)({abi:r,args:i,functionName:o});try{return await (0,C.s)(e,ep.Q,"estimateGas")({data:`${l}${a?a.replace("0x",""):""}`,to:n,...c})}catch(t){let e=c.account?(0,V.T)(c.account):void 0;throw(0,eh.S)(t,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:e?.address})}}var eg=r(32093),em=r(58177),ey=r(24104);async function eb(e){return BigInt(await e.request({method:"eth_blobBaseFee"}))}var ew=r(73785),ev=r(84411),eC=r(96274);async function eE(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){let i;let o=void 0!==r?(0,l.eC)(r):void 0;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||n]},{dedupe:!!o}),(0,eC.ly)(i)}
7114var ex=r(97414),eA=r(33773),eS=r(56580),e_=r(53619);async function eI(e,{address:t,blockHash:r,fromBlock:n,toBlock:i,event:o,events:s,args:a,strict:c}={}){let u=s??(o?[o]:void 0),d=[];u&&(d=[u.flatMap(e=>ea({abi:[e],eventName:e.name,args:s?void 0:a}))],o&&(d=d[0]));let h=(r?await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:"bigint"==typeof n?(0,l.eC)(n):n,toBlock:"bigint"==typeof i?(0,l.eC)(i):i}]})).map(e=>(0,e_.U)(e));return u?(0,eS.h)({abi:u,args:a,logs:h,strict:c??!1}):h}async function ek(e,t){let{abi:r,address:n,args:i,blockHash:o,eventName:s,fromBlock:a,toBlock:c,strict:l}=t,u=s?(0,eo.mE)({abi:r,name:s}):void 0,d=u?void 0:r.filter(e=>"event"===e.type);return(0,C.s)(e,eI,"getLogs")({address:n,args:i,blockHash:o,event:u,events:d,fromBlock:a,toBlock:c,strict:l})}class eO extends u.G{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function eN(e,t){let{address:r,factory:n,factoryData:i}=t;try{let[t,o,s,a,c,l,u]=await (0,C.s)(e,E.L,"readContract")({abi:eP,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:o,version:s,chainId:Number(a),verifyingContract:c,salt:l},extensions:u,fields:t}}catch(e){if("ContractFunctionExecutionError"===e.name&&"ContractFunctionZeroDataError"===e.cause.name)throw new eO({address:r});throw e}}let eP=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function eT(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){var o;let s="bigint"==typeof r?(0,l.eC)(r):void 0;return{baseFeePerGas:(o=await e.request({method:"eth_feeHistory",params:[(0,l.eC)(t),s||n,i]},{dedupe:!!s})).baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:o.gasUsedRatio,oldestBlock:BigInt(o.oldestBlock),reward:o.reward?.map(e=>e.map(e=>BigInt(e)))}}var eR=r(15274);async function e$(e,{filter:t}){let r=t.strict??!1,n=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(e=>(0,e_.U)(e));return t.abi?(0,eS.h)({abi:t.abi,logs:n,strict:r}):n}var eD=r(81524);async function eL(e,{address:t,blockNumber:r,blockTag:n,storageKeys:i}){var o;let s=void 0!==r?(0,l.eC)(r):void 0;return{...o=await e.request({method:"eth_getProof",params:[t,i,s||(n??"latest")]}),balance:o.balance?BigInt(o.balance):void 0,nonce:o.nonce?(0,eC.ly)(o.nonce):void 0,storageProof:o.storageProof?o.storageProof.map(e=>({...e,value:BigInt(e.value)})):void 0}}async function eM(e,{address:t,blockNumber:r,blockTag:n="latest",slot:i}){let o=void 0!==r?(0,l.eC)(r):void 0;return await e.request({method:"eth_getStorageAt",params:[t,i,o||n]})}var eU=r(70752);async function ej(e,{hash:t,transactionReceipt:r}){let[n,i]=await Promise.all([(0,C.s)(e,ev.z,"getBlockNumber")({}),t?(0,C.s)(e,eU.f,"getTransaction")({hash:t}):void 0]),o=r?.blockNumber||i?.blockNumber;return o?n-o+1n:0n}var eB=r(32924),eF=r(81157),ez=r(1153),eH=r(53624),eW=r(88002),eq=r(74282),eV=r(39047),eK=r(57194);async function eG(e,t){let{blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",blocks:i,returnFullTransactions:a,traceTransfers:c,validation:u}=t;try{let t=[];for(let e of i){let r=e.blockOverrides?eH.o(e.blockOverrides):void 0,n=e.calls.map(e=>{let t=e.account?(0,V.T)(e.account):void 0,r=e.abi?(0,s.R)(e):e.data,n={...e,data:e.dataSuffix?(0,f.zo)([r||"0x",e.dataSuffix]):r,from:e.from??t?.address};return(0,Y.F)(n),(0,Z.tG)(n)}),i=e.stateOverrides?(0,eK.mF)(e.stateOverrides):void 0;t.push({blockOverrides:r,calls:n,stateOverrides:i})}let h="bigint"==typeof r?(0,l.eC)(r):void 0;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:a,traceTransfers:c,validation:u},h||n]})).map((e,t)=>({...(0,eV.Z)(e),calls:e.calls.map((e,r)=>{let{abi:n,args:s,functionName:a,to:c}=i[t].calls[r],l=e.error?.data??e.returnData,u=BigInt(e.gasUsed),h=e.logs?.map(e=>e_.U(e)),p="0x1"===e.status?"success":"failure",f=n&&"success"===p&&"0x"!==l?(0,o.k)({abi:n,data:l,functionName:a}):null,g=(()=>{let t;if("success"!==p&&(e.error?.data==="0x"?t=new ee.wb:e.error&&(t=new d.VQ(e.error)),t))return(0,eh.S)(t,{abi:n??[],address:c??"0x",args:s,functionName:a??"<unknown>"})})();return{data:l,gasUsed:u,logs:h,status:p,..."success"===p?{result:f}:{error:g}}})}))}catch(t){let e=(0,eq.k)(t,{});if(e instanceof eW.cj)throw t;throw e}}var eZ=r(82985),eY=r(91178),eJ=r(52379),eX=r(68954),eQ=r(1330),e0=r(13636),e1=r(85641),e2=r(68547);function e5(e,t){if(tr(e)>t)throw new ts({givenSize:tr(e),maxSize:t})}let e3={zero:48,nine:57,A:65,F:70,a:97,f:102};function e6(e){return e>=e3.zero&&e<=e3.nine?e-e3.zero:e>=e3.A&&e<=e3.F?e-(e3.A-10):e>=e3.a&&e<=e3.f?e-(e3.a-10):void 0}function e4(e,t={}){let{dir:r="left"}=t,n=0;for(let t=0;t<e.length-1&&"0"===e["left"===r?t:e.length-t-1].toString();t++)n++;return"left"===r?e.slice(n):e.slice(0,e.length-n)}var e8=r(64427),e9=r(90748);let e7=new TextDecoder,te=new TextEncoder;function tt(e,t={}){let{size:r}=t,n=e;r&&(e8.Yf(e,r),n=e2.eh(e,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);let o=i.length/2,s=new Uint8Array(o);for(let e=0,t=0;e<o;e++){let r=e6(i.charCodeAt(t++)),n=e6(i.charCodeAt(t++));if(void 0===r||void 0===n)throw new e0.G(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);s[e]=16*r+n}return s}function tr(e){return e.length}function tn(e,t={}){let{size:r}=t;void 0!==r&&e5(e,r);let n=e2.xv(e,t);return e2.He(n,t)}function ti(e){return e4(e,{dir:"left"})}class to extends e0.G{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}class ts extends e0.G{constructor({givenSize:e,maxSize:t}
7114){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class ta extends e0.G{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}class tc extends e0.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}function tl(e,t={}){let{as:r="string"==typeof e?"Hex":"Bytes"}=t,n=(0,e1.fr)(e instanceof Uint8Array?e:"string"==typeof e?tt(e):e instanceof Uint8Array?e:new Uint8Array(e));return"Bytes"===r?n:e2.xv(n)}class tu extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let td={checksum:new tu(8192)}.checksum,th=/^0x[a-fA-F0-9]{40}$/;function tp(e,t={}){let{strict:r=!0}=t;if(!th.test(e))throw new tm({address:e,cause:new ty});if(r){if(e.toLowerCase()===e)return;if(tf(e)!==e)throw new tm({address:e,cause:new tb})}}function tf(e){if(td.has(e))return td.get(e);tp(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=tl(function(e,t={}){let{size:r}=t,n=te.encode(e);return"number"==typeof r?(e5(n,r),function(e,t={}){let{dir:r,size:n=32}=t;if(0===n)return e;if(e.length>n)throw new tc({size:e.length,targetSize:n,type:"Bytes"});let i=new Uint8Array(n);for(let t=0;t<n;t++){let o="right"===r;i[o?t:n-t-1]=e[o?t:e.length-t-1]}return i}(n,{dir:"right",size:r})):n}(t),{as:"Bytes"}),n=t.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&n[e]&&(n[e]=n[e].toUpperCase()),(15&r[e>>1])>=8&&n[e+1]&&(n[e+1]=n[e+1].toUpperCase());let i=`0x${n.join("")}`;return td.set(e,i),i}function tg(e,t={}){let{strict:r=!0}=t??{};try{return tp(e,{strict:r}),!0}catch{return!1}}class tm extends e0.G{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class ty extends e0.G{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class tb extends e0.G{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function tw(e){let t=!0,r="",n=0,i="",o=!1;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a)&&(t=!0),"("===a&&n++,")"===a&&n--,t){if(0===n){if(" "===a&&["event","function","error",""].includes(i))i="";else if(i+=a,")"===a){o=!0;break}continue}if(" "===a){","!==e[s-1]&&","!==r&&",("!==r&&(r="",t=!1);continue}i+=a,r+=a}}if(!o)throw new e0.G("Unable to normalize signature.");return i}function tv(e,t={}){let{prepare:r=!0}=t,n=Array.isArray(e)||"string"==typeof e?function(e){let t;if("string"==typeof e)t=(0,eX.cK)(e);else{let r=(0,eJ.D)(e),n=e.length;for(let i=0;i<n;i++){let n=e[i];if(!(0,eY.N0)(n)){t=(0,eX.cK)(n,r);break}}}if(!t)throw new eZ.a_({signature:e});return t}(e):e;return{...n,...r?{hash:tE(n)}:{}}}function tC(e){return e2.tP(tE(e),0,4)}function tE(e){return"string"!=typeof e&&"hash"in e&&e.hash?e.hash:tl(e2.mL(tw("string"==typeof e?e:eQ.t(e))))}class tx extends e0.G{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${tw(eQ.t(e.abiItem))}\`, and`,`\`${t.type}\` in \`${tw(eQ.t(t.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class tA extends e0.G{constructor({name:e,data:t,type:r="item"}){super(`ABI ${r}${e?` with name "${e}"`:t?` with data "${t}"`:""} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}var tS=r(37810),t_=r(31630);let tI=/^(.*)\[([0-9]*)\]$/,tk=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,tO=/^(u?int)(8|
vendor: 7,304 bytes, line 7114
711416|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,tN=2n**256n-1n;function tP(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=e2.dp(i)}let r=[],n=[],i=0;for(let o=0;o<e.length;o++){let{dynamic:s,encoded:a}=e[o];s?(r.push(e2.xS(t+i,{size:32})),n.push(a),i+=e2.dp(a)):r.push(a)}return e2.zo(...r,...n)}function tT(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function tR(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(tR);let r=tT(e.type);return!!(r&&tR({...e,type:r[1]}))}let t$={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new tM({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new tL({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new tD({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new tD({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};class tD extends e0.G{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class tL extends e0.G{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class tM extends e0.G{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function tU(e,t,r){let{checksumAddress:n=!1}=r??{};if(e.length!==t.length)throw new tq({expectedLength:e.length,givenLength:t.length});let i=tP(function({checksumAddress:e,parameters:t,values:r}){let n=[];for(let i=0;i<t.length;i++)n.push(function e({checksumAddress:t=!1,parameter:r,value:n}){let i=tT(r.type);if(i){let[o,s]=i;return function(t,r){let{checksumAddress:n,length:i,parameter:o}=r,s=null===i;if(!Array.isArray(t))throw new tV(t);if(!s&&t.length!==i)throw new tH({expectedLength:i,givenLength:t.length,type:`${o.type}[${i}]`});let a=!1,c=[];for(let r=0;r<t.length;r++){let i=e({checksumAddress:n,parameter:o,value:t[r]});i.dynamic&&(a=!0),c.push(i)}if(s||a){let e=tP(c);if(s){let t=e2.xS(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?e2.zo(t,e):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:e2.zo(...c.map(({encoded:e})=>e))}}(n,{checksumAddress:t,length:o,parameter:{...r,type:s}})}if("tuple"===r.type)return function(t,r){let{checksumAddress:n,parameter:i}=r,o=!1,s=[];for(let r=0;r<i.components.length;r++){let a=i.components[r],c=Array.isArray(t)?r:a.name,l=e({checksumAddress:n,parameter:a,value:t[c]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?tP(s):e2.zo(...s.map(({encoded:e})=>e))}}(n,{checksumAddress:t,parameter:r});if("address"===r.type)return function(e,t){let{checksum:r=!1}=t;return tp(e,{strict:r}),{dynamic:!1,encoded:e2.Q_(e.toLowerCase())}}(n,{checksum:t});if("bool"===r.type)return function(e){if("boolean"!=typeof e)throw new e0.G(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:e2.Q_(e2.O3(e))}}(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){let e=r.type.startsWith("int"),[,,t="256"]=tO.exec(r.type)??[];return function(e,{signed:t,size:r}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new e2.J5({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:e2.xS(e,{size:32,signed:t})}}(n,{signed:e,size:Number(t)})}if(r.type.startsWith("bytes"))return function(e,{type:t}){let[,r]=t.split("bytes"),n=e2.dp(e);if(!r){let t=e;return n%32!=0&&(t=e2.eh(t,32*Math.ceil((e.length-2)/2/32))),{dynamic:!0,encoded:e2.zo(e2.Q_(e2.xS(n,{size:32})),t)}}if(n!==Number.parseInt(r,10))throw new tW({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:e2.eh(e)}}(n,{type:r.type});if("string"===r.type)return function(e){let t=e2.mL(e),r=Math.ceil(e2.dp(t)/32),n=[];for(let e=0;e<r;e++)n.push(e2.eh(e2.tP(t,32*e,(e+1)*32)));return{dynamic:!0,encoded:e2.zo(e2.eh(e2.xS(e2.dp(t),{size:32})),...n)}}(n);throw new tK(r.type)}({checksumAddress:e,parameter:t[i],value:r[i]}));return n}({checksumAddress:n,parameters:e,values:t}));return 0===i.length?"0x":i}function tj(e,t){if(e.length!==t.length)throw new tq({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=t[n];
7114r.push(tj.encode(i,o))}return e2.zo(...r)}function tB(e){return Array.isArray(e)&&"string"==typeof e[0]||"string"==typeof e?function(e){let t=[];if("string"==typeof e){let r=(0,eX.Q4)(e),n=r.length;for(let e=0;e<n;e++)t.push((0,eX.C$)(r[e],{modifiers:eY.LY}))}else{let r=(0,eJ.D)(e),n=e.length;for(let i=0;i<n;i++){let n=e[i];if((0,eY.N0)(n))continue;let o=(0,eX.Q4)(n),s=o.length;for(let e=0;e<s;e++)t.push((0,eX.C$)(o[e],{modifiers:eY.LY,structs:r}))}}if(0===t.length)throw new tS.$r({params:e});return t}(e):e}(tj||(tj={})).encode=function e(t,r,n=!1){if("address"===t)return tp(r),e2.Q_(r.toLowerCase(),n?32:0);if("string"===t)return e2.mL(r);if("bytes"===t)return r;if("bool"===t)return e2.Q_(e2.O3(r),n?32:1);let i=t.match(tO);if(i){let[e,t,o="256"]=i,s=Number.parseInt(o,10)/8;return e2.xS(r,{size:n?32:s,signed:"int"===t})}let o=t.match(tk);if(o){let[e,t]=o;if(Number.parseInt(t,10)!==(r.length-2)/2)throw new tW({expectedSize:Number.parseInt(t,10),value:r});return e2.eh(r,n?32:0)}let s=t.match(tI);if(s&&Array.isArray(r)){let[t,n]=s,i=[];for(let t=0;t<r.length;t++)i.push(e(n,r[t],!0));return 0===i.length?"0x":e2.zo(...i)}throw new tK(t)};class tF extends e0.G{constructor({data:e,parameters:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${t_.P(t)})`,`Data:   ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class tz extends e0.G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class tH extends e0.G{constructor({expectedLength:e,givenLength:t,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${t}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class tW extends e0.G{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${e2.dp(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class tq extends e0.G{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding parameters/values length mismatch.
7115Expected length (parameters): ${e}
7116Given length (values): ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class tV extends e0.G{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class tK extends e0.G{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function tG(e,t={}){return tv(e,t)}let tZ="0x0000000000000000000000000000000000000000";var tY=r(99602);async function tJ(e,t){let{blockNumber:r,blockTag:n,calls:i,stateOverrides:o,traceAssetChanges:a,traceTransfers:c,validation:l}=t,d=t.account?(0,V.T)(t.account):void 0;if(a&&!d)throw new u.G("`account` is required when `traceAssetChanges` is true");let h=d?function(e,t){let{bytecode:r,args:n}=t;return e2.zo(r,e.inputs?.length&&n?.length?tU(e.inputs,n):"0x")}(tv("constructor(bytes, bytes)"),{bytecode:tY.NO,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",function(e,...t){let{overloads:r}=e,n=r?function(e,t,r){let n=function(e,t,r){let n;let{args:i=[],prepare:o=!0}=r??{},s=e2.Gu(t,{strict:!1}),a=e.filter(e=>s?"function"===e.type||"error"===e.type?tC(e)===e2.tP(t,0,4):"event"===e.type&&tE(e)===t:"name"in e&&e.name===t);if(0===a.length)throw new tA({name:t});if(1===a.length)return{...a[0],...o?{hash:tE(a[0])}:{}};for(let e of a)if("inputs"in e){if(!i||0===i.length){if(!e.inputs||0===e.inputs.length)return{...e,...o?{hash:tE(e)}:{}};continue}
vendor: 14,008 bytes, line 7116
7116if(e.inputs&&0!==e.inputs.length&&e.inputs.length===i.length&&i.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return tg(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,n)=>e(Object.values(t)[n],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(n&&"inputs"in n&&n.inputs){let t=function e(t,r,n){for(let i in t){let o=t[i],s=r[i];if("tuple"===o.type&&"tuple"===s.type&&"components"in o&&"components"in s)return e(o.components,s.components,n[i]);let a=[o.type,s.type];if(a.includes("address")&&a.includes("bytes20")||(a.includes("address")&&a.includes("string")||a.includes("address")&&a.includes("bytes"))&&tg(n[i],{strict:!1}))return a}}(e.inputs,n.inputs,i);if(t)throw new tx({abiItem:e,type:t[0]},{abiItem:n,type:t[1]})}n=e}}let c=(()=>{if(n)return n;let[e,...t]=a;return{...e,overloads:t}})();if(!c)throw new tA({name:t});return{...c,...o?{hash:tE(c)}:{}}}(e,t,r);if("function"!==n.type)throw new tA({name:t,type:"function"});return n}([e,...r],e.name,{args:t[0]}):e,i=tC(n),o=t.length>0?tU(n.inputs,t[0]):void 0;return o?e2.zo(i,o):i}(tG("function getBalance(address)"),[d.address])]}):void 0,p=a?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;let{accessList:r}=await J(e,{account:d.address,...t,data:t.abi?(0,s.R)(t):t.data});return r.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],f=await eG(e,{blockNumber:r,blockTag:n,blocks:[...a?[{calls:[{data:h}],stateOverrides:o},{calls:p.map((e,t)=>({abi:[tG("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[d.address],to:e,from:tZ,nonce:t})),stateOverrides:[{address:tZ,nonce:0}]}]:[],{calls:[...i,{}].map(e=>({...e,from:d?.address})),stateOverrides:o},...a?[{calls:[{data:h}]},{calls:p.map((e,t)=>({abi:[tG("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[d.address],to:e,from:tZ,nonce:t})),stateOverrides:[{address:tZ,nonce:0}]},{calls:p.map((e,t)=>({to:e,abi:[tG("function decimals() returns (uint256)")],functionName:"decimals",from:tZ,nonce:t})),stateOverrides:[{address:tZ,nonce:0}]},{calls:p.map((e,t)=>({to:e,abi:[tG("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:tZ,nonce:t})),stateOverrides:[{address:tZ,nonce:0}]},{calls:p.map((e,t)=>({to:e,abi:[tG("function symbol() returns (string)")],functionName:"symbol",from:tZ,nonce:t})),stateOverrides:[{address:tZ,nonce:0}]}]:[]],traceTransfers:c,validation:l}),g=a?f[2]:f[0],[m,y,,b,w,v,C,E]=a?f:[],{calls:x,...A}=g,S=x.slice(0,-1)??[],_=[...m?.calls??[],...y?.calls??[]].map(e=>"success"===e.status?(0,eC.y_)(e.data):null),I=[...b?.calls??[],...w?.calls??[]].map(e=>"success"===e.status?(0,eC.y_)(e.data):null),k=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),O=(E?.calls??[]).map(e=>"success"===e.status?e.result:null),N=(C?.calls??[]).map(e=>"success"===e.status?e.result:null),P=[];for(let[e,t]of I.entries()){let r=_[e];if("bigint"!=typeof t||"bigint"!=typeof r)continue;let n=k[e-1],i=O[e-1],o=N[e-1],s=0===e?{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",decimals:18,symbol:"ETH"}:{address:p[e-1],decimals:o||n?Number(n??1):void 0,symbol:i??void 0};P.some(e=>e.token.address===s.address)||P.push({token:s,value:{pre:r,post:t,diff:t-r}})}return{assetChanges:P,block:A,results:S}}async function tX(e,t){let{abi:r,address:n,args:i,dataSuffix:a,functionName:c,...l}=t,u=l.account?(0,V.T)(l.account):e.account,d=(0,s.R)({abi:r,args:i,functionName:c});try{let{data:s}=await (0,C.s)(e,q.R,"call")({batch:!1,data:`${d}${a?a.replace("0x",""):""}`,to:n,...l,account:u}),h=(0,o.k)({abi:r,args:i,functionName:c,data:s||"0x"}),p=r.filter(e=>"name"in e&&e.name===t.functionName);return{result:h,request:{abi:p,address:n,args:i,dataSuffix:a,functionName:c,...l,account:u}}}catch(e){throw(0,eh.S)(e,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:c,sender:u?.address})}}var tQ=r(64603);let t0="0x6492649264926492649264926492649264926492649264926492649264926492";class t1 extends e0.G{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function t2(e,t={}){let{recovered:r}=t;if(void 0===e.r||void 0===e.s||r&&void 0===e.yParity)throw new t4({signature:e});if(e.r<0n||e.r>tN)throw new t8({value:e.r});if(e.s<0n||e.s>tN)throw new t9({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new t7({value:e.yParity})}function t5(e){if(130!==e.length&&132!==e.length)throw new t6({signature:e});let t=BigInt(e2.tP(e,0,32)),r=BigInt(e2.tP(e,32,64)),n=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return t3(t)}catch{throw new t7({value:t})}})();return void 0===n?{r:t,s:r}:{r:t,s:r,yParity:n}}function t3(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return e%2==0?1:0;throw new re({value:e})}class t6 extends e0.G{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${e2.dp(e2.Dp(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class t4 extends e0.G{constructor({signature:e}){super(`Signature \`${e9.P(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class t8 extends e0.G{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class t9 extends e0.G{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class t7 extends e0.G{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class re extends e0.G{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}let rt=tB("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function rr(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==e2.tP(e,-32))throw new rn(e)}else t2(e.authorization)}class rn extends e0.G{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}var ri=r(88401),ro=r(74823),rs=r(54639),ra=r(46967);async function rc({address:e,authorization:t,signature:r}){return(0,rs.E)((0,ro.K)(e),await (0,ra.z)({authorization:t,signature:r}))}var rl=r(55729),ru=r(53307);async function rd(e,t){let{address:r,hash:n,erc6492VerifierAddress:i=t.universalSignatureVerifierAddress??e.chain?.contracts?.erc6492Verifier?.address,multicallAddress:o=t.multicallAddress??e.chain?.contracts?.multicall3?.address}=t,s=(()=>{let e=t.signature;return(0,y.v)(e)?e:"object"==typeof e&&"r"in e&&"s"in e?function({r:e,s:t,to:r="hex",v:n,yParity:i}){let o=(()=>{if(0===i||1===i)return i;if(n&&(27n===n||28n===n||n>=35n))return n%2n===0n?1:0;throw Error("Invalid `v` or `yParity` value")})(),s=`0x${new ru.secp256k1.Signature((0,eC.y_)(e),(0,eC.y_)(t)).toCompactHex()}${0===o?"1b":"1c"}`;return"hex"===r?s:(0,g.nr)(s)}(e):(0,l.ci)(e)})();try{if(function(e){try{return rr(e),!0}catch{return!1}}(s))return await rh(e,{...t,multicallAddress:o,signature:s});return await rp(e,{...t,verifierAddress:i,signature:s})}catch(e){try{if((0,rs.E)((0,ro.K)(r),await (0,rl.R)({hash:n,signature:s})))return!0}catch{}if(e instanceof rg)return!1;throw e}}async function rh(e,t){let{address:r,blockNumber:n,blockTag:o,hash:a,multicallAddress:c}=t,{authorization:u,data:d,signature:h,to:p}=function(e){rr(e);let t=e2.He(e2.tP(e,-64,-32)),r=e2.tP(e,-t-64,-64),n=e2.tP(e,0,-t-64),[i,o,s]=function(e,t,r={}){let{as:n="Array",checksumAddress:i=!1}=r,o="string"==typeof t?tt(t):t,s=function(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(t$);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}(o);if(0===tr(o)&&e.length>0)throw new tz;if(tr(o)&&32>tr(o))throw new tF({data:"string"==typeof t?t:e2.xv(t),parameters:e,size:tr(o)});let a=0,c="Array"===n?[]:{};for(let t=0;t<e.length;++t){let r=e[t];s.setPosition(a);let[o,l]=function e(t,r,n){let{checksumAddress:i,staticPosition:o}=n,s=tT(r.type);if(s){let[n,a]=s;return function(t,r,n){let{checksumAddress:i,length:o,staticPosition:s}=n;if(!o){let n=s+tn(t.readBytes(32)),o=n+32;t.setPosition(n);let a=tn(t.readBytes(32)),c=tR(r),l=0,u=[];for(let n=0;n<a;++n){t.setPosition(o+(c?32*n:l));let[s,a]=e(t,r,{checksumAddress:i,staticPosition:o});l+=a,u.push(s)}return t.setPosition(s+32),[u,32]}if(tR(r)){let n=s+tn(t.readBytes(32)),a=[];for(let s=0;s<o;++s){t.setPosition(n+32*s);let[o]=e(t,r,{checksumAddress:i,staticPosition:n});a.push(o)}return t.setPosition(s+32),[a,32]}let a=0,c=[];for(let n=0;n<o;++n){let[n,o]=e(t,r,{checksumAddress:i,staticPosition:s+a});a+=o,c.push(n)}return[c,a]}(t,{...r,type:a},{checksumAddress:i,length:n,staticPosition:o})}if("tuple"===r.type)return function(t,r,n){let{checksumAddress:i,staticPosition:o}=n,s=0===r.components.length||r.components.some(({name:e})=>!e),a=s?[]:{},c=0;if(tR(r)){let n=o+tn(t.readBytes(32));for(let o=0;o<r.components.length;++o){let l=r.components[o];t.setPosition(n+c);let[u,d]=e(t,l,{checksumAddress:i,staticPosition:n});c+=d,a[s?o:l?.name]=u}return t.setPosition(o+32),[a,32]}for(let n=0;n<r.components.length;++n){let l=r.components[n],[u,d]=e(t,l,{checksumAddress:i,staticPosition:o});a[s?n:l?.name]=u,c+=d}return[a,c]}(t,r,{checksumAddress:i,staticPosition:o});if("address"===r.type)return function(e,t={}){let r;let{checksum:n=!1}=t,i=e.readBytes(32);return[(r=e2.xv(function(e,t,r,n={}){var i,o;let{strict:s}=n;i=0,o=0;let a=e.slice(-20,void 0);return s&&function(e,t,r){if("number"==typeof r&&tr(e)!==r-t)throw new ta({offset:r,position:"end",size:tr(e)})}(a,-20,void 0),a}(i,0)),n?tf(r):r),32]}(t,{checksum:i});if("bool"===r.type)return[function(e,t={}){let{size:r}=t,n=e;if(void 0!==r&&(e5(n,r),n=ti(n)),n.length>1||n[0]>1)throw new to(n);return!!n[0]}(t.readBytes(32),{size:32}),32];if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=tn(e.readBytes(32));e.setPosition(r+t);let n=tn(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[e2.xv(i),32]}return[e2.xv(e.readBytes(Number.parseInt(i,10),32)),32]}(t,r,{staticPosition:o});if(r.type.startsWith("uint")||r.type.startsWith("int"))return function(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),i=e.readBytes(32);return[n>48?function(e,t={}){let{size:r}=t;void 0!==r&&e5(e,r);let n=e2.xv(e,t);return e2.Gh(n,t)}(i,{signed:r}):tn(i,{signed:r}),32]}(t,r);if("string"===r.type)return function(e,{staticPosition:t}){let r=tn(e.readBytes(32));e.setPosition(t+r);let n=tn(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=function(e,t={}){let{size:r}=t,n=e;return void 0!==r&&(e5(n,r),n=e4(n,{dir:"right"})),e7.decode(n)}(ti(e.readBytes(n,32)));return e.setPosition(t+32),[i,32]}(t,{staticPosition:o});throw new tK(r.type)}(s,r,{checksumAddress:i,staticPosition:0});a+=l,"Array"===n?c.push(o):c[r.name??t]=o}return c}(rt,r);return{authorization:function(e,t={}){return"string"==typeof e.chainId?function(e){let{address:t,chainId:r,nonce:n}=e,i=function(e){if(void 0!==e.r&&void 0!==e.s)return function(e){let t=(()=>"string"==typeof e?t5(e):e instanceof Uint8Array?t5(e2.xv(e)):"string"==typeof e.r?function(e){let t=(()=>{let t=e.v?Number(e.v):void 0,r=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof r&&(r=t3(t)),"number"!=typeof r)throw new t7({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}(e):e.v?{r:e.r,s:e.s,yParity:t3(e.v)}:{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}})();return t2(t),t}(e)}(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...i}}(e):{...e,...t.signature}}({address:i.delegation,chainId:Number(i.chainId),nonce:i.nonce,yParity:i.yParity,r:i.r,s:i.s}),signature:n,...s&&"0x"!==s?{data:s,to:o}:{}}}(t.signature);if(await (0,eA.C)(e,{address:r,blockNumber:n,blockTag:o})===(0,f.SM)(["0xef0100",u.address]))return await rf(e,{address:r,blockNumber:n,blockTag:o,hash:a,signature:h});let g={address:u.address,chainId:Number(u.chainId),nonce:Number(u.nonce),r:(0,l.eC)(u.r,{size:32}),s:(0,l.eC)(u.s,{size:32}),yParity:u.yParity};if(!await rc({address:r,authorization:g}))throw new rg;let m=await (0,C.s)(e,E.L,"readContract")({...c?{address:c}:{code:tY.xd},authorizationList:[g],abi:i.F8,blockNumber:n,blockTag:"pending",functionName:"aggregate3",args:[[...d?[{allowFailure:!0,target:p??r,callData:d}
7116]:[],{allowFailure:!0,target:r,callData:(0,s.R)({abi:i._A,functionName:"isValidSignature",args:[a,h]})}]]}),y=m[m.length-1]?.returnData;if(y?.startsWith("0x1626ba7e"))return!0;throw new rg}async function rp(e,t){let{address:r,factory:n,factoryData:o,hash:a,signature:c,verifierAddress:l,...u}=t,h=await (async()=>!n&&!o||function(e){try{return!function(e){if(e2.tP(e,-32)!==t0)throw new t1(e)}(e),!0}catch{return!1}}(c)?c:function(e){let{data:t,signature:r,to:n}=e;return e2.zo(tU(tB("address, bytes, bytes"),[n,t,r]),t0)}({data:o,signature:c,to:n}))(),p=l?{to:l,data:(0,s.R)({abi:i.MR,functionName:"isValidSig",args:[r,a,h]}),...u}:{data:(0,ri.w)({abi:i.MR,args:[r,a,h],bytecode:tY.de}),...u},{data:f}=await (0,C.s)(e,q.R,"call")(p).catch(e=>{if(e instanceof d.cg)throw new rg;throw e});if((0,eC.XA)(f??"0x0"))return!0;throw new rg}async function rf(e,t){let{address:r,blockNumber:n,blockTag:o,hash:s,signature:a}=t;if((await (0,C.s)(e,E.L,"readContract")({address:r,abi:i._A,args:[s,a],blockNumber:n,blockTag:o,functionName:"isValidSignature"}).catch(e=>{if(e instanceof d.uq)throw new rg;throw e})).startsWith("0x1626ba7e"))return!0;throw new rg}class rg extends Error{}var rm=r(51672);async function ry(e,{address:t,message:r,factory:n,factoryData:i,signature:o,...s}){return rd(e,{address:t,factory:n,factoryData:i,hash:(0,rm.r)(r),signature:o,...s})}var rb=r(95111);async function rw(e,t){let{address:r,factory:n,factoryData:i,signature:o,message:s,primaryType:a,types:c,domain:l,...u}=t;return rd(e,{address:r,factory:n,factoryData:i,hash:(0,rb.Jv)({message:s,primaryType:a,types:c,domain:l}),signature:o,...u})}var rv=r(5436),rC=r(2060),rE=r(48478),rx=r(60252),rA=r(25750),rS=r(78612),r_=r(27854),rI=r(61154);let rk=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,rO=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;var rN=r(76259);async function rP(e,t){let{address:r,domain:n,message:i,nonce:o,scheme:s,signature:a,time:c=new Date,...l}=t,u=function(e){let{scheme:t,statement:r,...n}=e.match(rk)?.groups??{},{chainId:i,expirationTime:o,issuedAt:s,notBefore:a,requestId:c,...l}=e.match(rO)?.groups??{},u=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...n,...l,...i?{chainId:Number(i)}:{},...o?{expirationTime:new Date(o)}:{},...s?{issuedAt:new Date(s)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}(i);if(!u.address||!function(e){let{address:t,domain:r,message:n,nonce:i,scheme:o,time:s=new Date}=e;if(r&&n.domain!==r||i&&n.nonce!==i||o&&n.scheme!==o||n.expirationTime&&s>=n.expirationTime||n.notBefore&&s<n.notBefore)return!1;try{if(!n.address||!(0,rN.U)(n.address,{strict:!1})||t&&!(0,rs.E)(n.address,t))return!1}catch{return!1}return!0}({address:r,domain:n,message:u,nonce:o,scheme:s,time:c}))return!1;let d=(0,rm.r)(i);return rd(e,{address:u.address,hash:d,signature:a,...l})}var rT=r(68208),rR=r(8330);function r$(e){return{call:t=>(0,q.R)(e,t),createAccessList:t=>J(e,t),createBlockFilter:()=>Q(e),createContractEventFilter:t=>el(e,t),createEventFilter:t=>eu(e,t),createPendingTransactionFilter:()=>(0,ed.W)(e),estimateContractGas:t=>ef(e,t),estimateGas:t=>(0,ep.Q)(e,t),getBalance:t=>(0,ey.s)(e,t),getBlobBaseFee:()=>eb(e),getBlock:t=>(0,ew.Q)(e,t),getBlockNumber:t=>(0,ev.z)(e,t),getBlockTransactionCount:t=>eE(e,t),getBytecode:t=>(0,eA.C)(e,t),getChainId:()=>(0,ex.L)(e),getCode:t=>(0,eA.C)(e,t),getContractEvents:t=>ek(e,t),getEip712Domain:t=>eN(e,t),getEnsAddress:t=>x(e,t),getEnsAvatar:t=>z(e,t),getEnsName:t=>H(e,t),getEnsResolver:t=>W(e,t),getEnsText:t=>F(e,t),getFeeHistory:t=>eT(e,t),estimateFeesPerGas:t=>(0,eg.X)(e,t),getFilterChanges:t=>(0,eR.K)(e,t),getFilterLogs:t=>e$(e,t),getGasPrice:()=>(0,eD.o)(e),getLogs:t=>eI(e,t),getProof:t=>eL(e,t),estimateMaxPriorityFeePerGas:t=>(0,em._)(e,t),getStorageAt:t=>eM(e,t),getTransaction:t=>(0,eU.f)(e,t),getTransactionConfirmations:t=>ej(e,t),getTransactionCount:t=>(0,eB.K)(e,t),getTransactionReceipt:t=>(0,eF.a)(e,t),multicall:t=>(0,ez.A)(e,t),prepareTransactionRequest:t=>(0,rT.ZE)(e,t),readContract:t=>(0,E.L)(e,t),sendRawTransaction:t=>(0,rR.p)(e,t),simulate:t=>eG(e,t),simulateBlocks:t=>eG(e,t),simulateCalls:t=>tJ(e,t),simulateContract:t=>tX(e,t),verifyHash:t=>rd(e,t),verifyMessage:t=>ry(e,t),verifySiweMessage:t=>rP(e,t),verifyTypedData:t=>rw(e,t),uninstallFilter:t=>(0,tQ.W)(e,t),waitForTransactionReceipt:t=>(0,rv.e)(e,t),watchBlocks:t=>(function(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:o,includeTransactions:s,poll:a,pollingInterval:c=e.pollingInterval}){let l,u,d,h;let p=void 0!==a?a:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
7116onfig.type&&"ipc"!==e.transport.transports[0].config.type),f=s??!1;return p?(()=>{let s=(0,rA.P)(["watchBlocks",e.uid,t,r,n,f,c]);return(0,rE.N7)(s,{onBlock:i,onError:o},i=>(0,rx.$)(async()=>{try{let n=await (0,C.s)(e,ew.Q,"getBlock")({blockTag:t,includeTransactions:f});if(null!==n.number&&l?.number!=null){if(n.number===l.number)return;if(n.number-l.number>1&&r)for(let t=l?.number+1n;t<n.number;t++){let r=await (0,C.s)(e,ew.Q,"getBlock")({blockNumber:t,includeTransactions:f});i.onBlock(r,l),l=r}}(l?.number==null||"pending"===t&&n?.number==null||null!==n.number&&n.number>l.number)&&(i.onBlock(n,l),l=n)}catch(e){i.onError?.(e)}},{emitOnBegin:n,interval:c}))})():(u=!0,d=!0,h=()=>u=!1,(async()=>{try{n&&(0,C.s)(e,ew.Q,"getBlock")({blockTag:t,includeTransactions:f}).then(e=>{u&&d&&(i(e,void 0),d=!1)}).catch(o);let r=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:s}=await r.subscribe({params:["newHeads"],async onData(t){if(!u)return;let r=await (0,C.s)(e,ew.Q,"getBlock")({blockNumber:t.result?.number,includeTransactions:f}).catch(()=>{});u&&(i(r,l),d=!1,l=r)},onError(e){o?.(e)}});h=s,u||h()}catch(e){o?.(e)}})(),()=>h())})(e,t),watchBlockNumber:t=>(0,rC.q)(e,t),watchContractEvent:t=>(function(e,t){let{abi:r,address:n,args:i,batch:o=!0,eventName:s,fromBlock:a,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:h}=t;return(void 0!==u?u:"bigint"==typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
7116onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{let t=h??!1,u=(0,rA.P)(["watchContractEvent",n,i,o,e.uid,s,d,t,a]);return(0,rE.N7)(u,{onLogs:l,onError:c},c=>{let l,u;void 0!==a&&(l=a-1n);let h=!1,p=(0,rx.$)(async()=>{if(!h){try{u=await (0,C.s)(e,el,"createContractEventFilter")({abi:r,address:n,args:i,eventName:s,strict:t,fromBlock:a})}catch{}h=!0;return}try{let a;if(u)a=await (0,C.s)(e,eR.K,"getFilterChanges")({filter:u});else{let o=await (0,C.s)(e,ev.z,"getBlockNumber")({});a=l&&l<o?await (0,C.s)(e,ek,"getContractEvents")({abi:r,address:n,args:i,eventName:s,fromBlock:l+1n,toBlock:o,strict:t}):[],l=o}if(0===a.length)return;if(o)c.onLogs(a);else for(let e of a)c.onLogs([e])}catch(e){u&&e instanceof rS.yR&&(h=!1),c.onError?.(e)}},{emitOnBegin:!0,interval:d});return async()=>{u&&await (0,C.s)(e,tQ.W,"uninstallFilter")({filter:u}),p()}})})():(()=>{let t=(0,rA.P)(["watchContractEvent",n,i,o,e.uid,s,d,h??!1]),a=!0,u=()=>a=!1;return(0,rE.N7)(t,{onLogs:l,onError:c},t=>((async()=>{try{let o=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),c=s?ea({abi:r,eventName:s,args:i}):[],{unsubscribe:l}=await o.subscribe({params:["logs",{address:n,topics:c}],onData(e){if(!a)return;let n=e.result;try{let{eventName:e,args:i}=(0,r_.F)({abi:r,data:n.data,topics:n.topics,strict:h}),o=(0,e_.U)(n,{args:i,eventName:e});t.onLogs([o])}catch(o){let e,r;if(o instanceof ee.SM||o instanceof ee.Gy){if(h)return;e=o.abiItem.name,r=o.abiItem.inputs?.some(e=>!("name"in e&&e.name))}let i=(0,e_.U)(n,{args:r?[]:{},eventName:e});t.onLogs([i])}},onError(e){t.onError?.(e)}});u=l,a||u()}catch(e){c?.(e)}})(),()=>u()))})()})(e,t),watchEvent:t=>(function(e,{address:t,args:r,batch:n=!0,event:i,events:o,fromBlock:s,onError:a,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}){let h,p;let f=void 0!==l?l:"bigint"==typeof s||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
7116onfig.type&&"ipc"!==e.transport.transports[0].config.type),g=d??!1;return f?(()=>{let l=(0,rA.P)(["watchEvent",t,r,n,e.uid,i,u,s]);return(0,rE.N7)(l,{onLogs:c,onError:a},a=>{let c,l;void 0!==s&&(c=s-1n);let d=!1,h=(0,rx.$)(async()=>{if(!d){try{l=await (0,C.s)(e,eu,"createEventFilter")({address:t,args:r,event:i,events:o,strict:g,fromBlock:s})}catch{}d=!0;return}try{let s;if(l)s=await (0,C.s)(e,eR.K,"getFilterChanges")({filter:l});else{let n=await (0,C.s)(e,ev.z,"getBlockNumber")({});s=c&&c!==n?await (0,C.s)(e,eI,"getLogs")({address:t,args:r,event:i,events:o,fromBlock:c+1n,toBlock:n}):[],c=n}if(0===s.length)return;if(n)a.onLogs(s);else for(let e of s)a.onLogs([e])}catch(e){l&&e instanceof rS.yR&&(d=!1),a.onError?.(e)}},{emitOnBegin:!0,interval:u});return async()=>{l&&await (0,C.s)(e,tQ.W,"uninstallFilter")({filter:l}),h()}})})():(h=!0,p=()=>h=!1,(async()=>{try{let n=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),s=o??(i?[i]:void 0),l=[];s&&(l=[s.flatMap(e=>ea({abi:[e],eventName:e.name,args:r}))],i&&(l=l[0]));let{unsubscribe:u}=await n.subscribe({params:["logs",{address:t,topics:l}],onData(e){if(!h)return;let t=e.result;try{let{eventName:e,args:r}=(0,r_.F)({abi:s??[],data:t.data,topics:t.topics,strict:g}),n=(0,e_.U)(t,{args:r,eventName:e});c([n])}catch(i){let e,r;if(i instanceof ee.SM||i instanceof ee.Gy){if(d)return;e=i.abiItem.name,r=i.abiItem.inputs?.some(e=>!("name"in e&&e.name))}let n=(0,e_.U)(t,{args:r?[]:{},eventName:e});c([n])}},onError(e){a?.(e)}});p=u,h||p()}catch(e){a?.(e)}})(),()=>p())})(e,t),watchPendingTransactions:t=>(0,rI.O)(e,t)}}function rD(e){let{key:t="public",name:r="Public Client"}=e;return(0,n.e)({...e,key:t,name:r,type:"publicClient"}).extend(r$)}},92179:function(e,t,r){"use strict";r.d(t,{q:function(){return d}});var n=r(55166),i=r(5130),o=r(78612),s=r(72490);let a=new(r(83018)).k(8192);var c=r(85889),l=r(25750),u=r(91086);function d({key:e,methods:t,name:r,request:d,retryCount:h=3,retryDelay:p=150,timeout:f,type:g},m){return{config:{key:e,methods:t,name:r,request:d,retryCount:h,retryDelay:p,timeout:f,type:g},request:function(e,t={}){return async(r,u={})=>{let{dedupe:d=!1,methods:h,retryDelay:p=150,retryCount:f=3,uid:g}={...t,...u},{method:m}=r;if(h?.exclude?.includes(m)||h?.include&&!h.include.includes(m))throw new o.gS(Error("method not supported"),{method:m});let y=d?(0,s.$G)(`${g}.${(0,l.P)(r)}`):void 0;return function(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(a.get(r))return a.get(r);let n=e().finally(()=>a.delete(r));return a.set(r,n),n}(()=>(0,c.J)(async()=>{try{return await e(r)}catch(e){switch(e.code){case o.s7.code:throw new o.s7(e);case o.B.code:throw new o.B(e);case o.LX.code:throw new o.LX(e,{method:r.method});case o.nY.code:throw new o.nY(e);case o.XS.code:throw new o.XS(e);case o.yR.code:throw new o.yR(e);case o.Og.code:throw new o.Og(e);case o.pT.code:throw new o.pT(e);case o.KB.code:throw new o.KB(e);case o.gS.code:throw new o.gS(e,{method:r.method});case o.Pv.code:throw new o.Pv(e);case o.GD.code:throw new o.GD(e);case o.ab.code:throw new o.ab(e);case o.PE.code:throw new o.PE(e);case o.Ts.code:throw new o.Ts(e);case o.u5.code:throw new o.u5(e);case o.I0.code:throw new o.I0(e);case o.x3.code:throw new o.x3(e);case o.vl.code:throw new o.vl(e);case o.Uu.code:throw new o.Uu(e);case o.Nt.code:throw new o.Nt(e);case o.EJ.code:throw new o.EJ(e);case o.fl.code:throw new o.fl(e);case o.NO.code:throw new o.NO(e);case o.r0.code:throw new o.r0(e);case 5e3:throw new o.ab(e);default:if(e instanceof n.G)throw e;throw new o.ir(e)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof i.Gg){let e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e,10)}return~~(1<<e)*p},retryCount:f,shouldRetry:({error:e})=>"code"in e&&"number"==typeof e.code?-1===e.code||e.code===o.Pv.code||e.code===o.XS.code:!(e instanceof i.Gg)||!e.status||403===e.status||408===e.status||413===e.status||429===e.status||500===e.status||502===e.status||503===e.status||504===e.status}),{enabled:d,id:y})}}(d,{methods:t,retryCount:h,retryDelay:p,uid:(0,u.h)()}),value:m}}},94650:function(e,t,r){"use strict";r.d(t,{d:function(){return d}});var n=r(5130),i=r(55166);class o extends i.G{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}var s=r(65215),a=r(46),c=r(25750);let l={current:0,take(){return this.current++},reset(){this.current=0}};var u=r(92179);function d(e,t={}){let{batch:r,fetchFn:i,fetchOptions:d,key:h="http",methods:p,name:f="HTTP JSON-RPC",onFetchRequest:g,onFetchResponse:m,retryDelay:y,raw:b}=t;return({chain:w,retryCount:v,timeout:C})=>{let{batchSize:E=1e3,wait:x=0}="object"==typeof r?r:{},A=t.retryCount??v,S=C??t.timeout??1e4,_=e||w?.rpcUrls.default.http[0];if(!_)throw new o;let I=function(e,t={}){return{async request(r){let{body:i,fetchFn:o=t.fetchFn??fetch,onRequest:s=t.onRequest,onResponse:u=t.onResponse,timeout:d=t.timeout??1e4}=r,h={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:p,method:f,signal:g}=h;try{let t;let r=await (0,a.F)(async({signal:t})=>{let r={...h,body:Array.isArray(i)?(0,c.P)(i.map(e=>({jsonrpc:"2.0",id:e.id??l.take(),...e}))):(0,c.P)({jsonrpc:"2.0",id:i.id??l.take(),...i}),headers:{"Content-Type":"application/json",...p},method:f||"POST",signal:g||(d>0?t:null)}
vendor: 4,554 bytes, line 7116
7116,n=new Request(e,r),a=await s?.(n,r)??{...r,url:e};return await o(a.url??e,a)},{errorInstance:new n.W5({body:i,url:e}),timeout:d,signal:!0});if(u&&await u(r),r.headers.get("Content-Type")?.startsWith("application/json"))t=await r.json();else{t=await r.text();try{t=JSON.parse(t||"{}")}catch(e){if(r.ok)throw e;t={error:t}}}if(!r.ok)throw new n.Gg({body:i,details:(0,c.P)(t.error)||r.statusText,headers:r.headers,status:r.status,url:e});return t}catch(t){if(t instanceof n.Gg||t instanceof n.W5)throw t;throw new n.Gg({body:i,cause:t,url:e})}}}}(_,{fetchFn:i,fetchOptions:d,onRequest:g,onResponse:m,timeout:S});return(0,u.q)({key:h,methods:p,name:f,async request({method:e,params:t}){let i={method:e,params:t},{schedule:o}=(0,s.S)({id:_,wait:x,shouldSplitBatch:e=>e.length>E,fn:e=>I.request({body:e}),sort:(e,t)=>e.id-t.id}),a=async e=>r?o(e):[await I.request({body:e})],[{error:c,result:l}]=await a(i);if(b)return{error:c,result:l};if(c)throw new n.bs({body:i,error:c,url:_});return l},retryCount:A,retryDelay:y,timeout:S,type:"http"},{fetchOptions:d,url:_})}}},98687:function(e,t,r){"use strict";r.d(t,{F8:function(){return n},MR:function(){return d},Wo:function(){return h},X$:function(){return l},Yi:function(){return i},_A:function(){return u},du:function(){return a},k3:function(){return s},nZ:function(){return c}});let n=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],i=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],o=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],s=[...o,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],a=[...o,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],c=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],l=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],u=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],d=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}
7116],h=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}]},99602:function(e,t,r){"use strict";r.d(t,{NO:function(){return n},de:function(){return o},pG:function(){return i},xd:function(){return s}});let n="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",i="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",o="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b
711660405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
7116603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",s="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
7116150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"},59303:function(e,t,r){"use strict";r.d(t,{$:function(){return n},Up:function(){return i},hZ:function(){return o}});
7116let n={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},o={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},91283:function(e,t,r){"use strict";r.d(t,{Bd:function(){return o},Zn:function(){return i},ez:function(){return n}});let n={gwei:9,wei:18},i={ether:-9,wei:9},o={ether:-18,gwei:-9}},87196:function(e,t,r){"use strict";r.d(t,{CI:function(){return I},FM:function(){return m},Gy:function(){return S},KY:function(){return x},M4:function(){return d},MS:function(){return f},MX:function(){return v},Mi:function(){return N},S4:function(){return E},SM:function(){return A},Zh:function(){return p},cO:function(){return a},dh:function(){return _},eF:function(){return C},fM:function(){return s},fs:function(){return h},gr:function(){return u},hn:function(){return k},lC:function(){return y},mv:function(){return b},wM:function(){return O},wb:function(){return l},xB:function(){return c},xL:function(){return w},yP:function(){return g}});var n=r(521),i=r(80205),o=r(55166);class s extends o.G{constructor({docsPath:e}){super("A constructor was not found on the ABI.\nMake sure you are using the correct ABI and that the constructor exists on it.",{docsPath:e,name:"AbiConstructorNotFoundError"})}}class a extends o.G{constructor({docsPath:e}){super("Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.\nMake sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.",{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class c extends o.G{constructor({data:e,params:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${(0,n.h)(t,{includeName:!0})})`,`Data:   ${e} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}}class l extends o.G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class u extends o.G{constructor({expectedLength:e,givenLength:t,type:r}){super(`ABI encoding array length mismatch for type ${r}.
7117Expected length: ${e}
7118Given length: ${t}`,{name:"AbiEncodingArrayLengthMismatchError"})}}class d extends o.G{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.d)(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class h extends o.G{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding params/values length mismatch.
7119Expected length (params): ${e}
7120Given length (values): ${t}`,{name:"AbiEncodingLengthMismatchError"})}}class p extends o.G{constructor(e,{docsPath:t}){super(`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).
7121Cannot encode error result without knowing what the parameter types are.
7122Make sure you are using the correct ABI and that the inputs exist on it.`,{docsPath:t,name:"AbiErrorInputsNotFoundError"})}}class f extends o.G{constructor(e,{docsPath:t}={}){super(`Error ${e?`"${e}" `:""}not found on ABI.
7123Make sure you are using the correct ABI and that the error exists on it.`,{docsPath:t,name:"AbiErrorNotFoundError"})}}class g extends o.G{constructor(e,{docsPath:t}){super(`Encoded error signature "${e}" not found on ABI.
7124Make sure you are using the correct ABI and that the error exists on it.
7125You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class m extends o.G{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class y extends o.G{constructor(e,{docsPath:t}){super(`Encoded event signature "${e}" not found on ABI.
7126Make sure you are using the correct ABI and that the event exists on it.
7127You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t,name:"AbiEventSignatureNotFoundError"})}}class b extends o.G{constructor(e,{docsPath:t}={}){super(`Event ${e?`"${e}" `:""}not found on ABI.
7128Make sure you are using the correct ABI and that the event exists on it.`,{docsPath:t,name:"AbiEventNotFoundError"})}}class w extends o.G{constructor(e,{docsPath:t}={}){super(`Function ${e?`"${e}" `:""}not found on ABI.
7129Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t,name:"AbiFunctionNotFoundError"})}}class v extends o.G{constructor(e,{docsPath:t}){super(`Function "${e}" does not contain any \`outputs\` on ABI.
7130Cannot decode function result without knowing what the parameter types are.
7131Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t,name:"AbiFunctionOutputsNotFoundError"})}}class C extends o.G{constructor(e,{docsPath:t}){super(`Encoded function signature "${e}" not found on ABI.
7132Make sure you are using the correct ABI and that the function exists on it.
7133You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t,name:"AbiFunctionSignatureNotFoundError"})}}class E extends o.G{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${(0,n.t)(e.abiItem)}\`, and`,`\`${t.type}\` in \`${(0,n.t)(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class x extends o.G{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}}class A extends o.G{constructor({abiItem:e,data:t,params:r,size:i}){super(`Data size of ${i} bytes is too small for non-indexed event parameters.`,{metaMessages:[`Params: (${(0,n.h)(r,{includeName:!0})})`,`Data:   ${t} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=i}}class S extends o.G{constructor({abiItem:e,param:t}){super(`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,n.t)(e,{includeName:!0})}".`,{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class _ extends o.G{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid encoding type.
7134Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiEncodingType"})}}class I extends o.G{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid decoding type.
7135Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiDecodingType"})}}class k extends o.G{constructor(e){super(`Value "${e}" is not a valid array.`,{name:"InvalidArrayError"})}}class O extends o.G{constructor(e){super(`"${e}" is not a valid definition type.
7136Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}}class N extends o.G{constructor(e){super(`Type "${e}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}},8811:function(e,t,r){"use strict";r.d(t,{Y:function(){return o},o:function(){return i}});var n=r(55166);class i extends n.G{constructor({docsPath:e}={}){super("Could not find an Account to execute with this Action.\nPlease provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client.",{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class o extends n.G{constructor({docsPath:e,metaMessages:t,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:e,metaMessages:t,name:"AccountTypeNotSupportedError"})}}},79364:function(e,t,r){"use strict";r.d(t,{b:function(){return i}});var n=r(55166);class i extends n.G{constructor({address:e}){super(`Address "${e}
7136" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}},55166:function(e,t,r){"use strict";r.d(t,{G:function(){return o}});let n="2.37.5",i={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${n}`};class o extends Error{constructor(e,t={}){let r=t.cause instanceof o?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof o&&t.cause.docsPath||t.docsPath,a=i.getDocsUrl?.({...t,docsPath:s});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=n}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}},25335:function(e,t,r){"use strict";r.d(t,{f:function(){return i}});var n=r(55166);class i extends n.G{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r=`Block at hash "${e}"`),t&&(r=`Block at number "${t}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}},11598:function(e,t,r){"use strict";r.d(t,{Bk:function(){return s},Yl:function(){return o},mm:function(){return i},pZ:function(){return a}});var n=r(55166);class i extends n.G{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class o extends n.G{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID:  ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class s extends n.G{constructor(){super("No chain was provided to the request.\nPlease provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.",{name:"ChainNotFoundError"})}}class a extends n.G{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}},57903:function(e,t,r){"use strict";r.d(t,{cg:function(){return y},uq:function(){return b},Lu:function(){return w},Dk:function(){return v},Mo:function(){return C},VQ:function(){return E}});var n=r(3902),i=r(59303),o=r(17753),s=r(521),a=r(25750);function c({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((e,r)=>`${n&&e.name?`${e.name}: `:""}${"object"==typeof t[r]?(0,a.P)(t[r]):t[r]}`).join(", ")})`}var l=r(27698),u=r(38578),d=r(59703),h=r(87196),p=r(55166),f=r(81762),g=r(61373),m=r(65460);class y extends p.G{constructor(e,{account:t,docsPath:r,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:h,to:p,value:m,stateOverride:y}){let b=t?(0,n.T)(t):void 0,w=(0,g.xr)({from:b?.address,to:p,value:void 0!==m&&`${(0,u.d)(m)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:s,gasPrice:void 0!==a&&`${(0,d.o)(a)} gwei`,maxFeePerGas:void 0!==c&&`${(0,d.o)(c)}
7136 gwei`,maxPriorityFeePerGas:void 0!==l&&`${(0,d.o)(l)} gwei`,nonce:h});y&&(w+=`
7137${(0,f.Bj)(y)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class b extends p.G{constructor(e,{abi:t,args:r,contractAddress:n,docsPath:i,functionName:o,sender:a}){let u=(0,l.mE)({abi:t,args:r,name:o}),d=u?c({abiItem:u,args:r,includeFunctionName:!1,includeName:!1}):void 0,h=u?(0,s.t)(u,{includeName:!0}):void 0,p=(0,g.xr)({address:n&&(0,m.C)(n),function:h,args:d&&"()"!==d&&`${[...Array(o?.length??0).keys()].map(()=>" ").join("")}${d}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],p&&"Contract Call:",p].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=t,this.args=r,this.cause=e,this.contractAddress=n,this.functionName=o,this.sender=a}}class w extends p.G{constructor({abi:e,data:t,functionName:r,message:n}){let a,l,u,d,p;if(t&&"0x"!==t)try{let{abiItem:r,errorName:n,args:a}=l=(0,o.p)({abi:e,data:t});if("Error"===n)d=a[0];else if("Panic"===n){let[e]=a;d=i.$[e]}else{let e=r?(0,s.t)(r,{includeName:!0}):void 0,t=r&&a?c({abiItem:r,args:a,includeFunctionName:!1,includeName:!1}):void 0;u=[e?`Error: ${e}`:"",t&&"()"!==t?`       ${[...Array(n?.length??0).keys()].map(()=>" ").join("")}${t}`:""]}}catch(e){a=e}else n&&(d=n);a instanceof h.yP&&(p=a.signature,u=[`Unable to decode signature "${p}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${p}.`]),super(d&&"execution reverted"!==d||p?[`The contract function "${r}" reverted with the following ${p?"signature":"reason"}:`,d||p].join("\n"):`The contract function "${r}" reverted.`,{cause:a,metaMessages:u,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=l,this.raw=t,this.reason=d,this.signature=p}}class v extends p.G{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${e}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class C extends p.G{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class E extends p.G{constructor({data:e,message:t}){super(t||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}},88689:function(e,t,r){"use strict";r.d(t,{KD:function(){return s},T_:function(){return i},lQ:function(){return o}});var n=r(55166);class i extends n.G{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class o extends n.G{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class s extends n.G{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}},9511:function(e,t,r){"use strict";r.d(t,{$s:function(){return o},W_:function(){return s},mV:function(){return i}});var n=r(55166);class i extends n.G{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class o extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class s extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${t} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}},23743:function(e,t,r){"use strict";r.d(t,{Cd:function(){return s},J5:function(){return i},M6:function(){return a},yr:function(){return o}});var n=r(55166);class i extends n.G{constructor({max:e,min:t,signed:r,size:n,value:i}
vendor: 5,398 bytes, lines 7137-7138
7137){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class o extends n.G{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class s extends n.G{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class a extends n.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},74994:function(e,t,r){"use strict";r.d(t,{Fz:function(){return o},e5:function(){return s},ld:function(){return a}});var n=r(59703),i=r(55166);class o extends i.G{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class s extends i.G{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class a extends i.G{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,n.o)(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}},88002:function(e,t,r){"use strict";r.d(t,{C_:function(){return d},G$:function(){return a},Hh:function(){return s},M_:function(){return o},WF:function(){return h},ZI:function(){return c},cj:function(){return m},cs:function(){return g},dR:function(){return p},pZ:function(){return f},se:function(){return u},vU:function(){return l}});var n=r(59703),i=r(55166);class o extends i.G{constructor({cause:e,message:t}={}){let r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class s extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class a extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class c extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class l extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.
7138Try increasing the nonce or find the latest nonce with \`getTransactionCount\`.`,{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class u extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class d extends i.G{constructor({cause:e}={}){super("The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class h extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class p extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class f extends i.G{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}
vendor: 4,668 bytes, line 7138
7138Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class g extends i.G{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${(0,n.o)(r)} gwei`:""}).`,{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(g,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class m extends i.G{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}},5130:function(e,t,r){"use strict";r.d(t,{Gg:function(){return s},W5:function(){return c},bs:function(){return a}});var n=r(25750),i=r(55166),o=r(65460);class s extends i.G{constructor({body:e,cause:t,details:r,headers:i,status:s,url:a}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${(0,o.G)(a)}`,e&&`Request body: ${(0,n.P)(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=a}}class a extends i.G{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(0,o.G)(r)}`,`Request body: ${(0,n.P)(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data}}class c extends i.G{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,o.G)(t)}`,`Request body: ${(0,n.P)(e)}`],name:"TimeoutError"})}}},78612:function(e,t,r){"use strict";r.d(t,{B:function(){return c},EJ:function(){return k},GD:function(){return b},I0:function(){return x},KB:function(){return g},LX:function(){return l},NO:function(){return N},Nt:function(){return I},Og:function(){return p},PE:function(){return v},Pv:function(){return y},Ts:function(){return C},Uu:function(){return _},XS:function(){return d},ab:function(){return w},fl:function(){return O},gS:function(){return m},ir:function(){return T},nY:function(){return u},pT:function(){return f},r0:function(){return P},s7:function(){return a},u5:function(){return E},vl:function(){return S},x3:function(){return A},yR:function(){return h}});var n=r(55166),i=r(5130);class o extends n.G{constructor(e,{code:t,docsPath:r,metaMessages:n,name:o,shortMessage:s}){super(s,{cause:e,docsPath:r,metaMessages:n||e?.metaMessages,name:o||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=o||e.name,this.code=e instanceof i.bs?e.code:t??-1}}class s extends o{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class a extends o{constructor(e){super(e,{code:a.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class c extends o{constructor(e){super(e,{code:c.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class l extends o{constructor(e,{method:t}={}){super(e,{code:l.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends o{constructor(e){super(e,{code:u.code,name:"InvalidParamsRpcError",shortMessage:"Invalid parameters were provided to the RPC method.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends o{constructor(e){super(e,{code:d.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});
7138class h extends o{constructor(e){super(e,{code:h.code,name:"InvalidInputRpcError",shortMessage:"Missing or invalid parameters.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class p extends o{constructor(e){super(e,{code:p.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class f extends o{constructor(e){super(e,{code:f.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class g extends o{constructor(e){super(e,{code:g.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class m extends o{constructor(e,{method:t}={}){super(e,{code:m.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class y extends o{constructor(e){super(e,{code:y.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class b extends o{constructor(e){super(e,{code:b.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class w extends s{constructor(e){super(e,{code:w.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class v extends s{constructor(e){super(e,{code:v.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class C extends s{constructor(e,{method:t}={}){super(e,{code:C.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class E extends s{constructor(e){super(e,{code:E.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class x extends s{constructor(e){super(e,{code:x.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class A extends s{constructor(e){super(e,{code:A.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class S extends s{constructor(e){super(e,{code:S.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class _ extends s{constructor(e){super(e,{code:_.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class I extends s{constructor(e){super(e,{code:I.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(I,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class k extends s{constructor(e){super(e,{code:k.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(k,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class O extends s{constructor(e){super(e,{code:O.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class N extends s{constructor(e){super(e,{code:N.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(N,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
vendor: 7,513 bytes, lines 7138-7143
7138);class P extends s{constructor(e){super(e,{code:P.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(P,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class T extends o{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}},81762:function(e,t,r){"use strict";r.d(t,{Bj:function(){return a},Nc:function(){return i},Z8:function(){return o}});var n=r(55166);class i extends n.G{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class o extends n.G{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function s(e){return e.reduce((e,{slot:t,value:r})=>`${e}        ${t}: ${r}
7139`,"")}function a(e){return e.reduce((e,{address:t,...r})=>{let n=`${e}    ${t}:
7140`;return r.nonce&&(n+=`      nonce: ${r.nonce}
7141`),r.balance&&(n+=`      balance: ${r.balance}
7142`),r.code&&(n+=`      code: ${r.code}
7143`),r.state&&(n+="      state:\n"+s(r.state)),r.stateDiff&&(n+="      stateDiff:\n"+s(r.stateDiff)),n},"  State Override:\n").slice(0,-1)}},61373:function(e,t,r){"use strict";r.d(t,{Bh:function(){return u},Yb:function(){return d},j3:function(){return c},mc:function(){return h},mk:function(){return l},xY:function(){return a},xr:function(){return s}});var n=r(38578),i=r(59703),o=r(55166);function s(e){let t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),r=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>`  ${`${e}:`.padEnd(r+1)}  ${t}`).join("\n")}class a extends o.G{constructor(){super("Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.\nUse `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others.",{name:"FeeConflictError"})}}class c extends o.G{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",s(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class l extends o.G{constructor(e,{account:t,docsPath:r,chain:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,to:p,value:f}){super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",s({chain:o&&`${o?.name} (id: ${o?.id})`,from:t?.address,to:p,value:void 0!==f&&`${(0,n.d)(f)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:c,gasPrice:void 0!==l&&`${(0,i.o)(l)} gwei`,maxFeePerGas:void 0!==u&&`${(0,i.o)(u)} gwei`,maxPriorityFeePerGas:void 0!==d&&`${(0,i.o)(d)} gwei`,nonce:h})].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class u extends o.G{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:i}){let o="Transaction";r&&void 0!==i&&(o=`Transaction at block time "${r}" at index "${i}"`),e&&void 0!==i&&(o=`Transaction at block hash "${e}" at index "${i}"`),t&&void 0!==i&&(o=`Transaction at block number "${t}" at index "${i}"`),n&&(o=`Transaction with hash "${n}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class d extends o.G{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class h extends o.G{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}},65460:function(e,t,r){"use strict";r.d(t,{C:function(){return n},G:function(){return i}});let n=e=>e,i=e=>e},78774:function(e,t,r){"use strict";r.d(t,{r:function(){return g}});var n=r(87196),i=r(74823),o=r(26674),s=r(80205),a=r(57418),c=r(50875),l=r(23743),u=r(96274),d=r(72490);function h(e,t={}){void 0!==t.size&&(0,u.Yf)(e,{size:t.size});let r=(0,d.ci)(e,t);return(0,u.ly)(r,t)}var p=r(3293),f=r(98814);function g(e,t){let r="string"==typeof t?(0,p.nr)(t):t,g=(0,o.q)(r);if(0===(0,s.d)(r)&&e.length>0)throw new n.wb;if((0,s.d)(t)&&32>(0,s.d)(t))throw new n.xB({data:"string"==typeof t?t:(0,d.ci)(t),params:e,size:(0,s.d)(t)});let y=0,b=[];for(let t=0;t<e.length;++t){let r=e[t];g.setPosition(y);let[o,s]=function e(t,r,{staticPosition:o}){let s=(0,f.S)(r.type);if(s){let[n,i]=s;return function(t,r,{length:n,staticPosition:i}){if(!n){let n=i+h(t.readBytes(32)),o=n+32;t.setPosition(n);let s=h(t.readBytes(32)),a=m(r),c=0,l=[];for(let n=0;n<s;++n){t.setPosition(o+(a?32*n:c));let[i,s]=e(t,r,{staticPosition:o});c+=s,l.push(i)}return t.setPosition(i+32),[l,32]}if(m(r)){let o=i+h(t.readBytes(32)),s=[];for(let i=0;i<n;++i){t.setPosition(o+32*i);let[n]=e(t,r,{staticPosition:o});s.push(n)}return t.setPosition(i+32),[s,32]}let o=0,s=[];for(let a=0;a<n;++a){let[n,a]=e(t,r,{staticPosition:i+o});o+=a,s.push(n)}return[s,o]}(t,{...r,type:i},{length:n,staticPosition:o})}if("tuple"===r.type)return function(t,r,{staticPosition:n}){let i=0===r.components.length||r.components.some(({name:e})=>!e),o=i?[]:{},s=0;if(m(r)){let a=n+h(t.readBytes(32));for(let n=0;n<r.components.length;++n){let c=r.components[n];t.setPosition(a+s);let[l,u]=e(t,c,{staticPosition:a});s+=u,o[i?n:c?.name]=l}return t.setPosition(n+32),[o,32]}for(let a=0;a<r.components.length;++a){let c=r.components[a],[l,u]=e(t,c,{staticPosition:n});o[i?a:c?.name]=l,s+=u}return[o,s]}(t,r,{staticPosition:o});if("address"===r.type)return function(e){let t=e.readBytes(32);return[(0,i.x)((0,d.ci)((0,a.T4)(t,-20))),32]}(t);if("bool"===r.type)return[function(e,t={}){let r=e;if(void 0!==t.size&&((0,u.Yf)(r,{size:t.size}),r=(0,c.f)(r)),r.length>1||r[0]>1)throw new l.yr(r);return!!r[0]}(t.readBytes(32),{size:32}),32];if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=h(e.readBytes(32));e.setPosition(r+t);let n=h(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[(0,d.ci)(i),32]}return[(0,d.ci)(e.readBytes(Number.parseInt(i,10),32)),32]}(t,r,{staticPosition:o});if(r.type.startsWith("uint")||r.type.startsWith("int"))return function(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),i=e.readBytes(32);return[n>48?function(e,t={}){void 0!==t.size&&(0,u.Yf)(e,{size:t.size});let r=(0,d.ci)(e,t);return(0,u.y_)(r,t)}(i,{signed:r}):h(i,{signed:r}),32]}(t,r);if("string"===r.type)return function(e,{staticPosition:t}){let r=h(e.readBytes(32));e.setPosition(t+r);let n=h(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=e.readBytes(n,32),o=function(e,t={}){let r=e;return void 0!==t.size&&((0,u.Yf)(r,{size:t.size}),r=(0,c.f)(r,{dir:"right"})),new TextDecoder().decode(r)}((0,c.f)(i));return e.setPosition(t+32),[o,32]}(t,{staticPosition:o});throw new n.CI(r.type,{docsPath:"/docs/contract/decodeAbiParameters"})}(g,r,{staticPosition:0});y+=s,b.push(o)}return b}function m(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;
vendor: 8,754 bytes, line 7143
7143if("tuple"===t)return e.components?.some(m);let r=(0,f.S)(e.type);return!!(r&&m({...e,type:r[1]}))}},17753:function(e,t,r){"use strict";r.d(t,{p:function(){return l}});var n=r(59303),i=r(87196),o=r(57418),s=r(81674),a=r(78774),c=r(521);function l(e){let{abi:t,data:r}=e,l=(0,o.tP)(r,0,4);if("0x"===l)throw new i.wb;let u=[...t||[],n.Up,n.hZ].find(e=>"error"===e.type&&l===(0,s.C)((0,c.t)(e)));if(!u)throw new i.yP(l,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:u,args:"inputs"in u&&u.inputs&&u.inputs.length>0?(0,a.r)(u.inputs,(0,o.tP)(r,4)):void 0,errorName:u.name}}},27854:function(e,t,r){"use strict";r.d(t,{F:function(){return u}});var n=r(87196),i=r(88689),o=r(80205),s=r(99552),a=r(78774),c=r(521);let l="/docs/contract/decodeEventLog";function u(e){let{abi:t,data:r,strict:u,topics:d}=e,h=u??!0,[p,...f]=d;if(!p)throw new n.FM({docsPath:l});let g=t.find(e=>"event"===e.type&&p===(0,s.n)((0,c.t)(e)));if(!(g&&"name"in g)||"event"!==g.type)throw new n.lC(p,{docsPath:l});let{name:m,inputs:y}=g,b=y?.some(e=>!("name"in e&&e.name)),w=b?[]:{},v=y.map((e,t)=>[e,t]).filter(([e])=>"indexed"in e&&e.indexed);for(let e=0;e<v.length;e++){let[t,r]=v[e],i=f[e];if(!i)throw new n.Gy({abiItem:g,param:t});w[b?r:t.name||r]=function({param:e,value:t}){return"string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,a.r)([e],t)||[])[0]}({param:t,value:i})}let C=y.filter(e=>!("indexed"in e&&e.indexed));if(C.length>0){if(r&&"0x"!==r)try{let e=(0,a.r)(C,r);if(e){if(b)for(let t=0;t<y.length;t++)w[t]=w[t]??e.shift();else for(let t=0;t<C.length;t++)w[C[t].name]=e[t]}}catch(e){if(h){if(e instanceof n.xB||e instanceof i.lQ)throw new n.SM({abiItem:g,data:r,params:C,size:(0,o.d)(r)});throw e}}else if(h)throw new n.SM({abiItem:g,data:"0x",params:C,size:0})}return{eventName:m,args:Object.values(w).length>0?w:void 0}}},97349:function(e,t,r){"use strict";r.d(t,{p:function(){return c}});var n=r(87196),i=r(57418),o=r(81674),s=r(78774),a=r(521);function c(e){let{abi:t,data:r}=e,c=(0,i.tP)(r,0,4),l=t.find(e=>"function"===e.type&&c===(0,o.C)((0,a.t)(e)));if(!l)throw new n.eF(c,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:l.name,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,s.r)(l.inputs,(0,i.tP)(r,4)):void 0}}},75669:function(e,t,r){"use strict";r.d(t,{k:function(){return a}});var n=r(87196),i=r(78774),o=r(27698);let s="/docs/contract/decodeFunctionResult";function a(e){let{abi:t,args:r,functionName:a,data:c}=e,l=t[0];if(a){let e=(0,o.mE)({abi:t,args:r,name:a});if(!e)throw new n.xL(a,{docsPath:s});l=e}if("function"!==l.type)throw new n.xL(void 0,{docsPath:s});if(!l.outputs)throw new n.MX(l.name,{docsPath:s});let u=(0,i.r)(l.outputs,c);return u&&u.length>1?u:u&&1===u.length?u[0]:void 0}},98814:function(e,t,r){"use strict";r.d(t,{E:function(){return f},S:function(){return m}});var n=r(87196),i=r(79364),o=r(55166),s=r(23743),a=r(76259),c=r(16340),l=r(67788),u=r(80205),d=r(57418),h=r(72490),p=r(50877);function f(e,t){if(e.length!==t.length)throw new n.fs({expectedLength:e.length,givenLength:t.length});let r=g(function({params:e,values:t}){let r=[];for(let f=0;f<e.length;f++)r.push(function e({param:t,value:r}){let f=m(t.type);if(f){let[i,o]=f;return function(t,{length:r,param:i}){let o=null===r;if(!Array.isArray(t))throw new n.hn(t);if(!o&&t.length!==r)throw new n.gr({expectedLength:r,givenLength:t.length,type:`${i.type}[${r}]`});let s=!1,a=[];for(let r=0;r<t.length;r++){let n=e({param:i,value:t[r]});n.dynamic&&(s=!0),a.push(n)}if(o||s){let e=g(a);if(o){let t=(0,h.eC)(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?(0,c.zo)([t,e]):t}}if(s)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,c.zo)(a.map(({encoded:e})=>e))}}(r,{length:i,param:{...t,type:o}})}if("tuple"===t.type)return function(t,{param:r}){let n=!1,i=[];for(let o=0;o<r.components.length;o++){let s=r.components[o],a=Array.isArray(t)?o:s.name,c=e({param:s,value:t[a]});i.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?g(i):(0,c.zo)(i.map(({encoded:e})=>e))}}(r,{param:t});if("address"===t.type)return function(e){if(!(0,a.U)(e))throw new i.b({address:e});return{dynamic:!1,encoded:(0,l.gc)(e.toLowerCase())}}(r);if("bool"===t.type)return function(e){if("boolean"!=typeof e)throw new o.G(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,l.gc)((0,h.C4)(e))}}(r);if(t.type.startsWith("uint")||t.type.startsWith("int")){let e=t.type.startsWith("int"),[,,n="256"]=p.lh.exec(t.type)??[];return function(e,{signed:t,size:r=256}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new s.J5({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:(0,h.eC)(e,{size:32,signed:t})}}(r,{signed:e,size:Number(n)})}if(t.type.startsWith("bytes"))return function(e,{param:t}){let[,r]=t.type.split("bytes"),i=(0,u.d)(e);if(!r){let t=e;return i%32!=0&&(t=(0,l.gc)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,c.zo)([(0,l.gc)((0,h.eC)(i,{size:32})),t])}}if(i!==Number.parseInt(r,10))throw new n.M4({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:(0,l.gc)(e,{dir:"right"})}}(r,{param:t});if("string"===t.type)return function(e){let t=(0,h.$G)(e),r=Math.ceil((0,u.d)(t)/32),n=[];for(let e=0;e<r;e++)n.push((0,l.gc)((0,d.tP)(t,32*e,(e+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,c.zo)([(0,l.gc)((0,h.eC)((0,u.d)(t),{size:32})),...n])}}(r);throw new n.dh(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}({param:e[f],value:t[f]}));return r}({params:e,values:t}));return 0===r.length?"0x":r}function g(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=(0,u.d)(i)}let r=[],n=[],i=0;for(let o=0;o<e.length;o++){let{dynamic:s,encoded:a}=e[o];s?(r.push((0,h.eC)(t+i,{size:32})),n.push(a),i+=(0,u.d)(a)):r.push(a)}return(0,c.zo)([...r,...n])}function m(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}},88401:function(e,t,r){"use strict";r.d(t,{w:function(){return a}});var n=r(87196),i=r(16340),o=r(98814);let s="/docs/contract/encodeDeployData";function a(e){let{abi:t,args:r,bytecode:a}=e;if(!r||0===r.length)return a;let c=t.find(e=>"type"in e&&"constructor"===e.type);if(!c)throw new n.fM({docsPath:s});if(!("inputs"in c)||!c.inputs||0===c.inputs.length)throw new n.cO({docsPath:s});let l=(0,o.E)(c.inputs,r);return(0,i.SM)([a,l])}},73924:function(e,t,r){"use strict";r.d(t,{R:function(){return u}});var n=r(16340),i=r(98814),o=r(87196),s=r(81674),a=r(521),c=r(27698);let l="/docs/contract/encodeFunctionData";function u(e){let{args:t}=e,{abi:r,functionName:u}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){let{abi:t,args:r,functionName:n}=e,i=t[0];if(n){let e=(0,c.mE)({abi:t,args:r,name:n});if(!e)throw new o.xL(n,{docsPath:l});i=e}if("function"!==i.type)throw new o.xL(void 0,{docsPath:l});return{abi:[i],functionName:(0,s.C)((0,a.t)(i))}}(e),d=r[0],h="inputs"in d&&d.inputs?(0,i.E)(d.inputs,t??[]):void 0;return(0,n.SM)([u,h??"0x"])}},521:function(e,t,r){"use strict";r.d(t,{h:function(){return o},t:function(){return i}});var n=r(87196);function i(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new n.wM(e.type);return`${e.name}(${o(e.inputs,{includeName:t})})`}function o(e,{includeName:t=!1}={}){return e?e.map(e=>(function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${o(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")})(e,{includeName:t})).join(t?", ":","):""}},27698:function(e,t,r){"use strict";r.d(t,{mE:function(){return c}});var n=r(87196),i=r(9326),o=r(76259),s=r(99552),a=r(81674);function c(e){let t;let{abi:r,args:c=[],name:l}=e,u=(0,i.v)(l,{strict:!1}),d=r.filter(e=>u?"function"===e.type?(0,a.C)(e)===l:"event"===e.type&&(0,s.n)(e)===l:"name"in e&&e.name===l);if(0!==d.length){if(1===d.length)return d[0];for(let e of d)if("inputs"in e){if(!c||0===c.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(e.inputs&&0!==e.inputs.length&&e.inputs.length===c.length&&c.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return(0,o.U)(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,n)=>e(Object.values(t)[n],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;
vendor: 15,254 bytes, line 7143
7143if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(t&&"inputs"in t&&t.inputs){let r=function e(t,r,n){for(let i in t){let s=t[i],a=r[i];if("tuple"===s.type&&"tuple"===a.type&&"components"in s&&"components"in a)return e(s.components,a.components,n[i]);let c=[s.type,a.type];if(c.includes("address")&&c.includes("bytes20")||(c.includes("address")&&c.includes("string")||c.includes("address")&&c.includes("bytes"))&&(0,o.U)(n[i],{strict:!1}))return c}}(e.inputs,t.inputs,c);if(r)throw new n.S4({abiItem:e,type:r[0]},{abiItem:t,type:r[1]})}t=e}}return t||d[0]}}},56580:function(e,t,r){"use strict";r.d(t,{h:function(){return l}});var n=r(87196),i=r(54639),o=r(3293),s=r(31416),a=r(99552),c=r(27854);function l(e){let{abi:t,args:r,logs:l,strict:u=!0}=e,d=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return l.map(e=>{try{let n=t.find(t=>"event"===t.type&&e.topics[0]===(0,a.n)(t));if(!n)return null;let l=(0,c.F)({...e,abi:[n],strict:u});if(d&&!d.includes(l.eventName)||!function(e){let{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function a(e,t,r){try{if("address"===e.type)return(0,i.E)(t,r);if("string"===e.type||"bytes"===e.type)return(0,s.w)((0,o.O0)(t))===r;return t===r}catch{return!1}}return Array.isArray(t)&&Array.isArray(n)?n.every((e,n)=>{if(null==e)return!0;let i=r[n];return!!i&&(Array.isArray(e)?e:[e]).some(e=>a(i,e,t[n]))}):!("object"!=typeof t||Array.isArray(t)||"object"!=typeof n||Array.isArray(n))&&Object.entries(n).every(([e,n])=>{if(null==n)return!0;let i=r.find(t=>t.name===e);return!!i&&(Array.isArray(n)?n:[n]).some(r=>a(i,r,t[e]))})}({args:l.args,inputs:n.inputs,matchArgs:r}))return null;return{...l,...e}}catch(i){let t,r;if(i instanceof n.lC)return null;if(i instanceof n.SM||i instanceof n.Gy){if(u)return null;t=i.abiItem.name,r=i.abiItem.inputs?.some(e=>!("name"in e&&e.name))}return{...e,args:r?[]:{},eventName:t}}}).filter(Boolean)}},74823:function(e,t,r){"use strict";r.d(t,{K:function(){return u},x:function(){return l}});var n=r(79364),i=r(3293),o=r(31416),s=r(83018),a=r(76259);let c=new s.k(8192);function l(e,t){if(c.has(`${e}.${t}`))return c.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,o.w)((0,i.qX)(r),"bytes"),s=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&n[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());let a=`0x${s.join("")}`;return c.set(`${e}.${t}`,a),a}function u(e,t){if(!(0,a.U)(e,{strict:!1}))throw new n.b({address:e});return l(e,t)}},76259:function(e,t,r){"use strict";r.d(t,{U:function(){return a}});var n=r(83018),i=r(74823);let o=/^0x[a-fA-F0-9]{40}$/,s=new n.k(8192);function a(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(s.has(n))return s.get(n);let a=!!o.test(e)&&(e.toLowerCase()===e||!r||(0,i.x)(e)===e);return s.set(n,a),a}},54639:function(e,t,r){"use strict";r.d(t,{E:function(){return o}});var n=r(79364),i=r(76259);function o(e,t){if(!(0,i.U)(e,{strict:!1}))throw new n.b({address:e});if(!(0,i.U)(t,{strict:!1}))throw new n.b({address:t});return e.toLowerCase()===t.toLowerCase()}},46967:function(e,t,r){"use strict";r.d(t,{z:function(){return d}});var n=r(55729),i=r(16340),o=r(3293),s=r(72490),a=r(55166),c=r(26674);function l(e){if(e<256)return 1;if(e<65536)return 2;if(e<16777216)return 3;if(e<4294967296)return 4;throw new a.G("Length is too large.")}var u=r(31416);async function d(e){let{authorization:t,signature:r}=e;return(0,n.R)({hash:function(e){let{chainId:t,nonce:r,to:n}=e,a=e.contractAddress??e.address,d=(0,u.w)((0,i.SM)(["0x05",function(e,t="hex"){let r=function e(t){return Array.isArray(t)?function(e){let t=e.reduce((e,t)=>e+t.length,0),r=l(t);return{length:t<=55?1+t:1+r+t,encode(n){for(let{encode:i}of(t<=55?n.pushByte(192+t):(n.pushByte(247+r),1===r?n.pushUint8(t):2===r?n.pushUint16(t):3===r?n.pushUint24(t):n.pushUint32(t)),e))i(n)}}}(t.map(t=>e(t))):function(e){let t="string"==typeof e?(0,o.nr)(e):e,r=l(t.length);return{length:1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(e){1===t.length&&t[0]<128||(t.length<=55?e.pushByte(128+t.length):(e.pushByte(183+r),1===r?e.pushUint8(t.length):2===r?e.pushUint16(t.length):3===r?e.pushUint24(t.length):e.pushUint32(t.length))),e.pushBytes(t)}}}(t)}(e),n=(0,c.q)(new Uint8Array(r.length));return(r.encode(n),"hex"===t)?(0,s.ci)(n.bytes):n.bytes}([t?(0,s.eC)(t):"0x",a,r?(0,s.eC)(r):"0x"])]));return"bytes"===n?(0,o.nr)(d):d}(t),signature:r??t})}},86278:function(e,t,r){"use strict";function n(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}r.d(t,{a:function(){return n}})},29176:function(e,t,r){"use strict";r.d(t,{L:function(){return i}});var n=r(11598);function i({blockNumber:e,chain:t,contract:r}){let i=t?.contracts?.[r];if(!i)throw new n.mm({chain:t,contract:{name:r}});if(e&&i.blockCreated&&i.blockCreated>e)throw new n.mm({blockNumber:e,chain:t,contract:{name:r,blockCreated:i.blockCreated}});return i.address}},26674:function(e,t,r){"use strict";r.d(t,{q:function(){return o}});var n=r(88689);let i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new n.KD({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new n.lQ({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new n.T_({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new n.T_({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function o(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(i);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}},16340:function(e,t,r){"use strict";function n(e){return"string"==typeof e[0]?i(e):function(e){let t=0;for(let r of e)t+=r.length;let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}(e)}function i(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}r.d(t,{SM:function(){return i},zo:function(){return n}})},9326:function(e,t,r){"use strict";function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}r.d(t,{v:function(){return n}})},67788:function(e,t,r){"use strict";r.d(t,{gc:function(){return o},vk:function(){return i}});var n=r(9511);function i(e,{dir:t,size:r=32}={}){return"string"==typeof e?o(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.$s({size:e.length,targetSize:r,type:"bytes"});let i=new Uint8Array(r);for(let n=0;n<r;n++){let o="right"===t;i[o?n:r-n-1]=e[o?n:e.length-n-1]}return i}(e,{dir:t,size:r})}function o(e,{dir:t,size:r=32}={}){if(null===r)return e;let i=e.replace("0x","");if(i.length>2*r)throw new n.$s({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*r,"0")}`}},80205:function(e,t,r){"use strict";r.d(t,{d:function(){return i}});var n=r(9326);function i(e){return(0,n.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},57418:function(e,t,r){"use strict";r.d(t,{T4:function(){return l},p5:function(){return u},tP:function(){return s}});var n=r(9511),i=r(9326),o=r(80205);function s(e,t,r,{strict:n}={}){return(0,i.v)(e,{strict:!1})?u(e,t,r,{strict:n}):l(e,t,r,{strict:n})}function a(e,t){if("number"==typeof t&&t>0&&t>(0,o.d)(e)-1)throw new n.mV({offset:t,position:"start",size:(0,o.d)(e)})}function c(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,o.d)(e)!==r-t)throw new n.mV({offset:r,position:"end",size:(0,o.d)(e)})}function l(e,t,r,{strict:n}={}){a(e,t);let i=e.slice(t,r);return n&&c(i,t,r),i}function u(e,t,r,{strict:n}={}){a(e,t);let i=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&c(i,t,r),i}},50875:function(e,t,r){"use strict";function n(e,{dir:t="left"}={}){let r="string"==typeof e?e.replace("0x",""):e,n=0;for(let e=0;e<r.length-1&&"0"===r["left"===t?e:r.length-e-1].toString();e++)n++;return(r="left"===t?r.slice(n):r.slice(0,r.length-n),"string"==typeof e)?(1===r.length&&"right"===t&&(r=`${r}0`),`0x${r.length%2==1?`0${r}`:r}`):r}r.d(t,{f:function(){return n}})},96274:function(e,t,r){"use strict";r.d(t,{XA:function(){return l},Yf:function(){return a},ly:function(){return u},rR:function(){return d},y_:function(){return c}});var n=r(23743),i=r(80205),o=r(50875),s=r(3293);function a(e,{size:t}){if((0,i.d)(e)>t)throw new n.M6({givenSize:(0,i.d)(e),maxSize:t})}function c(e,t={}){let{signed:r}=t;t.size&&a(e,{size:t.size});let n=BigInt(e);if(!r)return n;let i=(e.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function l(e,t={}){let r=e;if(t.size&&(a(r,{size:t.size}),r=(0,o.f)(r)),"0x00"===(0,o.f)(r))return!1;if("0x01"===(0,o.f)(r))return!0;throw new n.Cd(r)}function u(e,t={}){return Number(c(e,t))}function d(e,t={}){let r=(0,s.nr)(e);return t.size&&(a(r,{size:t.size}),r=(0,o.f)(r,{dir:"right"})),new TextDecoder().decode(r)}},3293:function(e,t,r){"use strict";r.d(t,{O0:function(){return l},nr:function(){return h},qX:function(){return p}});var n=r(55166),i=r(9326),o=r(67788),s=r(96274),a=r(72490);let c=new TextEncoder;function l(e,t={}){return"number"==typeof e||"bigint"==typeof e?h((0,a.eC)(e,t)):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?((0,s.Yf)(r,{size:t.size}),(0,o.vk)(r,{size:t.size})):r}(e,t):(0,i.v)(e)?h(e,t):p(e,t)}let u={zero:48,nine:57,A:65,F:70,a:97,f:102};function d(e){return e>=u.zero&&e<=u.nine?e-u.zero:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function h(e,t={}){let r=e;t.size&&((0,s.Yf)(r,{size:t.size}),r=(0,o.vk)(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);let a=i.length/2,c=new Uint8Array(a);for(let e=0,t=0;e<a;e++){let r=d(i.charCodeAt(t++)),o=d(i.charCodeAt(t++));if(void 0===r||void 0===o)throw new n.G(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);c[e]=16*r+o}return c}function p(e,t={}){let r=c.encode(e);return"number"==typeof t.size?((0,s.Yf)(r,{size:t.size}),(0,o.vk)(r,{dir:"right",size:t.size})):r}},72490:function(e,t,r){"use strict";r.d(t,{$G:function(){return h},C4:function(){return c},NC:function(){return a},ci:function(){return l},eC:function(){return u}});var n=r(23743),i=r(67788),o=r(96274);let s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?u(e,t):"string"==typeof e?h(e,t):"boolean"==typeof e?c(e,t):l(e,t)}function c(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?((0,o.Yf)(r,{size:t.size}),(0,i.vk)(r,{size:t.size})):r}function l(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=s[e[t]];let n=`0x${r}`;return"number"==typeof t.size?((0,o.Yf)(n,{size:t.size}),(0,i.vk)(n,{dir:"right",size:t.size})):n}function u(e,t={}){let r;let{signed:o,size:s}=t,a=BigInt(e);s?r=o?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let c="bigint"==typeof r&&o?-r-1n:0;if(r&&a>r||a<c){let t="bigint"==typeof e?"n":"";throw new n.J5({max:r?`${r}${t}`:void 0,min:`${c}${t}`,signed:o,size:s,value:`${e}${t}`})}let l=`0x${(o&&a<0?(1n<<BigInt(8*s))+BigInt(a):a).toString(16)}`;return s?(0,i.vk)(l,{size:s}):l}let d=new TextEncoder;function h(e,t={}){return l(d.encode(e),t)}},55001:function(e,t,r){"use strict";r.d(t,{w:function(){return m},M:function(){return g}});var n=r(98687),i=r(59303),o=r(97349),s=r(87196),a=r(16340),c=r(81674),l=r(98814),u=r(521),d=r(27698);let h="/docs/contract/encodeErrorResult";function p(e){let{abi:t,errorName:r,args:n}=e,i=t[0];if(r){let e=(0,d.mE)({abi:t,args:n,name:r});if(!e)throw new s.MS(r,{docsPath:h});i=e}if("error"!==i.type)throw new s.MS(void 0,{docsPath:h});let o=(0,u.t)(i),p=(0,c.C)(o),f="0x";if(n&&n.length>0){if(!i.inputs)throw new s.Zh(i.name,{docsPath:h});f=(0,l.E)(i.inputs,n)}return(0,a.SM)([p,f])}let f="/docs/contract/encodeFunctionResult",g="x-batch-gateway:true";async function m(e){let{data:t,ccipRequest:r}=e,{args:[a]}=(0,o.p)({abi:n.Yi,data:t}),c=[],u=[];return await Promise.all(a.map(async(e,t)=>{try{u[t]=e.urls.includes(g)?await m({data:e.data,ccipRequest:r}):await r(e),c[t]=!1}catch(e){c[t]=!0,u[t]="HttpRequestError"===e.name&&e.status?p({abi:n.Yi,errorName:"HttpError",args:[e.status,e.shortMessage]}):p({abi:[i.Up],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}})),function(e){let{abi:t,functionName:r,result:n}=e,i=t[0];if(r){let e=(0,d.mE)({abi:t,name:r});if(!e)throw new s.xL(r,{docsPath:f});i=e}if("function"!==i.type)throw new s.xL(void 0,{docsPath:f});if(!i.outputs)throw new s.MX(i.name,{docsPath:f});let o=(()=>
7143{if(0===i.outputs.length)return[];if(1===i.outputs.length)return[n];if(Array.isArray(n))return n;throw new s.hn(n)})();return(0,l.E)(i.outputs,o)}({abi:n.Yi,functionName:"query",result:[c,u]})}},29070:function(e,t,r){"use strict";r.d(t,{P:function(){return s}});var n=r(57903),i=r(88002),o=r(74282);function s(e,{docsPath:t,...r}){let s=(()=>{let t=(0,o.k)(e,r);return t instanceof i.cj?e:t})();return new n.cg(s,{docsPath:t,...r})}},66574:function(e,t,r){"use strict";r.d(t,{S:function(){return c}});var n=r(87196),i=r(55166),o=r(57903),s=r(5130),a=r(78612);function c(e,{abi:t,address:r,args:c,docsPath:l,functionName:u,sender:d}){let h=e instanceof o.VQ?e:e instanceof i.G?e.walk(e=>"data"in e)||e.walk():{},{code:p,data:f,details:g,message:m,shortMessage:y}=h,b=e instanceof n.wb?new o.Dk({functionName:u}):[3,a.XS.code].includes(p)&&(f||g||m||y)?new o.Lu({abi:t,data:"object"==typeof f?f.data:f,functionName:u,message:h instanceof s.bs?g:y??m}):e;return new o.uq(b,{abi:t,args:c,contractAddress:r,docsPath:l,functionName:u,sender:d})}},74282:function(e,t,r){"use strict";r.d(t,{k:function(){return o}});var n=r(55166),i=r(88002);function o(e,t){let r=(e.details||"").toLowerCase(),o=e instanceof n.G?e.walk(e=>e?.code===i.M_.code):e;return o instanceof n.G?new i.M_({cause:e,message:o.details}):i.M_.nodeMessage.test(r)?new i.M_({cause:e,message:e.details}):i.Hh.nodeMessage.test(r)?new i.Hh({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.G$.nodeMessage.test(r)?new i.G$({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.ZI.nodeMessage.test(r)?new i.ZI({cause:e,nonce:t?.nonce}):i.vU.nodeMessage.test(r)?new i.vU({cause:e,nonce:t?.nonce}):i.se.nodeMessage.test(r)?new i.se({cause:e,nonce:t?.nonce}):i.C_.nodeMessage.test(r)?new i.C_({cause:e}):i.WF.nodeMessage.test(r)?new i.WF({cause:e,gas:t?.gas}):i.dR.nodeMessage.test(r)?new i.dR({cause:e,gas:t?.gas}):i.pZ.nodeMessage.test(r)?new i.pZ({cause:e}):i.cs.nodeMessage.test(r)?new i.cs({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new i.cj({cause:e})}},15571:function(e,t,r){"use strict";function n(e,{method:t}){let r={};return"fallback"===e.transport.type&&e.transport.onResponse?.(({method:e,response:n,status:i,transport:o})=>{"success"===i&&t===e&&(r[n]=o.request)}),t=>r[t]||e.request}r.d(t,{g:function(){return n}})},39047:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(77076);function i(e){let t=(e.transactions??[]).map(e=>"string"==typeof e?e:(0,n.Tr)(e));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}},43813:function(e,t,r){"use strict";function n(e,{format:t}){if(!t)return{};let r={};return!function t(n){for(let i of Object.keys(n))i in e&&(r[i]=e[i]),n[i]&&"object"==typeof n[i]&&!Array.isArray(n[i])&&t(n[i])}(t(e||{})),r}r.d(t,{K:function(){return n}})},53619:function(e,t,r){"use strict";function n(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}r.d(t,{U:function(){return n}})},77076:function(e,t,r){"use strict";r.d(t,{Tr:function(){return o},c8:function(){return i}});var n=r(96274);let i={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function o(e){let t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?(0,n.ly)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,n.ly)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?i[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(t.authorizationList=e.authorizationList.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))),t.yParity=(()=>
7143{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}},53406:function(e,t,r){"use strict";r.d(t,{ew:function(){return s},fA:function(){return a}});var n=r(96274),i=r(53619),o=r(77076);let s={"0x0":"reverted","0x1":"success"};function a(e){let t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>(0,i.U)(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,n.ly)(e.transactionIndex):null,status:e.status?s[e.status]:null,type:e.type?o.c8[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}},23605:function(e,t,r){"use strict";r.d(t,{tG:function(){return o}});var n=r(72490);let i={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function o(e){let t={};return void 0!==e.authorizationList&&(t.authorizationList=e.authorizationList.map(e=>({address:e.address,r:e.r?(0,n.eC)(BigInt(e.r)):e.r,s:e.s?(0,n.eC)(BigInt(e.s)):e.s,chainId:(0,n.eC)(e.chainId),nonce:(0,n.eC)(e.nonce),...void 0!==e.yParity?{yParity:(0,n.eC)(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:(0,n.eC)(e.v)}:{}}))),void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?t.blobs=e.blobs.map(e=>(0,n.ci)(e)):t.blobs=e.blobs),void 0!==e.data&&(t.data=e.data),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=(0,n.eC)(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=(0,n.eC)(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=(0,n.eC)(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=(0,n.eC)(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=(0,n.eC)(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=(0,n.eC)(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=i[e.type]),void 0!==e.value&&(t.value=(0,n.eC)(e.value)),t}},47429:function(e,t,r){"use strict";function n(e,t,r){let n=e[t.name];if("function"==typeof n)return n;let i=e[r];return"function"==typeof i?i:r=>t(e,r)}r.d(t,{s:function(){return n}})},31416:function(e,t,r){"use strict";r.d(t,{w:function(){return a}});var n=r(85641),i=r(9326),o=r(3293),s=r(72490);function a(e,t){let r=(0,n.fr)((0,i.v)(e,{strict:!1})?(0,o.O0)(e):e);return"bytes"===(t||"hex")?r:(0,s.NC)(r)}},99552:function(e,t,r){"use strict";r.d(t,{n:function(){return n}});let n=r(80937).r},81674:function(e,t,r){"use strict";r.d(t,{C:function(){return o}});var n=r(57418),i=r(80937);let o=e=>(0,n.tP)((0,i.r)(e),0,4)},80937:function(e,t,r){"use strict";r.d(t,{r:function(){return l}});var n=r(3293),i=r(31416);let o=e=>(0,i.w)((0,n.O0)(e));var s=r(1330),a=r(55166);let c=e=>(function(e){let t=!0,r="",n=0,i="",o=!1;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a)&&(t=!0),"("===a&&n++,")"===a&&n--,t){if(0===n){if(" "===a&&["event","function",""].includes(i))i="";else if(i+=a,")"===a){o=!0;break}continue}if(" "===a){","!==e[s-1]&&","!==r&&",("!==r&&(r="",t=!1);continue}i+=a,r+=a}}if(!o)throw new a.G("Unable to normalize signature.");return i})("string"==typeof e?e:(0,s.t)(e));function l(e){return o(c(e))}},83018:function(e,t,r){"use strict";r.d(t,{k:function(){return n}});class n extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}},48478:function(e,t,r){"use strict";r.d(t,{N7:function(){return s}});let n=new Map,i=new Map,o=0;function s(e,t,r){let s=++o,a=()=>n.get(e)||[],c=()=>{let t=a();n.set(e,t.filter(e=>e.id!==s))},l=()=>{let t=a();if(!t.some(e=>e.id===s))return;let r=i.get(e);if(1===t.length&&r){let e=r();e instanceof Promise&&e.catch(()=>{})}c()},u=a();if(n.set(e,[...u,{id:s,fns:t}]),u&&u.length>0)return l;let d={};for(let e in t)d[e]=(...t)=>{let r=a();if(0!==r.length)for(let n of r)n.fns[e]?.(...t)};let h=r(d);return"function"==typeof h&&i.set(e,h),l}},60252:function(e,t,r){"use strict";r.d(t,{$:function(){return i}});var n=r(46611);function i(e,{emitOnBegin:t,initialWaitTime:r,interval:i}){let o=!0,s=()=>o=!1;return(async()=>{let a;t&&(a=await e({unpoll:s}));let c=await r?.(a)??i;await (0,n.D)(c);let l=async()=>{o&&(await e({unpoll:s}),await (0,n.D)(i),l())};l()})(),s}},65215:function(e,t,r){"use strict";r.d(t,{S:function(){return o}});var n=r(66353);let i=new Map;function o({fn:e,id:t,shouldSplitBatch:r,wait:o=0,sort:s}){let a=async()=>{let t=u();c();let r=t.map(({args:e})=>e);0!==r.length&&e(r).then(e=>{s&&Array.isArray(e)&&e.sort(s);for(let r=0;r<t.length;r++){let{resolve:n}=t[r];n?.([e[r],e])}}).catch(e=>{for(let r=0;r<t.length;r++){let{reject:n}=t[r];n?.(e)}})},c=()=>i.delete(t),l=()=>u().map(({args:e})=>e),u=()=>i.get(t)||[],d=e=>i.set(t,[...u(),e]);return{flush:c,async schedule(e){let{promise:t,resolve:i,reject:s}=(0,n.n)();return(r?.([...l(),e])&&a(),u().length>0)?d({args:e,resolve:i,reject:s}):(d({args:e,resolve:i,reject:s}),setTimeout(a,o)),t}}}},66353:function(e,t,r){"use strict";function n(){let e=()=>void 0,t=()=>void 0;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}r.d(t,{n:function(){return n}})},85889:function(e,t,r){"use strict";r.d(t,{J:function(){return i}});var n=r(46611);function i(e,{delay:t=100,retryCount:r=2,shouldRetry:i=()=>!0}={}){return new Promise((o,s)=>{let a=async({count:c=0}={})=>{let l=async({error:e})=>{let r="function"==typeof t?t({count:c,error:e}):t;r&&await (0,n.D)(r),a({count:c+1})};try{let t=await e();o(t)}catch(e){if(c<r&&await i({count:c,error:e}))return l({error:e});s(e)}};a()})}},46:function(e,t,r){"use strict";function n(e,{errorInstance:t=Error("timed out"),timeout:r,signal:n}){return new Promise((i,o)=>{(async()=>{let s;try{let a=new AbortController;r>0&&(s=setTimeout(()=>{n?a.abort():o(t)},r)),i(await e({signal:a?.signal||null}))}catch(e){e?.name==="AbortError"&&o(t),o(e)}finally{clearTimeout(s)}})()})}r.d(t,{F:function(){return n}})},50877:function(e,t,r){"use strict";r.d(t,{Ow:function(){return n},eL:function(){return i},lh:function(){return o}});let n=/^(.*)\[([0-9]*)\]$/,i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,o=/^(u?int)(8|
vendor: 4,334 bytes, lines 7143-7144
714316|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/},51672:function(e,t,r){"use strict";r.d(t,{r:function(){return a}});var n=r(31416),i=r(16340),o=r(80205),s=r(72490);function a(e,t){return(0,n.w)(function(e){let t="string"==typeof e?(0,s.$G)(e):"string"==typeof e.raw?e.raw:(0,s.ci)(e.raw),r=(0,s.$G)(`\x19Ethereum Signed Message:
7144${(0,o.d)(t)}`);return(0,i.zo)([r,t])}(e),t)}},95111:function(e,t,r){"use strict";r.d(t,{Jv:function(){return y}});var n=r(98814),i=r(16340),o=r(72490),s=r(31416),a=r(87196),c=r(79364),l=r(25750),u=r(55166);class d extends u.G{constructor({domain:e}){super(`Invalid domain "${(0,l.P)(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class h extends u.G{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class p extends u.G{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}var f=r(76259),g=r(80205),m=r(50877);function y(e){let{domain:t={},message:r,primaryType:n}=e,l={EIP712Domain:function({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},("number"==typeof e?.chainId||"bigint"==typeof e?.chainId)&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}({domain:t}),...e.types};!function(e){let{domain:t,message:r,primaryType:n,types:i}=e,s=(e,t)=>{for(let r of e){let{name:e,type:n}=r,l=t[e],u=n.match(m.lh);if(u&&("number"==typeof l||"bigint"==typeof l)){let[e,t,r]=u;(0,o.eC)(l,{signed:"int"===t,size:Number.parseInt(r,10)/8})}if("address"===n&&"string"==typeof l&&!(0,f.U)(l))throw new c.b({address:l});let d=n.match(m.eL);if(d){let[e,t]=d;if(t&&(0,g.d)(l)!==Number.parseInt(t,10))throw new a.KY({expectedSize:Number.parseInt(t,10),givenSize:(0,g.d)(l)})}let h=i[n];h&&(function(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new p({type:e})}(n),s(h,l))}};if(i.EIP712Domain&&t){if("object"!=typeof t)throw new d({domain:t});s(i.EIP712Domain,t)}if("EIP712Domain"!==n){if(i[n])s(i[n],r);else throw new h({primaryType:n,types:i})}}({domain:t,message:r,primaryType:n,types:l});let u=["0x1901"];return t&&u.push(function({domain:e,types:t}){return b({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:l})),"EIP712Domain"!==n&&u.push(b({data:r,primaryType:n,types:l})),(0,s.w)((0,i.zo)(u))}function b({data:e,primaryType:t,types:r}){let i=function e({data:t,primaryType:r,types:i}){let a=[{type:"bytes32"}],c=[function({primaryType:e,types:t}){let r=(0,o.NC)(function({primaryType:e,types:t}){let r="",n=function e({primaryType:t,types:r},n=new Set){let i=t.match(/^\w*/u),o=i?.[0];if(n.has(o)||void 0===r[o])return n;for(let t of(n.add(o),r[o]))e({primaryType:t.type,types:r},n);return n}({primaryType:e,types:t});for(let i of(n.delete(e),[e,...Array.from(n).sort()]))r+=`${i}(${t[i].map(({name:e,type:t})=>`${t} ${e}`).join(",")})`;return r}({primaryType:e,types:t}));return(0,s.w)(r)}({primaryType:r,types:i})];for(let l of i[r]){let[r,u]=function t({types:r,name:i,type:a,value:c}){if(void 0!==r[a])return[{type:"bytes32"},(0,s.w)(e({data:c,primaryType:a,types:r}))];if("bytes"===a){let e=c.length%2?"0":"";return c=`0x${e+c.slice(2)}`,[{type:"bytes32"},(0,s.w)(c)]}if("string"===a)return[{type:"bytes32"},(0,s.w)((0,o.NC)(c))];if(a.lastIndexOf("]")===a.length-1){let e=a.slice(0,a.lastIndexOf("[")),o=c.map(n=>t({name:i,type:e,types:r,value:n}));return[{type:"bytes32"},(0,s.w)((0,n.E)(o.map(([e])=>e),o.map(([,e])=>e)))]}return[{type:a},c]}({types:i,name:l.name,type:l.type,value:t[l.name]});a.push(r),c.push(u)}return(0,n.E)(a,c)}({data:e,primaryType:t,types:r});return(0,s.w)(i)}},55729:function(e,t,r){"use strict";r.d(t,{R:function(){return d}});var n=r(74823),i=r(31416),o=r(9326),s=r(80205),a=r(96274),c=r(72490);async function l({hash:e,signature:t}){let n=(0,o.v)(e)?e:(0,c.NC)(e),{secp256k1:i}=await Promise.resolve().then(r.bind(r,53307)),l=(()=>
7144{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:r,v:n,yParity:o}=t,s=u(Number(o??n));return new i.Signature((0,a.y_)(e),(0,a.y_)(r)).addRecoveryBit(s)}let e=(0,o.v)(t)?t:(0,c.NC)(t);if(65!==(0,s.d)(e))throw Error("invalid signature length");let r=u((0,a.ly)(`0x${e.slice(130)}`));return i.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(r)})().recoverPublicKey(n.substring(2)).toHex(!1);return`0x${l}`}function u(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function d({hash:e,signature:t}){return function(e){let t=(0,i.w)(`0x${e.substring(4)}`).substring(26);return(0,n.x)(`0x${t}`)}(await l({hash:e,signature:t}))}},57194:function(e,t,r){"use strict";r.d(t,{mF:function(){return l}});var n=r(79364),i=r(9511),o=r(81762),s=r(76259),a=r(72490);function c(e){if(e&&0!==e.length)return e.reduce((e,{slot:t,value:r})=>{if(66!==t.length)throw new i.W_({size:t.length,targetSize:66,type:"hex"});if(66!==r.length)throw new i.W_({size:r.length,targetSize:66,type:"hex"});return e[t]=r,e},{})}function l(e){if(!e)return;let t={};for(let{address:r,...i}of e){if(!(0,s.U)(r,{strict:!1}))throw new n.b({address:r});if(t[r])throw new o.Nc({address:r});t[r]=function(e){let{balance:t,nonce:r,state:n,stateDiff:i,code:s}=e,l={};if(void 0!==s&&(l.code=s),void 0!==t&&(l.balance=(0,a.eC)(t)),void 0!==r&&(l.nonce=(0,a.eC)(r)),void 0!==n&&(l.state=c(n)),void 0!==i){if(l.state)throw new o.Z8;l.stateDiff=c(i)}return l}(i)}return t}},25750:function(e,t,r){"use strict";r.d(t,{P:function(){return n}});let n=(e,t,r)=>JSON.stringify(e,(e,r)=>{let n="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,n):n},r)},21328:function(e,t,r){"use strict";r.d(t,{F:function(){return l}});var n=r(3902);let i=2n**256n-1n;var o=r(79364),s=r(88002),a=r(61373),c=r(76259);function l(e){let{account:t,gasPrice:r,maxFeePerGas:l,maxPriorityFeePerGas:u,to:d}=e,h=t?(0,n.T)(t):void 0;if(h&&!(0,c.U)(h.address))throw new o.b({address:h.address});if(d&&!(0,c.U)(d))throw new o.b({address:d});if(void 0!==r&&(void 0!==l||void 0!==u))throw new a.xY;if(l&&l>i)throw new s.Hh({maxFeePerGas:l});if(u&&l&&u>l)throw new s.cs({maxFeePerGas:l,maxPriorityFeePerGas:u})}},91086:function(e,t,r){"use strict";let n;r.d(t,{h:function(){return o}});let i=256;function o(e=11){if(!n||i+e>512){n="",i=0;for(let e=0;e<256;e++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(i,i+++e)}},38578:function(e,t,r){"use strict";r.d(t,{d:function(){return o}});var n=r(91283),i=r(67407);function o(e,t="wei"){return(0,i.b)(e,n.ez[t])}},59703:function(e,t,r){"use strict";r.d(t,{o:function(){return o}});var n=r(91283),i=r(67407);function o(e,t="wei"){return(0,i.b)(e,n.Zn[t])}},67407:function(e,t,r){"use strict";function n(e,t){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1));let[i,o]=[(r=r.padStart(t,"0")).slice(0,r.length-t),r.slice(r.length-t)];return o=o.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${o?`.${o}`:""}`}r.d(t,{b:function(){return n}})},46611:function(e,t,r){"use strict";async function n(e){return new Promise(t=>setTimeout(t,e))}r.d(t,{D:function(){return n}})},34556:function(e,t,r){"use strict";r.d(t,{V:function(){return a},F:function(){return c}});var n=r(50959);let i=!1;async function o(e,t={}){let r;if(i)return[];i=!0,e.setState(e=>({...e,status:e.current?"reconnecting":"connecting"}));let n=[];if(t.connectors?.length)for(let r of t.connectors){let t;t="function"==typeof r?e._internal.connectors.setup(r):r,n.push(t)}else n.push(...e.connectors);try{r=await e.storage?.getItem("recentConnectorId")}catch{}let o={};for(let[,t]of e.state.connections)o[t.connector.id]=1;r&&(o[r]=0);let s=Object.keys(o).length>0?[...n].sort((e,t)=>(o[e.id]??10)-(o[t.id]??10)):n,a=!1,c=[],l=[];for(let t of s){let r=await t.getProvider().catch(()=>void 0);if(!r||l.some(e=>e===r)||!await t.isAuthorized())continue;let n=await t.connect({isReconnecting:!0}).catch(()=>null);n&&(t.emitter.off("connect",e._internal.events.connect),t.emitter.on("change",e._internal.events.change),t.emitter.on("disconnect",e._internal.events.disconnect),e.setState(e=>{let r=new Map(a?e.connections:new Map).set(t.uid,{accounts:n.accounts,chainId:n.chainId,connector:t});return{...e,current:a?e.current:t.uid,connections:r}}),c.push({accounts:n.accounts,chainId:n.chainId,connector:t}),l.push(r),a=!0)}return("reconnecting"===e.state.status||"connecting"===e.state.status)&&(a?e.setState(e=>({...e,status:"connected"})):e.setState(e=>({...e,connections:new Map,current:null,status:"disconnected"}))),i=!1,c}function s(e){let{children:t,config:r,initialState:i,reconnectOnMount:s=!0}=e,{onMount:a}
7144=function(e,t){let{initialState:r,reconnectOnMount:n}=t;return r&&!e._internal.store.persist.hasHydrated()&&e.setState({...r,chainId:e.chains.some(e=>e.id===r.chainId)?r.chainId:e.chains[0].id,connections:n?r.connections:new Map,status:n?"reconnecting":"disconnected"}),{async onMount(){e._internal.ssr&&(await e._internal.store.persist.rehydrate(),e._internal.mipd&&e._internal.connectors.setState(t=>{let r=new Set;for(let e of t??[])if(e.rdns)for(let t of Array.isArray(e.rdns)?e.rdns:[e.rdns])r.add(t);let n=[];for(let t of e._internal.mipd?.getProviders()??[]){if(r.has(t.info.rdns))continue;let i=e._internal.connectors.providerDetailToConnector(t),o=e._internal.connectors.setup(i);n.push(o)}return[...t,...n]})),n?o(e):e.storage&&e.setState(e=>({...e,connections:new Map}))}}}(r,{initialState:i,reconnectOnMount:s});r._internal.ssr||a();let c=(0,n.useRef)(!0);return(0,n.useEffect)(()=>{if(c.current&&r._internal.ssr)return a(),()=>{c.current=!1}},[]),t}let a=(0,n.createContext)(void 0);function c(e){let{children:t,config:r}=e;return(0,n.createElement)(s,e,(0,n.createElement)(a.Provider,{value:r},t))}},49347:function(e,t,r){"use strict";r.d(t,{Ue:function(){return d}});var n=r(8234),i=r(50959),o=r(38361);let{useDebugValue:s}=i,{useSyncExternalStoreWithSelector:a}=o,c=!1,l=e=>e,u=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t="function"==typeof e?(0,n.M)(e):e,r=(e,r)=>(function(e,t=l,r){r&&!c&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),c=!0);let n=a(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return s(n),n})(t,e,r);return Object.assign(r,t),r},d=e=>e?u(e):u},8234:function(e,t,r){"use strict";r.d(t,{M:function(){return i}});let n=e=>{let t;let r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>s,subscribe:e=>(r.add(e),()=>r.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},s=t=e(n,i,o);return o},i=e=>e?n(e):n}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774,179],function(){return t(61787),t(70102)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.