From 728429343b595b067552ed54e24a2d894a847324 Mon Sep 17 00:00:00 2001 From: serjonya-trili Date: Wed, 22 May 2024 09:57:54 +0000 Subject: [PATCH] deploy: 93c7039aa89f8c038821858de7f6a71ce8e87f81 --- ...on-F8__rn9f.js => DailyMotion-h6PJ7FdU.js} | 2 +- ...ebook-v7IG1Iu_.js => Facebook-Dfq544d0.js} | 2 +- ...yer-CkYzVQql.js => FilePlayer-C_cf59eq.js} | 2 +- ...altura-B7_0hU-9.js => Kaltura-hZEG8-AX.js} | 2 +- ...cloud-DMn3HFhR.js => Mixcloud-CXsvkXxx.js} | 2 +- assets/{Mux-BB3adfLv.js => Mux-CB3UXor1.js} | 2 +- ...review-BNWDONTD.js => Preview-eFqEJmvp.js} | 2 +- ...oud-DIxM4yf7.js => SoundCloud-Cs4BWDQl.js} | 2 +- ...ble-BIg498SH.js => Streamable-gqvUkMSw.js} | 2 +- ...{Twitch-_F8av3qg.js => Twitch-C1YmLvSl.js} | 2 +- ...idyard-DyExc8oi.js => Vidyard-Del0Hja2.js} | 2 +- .../{Vimeo-Dwcn2a-4.js => Vimeo-CPBZZjfF.js} | 2 +- ...{Wistia-Cafs9unk.js => Wistia-DGQ5ZOW3.js} | 2 +- ...ouTube-D7Fg3hwi.js => YouTube-CGwc54Dj.js} | 2 +- .../{index-BkGXucR3.js => index-hPZl60DK.js} | 44 +++++++++---------- index.html | 2 +- 16 files changed, 37 insertions(+), 37 deletions(-) rename assets/{DailyMotion-F8__rn9f.js => DailyMotion-h6PJ7FdU.js} (97%) rename assets/{Facebook-v7IG1Iu_.js => Facebook-Dfq544d0.js} (98%) rename assets/{FilePlayer-CkYzVQql.js => FilePlayer-C_cf59eq.js} (99%) rename assets/{Kaltura-B7_0hU-9.js => Kaltura-hZEG8-AX.js} (97%) rename assets/{Mixcloud-DMn3HFhR.js => Mixcloud-CXsvkXxx.js} (97%) rename assets/{Mux-BB3adfLv.js => Mux-CB3UXor1.js} (98%) rename assets/{Preview-BNWDONTD.js => Preview-eFqEJmvp.js} (97%) rename assets/{SoundCloud-DIxM4yf7.js => SoundCloud-Cs4BWDQl.js} (97%) rename assets/{Streamable-BIg498SH.js => Streamable-gqvUkMSw.js} (97%) rename assets/{Twitch-_F8av3qg.js => Twitch-C1YmLvSl.js} (97%) rename assets/{Vidyard-DyExc8oi.js => Vidyard-Del0Hja2.js} (97%) rename assets/{Vimeo-Dwcn2a-4.js => Vimeo-CPBZZjfF.js} (98%) rename assets/{Wistia-Cafs9unk.js => Wistia-DGQ5ZOW3.js} (98%) rename assets/{YouTube-D7Fg3hwi.js => YouTube-CGwc54Dj.js} (98%) rename assets/{index-BkGXucR3.js => index-hPZl60DK.js} (95%) diff --git a/assets/DailyMotion-F8__rn9f.js b/assets/DailyMotion-h6PJ7FdU.js similarity index 97% rename from assets/DailyMotion-F8__rn9f.js rename to assets/DailyMotion-h6PJ7FdU.js index 6c96bc0df0..3b8587194c 100644 --- a/assets/DailyMotion-F8__rn9f.js +++ b/assets/DailyMotion-h6PJ7FdU.js @@ -1 +1 @@ -import{g as P,r as v,u as D,p as O}from"./index-BkGXucR3.js";function b(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?M(j(t)):{},h(!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};A(d,{default:()=>p});var _=C(d),c=L(v),l=D,f=O;const N="https://api.dmcdn.net/all.js",x="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(N,x,K,u=>u.player).then(u=>{if(!this.container)return;const g=u.player;this.player=new g(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:m=>a(m)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),I=b({__proto__:null,default:R},[_]);export{I as D}; +import{g as P,r as v,u as D,p as O}from"./index-hPZl60DK.js";function b(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?M(j(t)):{},h(!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};A(d,{default:()=>p});var _=C(d),c=L(v),l=D,f=O;const N="https://api.dmcdn.net/all.js",x="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(N,x,K,u=>u.player).then(u=>{if(!this.container)return;const g=u.player;this.player=new g(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:m=>a(m)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),I=b({__proto__:null,default:R},[_]);export{I as D}; diff --git a/assets/Facebook-v7IG1Iu_.js b/assets/Facebook-Dfq544d0.js similarity index 98% rename from assets/Facebook-v7IG1Iu_.js rename to assets/Facebook-Dfq544d0.js index c539daf568..404bb586c6 100644 --- a/assets/Facebook-v7IG1Iu_.js +++ b/assets/Facebook-Dfq544d0.js @@ -1 +1 @@ -import{g as _,r as g,u as P,p as m}from"./index-BkGXucR3.js";function v(t,e){for(var r=0;ra[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",y="FB",f="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,y,f).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,y,f).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",x.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),B=v({__proto__:null,default:M},[d]);export{B as F}; +import{g as _,r as g,u as P,p as m}from"./index-hPZl60DK.js";function v(t,e){for(var r=0;ra[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",y="FB",f="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,y,f).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,y,f).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",x.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),B=v({__proto__:null,default:M},[d]);export{B as F}; diff --git a/assets/FilePlayer-CkYzVQql.js b/assets/FilePlayer-C_cf59eq.js similarity index 99% rename from assets/FilePlayer-CkYzVQql.js rename to assets/FilePlayer-C_cf59eq.js index aa94cf6e94..fdeae4384e 100644 --- a/assets/FilePlayer-CkYzVQql.js +++ b/assets/FilePlayer-C_cf59eq.js @@ -1 +1 @@ -import{g as b,r as _,u as O,p as A}from"./index-BkGXucR3.js";function R(s,e){for(var t=0;ti[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),d=j(_),a=O,c=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends d.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?d.default.createElement("source",{key:t,src:e}):d.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>d.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:c.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:c.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return c.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return c.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return d.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",c.canPlay.file);const z=b(g),J=R({__proto__:null,default:z},[g]);export{J as F}; +import{g as b,r as _,u as O,p as A}from"./index-hPZl60DK.js";function R(s,e){for(var t=0;ti[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),d=j(_),a=O,c=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends d.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?d.default.createElement("source",{key:t,src:e}):d.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>d.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:c.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:c.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return c.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return c.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return d.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",c.canPlay.file);const z=b(g),J=R({__proto__:null,default:z},[g]);export{J as F}; diff --git a/assets/Kaltura-B7_0hU-9.js b/assets/Kaltura-hZEG8-AX.js similarity index 97% rename from assets/Kaltura-B7_0hU-9.js rename to assets/Kaltura-hZEG8-AX.js index 90e3f3b6da..811a967ed1 100644 --- a/assets/Kaltura-B7_0hU-9.js +++ b/assets/Kaltura-hZEG8-AX.js @@ -1 +1 @@ -import{g as y,r as f,u as _,p as m}from"./index-BkGXucR3.js";function P(r,e){for(var t=0;to[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(o=b(e,a))||o.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),s=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),d={};L(d,{default:()=>i});var h=D(d),u=K(f),p=_,M=m;const S="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends u.Component{constructor(){super(...arguments),s(this,"callPlayer",p.callPlayer),s(this,"duration",null),s(this,"currentTime",null),s(this,"secondsLoaded",null),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unmute")}),s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(S,T).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:o,seconds:a})=>{this.duration=o,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}s(i,"displayName","Kaltura");s(i,"canPlay",M.canPlay.kaltura);const E=y(h),N=P({__proto__:null,default:E},[h]);export{N as K}; +import{g as y,r as f,u as _,p as m}from"./index-hPZl60DK.js";function P(r,e){for(var t=0;to[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(o=b(e,a))||o.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),s=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),d={};L(d,{default:()=>i});var h=D(d),u=K(f),p=_,M=m;const S="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends u.Component{constructor(){super(...arguments),s(this,"callPlayer",p.callPlayer),s(this,"duration",null),s(this,"currentTime",null),s(this,"secondsLoaded",null),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unmute")}),s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(S,T).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:o,seconds:a})=>{this.duration=o,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}s(i,"displayName","Kaltura");s(i,"canPlay",M.canPlay.kaltura);const E=y(h),N=P({__proto__:null,default:E},[h]);export{N as K}; diff --git a/assets/Mixcloud-DMn3HFhR.js b/assets/Mixcloud-CXsvkXxx.js similarity index 97% rename from assets/Mixcloud-DMn3HFhR.js rename to assets/Mixcloud-CXsvkXxx.js index 4d301bf0cc..4903689728 100644 --- a/assets/Mixcloud-DMn3HFhR.js +++ b/assets/Mixcloud-CXsvkXxx.js @@ -1 +1 @@ -import{g as _,r as f,u as m,p as g}from"./index-BkGXucR3.js";function v(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),p=D(f),u=m,y=g;const E="https://widget.mixcloud.com/media/js/widgetApi.js",L="Mixcloud";class l extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",u.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,L).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,u.queryString)({...r.options,feed:`/${s}/`});return p.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),N=v({__proto__:null,default:T},[h]);export{N as M}; +import{g as _,r as f,u as m,p as g}from"./index-hPZl60DK.js";function v(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),p=D(f),u=m,y=g;const E="https://widget.mixcloud.com/media/js/widgetApi.js",L="Mixcloud";class l extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",u.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,L).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,u.queryString)({...r.options,feed:`/${s}/`});return p.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),N=v({__proto__:null,default:T},[h]);export{N as M}; diff --git a/assets/Mux-BB3adfLv.js b/assets/Mux-CB3UXor1.js similarity index 98% rename from assets/Mux-BB3adfLv.js rename to assets/Mux-CB3UXor1.js index 03d1da4779..0ff0ff3c90 100644 --- a/assets/Mux-BB3adfLv.js +++ b/assets/Mux-CB3UXor1.js @@ -1 +1 @@ -import{g as P,_ as E,r as g,p as _}from"./index-BkGXucR3.js";function b(r,e){for(var t=0;ti[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var L=Object.create,u=Object.defineProperty,I=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,O=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,M=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,R=(r,e)=>{for(var t in e)u(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of k(e))!x.call(r,s)&&s!==t&&u(r,s,{get:()=>e[s],enumerable:!(i=I(e,s))||i.enumerable});return r},w=(r,e,t)=>(t=r!=null?L(O(r)):{},f(!r||!r.__esModule?u(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>f(u({},"__esModule",{value:!0}),r),n=(r,e,t)=>(M(r,typeof e!="symbol"?e+"":e,t),t),y={};R(y,{default:()=>l});var m=D(y),v=w(g),p=_;const j="https://cdn.jsdelivr.net/npm/@mux/mux-player@VERSION/dist/mux-player.mjs";class l extends v.Component{constructor(){super(...arguments),n(this,"onReady",(...e)=>this.props.onReady(...e)),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),n(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onError",(...e)=>this.props.onError(...e)),n(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),n(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),n(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.player.muted=!0}),n(this,"unmute",()=>{this.player.muted=!1}),n(this,"ref",e=>{this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getPlaybackId(this.props.url);e&&(this.player.playbackId=e)}componentWillUnmount(){this.player.playbackId=null,this.removeListeners(this.player)}addListeners(e){const{playsinline:t}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),e.addEventListener("canplay",this.onReady),t&&e.setAttribute("playsinline","")}removeListeners(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("canplay",this.onReady)}async load(e){var t;const{onError:i,config:s}=this.props;if(!((t=globalThis.customElements)!=null&&t.get("mux-player")))try{const a=j.replace("VERSION",s.version);await E(()=>import(`${a}`),[],import.meta.url),this.props.onLoaded()}catch(a){i(a)}const[,o]=e.match(p.MATCH_URL_MUX);this.player.playbackId=o}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.playbackId=null}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getPlaybackId(e){const[,t]=e.match(p.MATCH_URL_MUX);return t}render(){const{url:e,playing:t,loop:i,controls:s,muted:o,config:a,width:h,height:c}=this.props,d={width:h==="auto"?h:"100%",height:c==="auto"?c:"100%"};return s===!1&&(d["--controls"]="none"),v.default.createElement("mux-player",{ref:this.ref,"playback-id":this.getPlaybackId(e),style:d,preload:"auto",autoPlay:t||void 0,muted:o?"":void 0,loop:i?"":void 0,...a.attributes})}}n(l,"displayName","Mux");n(l,"canPlay",p.canPlay.mux);const C=P(m),B=b({__proto__:null,default:C},[m]);export{B as M}; +import{g as P,_ as E,r as g,p as _}from"./index-hPZl60DK.js";function b(r,e){for(var t=0;ti[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var L=Object.create,u=Object.defineProperty,I=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,O=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,M=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,R=(r,e)=>{for(var t in e)u(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of k(e))!x.call(r,s)&&s!==t&&u(r,s,{get:()=>e[s],enumerable:!(i=I(e,s))||i.enumerable});return r},w=(r,e,t)=>(t=r!=null?L(O(r)):{},f(!r||!r.__esModule?u(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>f(u({},"__esModule",{value:!0}),r),n=(r,e,t)=>(M(r,typeof e!="symbol"?e+"":e,t),t),y={};R(y,{default:()=>l});var m=D(y),v=w(g),p=_;const j="https://cdn.jsdelivr.net/npm/@mux/mux-player@VERSION/dist/mux-player.mjs";class l extends v.Component{constructor(){super(...arguments),n(this,"onReady",(...e)=>this.props.onReady(...e)),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),n(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onError",(...e)=>this.props.onError(...e)),n(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),n(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),n(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.player.muted=!0}),n(this,"unmute",()=>{this.player.muted=!1}),n(this,"ref",e=>{this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getPlaybackId(this.props.url);e&&(this.player.playbackId=e)}componentWillUnmount(){this.player.playbackId=null,this.removeListeners(this.player)}addListeners(e){const{playsinline:t}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),e.addEventListener("canplay",this.onReady),t&&e.setAttribute("playsinline","")}removeListeners(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("canplay",this.onReady)}async load(e){var t;const{onError:i,config:s}=this.props;if(!((t=globalThis.customElements)!=null&&t.get("mux-player")))try{const a=j.replace("VERSION",s.version);await E(()=>import(`${a}`),[],import.meta.url),this.props.onLoaded()}catch(a){i(a)}const[,o]=e.match(p.MATCH_URL_MUX);this.player.playbackId=o}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.playbackId=null}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getPlaybackId(e){const[,t]=e.match(p.MATCH_URL_MUX);return t}render(){const{url:e,playing:t,loop:i,controls:s,muted:o,config:a,width:h,height:c}=this.props,d={width:h==="auto"?h:"100%",height:c==="auto"?c:"100%"};return s===!1&&(d["--controls"]="none"),v.default.createElement("mux-player",{ref:this.ref,"playback-id":this.getPlaybackId(e),style:d,preload:"auto",autoPlay:t||void 0,muted:o?"":void 0,loop:i?"":void 0,...a.attributes})}}n(l,"displayName","Mux");n(l,"canPlay",p.canPlay.mux);const C=P(m),B=b({__proto__:null,default:C},[m]);export{B as M}; diff --git a/assets/Preview-BNWDONTD.js b/assets/Preview-eFqEJmvp.js similarity index 97% rename from assets/Preview-BNWDONTD.js rename to assets/Preview-eFqEJmvp.js index 63041044db..7b68824c07 100644 --- a/assets/Preview-BNWDONTD.js +++ b/assets/Preview-eFqEJmvp.js @@ -1 +1 @@ -import{g as y,r as v}from"./index-BkGXucR3.js";function w(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,s=Object.defineProperty,O=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,I=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,E=(r,e,t)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,S=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},_=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of x(e))!j.call(r,a)&&a!==t&&s(r,a,{get:()=>e[a],enumerable:!(n=O(e,a))||n.enumerable});return r},C=(r,e,t)=>(t=r!=null?P(I(r)):{},_(!r||!r.__esModule?s(t,"default",{value:r,enumerable:!0}):t,r)),N=r=>_(s({},"__esModule",{value:!0}),r),p=(r,e,t)=>(E(r,typeof e!="symbol"?e+"":e,t),t),g={};S(g,{default:()=>k});var m=N(g),i=C(v);const u="64px",d={};class k extends i.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!i.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a,previewAriaLabel:o}=this.props,{image:f}=this.state,l=i.default.isValidElement(e),h={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:f&&!l?`url(${f})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...h},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...h},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},b=i.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},i.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return i.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress,...o?{"aria-label":o}:{}},l?e:null,n||b)}}const D=y(m),A=w({__proto__:null,default:D},[m]);export{A as P}; +import{g as y,r as v}from"./index-hPZl60DK.js";function w(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,s=Object.defineProperty,O=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,I=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,E=(r,e,t)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,S=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},_=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of x(e))!j.call(r,a)&&a!==t&&s(r,a,{get:()=>e[a],enumerable:!(n=O(e,a))||n.enumerable});return r},C=(r,e,t)=>(t=r!=null?P(I(r)):{},_(!r||!r.__esModule?s(t,"default",{value:r,enumerable:!0}):t,r)),N=r=>_(s({},"__esModule",{value:!0}),r),p=(r,e,t)=>(E(r,typeof e!="symbol"?e+"":e,t),t),g={};S(g,{default:()=>k});var m=N(g),i=C(v);const u="64px",d={};class k extends i.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!i.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a,previewAriaLabel:o}=this.props,{image:f}=this.state,l=i.default.isValidElement(e),h={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:f&&!l?`url(${f})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...h},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...h},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},b=i.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},i.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return i.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress,...o?{"aria-label":o}:{}},l?e:null,n||b)}}const D=y(m),A=w({__proto__:null,default:D},[m]);export{A as P}; diff --git a/assets/SoundCloud-DIxM4yf7.js b/assets/SoundCloud-Cs4BWDQl.js similarity index 97% rename from assets/SoundCloud-DIxM4yf7.js rename to assets/SoundCloud-Cs4BWDQl.js index 53de17475b..98939e18bf 100644 --- a/assets/SoundCloud-DIxM4yf7.js +++ b/assets/SoundCloud-Cs4BWDQl.js @@ -1 +1 @@ -import{g as P,r as g,u as b,p as v}from"./index-BkGXucR3.js";function O(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},M=(t,e,r)=>(r=t!=null?S(C(t)):{},d(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=R(h),p=M(g),c=b,T=v;const N="https://w.soundcloud.com/player/api.js",x="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(N,x).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",T.canPlay.soundcloud);a(u,"loopOnEnded",!0);const A=P(f),F=O({__proto__:null,default:A},[f]);export{F as S}; +import{g as P,r as g,u as b,p as v}from"./index-hPZl60DK.js";function O(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},M=(t,e,r)=>(r=t!=null?S(C(t)):{},d(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=R(h),p=M(g),c=b,T=v;const N="https://w.soundcloud.com/player/api.js",x="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(N,x).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",T.canPlay.soundcloud);a(u,"loopOnEnded",!0);const A=P(f),F=O({__proto__:null,default:A},[f]);export{F as S}; diff --git a/assets/Streamable-BIg498SH.js b/assets/Streamable-gqvUkMSw.js similarity index 97% rename from assets/Streamable-BIg498SH.js rename to assets/Streamable-gqvUkMSw.js index d3fe15d3b5..5806baf4fb 100644 --- a/assets/Streamable-BIg498SH.js +++ b/assets/Streamable-gqvUkMSw.js @@ -1 +1 @@ -import{g as m,r as f,u as _,p as b}from"./index-BkGXucR3.js";function P(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,L=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!j.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},M=(t,e,r)=>(r=t!=null?g(S(t)):{},c(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),D=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(L(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=D(h),p=M(f),u=_,d=b;const E="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),C=P({__proto__:null,default:x},[y]);export{C as S}; +import{g as m,r as f,u as _,p as b}from"./index-hPZl60DK.js";function P(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,L=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!j.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},M=(t,e,r)=>(r=t!=null?g(S(t)):{},c(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),D=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(L(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=D(h),p=M(f),u=_,d=b;const E="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),C=P({__proto__:null,default:x},[y]);export{C as S}; diff --git a/assets/Twitch-_F8av3qg.js b/assets/Twitch-C1YmLvSl.js similarity index 97% rename from assets/Twitch-_F8av3qg.js rename to assets/Twitch-C1YmLvSl.js index 743b7a366c..f088f0cb7d 100644 --- a/assets/Twitch-_F8av3qg.js +++ b/assets/Twitch-C1YmLvSl.js @@ -1 +1 @@ -import{g as w,r as D,u as C,p as N}from"./index-BkGXucR3.js";function I(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,l=Object.defineProperty,S=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,A=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of j(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=S(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?M(A(t)):{},_(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),y=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends y.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),o(this,"mute",()=>{this.callPlayer("setMuted",!0)}),o(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:n,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(d=>{this.player=new d.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...n.options});const{READY:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=d.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return y.default.createElement("div",{style:e,id:this.playerID})}}o(h,"displayName","Twitch");o(h,"canPlay",u.canPlay.twitch);o(h,"loopOnEnded",!0);const W=w(f),G=I({__proto__:null,default:W},[f]);export{G as T}; +import{g as w,r as D,u as C,p as N}from"./index-hPZl60DK.js";function I(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,l=Object.defineProperty,S=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,A=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of j(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=S(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?M(A(t)):{},_(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),y=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends y.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),o(this,"mute",()=>{this.callPlayer("setMuted",!0)}),o(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:n,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(d=>{this.player=new d.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...n.options});const{READY:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=d.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return y.default.createElement("div",{style:e,id:this.playerID})}}o(h,"displayName","Twitch");o(h,"canPlay",u.canPlay.twitch);o(h,"loopOnEnded",!0);const W=w(f),G=I({__proto__:null,default:W},[f]);export{G as T}; diff --git a/assets/Vidyard-DyExc8oi.js b/assets/Vidyard-Del0Hja2.js similarity index 97% rename from assets/Vidyard-DyExc8oi.js rename to assets/Vidyard-Del0Hja2.js index 34c1ed9ff9..b1c62edec2 100644 --- a/assets/Vidyard-DyExc8oi.js +++ b/assets/Vidyard-Del0Hja2.js @@ -1 +1 @@ -import{g as m,r as v,u as b,p as O}from"./index-BkGXucR3.js";function V(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},L=(t,e,r)=>(r=t!=null?D(S(t)):{},h(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),o(this,"callPlayer",d.callPlayer),o(this,"mute",()=>{this.setVolume(0)}),o(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:s,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,g)=>{this.player||(this.player=g,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...s.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}o(y,"displayName","Vidyard");o(y,"canPlay",P.canPlay.vidyard);const T=m(f),K=V({__proto__:null,default:T},[f]);export{K as V}; +import{g as m,r as v,u as b,p as O}from"./index-hPZl60DK.js";function V(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},L=(t,e,r)=>(r=t!=null?D(S(t)):{},h(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),o(this,"callPlayer",d.callPlayer),o(this,"mute",()=>{this.setVolume(0)}),o(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:s,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,g)=>{this.player||(this.player=g,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...s.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}o(y,"displayName","Vidyard");o(y,"canPlay",P.canPlay.vidyard);const T=m(f),K=V({__proto__:null,default:T},[f]);export{K as V}; diff --git a/assets/Vimeo-Dwcn2a-4.js b/assets/Vimeo-CPBZZjfF.js similarity index 98% rename from assets/Vimeo-Dwcn2a-4.js rename to assets/Vimeo-CPBZZjfF.js index 79a39f468a..995a5a69c6 100644 --- a/assets/Vimeo-Dwcn2a-4.js +++ b/assets/Vimeo-CPBZZjfF.js @@ -1 +1 @@ -import{g as d,r as f,u as m,p as _}from"./index-BkGXucR3.js";function P(t,e){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},j=(t,e,r)=>(r=t!=null?g(O(t)):{},h(!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};M(c,{default:()=>l});var y=E(c),p=j(f),u=m,L=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",L.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),C=P({__proto__:null,default:T},[y]);export{C as V}; +import{g as d,r as f,u as m,p as _}from"./index-hPZl60DK.js";function P(t,e){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},j=(t,e,r)=>(r=t!=null?g(O(t)):{},h(!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};M(c,{default:()=>l});var y=E(c),p=j(f),u=m,L=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",L.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),C=P({__proto__:null,default:T},[y]);export{C as V}; diff --git a/assets/Wistia-Cafs9unk.js b/assets/Wistia-DGQ5ZOW3.js similarity index 98% rename from assets/Wistia-Cafs9unk.js rename to assets/Wistia-DGQ5ZOW3.js index 68c31d867e..6543515756 100644 --- a/assets/Wistia-Cafs9unk.js +++ b/assets/Wistia-DGQ5ZOW3.js @@ -1 +1 @@ -import{g,r as m,u as v,p as w}from"./index-BkGXucR3.js";function O(t,e){for(var a=0;as[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),M=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=M(d),y=I(m),c=v,P=w;const W="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(W,x).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const L=g(_),T=O({__proto__:null,default:L},[_]);export{T as W}; +import{g,r as m,u as v,p as w}from"./index-hPZl60DK.js";function O(t,e){for(var a=0;as[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),M=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=M(d),y=I(m),c=v,P=w;const W="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(W,x).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const L=g(_),T=O({__proto__:null,default:L},[_]);export{T as W}; diff --git a/assets/YouTube-D7Fg3hwi.js b/assets/YouTube-CGwc54Dj.js similarity index 98% rename from assets/YouTube-D7Fg3hwi.js rename to assets/YouTube-CGwc54Dj.js index ff941b5a82..4fd4d6b2dd 100644 --- a/assets/YouTube-D7Fg3hwi.js +++ b/assets/YouTube-CGwc54Dj.js @@ -1 +1 @@ -import{g as U,r as I,u as L,p as M}from"./index-BkGXucR3.js";function Y(a,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var k=Object.create,u=Object.defineProperty,N=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of j(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=N(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?k(V(a)):{},v(!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),b=F(I),p=L,D=M;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends b.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(m.test(e)){const[,t]=e.match(m);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:c,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===c&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const R=!!this.callPlayer("getPlaylist");y&&!R&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||m.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||l.start,endSeconds:(0,p.parseEndTime)(e)||l.end});return}(0,p.getSDK)(G,T,z,c=>c.loaded).then(c=>{this.container&&(this.player=new c.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return b.default.createElement("div",{style:t},b.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),q=Y({__proto__:null,default:$},[S]);export{q as Y}; +import{g as U,r as I,u as L,p as M}from"./index-hPZl60DK.js";function Y(a,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var k=Object.create,u=Object.defineProperty,N=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of j(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=N(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?k(V(a)):{},v(!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),b=F(I),p=L,D=M;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends b.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(m.test(e)){const[,t]=e.match(m);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:c,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===c&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const R=!!this.callPlayer("getPlaylist");y&&!R&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||m.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||l.start,endSeconds:(0,p.parseEndTime)(e)||l.end});return}(0,p.getSDK)(G,T,z,c=>c.loaded).then(c=>{this.container&&(this.player=new c.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return b.default.createElement("div",{style:t},b.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),q=Y({__proto__:null,default:$},[S]);export{q as Y}; diff --git a/assets/index-BkGXucR3.js b/assets/index-hPZl60DK.js similarity index 95% rename from assets/index-BkGXucR3.js rename to assets/index-hPZl60DK.js index d4397f0ef3..a6760fdcf2 100644 --- a/assets/index-BkGXucR3.js +++ b/assets/index-hPZl60DK.js @@ -325,7 +325,7 @@ Error generating stack: `+tt.message+` ${vhPolyfill} `});function getErrorMessage(a,_){return`${a} returned \`undefined\`. Seems you forgot to wrap component within ${_}`}function createContext$1(a={}){const{name:_,strict:$=!0,hookName:j="useContext",providerName:et="Provider",errorMessage:tt,defaultValue:rt}=a,nt=reactExports.createContext(rt);nt.displayName=_;function it(){var st;const ot=reactExports.useContext(nt);if(!ot&&$){const at=new Error(tt??getErrorMessage(j,et));throw at.name="ContextError",(st=Error.captureStackTrace)==null||st.call(Error,at,it),at}return ot}return[nt.Provider,it,nt]}var[PortalManagerContextProvider,usePortalManager]=createContext$1({strict:!1,name:"PortalManagerContext"});function PortalManager(a){const{children:_,zIndex:$}=a;return jsxRuntimeExports.jsx(PortalManagerContextProvider,{value:{zIndex:$},children:_})}PortalManager.displayName="PortalManager";var useSafeLayoutEffect$2=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:reactExports.useEffect,[PortalContextProvider,usePortalContext]=createContext$1({strict:!1,name:"PortalContext"}),PORTAL_CLASSNAME="chakra-portal",PORTAL_SELECTOR=".chakra-portal",Container=a=>jsxRuntimeExports.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:a.zIndex,top:0,left:0,right:0},children:a.children}),DefaultPortal=a=>{const{appendToParentPortal:_,children:$}=a,[j,et]=reactExports.useState(null),tt=reactExports.useRef(null),[,rt]=reactExports.useState({});reactExports.useEffect(()=>rt({}),[]);const nt=usePortalContext(),it=usePortalManager();useSafeLayoutEffect$2(()=>{if(!j)return;const ot=j.ownerDocument,at=_?nt??ot.body:ot.body;if(!at)return;tt.current=ot.createElement("div"),tt.current.className=PORTAL_CLASSNAME,at.appendChild(tt.current),rt({});const ut=tt.current;return()=>{at.contains(ut)&&at.removeChild(ut)}},[j]);const st=it!=null&&it.zIndex?jsxRuntimeExports.jsx(Container,{zIndex:it==null?void 0:it.zIndex,children:$}):$;return tt.current?reactDomExports.createPortal(jsxRuntimeExports.jsx(PortalContextProvider,{value:tt.current,children:st}),tt.current):jsxRuntimeExports.jsx("span",{ref:ot=>{ot&&et(ot)}})},ContainerPortal=a=>{const{children:_,containerRef:$,appendToParentPortal:j}=a,et=$.current,tt=et??(typeof window<"u"?document.body:void 0),rt=reactExports.useMemo(()=>{const it=et==null?void 0:et.ownerDocument.createElement("div");return it&&(it.className=PORTAL_CLASSNAME),it},[et]),[,nt]=reactExports.useState({});return useSafeLayoutEffect$2(()=>nt({}),[]),useSafeLayoutEffect$2(()=>{if(!(!rt||!tt))return tt.appendChild(rt),()=>{tt.removeChild(rt)}},[rt,tt]),tt&&rt?reactDomExports.createPortal(jsxRuntimeExports.jsx(PortalContextProvider,{value:j?rt:null,children:_}),rt):null};function Portal(a){const _={appendToParentPortal:!0,...a},{containerRef:$,...j}=_;return $?jsxRuntimeExports.jsx(ContainerPortal,{containerRef:$,...j}):jsxRuntimeExports.jsx(DefaultPortal,{...j})}Portal.className=PORTAL_CLASSNAME;Portal.selector=PORTAL_SELECTOR;Portal.displayName="Portal";function useTheme(){const a=reactExports.useContext(ThemeContext);if(!a)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return a}var ColorModeContext=reactExports.createContext({});ColorModeContext.displayName="ColorModeContext";function useColorMode(){const a=reactExports.useContext(ColorModeContext);if(a===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return a}var classNames={light:"chakra-ui-light",dark:"chakra-ui-dark"};function getColorModeUtils(a={}){const{preventTransition:_=!0}=a,$={setDataset:j=>{const et=_?$.preventTransition():void 0;document.documentElement.dataset.theme=j,document.documentElement.style.colorScheme=j,et==null||et()},setClassName(j){document.body.classList.add(j?classNames.dark:classNames.light),document.body.classList.remove(j?classNames.light:classNames.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(j){var et;return((et=$.query().matches)!=null?et:j==="dark")?"dark":"light"},addListener(j){const et=$.query(),tt=rt=>{j(rt.matches?"dark":"light")};return typeof et.addListener=="function"?et.addListener(tt):et.addEventListener("change",tt),()=>{typeof et.removeListener=="function"?et.removeListener(tt):et.removeEventListener("change",tt)}},preventTransition(){const j=document.createElement("style");return j.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(j),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(j)})})}}};return $}var STORAGE_KEY="chakra-ui-color-mode";function createLocalStorageManager(a){return{ssr:!1,type:"localStorage",get(_){if(!(globalThis!=null&&globalThis.document))return _;let $;try{$=localStorage.getItem(a)||_}catch{}return $||_},set(_){try{localStorage.setItem(a,_)}catch{}}}}var localStorageManager=createLocalStorageManager(STORAGE_KEY),noop$c=()=>{};function getTheme(a,_){return a.type==="cookie"&&a.ssr?a.get(_):_}function ColorModeProvider(a){const{value:_,children:$,options:{useSystemColorMode:j,initialColorMode:et,disableTransitionOnChange:tt}={},colorModeManager:rt=localStorageManager}=a,nt=et==="dark"?"dark":"light",[it,st]=reactExports.useState(()=>getTheme(rt,nt)),[ot,at]=reactExports.useState(()=>getTheme(rt)),{getSystemTheme:ut,setClassName:ht,setDataset:yt,addListener:wt}=reactExports.useMemo(()=>getColorModeUtils({preventTransition:tt}),[tt]),Ct=et==="system"&&!it?ot:it,Pt=reactExports.useCallback(Bt=>{const Dt=Bt==="system"?ut():Bt;st(Dt),ht(Dt==="dark"),yt(Dt),rt.set(Dt)},[rt,ut,ht,yt]);useSafeLayoutEffect$2(()=>{et==="system"&&at(ut())},[]),reactExports.useEffect(()=>{const Bt=rt.get();if(Bt){Pt(Bt);return}if(et==="system"){Pt("system");return}Pt(nt)},[rt,nt,et,Pt]);const $t=reactExports.useCallback(()=>{Pt(Ct==="dark"?"light":"dark")},[Ct,Pt]);reactExports.useEffect(()=>{if(j)return wt(Pt)},[j,wt,Pt]);const Mt=reactExports.useMemo(()=>({colorMode:_??Ct,toggleColorMode:_?noop$c:$t,setColorMode:_?noop$c:Pt,forced:_!==void 0}),[Ct,$t,Pt,_]);return jsxRuntimeExports.jsx(ColorModeContext.Provider,{value:Mt,children:$})}ColorModeProvider.displayName="ColorModeProvider";var VALID_VALUES=new Set(["dark","light","system"]);function normalize$2(a){let _=a;return VALID_VALUES.has(_)||(_="light"),_}function getScriptSrc(a={}){const{initialColorMode:_="light",type:$="localStorage",storageKey:j="chakra-ui-color-mode"}=a,et=normalize$2(_),tt=$==="cookie",rt=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${et}",r="${j}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); `,nt=`(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="${et}",e="${j}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})(); - `;return`!${tt?rt:nt}`.trim()}function ColorModeScript(a={}){const{nonce:_}=a;return jsxRuntimeExports.jsx("script",{id:"chakra-script",nonce:_,dangerouslySetInnerHTML:{__html:getScriptSrc(a)}})}function useChakra(){const a=useColorMode(),_=useTheme();return{...a,theme:_}}function getTokenValue(a,_,$){var j,et;if(_==null)return _;const tt=rt=>{var nt,it;return(it=(nt=a.__cssMap)==null?void 0:nt[rt])==null?void 0:it.value};return(et=(j=tt(_))!=null?j:tt($))!=null?et:$}function getToken(a,_,$){const j=Array.isArray(_)?_:[_],et=Array.isArray($)?$:[$];return tt=>{const rt=et.filter(Boolean),nt=j.map((it,st)=>{var ot;const at=`${a}.${it}`;return getTokenValue(tt,at,(ot=rt[st])!=null?ot:it)});return Array.isArray(_)?nt:nt[0]}}var cx=(...a)=>a.filter(Boolean).join(" ");function isDev(){return!1}function isObject$5(a){const _=typeof a;return a!=null&&(_==="object"||_==="function")&&!Array.isArray(a)}var warn=a=>{const{condition:_,message:$}=a;_&&isDev()&&console.warn($)};function runIfFn$2(a,..._){return isFunction$8(a)?a(..._):a}var isFunction$8=a=>typeof a=="function",dataAttr=a=>a?"":void 0,ariaAttr=a=>a?!0:void 0;function callAllHandlers$1(...a){return function($){a.some(j=>(j==null||j($),$==null?void 0:$.defaultPrevented))}}function callAll(...a){return function($){a.forEach(j=>{j==null||j($)})}}var lodash_mergewith={exports:{}};lodash_mergewith.exports;(function(a,_){var $=200,j="__lodash_hash_undefined__",et=800,tt=16,rt=9007199254740991,nt="[object Arguments]",it="[object Array]",st="[object AsyncFunction]",ot="[object Boolean]",at="[object Date]",ut="[object Error]",ht="[object Function]",yt="[object GeneratorFunction]",wt="[object Map]",Ct="[object Number]",Pt="[object Null]",$t="[object Object]",Mt="[object Proxy]",Bt="[object RegExp]",Dt="[object Set]",zt="[object String]",Ot="[object Undefined]",It="[object WeakMap]",Lt="[object ArrayBuffer]",Ft="[object DataView]",jt="[object Float32Array]",bt="[object Float64Array]",vt="[object Int8Array]",ct="[object Int16Array]",dt="[object Int32Array]",mt="[object Uint8Array]",xt="[object Uint8ClampedArray]",At="[object Uint16Array]",Rt="[object Uint32Array]",St=/[\\^$.*+?()[\]{}|]/g,Tt=/^\[object .+?Constructor\]$/,Et=/^(?:0|[1-9]\d*)$/,Nt={};Nt[jt]=Nt[bt]=Nt[vt]=Nt[ct]=Nt[dt]=Nt[mt]=Nt[xt]=Nt[At]=Nt[Rt]=!0,Nt[nt]=Nt[it]=Nt[Lt]=Nt[ot]=Nt[Ft]=Nt[at]=Nt[ut]=Nt[ht]=Nt[wt]=Nt[Ct]=Nt[$t]=Nt[Bt]=Nt[Dt]=Nt[zt]=Nt[It]=!1;var tr=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ir=typeof self=="object"&&self&&self.Object===Object&&self,nr=tr||ir||Function("return this")(),Zt=_&&!_.nodeType&&_,Kt=Zt&&!0&&a&&!a.nodeType&&a,Qt=Kt&&Kt.exports===Zt,Ht=Qt&&tr.process,qt=function(){try{var Xt=Kt&&Kt.require&&Kt.require("util").types;return Xt||Ht&&Ht.binding&&Ht.binding("util")}catch{}}(),Jt=qt&&qt.isTypedArray;function ur(Xt,cr,gr){switch(gr.length){case 0:return Xt.call(cr);case 1:return Xt.call(cr,gr[0]);case 2:return Xt.call(cr,gr[0],gr[1]);case 3:return Xt.call(cr,gr[0],gr[1],gr[2])}return Xt.apply(cr,gr)}function xr(Xt,cr){for(var gr=-1,Dr=Array(Xt);++gr-1}function Gr(Xt,cr){var gr=this.__data__,Dr=Jn(gr,Xt);return Dr<0?(++this.size,gr.push([Xt,cr])):gr[Dr][1]=cr,this}hn.prototype.clear=fn,hn.prototype.delete=Kr,hn.prototype.get=Rn,hn.prototype.has=dn,hn.prototype.set=Gr;function gn(Xt){var cr=-1,gr=Xt==null?0:Xt.length;for(this.clear();++cr1?gr[rn-1]:void 0,Tn=rn>2?gr[2]:void 0;for(xn=Xt.length>3&&typeof xn=="function"?(rn--,xn):void 0,Tn&&Yl(gr[0],gr[1],Tn)&&(xn=rn<3?void 0:xn,rn=1),cr=Object(cr);++Dr-1&&Xt%1==0&&Xt0){if(++cr>=et)return arguments[0]}else cr=0;return Xt.apply(void 0,arguments)}}function $l(Xt){if(Xt!=null){try{return kr.call(Xt)}catch{}try{return Xt+""}catch{}}return""}function Xs(Xt,cr){return Xt===cr||Xt!==Xt&&cr!==cr}var Ao=es(function(){return arguments}())?es:function(Xt){return Is(Xt)&&Ar.call(Xt,"callee")&&!ar.call(Xt,"callee")},Bs=Array.isArray;function uo(Xt){return Xt!=null&&To(Xt.length)&&!$o(Xt)}function Tl(Xt){return Is(Xt)&&uo(Xt)}var fo=Wr||wr;function $o(Xt){if(!Ps(Xt))return!1;var cr=Qn(Xt);return cr==ht||cr==yt||cr==st||cr==Mt}function To(Xt){return typeof Xt=="number"&&Xt>-1&&Xt%1==0&&Xt<=rt}function Ps(Xt){var cr=typeof Xt;return Xt!=null&&(cr=="object"||cr=="function")}function Is(Xt){return Xt!=null&&typeof Xt=="object"}function Pl(Xt){if(!Is(Xt)||Qn(Xt)!=$t)return!1;var cr=Vt(Xt);if(cr===null)return!0;var gr=Ar.call(cr,"constructor")&&cr.constructor;return typeof gr=="function"&&gr instanceof gr&&kr.call(gr)==Br}var No=Jt?pr(Jt):us;function Po(Xt){return wo(Xt,Lo(Xt))}function Lo(Xt){return uo(Xt)?ps(Xt):Wn(Xt)}var Xl=Go(function(Xt,cr,gr,Dr){as(Xt,cr,gr,Dr)});function rs(Xt){return function(){return Xt}}function Xn(Xt){return Xt}function wr(){return!1}a.exports=Xl})(lodash_mergewith,lodash_mergewith.exports);var lodash_mergewithExports=lodash_mergewith.exports;const mergeWith=getDefaultExportFromCjs$1(lodash_mergewithExports);var isImportant=a=>/!(important)?$/.test(a),withoutImportant=a=>typeof a=="string"?a.replace(/!(important)?$/,"").trim():a,tokenToCSSVar=(a,_)=>$=>{const j=String(_),et=isImportant(j),tt=withoutImportant(j),rt=a?`${a}.${tt}`:tt;let nt=isObject$5($.__cssMap)&&rt in $.__cssMap?$.__cssMap[rt].varRef:_;return nt=withoutImportant(nt),et?`${nt} !important`:nt};function createTransform(a){const{scale:_,transform:$,compose:j}=a;return(tt,rt)=>{var nt;const it=tokenToCSSVar(_,tt)(rt);let st=(nt=$==null?void 0:$(it,rt))!=null?nt:it;return j&&(st=j(st,rt)),st}}var pipe$3=(...a)=>_=>a.reduce(($,j)=>j($),_);function toConfig(a,_){return $=>{const j={property:$,scale:a};return j.transform=createTransform({scale:a,transform:_}),j}}var getRtl=({rtl:a,ltr:_})=>$=>$.direction==="rtl"?a:_;function logical(a){const{property:_,scale:$,transform:j}=a;return{scale:$,property:getRtl(_),transform:$?createTransform({scale:$,compose:j}):j}}var transformTemplate=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function getTransformTemplate(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...transformTemplate].join(" ")}function getTransformGpuTemplate(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...transformTemplate].join(" ")}var filterTemplate={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},backdropFilterTemplate={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function getRingTemplate(a){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":a,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var flexDirectionTemplate={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},directionMap={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},valueSet=new Set(Object.values(directionMap)),globalSet=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),trimSpace=a=>a.trim();function parseGradient(a,_){if(a==null||globalSet.has(a))return a;if(!(isCSSFunction(a)||globalSet.has(a)))return`url('${a}')`;const et=/(^[a-z-A-Z]+)\((.*)\)/g.exec(a),tt=et==null?void 0:et[1],rt=et==null?void 0:et[2];if(!tt||!rt)return a;const nt=tt.includes("-gradient")?tt:`${tt}-gradient`,[it,...st]=rt.split(",").map(trimSpace).filter(Boolean);if((st==null?void 0:st.length)===0)return a;const ot=it in directionMap?directionMap[it]:it;st.unshift(ot);const at=st.map(ut=>{if(valueSet.has(ut))return ut;const ht=ut.indexOf(" "),[yt,wt]=ht!==-1?[ut.substr(0,ht),ut.substr(ht+1)]:[ut],Ct=isCSSFunction(wt)?wt:wt&&wt.split(" "),Pt=`colors.${yt}`,$t=Pt in _.__cssMap?_.__cssMap[Pt].varRef:yt;return Ct?[$t,...Array.isArray(Ct)?Ct:[Ct]].join(" "):$t});return`${nt}(${at.join(", ")})`}var isCSSFunction=a=>typeof a=="string"&&a.includes("(")&&a.includes(")"),gradientTransform=(a,_)=>parseGradient(a,_??{});function isCssVar(a){return/^var\(--.+\)$/.test(a)}var analyzeCSSValue=a=>{const _=parseFloat(a.toString()),$=a.toString().replace(String(_),"");return{unitless:!$,value:_,unit:$}},wrap=a=>_=>`${a}(${_})`,transformFunctions={filter(a){return a!=="auto"?a:filterTemplate},backdropFilter(a){return a!=="auto"?a:backdropFilterTemplate},ring(a){return getRingTemplate(transformFunctions.px(a))},bgClip(a){return a==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:a}},transform(a){return a==="auto"?getTransformTemplate():a==="auto-gpu"?getTransformGpuTemplate():a},vh(a){return a==="$100vh"?"var(--chakra-vh)":a},px(a){if(a==null)return a;const{unitless:_}=analyzeCSSValue(a);return _||typeof a=="number"?`${a}px`:a},fraction(a){return typeof a!="number"||a>1?a:`${a*100}%`},float(a,_){const $={left:"right",right:"left"};return _.direction==="rtl"?$[a]:a},degree(a){if(isCssVar(a)||a==null)return a;const _=typeof a=="string"&&!a.endsWith("deg");return typeof a=="number"||_?`${a}deg`:a},gradient:gradientTransform,blur:wrap("blur"),opacity:wrap("opacity"),brightness:wrap("brightness"),contrast:wrap("contrast"),dropShadow:wrap("drop-shadow"),grayscale:wrap("grayscale"),hueRotate:a=>wrap("hue-rotate")(transformFunctions.degree(a)),invert:wrap("invert"),saturate:wrap("saturate"),sepia:wrap("sepia"),bgImage(a){return a==null||isCSSFunction(a)||globalSet.has(a)?a:`url(${a})`},outline(a){const _=String(a)==="0"||String(a)==="none";return a!==null&&_?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:a}},flexDirection(a){var _;const{space:$,divide:j}=(_=flexDirectionTemplate[a])!=null?_:{},et={flexDirection:a};return $&&(et[$]=1),j&&(et[j]=1),et}},t$5={borderWidths:toConfig("borderWidths"),borderStyles:toConfig("borderStyles"),colors:toConfig("colors"),borders:toConfig("borders"),gradients:toConfig("gradients",transformFunctions.gradient),radii:toConfig("radii",transformFunctions.px),space:toConfig("space",pipe$3(transformFunctions.vh,transformFunctions.px)),spaceT:toConfig("space",pipe$3(transformFunctions.vh,transformFunctions.px)),degreeT(a){return{property:a,transform:transformFunctions.degree}},prop(a,_,$){return{property:a,scale:_,..._&&{transform:createTransform({scale:_,transform:$})}}},propT(a,_){return{property:a,transform:_}},sizes:toConfig("sizes",pipe$3(transformFunctions.vh,transformFunctions.px)),sizesT:toConfig("sizes",pipe$3(transformFunctions.vh,transformFunctions.fraction)),shadows:toConfig("shadows"),logical,blur:toConfig("blur",transformFunctions.blur)},background={background:t$5.colors("background"),backgroundColor:t$5.colors("backgroundColor"),backgroundImage:t$5.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:transformFunctions.bgClip},bgSize:t$5.prop("backgroundSize"),bgPosition:t$5.prop("backgroundPosition"),bg:t$5.colors("background"),bgColor:t$5.colors("backgroundColor"),bgPos:t$5.prop("backgroundPosition"),bgRepeat:t$5.prop("backgroundRepeat"),bgAttachment:t$5.prop("backgroundAttachment"),bgGradient:t$5.gradients("backgroundImage"),bgClip:{transform:transformFunctions.bgClip}};Object.assign(background,{bgImage:background.backgroundImage,bgImg:background.backgroundImage});var border={border:t$5.borders("border"),borderWidth:t$5.borderWidths("borderWidth"),borderStyle:t$5.borderStyles("borderStyle"),borderColor:t$5.colors("borderColor"),borderRadius:t$5.radii("borderRadius"),borderTop:t$5.borders("borderTop"),borderBlockStart:t$5.borders("borderBlockStart"),borderTopLeftRadius:t$5.radii("borderTopLeftRadius"),borderStartStartRadius:t$5.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:t$5.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:t$5.radii("borderTopRightRadius"),borderStartEndRadius:t$5.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:t$5.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:t$5.borders("borderRight"),borderInlineEnd:t$5.borders("borderInlineEnd"),borderBottom:t$5.borders("borderBottom"),borderBlockEnd:t$5.borders("borderBlockEnd"),borderBottomLeftRadius:t$5.radii("borderBottomLeftRadius"),borderBottomRightRadius:t$5.radii("borderBottomRightRadius"),borderLeft:t$5.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:t$5.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:t$5.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:t$5.borders(["borderLeft","borderRight"]),borderInline:t$5.borders("borderInline"),borderY:t$5.borders(["borderTop","borderBottom"]),borderBlock:t$5.borders("borderBlock"),borderTopWidth:t$5.borderWidths("borderTopWidth"),borderBlockStartWidth:t$5.borderWidths("borderBlockStartWidth"),borderTopColor:t$5.colors("borderTopColor"),borderBlockStartColor:t$5.colors("borderBlockStartColor"),borderTopStyle:t$5.borderStyles("borderTopStyle"),borderBlockStartStyle:t$5.borderStyles("borderBlockStartStyle"),borderBottomWidth:t$5.borderWidths("borderBottomWidth"),borderBlockEndWidth:t$5.borderWidths("borderBlockEndWidth"),borderBottomColor:t$5.colors("borderBottomColor"),borderBlockEndColor:t$5.colors("borderBlockEndColor"),borderBottomStyle:t$5.borderStyles("borderBottomStyle"),borderBlockEndStyle:t$5.borderStyles("borderBlockEndStyle"),borderLeftWidth:t$5.borderWidths("borderLeftWidth"),borderInlineStartWidth:t$5.borderWidths("borderInlineStartWidth"),borderLeftColor:t$5.colors("borderLeftColor"),borderInlineStartColor:t$5.colors("borderInlineStartColor"),borderLeftStyle:t$5.borderStyles("borderLeftStyle"),borderInlineStartStyle:t$5.borderStyles("borderInlineStartStyle"),borderRightWidth:t$5.borderWidths("borderRightWidth"),borderInlineEndWidth:t$5.borderWidths("borderInlineEndWidth"),borderRightColor:t$5.colors("borderRightColor"),borderInlineEndColor:t$5.colors("borderInlineEndColor"),borderRightStyle:t$5.borderStyles("borderRightStyle"),borderInlineEndStyle:t$5.borderStyles("borderInlineEndStyle"),borderTopRadius:t$5.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:t$5.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:t$5.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:t$5.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(border,{rounded:border.borderRadius,roundedTop:border.borderTopRadius,roundedTopLeft:border.borderTopLeftRadius,roundedTopRight:border.borderTopRightRadius,roundedTopStart:border.borderStartStartRadius,roundedTopEnd:border.borderStartEndRadius,roundedBottom:border.borderBottomRadius,roundedBottomLeft:border.borderBottomLeftRadius,roundedBottomRight:border.borderBottomRightRadius,roundedBottomStart:border.borderEndStartRadius,roundedBottomEnd:border.borderEndEndRadius,roundedLeft:border.borderLeftRadius,roundedRight:border.borderRightRadius,roundedStart:border.borderInlineStartRadius,roundedEnd:border.borderInlineEndRadius,borderStart:border.borderInlineStart,borderEnd:border.borderInlineEnd,borderTopStartRadius:border.borderStartStartRadius,borderTopEndRadius:border.borderStartEndRadius,borderBottomStartRadius:border.borderEndStartRadius,borderBottomEndRadius:border.borderEndEndRadius,borderStartRadius:border.borderInlineStartRadius,borderEndRadius:border.borderInlineEndRadius,borderStartWidth:border.borderInlineStartWidth,borderEndWidth:border.borderInlineEndWidth,borderStartColor:border.borderInlineStartColor,borderEndColor:border.borderInlineEndColor,borderStartStyle:border.borderInlineStartStyle,borderEndStyle:border.borderInlineEndStyle});var color$2={color:t$5.colors("color"),textColor:t$5.colors("color"),fill:t$5.colors("fill"),stroke:t$5.colors("stroke")},effect$3={boxShadow:t$5.shadows("boxShadow"),mixBlendMode:!0,blendMode:t$5.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:t$5.prop("backgroundBlendMode"),opacity:!0};Object.assign(effect$3,{shadow:effect$3.boxShadow});var filter$2={filter:{transform:transformFunctions.filter},blur:t$5.blur("--chakra-blur"),brightness:t$5.propT("--chakra-brightness",transformFunctions.brightness),contrast:t$5.propT("--chakra-contrast",transformFunctions.contrast),hueRotate:t$5.propT("--chakra-hue-rotate",transformFunctions.hueRotate),invert:t$5.propT("--chakra-invert",transformFunctions.invert),saturate:t$5.propT("--chakra-saturate",transformFunctions.saturate),dropShadow:t$5.propT("--chakra-drop-shadow",transformFunctions.dropShadow),backdropFilter:{transform:transformFunctions.backdropFilter},backdropBlur:t$5.blur("--chakra-backdrop-blur"),backdropBrightness:t$5.propT("--chakra-backdrop-brightness",transformFunctions.brightness),backdropContrast:t$5.propT("--chakra-backdrop-contrast",transformFunctions.contrast),backdropHueRotate:t$5.propT("--chakra-backdrop-hue-rotate",transformFunctions.hueRotate),backdropInvert:t$5.propT("--chakra-backdrop-invert",transformFunctions.invert),backdropSaturate:t$5.propT("--chakra-backdrop-saturate",transformFunctions.saturate)},flexbox={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:transformFunctions.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:t$5.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:t$5.space("gap"),rowGap:t$5.space("rowGap"),columnGap:t$5.space("columnGap")};Object.assign(flexbox,{flexDir:flexbox.flexDirection});var grid={gridGap:t$5.space("gridGap"),gridColumnGap:t$5.space("gridColumnGap"),gridRowGap:t$5.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},interactivity={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:transformFunctions.outline},outlineOffset:!0,outlineColor:t$5.colors("outlineColor")},layout$1={width:t$5.sizesT("width"),inlineSize:t$5.sizesT("inlineSize"),height:t$5.sizes("height"),blockSize:t$5.sizes("blockSize"),boxSize:t$5.sizes(["width","height"]),minWidth:t$5.sizes("minWidth"),minInlineSize:t$5.sizes("minInlineSize"),minHeight:t$5.sizes("minHeight"),minBlockSize:t$5.sizes("minBlockSize"),maxWidth:t$5.sizes("maxWidth"),maxInlineSize:t$5.sizes("maxInlineSize"),maxHeight:t$5.sizes("maxHeight"),maxBlockSize:t$5.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(a,_)=>{var $,j,et;return{[`@media screen and (min-width: ${(et=(j=($=_.__breakpoints)==null?void 0:$.get(a))==null?void 0:j.minW)!=null?et:a})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(a,_)=>{var $,j,et;return{[`@media screen and (max-width: ${(et=(j=($=_.__breakpoints)==null?void 0:$.get(a))==null?void 0:j._minW)!=null?et:a})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:t$5.propT("float",transformFunctions.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(layout$1,{w:layout$1.width,h:layout$1.height,minW:layout$1.minWidth,maxW:layout$1.maxWidth,minH:layout$1.minHeight,maxH:layout$1.maxHeight,overscroll:layout$1.overscrollBehavior,overscrollX:layout$1.overscrollBehaviorX,overscrollY:layout$1.overscrollBehaviorY});var list={listStyleType:!0,listStylePosition:!0,listStylePos:t$5.prop("listStylePosition"),listStyleImage:!0,listStyleImg:t$5.prop("listStyleImage")};function get$4(a,_,$,j){const et=typeof _=="string"?_.split("."):[_];for(j=0;j{const _=new WeakMap;return(j,et,tt,rt)=>{if(typeof j>"u")return a(j,et,tt);_.has(j)||_.set(j,new Map);const nt=_.get(j);if(nt.has(et))return nt.get(et);const it=a(j,et,tt,rt);return nt.set(et,it),it}},memoizedGet$1=memoize$1(get$4),srOnly={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},srFocusable={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},getWithPriority=(a,_,$)=>{const j={},et=memoizedGet$1(a,_,{});for(const tt in et)tt in $&&$[tt]!=null||(j[tt]=et[tt]);return j},others={srOnly:{transform(a){return a===!0?srOnly:a==="focusable"?srFocusable:{}}},layerStyle:{processResult:!0,transform:(a,_,$)=>getWithPriority(_,`layerStyles.${a}`,$)},textStyle:{processResult:!0,transform:(a,_,$)=>getWithPriority(_,`textStyles.${a}`,$)},apply:{processResult:!0,transform:(a,_,$)=>getWithPriority(_,a,$)}},position={position:!0,pos:t$5.prop("position"),zIndex:t$5.prop("zIndex","zIndices"),inset:t$5.spaceT("inset"),insetX:t$5.spaceT(["left","right"]),insetInline:t$5.spaceT("insetInline"),insetY:t$5.spaceT(["top","bottom"]),insetBlock:t$5.spaceT("insetBlock"),top:t$5.spaceT("top"),insetBlockStart:t$5.spaceT("insetBlockStart"),bottom:t$5.spaceT("bottom"),insetBlockEnd:t$5.spaceT("insetBlockEnd"),left:t$5.spaceT("left"),insetInlineStart:t$5.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:t$5.spaceT("right"),insetInlineEnd:t$5.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(position,{insetStart:position.insetInlineStart,insetEnd:position.insetInlineEnd});var ring={ring:{transform:transformFunctions.ring},ringColor:t$5.colors("--chakra-ring-color"),ringOffset:t$5.prop("--chakra-ring-offset-width"),ringOffsetColor:t$5.colors("--chakra-ring-offset-color"),ringInset:t$5.prop("--chakra-ring-inset")},space={margin:t$5.spaceT("margin"),marginTop:t$5.spaceT("marginTop"),marginBlockStart:t$5.spaceT("marginBlockStart"),marginRight:t$5.spaceT("marginRight"),marginInlineEnd:t$5.spaceT("marginInlineEnd"),marginBottom:t$5.spaceT("marginBottom"),marginBlockEnd:t$5.spaceT("marginBlockEnd"),marginLeft:t$5.spaceT("marginLeft"),marginInlineStart:t$5.spaceT("marginInlineStart"),marginX:t$5.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:t$5.spaceT("marginInline"),marginY:t$5.spaceT(["marginTop","marginBottom"]),marginBlock:t$5.spaceT("marginBlock"),padding:t$5.space("padding"),paddingTop:t$5.space("paddingTop"),paddingBlockStart:t$5.space("paddingBlockStart"),paddingRight:t$5.space("paddingRight"),paddingBottom:t$5.space("paddingBottom"),paddingBlockEnd:t$5.space("paddingBlockEnd"),paddingLeft:t$5.space("paddingLeft"),paddingInlineStart:t$5.space("paddingInlineStart"),paddingInlineEnd:t$5.space("paddingInlineEnd"),paddingX:t$5.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:t$5.space("paddingInline"),paddingY:t$5.space(["paddingTop","paddingBottom"]),paddingBlock:t$5.space("paddingBlock")};Object.assign(space,{m:space.margin,mt:space.marginTop,mr:space.marginRight,me:space.marginInlineEnd,marginEnd:space.marginInlineEnd,mb:space.marginBottom,ml:space.marginLeft,ms:space.marginInlineStart,marginStart:space.marginInlineStart,mx:space.marginX,my:space.marginY,p:space.padding,pt:space.paddingTop,py:space.paddingY,px:space.paddingX,pb:space.paddingBottom,pl:space.paddingLeft,ps:space.paddingInlineStart,paddingStart:space.paddingInlineStart,pr:space.paddingRight,pe:space.paddingInlineEnd,paddingEnd:space.paddingInlineEnd});var textDecoration={textDecorationColor:t$5.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:t$5.shadows("textShadow")},transform={clipPath:!0,transform:t$5.propT("transform",transformFunctions.transform),transformOrigin:!0,translateX:t$5.spaceT("--chakra-translate-x"),translateY:t$5.spaceT("--chakra-translate-y"),skewX:t$5.degreeT("--chakra-skew-x"),skewY:t$5.degreeT("--chakra-skew-y"),scaleX:t$5.prop("--chakra-scale-x"),scaleY:t$5.prop("--chakra-scale-y"),scale:t$5.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:t$5.degreeT("--chakra-rotate")},transition$1={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:t$5.prop("transitionDuration","transition.duration"),transitionProperty:t$5.prop("transitionProperty","transition.property"),transitionTimingFunction:t$5.prop("transitionTimingFunction","transition.easing")},typography$1={fontFamily:t$5.prop("fontFamily","fonts"),fontSize:t$5.prop("fontSize","fontSizes",transformFunctions.px),fontWeight:t$5.prop("fontWeight","fontWeights"),lineHeight:t$5.prop("lineHeight","lineHeights"),letterSpacing:t$5.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(a){if(a===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},scroll={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:t$5.spaceT("scrollMargin"),scrollMarginTop:t$5.spaceT("scrollMarginTop"),scrollMarginBottom:t$5.spaceT("scrollMarginBottom"),scrollMarginLeft:t$5.spaceT("scrollMarginLeft"),scrollMarginRight:t$5.spaceT("scrollMarginRight"),scrollMarginX:t$5.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:t$5.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:t$5.spaceT("scrollPadding"),scrollPaddingTop:t$5.spaceT("scrollPaddingTop"),scrollPaddingBottom:t$5.spaceT("scrollPaddingBottom"),scrollPaddingLeft:t$5.spaceT("scrollPaddingLeft"),scrollPaddingRight:t$5.spaceT("scrollPaddingRight"),scrollPaddingX:t$5.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:t$5.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function resolveReference(a){return isObject$5(a)&&a.reference?a.reference:String(a)}var toExpression=(a,..._)=>_.map(resolveReference).join(` ${a} `).replace(/calc/g,""),add$1=(...a)=>`calc(${toExpression("+",...a)})`,subtract$1=(...a)=>`calc(${toExpression("-",...a)})`,multiply$1=(...a)=>`calc(${toExpression("*",...a)})`,divide$1=(...a)=>`calc(${toExpression("/",...a)})`,negate$1=a=>{const _=resolveReference(a);return _!=null&&!Number.isNaN(parseFloat(_))?String(_).startsWith("-")?String(_).slice(1):`-${_}`:multiply$1(_,-1)},calc$1=Object.assign(a=>({add:(..._)=>calc$1(add$1(a,..._)),subtract:(..._)=>calc$1(subtract$1(a,..._)),multiply:(..._)=>calc$1(multiply$1(a,..._)),divide:(..._)=>calc$1(divide$1(a,..._)),negate:()=>calc$1(negate$1(a)),toString:()=>a.toString()}),{add:add$1,subtract:subtract$1,multiply:multiply$1,divide:divide$1,negate:negate$1});function replaceWhiteSpace$1(a,_="-"){return a.replace(/\s+/g,_)}function escape$2(a){const _=replaceWhiteSpace$1(a.toString());return escapeSymbol(escapeDot(_))}function escapeDot(a){return a.includes("\\.")?a:!Number.isInteger(parseFloat(a.toString()))?a.replace(".","\\."):a}function escapeSymbol(a){return a.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function addPrefix$1(a,_=""){return[_,a].filter(Boolean).join("-")}function toVarReference(a,_){return`var(${a}${_?`, ${_}`:""})`}function toVarDefinition(a,_=""){return escape$2(`--${addPrefix$1(a,_)}`)}function cssVar$1(a,_,$){const j=toVarDefinition(a,$);return{variable:j,reference:toVarReference(j,_)}}function defineCssVars(a,_){const $={};for(const j of _){if(Array.isArray(j)){const[et,tt]=j;$[et]=cssVar$1(`${a}-${et}`,tt);continue}$[j]=cssVar$1(`${a}-${j}`)}return $}function getLastItem(a){const _=a==null?0:a.length;return _?a[_-1]:void 0}function analyzeCSSValue2(a){const _=parseFloat(a.toString()),$=a.toString().replace(String(_),"");return{unitless:!$,value:_,unit:$}}function px$1(a){if(a==null)return a;const{unitless:_}=analyzeCSSValue2(a);return _||typeof a=="number"?`${a}px`:a}var sortByBreakpointValue=(a,_)=>parseInt(a[1],10)>parseInt(_[1],10)?1:-1,sortBps=a=>Object.fromEntries(Object.entries(a).sort(sortByBreakpointValue));function normalize$1(a){const _=sortBps(a);return Object.assign(Object.values(_),_)}function keys$1(a){const _=Object.keys(sortBps(a));return new Set(_)}function subtract2(a){var _;if(!a)return a;a=(_=px$1(a))!=null?_:a;const $=-.02;return typeof a=="number"?`${a+$}`:a.replace(/(\d+\.?\d*)/u,j=>`${parseFloat(j)+$}`)}function toMediaQueryString(a,_){const $=["@media screen"];return a&&$.push("and",`(min-width: ${px$1(a)})`),_&&$.push("and",`(max-width: ${px$1(_)})`),$.join(" ")}function analyzeBreakpoints(a){var _;if(!a)return null;a.base=(_=a.base)!=null?_:"0px";const $=normalize$1(a),j=Object.entries(a).sort(sortByBreakpointValue).map(([rt,nt],it,st)=>{var ot;let[,at]=(ot=st[it+1])!=null?ot:[];return at=parseFloat(at)>0?subtract2(at):void 0,{_minW:subtract2(nt),breakpoint:rt,minW:nt,maxW:at,maxWQuery:toMediaQueryString(null,at),minWQuery:toMediaQueryString(nt),minMaxQuery:toMediaQueryString(nt,at)}}),et=keys$1(a),tt=Array.from(et.values());return{keys:et,normalized:$,isResponsive(rt){const nt=Object.keys(rt);return nt.length>0&&nt.every(it=>et.has(it))},asObject:sortBps(a),asArray:normalize$1(a),details:j,get(rt){return j.find(nt=>nt.breakpoint===rt)},media:[null,...$.map(rt=>toMediaQueryString(rt)).slice(1)],toArrayValue(rt){if(!isObject$5(rt))throw new Error("toArrayValue: value must be an object");const nt=tt.map(it=>{var st;return(st=rt[it])!=null?st:null});for(;getLastItem(nt)===null;)nt.pop();return nt},toObjectValue(rt){if(!Array.isArray(rt))throw new Error("toObjectValue: value must be an array");return rt.reduce((nt,it,st)=>{const ot=tt[st];return ot!=null&&it!=null&&(nt[ot]=it),nt},{})}}}var state$1={hover:(a,_)=>`${a}:hover ${_}, ${a}[data-hover] ${_}`,focus:(a,_)=>`${a}:focus ${_}, ${a}[data-focus] ${_}`,focusVisible:(a,_)=>`${a}:focus-visible ${_}`,focusWithin:(a,_)=>`${a}:focus-within ${_}`,active:(a,_)=>`${a}:active ${_}, ${a}[data-active] ${_}`,disabled:(a,_)=>`${a}:disabled ${_}, ${a}[data-disabled] ${_}`,invalid:(a,_)=>`${a}:invalid ${_}, ${a}[data-invalid] ${_}`,checked:(a,_)=>`${a}:checked ${_}, ${a}[data-checked] ${_}`,indeterminate:(a,_)=>`${a}:indeterminate ${_}, ${a}[aria-checked=mixed] ${_}, ${a}[data-indeterminate] ${_}`,readOnly:(a,_)=>`${a}:read-only ${_}, ${a}[readonly] ${_}, ${a}[data-read-only] ${_}`,expanded:(a,_)=>`${a}:read-only ${_}, ${a}[aria-expanded=true] ${_}, ${a}[data-expanded] ${_}`,placeholderShown:(a,_)=>`${a}:placeholder-shown ${_}`},toGroup=a=>merge$2(_=>a(_,"&"),"[role=group]","[data-group]",".group"),toPeer=a=>merge$2(_=>a(_,"~ &"),"[data-peer]",".peer"),merge$2=(a,..._)=>_.map(a).join(", "),pseudoSelectors={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:toGroup(state$1.hover),_peerHover:toPeer(state$1.hover),_groupFocus:toGroup(state$1.focus),_peerFocus:toPeer(state$1.focus),_groupFocusVisible:toGroup(state$1.focusVisible),_peerFocusVisible:toPeer(state$1.focusVisible),_groupActive:toGroup(state$1.active),_peerActive:toPeer(state$1.active),_groupDisabled:toGroup(state$1.disabled),_peerDisabled:toPeer(state$1.disabled),_groupInvalid:toGroup(state$1.invalid),_peerInvalid:toPeer(state$1.invalid),_groupChecked:toGroup(state$1.checked),_peerChecked:toPeer(state$1.checked),_groupFocusWithin:toGroup(state$1.focusWithin),_peerFocusWithin:toPeer(state$1.focusWithin),_peerPlaceholderShown:toPeer(state$1.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},pseudoPropNames=Object.keys(pseudoSelectors);function tokenToCssVar(a,_){return cssVar$1(String(a).replace(/\./g,"-"),void 0,_)}function createThemeVars(a,_){let $={};const j={};for(const[et,tt]of Object.entries(a)){const{isSemantic:rt,value:nt}=tt,{variable:it,reference:st}=tokenToCssVar(et,_==null?void 0:_.cssVarPrefix);if(!rt){if(et.startsWith("space")){const ut=et.split("."),[ht,...yt]=ut,wt=`${ht}.-${yt.join(".")}`,Ct=calc$1.negate(nt),Pt=calc$1.negate(st);j[wt]={value:Ct,var:it,varRef:Pt}}$[it]=nt,j[et]={value:nt,var:it,varRef:st};continue}const ot=ut=>{const yt=[String(et).split(".")[0],ut].join(".");if(!a[yt])return ut;const{reference:Ct}=tokenToCssVar(yt,_==null?void 0:_.cssVarPrefix);return Ct},at=isObject$5(nt)?nt:{default:nt};$=mergeWith($,Object.entries(at).reduce((ut,[ht,yt])=>{var wt,Ct;if(!yt)return ut;const Pt=ot(`${yt}`);if(ht==="default")return ut[it]=Pt,ut;const $t=(Ct=(wt=pseudoSelectors)==null?void 0:wt[ht])!=null?Ct:ht;return ut[$t]={[it]:Pt},ut},{})),j[et]={value:st,var:it,varRef:st}}return{cssVars:$,cssMap:j}}function omit$6(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}function pick$2(a,_){const $={};for(const j of _)j in a&&($[j]=a[j]);return $}function isObject5(a){return typeof a=="object"&&a!=null&&!Array.isArray(a)}function walkObject(a,_,$={}){const{stop:j,getKey:et}=$;function tt(rt,nt=[]){var it;if(isObject5(rt)||Array.isArray(rt)){const st={};for(const[ot,at]of Object.entries(rt)){const ut=(it=et==null?void 0:et(ot))!=null?it:ot,ht=[...nt,ut];if(j!=null&&j(rt,ht))return _(rt,nt);st[ut]=tt(at,ht)}return st}return _(rt,nt)}return tt(a)}var tokens$1=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function extractTokens(a){return pick$2(a,tokens$1)}function extractSemanticTokens(a){return a.semanticTokens}function omitVars(a){const{__cssMap:_,__cssVars:$,__breakpoints:j,...et}=a;return et}var isSemanticCondition=a=>pseudoPropNames.includes(a)||a==="default";function flattenTokens({tokens:a,semanticTokens:_}){const $={};return walkObject(a,(j,et)=>{j!=null&&($[et.join(".")]={isSemantic:!1,value:j})}),walkObject(_,(j,et)=>{j!=null&&($[et.join(".")]={isSemantic:!0,value:j})},{stop:j=>Object.keys(j).every(isSemanticCondition)}),$}function toCSSVar(a){var _;const $=omitVars(a),j=extractTokens($),et=extractSemanticTokens($),tt=flattenTokens({tokens:j,semanticTokens:et}),rt=(_=$.config)==null?void 0:_.cssVarPrefix,{cssMap:nt,cssVars:it}=createThemeVars(tt,{cssVarPrefix:rt});return Object.assign($,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...it},__cssMap:nt,__breakpoints:analyzeBreakpoints($.breakpoints)}),$}var systemProps=mergeWith({},background,border,color$2,flexbox,layout$1,filter$2,ring,interactivity,grid,others,position,effect$3,space,scroll,typography$1,textDecoration,transform,list,transition$1),layoutSystem=Object.assign({},space,layout$1,flexbox,grid,position),layoutPropNames=Object.keys(layoutSystem),propNames=[...Object.keys(systemProps),...pseudoPropNames],styleProps={...systemProps,...pseudoSelectors},isStyleProp=a=>a in styleProps,expandResponsive=a=>_=>{if(!_.__breakpoints)return a;const{isResponsive:$,toArrayValue:j,media:et}=_.__breakpoints,tt={};for(const rt in a){let nt=runIfFn$2(a[rt],_);if(nt==null)continue;if(nt=isObject$5(nt)&&$(nt)?j(nt):nt,!Array.isArray(nt)){tt[rt]=nt;continue}const it=nt.slice(0,et.length).length;for(let st=0;sta.startsWith("--")&&typeof _=="string"&&!isCssVar2(_),resolveTokenValue=(a,_)=>{var $,j;if(_==null)return _;const et=it=>{var st,ot;return(ot=(st=a.__cssMap)==null?void 0:st[it])==null?void 0:ot.varRef},tt=it=>{var st;return(st=et(it))!=null?st:it},[rt,nt]=splitByComma(_);return _=(j=($=et(rt))!=null?$:tt(nt))!=null?j:tt(_),_};function getCss(a){const{configs:_={},pseudos:$={},theme:j}=a,et=(tt,rt=!1)=>{var nt,it,st;const ot=runIfFn$2(tt,j),at=expandResponsive(ot)(j);let ut={};for(let ht in at){const yt=at[ht];let wt=runIfFn$2(yt,j);ht in $&&(ht=$[ht]),isCSSVariableTokenValue(ht,wt)&&(wt=resolveTokenValue(j,wt));let Ct=_[ht];if(Ct===!0&&(Ct={property:ht}),isObject$5(wt)){ut[ht]=(nt=ut[ht])!=null?nt:{},ut[ht]=mergeWith({},ut[ht],et(wt,!0));continue}let Pt=(st=(it=Ct==null?void 0:Ct.transform)==null?void 0:it.call(Ct,wt,j,ot))!=null?st:wt;Pt=Ct!=null&&Ct.processResult?et(Pt,!0):Pt;const $t=runIfFn$2(Ct==null?void 0:Ct.property,j);if(!rt&&(Ct!=null&&Ct.static)){const Mt=runIfFn$2(Ct.static,j);ut=mergeWith({},ut,Mt)}if($t&&Array.isArray($t)){for(const Mt of $t)ut[Mt]=Pt;continue}if($t){$t==="&"&&isObject$5(Pt)?ut=mergeWith({},ut,Pt):ut[$t]=Pt;continue}if(isObject$5(Pt)){ut=mergeWith({},ut,Pt);continue}ut[ht]=Pt}return ut};return et}var css=a=>_=>getCss({theme:_,pseudos:pseudoSelectors,configs:systemProps})(a);function defineStyle(a){return a}function defineStyleConfig(a){return a}function createMultiStyleConfigHelpers(a){return{definePartsStyle(_){return _},defineMultiStyleConfig(_){return{parts:a,..._}}}}function normalize2(a,_){if(Array.isArray(a))return a;if(isObject$5(a))return _(a);if(a!=null)return[a]}function getNextIndex$1(a,_){for(let $=_+1;${mergeWith(st,{[Mt]:ut?$t[Mt]:{[Pt]:$t[Mt]}})});continue}if(!ht){ut?mergeWith(st,$t):st[Pt]=$t;continue}st[Pt]=$t}}return st}}function resolveStyleConfig(a){return _=>{var $;const{variant:j,size:et,theme:tt}=_,rt=createResolver(tt);return mergeWith({},runIfFn$2(($=a.baseStyle)!=null?$:{},_),rt(a,"sizes",et,_),rt(a,"variants",j,_))}}function getCSSVar(a,_,$){var j,et,tt;return(tt=(et=(j=a.__cssMap)==null?void 0:j[`${_}.${$}`])==null?void 0:et.varRef)!=null?tt:$}function omitThemingProps(a){return omit$6(a,["styleConfig","size","variant","colorScheme"])}var requiredChakraThemeKeys=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function isChakraTheme(a){return isObject$5(a)?requiredChakraThemeKeys.every(_=>Object.prototype.hasOwnProperty.call(a,_)):!1}var transitionProperty={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},transitionTimingFunction={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},transitionDuration={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},transition={property:transitionProperty,easing:transitionTimingFunction,duration:transitionDuration},transition_default=transition,zIndices={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},z_index_default=zIndices,borders$1={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},borders_default=borders$1,breakpoints={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},breakpoints_default=breakpoints,colors$1={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},colors_default=colors$1,radii={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},radius_default=radii,shadows={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},shadows_default=shadows,blur={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},blur_default=blur,typography={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},typography_default=typography,spacing={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},largeSizes={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},container={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},sizes$o={...spacing,...largeSizes,container},sizes_default=sizes$o,foundations={breakpoints:breakpoints_default,zIndices:z_index_default,radii:radius_default,blur:blur_default,colors:colors_default,...typography_default,sizes:sizes_default,shadows:shadows_default,space:spacing,borders:borders_default,transition:transition_default},{defineMultiStyleConfig:defineMultiStyleConfig$w,definePartsStyle:definePartsStyle$w}=createMultiStyleConfigHelpers(["stepper","step","title","description","indicator","separator","icon","number"]),$size$4=cssVar$1("stepper-indicator-size"),$iconSize=cssVar$1("stepper-icon-size"),$titleFontSize=cssVar$1("stepper-title-font-size"),$descFontSize=cssVar$1("stepper-description-font-size"),$accentColor=cssVar$1("stepper-accent-color"),baseStyle$J=definePartsStyle$w(({colorScheme:a})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[$accentColor.variable]:`colors.${a}.500`,_dark:{[$accentColor.variable]:`colors.${a}.200`}},title:{fontSize:$titleFontSize.reference,fontWeight:"medium"},description:{fontSize:$descFontSize.reference,color:"chakra-subtle-text"},number:{fontSize:$titleFontSize.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:$iconSize.reference,height:$iconSize.reference},indicator:{flexShrink:0,borderRadius:"full",width:$size$4.reference,height:$size$4.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:$accentColor.reference},"&[data-status=complete]":{bg:$accentColor.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:$accentColor.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${$size$4.reference} - 8px)`,top:`calc(${$size$4.reference} + 4px)`,insetStart:`calc(${$size$4.reference} / 2 - 1px)`}}})),stepperTheme=defineMultiStyleConfig$w({baseStyle:baseStyle$J,sizes:{xs:definePartsStyle$w({stepper:{[$size$4.variable]:"sizes.4",[$iconSize.variable]:"sizes.3",[$titleFontSize.variable]:"fontSizes.xs",[$descFontSize.variable]:"fontSizes.xs"}}),sm:definePartsStyle$w({stepper:{[$size$4.variable]:"sizes.6",[$iconSize.variable]:"sizes.4",[$titleFontSize.variable]:"fontSizes.sm",[$descFontSize.variable]:"fontSizes.xs"}}),md:definePartsStyle$w({stepper:{[$size$4.variable]:"sizes.8",[$iconSize.variable]:"sizes.5",[$titleFontSize.variable]:"fontSizes.md",[$descFontSize.variable]:"fontSizes.sm"}}),lg:definePartsStyle$w({stepper:{[$size$4.variable]:"sizes.10",[$iconSize.variable]:"sizes.6",[$titleFontSize.variable]:"fontSizes.lg",[$descFontSize.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function anatomy(a,_={}){let $=!1;function j(){if(!$){$=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function et(...ot){j();for(const at of ot)_[at]=it(at);return anatomy(a,_)}function tt(...ot){for(const at of ot)at in _||(_[at]=it(at));return anatomy(a,_)}function rt(){return Object.fromEntries(Object.entries(_).map(([at,ut])=>[at,ut.selector]))}function nt(){return Object.fromEntries(Object.entries(_).map(([at,ut])=>[at,ut.className]))}function it(ot){const ht=`chakra-${(["container","root"].includes(ot??"")?[a]:[a,ot]).filter(Boolean).join("__")}`;return{className:ht,selector:`.${ht}`,toString:()=>ot}}return{parts:et,toPart:it,extend:tt,selectors:rt,classnames:nt,get keys(){return Object.keys(_)},__type:{}}}var accordionAnatomy=anatomy("accordion").parts("root","container","button","panel").extend("icon"),alertAnatomy=anatomy("alert").parts("title","description","container").extend("icon","spinner"),avatarAnatomy=anatomy("avatar").parts("label","badge","container").extend("excessLabel","group"),breadcrumbAnatomy=anatomy("breadcrumb").parts("link","item","container").extend("separator");anatomy("button").parts();var checkboxAnatomy=anatomy("checkbox").parts("control","icon","container").extend("label");anatomy("progress").parts("track","filledTrack").extend("label");var drawerAnatomy=anatomy("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),editableAnatomy=anatomy("editable").parts("preview","input","textarea"),formAnatomy=anatomy("form").parts("container","requiredIndicator","helperText"),formErrorAnatomy=anatomy("formError").parts("text","icon"),inputAnatomy=anatomy("input").parts("addon","field","element","group"),listAnatomy=anatomy("list").parts("container","item","icon"),menuAnatomy=anatomy("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),modalAnatomy=anatomy("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),numberInputAnatomy=anatomy("numberinput").parts("root","field","stepperGroup","stepper");anatomy("pininput").parts("field");var popoverAnatomy=anatomy("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),progressAnatomy=anatomy("progress").parts("label","filledTrack","track"),radioAnatomy=anatomy("radio").parts("container","control","label"),selectAnatomy=anatomy("select").parts("field","icon"),sliderAnatomy=anatomy("slider").parts("container","track","thumb","filledTrack","mark"),statAnatomy=anatomy("stat").parts("container","label","helpText","number","icon"),switchAnatomy=anatomy("switch").parts("container","track","thumb","label"),tableAnatomy=anatomy("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tabsAnatomy=anatomy("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),tagAnatomy=anatomy("tag").parts("container","label","closeButton"),cardAnatomy=anatomy("card").parts("container","header","body","footer");anatomy("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function guard(a,_,$){return Math.min(Math.max(a,$),_)}class ColorError extends Error{constructor(_){super(`Failed to parse color: "${_}"`)}}var ColorError$1=ColorError;function parseToRgba(a){if(typeof a!="string")throw new ColorError$1(a);if(a.trim().toLowerCase()==="transparent")return[0,0,0,0];let _=a.trim();_=namedColorRegex.test(a)?nameToHex(a):a;const $=reducedHexRegex.exec(_);if($){const rt=Array.from($).slice(1);return[...rt.slice(0,3).map(nt=>parseInt(r$3(nt,2),16)),parseInt(r$3(rt[3]||"f",2),16)/255]}const j=hexRegex.exec(_);if(j){const rt=Array.from(j).slice(1);return[...rt.slice(0,3).map(nt=>parseInt(nt,16)),parseInt(rt[3]||"ff",16)/255]}const et=rgbaRegex.exec(_);if(et){const rt=Array.from(et).slice(1);return[...rt.slice(0,3).map(nt=>parseInt(nt,10)),parseFloat(rt[3]||"1")]}const tt=hslaRegex.exec(_);if(tt){const[rt,nt,it,st]=Array.from(tt).slice(1).map(parseFloat);if(guard(0,100,nt)!==nt)throw new ColorError$1(a);if(guard(0,100,it)!==it)throw new ColorError$1(a);return[...hslToRgb(rt,nt,it),Number.isNaN(st)?1:st]}throw new ColorError$1(a)}function hash$8(a){let _=5381,$=a.length;for(;$;)_=_*33^a.charCodeAt(--$);return(_>>>0)%2341}const colorToInt=a=>parseInt(a.replace(/_/g,""),36),compressedColorMap="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((a,_)=>{const $=colorToInt(_.substring(0,3)),j=colorToInt(_.substring(3)).toString(16);let et="";for(let tt=0;tt<6-j.length;tt++)et+="0";return a[$]=`${et}${j}`,a},{});function nameToHex(a){const _=a.toLowerCase().trim(),$=compressedColorMap[hash$8(_)];if(!$)throw new ColorError$1(a);return`#${$}`}const r$3=(a,_)=>Array.from(Array(_)).map(()=>a).join(""),reducedHexRegex=new RegExp(`^#${r$3("([a-f0-9])",3)}([a-f0-9])?$`,"i"),hexRegex=new RegExp(`^#${r$3("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),rgbaRegex=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$3(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),hslaRegex=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,namedColorRegex=/^[a-z]+$/i,roundColor=a=>Math.round(a*255),hslToRgb=(a,_,$)=>{let j=$/100;if(_===0)return[j,j,j].map(roundColor);const et=(a%360+360)%360/60,tt=(1-Math.abs(2*j-1))*(_/100),rt=tt*(1-Math.abs(et%2-1));let nt=0,it=0,st=0;et>=0&&et<1?(nt=tt,it=rt):et>=1&&et<2?(nt=rt,it=tt):et>=2&&et<3?(it=tt,st=rt):et>=3&&et<4?(it=rt,st=tt):et>=4&&et<5?(nt=rt,st=tt):et>=5&&et<6&&(nt=tt,st=rt);const ot=j-tt/2,at=nt+ot,ut=it+ot,ht=st+ot;return[at,ut,ht].map(roundColor)};function rgba$1(a,_,$,j){return`rgba(${guard(0,255,a).toFixed()}, ${guard(0,255,_).toFixed()}, ${guard(0,255,$).toFixed()}, ${parseFloat(guard(0,1,j).toFixed(3))})`}function transparentize$1(a,_){const[$,j,et,tt]=parseToRgba(a);return rgba$1($,j,et,tt-_)}function toHex$3(a){const[_,$,j,et]=parseToRgba(a);let tt=rt=>{const nt=guard(0,255,rt).toString(16);return nt.length===1?`0${nt}`:nt};return`#${tt(_)}${tt($)}${tt(j)}${et<1?tt(Math.round(et*255)):""}`}function dlv_es_default(a,_,$,j,et){for(_=_.split?_.split("."):_,j=0;j<_.length;j++)a=a?a[_[j]]:et;return a===et?$:a}var isEmptyObject$1=a=>Object.keys(a).length===0,getColor=(a,_,$)=>{const j=dlv_es_default(a,`colors.${_}`,_);try{return toHex$3(j),j}catch{return $??"#000000"}},getBrightness=a=>{const[_,$,j]=parseToRgba(a);return(_*299+$*587+j*114)/1e3},tone=a=>_=>{const $=getColor(_,a);return getBrightness($)<128?"dark":"light"},isDark=a=>_=>tone(a)(_)==="dark",transparentize=(a,_)=>$=>{const j=getColor($,a);return transparentize$1(j,1-_)};function generateStripe(a="1rem",_="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + `;return`!${tt?rt:nt}`.trim()}function ColorModeScript(a={}){const{nonce:_}=a;return jsxRuntimeExports.jsx("script",{id:"chakra-script",nonce:_,dangerouslySetInnerHTML:{__html:getScriptSrc(a)}})}function useChakra(){const a=useColorMode(),_=useTheme();return{...a,theme:_}}function getTokenValue(a,_,$){var j,et;if(_==null)return _;const tt=rt=>{var nt,it;return(it=(nt=a.__cssMap)==null?void 0:nt[rt])==null?void 0:it.value};return(et=(j=tt(_))!=null?j:tt($))!=null?et:$}function getToken(a,_,$){const j=Array.isArray(_)?_:[_],et=Array.isArray($)?$:[$];return tt=>{const rt=et.filter(Boolean),nt=j.map((it,st)=>{var ot;const at=`${a}.${it}`;return getTokenValue(tt,at,(ot=rt[st])!=null?ot:it)});return Array.isArray(_)?nt:nt[0]}}var cx=(...a)=>a.filter(Boolean).join(" ");function isDev(){return!1}function isObject$5(a){const _=typeof a;return a!=null&&(_==="object"||_==="function")&&!Array.isArray(a)}var warn=a=>{const{condition:_,message:$}=a;_&&isDev()&&console.warn($)};function runIfFn$2(a,..._){return isFunction$8(a)?a(..._):a}var isFunction$8=a=>typeof a=="function",dataAttr=a=>a?"":void 0,ariaAttr=a=>a?!0:void 0;function callAllHandlers$1(...a){return function($){a.some(j=>(j==null||j($),$==null?void 0:$.defaultPrevented))}}function callAll(...a){return function($){a.forEach(j=>{j==null||j($)})}}var lodash_mergewith={exports:{}};lodash_mergewith.exports;(function(a,_){var $=200,j="__lodash_hash_undefined__",et=800,tt=16,rt=9007199254740991,nt="[object Arguments]",it="[object Array]",st="[object AsyncFunction]",ot="[object Boolean]",at="[object Date]",ut="[object Error]",ht="[object Function]",yt="[object GeneratorFunction]",wt="[object Map]",Ct="[object Number]",Pt="[object Null]",$t="[object Object]",Mt="[object Proxy]",Bt="[object RegExp]",Dt="[object Set]",zt="[object String]",Ot="[object Undefined]",It="[object WeakMap]",Lt="[object ArrayBuffer]",Ft="[object DataView]",jt="[object Float32Array]",bt="[object Float64Array]",vt="[object Int8Array]",ct="[object Int16Array]",dt="[object Int32Array]",mt="[object Uint8Array]",xt="[object Uint8ClampedArray]",At="[object Uint16Array]",Rt="[object Uint32Array]",St=/[\\^$.*+?()[\]{}|]/g,Tt=/^\[object .+?Constructor\]$/,Et=/^(?:0|[1-9]\d*)$/,Nt={};Nt[jt]=Nt[bt]=Nt[vt]=Nt[ct]=Nt[dt]=Nt[mt]=Nt[xt]=Nt[At]=Nt[Rt]=!0,Nt[nt]=Nt[it]=Nt[Lt]=Nt[ot]=Nt[Ft]=Nt[at]=Nt[ut]=Nt[ht]=Nt[wt]=Nt[Ct]=Nt[$t]=Nt[Bt]=Nt[Dt]=Nt[zt]=Nt[It]=!1;var tr=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ir=typeof self=="object"&&self&&self.Object===Object&&self,nr=tr||ir||Function("return this")(),Zt=_&&!_.nodeType&&_,Kt=Zt&&!0&&a&&!a.nodeType&&a,Qt=Kt&&Kt.exports===Zt,Ht=Qt&&tr.process,qt=function(){try{var Xt=Kt&&Kt.require&&Kt.require("util").types;return Xt||Ht&&Ht.binding&&Ht.binding("util")}catch{}}(),Jt=qt&&qt.isTypedArray;function ur(Xt,cr,gr){switch(gr.length){case 0:return Xt.call(cr);case 1:return Xt.call(cr,gr[0]);case 2:return Xt.call(cr,gr[0],gr[1]);case 3:return Xt.call(cr,gr[0],gr[1],gr[2])}return Xt.apply(cr,gr)}function xr(Xt,cr){for(var gr=-1,Dr=Array(Xt);++gr-1}function Gr(Xt,cr){var gr=this.__data__,Dr=Jn(gr,Xt);return Dr<0?(++this.size,gr.push([Xt,cr])):gr[Dr][1]=cr,this}hn.prototype.clear=fn,hn.prototype.delete=Kr,hn.prototype.get=Rn,hn.prototype.has=dn,hn.prototype.set=Gr;function gn(Xt){var cr=-1,gr=Xt==null?0:Xt.length;for(this.clear();++cr1?gr[rn-1]:void 0,Tn=rn>2?gr[2]:void 0;for(xn=Xt.length>3&&typeof xn=="function"?(rn--,xn):void 0,Tn&&Yl(gr[0],gr[1],Tn)&&(xn=rn<3?void 0:xn,rn=1),cr=Object(cr);++Dr-1&&Xt%1==0&&Xt0){if(++cr>=et)return arguments[0]}else cr=0;return Xt.apply(void 0,arguments)}}function $l(Xt){if(Xt!=null){try{return kr.call(Xt)}catch{}try{return Xt+""}catch{}}return""}function Xs(Xt,cr){return Xt===cr||Xt!==Xt&&cr!==cr}var Ao=es(function(){return arguments}())?es:function(Xt){return Is(Xt)&&Ar.call(Xt,"callee")&&!ar.call(Xt,"callee")},Bs=Array.isArray;function uo(Xt){return Xt!=null&&To(Xt.length)&&!$o(Xt)}function Tl(Xt){return Is(Xt)&&uo(Xt)}var fo=Wr||wr;function $o(Xt){if(!Ps(Xt))return!1;var cr=Qn(Xt);return cr==ht||cr==yt||cr==st||cr==Mt}function To(Xt){return typeof Xt=="number"&&Xt>-1&&Xt%1==0&&Xt<=rt}function Ps(Xt){var cr=typeof Xt;return Xt!=null&&(cr=="object"||cr=="function")}function Is(Xt){return Xt!=null&&typeof Xt=="object"}function Pl(Xt){if(!Is(Xt)||Qn(Xt)!=$t)return!1;var cr=Vt(Xt);if(cr===null)return!0;var gr=Ar.call(cr,"constructor")&&cr.constructor;return typeof gr=="function"&&gr instanceof gr&&kr.call(gr)==Br}var No=Jt?pr(Jt):us;function Po(Xt){return wo(Xt,Lo(Xt))}function Lo(Xt){return uo(Xt)?ps(Xt):Wn(Xt)}var Xl=Go(function(Xt,cr,gr,Dr){as(Xt,cr,gr,Dr)});function rs(Xt){return function(){return Xt}}function Xn(Xt){return Xt}function wr(){return!1}a.exports=Xl})(lodash_mergewith,lodash_mergewith.exports);var lodash_mergewithExports=lodash_mergewith.exports;const mergeWith=getDefaultExportFromCjs$1(lodash_mergewithExports);var isImportant=a=>/!(important)?$/.test(a),withoutImportant=a=>typeof a=="string"?a.replace(/!(important)?$/,"").trim():a,tokenToCSSVar=(a,_)=>$=>{const j=String(_),et=isImportant(j),tt=withoutImportant(j),rt=a?`${a}.${tt}`:tt;let nt=isObject$5($.__cssMap)&&rt in $.__cssMap?$.__cssMap[rt].varRef:_;return nt=withoutImportant(nt),et?`${nt} !important`:nt};function createTransform(a){const{scale:_,transform:$,compose:j}=a;return(tt,rt)=>{var nt;const it=tokenToCSSVar(_,tt)(rt);let st=(nt=$==null?void 0:$(it,rt))!=null?nt:it;return j&&(st=j(st,rt)),st}}var pipe$3=(...a)=>_=>a.reduce(($,j)=>j($),_);function toConfig(a,_){return $=>{const j={property:$,scale:a};return j.transform=createTransform({scale:a,transform:_}),j}}var getRtl=({rtl:a,ltr:_})=>$=>$.direction==="rtl"?a:_;function logical(a){const{property:_,scale:$,transform:j}=a;return{scale:$,property:getRtl(_),transform:$?createTransform({scale:$,compose:j}):j}}var transformTemplate=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function getTransformTemplate(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...transformTemplate].join(" ")}function getTransformGpuTemplate(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...transformTemplate].join(" ")}var filterTemplate={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},backdropFilterTemplate={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function getRingTemplate(a){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":a,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var flexDirectionTemplate={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},directionMap={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},valueSet=new Set(Object.values(directionMap)),globalSet=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),trimSpace=a=>a.trim();function parseGradient(a,_){if(a==null||globalSet.has(a))return a;if(!(isCSSFunction(a)||globalSet.has(a)))return`url('${a}')`;const et=/(^[a-z-A-Z]+)\((.*)\)/g.exec(a),tt=et==null?void 0:et[1],rt=et==null?void 0:et[2];if(!tt||!rt)return a;const nt=tt.includes("-gradient")?tt:`${tt}-gradient`,[it,...st]=rt.split(",").map(trimSpace).filter(Boolean);if((st==null?void 0:st.length)===0)return a;const ot=it in directionMap?directionMap[it]:it;st.unshift(ot);const at=st.map(ut=>{if(valueSet.has(ut))return ut;const ht=ut.indexOf(" "),[yt,wt]=ht!==-1?[ut.substr(0,ht),ut.substr(ht+1)]:[ut],Ct=isCSSFunction(wt)?wt:wt&&wt.split(" "),Pt=`colors.${yt}`,$t=Pt in _.__cssMap?_.__cssMap[Pt].varRef:yt;return Ct?[$t,...Array.isArray(Ct)?Ct:[Ct]].join(" "):$t});return`${nt}(${at.join(", ")})`}var isCSSFunction=a=>typeof a=="string"&&a.includes("(")&&a.includes(")"),gradientTransform=(a,_)=>parseGradient(a,_??{});function isCssVar(a){return/^var\(--.+\)$/.test(a)}var analyzeCSSValue=a=>{const _=parseFloat(a.toString()),$=a.toString().replace(String(_),"");return{unitless:!$,value:_,unit:$}},wrap=a=>_=>`${a}(${_})`,transformFunctions={filter(a){return a!=="auto"?a:filterTemplate},backdropFilter(a){return a!=="auto"?a:backdropFilterTemplate},ring(a){return getRingTemplate(transformFunctions.px(a))},bgClip(a){return a==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:a}},transform(a){return a==="auto"?getTransformTemplate():a==="auto-gpu"?getTransformGpuTemplate():a},vh(a){return a==="$100vh"?"var(--chakra-vh)":a},px(a){if(a==null)return a;const{unitless:_}=analyzeCSSValue(a);return _||typeof a=="number"?`${a}px`:a},fraction(a){return typeof a!="number"||a>1?a:`${a*100}%`},float(a,_){const $={left:"right",right:"left"};return _.direction==="rtl"?$[a]:a},degree(a){if(isCssVar(a)||a==null)return a;const _=typeof a=="string"&&!a.endsWith("deg");return typeof a=="number"||_?`${a}deg`:a},gradient:gradientTransform,blur:wrap("blur"),opacity:wrap("opacity"),brightness:wrap("brightness"),contrast:wrap("contrast"),dropShadow:wrap("drop-shadow"),grayscale:wrap("grayscale"),hueRotate:a=>wrap("hue-rotate")(transformFunctions.degree(a)),invert:wrap("invert"),saturate:wrap("saturate"),sepia:wrap("sepia"),bgImage(a){return a==null||isCSSFunction(a)||globalSet.has(a)?a:`url(${a})`},outline(a){const _=String(a)==="0"||String(a)==="none";return a!==null&&_?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:a}},flexDirection(a){var _;const{space:$,divide:j}=(_=flexDirectionTemplate[a])!=null?_:{},et={flexDirection:a};return $&&(et[$]=1),j&&(et[j]=1),et}},t$5={borderWidths:toConfig("borderWidths"),borderStyles:toConfig("borderStyles"),colors:toConfig("colors"),borders:toConfig("borders"),gradients:toConfig("gradients",transformFunctions.gradient),radii:toConfig("radii",transformFunctions.px),space:toConfig("space",pipe$3(transformFunctions.vh,transformFunctions.px)),spaceT:toConfig("space",pipe$3(transformFunctions.vh,transformFunctions.px)),degreeT(a){return{property:a,transform:transformFunctions.degree}},prop(a,_,$){return{property:a,scale:_,..._&&{transform:createTransform({scale:_,transform:$})}}},propT(a,_){return{property:a,transform:_}},sizes:toConfig("sizes",pipe$3(transformFunctions.vh,transformFunctions.px)),sizesT:toConfig("sizes",pipe$3(transformFunctions.vh,transformFunctions.fraction)),shadows:toConfig("shadows"),logical,blur:toConfig("blur",transformFunctions.blur)},background={background:t$5.colors("background"),backgroundColor:t$5.colors("backgroundColor"),backgroundImage:t$5.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:transformFunctions.bgClip},bgSize:t$5.prop("backgroundSize"),bgPosition:t$5.prop("backgroundPosition"),bg:t$5.colors("background"),bgColor:t$5.colors("backgroundColor"),bgPos:t$5.prop("backgroundPosition"),bgRepeat:t$5.prop("backgroundRepeat"),bgAttachment:t$5.prop("backgroundAttachment"),bgGradient:t$5.gradients("backgroundImage"),bgClip:{transform:transformFunctions.bgClip}};Object.assign(background,{bgImage:background.backgroundImage,bgImg:background.backgroundImage});var border={border:t$5.borders("border"),borderWidth:t$5.borderWidths("borderWidth"),borderStyle:t$5.borderStyles("borderStyle"),borderColor:t$5.colors("borderColor"),borderRadius:t$5.radii("borderRadius"),borderTop:t$5.borders("borderTop"),borderBlockStart:t$5.borders("borderBlockStart"),borderTopLeftRadius:t$5.radii("borderTopLeftRadius"),borderStartStartRadius:t$5.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:t$5.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:t$5.radii("borderTopRightRadius"),borderStartEndRadius:t$5.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:t$5.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:t$5.borders("borderRight"),borderInlineEnd:t$5.borders("borderInlineEnd"),borderBottom:t$5.borders("borderBottom"),borderBlockEnd:t$5.borders("borderBlockEnd"),borderBottomLeftRadius:t$5.radii("borderBottomLeftRadius"),borderBottomRightRadius:t$5.radii("borderBottomRightRadius"),borderLeft:t$5.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:t$5.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:t$5.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:t$5.borders(["borderLeft","borderRight"]),borderInline:t$5.borders("borderInline"),borderY:t$5.borders(["borderTop","borderBottom"]),borderBlock:t$5.borders("borderBlock"),borderTopWidth:t$5.borderWidths("borderTopWidth"),borderBlockStartWidth:t$5.borderWidths("borderBlockStartWidth"),borderTopColor:t$5.colors("borderTopColor"),borderBlockStartColor:t$5.colors("borderBlockStartColor"),borderTopStyle:t$5.borderStyles("borderTopStyle"),borderBlockStartStyle:t$5.borderStyles("borderBlockStartStyle"),borderBottomWidth:t$5.borderWidths("borderBottomWidth"),borderBlockEndWidth:t$5.borderWidths("borderBlockEndWidth"),borderBottomColor:t$5.colors("borderBottomColor"),borderBlockEndColor:t$5.colors("borderBlockEndColor"),borderBottomStyle:t$5.borderStyles("borderBottomStyle"),borderBlockEndStyle:t$5.borderStyles("borderBlockEndStyle"),borderLeftWidth:t$5.borderWidths("borderLeftWidth"),borderInlineStartWidth:t$5.borderWidths("borderInlineStartWidth"),borderLeftColor:t$5.colors("borderLeftColor"),borderInlineStartColor:t$5.colors("borderInlineStartColor"),borderLeftStyle:t$5.borderStyles("borderLeftStyle"),borderInlineStartStyle:t$5.borderStyles("borderInlineStartStyle"),borderRightWidth:t$5.borderWidths("borderRightWidth"),borderInlineEndWidth:t$5.borderWidths("borderInlineEndWidth"),borderRightColor:t$5.colors("borderRightColor"),borderInlineEndColor:t$5.colors("borderInlineEndColor"),borderRightStyle:t$5.borderStyles("borderRightStyle"),borderInlineEndStyle:t$5.borderStyles("borderInlineEndStyle"),borderTopRadius:t$5.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:t$5.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:t$5.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:t$5.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(border,{rounded:border.borderRadius,roundedTop:border.borderTopRadius,roundedTopLeft:border.borderTopLeftRadius,roundedTopRight:border.borderTopRightRadius,roundedTopStart:border.borderStartStartRadius,roundedTopEnd:border.borderStartEndRadius,roundedBottom:border.borderBottomRadius,roundedBottomLeft:border.borderBottomLeftRadius,roundedBottomRight:border.borderBottomRightRadius,roundedBottomStart:border.borderEndStartRadius,roundedBottomEnd:border.borderEndEndRadius,roundedLeft:border.borderLeftRadius,roundedRight:border.borderRightRadius,roundedStart:border.borderInlineStartRadius,roundedEnd:border.borderInlineEndRadius,borderStart:border.borderInlineStart,borderEnd:border.borderInlineEnd,borderTopStartRadius:border.borderStartStartRadius,borderTopEndRadius:border.borderStartEndRadius,borderBottomStartRadius:border.borderEndStartRadius,borderBottomEndRadius:border.borderEndEndRadius,borderStartRadius:border.borderInlineStartRadius,borderEndRadius:border.borderInlineEndRadius,borderStartWidth:border.borderInlineStartWidth,borderEndWidth:border.borderInlineEndWidth,borderStartColor:border.borderInlineStartColor,borderEndColor:border.borderInlineEndColor,borderStartStyle:border.borderInlineStartStyle,borderEndStyle:border.borderInlineEndStyle});var color$2={color:t$5.colors("color"),textColor:t$5.colors("color"),fill:t$5.colors("fill"),stroke:t$5.colors("stroke")},effect$3={boxShadow:t$5.shadows("boxShadow"),mixBlendMode:!0,blendMode:t$5.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:t$5.prop("backgroundBlendMode"),opacity:!0};Object.assign(effect$3,{shadow:effect$3.boxShadow});var filter$2={filter:{transform:transformFunctions.filter},blur:t$5.blur("--chakra-blur"),brightness:t$5.propT("--chakra-brightness",transformFunctions.brightness),contrast:t$5.propT("--chakra-contrast",transformFunctions.contrast),hueRotate:t$5.propT("--chakra-hue-rotate",transformFunctions.hueRotate),invert:t$5.propT("--chakra-invert",transformFunctions.invert),saturate:t$5.propT("--chakra-saturate",transformFunctions.saturate),dropShadow:t$5.propT("--chakra-drop-shadow",transformFunctions.dropShadow),backdropFilter:{transform:transformFunctions.backdropFilter},backdropBlur:t$5.blur("--chakra-backdrop-blur"),backdropBrightness:t$5.propT("--chakra-backdrop-brightness",transformFunctions.brightness),backdropContrast:t$5.propT("--chakra-backdrop-contrast",transformFunctions.contrast),backdropHueRotate:t$5.propT("--chakra-backdrop-hue-rotate",transformFunctions.hueRotate),backdropInvert:t$5.propT("--chakra-backdrop-invert",transformFunctions.invert),backdropSaturate:t$5.propT("--chakra-backdrop-saturate",transformFunctions.saturate)},flexbox={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:transformFunctions.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:t$5.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:t$5.space("gap"),rowGap:t$5.space("rowGap"),columnGap:t$5.space("columnGap")};Object.assign(flexbox,{flexDir:flexbox.flexDirection});var grid={gridGap:t$5.space("gridGap"),gridColumnGap:t$5.space("gridColumnGap"),gridRowGap:t$5.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},interactivity={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:transformFunctions.outline},outlineOffset:!0,outlineColor:t$5.colors("outlineColor")},layout$1={width:t$5.sizesT("width"),inlineSize:t$5.sizesT("inlineSize"),height:t$5.sizes("height"),blockSize:t$5.sizes("blockSize"),boxSize:t$5.sizes(["width","height"]),minWidth:t$5.sizes("minWidth"),minInlineSize:t$5.sizes("minInlineSize"),minHeight:t$5.sizes("minHeight"),minBlockSize:t$5.sizes("minBlockSize"),maxWidth:t$5.sizes("maxWidth"),maxInlineSize:t$5.sizes("maxInlineSize"),maxHeight:t$5.sizes("maxHeight"),maxBlockSize:t$5.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(a,_)=>{var $,j,et;return{[`@media screen and (min-width: ${(et=(j=($=_.__breakpoints)==null?void 0:$.get(a))==null?void 0:j.minW)!=null?et:a})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(a,_)=>{var $,j,et;return{[`@media screen and (max-width: ${(et=(j=($=_.__breakpoints)==null?void 0:$.get(a))==null?void 0:j._minW)!=null?et:a})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:t$5.propT("float",transformFunctions.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(layout$1,{w:layout$1.width,h:layout$1.height,minW:layout$1.minWidth,maxW:layout$1.maxWidth,minH:layout$1.minHeight,maxH:layout$1.maxHeight,overscroll:layout$1.overscrollBehavior,overscrollX:layout$1.overscrollBehaviorX,overscrollY:layout$1.overscrollBehaviorY});var list={listStyleType:!0,listStylePosition:!0,listStylePos:t$5.prop("listStylePosition"),listStyleImage:!0,listStyleImg:t$5.prop("listStyleImage")};function get$4(a,_,$,j){const et=typeof _=="string"?_.split("."):[_];for(j=0;j{const _=new WeakMap;return(j,et,tt,rt)=>{if(typeof j>"u")return a(j,et,tt);_.has(j)||_.set(j,new Map);const nt=_.get(j);if(nt.has(et))return nt.get(et);const it=a(j,et,tt,rt);return nt.set(et,it),it}},memoizedGet$1=memoize$1(get$4),srOnly={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},srFocusable={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},getWithPriority=(a,_,$)=>{const j={},et=memoizedGet$1(a,_,{});for(const tt in et)tt in $&&$[tt]!=null||(j[tt]=et[tt]);return j},others={srOnly:{transform(a){return a===!0?srOnly:a==="focusable"?srFocusable:{}}},layerStyle:{processResult:!0,transform:(a,_,$)=>getWithPriority(_,`layerStyles.${a}`,$)},textStyle:{processResult:!0,transform:(a,_,$)=>getWithPriority(_,`textStyles.${a}`,$)},apply:{processResult:!0,transform:(a,_,$)=>getWithPriority(_,a,$)}},position={position:!0,pos:t$5.prop("position"),zIndex:t$5.prop("zIndex","zIndices"),inset:t$5.spaceT("inset"),insetX:t$5.spaceT(["left","right"]),insetInline:t$5.spaceT("insetInline"),insetY:t$5.spaceT(["top","bottom"]),insetBlock:t$5.spaceT("insetBlock"),top:t$5.spaceT("top"),insetBlockStart:t$5.spaceT("insetBlockStart"),bottom:t$5.spaceT("bottom"),insetBlockEnd:t$5.spaceT("insetBlockEnd"),left:t$5.spaceT("left"),insetInlineStart:t$5.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:t$5.spaceT("right"),insetInlineEnd:t$5.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(position,{insetStart:position.insetInlineStart,insetEnd:position.insetInlineEnd});var ring={ring:{transform:transformFunctions.ring},ringColor:t$5.colors("--chakra-ring-color"),ringOffset:t$5.prop("--chakra-ring-offset-width"),ringOffsetColor:t$5.colors("--chakra-ring-offset-color"),ringInset:t$5.prop("--chakra-ring-inset")},space={margin:t$5.spaceT("margin"),marginTop:t$5.spaceT("marginTop"),marginBlockStart:t$5.spaceT("marginBlockStart"),marginRight:t$5.spaceT("marginRight"),marginInlineEnd:t$5.spaceT("marginInlineEnd"),marginBottom:t$5.spaceT("marginBottom"),marginBlockEnd:t$5.spaceT("marginBlockEnd"),marginLeft:t$5.spaceT("marginLeft"),marginInlineStart:t$5.spaceT("marginInlineStart"),marginX:t$5.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:t$5.spaceT("marginInline"),marginY:t$5.spaceT(["marginTop","marginBottom"]),marginBlock:t$5.spaceT("marginBlock"),padding:t$5.space("padding"),paddingTop:t$5.space("paddingTop"),paddingBlockStart:t$5.space("paddingBlockStart"),paddingRight:t$5.space("paddingRight"),paddingBottom:t$5.space("paddingBottom"),paddingBlockEnd:t$5.space("paddingBlockEnd"),paddingLeft:t$5.space("paddingLeft"),paddingInlineStart:t$5.space("paddingInlineStart"),paddingInlineEnd:t$5.space("paddingInlineEnd"),paddingX:t$5.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:t$5.space("paddingInline"),paddingY:t$5.space(["paddingTop","paddingBottom"]),paddingBlock:t$5.space("paddingBlock")};Object.assign(space,{m:space.margin,mt:space.marginTop,mr:space.marginRight,me:space.marginInlineEnd,marginEnd:space.marginInlineEnd,mb:space.marginBottom,ml:space.marginLeft,ms:space.marginInlineStart,marginStart:space.marginInlineStart,mx:space.marginX,my:space.marginY,p:space.padding,pt:space.paddingTop,py:space.paddingY,px:space.paddingX,pb:space.paddingBottom,pl:space.paddingLeft,ps:space.paddingInlineStart,paddingStart:space.paddingInlineStart,pr:space.paddingRight,pe:space.paddingInlineEnd,paddingEnd:space.paddingInlineEnd});var textDecoration={textDecorationColor:t$5.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:t$5.shadows("textShadow")},transform={clipPath:!0,transform:t$5.propT("transform",transformFunctions.transform),transformOrigin:!0,translateX:t$5.spaceT("--chakra-translate-x"),translateY:t$5.spaceT("--chakra-translate-y"),skewX:t$5.degreeT("--chakra-skew-x"),skewY:t$5.degreeT("--chakra-skew-y"),scaleX:t$5.prop("--chakra-scale-x"),scaleY:t$5.prop("--chakra-scale-y"),scale:t$5.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:t$5.degreeT("--chakra-rotate")},transition$1={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:t$5.prop("transitionDuration","transition.duration"),transitionProperty:t$5.prop("transitionProperty","transition.property"),transitionTimingFunction:t$5.prop("transitionTimingFunction","transition.easing")},typography$1={fontFamily:t$5.prop("fontFamily","fonts"),fontSize:t$5.prop("fontSize","fontSizes",transformFunctions.px),fontWeight:t$5.prop("fontWeight","fontWeights"),lineHeight:t$5.prop("lineHeight","lineHeights"),letterSpacing:t$5.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(a){if(a===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},scroll={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:t$5.spaceT("scrollMargin"),scrollMarginTop:t$5.spaceT("scrollMarginTop"),scrollMarginBottom:t$5.spaceT("scrollMarginBottom"),scrollMarginLeft:t$5.spaceT("scrollMarginLeft"),scrollMarginRight:t$5.spaceT("scrollMarginRight"),scrollMarginX:t$5.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:t$5.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:t$5.spaceT("scrollPadding"),scrollPaddingTop:t$5.spaceT("scrollPaddingTop"),scrollPaddingBottom:t$5.spaceT("scrollPaddingBottom"),scrollPaddingLeft:t$5.spaceT("scrollPaddingLeft"),scrollPaddingRight:t$5.spaceT("scrollPaddingRight"),scrollPaddingX:t$5.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:t$5.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function resolveReference(a){return isObject$5(a)&&a.reference?a.reference:String(a)}var toExpression=(a,..._)=>_.map(resolveReference).join(` ${a} `).replace(/calc/g,""),add$1=(...a)=>`calc(${toExpression("+",...a)})`,subtract$1=(...a)=>`calc(${toExpression("-",...a)})`,multiply$1=(...a)=>`calc(${toExpression("*",...a)})`,divide$1=(...a)=>`calc(${toExpression("/",...a)})`,negate$1=a=>{const _=resolveReference(a);return _!=null&&!Number.isNaN(parseFloat(_))?String(_).startsWith("-")?String(_).slice(1):`-${_}`:multiply$1(_,-1)},calc$1=Object.assign(a=>({add:(..._)=>calc$1(add$1(a,..._)),subtract:(..._)=>calc$1(subtract$1(a,..._)),multiply:(..._)=>calc$1(multiply$1(a,..._)),divide:(..._)=>calc$1(divide$1(a,..._)),negate:()=>calc$1(negate$1(a)),toString:()=>a.toString()}),{add:add$1,subtract:subtract$1,multiply:multiply$1,divide:divide$1,negate:negate$1});function replaceWhiteSpace$1(a,_="-"){return a.replace(/\s+/g,_)}function escape$2(a){const _=replaceWhiteSpace$1(a.toString());return escapeSymbol(escapeDot(_))}function escapeDot(a){return a.includes("\\.")?a:!Number.isInteger(parseFloat(a.toString()))?a.replace(".","\\."):a}function escapeSymbol(a){return a.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function addPrefix$1(a,_=""){return[_,a].filter(Boolean).join("-")}function toVarReference(a,_){return`var(${a}${_?`, ${_}`:""})`}function toVarDefinition(a,_=""){return escape$2(`--${addPrefix$1(a,_)}`)}function cssVar$1(a,_,$){const j=toVarDefinition(a,$);return{variable:j,reference:toVarReference(j,_)}}function defineCssVars(a,_){const $={};for(const j of _){if(Array.isArray(j)){const[et,tt]=j;$[et]=cssVar$1(`${a}-${et}`,tt);continue}$[j]=cssVar$1(`${a}-${j}`)}return $}function getLastItem(a){const _=a==null?0:a.length;return _?a[_-1]:void 0}function analyzeCSSValue2(a){const _=parseFloat(a.toString()),$=a.toString().replace(String(_),"");return{unitless:!$,value:_,unit:$}}function px$1(a){if(a==null)return a;const{unitless:_}=analyzeCSSValue2(a);return _||typeof a=="number"?`${a}px`:a}var sortByBreakpointValue=(a,_)=>parseInt(a[1],10)>parseInt(_[1],10)?1:-1,sortBps=a=>Object.fromEntries(Object.entries(a).sort(sortByBreakpointValue));function normalize$1(a){const _=sortBps(a);return Object.assign(Object.values(_),_)}function keys$1(a){const _=Object.keys(sortBps(a));return new Set(_)}function subtract2(a){var _;if(!a)return a;a=(_=px$1(a))!=null?_:a;const $=-.02;return typeof a=="number"?`${a+$}`:a.replace(/(\d+\.?\d*)/u,j=>`${parseFloat(j)+$}`)}function toMediaQueryString(a,_){const $=["@media screen"];return a&&$.push("and",`(min-width: ${px$1(a)})`),_&&$.push("and",`(max-width: ${px$1(_)})`),$.join(" ")}function analyzeBreakpoints(a){var _;if(!a)return null;a.base=(_=a.base)!=null?_:"0px";const $=normalize$1(a),j=Object.entries(a).sort(sortByBreakpointValue).map(([rt,nt],it,st)=>{var ot;let[,at]=(ot=st[it+1])!=null?ot:[];return at=parseFloat(at)>0?subtract2(at):void 0,{_minW:subtract2(nt),breakpoint:rt,minW:nt,maxW:at,maxWQuery:toMediaQueryString(null,at),minWQuery:toMediaQueryString(nt),minMaxQuery:toMediaQueryString(nt,at)}}),et=keys$1(a),tt=Array.from(et.values());return{keys:et,normalized:$,isResponsive(rt){const nt=Object.keys(rt);return nt.length>0&&nt.every(it=>et.has(it))},asObject:sortBps(a),asArray:normalize$1(a),details:j,get(rt){return j.find(nt=>nt.breakpoint===rt)},media:[null,...$.map(rt=>toMediaQueryString(rt)).slice(1)],toArrayValue(rt){if(!isObject$5(rt))throw new Error("toArrayValue: value must be an object");const nt=tt.map(it=>{var st;return(st=rt[it])!=null?st:null});for(;getLastItem(nt)===null;)nt.pop();return nt},toObjectValue(rt){if(!Array.isArray(rt))throw new Error("toObjectValue: value must be an array");return rt.reduce((nt,it,st)=>{const ot=tt[st];return ot!=null&&it!=null&&(nt[ot]=it),nt},{})}}}var state$1={hover:(a,_)=>`${a}:hover ${_}, ${a}[data-hover] ${_}`,focus:(a,_)=>`${a}:focus ${_}, ${a}[data-focus] ${_}`,focusVisible:(a,_)=>`${a}:focus-visible ${_}`,focusWithin:(a,_)=>`${a}:focus-within ${_}`,active:(a,_)=>`${a}:active ${_}, ${a}[data-active] ${_}`,disabled:(a,_)=>`${a}:disabled ${_}, ${a}[data-disabled] ${_}`,invalid:(a,_)=>`${a}:invalid ${_}, ${a}[data-invalid] ${_}`,checked:(a,_)=>`${a}:checked ${_}, ${a}[data-checked] ${_}`,indeterminate:(a,_)=>`${a}:indeterminate ${_}, ${a}[aria-checked=mixed] ${_}, ${a}[data-indeterminate] ${_}`,readOnly:(a,_)=>`${a}:read-only ${_}, ${a}[readonly] ${_}, ${a}[data-read-only] ${_}`,expanded:(a,_)=>`${a}:read-only ${_}, ${a}[aria-expanded=true] ${_}, ${a}[data-expanded] ${_}`,placeholderShown:(a,_)=>`${a}:placeholder-shown ${_}`},toGroup=a=>merge$2(_=>a(_,"&"),"[role=group]","[data-group]",".group"),toPeer=a=>merge$2(_=>a(_,"~ &"),"[data-peer]",".peer"),merge$2=(a,..._)=>_.map(a).join(", "),pseudoSelectors={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:toGroup(state$1.hover),_peerHover:toPeer(state$1.hover),_groupFocus:toGroup(state$1.focus),_peerFocus:toPeer(state$1.focus),_groupFocusVisible:toGroup(state$1.focusVisible),_peerFocusVisible:toPeer(state$1.focusVisible),_groupActive:toGroup(state$1.active),_peerActive:toPeer(state$1.active),_groupDisabled:toGroup(state$1.disabled),_peerDisabled:toPeer(state$1.disabled),_groupInvalid:toGroup(state$1.invalid),_peerInvalid:toPeer(state$1.invalid),_groupChecked:toGroup(state$1.checked),_peerChecked:toPeer(state$1.checked),_groupFocusWithin:toGroup(state$1.focusWithin),_peerFocusWithin:toPeer(state$1.focusWithin),_peerPlaceholderShown:toPeer(state$1.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},pseudoPropNames=Object.keys(pseudoSelectors);function tokenToCssVar(a,_){return cssVar$1(String(a).replace(/\./g,"-"),void 0,_)}function createThemeVars(a,_){let $={};const j={};for(const[et,tt]of Object.entries(a)){const{isSemantic:rt,value:nt}=tt,{variable:it,reference:st}=tokenToCssVar(et,_==null?void 0:_.cssVarPrefix);if(!rt){if(et.startsWith("space")){const ut=et.split("."),[ht,...yt]=ut,wt=`${ht}.-${yt.join(".")}`,Ct=calc$1.negate(nt),Pt=calc$1.negate(st);j[wt]={value:Ct,var:it,varRef:Pt}}$[it]=nt,j[et]={value:nt,var:it,varRef:st};continue}const ot=ut=>{const yt=[String(et).split(".")[0],ut].join(".");if(!a[yt])return ut;const{reference:Ct}=tokenToCssVar(yt,_==null?void 0:_.cssVarPrefix);return Ct},at=isObject$5(nt)?nt:{default:nt};$=mergeWith($,Object.entries(at).reduce((ut,[ht,yt])=>{var wt,Ct;if(!yt)return ut;const Pt=ot(`${yt}`);if(ht==="default")return ut[it]=Pt,ut;const $t=(Ct=(wt=pseudoSelectors)==null?void 0:wt[ht])!=null?Ct:ht;return ut[$t]={[it]:Pt},ut},{})),j[et]={value:st,var:it,varRef:st}}return{cssVars:$,cssMap:j}}function omit$6(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}function pick$2(a,_){const $={};for(const j of _)j in a&&($[j]=a[j]);return $}function isObject5(a){return typeof a=="object"&&a!=null&&!Array.isArray(a)}function walkObject(a,_,$={}){const{stop:j,getKey:et}=$;function tt(rt,nt=[]){var it;if(isObject5(rt)||Array.isArray(rt)){const st={};for(const[ot,at]of Object.entries(rt)){const ut=(it=et==null?void 0:et(ot))!=null?it:ot,ht=[...nt,ut];if(j!=null&&j(rt,ht))return _(rt,nt);st[ut]=tt(at,ht)}return st}return _(rt,nt)}return tt(a)}var tokens$1=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function extractTokens(a){return pick$2(a,tokens$1)}function extractSemanticTokens(a){return a.semanticTokens}function omitVars(a){const{__cssMap:_,__cssVars:$,__breakpoints:j,...et}=a;return et}var isSemanticCondition=a=>pseudoPropNames.includes(a)||a==="default";function flattenTokens({tokens:a,semanticTokens:_}){const $={};return walkObject(a,(j,et)=>{j!=null&&($[et.join(".")]={isSemantic:!1,value:j})}),walkObject(_,(j,et)=>{j!=null&&($[et.join(".")]={isSemantic:!0,value:j})},{stop:j=>Object.keys(j).every(isSemanticCondition)}),$}function toCSSVar(a){var _;const $=omitVars(a),j=extractTokens($),et=extractSemanticTokens($),tt=flattenTokens({tokens:j,semanticTokens:et}),rt=(_=$.config)==null?void 0:_.cssVarPrefix,{cssMap:nt,cssVars:it}=createThemeVars(tt,{cssVarPrefix:rt});return Object.assign($,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...it},__cssMap:nt,__breakpoints:analyzeBreakpoints($.breakpoints)}),$}var systemProps=mergeWith({},background,border,color$2,flexbox,layout$1,filter$2,ring,interactivity,grid,others,position,effect$3,space,scroll,typography$1,textDecoration,transform,list,transition$1),layoutSystem=Object.assign({},space,layout$1,flexbox,grid,position),layoutPropNames=Object.keys(layoutSystem),propNames=[...Object.keys(systemProps),...pseudoPropNames],styleProps={...systemProps,...pseudoSelectors},isStyleProp=a=>a in styleProps,expandResponsive=a=>_=>{if(!_.__breakpoints)return a;const{isResponsive:$,toArrayValue:j,media:et}=_.__breakpoints,tt={};for(const rt in a){let nt=runIfFn$2(a[rt],_);if(nt==null)continue;if(nt=isObject$5(nt)&&$(nt)?j(nt):nt,!Array.isArray(nt)){tt[rt]=nt;continue}const it=nt.slice(0,et.length).length;for(let st=0;sta.startsWith("--")&&typeof _=="string"&&!isCssVar2(_),resolveTokenValue=(a,_)=>{var $,j;if(_==null)return _;const et=it=>{var st,ot;return(ot=(st=a.__cssMap)==null?void 0:st[it])==null?void 0:ot.varRef},tt=it=>{var st;return(st=et(it))!=null?st:it},[rt,nt]=splitByComma(_);return _=(j=($=et(rt))!=null?$:tt(nt))!=null?j:tt(_),_};function getCss(a){const{configs:_={},pseudos:$={},theme:j}=a,et=(tt,rt=!1)=>{var nt,it,st;const ot=runIfFn$2(tt,j),at=expandResponsive(ot)(j);let ut={};for(let ht in at){const yt=at[ht];let wt=runIfFn$2(yt,j);ht in $&&(ht=$[ht]),isCSSVariableTokenValue(ht,wt)&&(wt=resolveTokenValue(j,wt));let Ct=_[ht];if(Ct===!0&&(Ct={property:ht}),isObject$5(wt)){ut[ht]=(nt=ut[ht])!=null?nt:{},ut[ht]=mergeWith({},ut[ht],et(wt,!0));continue}let Pt=(st=(it=Ct==null?void 0:Ct.transform)==null?void 0:it.call(Ct,wt,j,ot))!=null?st:wt;Pt=Ct!=null&&Ct.processResult?et(Pt,!0):Pt;const $t=runIfFn$2(Ct==null?void 0:Ct.property,j);if(!rt&&(Ct!=null&&Ct.static)){const Mt=runIfFn$2(Ct.static,j);ut=mergeWith({},ut,Mt)}if($t&&Array.isArray($t)){for(const Mt of $t)ut[Mt]=Pt;continue}if($t){$t==="&"&&isObject$5(Pt)?ut=mergeWith({},ut,Pt):ut[$t]=Pt;continue}if(isObject$5(Pt)){ut=mergeWith({},ut,Pt);continue}ut[ht]=Pt}return ut};return et}var css=a=>_=>getCss({theme:_,pseudos:pseudoSelectors,configs:systemProps})(a);function defineStyle(a){return a}function defineStyleConfig(a){return a}function createMultiStyleConfigHelpers(a){return{definePartsStyle(_){return _},defineMultiStyleConfig(_){return{parts:a,..._}}}}function normalize2(a,_){if(Array.isArray(a))return a;if(isObject$5(a))return _(a);if(a!=null)return[a]}function getNextIndex$1(a,_){for(let $=_+1;${mergeWith(st,{[Mt]:ut?$t[Mt]:{[Pt]:$t[Mt]}})});continue}if(!ht){ut?mergeWith(st,$t):st[Pt]=$t;continue}st[Pt]=$t}}return st}}function resolveStyleConfig(a){return _=>{var $;const{variant:j,size:et,theme:tt}=_,rt=createResolver(tt);return mergeWith({},runIfFn$2(($=a.baseStyle)!=null?$:{},_),rt(a,"sizes",et,_),rt(a,"variants",j,_))}}function getCSSVar(a,_,$){var j,et,tt;return(tt=(et=(j=a.__cssMap)==null?void 0:j[`${_}.${$}`])==null?void 0:et.varRef)!=null?tt:$}function omitThemingProps(a){return omit$6(a,["styleConfig","size","variant","colorScheme"])}var requiredChakraThemeKeys=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function isChakraTheme(a){return isObject$5(a)?requiredChakraThemeKeys.every(_=>Object.prototype.hasOwnProperty.call(a,_)):!1}var transitionProperty={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},transitionTimingFunction={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},transitionDuration={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},transition={property:transitionProperty,easing:transitionTimingFunction,duration:transitionDuration},transition_default=transition,zIndices={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},z_index_default=zIndices,borders$1={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},borders_default=borders$1,breakpoints={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},breakpoints_default=breakpoints,colors$1={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},colors_default=colors$1,radii={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},radius_default=radii,shadows={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},shadows_default=shadows,blur={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},blur_default=blur,typography={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},typography_default=typography,spacing={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},largeSizes={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},container={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},sizes$o={...spacing,...largeSizes,container},sizes_default=sizes$o,foundations={breakpoints:breakpoints_default,zIndices:z_index_default,radii:radius_default,blur:blur_default,colors:colors_default,...typography_default,sizes:sizes_default,shadows:shadows_default,space:spacing,borders:borders_default,transition:transition_default},{defineMultiStyleConfig:defineMultiStyleConfig$w,definePartsStyle:definePartsStyle$w}=createMultiStyleConfigHelpers(["stepper","step","title","description","indicator","separator","icon","number"]),$size$4=cssVar$1("stepper-indicator-size"),$iconSize=cssVar$1("stepper-icon-size"),$titleFontSize=cssVar$1("stepper-title-font-size"),$descFontSize=cssVar$1("stepper-description-font-size"),$accentColor=cssVar$1("stepper-accent-color"),baseStyle$J=definePartsStyle$w(({colorScheme:a})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[$accentColor.variable]:`colors.${a}.500`,_dark:{[$accentColor.variable]:`colors.${a}.200`}},title:{fontSize:$titleFontSize.reference,fontWeight:"medium"},description:{fontSize:$descFontSize.reference,color:"chakra-subtle-text"},number:{fontSize:$titleFontSize.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:$iconSize.reference,height:$iconSize.reference},indicator:{flexShrink:0,borderRadius:"full",width:$size$4.reference,height:$size$4.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:$accentColor.reference},"&[data-status=complete]":{bg:$accentColor.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:$accentColor.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${$size$4.reference} - 8px)`,top:`calc(${$size$4.reference} + 4px)`,insetStart:`calc(${$size$4.reference} / 2 - 1px)`}}})),stepperTheme=defineMultiStyleConfig$w({baseStyle:baseStyle$J,sizes:{xs:definePartsStyle$w({stepper:{[$size$4.variable]:"sizes.4",[$iconSize.variable]:"sizes.3",[$titleFontSize.variable]:"fontSizes.xs",[$descFontSize.variable]:"fontSizes.xs"}}),sm:definePartsStyle$w({stepper:{[$size$4.variable]:"sizes.6",[$iconSize.variable]:"sizes.4",[$titleFontSize.variable]:"fontSizes.sm",[$descFontSize.variable]:"fontSizes.xs"}}),md:definePartsStyle$w({stepper:{[$size$4.variable]:"sizes.8",[$iconSize.variable]:"sizes.5",[$titleFontSize.variable]:"fontSizes.md",[$descFontSize.variable]:"fontSizes.sm"}}),lg:definePartsStyle$w({stepper:{[$size$4.variable]:"sizes.10",[$iconSize.variable]:"sizes.6",[$titleFontSize.variable]:"fontSizes.lg",[$descFontSize.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function anatomy(a,_={}){let $=!1;function j(){if(!$){$=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function et(...ot){j();for(const at of ot)_[at]=it(at);return anatomy(a,_)}function tt(...ot){for(const at of ot)at in _||(_[at]=it(at));return anatomy(a,_)}function rt(){return Object.fromEntries(Object.entries(_).map(([at,ut])=>[at,ut.selector]))}function nt(){return Object.fromEntries(Object.entries(_).map(([at,ut])=>[at,ut.className]))}function it(ot){const ht=`chakra-${(["container","root"].includes(ot??"")?[a]:[a,ot]).filter(Boolean).join("__")}`;return{className:ht,selector:`.${ht}`,toString:()=>ot}}return{parts:et,toPart:it,extend:tt,selectors:rt,classnames:nt,get keys(){return Object.keys(_)},__type:{}}}var accordionAnatomy=anatomy("accordion").parts("root","container","button","panel").extend("icon"),alertAnatomy=anatomy("alert").parts("title","description","container").extend("icon","spinner"),avatarAnatomy=anatomy("avatar").parts("label","badge","container").extend("excessLabel","group"),breadcrumbAnatomy=anatomy("breadcrumb").parts("link","item","container").extend("separator");anatomy("button").parts();var checkboxAnatomy=anatomy("checkbox").parts("control","icon","container").extend("label");anatomy("progress").parts("track","filledTrack").extend("label");var drawerAnatomy=anatomy("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),editableAnatomy=anatomy("editable").parts("preview","input","textarea"),formAnatomy=anatomy("form").parts("container","requiredIndicator","helperText"),formErrorAnatomy=anatomy("formError").parts("text","icon"),inputAnatomy=anatomy("input").parts("addon","field","element","group"),listAnatomy=anatomy("list").parts("container","item","icon"),menuAnatomy=anatomy("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),modalAnatomy=anatomy("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),numberInputAnatomy=anatomy("numberinput").parts("root","field","stepperGroup","stepper");anatomy("pininput").parts("field");var popoverAnatomy=anatomy("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),progressAnatomy=anatomy("progress").parts("label","filledTrack","track"),radioAnatomy=anatomy("radio").parts("container","control","label"),selectAnatomy=anatomy("select").parts("field","icon"),sliderAnatomy=anatomy("slider").parts("container","track","thumb","filledTrack","mark"),statAnatomy=anatomy("stat").parts("container","label","helpText","number","icon"),switchAnatomy=anatomy("switch").parts("container","track","thumb","label"),tableAnatomy=anatomy("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tabsAnatomy=anatomy("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),tagAnatomy=anatomy("tag").parts("container","label","closeButton"),cardAnatomy=anatomy("card").parts("container","header","body","footer");anatomy("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function guard(a,_,$){return Math.min(Math.max(a,$),_)}class ColorError extends Error{constructor(_){super(`Failed to parse color: "${_}"`)}}var ColorError$1=ColorError;function parseToRgba(a){if(typeof a!="string")throw new ColorError$1(a);if(a.trim().toLowerCase()==="transparent")return[0,0,0,0];let _=a.trim();_=namedColorRegex.test(a)?nameToHex(a):a;const $=reducedHexRegex.exec(_);if($){const rt=Array.from($).slice(1);return[...rt.slice(0,3).map(nt=>parseInt(r$3(nt,2),16)),parseInt(r$3(rt[3]||"f",2),16)/255]}const j=hexRegex.exec(_);if(j){const rt=Array.from(j).slice(1);return[...rt.slice(0,3).map(nt=>parseInt(nt,16)),parseInt(rt[3]||"ff",16)/255]}const et=rgbaRegex.exec(_);if(et){const rt=Array.from(et).slice(1);return[...rt.slice(0,3).map(nt=>parseInt(nt,10)),parseFloat(rt[3]||"1")]}const tt=hslaRegex.exec(_);if(tt){const[rt,nt,it,st]=Array.from(tt).slice(1).map(parseFloat);if(guard(0,100,nt)!==nt)throw new ColorError$1(a);if(guard(0,100,it)!==it)throw new ColorError$1(a);return[...hslToRgb(rt,nt,it),Number.isNaN(st)?1:st]}throw new ColorError$1(a)}function hash$8(a){let _=5381,$=a.length;for(;$;)_=_*33^a.charCodeAt(--$);return(_>>>0)%2341}const colorToInt=a=>parseInt(a.replace(/_/g,""),36),compressedColorMap="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((a,_)=>{const $=colorToInt(_.substring(0,3)),j=colorToInt(_.substring(3)).toString(16);let et="";for(let tt=0;tt<6-j.length;tt++)et+="0";return a[$]=`${et}${j}`,a},{});function nameToHex(a){const _=a.toLowerCase().trim(),$=compressedColorMap[hash$8(_)];if(!$)throw new ColorError$1(a);return`#${$}`}const r$3=(a,_)=>Array.from(Array(_)).map(()=>a).join(""),reducedHexRegex=new RegExp(`^#${r$3("([a-f0-9])",3)}([a-f0-9])?$`,"i"),hexRegex=new RegExp(`^#${r$3("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),rgbaRegex=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$3(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),hslaRegex=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,namedColorRegex=/^[a-z]+$/i,roundColor=a=>Math.round(a*255),hslToRgb=(a,_,$)=>{let j=$/100;if(_===0)return[j,j,j].map(roundColor);const et=(a%360+360)%360/60,tt=(1-Math.abs(2*j-1))*(_/100),rt=tt*(1-Math.abs(et%2-1));let nt=0,it=0,st=0;et>=0&&et<1?(nt=tt,it=rt):et>=1&&et<2?(nt=rt,it=tt):et>=2&&et<3?(it=tt,st=rt):et>=3&&et<4?(it=rt,st=tt):et>=4&&et<5?(nt=rt,st=tt):et>=5&&et<6&&(nt=tt,st=rt);const ot=j-tt/2,at=nt+ot,ut=it+ot,ht=st+ot;return[at,ut,ht].map(roundColor)};function rgba$1(a,_,$,j){return`rgba(${guard(0,255,a).toFixed()}, ${guard(0,255,_).toFixed()}, ${guard(0,255,$).toFixed()}, ${parseFloat(guard(0,1,j).toFixed(3))})`}function transparentize$1(a,_){const[$,j,et,tt]=parseToRgba(a);return rgba$1($,j,et,tt-_)}function toHex$3(a){const[_,$,j,et]=parseToRgba(a);let tt=rt=>{const nt=guard(0,255,rt).toString(16);return nt.length===1?`0${nt}`:nt};return`#${tt(_)}${tt($)}${tt(j)}${et<1?tt(Math.round(et*255)):""}`}function dlv_es_default(a,_,$,j,et){for(_=_.split?_.split("."):_,j=0;j<_.length;j++)a=a?a[_[j]]:et;return a===et?$:a}var isEmptyObject$1=a=>Object.keys(a).length===0,getColor=(a,_,$)=>{const j=dlv_es_default(a,`colors.${_}`,_);try{return toHex$3(j),j}catch{return $??"#000000"}},getBrightness=a=>{const[_,$,j]=parseToRgba(a);return(_*299+$*587+j*114)/1e3},tone=a=>_=>{const $=getColor(_,a);return getBrightness($)<128?"dark":"light"},isDark=a=>_=>tone(a)(_)==="dark",transparentize=(a,_)=>$=>{const j=getColor($,a);return transparentize$1(j,1-_)};function generateStripe(a="1rem",_="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${_} 25%, transparent 25%, @@ -339,7 +339,7 @@ Error generating stack: `+tt.message+` transparent 0%, ${getColor($,rt)} 50%, transparent 100% - )`;return{...!j&&et&&tt,...j?{bgImage:nt}:{bgColor:rt}}},baseStyleLabel$3={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},baseStyleTrack$1=a=>({bg:mode("gray.100","whiteAlpha.300")(a)}),baseStyleFilledTrack$1=a=>({transitionProperty:"common",transitionDuration:"slow",...filledStyle(a)}),baseStyle$A=definePartsStyle$q(a=>({label:baseStyleLabel$3,filledTrack:baseStyleFilledTrack$1(a),track:baseStyleTrack$1(a)})),sizes$h={xs:definePartsStyle$q({track:{h:"1"}}),sm:definePartsStyle$q({track:{h:"2"}}),md:definePartsStyle$q({track:{h:"3"}}),lg:definePartsStyle$q({track:{h:"4"}})},progressTheme=defineMultiStyleConfig$q({sizes:sizes$h,baseStyle:baseStyle$A,defaultProps:{size:"md",colorScheme:"blue"}}),isFunction$7=a=>typeof a=="function";function runIfFn$1(a,..._){return isFunction$7(a)?a(..._):a}var{definePartsStyle:definePartsStyle$p,defineMultiStyleConfig:defineMultiStyleConfig$p}=createMultiStyleConfigHelpers(checkboxAnatomy.keys),$size$3=cssVar$1("checkbox-size"),baseStyleControl$1=a=>{const{colorScheme:_}=a;return{w:$size$3.reference,h:$size$3.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:mode(`${_}.500`,`${_}.200`)(a),borderColor:mode(`${_}.500`,`${_}.200`)(a),color:mode("white","gray.900")(a),_hover:{bg:mode(`${_}.600`,`${_}.300`)(a),borderColor:mode(`${_}.600`,`${_}.300`)(a)},_disabled:{borderColor:mode("gray.200","transparent")(a),bg:mode("gray.200","whiteAlpha.300")(a),color:mode("gray.500","whiteAlpha.500")(a)}},_indeterminate:{bg:mode(`${_}.500`,`${_}.200`)(a),borderColor:mode(`${_}.500`,`${_}.200`)(a),color:mode("white","gray.900")(a)},_disabled:{bg:mode("gray.100","whiteAlpha.100")(a),borderColor:mode("gray.100","transparent")(a)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:mode("red.500","red.300")(a)}}},baseStyleContainer$3={_disabled:{cursor:"not-allowed"}},baseStyleLabel$2={userSelect:"none",_disabled:{opacity:.4}},baseStyleIcon$6={transitionProperty:"transform",transitionDuration:"normal"},baseStyle$z=definePartsStyle$p(a=>({icon:baseStyleIcon$6,container:baseStyleContainer$3,control:runIfFn$1(baseStyleControl$1,a),label:baseStyleLabel$2})),sizes$g={sm:definePartsStyle$p({control:{[$size$3.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:definePartsStyle$p({control:{[$size$3.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:definePartsStyle$p({control:{[$size$3.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},checkboxTheme$1=defineMultiStyleConfig$p({baseStyle:baseStyle$z,sizes:sizes$g,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$o,definePartsStyle:definePartsStyle$o}=createMultiStyleConfigHelpers(radioAnatomy.keys),baseStyleControl=a=>{var _;const $=(_=runIfFn$1(checkboxTheme$1.baseStyle,a))==null?void 0:_.control;return{...$,borderRadius:"full",_checked:{...$==null?void 0:$._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},baseStyle$y=definePartsStyle$o(a=>{var _,$,j,et;return{label:($=(_=checkboxTheme$1).baseStyle)==null?void 0:$.call(_,a).label,container:(et=(j=checkboxTheme$1).baseStyle)==null?void 0:et.call(j,a).container,control:baseStyleControl(a)}}),sizes$f={md:definePartsStyle$o({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:definePartsStyle$o({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:definePartsStyle$o({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},radioTheme$1=defineMultiStyleConfig$o({baseStyle:baseStyle$y,sizes:sizes$f,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$n,definePartsStyle:definePartsStyle$n}=createMultiStyleConfigHelpers(selectAnatomy.keys),$bg$b=cssVar$1("select-bg"),_a$6,baseStyleField$1={...(_a$6=inputTheme.baseStyle)==null?void 0:_a$6.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$bg$b.reference,[$bg$b.variable]:"colors.white",_dark:{[$bg$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$bg$b.reference}},baseStyleIcon$5={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},baseStyle$x=definePartsStyle$n({field:baseStyleField$1,icon:baseStyleIcon$5}),iconSpacing={paddingInlineEnd:"8"},_a2$1,_b$1,_c,_d,_e,_f,_g,_h,sizes$e={lg:{...(_a2$1=inputTheme.sizes)==null?void 0:_a2$1.lg,field:{...(_b$1=inputTheme.sizes)==null?void 0:_b$1.lg.field,...iconSpacing}},md:{...(_c=inputTheme.sizes)==null?void 0:_c.md,field:{...(_d=inputTheme.sizes)==null?void 0:_d.md.field,...iconSpacing}},sm:{...(_e=inputTheme.sizes)==null?void 0:_e.sm,field:{...(_f=inputTheme.sizes)==null?void 0:_f.sm.field,...iconSpacing}},xs:{...(_g=inputTheme.sizes)==null?void 0:_g.xs,field:{...(_h=inputTheme.sizes)==null?void 0:_h.xs.field,...iconSpacing},icon:{insetEnd:"1"}}},selectTheme=defineMultiStyleConfig$n({baseStyle:baseStyle$x,sizes:sizes$e,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),$startColor=cssVar$1("skeleton-start-color"),$endColor=cssVar$1("skeleton-end-color"),baseStyle$w={[$startColor.variable]:"colors.gray.100",[$endColor.variable]:"colors.gray.400",_dark:{[$startColor.variable]:"colors.gray.800",[$endColor.variable]:"colors.gray.600"},background:$startColor.reference,borderColor:$endColor.reference,opacity:.7,borderRadius:"sm"},skeletonTheme={baseStyle:baseStyle$w},$bg$a=cssVar$1("skip-link-bg"),baseStyle$v={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[$bg$a.variable]:"colors.white",_dark:{[$bg$a.variable]:"colors.gray.700"},bg:$bg$a.reference}},skipLinkTheme={baseStyle:baseStyle$v},{defineMultiStyleConfig:defineMultiStyleConfig$m,definePartsStyle:definePartsStyle$m}=createMultiStyleConfigHelpers(sliderAnatomy.keys),$thumbSize=cssVar$1("slider-thumb-size"),$trackSize=cssVar$1("slider-track-size"),$bg$9=cssVar$1("slider-bg"),baseStyleContainer$2=a=>{const{orientation:_}=a;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...orient({orientation:_,vertical:{h:"100%"},horizontal:{w:"100%"}})}},baseStyleTrack=a=>({...orient({orientation:a.orientation,horizontal:{h:$trackSize.reference},vertical:{w:$trackSize.reference}}),overflow:"hidden",borderRadius:"sm",[$bg$9.variable]:"colors.gray.200",_dark:{[$bg$9.variable]:"colors.whiteAlpha.200"},_disabled:{[$bg$9.variable]:"colors.gray.300",_dark:{[$bg$9.variable]:"colors.whiteAlpha.300"}},bg:$bg$9.reference}),baseStyleThumb=a=>{const{orientation:_}=a;return{...orient({orientation:_,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:$thumbSize.reference,h:$thumbSize.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},baseStyleFilledTrack=a=>{const{colorScheme:_}=a;return{width:"inherit",height:"inherit",[$bg$9.variable]:`colors.${_}.500`,_dark:{[$bg$9.variable]:`colors.${_}.200`},bg:$bg$9.reference}},baseStyle$u=definePartsStyle$m(a=>({container:baseStyleContainer$2(a),track:baseStyleTrack(a),thumb:baseStyleThumb(a),filledTrack:baseStyleFilledTrack(a)})),sizeLg=definePartsStyle$m({container:{[$thumbSize.variable]:"sizes.4",[$trackSize.variable]:"sizes.1"}}),sizeMd=definePartsStyle$m({container:{[$thumbSize.variable]:"sizes.3.5",[$trackSize.variable]:"sizes.1"}}),sizeSm=definePartsStyle$m({container:{[$thumbSize.variable]:"sizes.2.5",[$trackSize.variable]:"sizes.0.5"}}),sizes$d={lg:sizeLg,md:sizeMd,sm:sizeSm},sliderTheme=defineMultiStyleConfig$m({baseStyle:baseStyle$u,sizes:sizes$d,defaultProps:{size:"md",colorScheme:"blue"}}),$size$2=cssVar("spinner-size"),baseStyle$t={width:[$size$2.reference],height:[$size$2.reference]},sizes$c={xs:{[$size$2.variable]:"sizes.3"},sm:{[$size$2.variable]:"sizes.4"},md:{[$size$2.variable]:"sizes.6"},lg:{[$size$2.variable]:"sizes.8"},xl:{[$size$2.variable]:"sizes.12"}},spinnerTheme={baseStyle:baseStyle$t,sizes:sizes$c,defaultProps:{size:"md"}},{defineMultiStyleConfig:defineMultiStyleConfig$l,definePartsStyle:definePartsStyle$l}=createMultiStyleConfigHelpers(statAnatomy.keys),baseStyleLabel$1={fontWeight:"medium"},baseStyleHelpText={opacity:.8,marginBottom:"2"},baseStyleNumber={verticalAlign:"baseline",fontWeight:"semibold"},baseStyleIcon$4={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},baseStyle$s=definePartsStyle$l({container:{},label:baseStyleLabel$1,helpText:baseStyleHelpText,number:baseStyleNumber,icon:baseStyleIcon$4}),sizes$b={md:definePartsStyle$l({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},statTheme=defineMultiStyleConfig$l({baseStyle:baseStyle$s,sizes:sizes$b,defaultProps:{size:"md"}}),$bg$8=cssVar$1("kbd-bg"),baseStyle$r={[$bg$8.variable]:"colors.gray.100",_dark:{[$bg$8.variable]:"colors.whiteAlpha.100"},bg:$bg$8.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},kbdTheme={baseStyle:baseStyle$r},baseStyle$q={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},linkTheme={baseStyle:baseStyle$q},{defineMultiStyleConfig:defineMultiStyleConfig$k,definePartsStyle:definePartsStyle$k}=createMultiStyleConfigHelpers(listAnatomy.keys),baseStyleIcon$3={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},baseStyle$p=definePartsStyle$k({icon:baseStyleIcon$3}),listTheme$1=defineMultiStyleConfig$k({baseStyle:baseStyle$p}),{defineMultiStyleConfig:defineMultiStyleConfig$j,definePartsStyle:definePartsStyle$j}=createMultiStyleConfigHelpers(menuAnatomy.keys),$bg$7=cssVar$1("menu-bg"),$shadow$2=cssVar$1("menu-shadow"),baseStyleList={[$bg$7.variable]:"#fff",[$shadow$2.variable]:"shadows.sm",_dark:{[$bg$7.variable]:"colors.gray.700",[$shadow$2.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$bg$7.reference,boxShadow:$shadow$2.reference},baseStyleItem={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$7.variable]:"colors.gray.200",_dark:{[$bg$7.variable]:"colors.whiteAlpha.200"}},_expanded:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$bg$7.reference},baseStyleGroupTitle={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},baseStyleIcon$2={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},baseStyleCommand={opacity:.6},baseStyleDivider={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},baseStyleButton$1={transitionProperty:"common",transitionDuration:"normal"},baseStyle$o=definePartsStyle$j({button:baseStyleButton$1,list:baseStyleList,item:baseStyleItem,groupTitle:baseStyleGroupTitle,icon:baseStyleIcon$2,command:baseStyleCommand,divider:baseStyleDivider}),menuTheme=defineMultiStyleConfig$j({baseStyle:baseStyle$o}),{defineMultiStyleConfig:defineMultiStyleConfig$i,definePartsStyle:definePartsStyle$i}=createMultiStyleConfigHelpers(modalAnatomy.keys),$bg$6=cssVar$1("modal-bg"),$shadow$1=cssVar$1("modal-shadow"),baseStyleOverlay$1={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer$1=a=>{const{isCentered:_,scrollBehavior:$}=a;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:_?"center":"flex-start",overflow:$==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},baseStyleDialog$1=a=>{const{isCentered:_,scrollBehavior:$}=a;return{borderRadius:"md",color:"inherit",my:_?"auto":"16",mx:_?"auto":void 0,zIndex:"modal",maxH:$==="inside"?"calc(100% - 7.5rem)":void 0,[$bg$6.variable]:"colors.white",[$shadow$1.variable]:"shadows.lg",_dark:{[$bg$6.variable]:"colors.gray.700",[$shadow$1.variable]:"shadows.dark-lg"},bg:$bg$6.reference,boxShadow:$shadow$1.reference}},baseStyleHeader$2={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton$2={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody$2=a=>{const{scrollBehavior:_}=a;return{px:"6",py:"2",flex:"1",overflow:_==="inside"?"auto":void 0}},baseStyleFooter$2={px:"6",py:"4"},baseStyle$n=definePartsStyle$i(a=>({overlay:baseStyleOverlay$1,dialogContainer:runIfFn$1(baseStyleDialogContainer$1,a),dialog:runIfFn$1(baseStyleDialog$1,a),header:baseStyleHeader$2,closeButton:baseStyleCloseButton$2,body:runIfFn$1(baseStyleBody$2,a),footer:baseStyleFooter$2}));function getSize$3(a){return definePartsStyle$i(a==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:a}})}var sizes$a={xs:getSize$3("xs"),sm:getSize$3("sm"),md:getSize$3("md"),lg:getSize$3("lg"),xl:getSize$3("xl"),"2xl":getSize$3("2xl"),"3xl":getSize$3("3xl"),"4xl":getSize$3("4xl"),"5xl":getSize$3("5xl"),"6xl":getSize$3("6xl"),full:getSize$3("full")},modalTheme$1=defineMultiStyleConfig$i({baseStyle:baseStyle$n,sizes:sizes$a,defaultProps:{size:"md"}}),{defineMultiStyleConfig:defineMultiStyleConfig$h,definePartsStyle:definePartsStyle$h}=createMultiStyleConfigHelpers(numberInputAnatomy.keys),$stepperWidth=cssVar("number-input-stepper-width"),$inputPadding=cssVar("number-input-input-padding"),inputPaddingValue=calc($stepperWidth).add("0.5rem").toString(),$bg$5=cssVar("number-input-bg"),$fg$3=cssVar("number-input-color"),$border$2=cssVar("number-input-border-color"),baseStyleRoot={[$stepperWidth.variable]:"sizes.6",[$inputPadding.variable]:inputPaddingValue},baseStyleField=a=>{var _,$;return($=(_=runIfFn$1(inputTheme.baseStyle,a))==null?void 0:_.field)!=null?$:{}},baseStyleStepperGroup={width:$stepperWidth.reference},baseStyleStepper={borderStart:"1px solid",borderStartColor:$border$2.reference,color:$fg$3.reference,bg:$bg$5.reference,[$fg$3.variable]:"colors.chakra-body-text",[$border$2.variable]:"colors.chakra-border-color",_dark:{[$fg$3.variable]:"colors.whiteAlpha.800",[$border$2.variable]:"colors.whiteAlpha.300"},_active:{[$bg$5.variable]:"colors.gray.200",_dark:{[$bg$5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},baseStyle$m=definePartsStyle$h(a=>{var _;return{root:baseStyleRoot,field:(_=runIfFn$1(baseStyleField,a))!=null?_:{},stepperGroup:baseStyleStepperGroup,stepper:baseStyleStepper}});function getSize$2(a){var _,$,j;const et=(_=inputTheme.sizes)==null?void 0:_[a],tt={lg:"md",md:"md",sm:"sm",xs:"sm"},rt=(j=($=et.field)==null?void 0:$.fontSize)!=null?j:"md",nt=typography_default.fontSizes[rt];return definePartsStyle$h({field:{...et.field,paddingInlineEnd:$inputPadding.reference,verticalAlign:"top"},stepper:{fontSize:calc(nt).multiply(.75).toString(),_first:{borderTopEndRadius:tt[a]},_last:{borderBottomEndRadius:tt[a],mt:"-1px",borderTopWidth:1}}})}var sizes$9={xs:getSize$2("xs"),sm:getSize$2("sm"),md:getSize$2("md"),lg:getSize$2("lg")},numberInputTheme=defineMultiStyleConfig$h({baseStyle:baseStyle$m,sizes:sizes$9,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),_a$5,baseStyle$l={...(_a$5=inputTheme.baseStyle)==null?void 0:_a$5.field,textAlign:"center"},sizes$8={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},_a2,_b,variants$a={outline:a=>{var _,$,j;return(j=($=runIfFn$1((_=inputTheme.variants)==null?void 0:_.outline,a))==null?void 0:$.field)!=null?j:{}},flushed:a=>{var _,$,j;return(j=($=runIfFn$1((_=inputTheme.variants)==null?void 0:_.flushed,a))==null?void 0:$.field)!=null?j:{}},filled:a=>{var _,$,j;return(j=($=runIfFn$1((_=inputTheme.variants)==null?void 0:_.filled,a))==null?void 0:$.field)!=null?j:{}},unstyled:(_b=(_a2=inputTheme.variants)==null?void 0:_a2.unstyled.field)!=null?_b:{}},pinInputTheme={baseStyle:baseStyle$l,sizes:sizes$8,variants:variants$a,defaultProps:inputTheme.defaultProps},{defineMultiStyleConfig:defineMultiStyleConfig$g,definePartsStyle:definePartsStyle$g}=createMultiStyleConfigHelpers(popoverAnatomy.keys),$popperBg=cssVar("popper-bg"),$arrowBg=cssVar("popper-arrow-bg"),$arrowShadowColor=cssVar("popper-arrow-shadow-color"),baseStylePopper={zIndex:10},baseStyleContent={[$popperBg.variable]:"colors.white",bg:$popperBg.reference,[$arrowBg.variable]:$popperBg.reference,[$arrowShadowColor.variable]:"colors.gray.200",_dark:{[$popperBg.variable]:"colors.gray.700",[$arrowShadowColor.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},baseStyleHeader$1={px:3,py:2,borderBottomWidth:"1px"},baseStyleBody$1={px:3,py:2},baseStyleFooter$1={px:3,py:2,borderTopWidth:"1px"},baseStyleCloseButton$1={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},baseStyle$k=definePartsStyle$g({popper:baseStylePopper,content:baseStyleContent,header:baseStyleHeader$1,body:baseStyleBody$1,footer:baseStyleFooter$1,closeButton:baseStyleCloseButton$1}),popoverTheme=defineMultiStyleConfig$g({baseStyle:baseStyle$k}),{definePartsStyle:definePartsStyle$f,defineMultiStyleConfig:defineMultiStyleConfig$f}=createMultiStyleConfigHelpers(drawerAnatomy.keys),$bg$4=cssVar$1("drawer-bg"),$bs=cssVar$1("drawer-box-shadow");function getSize$1(a){return definePartsStyle$f(a==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:a}})}var baseStyleOverlay={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer={display:"flex",zIndex:"modal",justifyContent:"center"},baseStyleDialog=a=>{const{isFullHeight:_}=a;return{..._&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[$bg$4.variable]:"colors.white",[$bs.variable]:"shadows.lg",_dark:{[$bg$4.variable]:"colors.gray.700",[$bs.variable]:"shadows.dark-lg"},bg:$bg$4.reference,boxShadow:$bs.reference}},baseStyleHeader={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody={px:"6",py:"2",flex:"1",overflow:"auto"},baseStyleFooter={px:"6",py:"4"},baseStyle$j=definePartsStyle$f(a=>({overlay:baseStyleOverlay,dialogContainer:baseStyleDialogContainer,dialog:runIfFn$1(baseStyleDialog,a),header:baseStyleHeader,closeButton:baseStyleCloseButton,body:baseStyleBody,footer:baseStyleFooter})),sizes$7={xs:getSize$1("xs"),sm:getSize$1("md"),md:getSize$1("lg"),lg:getSize$1("2xl"),xl:getSize$1("4xl"),full:getSize$1("full")},drawerTheme$1=defineMultiStyleConfig$f({baseStyle:baseStyle$j,sizes:sizes$7,defaultProps:{size:"xs"}}),{definePartsStyle:definePartsStyle$e,defineMultiStyleConfig:defineMultiStyleConfig$e}=createMultiStyleConfigHelpers(editableAnatomy.keys),baseStylePreview={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},baseStyleInput={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyleTextarea={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyle$i=definePartsStyle$e({preview:baseStylePreview,input:baseStyleInput,textarea:baseStyleTextarea}),editableTheme=defineMultiStyleConfig$e({baseStyle:baseStyle$i}),{definePartsStyle:definePartsStyle$d,defineMultiStyleConfig:defineMultiStyleConfig$d}=createMultiStyleConfigHelpers(formAnatomy.keys),$fg$2=cssVar$1("form-control-color"),baseStyleRequiredIndicator={marginStart:"1",[$fg$2.variable]:"colors.red.500",_dark:{[$fg$2.variable]:"colors.red.300"},color:$fg$2.reference},baseStyleHelperText={mt:"2",[$fg$2.variable]:"colors.gray.600",_dark:{[$fg$2.variable]:"colors.whiteAlpha.600"},color:$fg$2.reference,lineHeight:"normal",fontSize:"sm"},baseStyle$h=definePartsStyle$d({container:{width:"100%",position:"relative"},requiredIndicator:baseStyleRequiredIndicator,helperText:baseStyleHelperText}),formTheme=defineMultiStyleConfig$d({baseStyle:baseStyle$h}),{definePartsStyle:definePartsStyle$c,defineMultiStyleConfig:defineMultiStyleConfig$c}=createMultiStyleConfigHelpers(formErrorAnatomy.keys),$fg$1=cssVar$1("form-error-color"),baseStyleText={[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},baseStyleIcon$1={marginEnd:"0.5em",[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference},baseStyle$g=definePartsStyle$c({text:baseStyleText,icon:baseStyleIcon$1}),formErrorTheme=defineMultiStyleConfig$c({baseStyle:baseStyle$g}),baseStyle$f={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},formLabelTheme={baseStyle:baseStyle$f},baseStyle$e={fontFamily:"heading",fontWeight:"bold"},sizes$6={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},headingTheme={baseStyle:baseStyle$e,sizes:sizes$6,defaultProps:{size:"xl"}},{defineMultiStyleConfig:defineMultiStyleConfig$b,definePartsStyle:definePartsStyle$b}=createMultiStyleConfigHelpers(breadcrumbAnatomy.keys),$decor=cssVar$1("breadcrumb-link-decor"),baseStyleLink={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:$decor.reference,[$decor.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[$decor.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},baseStyle$d=definePartsStyle$b({link:baseStyleLink}),breadcrumbTheme=defineMultiStyleConfig$b({baseStyle:baseStyle$d}),baseStyle$c={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variantGhost=a=>{const{colorScheme:_,theme:$}=a;if(_==="gray")return{color:mode("gray.800","whiteAlpha.900")(a),_hover:{bg:mode("gray.100","whiteAlpha.200")(a)},_active:{bg:mode("gray.200","whiteAlpha.300")(a)}};const j=transparentize(`${_}.200`,.12)($),et=transparentize(`${_}.200`,.24)($);return{color:mode(`${_}.600`,`${_}.200`)(a),bg:"transparent",_hover:{bg:mode(`${_}.50`,j)(a)},_active:{bg:mode(`${_}.100`,et)(a)}}},variantOutline=a=>{const{colorScheme:_}=a,$=mode("gray.200","whiteAlpha.300")(a);return{border:"1px solid",borderColor:_==="gray"?$:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...runIfFn$1(variantGhost,a)}},accessibleColorMap={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},variantSolid$2=a=>{var _;const{colorScheme:$}=a;if($==="gray"){const it=mode("gray.100","whiteAlpha.200")(a);return{bg:it,color:mode("gray.800","whiteAlpha.900")(a),_hover:{bg:mode("gray.200","whiteAlpha.300")(a),_disabled:{bg:it}},_active:{bg:mode("gray.300","whiteAlpha.400")(a)}}}const{bg:j=`${$}.500`,color:et="white",hoverBg:tt=`${$}.600`,activeBg:rt=`${$}.700`}=(_=accessibleColorMap[$])!=null?_:{},nt=mode(j,`${$}.200`)(a);return{bg:nt,color:mode(et,"gray.800")(a),_hover:{bg:mode(tt,`${$}.300`)(a),_disabled:{bg:nt}},_active:{bg:mode(rt,`${$}.400`)(a)}}},variantLink=a=>{const{colorScheme:_}=a;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:mode(`${_}.500`,`${_}.200`)(a),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:mode(`${_}.700`,`${_}.500`)(a)}}},variantUnstyled={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},variants$9={ghost:variantGhost,outline:variantOutline,solid:variantSolid$2,link:variantLink,unstyled:variantUnstyled},sizes$5={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},buttonTheme$1={baseStyle:baseStyle$c,variants:variants$9,sizes:sizes$5,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:definePartsStyle$a,defineMultiStyleConfig:defineMultiStyleConfig$a}=createMultiStyleConfigHelpers(cardAnatomy.keys),$bg$3=cssVar$1("card-bg"),$padding=cssVar$1("card-padding"),$shadow=cssVar$1("card-shadow"),$radius=cssVar$1("card-radius"),$border$1=cssVar$1("card-border-width","0"),$borderColor=cssVar$1("card-border-color"),baseStyle$b=definePartsStyle$a({container:{[$bg$3.variable]:"colors.chakra-body-bg",backgroundColor:$bg$3.reference,boxShadow:$shadow.reference,borderRadius:$radius.reference,color:"chakra-body-text",borderWidth:$border$1.reference,borderColor:$borderColor.reference},body:{padding:$padding.reference,flex:"1 1 0%"},header:{padding:$padding.reference},footer:{padding:$padding.reference}}),sizes$4={sm:definePartsStyle$a({container:{[$radius.variable]:"radii.base",[$padding.variable]:"space.3"}}),md:definePartsStyle$a({container:{[$radius.variable]:"radii.md",[$padding.variable]:"space.5"}}),lg:definePartsStyle$a({container:{[$radius.variable]:"radii.xl",[$padding.variable]:"space.7"}})},variants$8={elevated:definePartsStyle$a({container:{[$shadow.variable]:"shadows.base",_dark:{[$bg$3.variable]:"colors.gray.700"}}}),outline:definePartsStyle$a({container:{[$border$1.variable]:"1px",[$borderColor.variable]:"colors.chakra-border-color"}}),filled:definePartsStyle$a({container:{[$bg$3.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[$padding.variable]:0},header:{[$padding.variable]:0},footer:{[$padding.variable]:0}}},cardTheme=defineMultiStyleConfig$a({baseStyle:baseStyle$b,variants:variants$8,sizes:sizes$4,defaultProps:{variant:"elevated",size:"md"}}),$size$1=cssVar("close-button-size"),$bg$2=cssVar("close-button-bg"),baseStyle$a={w:[$size$1.reference],h:[$size$1.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[$bg$2.variable]:"colors.blackAlpha.100",_dark:{[$bg$2.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$2.variable]:"colors.blackAlpha.200",_dark:{[$bg$2.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:$bg$2.reference},sizes$3={lg:{[$size$1.variable]:"sizes.10",fontSize:"md"},md:{[$size$1.variable]:"sizes.8",fontSize:"xs"},sm:{[$size$1.variable]:"sizes.6",fontSize:"2xs"}},closeButtonTheme={baseStyle:baseStyle$a,sizes:sizes$3,defaultProps:{size:"md"}},{variants:variants$7,defaultProps:defaultProps$1}=badgeTheme,baseStyle$9={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:vars.bg.reference,color:vars.color.reference,boxShadow:vars.shadow.reference},codeTheme={baseStyle:baseStyle$9,variants:variants$7,defaultProps:defaultProps$1},baseStyle$8={w:"100%",mx:"auto",maxW:"prose",px:"4"},containerTheme={baseStyle:baseStyle$8},baseStyle$7={opacity:.6,borderColor:"inherit"},variantSolid$1={borderStyle:"solid"},variantDashed={borderStyle:"dashed"},variants$6={solid:variantSolid$1,dashed:variantDashed},dividerTheme={baseStyle:baseStyle$7,variants:variants$6,defaultProps:{variant:"solid"}},{definePartsStyle:definePartsStyle$9,defineMultiStyleConfig:defineMultiStyleConfig$9}=createMultiStyleConfigHelpers(accordionAnatomy.keys),baseStyleContainer$1={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},baseStyleButton={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},baseStylePanel={pt:"2",px:"4",pb:"5"},baseStyleIcon={fontSize:"1.25em"},baseStyle$6=definePartsStyle$9({container:baseStyleContainer$1,button:baseStyleButton,panel:baseStylePanel,icon:baseStyleIcon}),accordionTheme=defineMultiStyleConfig$9({baseStyle:baseStyle$6}),{definePartsStyle:definePartsStyle$8,defineMultiStyleConfig:defineMultiStyleConfig$8}=createMultiStyleConfigHelpers(alertAnatomy.keys),$fg=cssVar$1("alert-fg"),$bg$1=cssVar$1("alert-bg"),baseStyle$5=definePartsStyle$8({container:{bg:$bg$1.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function getBg(a){const{theme:_,colorScheme:$}=a,j=transparentize(`${$}.200`,.16)(_);return{light:`colors.${$}.100`,dark:j}}var variantSubtle=definePartsStyle$8(a=>{const{colorScheme:_}=a,$=getBg(a);return{container:{[$fg.variable]:`colors.${_}.600`,[$bg$1.variable]:$.light,_dark:{[$fg.variable]:`colors.${_}.200`,[$bg$1.variable]:$.dark}}}}),variantLeftAccent=definePartsStyle$8(a=>{const{colorScheme:_}=a,$=getBg(a);return{container:{[$fg.variable]:`colors.${_}.600`,[$bg$1.variable]:$.light,_dark:{[$fg.variable]:`colors.${_}.200`,[$bg$1.variable]:$.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:$fg.reference}}}),variantTopAccent=definePartsStyle$8(a=>{const{colorScheme:_}=a,$=getBg(a);return{container:{[$fg.variable]:`colors.${_}.600`,[$bg$1.variable]:$.light,_dark:{[$fg.variable]:`colors.${_}.200`,[$bg$1.variable]:$.dark},pt:"2",borderTopWidth:"4px",borderTopColor:$fg.reference}}}),variantSolid=definePartsStyle$8(a=>{const{colorScheme:_}=a;return{container:{[$fg.variable]:"colors.white",[$bg$1.variable]:`colors.${_}.600`,_dark:{[$fg.variable]:"colors.gray.900",[$bg$1.variable]:`colors.${_}.200`},color:$fg.reference}}}),variants$5={subtle:variantSubtle,"left-accent":variantLeftAccent,"top-accent":variantTopAccent,solid:variantSolid},alertTheme=defineMultiStyleConfig$8({baseStyle:baseStyle$5,variants:variants$5,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:definePartsStyle$7,defineMultiStyleConfig:defineMultiStyleConfig$7}=createMultiStyleConfigHelpers(avatarAnatomy.keys),$border=cssVar$1("avatar-border-color"),$bg=cssVar$1("avatar-bg"),$fs=cssVar$1("avatar-font-size"),$size=cssVar$1("avatar-size"),baseStyleBadge={borderRadius:"full",border:"0.2em solid",borderColor:$border.reference,[$border.variable]:"white",_dark:{[$border.variable]:"colors.gray.800"}},baseStyleExcessLabel={bg:$bg.reference,fontSize:$fs.reference,width:$size.reference,height:$size.reference,lineHeight:"1",[$bg.variable]:"colors.gray.200",_dark:{[$bg.variable]:"colors.whiteAlpha.400"}},baseStyleContainer=a=>{const{name:_,theme:$}=a,j=_?randomColor({string:_}):"colors.gray.400",et=isDark(j)($);let tt="white";return et||(tt="gray.800"),{bg:$bg.reference,fontSize:$fs.reference,color:tt,borderColor:$border.reference,verticalAlign:"top",width:$size.reference,height:$size.reference,"&:not([data-loaded])":{[$bg.variable]:j},[$border.variable]:"colors.white",_dark:{[$border.variable]:"colors.gray.800"}}},baseStyleLabel={fontSize:$fs.reference,lineHeight:"1"},baseStyle$4=definePartsStyle$7(a=>({badge:runIfFn$1(baseStyleBadge,a),excessLabel:runIfFn$1(baseStyleExcessLabel,a),container:runIfFn$1(baseStyleContainer,a),label:baseStyleLabel}));function getSize(a){const _=a!=="100%"?sizes_default[a]:void 0;return definePartsStyle$7({container:{[$size.variable]:_??a,[$fs.variable]:`calc(${_??a} / 2.5)`},excessLabel:{[$size.variable]:_??a,[$fs.variable]:`calc(${_??a} / 2.5)`}})}var sizes$2={"2xs":getSize(4),xs:getSize(6),sm:getSize(8),md:getSize(12),lg:getSize(16),xl:getSize(24),"2xl":getSize(32),full:getSize("100%")},avatarTheme=defineMultiStyleConfig$7({baseStyle:baseStyle$4,sizes:sizes$2,defaultProps:{size:"md"}}),components={Accordion:accordionTheme,Alert:alertTheme,Avatar:avatarTheme,Badge:badgeTheme,Breadcrumb:breadcrumbTheme,Button:buttonTheme$1,Checkbox:checkboxTheme$1,CloseButton:closeButtonTheme,Code:codeTheme,Container:containerTheme,Divider:dividerTheme,Drawer:drawerTheme$1,Editable:editableTheme,Form:formTheme,FormError:formErrorTheme,FormLabel:formLabelTheme,Heading:headingTheme,Input:inputTheme,Kbd:kbdTheme,Link:linkTheme,List:listTheme$1,Menu:menuTheme,Modal:modalTheme$1,NumberInput:numberInputTheme,PinInput:pinInputTheme,Popover:popoverTheme,Progress:progressTheme,Radio:radioTheme$1,Select:selectTheme,Skeleton:skeletonTheme,SkipLink:skipLinkTheme,Slider:sliderTheme,Spinner:spinnerTheme,Stat:statTheme,Switch:switchTheme$1,Table:tableTheme,Tabs:tabsTheme$1,Tag:tagTheme,Textarea:textareaTheme,Tooltip:tooltipTheme,Card:cardTheme,Stepper:stepperTheme},semanticTokens={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},styles={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},direction="ltr",config$4={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},theme$1={semanticTokens,direction,...foundations,components,styles,config:config$4};function isFunction$6(a){return typeof a=="function"}function pipe$2(...a){return _=>a.reduce(($,j)=>j($),_)}var createExtendTheme=a=>function(...$){let j=[...$],et=$[$.length-1];return isChakraTheme(et)&&j.length>1?j=j.slice(0,j.length-1):et=a,pipe$2(...j.map(tt=>rt=>isFunction$6(tt)?tt(rt):mergeThemeOverride(rt,tt)))(et)},extendTheme=createExtendTheme(theme$1);function mergeThemeOverride(...a){return mergeWith({},...a,mergeThemeCustomizer)}function mergeThemeCustomizer(a,_,$,j){if((isFunction$6(a)||isFunction$6(_))&&Object.prototype.hasOwnProperty.call(j,$))return(...et)=>{const tt=isFunction$6(a)?a(...et):a,rt=isFunction$6(_)?_(...et):_;return mergeWith({},tt,rt,mergeThemeCustomizer)}}function isElement$4(a){return a!=null&&typeof a=="object"&&"nodeType"in a&&a.nodeType===Node.ELEMENT_NODE}function getOwnerDocument$3(a){var _;return isElement$4(a)&&(_=a.ownerDocument)!=null?_:document}function canUseDOM$1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var isBrowser$2=canUseDOM$1();function omit$5(a,_){const $={};return Object.keys(a).forEach(j=>{_.includes(j)||($[j]=a[j])}),$}function get$3(a,_,$,j){const et=typeof _=="string"?_.split("."):[_];for(j=0;j{const _=new WeakMap;return(j,et,tt,rt)=>{if(typeof j>"u")return a(j,et,tt);_.has(j)||_.set(j,new Map);const nt=_.get(j);if(nt.has(et))return nt.get(et);const it=a(j,et,tt,rt);return nt.set(et,it),it}},memoizedGet=memoize(get$3);function objectFilter(a,_){const $={};return Object.keys(a).forEach(j=>{const et=a[j];_(et,j,a)&&($[j]=et)}),$}var filterUndefined=a=>objectFilter(a,_=>_!=null);function isFunction$5(a){return typeof a=="function"}function runIfFn(a,..._){return isFunction$5(a)?a(..._):a}function callAllHandlers(...a){return function($){a.some(j=>(j==null||j($),$==null?void 0:$.defaultPrevented))}}var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal$1(a,_){if(a===_)return!0;if(a&&_&&typeof a=="object"&&typeof _=="object"){if(a.constructor!==_.constructor)return!1;var $,j,et;if(Array.isArray(a)){if($=a.length,$!=_.length)return!1;for(j=$;j--!==0;)if(!equal$1(a[j],_[j]))return!1;return!0}var tt;if(hasMap&&a instanceof Map&&_ instanceof Map){if(a.size!==_.size)return!1;for(tt=a.entries();!(j=tt.next()).done;)if(!_.has(j.value[0]))return!1;for(tt=a.entries();!(j=tt.next()).done;)if(!equal$1(j.value[1],_.get(j.value[0])))return!1;return!0}if(hasSet&&a instanceof Set&&_ instanceof Set){if(a.size!==_.size)return!1;for(tt=a.entries();!(j=tt.next()).done;)if(!_.has(j.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(_)){if($=a.length,$!=_.length)return!1;for(j=$;j--!==0;)if(a[j]!==_[j])return!1;return!0}if(a.constructor===RegExp)return a.source===_.source&&a.flags===_.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof _.valueOf=="function")return a.valueOf()===_.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof _.toString=="function")return a.toString()===_.toString();if(et=Object.keys(a),$=et.length,$!==Object.keys(_).length)return!1;for(j=$;j--!==0;)if(!Object.prototype.hasOwnProperty.call(_,et[j]))return!1;if(hasElementType&&a instanceof Element)return!1;for(j=$;j--!==0;)if(!((et[j]==="_owner"||et[j]==="__v"||et[j]==="__o")&&a.$$typeof)&&!equal$1(a[et[j]],_[et[j]]))return!1;return!0}return a!==a&&_!==_}var reactFastCompare=function(_,$){try{return equal$1(_,$)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}};const isEqual$2=getDefaultExportFromCjs$1(reactFastCompare);function useStyleConfigImpl(a,_={}){var $;const{styleConfig:j,...et}=_,{theme:tt,colorMode:rt}=useChakra(),nt=a?memoizedGet(tt,`components.${a}`):void 0,it=j||nt,st=mergeWith({theme:tt,colorMode:rt},($=it==null?void 0:it.defaultProps)!=null?$:{},filterUndefined(omit$5(et,["children"]))),ot=reactExports.useRef({});if(it){const ut=resolveStyleConfig(it)(st);isEqual$2(ot.current,ut)||(ot.current=ut)}return ot.current}function useStyleConfig(a,_={}){return useStyleConfigImpl(a,_)}function useMultiStyleConfig(a,_={}){return useStyleConfigImpl(a,_)}var allPropNames=new Set([...propNames,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),validHTMLProps=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function shouldForwardProp(a){return validHTMLProps.has(a)||!allPropNames.has(a)}function assignAfter(a,..._){if(a==null)throw new TypeError("Cannot convert undefined or null to object");const $={...a};for(const j of _)if(j!=null)for(const et in j)Object.prototype.hasOwnProperty.call(j,et)&&(et in $&&delete $[et],$[et]=j[et]);return $}function compact$1(a){const _=Object.assign({},a);for(let $ in _)_[$]===void 0&&delete _[$];return _}function _extends$6(){return _extends$6=Object.assign?Object.assign.bind():function(a){for(var _=1;_96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(_,$,j){var et;if($){var tt=$.shouldForwardProp;et=_.__emotion_forwardProp&&tt?function(rt){return _.__emotion_forwardProp(rt)&&tt(rt)}:tt}return typeof et!="function"&&j&&(et=_.__emotion_forwardProp),et},Insertion=function(_){var $=_.cache,j=_.serialized,et=_.isStringTag;return registerStyles($,j,et),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles($,j,et)}),null},createStyled=function a(_,$){var j=_.__emotion_real===_,et=j&&_.__emotion_base||_,tt,rt;$!==void 0&&(tt=$.label,rt=$.target);var nt=composeShouldForwardProps(_,$,j),it=nt||getDefaultShouldForwardProp(et),st=!it("as");return function(){var ot=arguments,at=j&&_.__emotion_styles!==void 0?_.__emotion_styles.slice(0):[];if(tt!==void 0&&at.push("label:"+tt+";"),ot[0]==null||ot[0].raw===void 0)at.push.apply(at,ot);else{at.push(ot[0][0]);for(var ut=ot.length,ht=1;ht_=>{const{theme:$,css:j,__css:et,sx:tt,...rt}=_,nt=objectFilter(rt,(at,ut)=>isStyleProp(ut)),it=runIfFn(a,_),st=assignAfter({},et,it,filterUndefined(nt),tt),ot=css(st)(_.theme);return j?[ot,j]:ot};function styled(a,_){const{baseStyle:$,...j}=_??{};j.shouldForwardProp||(j.shouldForwardProp=shouldForwardProp);const et=toCSSObject({baseStyle:$}),tt=emotion_styled(a,j)(et);return React$2.forwardRef(function(it,st){const{colorMode:ot,forced:at}=useColorMode();return React$2.createElement(tt,{ref:st,"data-theme":at?ot:void 0,...it})})}function factory(){const a=new Map;return new Proxy(styled,{apply(_,$,j){return styled(...j)},get(_,$){return a.has($)||a.set($,styled($)),a.get($)}})}var chakra=factory();function forwardRef(a){return reactExports.forwardRef(a)}function createContext(a={}){const{strict:_=!0,errorMessage:$="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:j}=a,et=reactExports.createContext(void 0);et.displayName=j;function tt(){var rt;const nt=reactExports.useContext(et);if(!nt&&_){const it=new Error($);throw it.name="ContextError",(rt=Error.captureStackTrace)==null||rt.call(Error,it,tt),it}return nt}return[et.Provider,tt,et]}function ThemeProvider(a){const{cssVarsRoot:_,theme:$,children:j}=a,et=reactExports.useMemo(()=>toCSSVar($),[$]);return jsxRuntimeExports.jsxs(ThemeProvider$1,{theme:et,children:[jsxRuntimeExports.jsx(CSSVars,{root:_}),j]})}function CSSVars({root:a=":host, :root"}){const _=[a,"[data-theme]"].join(",");return jsxRuntimeExports.jsx(Global,{styles:$=>({[_]:$.__cssVars})})}createContext({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function createStylesContext(a){return createContext({name:`${a}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${a} />" `})}function GlobalStyle(){const{colorMode:a}=useColorMode();return jsxRuntimeExports.jsx(Global,{styles:_=>{const $=memoizedGet(_,"styles.global"),j=runIfFn($,{theme:_,colorMode:a});return j?css(j)(_):void 0}})}var EnvironmentContext=reactExports.createContext({getDocument(){return document},getWindow(){return window}});EnvironmentContext.displayName="EnvironmentContext";function useEnvironment({defer:a}={}){const[,_]=reactExports.useReducer($=>$+1,0);return useSafeLayoutEffect$2(()=>{a&&_()},[a]),reactExports.useContext(EnvironmentContext)}function EnvironmentProvider(a){const{children:_,environment:$,disabled:j}=a,et=reactExports.useRef(null),tt=reactExports.useMemo(()=>$||{getDocument:()=>{var nt,it;return(it=(nt=et.current)==null?void 0:nt.ownerDocument)!=null?it:document},getWindow:()=>{var nt,it;return(it=(nt=et.current)==null?void 0:nt.ownerDocument.defaultView)!=null?it:window}},[$]),rt=!j||!$;return jsxRuntimeExports.jsxs(EnvironmentContext.Provider,{value:tt,children:[_,rt&&jsxRuntimeExports.jsx("span",{id:"__chakra_env",hidden:!0,ref:et})]})}EnvironmentProvider.displayName="EnvironmentProvider";var ChakraProvider$1=a=>{const{children:_,colorModeManager:$,portalZIndex:j,resetScope:et,resetCSS:tt=!0,theme:rt={},environment:nt,cssVarsRoot:it,disableEnvironment:st,disableGlobalStyle:ot}=a,at=jsxRuntimeExports.jsx(EnvironmentProvider,{environment:nt,disabled:st,children:_});return jsxRuntimeExports.jsx(ThemeProvider,{theme:rt,cssVarsRoot:it,children:jsxRuntimeExports.jsxs(ColorModeProvider,{colorModeManager:$,options:rt.config,children:[tt?jsxRuntimeExports.jsx(CSSReset,{scope:et}):jsxRuntimeExports.jsx(CSSPolyfill,{}),!ot&&jsxRuntimeExports.jsx(GlobalStyle,{}),j?jsxRuntimeExports.jsx(PortalManager,{zIndex:j,children:at}):at]})})},findById=(a,_)=>a.find($=>$.id===_);function findToast(a,_){const $=getToastPosition(a,_),j=$?a[$].findIndex(et=>et.id===_):-1;return{position:$,index:j}}function getToastPosition(a,_){for(const[$,j]of Object.entries(a))if(findById(j,_))return $}function getToastStyle(a){const _=a.includes("right"),$=a.includes("left");let j="center";return _&&(j="flex-end"),$&&(j="flex-start"),{display:"flex",flexDirection:"column",alignItems:j}}function getToastListStyle(a){const $=a==="top"||a==="bottom"?"0 auto":void 0,j=a.includes("top")?"env(safe-area-inset-top, 0px)":void 0,et=a.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,tt=a.includes("left")?void 0:"env(safe-area-inset-right, 0px)",rt=a.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:$,top:j,bottom:et,right:tt,left:rt}}function useCallbackRef$2(a,_=[]){const $=reactExports.useRef(a);return reactExports.useEffect(()=>{$.current=a}),reactExports.useCallback((...j)=>{var et;return(et=$.current)==null?void 0:et.call($,...j)},_)}function useTimeout(a,_){const $=useCallbackRef$2(a);reactExports.useEffect(()=>{if(_==null)return;let j=null;return j=window.setTimeout(()=>{$()},_),()=>{j&&window.clearTimeout(j)}},[_,$])}function useUpdateEffect(a,_){const $=reactExports.useRef(!1),j=reactExports.useRef(!1);reactExports.useEffect(()=>{if($.current&&j.current)return a();j.current=!0},_),reactExports.useEffect(()=>($.current=!0,()=>{$.current=!1}),[])}const MotionConfigContext=reactExports.createContext({transformPagePoint:a=>a,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({}),PresenceContext=reactExports.createContext(null),isBrowser$1=typeof document<"u",useIsomorphicLayoutEffect$2=isBrowser$1?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1}),camelToDash=a=>a.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId),MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1};class Queue{constructor(){this.order=[],this.scheduled=new Set}add(_){if(!this.scheduled.has(_))return this.scheduled.add(_),this.order.push(_),!0}remove(_){const $=this.order.indexOf(_);$!==-1&&(this.order.splice($,1),this.scheduled.delete(_))}clear(){this.order.length=0,this.scheduled.clear()}}function createRenderStep(a){let _=new Queue,$=new Queue,j=0,et=!1,tt=!1;const rt=new WeakSet,nt={schedule:(it,st=!1,ot=!1)=>{const at=ot&&et,ut=at?_:$;return st&&rt.add(it),ut.add(it)&&at&&et&&(j=_.order.length),it},cancel:it=>{$.remove(it),rt.delete(it)},process:it=>{if(et){tt=!0;return}if(et=!0,[_,$]=[$,_],$.clear(),j=_.order.length,j)for(let st=0;st(at[ut]=createRenderStep(()=>$=!0),at),{}),rt=at=>{tt[at].process(et)},nt=()=>{const at=performance.now();$=!1,et.delta=j?1e3/60:Math.max(Math.min(at-et.timestamp,maxElapsed),1),et.timestamp=at,et.isProcessing=!0,stepsOrder.forEach(rt),et.isProcessing=!1,$&&_&&(j=!1,a(nt))},it=()=>{$=!0,j=!0,et.isProcessing||a(nt)};return{schedule:stepsOrder.reduce((at,ut)=>{const ht=tt[ut];return at[ut]=(yt,wt=!1,Ct=!1)=>($||it(),ht.schedule(yt,wt,Ct)),at},{}),cancel:at=>stepsOrder.forEach(ut=>tt[ut].cancel(at)),state:et,steps:tt}}const{schedule:microtask,cancel:cancelMicrotask}=createRenderBatcher(queueMicrotask,!1);function useVisualElement(a,_,$,j){const{visualElement:et}=reactExports.useContext(MotionContext),tt=reactExports.useContext(LazyContext),rt=reactExports.useContext(PresenceContext),nt=reactExports.useContext(MotionConfigContext).reducedMotion,it=reactExports.useRef();j=j||tt.renderer,!it.current&&j&&(it.current=j(a,{visualState:_,parent:et,props:$,presenceContext:rt,blockInitialAnimation:rt?rt.initial===!1:!1,reducedMotionConfig:nt}));const st=it.current;reactExports.useInsertionEffect(()=>{st&&st.update($,rt)});const ot=reactExports.useRef(!!($[optimizedAppearDataAttribute]&&!window.HandoffComplete));return useIsomorphicLayoutEffect$2(()=>{st&&(microtask.postRender(st.render),ot.current&&st.animationState&&st.animationState.animateChanges())}),reactExports.useEffect(()=>{st&&(st.updateFeatures(),!ot.current&&st.animationState&&st.animationState.animateChanges(),ot.current&&(ot.current=!1,window.HandoffComplete=!0))}),st}function isRefObject$2(a){return a&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function useMotionRef(a,_,$){return reactExports.useCallback(j=>{j&&a.mount&&a.mount(j),_&&(j?_.mount(j):_.unmount()),$&&(typeof $=="function"?$(j):isRefObject$2($)&&($.current=j))},[_])}function isVariantLabel(a){return typeof a=="string"||Array.isArray(a)}function isAnimationControls(a){return a!==null&&typeof a=="object"&&typeof a.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(a){return isAnimationControls(a.animate)||variantProps.some(_=>isVariantLabel(a[_]))}function isVariantNode(a){return!!(isControllingVariants(a)||a.variants)}function getCurrentTreeVariants(a,_){if(isControllingVariants(a)){const{initial:$,animate:j}=a;return{initial:$===!1||isVariantLabel($)?$:void 0,animate:isVariantLabel(j)?j:void 0}}return a.inherit!==!1?_:{}}function useCreateMotionContext(a){const{initial:_,animate:$}=getCurrentTreeVariants(a,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:_,animate:$}),[variantLabelsAsDependency(_),variantLabelsAsDependency($)])}function variantLabelsAsDependency(a){return Array.isArray(a)?a.join(" "):a}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const a in featureProps)featureDefinitions[a]={isEnabled:_=>featureProps[a].some($=>!!_[$])};function loadFeatures(a){for(const _ in a)featureDefinitions[_]={...featureDefinitions[_],...a[_]}}const LayoutGroupContext=reactExports.createContext({}),SwitchLayoutGroupContext=reactExports.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:a,createVisualElement:_,useRender:$,useVisualState:j,Component:et}){a&&loadFeatures(a);function tt(nt,it){let st;const ot={...reactExports.useContext(MotionConfigContext),...nt,layoutId:useLayoutId(nt)},{isStatic:at}=ot,ut=useCreateMotionContext(nt),ht=j(nt,at);if(!at&&isBrowser$1){ut.visualElement=useVisualElement(et,ht,ot,_);const yt=reactExports.useContext(SwitchLayoutGroupContext),wt=reactExports.useContext(LazyContext).strict;ut.visualElement&&(st=ut.visualElement.loadFeatures(ot,wt,a,yt))}return jsxRuntimeExports.jsxs(MotionContext.Provider,{value:ut,children:[st&&ut.visualElement?jsxRuntimeExports.jsx(st,{visualElement:ut.visualElement,...ot}):null,$(et,nt,useMotionRef(ht,ut.visualElement,it),ht,at,ut.visualElement)]})}const rt=reactExports.forwardRef(tt);return rt[motionComponentSymbol]=et,rt}function useLayoutId({layoutId:a}){const _=reactExports.useContext(LayoutGroupContext).id;return _&&a!==void 0?_+"-"+a:a}function createMotionProxy(a){function _(j,et={}){return createMotionComponent(a(j,et))}if(typeof Proxy>"u")return _;const $=new Map;return new Proxy(_,{get:(j,et)=>($.has(et)||$.set(et,_(et)),$.get(et))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(a){return typeof a!="string"||a.includes("-")?!1:!!(lowercaseSVGElements.indexOf(a)>-1||/[A-Z]/u.test(a))}const scaleCorrectors={};function addScaleCorrector(a){Object.assign(scaleCorrectors,a)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(a,{layout:_,layoutId:$}){return transformProps.has(a)||a.startsWith("origin")||(_||$!==void 0)&&(!!scaleCorrectors[a]||a==="opacity")}const isMotionValue=a=>!!(a&&a.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(a,{enableHardwareAcceleration:_=!0,allowTransformNone:$=!0},j,et){let tt="";for(let rt=0;rt_=>typeof _=="string"&&_.startsWith(a),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=a=>startsAsVariableToken(a)?singleCssVariableRegex.test(a.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,getValueAsType=(a,_)=>_&&typeof a=="number"?_.transform(a):a,clamp=(a,_,$)=>$>_?_:$typeof a=="number",parse:parseFloat,transform:a=>a},alpha={...number$2,transform:a=>clamp(0,1,a)},scale$1={...number$2,default:1},sanitize=a=>Math.round(a*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function isString$4(a){return typeof a=="string"}const createUnitType=a=>({test:_=>isString$4(_)&&_.endsWith(a)&&_.split(" ").length===1,parse:parseFloat,transform:_=>`${_}${a}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:a=>percent.parse(a)/100,transform:a=>percent.transform(a*100)},int$1={...number$2,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale:scale$1,scaleX:scale$1,scaleY:scale$1,scaleZ:scale$1,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int$1,backgroundPositionX:px,backgroundPositionY:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int$1};function buildHTMLStyles(a,_,$,j){const{style:et,vars:tt,transform:rt,transformOrigin:nt}=a;let it=!1,st=!1,ot=!0;for(const at in _){const ut=_[at];if(isCSSVariableName(at)){tt[at]=ut;continue}const ht=numberValueTypes[at],yt=getValueAsType(ut,ht);if(transformProps.has(at)){if(it=!0,rt[at]=yt,!ot)continue;ut!==(ht.default||0)&&(ot=!1)}else at.startsWith("origin")?(st=!0,nt[at]=yt):et[at]=yt}if(_.transform||(it||j?et.transform=buildTransform(a.transform,$,ot,j):et.transform&&(et.transform="none")),st){const{originX:at="50%",originY:ut="50%",originZ:ht=0}=nt;et.transformOrigin=`${at} ${ut} ${ht}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(a,_,$){for(const j in _)!isMotionValue(_[j])&&!isForcedMotionValue(j,$)&&(a[j]=_[j])}function useInitialMotionValues({transformTemplate:a},_,$){return reactExports.useMemo(()=>{const j=createHtmlRenderState();return buildHTMLStyles(j,_,{enableHardwareAcceleration:!$},a),Object.assign({},j.vars,j.style)},[_])}function useStyle(a,_,$){const j=a.style||{},et={};return copyRawValuesOnly(et,j,a),Object.assign(et,useInitialMotionValues(a,_,$)),et}function useHTMLProps(a,_,$){const j={},et=useStyle(a,_,$);return a.drag&&a.dragListener!==!1&&(j.draggable=!1,et.userSelect=et.WebkitUserSelect=et.WebkitTouchCallout="none",et.touchAction=a.drag===!0?"none":`pan-${a.drag==="x"?"y":"x"}`),a.tabIndex===void 0&&(a.onTap||a.onTapStart||a.whileTap)&&(j.tabIndex=0),j.style=et,j}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(a){return a.startsWith("while")||a.startsWith("drag")&&a!=="draggable"||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||validMotionProps.has(a)}let shouldForward=a=>!isValidMotionProp(a);function loadExternalIsValidProp(a){a&&(shouldForward=_=>_.startsWith("on")?!isValidMotionProp(_):a(_))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(a,_,$){const j={};for(const et in a)et==="values"&&typeof a.values=="object"||(shouldForward(et)||$===!0&&isValidMotionProp(et)||!_&&!isValidMotionProp(et)||a.draggable&&et.startsWith("onDrag"))&&(j[et]=a[et]);return j}function calcOrigin$1(a,_,$){return typeof a=="string"?a:px.transform(_+$*a)}function calcSVGTransformOrigin(a,_,$){const j=calcOrigin$1(_,a.x,a.width),et=calcOrigin$1($,a.y,a.height);return`${j} ${et}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(a,_,$=1,j=0,et=!0){a.pathLength=1;const tt=et?dashKeys:camelKeys;a[tt.offset]=px.transform(-j);const rt=px.transform(_),nt=px.transform($);a[tt.array]=`${rt} ${nt}`}function buildSVGAttrs(a,{attrX:_,attrY:$,attrScale:j,originX:et,originY:tt,pathLength:rt,pathSpacing:nt=1,pathOffset:it=0,...st},ot,at,ut){if(buildHTMLStyles(a,st,ot,ut),at){a.style.viewBox&&(a.attrs.viewBox=a.style.viewBox);return}a.attrs=a.style,a.style={};const{attrs:ht,style:yt,dimensions:wt}=a;ht.transform&&(wt&&(yt.transform=ht.transform),delete ht.transform),wt&&(et!==void 0||tt!==void 0||yt.transform)&&(yt.transformOrigin=calcSVGTransformOrigin(wt,et!==void 0?et:.5,tt!==void 0?tt:.5)),_!==void 0&&(ht.x=_),$!==void 0&&(ht.y=$),j!==void 0&&(ht.scale=j),rt!==void 0&&buildSVGPath(ht,rt,nt,it,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=a=>typeof a=="string"&&a.toLowerCase()==="svg";function useSVGProps(a,_,$,j){const et=reactExports.useMemo(()=>{const tt=createSvgRenderState();return buildSVGAttrs(tt,_,{enableHardwareAcceleration:!1},isSVGTag(j),a.transformTemplate),{...tt.attrs,style:{...tt.style}}},[_]);if(a.style){const tt={};copyRawValuesOnly(tt,a.style,a),et.style={...tt,...et.style}}return et}function createUseRender(a=!1){return($,j,et,{latestValues:tt},rt)=>{const it=(isSVGComponent($)?useSVGProps:useHTMLProps)(j,tt,rt,$),st=filterProps(j,typeof $=="string",a),ot=$!==reactExports.Fragment?{...st,...it,ref:et}:{},{children:at}=j,ut=reactExports.useMemo(()=>isMotionValue(at)?at.get():at,[at]);return reactExports.createElement($,{...ot,children:ut})}}function renderHTML(a,{style:_,vars:$},j,et){Object.assign(a.style,_,et&&et.getProjectionStyles(j));for(const tt in $)a.style.setProperty(tt,$[tt])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(a,_,$,j){renderHTML(a,_,void 0,j);for(const et in _.attrs)a.setAttribute(camelCaseAttributes.has(et)?et:camelToDash(et),_.attrs[et])}function scrapeMotionValuesFromProps$1(a,_,$){var j;const{style:et}=a,tt={};for(const rt in et)(isMotionValue(et[rt])||_.style&&isMotionValue(_.style[rt])||isForcedMotionValue(rt,a)||((j=$==null?void 0:$.getValue(rt))===null||j===void 0?void 0:j.liveStyle)!==void 0)&&(tt[rt]=et[rt]);return tt}function scrapeMotionValuesFromProps(a,_,$){const j=scrapeMotionValuesFromProps$1(a,_,$);for(const et in a)if(isMotionValue(a[et])||isMotionValue(_[et])){const tt=transformPropOrder.indexOf(et)!==-1?"attr"+et.charAt(0).toUpperCase()+et.substring(1):et;j[tt]=a[et]}return j}function getValueState(a){const _=[{},{}];return a==null||a.values.forEach(($,j)=>{_[0][j]=$.get(),_[1][j]=$.getVelocity()}),_}function resolveVariantFromProps(a,_,$,j){if(typeof _=="function"){const[et,tt]=getValueState(j);_=_($!==void 0?$:a.custom,et,tt)}if(typeof _=="string"&&(_=a.variants&&a.variants[_]),typeof _=="function"){const[et,tt]=getValueState(j);_=_($!==void 0?$:a.custom,et,tt)}return _}function useConstant(a){const _=reactExports.useRef(null);return _.current===null&&(_.current=a()),_.current}const isKeyframesTarget=a=>Array.isArray(a),isCustomValue=a=>!!(a&&typeof a=="object"&&a.mix&&a.toValue),resolveFinalValueInKeyframes=a=>isKeyframesTarget(a)?a[a.length-1]||0:a;function resolveMotionValue(a){const _=isMotionValue(a)?a.get():a;return isCustomValue(_)?_.toValue():_}function makeState({scrapeMotionValuesFromProps:a,createRenderState:_,onMount:$},j,et,tt){const rt={latestValues:makeLatestValues(j,et,tt,a),renderState:_()};return $&&(rt.mount=nt=>$(j,nt,rt)),rt}const makeUseVisualState=a=>(_,$)=>{const j=reactExports.useContext(MotionContext),et=reactExports.useContext(PresenceContext),tt=()=>makeState(a,_,j,et);return $?tt():useConstant(tt)};function makeLatestValues(a,_,$,j){const et={},tt=j(a,{});for(const ut in tt)et[ut]=resolveMotionValue(tt[ut]);let{initial:rt,animate:nt}=a;const it=isControllingVariants(a),st=isVariantNode(a);_&&st&&!it&&a.inherit!==!1&&(rt===void 0&&(rt=_.initial),nt===void 0&&(nt=_.animate));let ot=$?$.initial===!1:!1;ot=ot||rt===!1;const at=ot?nt:rt;return at&&typeof at!="boolean"&&!isAnimationControls(at)&&(Array.isArray(at)?at:[at]).forEach(ht=>{const yt=resolveVariantFromProps(a,ht);if(!yt)return;const{transitionEnd:wt,transition:Ct,...Pt}=yt;for(const $t in Pt){let Mt=Pt[$t];if(Array.isArray(Mt)){const Bt=ot?Mt.length-1:0;Mt=Mt[Bt]}Mt!==null&&(et[$t]=Mt)}for(const $t in wt)et[$t]=wt[$t]}),et}const noop$b=a=>a,{schedule:frame,cancel:cancelFrame,state:frameData,steps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$b,!0),svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(a,_,{renderState:$,latestValues:j})=>{frame.read(()=>{try{$.dimensions=typeof _.getBBox=="function"?_.getBBox():_.getBoundingClientRect()}catch{$.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs($,j,{enableHardwareAcceleration:!1},isSVGTag(_.tagName),a.transformTemplate),renderSVG(_,$)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(a,{forwardMotionProps:_=!1},$,j){return{...isSVGComponent(a)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:$,useRender:createUseRender(_),createVisualElement:j,Component:a}}function addDomEvent(a,_,$,j={passive:!0}){return a.addEventListener(_,$,j),()=>a.removeEventListener(_,$)}const isPrimaryPointer=a=>a.pointerType==="mouse"?typeof a.button!="number"||a.button<=0:a.isPrimary!==!1;function extractEventInfo(a,_="page"){return{point:{x:a[`${_}X`],y:a[`${_}Y`]}}}const addPointerInfo=a=>_=>isPrimaryPointer(_)&&a(_,extractEventInfo(_));function addPointerEvent(a,_,$,j){return addDomEvent(a,_,addPointerInfo($),j)}const combineFunctions=(a,_)=>$=>_(a($)),pipe$1=(...a)=>a.reduce(combineFunctions);function createLock(a){let _=null;return()=>{const $=()=>{_=null};return _===null?(_=a,$):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(a){let _=!1;if(a==="y")_=globalVerticalLock();else if(a==="x")_=globalHorizontalLock();else{const $=globalHorizontalLock(),j=globalVerticalLock();$&&j?_=()=>{$(),j()}:($&&$(),j&&j())}return _}function isDragActive(){const a=getGlobalLock(!0);return a?(a(),!1):!0}class Feature{constructor(_){this.isMounted=!1,this.node=_}update(){}}function addHoverEvent(a,_){const $=_?"pointerenter":"pointerleave",j=_?"onHoverStart":"onHoverEnd",et=(tt,rt)=>{if(tt.pointerType==="touch"||isDragActive())return;const nt=a.getProps();a.animationState&&nt.whileHover&&a.animationState.setActive("whileHover",_);const it=nt[j];it&&frame.postRender(()=>it(tt,rt))};return addPointerEvent(a.current,$,et,{passive:!a.getProps()[j]})}class HoverGesture extends Feature{mount(){this.unmount=pipe$1(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let _=!1;try{_=this.node.current.matches(":focus-visible")}catch{_=!0}!_||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe$1(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(a,_)=>_?a===_?!0:isNodeOrChild(a,_.parentElement):!1;function fireSyntheticPointerEvent(a,_){if(!_)return;const $=new PointerEvent("pointer"+a);_($,extractEventInfo($))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$b,this.removeEndListeners=noop$b,this.removeAccessibleListeners=noop$b,this.startPointerPress=(_,$)=>{if(this.isPressing)return;this.removeEndListeners();const j=this.node.getProps(),tt=addPointerEvent(window,"pointerup",(nt,it)=>{if(!this.checkPressEnd())return;const{onTap:st,onTapCancel:ot,globalTapTarget:at}=this.node.getProps(),ut=!at&&!isNodeOrChild(this.node.current,nt.target)?ot:st;ut&&frame.update(()=>ut(nt,it))},{passive:!(j.onTap||j.onPointerUp)}),rt=addPointerEvent(window,"pointercancel",(nt,it)=>this.cancelPress(nt,it),{passive:!(j.onTapCancel||j.onPointerCancel)});this.removeEndListeners=pipe$1(tt,rt),this.startPress(_,$)},this.startAccessiblePress=()=>{const _=tt=>{if(tt.key!=="Enter"||this.isPressing)return;const rt=nt=>{nt.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(it,st)=>{const{onTap:ot}=this.node.getProps();ot&&frame.postRender(()=>ot(it,st))})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",rt),fireSyntheticPointerEvent("down",(nt,it)=>{this.startPress(nt,it)})},$=addDomEvent(this.node.current,"keydown",_),j=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(tt,rt)=>this.cancelPress(tt,rt))},et=addDomEvent(this.node.current,"blur",j);this.removeAccessibleListeners=pipe$1($,et)}}startPress(_,$){this.isPressing=!0;const{onTapStart:j,whileTap:et}=this.node.getProps();et&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),j&&frame.postRender(()=>j(_,$))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(_,$){if(!this.checkPressEnd())return;const{onTapCancel:j}=this.node.getProps();j&&frame.postRender(()=>j(_,$))}mount(){const _=this.node.getProps(),$=addPointerEvent(_.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(_.onTapStart||_.onPointerStart)}),j=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe$1($,j)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=a=>{const _=observerCallbacks.get(a.target);_&&_(a)},fireAllObserverCallbacks=a=>{a.forEach(fireObserverCallback)};function initIntersectionObserver({root:a,..._}){const $=a||document;observers.has($)||observers.set($,{});const j=observers.get($),et=JSON.stringify(_);return j[et]||(j[et]=new IntersectionObserver(fireAllObserverCallbacks,{root:a,..._})),j[et]}function observeIntersection(a,_,$){const j=initIntersectionObserver(_);return observerCallbacks.set(a,$),j.observe(a),()=>{observerCallbacks.delete(a),j.unobserve(a)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:_={}}=this.node.getProps(),{root:$,margin:j,amount:et="some",once:tt}=_,rt={root:$?$.current:void 0,rootMargin:j,threshold:typeof et=="number"?et:thresholdNames[et]},nt=it=>{const{isIntersecting:st}=it;if(this.isInView===st||(this.isInView=st,tt&&!st&&this.hasEnteredView))return;st&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",st);const{onViewportEnter:ot,onViewportLeave:at}=this.node.getProps(),ut=st?ot:at;ut&&ut(it)};return observeIntersection(this.node.current,rt,nt)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:_,prevProps:$}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(_,$))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:a={}},{viewport:_={}}={}){return $=>a[$]!==_[$]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(a,_){if(!Array.isArray(_))return!1;const $=_.length;if($!==a.length)return!1;for(let j=0;j<$;j++)if(_[j]!==a[j])return!1;return!0}function resolveVariant(a,_,$){const j=a.getProps();return resolveVariantFromProps(j,_,$!==void 0?$:j.custom,a)}const secondsToMilliseconds$1=a=>a*1e3,millisecondsToSeconds=a=>a/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=a=>({type:"spring",stiffness:550,damping:a===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(a,{keyframes:_})=>_.length>2?keyframesTransition:transformProps.has(a)?a.startsWith("scale")?criticallyDampedSpring(_[1]):underDampedSpring:ease;function isTransitionDefined({when:a,delay:_,delayChildren:$,staggerChildren:j,staggerDirection:et,repeat:tt,repeatType:rt,repeatDelay:nt,from:it,elapsed:st,...ot}){return!!Object.keys(ot).length}function getValueTransition(a,_){return a[_]||a.default||a}const isNotNull=a=>a!==null;function getFinalKeyframe(a,{repeat:_,repeatType:$="loop"},j){const et=a.filter(isNotNull),tt=_&&$!=="loop"&&_%2===1?0:et.length-1;return!tt||j===void 0?et[tt]:j}let now$1;function clearTime(){now$1=void 0}const time={now:()=>(now$1===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now$1),set:a=>{now$1=a,queueMicrotask(clearTime)}},isZeroValueString=a=>/^0[^.\s]+$/u.test(a);function isNone(a){return typeof a=="number"?a===0:a!==null?a==="none"||a==="0"||isZeroValueString(a):!0}let invariant$1=noop$b;const isNumericalString=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a),splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(a){const _=splitCSSVariableRegex.exec(a);if(!_)return[,];const[,$,j,et]=_;return[`--${$??j}`,et]}function getVariableValue(a,_,$=1){const[j,et]=parseCSSVariable(a);if(!j)return;const tt=window.getComputedStyle(_).getPropertyValue(j);if(tt){const rt=tt.trim();return isNumericalString(rt)?parseFloat(rt):rt}return isCSSVariableToken(et)?getVariableValue(et,_,$+1):et}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=a=>a===number$2||a===px,getPosFromMatrix=(a,_)=>parseFloat(a.split(", ")[_]),getTranslateFromMatrix=(a,_)=>($,{transform:j})=>{if(j==="none"||!j)return 0;const et=j.match(/^matrix3d\((.+)\)$/u);if(et)return getPosFromMatrix(et[1],_);{const tt=j.match(/^matrix\((.+)\)$/u);return tt?getPosFromMatrix(tt[1],a):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(a=>!transformKeys.has(a));function removeNonTranslationalTransform(a){const _=[];return nonTranslationalTransformKeys.forEach($=>{const j=a.getValue($);j!==void 0&&(_.push([$,j.get()]),j.set($.startsWith("scale")?1:0))}),_}const positionalValues={width:({x:a},{paddingLeft:_="0",paddingRight:$="0"})=>a.max-a.min-parseFloat(_)-parseFloat($),height:({y:a},{paddingTop:_="0",paddingBottom:$="0"})=>a.max-a.min-parseFloat(_)-parseFloat($),top:(a,{top:_})=>parseFloat(_),left:(a,{left:_})=>parseFloat(_),bottom:({y:a},{top:_})=>parseFloat(_)+(a.max-a.min),right:({x:a},{left:_})=>parseFloat(_)+(a.max-a.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x;positionalValues.translateY=positionalValues.y;const testValueType=a=>_=>_.test(a),auto$1={test:a=>a==="auto",parse:a=>a},dimensionValueTypes=[number$2,px,percent,degrees,vw,vh,auto$1],findDimensionValueType=a=>dimensionValueTypes.find(testValueType(a)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const a=Array.from(toResolve).filter(j=>j.needsMeasurement),_=new Set(a.map(j=>j.element)),$=new Map;_.forEach(j=>{const et=removeNonTranslationalTransform(j);et.length&&($.set(j,et),j.render())}),a.forEach(j=>j.measureInitialState()),_.forEach(j=>{j.render();const et=$.get(j);et&&et.forEach(([tt,rt])=>{var nt;(nt=j.getValue(tt))===null||nt===void 0||nt.set(rt)})}),a.forEach(j=>j.measureEndState()),a.forEach(j=>{j.suspendedScrollY!==void 0&&window.scrollTo(0,j.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(a=>a.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(_,$,j,et,tt,rt=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[..._],this.onComplete=$,this.name=j,this.motionValue=et,this.element=tt,this.isAsync=rt}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:_,name:$,element:j,motionValue:et}=this;for(let tt=0;tt<_.length;tt++)if(_[tt]===null)if(tt===0){const rt=et==null?void 0:et.get(),nt=_[_.length-1];if(rt!==void 0)_[0]=rt;else if(j&&$){const it=j.readValue($,nt);it!=null&&(_[0]=it)}_[0]===void 0&&(_[0]=nt),et&&rt===void 0&&et.set(_[0])}else _[tt]=_[tt-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),toResolve.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,toResolve.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const isColorString=(a,_)=>$=>!!(isString$4($)&&singleColorRegex.test($)&&$.startsWith(a)||_&&Object.prototype.hasOwnProperty.call($,_)),splitColor=(a,_,$)=>j=>{if(!isString$4(j))return j;const[et,tt,rt,nt]=j.match(floatRegex);return{[a]:parseFloat(et),[_]:parseFloat(tt),[$]:parseFloat(rt),alpha:nt!==void 0?parseFloat(nt):1}},clampRgbUnit=a=>clamp(0,255,a),rgbUnit={...number$2,transform:a=>Math.round(clampRgbUnit(a))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:a,green:_,blue:$,alpha:j=1})=>"rgba("+rgbUnit.transform(a)+", "+rgbUnit.transform(_)+", "+rgbUnit.transform($)+", "+sanitize(alpha.transform(j))+")"};function parseHex$1(a){let _="",$="",j="",et="";return a.length>5?(_=a.substring(1,3),$=a.substring(3,5),j=a.substring(5,7),et=a.substring(7,9)):(_=a.substring(1,2),$=a.substring(2,3),j=a.substring(3,4),et=a.substring(4,5),_+=_,$+=$,j+=j,et+=et),{red:parseInt(_,16),green:parseInt($,16),blue:parseInt(j,16),alpha:et?parseInt(et,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex$1,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:a,saturation:_,lightness:$,alpha:j=1})=>"hsla("+Math.round(a)+", "+percent.transform(sanitize(_))+", "+percent.transform(sanitize($))+", "+sanitize(alpha.transform(j))+")"},color$1={test:a=>rgba.test(a)||hex.test(a)||hsla.test(a),parse:a=>rgba.test(a)?rgba.parse(a):hsla.test(a)?hsla.parse(a):hex.parse(a),transform:a=>isString$4(a)?a:a.hasOwnProperty("red")?rgba.transform(a):hsla.transform(a)};function test$1(a){var _,$;return isNaN(a)&&isString$4(a)&&(((_=a.match(floatRegex))===null||_===void 0?void 0:_.length)||0)+((($=a.match(colorRegex))===null||$===void 0?void 0:$.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(a){const _=a.toString(),$=[],j={color:[],number:[],var:[]},et=[];let tt=0;const nt=_.replace(complexRegex,it=>(color$1.test(it)?(j.color.push(tt),et.push(COLOR_TOKEN),$.push(color$1.parse(it))):it.startsWith(VAR_FUNCTION_TOKEN)?(j.var.push(tt),et.push(VAR_TOKEN),$.push(it)):(j.number.push(tt),et.push(NUMBER_TOKEN),$.push(parseFloat(it))),++tt,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:$,split:nt,indexes:j,types:et}}function parseComplexValue(a){return analyseComplexValue(a).values}function createTransformer(a){const{split:_,types:$}=analyseComplexValue(a),j=_.length;return et=>{let tt="";for(let rt=0;rttypeof a=="number"?0:a;function getAnimatableNone$1(a){const _=parseComplexValue(a);return createTransformer(a)(_.map(convertNumbersToZero))}const complex={test:test$1,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(a){const[_,$]=a.slice(0,-1).split("(");if(_==="drop-shadow")return a;const[j]=$.match(floatRegex)||[];if(!j)return a;const et=$.replace(j,"");let tt=maxDefaults.has(_)?1:0;return j!==$&&(tt*=100),_+"("+tt+et+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter$1={...complex,getAnimatableNone:a=>{const _=a.match(functionRegex);return _?_.map(applyDefaultFilter).join(" "):a}},defaultValueTypes={...numberValueTypes,color:color$1,backgroundColor:color$1,outlineColor:color$1,fill:color$1,stroke:color$1,borderColor:color$1,borderTopColor:color$1,borderRightColor:color$1,borderBottomColor:color$1,borderLeftColor:color$1,filter:filter$1,WebkitFilter:filter$1},getDefaultValueType=a=>defaultValueTypes[a];function getAnimatableNone(a,_){let $=getDefaultValueType(a);return $!==filter$1&&($=complex),$.getAnimatableNone?$.getAnimatableNone(_):void 0}const invalidTemplates=new Set(["auto","none","0"]);function makeNoneKeyframesAnimatable(a,_,$){let j=0,et;for(;j{$.getValue(it).set(st)}),this.resolveNoneKeyframes()}}function memo(a){let _;return()=>(_===void 0&&(_=a()),_)}const isAnimatable=(a,_)=>_==="zIndex"?!1:!!(typeof a=="number"||Array.isArray(a)||typeof a=="string"&&(complex.test(a)||a==="0")&&!a.startsWith("url("));function hasKeyframesChanged(a){const _=a[0];if(a.length===1)return!0;for(let $=0;${this.resolveFinishedPromise=_})}}function velocityPerSecond(a,_){return _?a*(1e3/_):0}const velocitySampleDuration=5;function calcGeneratorVelocity(a,_,$){const j=Math.max(_-velocitySampleDuration,0);return velocityPerSecond($-a(j),_-j)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:a=800,bounce:_=.25,velocity:$=0,mass:j=1}){let et,tt,rt=1-_;rt=clamp(minDamping,maxDamping,rt),a=clamp(minDuration,maxDuration$1,millisecondsToSeconds(a)),rt<1?(et=st=>{const ot=st*rt,at=ot*a,ut=ot-$,ht=calcAngularFreq(st,rt),yt=Math.exp(-at);return safeMin-ut/ht*yt},tt=st=>{const at=st*rt*a,ut=at*$+$,ht=Math.pow(rt,2)*Math.pow(st,2)*a,yt=Math.exp(-at),wt=calcAngularFreq(Math.pow(st,2),rt);return(-et(st)+safeMin>0?-1:1)*((ut-ht)*yt)/wt}):(et=st=>{const ot=Math.exp(-st*a),at=(st-$)*a+1;return-safeMin+ot*at},tt=st=>{const ot=Math.exp(-st*a),at=($-st)*(a*a);return ot*at});const nt=5/a,it=approximateRoot(et,tt,nt);if(a=secondsToMilliseconds$1(a),isNaN(it))return{stiffness:100,damping:10,duration:a};{const st=Math.pow(it,2)*j;return{stiffness:st,damping:rt*2*Math.sqrt(j*st),duration:a}}}const rootIterations=12;function approximateRoot(a,_,$){let j=$;for(let et=1;eta[$]!==void 0)}function getSpringOptions(a){let _={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...a};if(!isSpringType(a,physicsKeys)&&isSpringType(a,durationKeys)){const $=findSpring(a);_={..._,...$,mass:1},_.isResolvedFromDuration=!0}return _}function spring({keyframes:a,restDelta:_,restSpeed:$,...j}){const et=a[0],tt=a[a.length-1],rt={done:!1,value:et},{stiffness:nt,damping:it,mass:st,duration:ot,velocity:at,isResolvedFromDuration:ut}=getSpringOptions({...j,velocity:-millisecondsToSeconds(j.velocity||0)}),ht=at||0,yt=it/(2*Math.sqrt(nt*st)),wt=tt-et,Ct=millisecondsToSeconds(Math.sqrt(nt/st)),Pt=Math.abs(wt)<5;$||($=Pt?.01:2),_||(_=Pt?.005:.5);let $t;if(yt<1){const Mt=calcAngularFreq(Ct,yt);$t=Bt=>{const Dt=Math.exp(-yt*Ct*Bt);return tt-Dt*((ht+yt*Ct*wt)/Mt*Math.sin(Mt*Bt)+wt*Math.cos(Mt*Bt))}}else if(yt===1)$t=Mt=>tt-Math.exp(-Ct*Mt)*(wt+(ht+Ct*wt)*Mt);else{const Mt=Ct*Math.sqrt(yt*yt-1);$t=Bt=>{const Dt=Math.exp(-yt*Ct*Bt),zt=Math.min(Mt*Bt,300);return tt-Dt*((ht+yt*Ct*wt)*Math.sinh(zt)+Mt*wt*Math.cosh(zt))/Mt}}return{calculatedDuration:ut&&ot||null,next:Mt=>{const Bt=$t(Mt);if(ut)rt.done=Mt>=ot;else{let Dt=ht;Mt!==0&&(yt<1?Dt=calcGeneratorVelocity($t,Mt,Bt):Dt=0);const zt=Math.abs(Dt)<=$,Ot=Math.abs(tt-Bt)<=_;rt.done=zt&&Ot}return rt.value=rt.done?tt:Bt,rt}}}function inertia({keyframes:a,velocity:_=0,power:$=.8,timeConstant:j=325,bounceDamping:et=10,bounceStiffness:tt=500,modifyTarget:rt,min:nt,max:it,restDelta:st=.5,restSpeed:ot}){const at=a[0],ut={done:!1,value:at},ht=It=>nt!==void 0&&Itit,yt=It=>nt===void 0?it:it===void 0||Math.abs(nt-It)-wt*Math.exp(-It/j),Mt=It=>Pt+$t(It),Bt=It=>{const Lt=$t(It),Ft=Mt(It);ut.done=Math.abs(Lt)<=st,ut.value=ut.done?Pt:Ft};let Dt,zt;const Ot=It=>{ht(ut.value)&&(Dt=It,zt=spring({keyframes:[ut.value,yt(ut.value)],velocity:calcGeneratorVelocity(Mt,It,ut.value),damping:et,stiffness:tt,restDelta:st,restSpeed:ot}))};return Ot(0),{calculatedDuration:null,next:It=>{let Lt=!1;return!zt&&Dt===void 0&&(Lt=!0,Bt(It),Ot(It)),Dt!==void 0&&It>=Dt?zt.next(It-Dt):(!Lt&&Bt(It),ut)}}}const calcBezier=(a,_,$)=>(((1-3*$+3*_)*a+(3*$-6*_))*a+3*_)*a,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(a,_,$,j,et){let tt,rt,nt=0;do rt=_+($-_)/2,tt=calcBezier(rt,j,et)-a,tt>0?$=rt:_=rt;while(Math.abs(tt)>subdivisionPrecision&&++ntbinarySubdivide(tt,0,1,a,$);return tt=>tt===0||tt===1?tt:calcBezier(et(tt),_,j)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=a=>Array.isArray(a)&&typeof a[0]!="number",mirrorEasing=a=>_=>_<=.5?a(2*_)/2:(2-a(2*(1-_)))/2,reverseEasing=a=>_=>1-a(1-_),circIn=a=>1-Math.sin(Math.acos(a)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=a=>(a*=2)<1?.5*backIn(a):.5*(2-Math.pow(2,-10*(a-1))),easingLookup={linear:noop$b,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=a=>{if(Array.isArray(a)){invariant$1(a.length===4);const[_,$,j,et]=a;return cubicBezier(_,$,j,et)}else if(typeof a=="string")return invariant$1(easingLookup[a]!==void 0),easingLookup[a];return a},progress=(a,_,$)=>{const j=_-a;return j===0?1:($-a)/j},mixNumber$1=(a,_,$)=>a+(_-a)*$;function hueToRgb(a,_,$){return $<0&&($+=1),$>1&&($-=1),$<1/6?a+(_-a)*6*$:$<1/2?_:$<2/3?a+(_-a)*(2/3-$)*6:a}function hslaToRgba({hue:a,saturation:_,lightness:$,alpha:j}){a/=360,_/=100,$/=100;let et=0,tt=0,rt=0;if(!_)et=tt=rt=$;else{const nt=$<.5?$*(1+_):$+_-$*_,it=2*$-nt;et=hueToRgb(it,nt,a+1/3),tt=hueToRgb(it,nt,a),rt=hueToRgb(it,nt,a-1/3)}return{red:Math.round(et*255),green:Math.round(tt*255),blue:Math.round(rt*255),alpha:j}}const mixLinearColor=(a,_,$)=>{const j=a*a,et=$*(_*_-j)+j;return et<0?0:Math.sqrt(et)},colorTypes=[hex,rgba,hsla],getColorType=a=>colorTypes.find(_=>_.test(a));function asRGBA(a){const _=getColorType(a);let $=_.parse(a);return _===hsla&&($=hslaToRgba($)),$}const mixColor=(a,_)=>{const $=asRGBA(a),j=asRGBA(_),et={...$};return tt=>(et.red=mixLinearColor($.red,j.red,tt),et.green=mixLinearColor($.green,j.green,tt),et.blue=mixLinearColor($.blue,j.blue,tt),et.alpha=mixNumber$1($.alpha,j.alpha,tt),rgba.transform(et))},invisibleValues=new Set(["none","hidden"]);function mixVisibility(a,_){return invisibleValues.has(a)?$=>$<=0?a:_:$=>$>=1?_:a}function mixImmediate(a,_){return $=>$>0?_:a}function mixNumber(a,_){return $=>mixNumber$1(a,_,$)}function getMixer(a){return typeof a=="number"?mixNumber:typeof a=="string"?isCSSVariableToken(a)?mixImmediate:color$1.test(a)?mixColor:mixComplex:Array.isArray(a)?mixArray:typeof a=="object"?color$1.test(a)?mixColor:mixObject:mixImmediate}function mixArray(a,_){const $=[...a],j=$.length,et=a.map((tt,rt)=>getMixer(tt)(tt,_[rt]));return tt=>{for(let rt=0;rt{for(const tt in j)$[tt]=j[tt](et);return $}}function matchOrder(a,_){var $;const j=[],et={color:0,var:0,number:0};for(let tt=0;tt<_.values.length;tt++){const rt=_.types[tt],nt=a.indexes[rt][et[rt]],it=($=a.values[nt])!==null&&$!==void 0?$:0;j[tt]=it,et[rt]++}return j}const mixComplex=(a,_)=>{const $=complex.createTransformer(_),j=analyseComplexValue(a),et=analyseComplexValue(_);return j.indexes.var.length===et.indexes.var.length&&j.indexes.color.length===et.indexes.color.length&&j.indexes.number.length>=et.indexes.number.length?invisibleValues.has(a)&&!et.values.length||invisibleValues.has(_)&&!j.values.length?mixVisibility(a,_):pipe$1(mixArray(matchOrder(j,et),et.values),$):mixImmediate(a,_)};function mix(a,_,$){return typeof a=="number"&&typeof _=="number"&&typeof $=="number"?mixNumber$1(a,_,$):getMixer(a)(a,_)}function createMixers(a,_,$){const j=[],et=$||mix,tt=a.length-1;for(let rt=0;rt_[0];if(tt===2&&a[0]===a[1])return()=>_[1];a[0]>a[tt-1]&&(a=[...a].reverse(),_=[..._].reverse());const rt=createMixers(_,j,et),nt=rt.length,it=st=>{let ot=0;if(nt>1)for(;otit(clamp(a[0],a[tt-1],st)):it}function fillOffset(a,_){const $=a[a.length-1];for(let j=1;j<=_;j++){const et=progress(0,_,j);a.push(mixNumber$1($,1,et))}}function defaultOffset(a){const _=[0];return fillOffset(_,a.length-1),_}function convertOffsetToTimes(a,_){return a.map($=>$*_)}function defaultEasing(a,_){return a.map(()=>_||easeInOut).splice(0,a.length-1)}function keyframes({duration:a=300,keyframes:_,times:$,ease:j="easeInOut"}){const et=isEasingArray(j)?j.map(easingDefinitionToFunction):easingDefinitionToFunction(j),tt={done:!1,value:_[0]},rt=convertOffsetToTimes($&&$.length===_.length?$:defaultOffset(_),a),nt=interpolate(rt,_,{ease:Array.isArray(et)?et:defaultEasing(_,et)});return{calculatedDuration:a,next:it=>(tt.value=nt(it),tt.done=it>=a,tt)}}const maxGeneratorDuration=2e4;function calcGeneratorDuration(a){let _=0;const $=50;let j=a.next(_);for(;!j.done&&_=maxGeneratorDuration?1/0:_}const frameloopDriver=a=>{const _=({timestamp:$})=>a($);return{start:()=>frame.update(_,!0),stop:()=>cancelFrame(_),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=a=>a/100;class MainThreadAnimation extends BaseAnimation{constructor({KeyframeResolver:_=KeyframeResolver,...$}){super($),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:nt}=this.options;nt&&nt()};const{name:j,motionValue:et,keyframes:tt}=this.options,rt=(nt,it)=>this.onKeyframesResolved(nt,it);j&&et&&et.owner?this.resolver=et.owner.resolveKeyframes(tt,rt,j,et):this.resolver=new _(tt,rt,j,et),this.resolver.scheduleResolve()}initPlayback(_){const{type:$="keyframes",repeat:j=0,repeatDelay:et=0,repeatType:tt,velocity:rt=0}=this.options,nt=generators[$]||keyframes;let it,st;nt!==keyframes&&typeof _[0]!="number"&&(it=pipe$1(percentToProgress,mix(_[0],_[1])),_=[0,100]);const ot=nt({...this.options,keyframes:_});tt==="mirror"&&(st=nt({...this.options,keyframes:[..._].reverse(),velocity:-rt})),ot.calculatedDuration===null&&(ot.calculatedDuration=calcGeneratorDuration(ot));const{calculatedDuration:at}=ot,ut=at+et,ht=ut*(j+1)-et;return{generator:ot,mirroredGenerator:st,mapPercentToKeyframes:it,calculatedDuration:at,resolvedDuration:ut,totalDuration:ht}}onPostResolved(){const{autoplay:_=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!_?this.pause():this.state=this.pendingPlayState}tick(_,$=!1){const{resolved:j}=this;if(!j){const{keyframes:It}=this.options;return{done:!0,value:It[It.length-1]}}const{finalKeyframe:et,generator:tt,mirroredGenerator:rt,mapPercentToKeyframes:nt,keyframes:it,calculatedDuration:st,totalDuration:ot,resolvedDuration:at}=j;if(this.startTime===null)return tt.next(0);const{delay:ut,repeat:ht,repeatType:yt,repeatDelay:wt,onUpdate:Ct}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,_):this.speed<0&&(this.startTime=Math.min(_-ot/this.speed,this.startTime)),$?this.currentTime=_:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(_-this.startTime)*this.speed;const Pt=this.currentTime-ut*(this.speed>=0?1:-1),$t=this.speed>=0?Pt<0:Pt>ot;this.currentTime=Math.max(Pt,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=ot);let Mt=this.currentTime,Bt=tt;if(ht){const It=Math.min(this.currentTime,ot)/at;let Lt=Math.floor(It),Ft=It%1;!Ft&&It>=1&&(Ft=1),Ft===1&&Lt--,Lt=Math.min(Lt,ht+1),!!(Lt%2)&&(yt==="reverse"?(Ft=1-Ft,wt&&(Ft-=wt/at)):yt==="mirror"&&(Bt=rt)),Mt=clamp(0,1,Ft)*at}const Dt=$t?{done:!1,value:it[0]}:Bt.next(Mt);nt&&(Dt.value=nt(Dt.value));let{done:zt}=Dt;!$t&&st!==null&&(zt=this.speed>=0?this.currentTime>=ot:this.currentTime<=0);const Ot=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&zt);return Ot&&et!==void 0&&(Dt.value=getFinalKeyframe(it,this.options,et)),Ct&&Ct(Dt.value),Ot&&this.finish(),Dt}get duration(){const{resolved:_}=this;return _?millisecondsToSeconds(_.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(_){_=secondsToMilliseconds$1(_),this.currentTime=_,this.holdTime!==null||this.speed===0?this.holdTime=_:this.driver&&(this.startTime=this.driver.now()-_/this.speed)}get speed(){return this.playbackSpeed}set speed(_){const $=this.playbackSpeed!==_;this.playbackSpeed=_,$&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:_=frameloopDriver,onPlay:$}=this.options;this.driver||(this.driver=_(et=>this.tick(et))),$&&$();const j=this.driver.now();this.holdTime!==null?this.startTime=j-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=j),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var _;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(_=this.currentTime)!==null&&_!==void 0?_:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:_}=this.options;_&&_()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(_){return this.startTime=0,this.tick(_,!0)}}const isBezierDefinition=a=>Array.isArray(a)&&typeof a[0]=="number";function isWaapiSupportedEasing(a){return!!(!a||typeof a=="string"&&a in supportedWaapiEasing||isBezierDefinition(a)||Array.isArray(a)&&a.every(isWaapiSupportedEasing))}const cubicBezierAsString=([a,_,$,j])=>`cubic-bezier(${a}, ${_}, ${$}, ${j})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasingWithDefault(a){return mapEasingToNativeEasing(a)||supportedWaapiEasing.easeOut}function mapEasingToNativeEasing(a){if(a)return isBezierDefinition(a)?cubicBezierAsString(a):Array.isArray(a)?a.map(mapEasingToNativeEasingWithDefault):supportedWaapiEasing[a]}function animateStyle(a,_,$,{delay:j=0,duration:et=300,repeat:tt=0,repeatType:rt="loop",ease:nt,times:it}={}){const st={[_]:$};it&&(st.offset=it);const ot=mapEasingToNativeEasing(nt);return Array.isArray(ot)&&(st.easing=ot),a.animate(st,{delay:j,duration:et,easing:Array.isArray(ot)?"linear":ot,fill:"both",iterations:tt+1,direction:rt==="reverse"?"alternate":"normal"})}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),acceleratedValues=new Set(["opacity","clipPath","filter","transform"]),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(a){return a.type==="spring"||a.name==="backgroundColor"||!isWaapiSupportedEasing(a.ease)}function pregenerateKeyframes(a,_){const $=new MainThreadAnimation({..._,keyframes:a,repeat:0,delay:0,isGenerator:!0});let j={done:!1,value:a[0]};const et=[];let tt=0;for(;!j.done&&ttthis.onKeyframesResolved(tt,rt),$,j),this.resolver.scheduleResolve()}initPlayback(_,$){var j;let{duration:et=300,times:tt,ease:rt,type:nt,motionValue:it,name:st}=this.options;if(!(!((j=it.owner)===null||j===void 0)&&j.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:at,onUpdate:ut,motionValue:ht,...yt}=this.options,wt=pregenerateKeyframes(_,yt);_=wt.keyframes,_.length===1&&(_[1]=_[0]),et=wt.duration,tt=wt.times,rt=wt.ease,nt="keyframes"}const ot=animateStyle(it.owner.current,st,_,{...this.options,duration:et,times:tt,ease:rt});return ot.startTime=time.now(),this.pendingTimeline?(ot.timeline=this.pendingTimeline,this.pendingTimeline=void 0):ot.onfinish=()=>{const{onComplete:at}=this.options;it.set(getFinalKeyframe(_,this.options,$)),at&&at(),this.cancel(),this.resolveFinishedPromise()},{animation:ot,duration:et,times:tt,type:nt,ease:rt,keyframes:_}}get duration(){const{resolved:_}=this;if(!_)return 0;const{duration:$}=_;return millisecondsToSeconds($)}get time(){const{resolved:_}=this;if(!_)return 0;const{animation:$}=_;return millisecondsToSeconds($.currentTime||0)}set time(_){const{resolved:$}=this;if(!$)return;const{animation:j}=$;j.currentTime=secondsToMilliseconds$1(_)}get speed(){const{resolved:_}=this;if(!_)return 1;const{animation:$}=_;return $.playbackRate}set speed(_){const{resolved:$}=this;if(!$)return;const{animation:j}=$;j.playbackRate=_}get state(){const{resolved:_}=this;if(!_)return"idle";const{animation:$}=_;return $.playState}attachTimeline(_){if(!this._resolved)this.pendingTimeline=_;else{const{resolved:$}=this;if(!$)return noop$b;const{animation:j}=$;j.timeline=_,j.onfinish=null}return noop$b}play(){if(this.isStopped)return;const{resolved:_}=this;if(!_)return;const{animation:$}=_;$.playState==="finished"&&this.updateFinishedPromise(),$.play()}pause(){const{resolved:_}=this;if(!_)return;const{animation:$}=_;$.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:_}=this;if(!_)return;const{animation:$,keyframes:j,duration:et,type:tt,ease:rt,times:nt}=_;if(!($.playState==="idle"||$.playState==="finished")){if(this.time){const{motionValue:it,onUpdate:st,onComplete:ot,...at}=this.options,ut=new MainThreadAnimation({...at,keyframes:j,duration:et,type:tt,ease:rt,times:nt,isGenerator:!0}),ht=secondsToMilliseconds$1(this.time);it.setWithVelocity(ut.sample(ht-sampleDelta).value,ut.sample(ht).value,sampleDelta)}this.cancel()}}complete(){const{resolved:_}=this;_&&_.animation.finish()}cancel(){const{resolved:_}=this;_&&_.animation.cancel()}static supports(_){const{motionValue:$,name:j,repeatDelay:et,repeatType:tt,damping:rt,type:nt}=_;return supportsWaapi()&&j&&acceleratedValues.has(j)&&$&&$.owner&&$.owner.current instanceof HTMLElement&&!$.owner.getProps().onUpdate&&!et&&tt!=="mirror"&&rt!==0&&nt!=="inertia"}}const animateMotionValue=(a,_,$,j={},et,tt)=>rt=>{const nt=getValueTransition(j,a)||{},it=nt.delay||j.delay||0;let{elapsed:st=0}=j;st=st-secondsToMilliseconds$1(it);let ot={keyframes:Array.isArray($)?$:[null,$],ease:"easeOut",velocity:_.getVelocity(),...nt,delay:-st,onUpdate:ut=>{_.set(ut),nt.onUpdate&&nt.onUpdate(ut)},onComplete:()=>{rt(),nt.onComplete&&nt.onComplete()},name:a,motionValue:_,element:tt?void 0:et};isTransitionDefined(nt)||(ot={...ot,...getDefaultTransition(a,ot)}),ot.duration&&(ot.duration=secondsToMilliseconds$1(ot.duration)),ot.repeatDelay&&(ot.repeatDelay=secondsToMilliseconds$1(ot.repeatDelay)),ot.from!==void 0&&(ot.keyframes[0]=ot.from);let at=!1;if((ot.type===!1||ot.duration===0&&!ot.repeatDelay)&&(ot.duration=0,ot.delay===0&&(at=!0)),at&&!tt&&_.get()!==void 0){const ut=getFinalKeyframe(ot.keyframes,nt);if(ut!==void 0){frame.update(()=>{ot.onUpdate(ut),ot.onComplete()});return}}return!tt&&AcceleratedAnimation.supports(ot)?new AcceleratedAnimation(ot):new MainThreadAnimation(ot)};function isWillChangeMotionValue(a){return!!(isMotionValue(a)&&a.add)}function addUniqueItem(a,_){a.indexOf(_)===-1&&a.push(_)}function removeItem(a,_){const $=a.indexOf(_);$>-1&&a.splice($,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(_){return addUniqueItem(this.subscriptions,_),()=>removeItem(this.subscriptions,_)}notify(_,$,j){const et=this.subscriptions.length;if(et)if(et===1)this.subscriptions[0](_,$,j);else for(let tt=0;tt!isNaN(parseFloat(a));class MotionValue{constructor(_,$={}){this.version="11.2.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(j,et=!0)=>{const tt=time.now();this.updatedAt!==tt&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(j),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),et&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(_),this.owner=$.owner}setCurrent(_){this.current=_,this.updatedAt=time.now(),this.canTrackVelocity===null&&_!==void 0&&(this.canTrackVelocity=isFloat(this.current))}setPrevFrameValue(_=this.current){this.prevFrameValue=_,this.prevUpdatedAt=this.updatedAt}onChange(_){return this.on("change",_)}on(_,$){this.events[_]||(this.events[_]=new SubscriptionManager);const j=this.events[_].add($);return _==="change"?()=>{j(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:j}clearListeners(){for(const _ in this.events)this.events[_].clear()}attach(_,$){this.passiveEffect=_,this.stopPassiveEffect=$}set(_,$=!0){!$||!this.passiveEffect?this.updateAndNotify(_,$):this.passiveEffect(_,this.updateAndNotify)}setWithVelocity(_,$,j){this.set($),this.prev=void 0,this.prevFrameValue=_,this.prevUpdatedAt=this.updatedAt-j}jump(_,$=!0){this.updateAndNotify(_),this.prev=_,this.prevUpdatedAt=this.prevFrameValue=void 0,$&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const _=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||_-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const $=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),$)}start(_){return this.stop(),new Promise($=>{this.hasAnimated=!0,this.animation=_($),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(a,_){return new MotionValue(a,_)}function setMotionValue(a,_,$){a.hasValue(_)?a.getValue(_).set($):a.addValue(_,motionValue($))}function setTarget(a,_){const $=resolveVariant(a,_);let{transitionEnd:j={},transition:et={},...tt}=$||{};tt={...tt,...j};for(const rt in tt){const nt=resolveFinalValueInKeyframes(tt[rt]);setMotionValue(a,rt,nt)}}function shouldBlockAnimation({protectedKeys:a,needsAnimating:_},$){const j=a.hasOwnProperty($)&&_[$]!==!0;return _[$]=!1,j}function animateTarget(a,_,{delay:$=0,transitionOverride:j,type:et}={}){var tt;let{transition:rt=a.getDefaultTransition(),transitionEnd:nt,...it}=_;const st=a.getValue("willChange");j&&(rt=j);const ot=[],at=et&&a.animationState&&a.animationState.getState()[et];for(const ut in it){const ht=a.getValue(ut,(tt=a.latestValues[ut])!==null&&tt!==void 0?tt:null),yt=it[ut];if(yt===void 0||at&&shouldBlockAnimation(at,ut))continue;const wt={delay:$,elapsed:0,...getValueTransition(rt||{},ut)};let Ct=!1;if(window.HandoffAppearAnimations){const Mt=a.getProps()[optimizedAppearDataAttribute];if(Mt){const Bt=window.HandoffAppearAnimations(Mt,ut,ht,frame);Bt!==null&&(wt.elapsed=Bt,Ct=!0)}}ht.start(animateMotionValue(ut,ht,yt,a.shouldReduceMotion&&transformProps.has(ut)?{type:!1}:wt,a,Ct));const Pt=ht.animation;Pt&&(isWillChangeMotionValue(st)&&(st.add(ut),Pt.then(()=>st.remove(ut))),ot.push(Pt))}return nt&&Promise.all(ot).then(()=>{frame.update(()=>{nt&&setTarget(a,nt)})}),ot}function animateVariant(a,_,$={}){var j;const et=resolveVariant(a,_,$.type==="exit"?(j=a.presenceContext)===null||j===void 0?void 0:j.custom:void 0);let{transition:tt=a.getDefaultTransition()||{}}=et||{};$.transitionOverride&&(tt=$.transitionOverride);const rt=et?()=>Promise.all(animateTarget(a,et,$)):()=>Promise.resolve(),nt=a.variantChildren&&a.variantChildren.size?(st=0)=>{const{delayChildren:ot=0,staggerChildren:at,staggerDirection:ut}=tt;return animateChildren(a,_,ot+st,at,ut,$)}:()=>Promise.resolve(),{when:it}=tt;if(it){const[st,ot]=it==="beforeChildren"?[rt,nt]:[nt,rt];return st().then(()=>ot())}else return Promise.all([rt(),nt($.delay)])}function animateChildren(a,_,$=0,j=0,et=1,tt){const rt=[],nt=(a.variantChildren.size-1)*j,it=et===1?(st=0)=>st*j:(st=0)=>nt-st*j;return Array.from(a.variantChildren).sort(sortByTreeOrder).forEach((st,ot)=>{st.notify("AnimationStart",_),rt.push(animateVariant(st,_,{...tt,delay:$+it(ot)}).then(()=>st.notify("AnimationComplete",_)))}),Promise.all(rt)}function sortByTreeOrder(a,_){return a.sortNodePosition(_)}function animateVisualElement(a,_,$={}){a.notify("AnimationStart",_);let j;if(Array.isArray(_)){const et=_.map(tt=>animateVariant(a,tt,$));j=Promise.all(et)}else if(typeof _=="string")j=animateVariant(a,_,$);else{const et=typeof _=="function"?resolveVariant(a,_,$.custom):_;j=Promise.all(animateTarget(a,et,$))}return j.then(()=>{frame.postRender(()=>{a.notify("AnimationComplete",_)})})}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(a){return _=>Promise.all(_.map(({animation:$,options:j})=>animateVisualElement(a,$,j)))}function createAnimationState(a){let _=animateList(a);const $=createState();let j=!0;const et=it=>(st,ot)=>{var at;const ut=resolveVariant(a,ot,it==="exit"?(at=a.presenceContext)===null||at===void 0?void 0:at.custom:void 0);if(ut){const{transition:ht,transitionEnd:yt,...wt}=ut;st={...st,...wt,...yt}}return st};function tt(it){_=it(a)}function rt(it){const st=a.getProps(),ot=a.getVariantContext(!0)||{},at=[],ut=new Set;let ht={},yt=1/0;for(let Ct=0;Ctyt&&Bt,Lt=!1;const Ft=Array.isArray(Mt)?Mt:[Mt];let jt=Ft.reduce(et(Pt),{});Dt===!1&&(jt={});const{prevResolvedValues:bt={}}=$t,vt={...bt,...jt},ct=dt=>{It=!0,ut.has(dt)&&(Lt=!0,ut.delete(dt)),$t.needsAnimating[dt]=!0;const mt=a.getValue(dt);mt&&(mt.liveStyle=!1)};for(const dt in vt){const mt=jt[dt],xt=bt[dt];if(ht.hasOwnProperty(dt))continue;let At=!1;isKeyframesTarget(mt)&&isKeyframesTarget(xt)?At=!shallowCompare(mt,xt):At=mt!==xt,At?mt!=null?ct(dt):ut.add(dt):mt!==void 0&&ut.has(dt)?ct(dt):$t.protectedKeys[dt]=!0}$t.prevProp=Mt,$t.prevResolvedValues=jt,$t.isActive&&(ht={...ht,...jt}),j&&a.blockInitialAnimation&&(It=!1),It&&(!zt||Lt)&&at.push(...Ft.map(dt=>({animation:dt,options:{type:Pt}})))}if(ut.size){const Ct={};ut.forEach(Pt=>{const $t=a.getBaseTarget(Pt),Mt=a.getValue(Pt);Mt&&(Mt.liveStyle=!0),Ct[Pt]=$t??null}),at.push({animation:Ct})}let wt=!!at.length;return j&&(st.initial===!1||st.initial===st.animate)&&!a.manuallyAnimateOnMount&&(wt=!1),j=!1,wt?_(at):Promise.resolve()}function nt(it,st){var ot;if($[it].isActive===st)return Promise.resolve();(ot=a.variantChildren)===null||ot===void 0||ot.forEach(ut=>{var ht;return(ht=ut.animationState)===null||ht===void 0?void 0:ht.setActive(it,st)}),$[it].isActive=st;const at=rt(it);for(const ut in $)$[ut].protectedKeys={};return at}return{animateChanges:rt,setActive:nt,setAnimateFunction:tt,getState:()=>$}}function checkVariantsDidChange(a,_){return typeof _=="string"?_!==a:Array.isArray(_)?!shallowCompare(_,a):!1}function createTypeState(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(_){super(_),_.animationState||(_.animationState=createAnimationState(_))}updateAnimationControlsSubscription(){const{animate:_}=this.node.getProps();this.unmount(),isAnimationControls(_)&&(this.unmount=_.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:_}=this.node.getProps(),{animate:$}=this.node.prevProps||{};_!==$&&this.updateAnimationControlsSubscription()}unmount(){}}let id$2=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$2++}update(){if(!this.node.presenceContext)return;const{isPresent:_,onExitComplete:$}=this.node.presenceContext,{isPresent:j}=this.node.prevPresenceContext||{};if(!this.node.animationState||_===j)return;const et=this.node.animationState.setActive("exit",!_);$&&!_&&et.then(()=>$(this.id))}mount(){const{register:_}=this.node.presenceContext||{};_&&(this.unmount=_(this.id))}unmount(){}}const animations$1={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(a,_)=>Math.abs(a-_);function distance2D(a,_){const $=distance(a.x,_.x),j=distance(a.y,_.y);return Math.sqrt($**2+j**2)}class PanSession{constructor(_,$,{transformPagePoint:j,contextWindow:et,dragSnapToOrigin:tt=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const at=getPanInfo(this.lastMoveEventInfo,this.history),ut=this.startEvent!==null,ht=distance2D(at.offset,{x:0,y:0})>=3;if(!ut&&!ht)return;const{point:yt}=at,{timestamp:wt}=frameData;this.history.push({...yt,timestamp:wt});const{onStart:Ct,onMove:Pt}=this.handlers;ut||(Ct&&Ct(this.lastMoveEvent,at),this.startEvent=this.lastMoveEvent),Pt&&Pt(this.lastMoveEvent,at)},this.handlePointerMove=(at,ut)=>{this.lastMoveEvent=at,this.lastMoveEventInfo=transformPoint(ut,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(at,ut)=>{this.end();const{onEnd:ht,onSessionEnd:yt,resumeAnimation:wt}=this.handlers;if(this.dragSnapToOrigin&&wt&&wt(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const Ct=getPanInfo(at.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(ut,this.transformPagePoint),this.history);this.startEvent&&ht&&ht(at,Ct),yt&&yt(at,Ct)},!isPrimaryPointer(_))return;this.dragSnapToOrigin=tt,this.handlers=$,this.transformPagePoint=j,this.contextWindow=et||window;const rt=extractEventInfo(_),nt=transformPoint(rt,this.transformPagePoint),{point:it}=nt,{timestamp:st}=frameData;this.history=[{...it,timestamp:st}];const{onSessionStart:ot}=$;ot&&ot(_,getPanInfo(nt,this.history)),this.removeListeners=pipe$1(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(_){this.handlers=_}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(a,_){return _?{point:_(a.point)}:a}function subtractPoint(a,_){return{x:a.x-_.x,y:a.y-_.y}}function getPanInfo({point:a},_){return{point:a,delta:subtractPoint(a,lastDevicePoint(_)),offset:subtractPoint(a,startDevicePoint(_)),velocity:getVelocity(_,.1)}}function startDevicePoint(a){return a[0]}function lastDevicePoint(a){return a[a.length-1]}function getVelocity(a,_){if(a.length<2)return{x:0,y:0};let $=a.length-1,j=null;const et=lastDevicePoint(a);for(;$>=0&&(j=a[$],!(et.timestamp-j.timestamp>secondsToMilliseconds$1(_)));)$--;if(!j)return{x:0,y:0};const tt=millisecondsToSeconds(et.timestamp-j.timestamp);if(tt===0)return{x:0,y:0};const rt={x:(et.x-j.x)/tt,y:(et.y-j.y)/tt};return rt.x===1/0&&(rt.x=0),rt.y===1/0&&(rt.y=0),rt}function calcLength(a){return a.max-a.min}function isNear(a,_=0,$=.01){return Math.abs(a-_)<=$}function calcAxisDelta(a,_,$,j=.5){a.origin=j,a.originPoint=mixNumber$1(_.min,_.max,a.origin),a.scale=calcLength($)/calcLength(_),(isNear(a.scale,1,1e-4)||isNaN(a.scale))&&(a.scale=1),a.translate=mixNumber$1($.min,$.max,a.origin)-a.originPoint,(isNear(a.translate)||isNaN(a.translate))&&(a.translate=0)}function calcBoxDelta(a,_,$,j){calcAxisDelta(a.x,_.x,$.x,j?j.originX:void 0),calcAxisDelta(a.y,_.y,$.y,j?j.originY:void 0)}function calcRelativeAxis(a,_,$){a.min=$.min+_.min,a.max=a.min+calcLength(_)}function calcRelativeBox(a,_,$){calcRelativeAxis(a.x,_.x,$.x),calcRelativeAxis(a.y,_.y,$.y)}function calcRelativeAxisPosition(a,_,$){a.min=_.min-$.min,a.max=a.min+calcLength(_)}function calcRelativePosition(a,_,$){calcRelativeAxisPosition(a.x,_.x,$.x),calcRelativeAxisPosition(a.y,_.y,$.y)}function applyConstraints(a,{min:_,max:$},j){return _!==void 0&&a<_?a=j?mixNumber$1(_,a,j.min):Math.max(a,_):$!==void 0&&a>$&&(a=j?mixNumber$1($,a,j.max):Math.min(a,$)),a}function calcRelativeAxisConstraints(a,_,$){return{min:_!==void 0?a.min+_:void 0,max:$!==void 0?a.max+$-(a.max-a.min):void 0}}function calcRelativeConstraints(a,{top:_,left:$,bottom:j,right:et}){return{x:calcRelativeAxisConstraints(a.x,$,et),y:calcRelativeAxisConstraints(a.y,_,j)}}function calcViewportAxisConstraints(a,_){let $=_.min-a.min,j=_.max-a.max;return _.max-_.minj?$=progress(_.min,_.max-j,a.min):j>et&&($=progress(a.min,a.max-et,_.min)),clamp(0,1,$)}function rebaseAxisConstraints(a,_){const $={};return _.min!==void 0&&($.min=_.min-a.min),_.max!==void 0&&($.max=_.max-a.min),$}const defaultElastic=.35;function resolveDragElastic(a=defaultElastic){return a===!1?a=0:a===!0&&(a=defaultElastic),{x:resolveAxisElastic(a,"left","right"),y:resolveAxisElastic(a,"top","bottom")}}function resolveAxisElastic(a,_,$){return{min:resolvePointElastic(a,_),max:resolvePointElastic(a,$)}}function resolvePointElastic(a,_){return typeof a=="number"?a:a[_]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(a){return[a("x"),a("y")]}function convertBoundingBoxToBox({top:a,left:_,right:$,bottom:j}){return{x:{min:_,max:$},y:{min:a,max:j}}}function convertBoxToBoundingBox({x:a,y:_}){return{top:_.min,right:a.max,bottom:_.max,left:a.min}}function transformBoxPoints(a,_){if(!_)return a;const $=_({x:a.left,y:a.top}),j=_({x:a.right,y:a.bottom});return{top:$.y,left:$.x,bottom:j.y,right:j.x}}function isIdentityScale(a){return a===void 0||a===1}function hasScale({scale:a,scaleX:_,scaleY:$}){return!isIdentityScale(a)||!isIdentityScale(_)||!isIdentityScale($)}function hasTransform(a){return hasScale(a)||has2DTranslate(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function has2DTranslate(a){return is2DTranslate(a.x)||is2DTranslate(a.y)}function is2DTranslate(a){return a&&a!=="0%"}function scalePoint(a,_,$){const j=a-$,et=_*j;return $+et}function applyPointDelta(a,_,$,j,et){return et!==void 0&&(a=scalePoint(a,et,j)),scalePoint(a,$,j)+_}function applyAxisDelta(a,_=0,$=1,j,et){a.min=applyPointDelta(a.min,_,$,j,et),a.max=applyPointDelta(a.max,_,$,j,et)}function applyBoxDelta(a,{x:_,y:$}){applyAxisDelta(a.x,_.translate,_.scale,_.originPoint),applyAxisDelta(a.y,$.translate,$.scale,$.originPoint)}function applyTreeDeltas(a,_,$,j=!1){const et=$.length;if(!et)return;_.x=_.y=1;let tt,rt;for(let nt=0;nt1.0000000000001||a<.999999999999?a:1}function translateAxis(a,_){a.min=a.min+_,a.max=a.max+_}function transformAxis(a,_,[$,j,et]){const tt=_[et]!==void 0?_[et]:.5,rt=mixNumber$1(a.min,a.max,tt);applyAxisDelta(a,_[$],_[j],rt,_.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(a,_){transformAxis(a.x,_,xKeys$1),transformAxis(a.y,_,yKeys$1)}function measureViewportBox(a,_){return convertBoundingBoxToBox(transformBoxPoints(a.getBoundingClientRect(),_))}function measurePageBox(a,_,$){const j=measureViewportBox(a,$),{scroll:et}=_;return et&&(translateAxis(j.x,et.offset.x),translateAxis(j.y,et.offset.y)),j}const getContextWindow=({current:a})=>a?a.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(_){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=_}start(_,{snapToCursor:$=!1}={}){const{presenceContext:j}=this.visualElement;if(j&&j.isPresent===!1)return;const et=ot=>{const{dragSnapToOrigin:at}=this.getProps();at?this.pauseAnimation():this.stopAnimation(),$&&this.snapToCursor(extractEventInfo(ot,"page").point)},tt=(ot,at)=>{const{drag:ut,dragPropagation:ht,onDragStart:yt}=this.getProps();if(ut&&!ht&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(ut),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(Ct=>{let Pt=this.getAxisMotionValue(Ct).get()||0;if(percent.test(Pt)){const{projection:$t}=this.visualElement;if($t&&$t.layout){const Mt=$t.layout.layoutBox[Ct];Mt&&(Pt=calcLength(Mt)*(parseFloat(Pt)/100))}}this.originPoint[Ct]=Pt}),yt&&frame.postRender(()=>yt(ot,at));const{animationState:wt}=this.visualElement;wt&&wt.setActive("whileDrag",!0)},rt=(ot,at)=>{const{dragPropagation:ut,dragDirectionLock:ht,onDirectionLock:yt,onDrag:wt}=this.getProps();if(!ut&&!this.openGlobalLock)return;const{offset:Ct}=at;if(ht&&this.currentDirection===null){this.currentDirection=getCurrentDirection(Ct),this.currentDirection!==null&&yt&&yt(this.currentDirection);return}this.updateAxis("x",at.point,Ct),this.updateAxis("y",at.point,Ct),this.visualElement.render(),wt&&wt(ot,at)},nt=(ot,at)=>this.stop(ot,at),it=()=>eachAxis(ot=>{var at;return this.getAnimationState(ot)==="paused"&&((at=this.getAxisMotionValue(ot).animation)===null||at===void 0?void 0:at.play())}),{dragSnapToOrigin:st}=this.getProps();this.panSession=new PanSession(_,{onSessionStart:et,onStart:tt,onMove:rt,onSessionEnd:nt,resumeAnimation:it},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:st,contextWindow:getContextWindow(this.visualElement)})}stop(_,$){const j=this.isDragging;if(this.cancel(),!j)return;const{velocity:et}=$;this.startAnimation(et);const{onDragEnd:tt}=this.getProps();tt&&frame.postRender(()=>tt(_,$))}cancel(){this.isDragging=!1;const{projection:_,animationState:$}=this.visualElement;_&&(_.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:j}=this.getProps();!j&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),$&&$.setActive("whileDrag",!1)}updateAxis(_,$,j){const{drag:et}=this.getProps();if(!j||!shouldDrag(_,et,this.currentDirection))return;const tt=this.getAxisMotionValue(_);let rt=this.originPoint[_]+j[_];this.constraints&&this.constraints[_]&&(rt=applyConstraints(rt,this.constraints[_],this.elastic[_])),tt.set(rt)}resolveConstraints(){var _;const{dragConstraints:$,dragElastic:j}=this.getProps(),et=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(_=this.visualElement.projection)===null||_===void 0?void 0:_.layout,tt=this.constraints;$&&isRefObject$2($)?this.constraints||(this.constraints=this.resolveRefConstraints()):$&&et?this.constraints=calcRelativeConstraints(et.layoutBox,$):this.constraints=!1,this.elastic=resolveDragElastic(j),tt!==this.constraints&&et&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(rt=>{this.constraints!==!1&&this.getAxisMotionValue(rt)&&(this.constraints[rt]=rebaseAxisConstraints(et.layoutBox[rt],this.constraints[rt]))})}resolveRefConstraints(){const{dragConstraints:_,onMeasureDragConstraints:$}=this.getProps();if(!_||!isRefObject$2(_))return!1;const j=_.current,{projection:et}=this.visualElement;if(!et||!et.layout)return!1;const tt=measurePageBox(j,et.root,this.visualElement.getTransformPagePoint());let rt=calcViewportConstraints(et.layout.layoutBox,tt);if($){const nt=$(convertBoxToBoundingBox(rt));this.hasMutatedConstraints=!!nt,nt&&(rt=convertBoundingBoxToBox(nt))}return rt}startAnimation(_){const{drag:$,dragMomentum:j,dragElastic:et,dragTransition:tt,dragSnapToOrigin:rt,onDragTransitionEnd:nt}=this.getProps(),it=this.constraints||{},st=eachAxis(ot=>{if(!shouldDrag(ot,$,this.currentDirection))return;let at=it&&it[ot]||{};rt&&(at={min:0,max:0});const ut=et?200:1e6,ht=et?40:1e7,yt={type:"inertia",velocity:j?_[ot]:0,bounceStiffness:ut,bounceDamping:ht,timeConstant:750,restDelta:1,restSpeed:10,...tt,...at};return this.startAxisValueAnimation(ot,yt)});return Promise.all(st).then(nt)}startAxisValueAnimation(_,$){const j=this.getAxisMotionValue(_);return j.start(animateMotionValue(_,j,0,$,this.visualElement))}stopAnimation(){eachAxis(_=>this.getAxisMotionValue(_).stop())}pauseAnimation(){eachAxis(_=>{var $;return($=this.getAxisMotionValue(_).animation)===null||$===void 0?void 0:$.pause()})}getAnimationState(_){var $;return($=this.getAxisMotionValue(_).animation)===null||$===void 0?void 0:$.state}getAxisMotionValue(_){const $=`_drag${_.toUpperCase()}`,j=this.visualElement.getProps(),et=j[$];return et||this.visualElement.getValue(_,(j.initial?j.initial[_]:void 0)||0)}snapToCursor(_){eachAxis($=>{const{drag:j}=this.getProps();if(!shouldDrag($,j,this.currentDirection))return;const{projection:et}=this.visualElement,tt=this.getAxisMotionValue($);if(et&&et.layout){const{min:rt,max:nt}=et.layout.layoutBox[$];tt.set(_[$]-mixNumber$1(rt,nt,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:_,dragConstraints:$}=this.getProps(),{projection:j}=this.visualElement;if(!isRefObject$2($)||!j||!this.constraints)return;this.stopAnimation();const et={x:0,y:0};eachAxis(rt=>{const nt=this.getAxisMotionValue(rt);if(nt&&this.constraints!==!1){const it=nt.get();et[rt]=calcOrigin({min:it,max:it},this.constraints[rt])}});const{transformTemplate:tt}=this.visualElement.getProps();this.visualElement.current.style.transform=tt?tt({},""):"none",j.root&&j.root.updateScroll(),j.updateLayout(),this.resolveConstraints(),eachAxis(rt=>{if(!shouldDrag(rt,_,null))return;const nt=this.getAxisMotionValue(rt),{min:it,max:st}=this.constraints[rt];nt.set(mixNumber$1(it,st,et[rt]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const _=this.visualElement.current,$=addPointerEvent(_,"pointerdown",it=>{const{drag:st,dragListener:ot=!0}=this.getProps();st&&ot&&this.start(it)}),j=()=>{const{dragConstraints:it}=this.getProps();isRefObject$2(it)&&(this.constraints=this.resolveRefConstraints())},{projection:et}=this.visualElement,tt=et.addEventListener("measure",j);et&&!et.layout&&(et.root&&et.root.updateScroll(),et.updateLayout()),j();const rt=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),nt=et.addEventListener("didUpdate",({delta:it,hasLayoutChanged:st})=>{this.isDragging&&st&&(eachAxis(ot=>{const at=this.getAxisMotionValue(ot);at&&(this.originPoint[ot]+=it[ot].translate,at.set(at.get()+it[ot].translate))}),this.visualElement.render())});return()=>{rt(),$(),tt(),nt&&nt()}}getProps(){const _=this.visualElement.getProps(),{drag:$=!1,dragDirectionLock:j=!1,dragPropagation:et=!1,dragConstraints:tt=!1,dragElastic:rt=defaultElastic,dragMomentum:nt=!0}=_;return{..._,drag:$,dragDirectionLock:j,dragPropagation:et,dragConstraints:tt,dragElastic:rt,dragMomentum:nt}}}function shouldDrag(a,_,$){return(_===!0||_===a)&&($===null||$===a)}function getCurrentDirection(a,_=10){let $=null;return Math.abs(a.y)>_?$="y":Math.abs(a.x)>_&&($="x"),$}class DragGesture extends Feature{constructor(_){super(_),this.removeGroupControls=noop$b,this.removeListeners=noop$b,this.controls=new VisualElementDragControls(_)}mount(){const{dragControls:_}=this.node.getProps();_&&(this.removeGroupControls=_.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$b}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=a=>(_,$)=>{a&&frame.postRender(()=>a(_,$))};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$b}onPointerDown(_){this.session=new PanSession(_,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:_,onPanStart:$,onPan:j,onPanEnd:et}=this.node.getProps();return{onSessionStart:asyncHandler(_),onStart:asyncHandler($),onMove:j,onEnd:(tt,rt)=>{delete this.session,et&&frame.postRender(()=>et(tt,rt))}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",_=>this.onPointerDown(_))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const a=reactExports.useContext(PresenceContext);if(a===null)return[!0,null];const{isPresent:_,onExitComplete:$,register:j}=a,et=reactExports.useId();return reactExports.useEffect(()=>j(et),[]),!_&&$?[!1,()=>$&&$(et)]:[!0]}function useIsPresent(){return isPresent(reactExports.useContext(PresenceContext))}function isPresent(a){return a===null?!0:a.isPresent}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(a,_){return _.max===_.min?0:a/(_.max-_.min)*100}const correctBorderRadius={correct:(a,_)=>{if(!_.target)return a;if(typeof a=="string")if(px.test(a))a=parseFloat(a);else return a;const $=pixelsToPercent(a,_.target.x),j=pixelsToPercent(a,_.target.y);return`${$}% ${j}%`}},correctBoxShadow={correct:(a,{treeScale:_,projectionDelta:$})=>{const j=a,et=complex.parse(a);if(et.length>5)return j;const tt=complex.createTransformer(a),rt=typeof et[0]!="number"?1:0,nt=$.x.scale*_.x,it=$.y.scale*_.y;et[0+rt]/=nt,et[1+rt]/=it;const st=mixNumber$1(nt,it,.5);return typeof et[2+rt]=="number"&&(et[2+rt]/=st),typeof et[3+rt]=="number"&&(et[3+rt]/=st),tt(et)}};class MeasureLayoutWithContext extends reactExports.Component{componentDidMount(){const{visualElement:_,layoutGroup:$,switchLayoutGroup:j,layoutId:et}=this.props,{projection:tt}=_;addScaleCorrector(defaultScaleCorrectors),tt&&($.group&&$.group.add(tt),j&&j.register&&et&&j.register(tt),tt.root.didUpdate(),tt.addEventListener("animationComplete",()=>{this.safeToRemove()}),tt.setOptions({...tt.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(_){const{layoutDependency:$,visualElement:j,drag:et,isPresent:tt}=this.props,rt=j.projection;return rt&&(rt.isPresent=tt,et||_.layoutDependency!==$||$===void 0?rt.willUpdate():this.safeToRemove(),_.isPresent!==tt&&(tt?rt.promote():rt.relegate()||frame.postRender(()=>{const nt=rt.getStack();(!nt||!nt.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:_}=this.props.visualElement;_&&(_.root.didUpdate(),microtask.postRender(()=>{!_.currentAnimation&&_.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:_,layoutGroup:$,switchLayoutGroup:j}=this.props,{projection:et}=_;et&&(et.scheduleCheckAfterUnmount(),$&&$.group&&$.group.remove(et),j&&j.deregister&&j.deregister(et))}safeToRemove(){const{safeToRemove:_}=this.props;_&&_()}render(){return null}}function MeasureLayout(a){const[_,$]=usePresence(),j=reactExports.useContext(LayoutGroupContext);return jsxRuntimeExports.jsx(MeasureLayoutWithContext,{...a,layoutGroup:j,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:_,safeToRemove:$})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=a=>typeof a=="string"?parseFloat(a):a,isPx=a=>typeof a=="number"||px.test(a);function mixValues(a,_,$,j,et,tt){et?(a.opacity=mixNumber$1(0,$.opacity!==void 0?$.opacity:1,easeCrossfadeIn(j)),a.opacityExit=mixNumber$1(_.opacity!==void 0?_.opacity:1,0,easeCrossfadeOut(j))):tt&&(a.opacity=mixNumber$1(_.opacity!==void 0?_.opacity:1,$.opacity!==void 0?$.opacity:1,j));for(let rt=0;rtj_?1:$(progress(a,_,j))}function copyAxisInto(a,_){a.min=_.min,a.max=_.max}function copyBoxInto(a,_){copyAxisInto(a.x,_.x),copyAxisInto(a.y,_.y)}function removePointDelta(a,_,$,j,et){return a-=_,a=scalePoint(a,1/$,j),et!==void 0&&(a=scalePoint(a,1/et,j)),a}function removeAxisDelta(a,_=0,$=1,j=.5,et,tt=a,rt=a){if(percent.test(_)&&(_=parseFloat(_),_=mixNumber$1(rt.min,rt.max,_/100)-rt.min),typeof _!="number")return;let nt=mixNumber$1(tt.min,tt.max,j);a===tt&&(nt-=_),a.min=removePointDelta(a.min,_,$,nt,et),a.max=removePointDelta(a.max,_,$,nt,et)}function removeAxisTransforms(a,_,[$,j,et],tt,rt){removeAxisDelta(a,_[$],_[j],_[et],_.scale,tt,rt)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(a,_,$,j){removeAxisTransforms(a.x,_,xKeys,$?$.x:void 0,j?j.x:void 0),removeAxisTransforms(a.y,_,yKeys,$?$.y:void 0,j?j.y:void 0)}function isAxisDeltaZero(a){return a.translate===0&&a.scale===1}function isDeltaZero(a){return isAxisDeltaZero(a.x)&&isAxisDeltaZero(a.y)}function boxEquals(a,_){return a.x.min===_.x.min&&a.x.max===_.x.max&&a.y.min===_.y.min&&a.y.max===_.y.max}function boxEqualsRounded(a,_){return Math.round(a.x.min)===Math.round(_.x.min)&&Math.round(a.x.max)===Math.round(_.x.max)&&Math.round(a.y.min)===Math.round(_.y.min)&&Math.round(a.y.max)===Math.round(_.y.max)}function aspectRatio(a){return calcLength(a.x)/calcLength(a.y)}class NodeStack{constructor(){this.members=[]}add(_){addUniqueItem(this.members,_),_.scheduleRender()}remove(_){if(removeItem(this.members,_),_===this.prevLead&&(this.prevLead=void 0),_===this.lead){const $=this.members[this.members.length-1];$&&this.promote($)}}relegate(_){const $=this.members.findIndex(et=>_===et);if($===0)return!1;let j;for(let et=$;et>=0;et--){const tt=this.members[et];if(tt.isPresent!==!1){j=tt;break}}return j?(this.promote(j),!0):!1}promote(_,$){const j=this.lead;if(_!==j&&(this.prevLead=j,this.lead=_,_.show(),j)){j.instance&&j.scheduleRender(),_.scheduleRender(),_.resumeFrom=j,$&&(_.resumeFrom.preserveOpacity=!0),j.snapshot&&(_.snapshot=j.snapshot,_.snapshot.latestValues=j.animationValues||j.latestValues),_.root&&_.root.isUpdating&&(_.isLayoutDirty=!0);const{crossfade:et}=_.options;et===!1&&j.hide()}}exitAnimationComplete(){this.members.forEach(_=>{const{options:$,resumingFrom:j}=_;$.onExitComplete&&$.onExitComplete(),j&&j.options.onExitComplete&&j.options.onExitComplete()})}scheduleRender(){this.members.forEach(_=>{_.instance&&_.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(a,_,$){let j="";const et=a.x.translate/_.x,tt=a.y.translate/_.y,rt=($==null?void 0:$.z)||0;if((et||tt||rt)&&(j=`translate3d(${et}px, ${tt}px, ${rt}px) `),(_.x!==1||_.y!==1)&&(j+=`scale(${1/_.x}, ${1/_.y}) `),$){const{transformPerspective:st,rotate:ot,rotateX:at,rotateY:ut,skewX:ht,skewY:yt}=$;st&&(j=`perspective(${st}px) ${j}`),ot&&(j+=`rotate(${ot}deg) `),at&&(j+=`rotateX(${at}deg) `),ut&&(j+=`rotateY(${ut}deg) `),ht&&(j+=`skewX(${ht}deg) `),yt&&(j+=`skewY(${yt}deg) `)}const nt=a.x.scale*_.x,it=a.y.scale*_.y;return(nt!==1||it!==1)&&(j+=`scale(${nt}, ${it})`),j||"none"}const compareByDepth=(a,_)=>a.depth-_.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(_){addUniqueItem(this.children,_),this.isDirty=!0}remove(_){removeItem(this.children,_),this.isDirty=!0}forEach(_){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(_)}}function delay(a,_){const $=time.now(),j=({timestamp:et})=>{const tt=et-$;tt>=_&&(cancelFrame(j),a(tt-_))};return frame.read(j,!0),()=>cancelFrame(j)}function record(a){window.MotionDebug&&window.MotionDebug.record(a)}function isSVGElement(a){return a instanceof SVGElement&&a.tagName!=="svg"}function animateSingleValue(a,_,$){const j=isMotionValue(a)?a:motionValue(a);return j.start(animateMotionValue("",j,_,$)),j.animation}const transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id$1=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function resetDistortingTransform(a,_,$,j){const{latestValues:et}=_;et[a]&&($[a]=et[a],_.setStaticValue(a,0),j&&(j[a]=0))}function createProjectionNode({attachResizeListener:a,defaultParent:_,measureScroll:$,checkIsScrollRoot:j,resetTransform:et}){return class{constructor(rt={},nt=_==null?void 0:_()){this.id=id$1++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=rt,this.root=nt?nt.root||nt:this,this.path=nt?[...nt.path,nt]:[],this.parent=nt,this.depth=nt?nt.depth+1:0;for(let it=0;itthis.root.updateBlockedByResize=!1;a(rt,()=>{this.root.updateBlockedByResize=!0,at&&at(),at=delay(ut,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}it&&this.root.registerSharedNode(it,this),this.options.animate!==!1&&ot&&(it||st)&&this.addEventListener("didUpdate",({delta:at,hasLayoutChanged:ut,hasRelativeTargetChanged:ht,layout:yt})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const wt=this.options.transition||ot.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:Ct,onLayoutAnimationComplete:Pt}=ot.getProps(),$t=!this.targetLayout||!boxEqualsRounded(this.targetLayout,yt)||ht,Mt=!ut&&ht;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||Mt||ut&&($t||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(at,Mt);const Bt={...getValueTransition(wt,"layout"),onPlay:Ct,onComplete:Pt};(ot.shouldReduceMotion||this.options.layoutRoot)&&(Bt.delay=0,Bt.type=!1),this.startAnimation(Bt)}else ut||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=yt})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const rt=this.getStack();rt&&rt.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:rt}=this.options;return rt&&rt.getProps().transformTemplate}willUpdate(rt=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let ot=0;otthis.update()))}clearAllSnapshots(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let it=0;it{const Dt=Bt/1e3;mixAxisDelta(at.x,rt.x,Dt),mixAxisDelta(at.y,rt.y,Dt),this.setTargetDelta(at),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(ut,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,ut,Dt),Mt&&boxEquals(this.relativeTarget,Mt)&&(this.isProjectionDirty=!1),Mt||(Mt=createBox()),copyBoxInto(Mt,this.relativeTarget)),wt&&(this.animationValues=ot,mixValues(ot,st,this.latestValues,Dt,$t,Pt)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=Dt},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(rt){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...rt,onUpdate:nt=>{this.mixTargetDelta(nt),rt.onUpdate&&rt.onUpdate(nt)},onComplete:()=>{rt.onComplete&&rt.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const rt=this.getStack();rt&&rt.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const rt=this.getLead();let{targetWithTransforms:nt,target:it,layout:st,latestValues:ot}=rt;if(!(!nt||!it||!st)){if(this!==rt&&this.layout&&st&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,st.layoutBox)){it=this.target||createBox();const at=calcLength(this.layout.layoutBox.x);it.x.min=rt.target.x.min,it.x.max=it.x.min+at;const ut=calcLength(this.layout.layoutBox.y);it.y.min=rt.target.y.min,it.y.max=it.y.min+ut}copyBoxInto(nt,it),transformBox(nt,ot),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,nt,ot)}}registerSharedNode(rt,nt){this.sharedNodes.has(rt)||this.sharedNodes.set(rt,new NodeStack),this.sharedNodes.get(rt).add(nt);const st=nt.options.initialPromotionConfig;nt.promote({transition:st?st.transition:void 0,preserveFollowOpacity:st&&st.shouldPreserveFollowOpacity?st.shouldPreserveFollowOpacity(nt):void 0})}isLead(){const rt=this.getStack();return rt?rt.lead===this:!0}getLead(){var rt;const{layoutId:nt}=this.options;return nt?((rt=this.getStack())===null||rt===void 0?void 0:rt.lead)||this:this}getPrevLead(){var rt;const{layoutId:nt}=this.options;return nt?(rt=this.getStack())===null||rt===void 0?void 0:rt.prevLead:void 0}getStack(){const{layoutId:rt}=this.options;if(rt)return this.root.sharedNodes.get(rt)}promote({needsReset:rt,transition:nt,preserveFollowOpacity:it}={}){const st=this.getStack();st&&st.promote(this,it),rt&&(this.projectionDelta=void 0,this.needsReset=!0),nt&&this.setOptions({transition:nt})}relegate(){const rt=this.getStack();return rt?rt.relegate(this):!1}resetSkewAndRotation(){const{visualElement:rt}=this.options;if(!rt)return;let nt=!1;const{latestValues:it}=rt;if((it.z||it.rotate||it.rotateX||it.rotateY||it.rotateZ||it.skewX||it.skewY)&&(nt=!0),!nt)return;const st={};it.z&&resetDistortingTransform("z",rt,st,this.animationValues);for(let ot=0;ot{var nt;return(nt=rt.currentAnimation)===null||nt===void 0?void 0:nt.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(a){a.updateLayout()}function notifyLayoutUpdate(a){var _;const $=((_=a.resumeFrom)===null||_===void 0?void 0:_.snapshot)||a.snapshot;if(a.isLead()&&a.layout&&$&&a.hasListeners("didUpdate")){const{layoutBox:j,measuredBox:et}=a.layout,{animationType:tt}=a.options,rt=$.source!==a.layout.source;tt==="size"?eachAxis(at=>{const ut=rt?$.measuredBox[at]:$.layoutBox[at],ht=calcLength(ut);ut.min=j[at].min,ut.max=ut.min+ht}):shouldAnimatePositionOnly(tt,$.layoutBox,j)&&eachAxis(at=>{const ut=rt?$.measuredBox[at]:$.layoutBox[at],ht=calcLength(j[at]);ut.max=ut.min+ht,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[at].max=a.relativeTarget[at].min+ht)});const nt=createDelta();calcBoxDelta(nt,j,$.layoutBox);const it=createDelta();rt?calcBoxDelta(it,a.applyTransform(et,!0),$.measuredBox):calcBoxDelta(it,j,$.layoutBox);const st=!isDeltaZero(nt);let ot=!1;if(!a.resumeFrom){const at=a.getClosestProjectingParent();if(at&&!at.resumeFrom){const{snapshot:ut,layout:ht}=at;if(ut&&ht){const yt=createBox();calcRelativePosition(yt,$.layoutBox,ut.layoutBox);const wt=createBox();calcRelativePosition(wt,j,ht.layoutBox),boxEqualsRounded(yt,wt)||(ot=!0),at.options.layoutRoot&&(a.relativeTarget=wt,a.relativeTargetOrigin=yt,a.relativeParent=at)}}}a.notifyListeners("didUpdate",{layout:j,snapshot:$,delta:it,layoutDelta:nt,hasLayoutChanged:st,hasRelativeTargetChanged:ot})}else if(a.isLead()){const{onExitComplete:j}=a.options;j&&j()}a.options.transition=void 0}function propagateDirtyNodes(a){projectionFrameData.totalNodes++,a.parent&&(a.isProjecting()||(a.isProjectionDirty=a.parent.isProjectionDirty),a.isSharedProjectionDirty||(a.isSharedProjectionDirty=!!(a.isProjectionDirty||a.parent.isProjectionDirty||a.parent.isSharedProjectionDirty)),a.isTransformDirty||(a.isTransformDirty=a.parent.isTransformDirty))}function cleanDirtyNodes(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function clearSnapshot(a){a.clearSnapshot()}function clearMeasurements(a){a.clearMeasurements()}function clearIsLayoutDirty(a){a.isLayoutDirty=!1}function resetTransformStyle(a){const{visualElement:_}=a.options;_&&_.getProps().onBeforeLayoutMeasure&&_.notify("BeforeLayoutMeasure"),a.resetTransform()}function finishAnimation(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function resolveTargetDelta(a){a.resolveTargetDelta()}function calcProjection(a){a.calcProjection()}function resetSkewAndRotation(a){a.resetSkewAndRotation()}function removeLeadSnapshots(a){a.removeLeadSnapshot()}function mixAxisDelta(a,_,$){a.translate=mixNumber$1(_.translate,0,$),a.scale=mixNumber$1(_.scale,1,$),a.origin=_.origin,a.originPoint=_.originPoint}function mixAxis(a,_,$,j){a.min=mixNumber$1(_.min,$.min,j),a.max=mixNumber$1(_.max,$.max,j)}function mixBox(a,_,$,j){mixAxis(a.x,_.x,$.x,j),mixAxis(a.y,_.y,$.y,j)}function hasOpacityCrossfade(a){return a.animationValues&&a.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=a=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$b;function roundAxis(a){a.min=roundPoint(a.min),a.max=roundPoint(a.max)}function roundBox(a){roundAxis(a.x),roundAxis(a.y)}function shouldAnimatePositionOnly(a,_,$){return a==="position"||a==="preserve-aspect"&&!isNear(aspectRatio(_),aspectRatio($),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(a,_)=>addDomEvent(a,"resize",_),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const a=new DocumentProjectionNode({});a.mount(window),a.setOptions({layoutScroll:!0}),rootProjectionNode.current=a}return rootProjectionNode.current},resetTransform:(a,_)=>{a.style.transform=_!==void 0?_:"none"},checkIsScrollRoot:a=>window.getComputedStyle(a).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser$1)if(window.matchMedia){const a=window.matchMedia("(prefers-reduced-motion)"),_=()=>prefersReducedMotion.current=a.matches;a.addListener(_),_()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(a,_,$){const{willChange:j}=_;for(const et in _){const tt=_[et],rt=$[et];if(isMotionValue(tt))a.addValue(et,tt),isWillChangeMotionValue(j)&&j.add(et);else if(isMotionValue(rt))a.addValue(et,motionValue(tt,{owner:a})),isWillChangeMotionValue(j)&&j.remove(et);else if(rt!==tt)if(a.hasValue(et)){const nt=a.getValue(et);nt.liveStyle===!0?nt.jump(tt):nt.hasAnimated||nt.set(tt)}else{const nt=a.getStaticValue(et);a.addValue(et,motionValue(nt!==void 0?nt:tt,{owner:a}))}}for(const et in $)_[et]===void 0&&a.removeValue(et);return _}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color$1,complex],findValueType=a=>valueTypes.find(testValueType(a)),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;function getClosestProjectingNode(a){if(a)return a.options.allowProjection!==!1?a.projection:getClosestProjectingNode(a.parent)}class VisualElement{scrapeMotionValuesFromProps(_,$,j){return{}}constructor({parent:_,props:$,presenceContext:j,reducedMotionConfig:et,blockInitialAnimation:tt,visualState:rt},nt={}){this.resolveKeyframes=(ut,ht,yt,wt)=>new this.KeyframeResolver(ut,ht,yt,wt,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>frame.render(this.render,!1,!0);const{latestValues:it,renderState:st}=rt;this.latestValues=it,this.baseTarget={...it},this.initialValues=$.initial?{...it}:{},this.renderState=st,this.parent=_,this.props=$,this.presenceContext=j,this.depth=_?_.depth+1:0,this.reducedMotionConfig=et,this.options=nt,this.blockInitialAnimation=!!tt,this.isControllingVariants=isControllingVariants($),this.isVariantNode=isVariantNode($),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(_&&_.current);const{willChange:ot,...at}=this.scrapeMotionValuesFromProps($,{},this);for(const ut in at){const ht=at[ut];it[ut]!==void 0&&isMotionValue(ht)&&(ht.set(it[ut],!1),isWillChangeMotionValue(ot)&&ot.add(ut))}}mount(_){this.current=_,visualElementStore.set(_,this),this.projection&&!this.projection.instance&&this.projection.mount(_),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(($,j)=>this.bindToMotionValue(j,$)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){var _;visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach($=>$()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const $ in this.events)this.events[$].clear();for(const $ in this.features)(_=this.features[$])===null||_===void 0||_.unmount();this.current=null}bindToMotionValue(_,$){const j=transformProps.has(_),et=$.on("change",rt=>{this.latestValues[_]=rt,this.props.onUpdate&&frame.preRender(this.notifyUpdate),j&&this.projection&&(this.projection.isTransformDirty=!0)}),tt=$.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(_,()=>{et(),tt(),$.owner&&$.stop()})}sortNodePosition(_){return!this.current||!this.sortInstanceNodePosition||this.type!==_.type?0:this.sortInstanceNodePosition(this.current,_.current)}loadFeatures({children:_,...$},j,et,tt){let rt,nt;for(let it=0;itthis.scheduleRender(),animationType:typeof st=="string"?st:"both",initialPromotionConfig:tt,layoutScroll:ut,layoutRoot:ht})}return nt}updateFeatures(){for(const _ in this.features){const $=this.features[_];$.isMounted?$.update():($.mount(),$.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(_){return this.latestValues[_]}setStaticValue(_,$){this.latestValues[_]=$}update(_,$){(_.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=_,this.prevPresenceContext=this.presenceContext,this.presenceContext=$;for(let j=0;j$.variantChildren.delete(_)}addValue(_,$){const j=this.values.get(_);$!==j&&(j&&this.removeValue(_),this.bindToMotionValue(_,$),this.values.set(_,$),this.latestValues[_]=$.get())}removeValue(_){this.values.delete(_);const $=this.valueSubscriptions.get(_);$&&($(),this.valueSubscriptions.delete(_)),delete this.latestValues[_],this.removeValueFromRenderState(_,this.renderState)}hasValue(_){return this.values.has(_)}getValue(_,$){if(this.props.values&&this.props.values[_])return this.props.values[_];let j=this.values.get(_);return j===void 0&&$!==void 0&&(j=motionValue($===null?void 0:$,{owner:this}),this.addValue(_,j)),j}readValue(_,$){var j;let et=this.latestValues[_]!==void 0||!this.current?this.latestValues[_]:(j=this.getBaseTargetFromProps(this.props,_))!==null&&j!==void 0?j:this.readValueFromInstance(this.current,_,this.options);return et!=null&&(typeof et=="string"&&(isNumericalString(et)||isZeroValueString(et))?et=parseFloat(et):!findValueType(et)&&complex.test($)&&(et=getAnimatableNone(_,$)),this.setBaseTarget(_,isMotionValue(et)?et.get():et)),isMotionValue(et)?et.get():et}setBaseTarget(_,$){this.baseTarget[_]=$}getBaseTarget(_){var $;const{initial:j}=this.props;let et;if(typeof j=="string"||typeof j=="object"){const rt=resolveVariantFromProps(this.props,j,($=this.presenceContext)===null||$===void 0?void 0:$.custom);rt&&(et=rt[_])}if(j&&et!==void 0)return et;const tt=this.getBaseTargetFromProps(this.props,_);return tt!==void 0&&!isMotionValue(tt)?tt:this.initialValues[_]!==void 0&&et===void 0?void 0:this.baseTarget[_]}on(_,$){return this.events[_]||(this.events[_]=new SubscriptionManager),this.events[_].add($)}notify(_,...$){this.events[_]&&this.events[_].notify(...$)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(_,$){return _.compareDocumentPosition($)&2?1:-1}getBaseTargetFromProps(_,$){return _.style?_.style[$]:void 0}removeValueFromRenderState(_,{vars:$,style:j}){delete $[_],delete j[_]}}function getComputedStyle$2(a){return window.getComputedStyle(a)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html"}readValueFromInstance(_,$){if(transformProps.has($)){const j=getDefaultValueType($);return j&&j.default||0}else{const j=getComputedStyle$2(_),et=(isCSSVariableName($)?j.getPropertyValue($):j[$])||0;return typeof et=="string"?et.trim():et}}measureInstanceViewportBox(_,{transformPagePoint:$}){return measureViewportBox(_,$)}build(_,$,j,et){buildHTMLStyles(_,$,j,et.transformTemplate)}scrapeMotionValuesFromProps(_,$,j){return scrapeMotionValuesFromProps$1(_,$,j)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:_}=this.props;isMotionValue(_)&&(this.childSubscription=_.on("change",$=>{this.current&&(this.current.textContent=`${$}`)}))}renderInstance(_,$,j,et){renderHTML(_,$,j,et)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(_,$){return _[$]}readValueFromInstance(_,$){if(transformProps.has($)){const j=getDefaultValueType($);return j&&j.default||0}return $=camelCaseAttributes.has($)?$:camelToDash($),_.getAttribute($)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(_,$,j){return scrapeMotionValuesFromProps(_,$,j)}build(_,$,j,et){buildSVGAttrs(_,$,j,this.isSVGTag,et.transformTemplate)}renderInstance(_,$,j,et){renderSVG(_,$,j,et)}mount(_){this.isSVGTag=isSVGTag(_.tagName),super.mount(_)}}const createDomVisualElement=(a,_)=>isSVGComponent(a)?new SVGVisualElement(_,{enableHardwareAcceleration:!1}):new HTMLVisualElement(_,{allowProjection:a!==reactExports.Fragment,enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations$1,...gestureAnimations,...drag,...layout},motion=createMotionProxy((a,_)=>createDomMotionConfig(a,_,preloadedFeatures,createDomVisualElement));function useIsMounted(){const a=reactExports.useRef(!1);return useIsomorphicLayoutEffect$2(()=>(a.current=!0,()=>{a.current=!1}),[]),a}function useForceUpdate(){const a=useIsMounted(),[_,$]=reactExports.useState(0),j=reactExports.useCallback(()=>{a.current&&$(_+1)},[_]);return[reactExports.useCallback(()=>frame.postRender(j),[j]),_]}class PopChildMeasure extends reactExports.Component{getSnapshotBeforeUpdate(_){const $=this.props.childRef.current;if($&&_.isPresent&&!this.props.isPresent){const j=this.props.sizeRef.current;j.height=$.offsetHeight||0,j.width=$.offsetWidth||0,j.top=$.offsetTop,j.left=$.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function PopChild({children:a,isPresent:_}){const $=reactExports.useId(),j=reactExports.useRef(null),et=reactExports.useRef({width:0,height:0,top:0,left:0}),{nonce:tt}=reactExports.useContext(MotionConfigContext);return reactExports.useInsertionEffect(()=>{const{width:rt,height:nt,top:it,left:st}=et.current;if(_||!j.current||!rt||!nt)return;j.current.dataset.motionPopId=$;const ot=document.createElement("style");return tt&&(ot.nonce=tt),document.head.appendChild(ot),ot.sheet&&ot.sheet.insertRule(` + )`;return{...!j&&et&&tt,...j?{bgImage:nt}:{bgColor:rt}}},baseStyleLabel$3={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},baseStyleTrack$1=a=>({bg:mode("gray.100","whiteAlpha.300")(a)}),baseStyleFilledTrack$1=a=>({transitionProperty:"common",transitionDuration:"slow",...filledStyle(a)}),baseStyle$A=definePartsStyle$q(a=>({label:baseStyleLabel$3,filledTrack:baseStyleFilledTrack$1(a),track:baseStyleTrack$1(a)})),sizes$h={xs:definePartsStyle$q({track:{h:"1"}}),sm:definePartsStyle$q({track:{h:"2"}}),md:definePartsStyle$q({track:{h:"3"}}),lg:definePartsStyle$q({track:{h:"4"}})},progressTheme=defineMultiStyleConfig$q({sizes:sizes$h,baseStyle:baseStyle$A,defaultProps:{size:"md",colorScheme:"blue"}}),isFunction$7=a=>typeof a=="function";function runIfFn$1(a,..._){return isFunction$7(a)?a(..._):a}var{definePartsStyle:definePartsStyle$p,defineMultiStyleConfig:defineMultiStyleConfig$p}=createMultiStyleConfigHelpers(checkboxAnatomy.keys),$size$3=cssVar$1("checkbox-size"),baseStyleControl$1=a=>{const{colorScheme:_}=a;return{w:$size$3.reference,h:$size$3.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:mode(`${_}.500`,`${_}.200`)(a),borderColor:mode(`${_}.500`,`${_}.200`)(a),color:mode("white","gray.900")(a),_hover:{bg:mode(`${_}.600`,`${_}.300`)(a),borderColor:mode(`${_}.600`,`${_}.300`)(a)},_disabled:{borderColor:mode("gray.200","transparent")(a),bg:mode("gray.200","whiteAlpha.300")(a),color:mode("gray.500","whiteAlpha.500")(a)}},_indeterminate:{bg:mode(`${_}.500`,`${_}.200`)(a),borderColor:mode(`${_}.500`,`${_}.200`)(a),color:mode("white","gray.900")(a)},_disabled:{bg:mode("gray.100","whiteAlpha.100")(a),borderColor:mode("gray.100","transparent")(a)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:mode("red.500","red.300")(a)}}},baseStyleContainer$3={_disabled:{cursor:"not-allowed"}},baseStyleLabel$2={userSelect:"none",_disabled:{opacity:.4}},baseStyleIcon$6={transitionProperty:"transform",transitionDuration:"normal"},baseStyle$z=definePartsStyle$p(a=>({icon:baseStyleIcon$6,container:baseStyleContainer$3,control:runIfFn$1(baseStyleControl$1,a),label:baseStyleLabel$2})),sizes$g={sm:definePartsStyle$p({control:{[$size$3.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:definePartsStyle$p({control:{[$size$3.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:definePartsStyle$p({control:{[$size$3.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},checkboxTheme$1=defineMultiStyleConfig$p({baseStyle:baseStyle$z,sizes:sizes$g,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$o,definePartsStyle:definePartsStyle$o}=createMultiStyleConfigHelpers(radioAnatomy.keys),baseStyleControl=a=>{var _;const $=(_=runIfFn$1(checkboxTheme$1.baseStyle,a))==null?void 0:_.control;return{...$,borderRadius:"full",_checked:{...$==null?void 0:$._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},baseStyle$y=definePartsStyle$o(a=>{var _,$,j,et;return{label:($=(_=checkboxTheme$1).baseStyle)==null?void 0:$.call(_,a).label,container:(et=(j=checkboxTheme$1).baseStyle)==null?void 0:et.call(j,a).container,control:baseStyleControl(a)}}),sizes$f={md:definePartsStyle$o({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:definePartsStyle$o({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:definePartsStyle$o({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},radioTheme$1=defineMultiStyleConfig$o({baseStyle:baseStyle$y,sizes:sizes$f,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$n,definePartsStyle:definePartsStyle$n}=createMultiStyleConfigHelpers(selectAnatomy.keys),$bg$b=cssVar$1("select-bg"),_a$6,baseStyleField$1={...(_a$6=inputTheme.baseStyle)==null?void 0:_a$6.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$bg$b.reference,[$bg$b.variable]:"colors.white",_dark:{[$bg$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$bg$b.reference}},baseStyleIcon$5={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},baseStyle$x=definePartsStyle$n({field:baseStyleField$1,icon:baseStyleIcon$5}),iconSpacing={paddingInlineEnd:"8"},_a2$1,_b$1,_c,_d,_e,_f,_g,_h,sizes$e={lg:{...(_a2$1=inputTheme.sizes)==null?void 0:_a2$1.lg,field:{...(_b$1=inputTheme.sizes)==null?void 0:_b$1.lg.field,...iconSpacing}},md:{...(_c=inputTheme.sizes)==null?void 0:_c.md,field:{...(_d=inputTheme.sizes)==null?void 0:_d.md.field,...iconSpacing}},sm:{...(_e=inputTheme.sizes)==null?void 0:_e.sm,field:{...(_f=inputTheme.sizes)==null?void 0:_f.sm.field,...iconSpacing}},xs:{...(_g=inputTheme.sizes)==null?void 0:_g.xs,field:{...(_h=inputTheme.sizes)==null?void 0:_h.xs.field,...iconSpacing},icon:{insetEnd:"1"}}},selectTheme=defineMultiStyleConfig$n({baseStyle:baseStyle$x,sizes:sizes$e,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),$startColor=cssVar$1("skeleton-start-color"),$endColor=cssVar$1("skeleton-end-color"),baseStyle$w={[$startColor.variable]:"colors.gray.100",[$endColor.variable]:"colors.gray.400",_dark:{[$startColor.variable]:"colors.gray.800",[$endColor.variable]:"colors.gray.600"},background:$startColor.reference,borderColor:$endColor.reference,opacity:.7,borderRadius:"sm"},skeletonTheme={baseStyle:baseStyle$w},$bg$a=cssVar$1("skip-link-bg"),baseStyle$v={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[$bg$a.variable]:"colors.white",_dark:{[$bg$a.variable]:"colors.gray.700"},bg:$bg$a.reference}},skipLinkTheme={baseStyle:baseStyle$v},{defineMultiStyleConfig:defineMultiStyleConfig$m,definePartsStyle:definePartsStyle$m}=createMultiStyleConfigHelpers(sliderAnatomy.keys),$thumbSize=cssVar$1("slider-thumb-size"),$trackSize=cssVar$1("slider-track-size"),$bg$9=cssVar$1("slider-bg"),baseStyleContainer$2=a=>{const{orientation:_}=a;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...orient({orientation:_,vertical:{h:"100%"},horizontal:{w:"100%"}})}},baseStyleTrack=a=>({...orient({orientation:a.orientation,horizontal:{h:$trackSize.reference},vertical:{w:$trackSize.reference}}),overflow:"hidden",borderRadius:"sm",[$bg$9.variable]:"colors.gray.200",_dark:{[$bg$9.variable]:"colors.whiteAlpha.200"},_disabled:{[$bg$9.variable]:"colors.gray.300",_dark:{[$bg$9.variable]:"colors.whiteAlpha.300"}},bg:$bg$9.reference}),baseStyleThumb=a=>{const{orientation:_}=a;return{...orient({orientation:_,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:$thumbSize.reference,h:$thumbSize.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},baseStyleFilledTrack=a=>{const{colorScheme:_}=a;return{width:"inherit",height:"inherit",[$bg$9.variable]:`colors.${_}.500`,_dark:{[$bg$9.variable]:`colors.${_}.200`},bg:$bg$9.reference}},baseStyle$u=definePartsStyle$m(a=>({container:baseStyleContainer$2(a),track:baseStyleTrack(a),thumb:baseStyleThumb(a),filledTrack:baseStyleFilledTrack(a)})),sizeLg=definePartsStyle$m({container:{[$thumbSize.variable]:"sizes.4",[$trackSize.variable]:"sizes.1"}}),sizeMd=definePartsStyle$m({container:{[$thumbSize.variable]:"sizes.3.5",[$trackSize.variable]:"sizes.1"}}),sizeSm=definePartsStyle$m({container:{[$thumbSize.variable]:"sizes.2.5",[$trackSize.variable]:"sizes.0.5"}}),sizes$d={lg:sizeLg,md:sizeMd,sm:sizeSm},sliderTheme=defineMultiStyleConfig$m({baseStyle:baseStyle$u,sizes:sizes$d,defaultProps:{size:"md",colorScheme:"blue"}}),$size$2=cssVar("spinner-size"),baseStyle$t={width:[$size$2.reference],height:[$size$2.reference]},sizes$c={xs:{[$size$2.variable]:"sizes.3"},sm:{[$size$2.variable]:"sizes.4"},md:{[$size$2.variable]:"sizes.6"},lg:{[$size$2.variable]:"sizes.8"},xl:{[$size$2.variable]:"sizes.12"}},spinnerTheme={baseStyle:baseStyle$t,sizes:sizes$c,defaultProps:{size:"md"}},{defineMultiStyleConfig:defineMultiStyleConfig$l,definePartsStyle:definePartsStyle$l}=createMultiStyleConfigHelpers(statAnatomy.keys),baseStyleLabel$1={fontWeight:"medium"},baseStyleHelpText={opacity:.8,marginBottom:"2"},baseStyleNumber={verticalAlign:"baseline",fontWeight:"semibold"},baseStyleIcon$4={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},baseStyle$s=definePartsStyle$l({container:{},label:baseStyleLabel$1,helpText:baseStyleHelpText,number:baseStyleNumber,icon:baseStyleIcon$4}),sizes$b={md:definePartsStyle$l({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},statTheme=defineMultiStyleConfig$l({baseStyle:baseStyle$s,sizes:sizes$b,defaultProps:{size:"md"}}),$bg$8=cssVar$1("kbd-bg"),baseStyle$r={[$bg$8.variable]:"colors.gray.100",_dark:{[$bg$8.variable]:"colors.whiteAlpha.100"},bg:$bg$8.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},kbdTheme={baseStyle:baseStyle$r},baseStyle$q={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},linkTheme={baseStyle:baseStyle$q},{defineMultiStyleConfig:defineMultiStyleConfig$k,definePartsStyle:definePartsStyle$k}=createMultiStyleConfigHelpers(listAnatomy.keys),baseStyleIcon$3={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},baseStyle$p=definePartsStyle$k({icon:baseStyleIcon$3}),listTheme$1=defineMultiStyleConfig$k({baseStyle:baseStyle$p}),{defineMultiStyleConfig:defineMultiStyleConfig$j,definePartsStyle:definePartsStyle$j}=createMultiStyleConfigHelpers(menuAnatomy.keys),$bg$7=cssVar$1("menu-bg"),$shadow$2=cssVar$1("menu-shadow"),baseStyleList={[$bg$7.variable]:"#fff",[$shadow$2.variable]:"shadows.sm",_dark:{[$bg$7.variable]:"colors.gray.700",[$shadow$2.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$bg$7.reference,boxShadow:$shadow$2.reference},baseStyleItem={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$7.variable]:"colors.gray.200",_dark:{[$bg$7.variable]:"colors.whiteAlpha.200"}},_expanded:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$bg$7.reference},baseStyleGroupTitle={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},baseStyleIcon$2={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},baseStyleCommand={opacity:.6},baseStyleDivider={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},baseStyleButton$1={transitionProperty:"common",transitionDuration:"normal"},baseStyle$o=definePartsStyle$j({button:baseStyleButton$1,list:baseStyleList,item:baseStyleItem,groupTitle:baseStyleGroupTitle,icon:baseStyleIcon$2,command:baseStyleCommand,divider:baseStyleDivider}),menuTheme=defineMultiStyleConfig$j({baseStyle:baseStyle$o}),{defineMultiStyleConfig:defineMultiStyleConfig$i,definePartsStyle:definePartsStyle$i}=createMultiStyleConfigHelpers(modalAnatomy.keys),$bg$6=cssVar$1("modal-bg"),$shadow$1=cssVar$1("modal-shadow"),baseStyleOverlay$1={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer$1=a=>{const{isCentered:_,scrollBehavior:$}=a;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:_?"center":"flex-start",overflow:$==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},baseStyleDialog$1=a=>{const{isCentered:_,scrollBehavior:$}=a;return{borderRadius:"md",color:"inherit",my:_?"auto":"16",mx:_?"auto":void 0,zIndex:"modal",maxH:$==="inside"?"calc(100% - 7.5rem)":void 0,[$bg$6.variable]:"colors.white",[$shadow$1.variable]:"shadows.lg",_dark:{[$bg$6.variable]:"colors.gray.700",[$shadow$1.variable]:"shadows.dark-lg"},bg:$bg$6.reference,boxShadow:$shadow$1.reference}},baseStyleHeader$2={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton$2={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody$2=a=>{const{scrollBehavior:_}=a;return{px:"6",py:"2",flex:"1",overflow:_==="inside"?"auto":void 0}},baseStyleFooter$2={px:"6",py:"4"},baseStyle$n=definePartsStyle$i(a=>({overlay:baseStyleOverlay$1,dialogContainer:runIfFn$1(baseStyleDialogContainer$1,a),dialog:runIfFn$1(baseStyleDialog$1,a),header:baseStyleHeader$2,closeButton:baseStyleCloseButton$2,body:runIfFn$1(baseStyleBody$2,a),footer:baseStyleFooter$2}));function getSize$3(a){return definePartsStyle$i(a==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:a}})}var sizes$a={xs:getSize$3("xs"),sm:getSize$3("sm"),md:getSize$3("md"),lg:getSize$3("lg"),xl:getSize$3("xl"),"2xl":getSize$3("2xl"),"3xl":getSize$3("3xl"),"4xl":getSize$3("4xl"),"5xl":getSize$3("5xl"),"6xl":getSize$3("6xl"),full:getSize$3("full")},modalTheme$1=defineMultiStyleConfig$i({baseStyle:baseStyle$n,sizes:sizes$a,defaultProps:{size:"md"}}),{defineMultiStyleConfig:defineMultiStyleConfig$h,definePartsStyle:definePartsStyle$h}=createMultiStyleConfigHelpers(numberInputAnatomy.keys),$stepperWidth=cssVar("number-input-stepper-width"),$inputPadding=cssVar("number-input-input-padding"),inputPaddingValue=calc($stepperWidth).add("0.5rem").toString(),$bg$5=cssVar("number-input-bg"),$fg$3=cssVar("number-input-color"),$border$2=cssVar("number-input-border-color"),baseStyleRoot={[$stepperWidth.variable]:"sizes.6",[$inputPadding.variable]:inputPaddingValue},baseStyleField=a=>{var _,$;return($=(_=runIfFn$1(inputTheme.baseStyle,a))==null?void 0:_.field)!=null?$:{}},baseStyleStepperGroup={width:$stepperWidth.reference},baseStyleStepper={borderStart:"1px solid",borderStartColor:$border$2.reference,color:$fg$3.reference,bg:$bg$5.reference,[$fg$3.variable]:"colors.chakra-body-text",[$border$2.variable]:"colors.chakra-border-color",_dark:{[$fg$3.variable]:"colors.whiteAlpha.800",[$border$2.variable]:"colors.whiteAlpha.300"},_active:{[$bg$5.variable]:"colors.gray.200",_dark:{[$bg$5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},baseStyle$m=definePartsStyle$h(a=>{var _;return{root:baseStyleRoot,field:(_=runIfFn$1(baseStyleField,a))!=null?_:{},stepperGroup:baseStyleStepperGroup,stepper:baseStyleStepper}});function getSize$2(a){var _,$,j;const et=(_=inputTheme.sizes)==null?void 0:_[a],tt={lg:"md",md:"md",sm:"sm",xs:"sm"},rt=(j=($=et.field)==null?void 0:$.fontSize)!=null?j:"md",nt=typography_default.fontSizes[rt];return definePartsStyle$h({field:{...et.field,paddingInlineEnd:$inputPadding.reference,verticalAlign:"top"},stepper:{fontSize:calc(nt).multiply(.75).toString(),_first:{borderTopEndRadius:tt[a]},_last:{borderBottomEndRadius:tt[a],mt:"-1px",borderTopWidth:1}}})}var sizes$9={xs:getSize$2("xs"),sm:getSize$2("sm"),md:getSize$2("md"),lg:getSize$2("lg")},numberInputTheme=defineMultiStyleConfig$h({baseStyle:baseStyle$m,sizes:sizes$9,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),_a$5,baseStyle$l={...(_a$5=inputTheme.baseStyle)==null?void 0:_a$5.field,textAlign:"center"},sizes$8={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},_a2,_b,variants$a={outline:a=>{var _,$,j;return(j=($=runIfFn$1((_=inputTheme.variants)==null?void 0:_.outline,a))==null?void 0:$.field)!=null?j:{}},flushed:a=>{var _,$,j;return(j=($=runIfFn$1((_=inputTheme.variants)==null?void 0:_.flushed,a))==null?void 0:$.field)!=null?j:{}},filled:a=>{var _,$,j;return(j=($=runIfFn$1((_=inputTheme.variants)==null?void 0:_.filled,a))==null?void 0:$.field)!=null?j:{}},unstyled:(_b=(_a2=inputTheme.variants)==null?void 0:_a2.unstyled.field)!=null?_b:{}},pinInputTheme={baseStyle:baseStyle$l,sizes:sizes$8,variants:variants$a,defaultProps:inputTheme.defaultProps},{defineMultiStyleConfig:defineMultiStyleConfig$g,definePartsStyle:definePartsStyle$g}=createMultiStyleConfigHelpers(popoverAnatomy.keys),$popperBg=cssVar("popper-bg"),$arrowBg=cssVar("popper-arrow-bg"),$arrowShadowColor=cssVar("popper-arrow-shadow-color"),baseStylePopper={zIndex:10},baseStyleContent={[$popperBg.variable]:"colors.white",bg:$popperBg.reference,[$arrowBg.variable]:$popperBg.reference,[$arrowShadowColor.variable]:"colors.gray.200",_dark:{[$popperBg.variable]:"colors.gray.700",[$arrowShadowColor.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},baseStyleHeader$1={px:3,py:2,borderBottomWidth:"1px"},baseStyleBody$1={px:3,py:2},baseStyleFooter$1={px:3,py:2,borderTopWidth:"1px"},baseStyleCloseButton$1={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},baseStyle$k=definePartsStyle$g({popper:baseStylePopper,content:baseStyleContent,header:baseStyleHeader$1,body:baseStyleBody$1,footer:baseStyleFooter$1,closeButton:baseStyleCloseButton$1}),popoverTheme=defineMultiStyleConfig$g({baseStyle:baseStyle$k}),{definePartsStyle:definePartsStyle$f,defineMultiStyleConfig:defineMultiStyleConfig$f}=createMultiStyleConfigHelpers(drawerAnatomy.keys),$bg$4=cssVar$1("drawer-bg"),$bs=cssVar$1("drawer-box-shadow");function getSize$1(a){return definePartsStyle$f(a==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:a}})}var baseStyleOverlay={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer={display:"flex",zIndex:"modal",justifyContent:"center"},baseStyleDialog=a=>{const{isFullHeight:_}=a;return{..._&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[$bg$4.variable]:"colors.white",[$bs.variable]:"shadows.lg",_dark:{[$bg$4.variable]:"colors.gray.700",[$bs.variable]:"shadows.dark-lg"},bg:$bg$4.reference,boxShadow:$bs.reference}},baseStyleHeader={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody={px:"6",py:"2",flex:"1",overflow:"auto"},baseStyleFooter={px:"6",py:"4"},baseStyle$j=definePartsStyle$f(a=>({overlay:baseStyleOverlay,dialogContainer:baseStyleDialogContainer,dialog:runIfFn$1(baseStyleDialog,a),header:baseStyleHeader,closeButton:baseStyleCloseButton,body:baseStyleBody,footer:baseStyleFooter})),sizes$7={xs:getSize$1("xs"),sm:getSize$1("md"),md:getSize$1("lg"),lg:getSize$1("2xl"),xl:getSize$1("4xl"),full:getSize$1("full")},drawerTheme$1=defineMultiStyleConfig$f({baseStyle:baseStyle$j,sizes:sizes$7,defaultProps:{size:"xs"}}),{definePartsStyle:definePartsStyle$e,defineMultiStyleConfig:defineMultiStyleConfig$e}=createMultiStyleConfigHelpers(editableAnatomy.keys),baseStylePreview={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},baseStyleInput={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyleTextarea={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyle$i=definePartsStyle$e({preview:baseStylePreview,input:baseStyleInput,textarea:baseStyleTextarea}),editableTheme=defineMultiStyleConfig$e({baseStyle:baseStyle$i}),{definePartsStyle:definePartsStyle$d,defineMultiStyleConfig:defineMultiStyleConfig$d}=createMultiStyleConfigHelpers(formAnatomy.keys),$fg$2=cssVar$1("form-control-color"),baseStyleRequiredIndicator={marginStart:"1",[$fg$2.variable]:"colors.red.500",_dark:{[$fg$2.variable]:"colors.red.300"},color:$fg$2.reference},baseStyleHelperText={mt:"2",[$fg$2.variable]:"colors.gray.600",_dark:{[$fg$2.variable]:"colors.whiteAlpha.600"},color:$fg$2.reference,lineHeight:"normal",fontSize:"sm"},baseStyle$h=definePartsStyle$d({container:{width:"100%",position:"relative"},requiredIndicator:baseStyleRequiredIndicator,helperText:baseStyleHelperText}),formTheme=defineMultiStyleConfig$d({baseStyle:baseStyle$h}),{definePartsStyle:definePartsStyle$c,defineMultiStyleConfig:defineMultiStyleConfig$c}=createMultiStyleConfigHelpers(formErrorAnatomy.keys),$fg$1=cssVar$1("form-error-color"),baseStyleText={[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},baseStyleIcon$1={marginEnd:"0.5em",[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference},baseStyle$g=definePartsStyle$c({text:baseStyleText,icon:baseStyleIcon$1}),formErrorTheme=defineMultiStyleConfig$c({baseStyle:baseStyle$g}),baseStyle$f={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},formLabelTheme={baseStyle:baseStyle$f},baseStyle$e={fontFamily:"heading",fontWeight:"bold"},sizes$6={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},headingTheme={baseStyle:baseStyle$e,sizes:sizes$6,defaultProps:{size:"xl"}},{defineMultiStyleConfig:defineMultiStyleConfig$b,definePartsStyle:definePartsStyle$b}=createMultiStyleConfigHelpers(breadcrumbAnatomy.keys),$decor=cssVar$1("breadcrumb-link-decor"),baseStyleLink={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:$decor.reference,[$decor.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[$decor.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},baseStyle$d=definePartsStyle$b({link:baseStyleLink}),breadcrumbTheme=defineMultiStyleConfig$b({baseStyle:baseStyle$d}),baseStyle$c={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variantGhost=a=>{const{colorScheme:_,theme:$}=a;if(_==="gray")return{color:mode("gray.800","whiteAlpha.900")(a),_hover:{bg:mode("gray.100","whiteAlpha.200")(a)},_active:{bg:mode("gray.200","whiteAlpha.300")(a)}};const j=transparentize(`${_}.200`,.12)($),et=transparentize(`${_}.200`,.24)($);return{color:mode(`${_}.600`,`${_}.200`)(a),bg:"transparent",_hover:{bg:mode(`${_}.50`,j)(a)},_active:{bg:mode(`${_}.100`,et)(a)}}},variantOutline=a=>{const{colorScheme:_}=a,$=mode("gray.200","whiteAlpha.300")(a);return{border:"1px solid",borderColor:_==="gray"?$:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...runIfFn$1(variantGhost,a)}},accessibleColorMap={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},variantSolid$2=a=>{var _;const{colorScheme:$}=a;if($==="gray"){const it=mode("gray.100","whiteAlpha.200")(a);return{bg:it,color:mode("gray.800","whiteAlpha.900")(a),_hover:{bg:mode("gray.200","whiteAlpha.300")(a),_disabled:{bg:it}},_active:{bg:mode("gray.300","whiteAlpha.400")(a)}}}const{bg:j=`${$}.500`,color:et="white",hoverBg:tt=`${$}.600`,activeBg:rt=`${$}.700`}=(_=accessibleColorMap[$])!=null?_:{},nt=mode(j,`${$}.200`)(a);return{bg:nt,color:mode(et,"gray.800")(a),_hover:{bg:mode(tt,`${$}.300`)(a),_disabled:{bg:nt}},_active:{bg:mode(rt,`${$}.400`)(a)}}},variantLink=a=>{const{colorScheme:_}=a;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:mode(`${_}.500`,`${_}.200`)(a),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:mode(`${_}.700`,`${_}.500`)(a)}}},variantUnstyled={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},variants$9={ghost:variantGhost,outline:variantOutline,solid:variantSolid$2,link:variantLink,unstyled:variantUnstyled},sizes$5={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},buttonTheme$1={baseStyle:baseStyle$c,variants:variants$9,sizes:sizes$5,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:definePartsStyle$a,defineMultiStyleConfig:defineMultiStyleConfig$a}=createMultiStyleConfigHelpers(cardAnatomy.keys),$bg$3=cssVar$1("card-bg"),$padding=cssVar$1("card-padding"),$shadow=cssVar$1("card-shadow"),$radius=cssVar$1("card-radius"),$border$1=cssVar$1("card-border-width","0"),$borderColor=cssVar$1("card-border-color"),baseStyle$b=definePartsStyle$a({container:{[$bg$3.variable]:"colors.chakra-body-bg",backgroundColor:$bg$3.reference,boxShadow:$shadow.reference,borderRadius:$radius.reference,color:"chakra-body-text",borderWidth:$border$1.reference,borderColor:$borderColor.reference},body:{padding:$padding.reference,flex:"1 1 0%"},header:{padding:$padding.reference},footer:{padding:$padding.reference}}),sizes$4={sm:definePartsStyle$a({container:{[$radius.variable]:"radii.base",[$padding.variable]:"space.3"}}),md:definePartsStyle$a({container:{[$radius.variable]:"radii.md",[$padding.variable]:"space.5"}}),lg:definePartsStyle$a({container:{[$radius.variable]:"radii.xl",[$padding.variable]:"space.7"}})},variants$8={elevated:definePartsStyle$a({container:{[$shadow.variable]:"shadows.base",_dark:{[$bg$3.variable]:"colors.gray.700"}}}),outline:definePartsStyle$a({container:{[$border$1.variable]:"1px",[$borderColor.variable]:"colors.chakra-border-color"}}),filled:definePartsStyle$a({container:{[$bg$3.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[$padding.variable]:0},header:{[$padding.variable]:0},footer:{[$padding.variable]:0}}},cardTheme=defineMultiStyleConfig$a({baseStyle:baseStyle$b,variants:variants$8,sizes:sizes$4,defaultProps:{variant:"elevated",size:"md"}}),$size$1=cssVar("close-button-size"),$bg$2=cssVar("close-button-bg"),baseStyle$a={w:[$size$1.reference],h:[$size$1.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[$bg$2.variable]:"colors.blackAlpha.100",_dark:{[$bg$2.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$2.variable]:"colors.blackAlpha.200",_dark:{[$bg$2.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:$bg$2.reference},sizes$3={lg:{[$size$1.variable]:"sizes.10",fontSize:"md"},md:{[$size$1.variable]:"sizes.8",fontSize:"xs"},sm:{[$size$1.variable]:"sizes.6",fontSize:"2xs"}},closeButtonTheme={baseStyle:baseStyle$a,sizes:sizes$3,defaultProps:{size:"md"}},{variants:variants$7,defaultProps:defaultProps$1}=badgeTheme,baseStyle$9={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:vars.bg.reference,color:vars.color.reference,boxShadow:vars.shadow.reference},codeTheme={baseStyle:baseStyle$9,variants:variants$7,defaultProps:defaultProps$1},baseStyle$8={w:"100%",mx:"auto",maxW:"prose",px:"4"},containerTheme={baseStyle:baseStyle$8},baseStyle$7={opacity:.6,borderColor:"inherit"},variantSolid$1={borderStyle:"solid"},variantDashed={borderStyle:"dashed"},variants$6={solid:variantSolid$1,dashed:variantDashed},dividerTheme={baseStyle:baseStyle$7,variants:variants$6,defaultProps:{variant:"solid"}},{definePartsStyle:definePartsStyle$9,defineMultiStyleConfig:defineMultiStyleConfig$9}=createMultiStyleConfigHelpers(accordionAnatomy.keys),baseStyleContainer$1={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},baseStyleButton={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},baseStylePanel={pt:"2",px:"4",pb:"5"},baseStyleIcon={fontSize:"1.25em"},baseStyle$6=definePartsStyle$9({container:baseStyleContainer$1,button:baseStyleButton,panel:baseStylePanel,icon:baseStyleIcon}),accordionTheme=defineMultiStyleConfig$9({baseStyle:baseStyle$6}),{definePartsStyle:definePartsStyle$8,defineMultiStyleConfig:defineMultiStyleConfig$8}=createMultiStyleConfigHelpers(alertAnatomy.keys),$fg=cssVar$1("alert-fg"),$bg$1=cssVar$1("alert-bg"),baseStyle$5=definePartsStyle$8({container:{bg:$bg$1.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function getBg(a){const{theme:_,colorScheme:$}=a,j=transparentize(`${$}.200`,.16)(_);return{light:`colors.${$}.100`,dark:j}}var variantSubtle=definePartsStyle$8(a=>{const{colorScheme:_}=a,$=getBg(a);return{container:{[$fg.variable]:`colors.${_}.600`,[$bg$1.variable]:$.light,_dark:{[$fg.variable]:`colors.${_}.200`,[$bg$1.variable]:$.dark}}}}),variantLeftAccent=definePartsStyle$8(a=>{const{colorScheme:_}=a,$=getBg(a);return{container:{[$fg.variable]:`colors.${_}.600`,[$bg$1.variable]:$.light,_dark:{[$fg.variable]:`colors.${_}.200`,[$bg$1.variable]:$.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:$fg.reference}}}),variantTopAccent=definePartsStyle$8(a=>{const{colorScheme:_}=a,$=getBg(a);return{container:{[$fg.variable]:`colors.${_}.600`,[$bg$1.variable]:$.light,_dark:{[$fg.variable]:`colors.${_}.200`,[$bg$1.variable]:$.dark},pt:"2",borderTopWidth:"4px",borderTopColor:$fg.reference}}}),variantSolid=definePartsStyle$8(a=>{const{colorScheme:_}=a;return{container:{[$fg.variable]:"colors.white",[$bg$1.variable]:`colors.${_}.600`,_dark:{[$fg.variable]:"colors.gray.900",[$bg$1.variable]:`colors.${_}.200`},color:$fg.reference}}}),variants$5={subtle:variantSubtle,"left-accent":variantLeftAccent,"top-accent":variantTopAccent,solid:variantSolid},alertTheme=defineMultiStyleConfig$8({baseStyle:baseStyle$5,variants:variants$5,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:definePartsStyle$7,defineMultiStyleConfig:defineMultiStyleConfig$7}=createMultiStyleConfigHelpers(avatarAnatomy.keys),$border=cssVar$1("avatar-border-color"),$bg=cssVar$1("avatar-bg"),$fs=cssVar$1("avatar-font-size"),$size=cssVar$1("avatar-size"),baseStyleBadge={borderRadius:"full",border:"0.2em solid",borderColor:$border.reference,[$border.variable]:"white",_dark:{[$border.variable]:"colors.gray.800"}},baseStyleExcessLabel={bg:$bg.reference,fontSize:$fs.reference,width:$size.reference,height:$size.reference,lineHeight:"1",[$bg.variable]:"colors.gray.200",_dark:{[$bg.variable]:"colors.whiteAlpha.400"}},baseStyleContainer=a=>{const{name:_,theme:$}=a,j=_?randomColor({string:_}):"colors.gray.400",et=isDark(j)($);let tt="white";return et||(tt="gray.800"),{bg:$bg.reference,fontSize:$fs.reference,color:tt,borderColor:$border.reference,verticalAlign:"top",width:$size.reference,height:$size.reference,"&:not([data-loaded])":{[$bg.variable]:j},[$border.variable]:"colors.white",_dark:{[$border.variable]:"colors.gray.800"}}},baseStyleLabel={fontSize:$fs.reference,lineHeight:"1"},baseStyle$4=definePartsStyle$7(a=>({badge:runIfFn$1(baseStyleBadge,a),excessLabel:runIfFn$1(baseStyleExcessLabel,a),container:runIfFn$1(baseStyleContainer,a),label:baseStyleLabel}));function getSize(a){const _=a!=="100%"?sizes_default[a]:void 0;return definePartsStyle$7({container:{[$size.variable]:_??a,[$fs.variable]:`calc(${_??a} / 2.5)`},excessLabel:{[$size.variable]:_??a,[$fs.variable]:`calc(${_??a} / 2.5)`}})}var sizes$2={"2xs":getSize(4),xs:getSize(6),sm:getSize(8),md:getSize(12),lg:getSize(16),xl:getSize(24),"2xl":getSize(32),full:getSize("100%")},avatarTheme=defineMultiStyleConfig$7({baseStyle:baseStyle$4,sizes:sizes$2,defaultProps:{size:"md"}}),components={Accordion:accordionTheme,Alert:alertTheme,Avatar:avatarTheme,Badge:badgeTheme,Breadcrumb:breadcrumbTheme,Button:buttonTheme$1,Checkbox:checkboxTheme$1,CloseButton:closeButtonTheme,Code:codeTheme,Container:containerTheme,Divider:dividerTheme,Drawer:drawerTheme$1,Editable:editableTheme,Form:formTheme,FormError:formErrorTheme,FormLabel:formLabelTheme,Heading:headingTheme,Input:inputTheme,Kbd:kbdTheme,Link:linkTheme,List:listTheme$1,Menu:menuTheme,Modal:modalTheme$1,NumberInput:numberInputTheme,PinInput:pinInputTheme,Popover:popoverTheme,Progress:progressTheme,Radio:radioTheme$1,Select:selectTheme,Skeleton:skeletonTheme,SkipLink:skipLinkTheme,Slider:sliderTheme,Spinner:spinnerTheme,Stat:statTheme,Switch:switchTheme$1,Table:tableTheme,Tabs:tabsTheme$1,Tag:tagTheme,Textarea:textareaTheme,Tooltip:tooltipTheme,Card:cardTheme,Stepper:stepperTheme},semanticTokens={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},styles={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},direction="ltr",config$4={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},theme$1={semanticTokens,direction,...foundations,components,styles,config:config$4};function isFunction$6(a){return typeof a=="function"}function pipe$2(...a){return _=>a.reduce(($,j)=>j($),_)}var createExtendTheme=a=>function(...$){let j=[...$],et=$[$.length-1];return isChakraTheme(et)&&j.length>1?j=j.slice(0,j.length-1):et=a,pipe$2(...j.map(tt=>rt=>isFunction$6(tt)?tt(rt):mergeThemeOverride(rt,tt)))(et)},extendTheme=createExtendTheme(theme$1);function mergeThemeOverride(...a){return mergeWith({},...a,mergeThemeCustomizer)}function mergeThemeCustomizer(a,_,$,j){if((isFunction$6(a)||isFunction$6(_))&&Object.prototype.hasOwnProperty.call(j,$))return(...et)=>{const tt=isFunction$6(a)?a(...et):a,rt=isFunction$6(_)?_(...et):_;return mergeWith({},tt,rt,mergeThemeCustomizer)}}function isElement$4(a){return a!=null&&typeof a=="object"&&"nodeType"in a&&a.nodeType===Node.ELEMENT_NODE}function getOwnerDocument$3(a){var _;return isElement$4(a)&&(_=a.ownerDocument)!=null?_:document}function canUseDOM$1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var isBrowser$2=canUseDOM$1();function omit$5(a,_){const $={};return Object.keys(a).forEach(j=>{_.includes(j)||($[j]=a[j])}),$}function get$3(a,_,$,j){const et=typeof _=="string"?_.split("."):[_];for(j=0;j{const _=new WeakMap;return(j,et,tt,rt)=>{if(typeof j>"u")return a(j,et,tt);_.has(j)||_.set(j,new Map);const nt=_.get(j);if(nt.has(et))return nt.get(et);const it=a(j,et,tt,rt);return nt.set(et,it),it}},memoizedGet=memoize(get$3);function objectFilter(a,_){const $={};return Object.keys(a).forEach(j=>{const et=a[j];_(et,j,a)&&($[j]=et)}),$}var filterUndefined=a=>objectFilter(a,_=>_!=null);function isFunction$5(a){return typeof a=="function"}function runIfFn(a,..._){return isFunction$5(a)?a(..._):a}function callAllHandlers(...a){return function($){a.some(j=>(j==null||j($),$==null?void 0:$.defaultPrevented))}}var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal$1(a,_){if(a===_)return!0;if(a&&_&&typeof a=="object"&&typeof _=="object"){if(a.constructor!==_.constructor)return!1;var $,j,et;if(Array.isArray(a)){if($=a.length,$!=_.length)return!1;for(j=$;j--!==0;)if(!equal$1(a[j],_[j]))return!1;return!0}var tt;if(hasMap&&a instanceof Map&&_ instanceof Map){if(a.size!==_.size)return!1;for(tt=a.entries();!(j=tt.next()).done;)if(!_.has(j.value[0]))return!1;for(tt=a.entries();!(j=tt.next()).done;)if(!equal$1(j.value[1],_.get(j.value[0])))return!1;return!0}if(hasSet&&a instanceof Set&&_ instanceof Set){if(a.size!==_.size)return!1;for(tt=a.entries();!(j=tt.next()).done;)if(!_.has(j.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(_)){if($=a.length,$!=_.length)return!1;for(j=$;j--!==0;)if(a[j]!==_[j])return!1;return!0}if(a.constructor===RegExp)return a.source===_.source&&a.flags===_.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof _.valueOf=="function")return a.valueOf()===_.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof _.toString=="function")return a.toString()===_.toString();if(et=Object.keys(a),$=et.length,$!==Object.keys(_).length)return!1;for(j=$;j--!==0;)if(!Object.prototype.hasOwnProperty.call(_,et[j]))return!1;if(hasElementType&&a instanceof Element)return!1;for(j=$;j--!==0;)if(!((et[j]==="_owner"||et[j]==="__v"||et[j]==="__o")&&a.$$typeof)&&!equal$1(a[et[j]],_[et[j]]))return!1;return!0}return a!==a&&_!==_}var reactFastCompare=function(_,$){try{return equal$1(_,$)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}};const isEqual$2=getDefaultExportFromCjs$1(reactFastCompare);function useStyleConfigImpl(a,_={}){var $;const{styleConfig:j,...et}=_,{theme:tt,colorMode:rt}=useChakra(),nt=a?memoizedGet(tt,`components.${a}`):void 0,it=j||nt,st=mergeWith({theme:tt,colorMode:rt},($=it==null?void 0:it.defaultProps)!=null?$:{},filterUndefined(omit$5(et,["children"]))),ot=reactExports.useRef({});if(it){const ut=resolveStyleConfig(it)(st);isEqual$2(ot.current,ut)||(ot.current=ut)}return ot.current}function useStyleConfig(a,_={}){return useStyleConfigImpl(a,_)}function useMultiStyleConfig(a,_={}){return useStyleConfigImpl(a,_)}var allPropNames=new Set([...propNames,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),validHTMLProps=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function shouldForwardProp(a){return validHTMLProps.has(a)||!allPropNames.has(a)}function assignAfter(a,..._){if(a==null)throw new TypeError("Cannot convert undefined or null to object");const $={...a};for(const j of _)if(j!=null)for(const et in j)Object.prototype.hasOwnProperty.call(j,et)&&(et in $&&delete $[et],$[et]=j[et]);return $}function compact$1(a){const _=Object.assign({},a);for(let $ in _)_[$]===void 0&&delete _[$];return _}function _extends$6(){return _extends$6=Object.assign?Object.assign.bind():function(a){for(var _=1;_96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(_,$,j){var et;if($){var tt=$.shouldForwardProp;et=_.__emotion_forwardProp&&tt?function(rt){return _.__emotion_forwardProp(rt)&&tt(rt)}:tt}return typeof et!="function"&&j&&(et=_.__emotion_forwardProp),et},Insertion=function(_){var $=_.cache,j=_.serialized,et=_.isStringTag;return registerStyles($,j,et),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles($,j,et)}),null},createStyled=function a(_,$){var j=_.__emotion_real===_,et=j&&_.__emotion_base||_,tt,rt;$!==void 0&&(tt=$.label,rt=$.target);var nt=composeShouldForwardProps(_,$,j),it=nt||getDefaultShouldForwardProp(et),st=!it("as");return function(){var ot=arguments,at=j&&_.__emotion_styles!==void 0?_.__emotion_styles.slice(0):[];if(tt!==void 0&&at.push("label:"+tt+";"),ot[0]==null||ot[0].raw===void 0)at.push.apply(at,ot);else{at.push(ot[0][0]);for(var ut=ot.length,ht=1;ht_=>{const{theme:$,css:j,__css:et,sx:tt,...rt}=_,nt=objectFilter(rt,(at,ut)=>isStyleProp(ut)),it=runIfFn(a,_),st=assignAfter({},et,it,filterUndefined(nt),tt),ot=css(st)(_.theme);return j?[ot,j]:ot};function styled(a,_){const{baseStyle:$,...j}=_??{};j.shouldForwardProp||(j.shouldForwardProp=shouldForwardProp);const et=toCSSObject({baseStyle:$}),tt=emotion_styled(a,j)(et);return React$2.forwardRef(function(it,st){const{colorMode:ot,forced:at}=useColorMode();return React$2.createElement(tt,{ref:st,"data-theme":at?ot:void 0,...it})})}function factory(){const a=new Map;return new Proxy(styled,{apply(_,$,j){return styled(...j)},get(_,$){return a.has($)||a.set($,styled($)),a.get($)}})}var chakra=factory();function forwardRef(a){return reactExports.forwardRef(a)}function createContext(a={}){const{strict:_=!0,errorMessage:$="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:j}=a,et=reactExports.createContext(void 0);et.displayName=j;function tt(){var rt;const nt=reactExports.useContext(et);if(!nt&&_){const it=new Error($);throw it.name="ContextError",(rt=Error.captureStackTrace)==null||rt.call(Error,it,tt),it}return nt}return[et.Provider,tt,et]}function ThemeProvider(a){const{cssVarsRoot:_,theme:$,children:j}=a,et=reactExports.useMemo(()=>toCSSVar($),[$]);return jsxRuntimeExports.jsxs(ThemeProvider$1,{theme:et,children:[jsxRuntimeExports.jsx(CSSVars,{root:_}),j]})}function CSSVars({root:a=":host, :root"}){const _=[a,"[data-theme]"].join(",");return jsxRuntimeExports.jsx(Global,{styles:$=>({[_]:$.__cssVars})})}createContext({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function createStylesContext(a){return createContext({name:`${a}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${a} />" `})}function GlobalStyle(){const{colorMode:a}=useColorMode();return jsxRuntimeExports.jsx(Global,{styles:_=>{const $=memoizedGet(_,"styles.global"),j=runIfFn($,{theme:_,colorMode:a});return j?css(j)(_):void 0}})}var EnvironmentContext=reactExports.createContext({getDocument(){return document},getWindow(){return window}});EnvironmentContext.displayName="EnvironmentContext";function useEnvironment({defer:a}={}){const[,_]=reactExports.useReducer($=>$+1,0);return useSafeLayoutEffect$2(()=>{a&&_()},[a]),reactExports.useContext(EnvironmentContext)}function EnvironmentProvider(a){const{children:_,environment:$,disabled:j}=a,et=reactExports.useRef(null),tt=reactExports.useMemo(()=>$||{getDocument:()=>{var nt,it;return(it=(nt=et.current)==null?void 0:nt.ownerDocument)!=null?it:document},getWindow:()=>{var nt,it;return(it=(nt=et.current)==null?void 0:nt.ownerDocument.defaultView)!=null?it:window}},[$]),rt=!j||!$;return jsxRuntimeExports.jsxs(EnvironmentContext.Provider,{value:tt,children:[_,rt&&jsxRuntimeExports.jsx("span",{id:"__chakra_env",hidden:!0,ref:et})]})}EnvironmentProvider.displayName="EnvironmentProvider";var ChakraProvider$1=a=>{const{children:_,colorModeManager:$,portalZIndex:j,resetScope:et,resetCSS:tt=!0,theme:rt={},environment:nt,cssVarsRoot:it,disableEnvironment:st,disableGlobalStyle:ot}=a,at=jsxRuntimeExports.jsx(EnvironmentProvider,{environment:nt,disabled:st,children:_});return jsxRuntimeExports.jsx(ThemeProvider,{theme:rt,cssVarsRoot:it,children:jsxRuntimeExports.jsxs(ColorModeProvider,{colorModeManager:$,options:rt.config,children:[tt?jsxRuntimeExports.jsx(CSSReset,{scope:et}):jsxRuntimeExports.jsx(CSSPolyfill,{}),!ot&&jsxRuntimeExports.jsx(GlobalStyle,{}),j?jsxRuntimeExports.jsx(PortalManager,{zIndex:j,children:at}):at]})})},findById=(a,_)=>a.find($=>$.id===_);function findToast(a,_){const $=getToastPosition(a,_),j=$?a[$].findIndex(et=>et.id===_):-1;return{position:$,index:j}}function getToastPosition(a,_){for(const[$,j]of Object.entries(a))if(findById(j,_))return $}function getToastStyle(a){const _=a.includes("right"),$=a.includes("left");let j="center";return _&&(j="flex-end"),$&&(j="flex-start"),{display:"flex",flexDirection:"column",alignItems:j}}function getToastListStyle(a){const $=a==="top"||a==="bottom"?"0 auto":void 0,j=a.includes("top")?"env(safe-area-inset-top, 0px)":void 0,et=a.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,tt=a.includes("left")?void 0:"env(safe-area-inset-right, 0px)",rt=a.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:$,top:j,bottom:et,right:tt,left:rt}}function useCallbackRef$2(a,_=[]){const $=reactExports.useRef(a);return reactExports.useEffect(()=>{$.current=a}),reactExports.useCallback((...j)=>{var et;return(et=$.current)==null?void 0:et.call($,...j)},_)}function useTimeout(a,_){const $=useCallbackRef$2(a);reactExports.useEffect(()=>{if(_==null)return;let j=null;return j=window.setTimeout(()=>{$()},_),()=>{j&&window.clearTimeout(j)}},[_,$])}function useUpdateEffect(a,_){const $=reactExports.useRef(!1),j=reactExports.useRef(!1);reactExports.useEffect(()=>{if($.current&&j.current)return a();j.current=!0},_),reactExports.useEffect(()=>($.current=!0,()=>{$.current=!1}),[])}const MotionConfigContext=reactExports.createContext({transformPagePoint:a=>a,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({}),PresenceContext=reactExports.createContext(null),isBrowser$1=typeof document<"u",useIsomorphicLayoutEffect$2=isBrowser$1?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1}),camelToDash=a=>a.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId),MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1};class Queue{constructor(){this.order=[],this.scheduled=new Set}add(_){if(!this.scheduled.has(_))return this.scheduled.add(_),this.order.push(_),!0}remove(_){const $=this.order.indexOf(_);$!==-1&&(this.order.splice($,1),this.scheduled.delete(_))}clear(){this.order.length=0,this.scheduled.clear()}}function createRenderStep(a){let _=new Queue,$=new Queue,j=0,et=!1,tt=!1;const rt=new WeakSet,nt={schedule:(it,st=!1,ot=!1)=>{const at=ot&&et,ut=at?_:$;return st&&rt.add(it),ut.add(it)&&at&&et&&(j=_.order.length),it},cancel:it=>{$.remove(it),rt.delete(it)},process:it=>{if(et){tt=!0;return}if(et=!0,[_,$]=[$,_],$.clear(),j=_.order.length,j)for(let st=0;st(at[ut]=createRenderStep(()=>$=!0),at),{}),rt=at=>{tt[at].process(et)},nt=()=>{const at=performance.now();$=!1,et.delta=j?1e3/60:Math.max(Math.min(at-et.timestamp,maxElapsed),1),et.timestamp=at,et.isProcessing=!0,stepsOrder.forEach(rt),et.isProcessing=!1,$&&_&&(j=!1,a(nt))},it=()=>{$=!0,j=!0,et.isProcessing||a(nt)};return{schedule:stepsOrder.reduce((at,ut)=>{const ht=tt[ut];return at[ut]=(yt,wt=!1,Ct=!1)=>($||it(),ht.schedule(yt,wt,Ct)),at},{}),cancel:at=>stepsOrder.forEach(ut=>tt[ut].cancel(at)),state:et,steps:tt}}const{schedule:microtask,cancel:cancelMicrotask}=createRenderBatcher(queueMicrotask,!1);function useVisualElement(a,_,$,j){const{visualElement:et}=reactExports.useContext(MotionContext),tt=reactExports.useContext(LazyContext),rt=reactExports.useContext(PresenceContext),nt=reactExports.useContext(MotionConfigContext).reducedMotion,it=reactExports.useRef();j=j||tt.renderer,!it.current&&j&&(it.current=j(a,{visualState:_,parent:et,props:$,presenceContext:rt,blockInitialAnimation:rt?rt.initial===!1:!1,reducedMotionConfig:nt}));const st=it.current;reactExports.useInsertionEffect(()=>{st&&st.update($,rt)});const ot=reactExports.useRef(!!($[optimizedAppearDataAttribute]&&!window.HandoffComplete));return useIsomorphicLayoutEffect$2(()=>{st&&(microtask.postRender(st.render),ot.current&&st.animationState&&st.animationState.animateChanges())}),reactExports.useEffect(()=>{st&&(st.updateFeatures(),!ot.current&&st.animationState&&st.animationState.animateChanges(),ot.current&&(ot.current=!1,window.HandoffComplete=!0))}),st}function isRefObject$2(a){return a&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function useMotionRef(a,_,$){return reactExports.useCallback(j=>{j&&a.mount&&a.mount(j),_&&(j?_.mount(j):_.unmount()),$&&(typeof $=="function"?$(j):isRefObject$2($)&&($.current=j))},[_])}function isVariantLabel(a){return typeof a=="string"||Array.isArray(a)}function isAnimationControls(a){return a!==null&&typeof a=="object"&&typeof a.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(a){return isAnimationControls(a.animate)||variantProps.some(_=>isVariantLabel(a[_]))}function isVariantNode(a){return!!(isControllingVariants(a)||a.variants)}function getCurrentTreeVariants(a,_){if(isControllingVariants(a)){const{initial:$,animate:j}=a;return{initial:$===!1||isVariantLabel($)?$:void 0,animate:isVariantLabel(j)?j:void 0}}return a.inherit!==!1?_:{}}function useCreateMotionContext(a){const{initial:_,animate:$}=getCurrentTreeVariants(a,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:_,animate:$}),[variantLabelsAsDependency(_),variantLabelsAsDependency($)])}function variantLabelsAsDependency(a){return Array.isArray(a)?a.join(" "):a}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const a in featureProps)featureDefinitions[a]={isEnabled:_=>featureProps[a].some($=>!!_[$])};function loadFeatures(a){for(const _ in a)featureDefinitions[_]={...featureDefinitions[_],...a[_]}}const LayoutGroupContext=reactExports.createContext({}),SwitchLayoutGroupContext=reactExports.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:a,createVisualElement:_,useRender:$,useVisualState:j,Component:et}){a&&loadFeatures(a);function tt(nt,it){let st;const ot={...reactExports.useContext(MotionConfigContext),...nt,layoutId:useLayoutId(nt)},{isStatic:at}=ot,ut=useCreateMotionContext(nt),ht=j(nt,at);if(!at&&isBrowser$1){ut.visualElement=useVisualElement(et,ht,ot,_);const yt=reactExports.useContext(SwitchLayoutGroupContext),wt=reactExports.useContext(LazyContext).strict;ut.visualElement&&(st=ut.visualElement.loadFeatures(ot,wt,a,yt))}return jsxRuntimeExports.jsxs(MotionContext.Provider,{value:ut,children:[st&&ut.visualElement?jsxRuntimeExports.jsx(st,{visualElement:ut.visualElement,...ot}):null,$(et,nt,useMotionRef(ht,ut.visualElement,it),ht,at,ut.visualElement)]})}const rt=reactExports.forwardRef(tt);return rt[motionComponentSymbol]=et,rt}function useLayoutId({layoutId:a}){const _=reactExports.useContext(LayoutGroupContext).id;return _&&a!==void 0?_+"-"+a:a}function createMotionProxy(a){function _(j,et={}){return createMotionComponent(a(j,et))}if(typeof Proxy>"u")return _;const $=new Map;return new Proxy(_,{get:(j,et)=>($.has(et)||$.set(et,_(et)),$.get(et))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(a){return typeof a!="string"||a.includes("-")?!1:!!(lowercaseSVGElements.indexOf(a)>-1||/[A-Z]/u.test(a))}const scaleCorrectors={};function addScaleCorrector(a){Object.assign(scaleCorrectors,a)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(a,{layout:_,layoutId:$}){return transformProps.has(a)||a.startsWith("origin")||(_||$!==void 0)&&(!!scaleCorrectors[a]||a==="opacity")}const isMotionValue=a=>!!(a&&a.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(a,{enableHardwareAcceleration:_=!0,allowTransformNone:$=!0},j,et){let tt="";for(let rt=0;rt_=>typeof _=="string"&&_.startsWith(a),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=a=>startsAsVariableToken(a)?singleCssVariableRegex.test(a.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,getValueAsType=(a,_)=>_&&typeof a=="number"?_.transform(a):a,clamp=(a,_,$)=>$>_?_:$typeof a=="number",parse:parseFloat,transform:a=>a},alpha={...number$2,transform:a=>clamp(0,1,a)},scale$1={...number$2,default:1},sanitize=a=>Math.round(a*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function isString$4(a){return typeof a=="string"}const createUnitType=a=>({test:_=>isString$4(_)&&_.endsWith(a)&&_.split(" ").length===1,parse:parseFloat,transform:_=>`${_}${a}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:a=>percent.parse(a)/100,transform:a=>percent.transform(a*100)},int$1={...number$2,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale:scale$1,scaleX:scale$1,scaleY:scale$1,scaleZ:scale$1,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int$1,backgroundPositionX:px,backgroundPositionY:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int$1};function buildHTMLStyles(a,_,$,j){const{style:et,vars:tt,transform:rt,transformOrigin:nt}=a;let it=!1,st=!1,ot=!0;for(const at in _){const ut=_[at];if(isCSSVariableName(at)){tt[at]=ut;continue}const ht=numberValueTypes[at],yt=getValueAsType(ut,ht);if(transformProps.has(at)){if(it=!0,rt[at]=yt,!ot)continue;ut!==(ht.default||0)&&(ot=!1)}else at.startsWith("origin")?(st=!0,nt[at]=yt):et[at]=yt}if(_.transform||(it||j?et.transform=buildTransform(a.transform,$,ot,j):et.transform&&(et.transform="none")),st){const{originX:at="50%",originY:ut="50%",originZ:ht=0}=nt;et.transformOrigin=`${at} ${ut} ${ht}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(a,_,$){for(const j in _)!isMotionValue(_[j])&&!isForcedMotionValue(j,$)&&(a[j]=_[j])}function useInitialMotionValues({transformTemplate:a},_,$){return reactExports.useMemo(()=>{const j=createHtmlRenderState();return buildHTMLStyles(j,_,{enableHardwareAcceleration:!$},a),Object.assign({},j.vars,j.style)},[_])}function useStyle(a,_,$){const j=a.style||{},et={};return copyRawValuesOnly(et,j,a),Object.assign(et,useInitialMotionValues(a,_,$)),et}function useHTMLProps(a,_,$){const j={},et=useStyle(a,_,$);return a.drag&&a.dragListener!==!1&&(j.draggable=!1,et.userSelect=et.WebkitUserSelect=et.WebkitTouchCallout="none",et.touchAction=a.drag===!0?"none":`pan-${a.drag==="x"?"y":"x"}`),a.tabIndex===void 0&&(a.onTap||a.onTapStart||a.whileTap)&&(j.tabIndex=0),j.style=et,j}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(a){return a.startsWith("while")||a.startsWith("drag")&&a!=="draggable"||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||validMotionProps.has(a)}let shouldForward=a=>!isValidMotionProp(a);function loadExternalIsValidProp(a){a&&(shouldForward=_=>_.startsWith("on")?!isValidMotionProp(_):a(_))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(a,_,$){const j={};for(const et in a)et==="values"&&typeof a.values=="object"||(shouldForward(et)||$===!0&&isValidMotionProp(et)||!_&&!isValidMotionProp(et)||a.draggable&&et.startsWith("onDrag"))&&(j[et]=a[et]);return j}function calcOrigin$1(a,_,$){return typeof a=="string"?a:px.transform(_+$*a)}function calcSVGTransformOrigin(a,_,$){const j=calcOrigin$1(_,a.x,a.width),et=calcOrigin$1($,a.y,a.height);return`${j} ${et}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(a,_,$=1,j=0,et=!0){a.pathLength=1;const tt=et?dashKeys:camelKeys;a[tt.offset]=px.transform(-j);const rt=px.transform(_),nt=px.transform($);a[tt.array]=`${rt} ${nt}`}function buildSVGAttrs(a,{attrX:_,attrY:$,attrScale:j,originX:et,originY:tt,pathLength:rt,pathSpacing:nt=1,pathOffset:it=0,...st},ot,at,ut){if(buildHTMLStyles(a,st,ot,ut),at){a.style.viewBox&&(a.attrs.viewBox=a.style.viewBox);return}a.attrs=a.style,a.style={};const{attrs:ht,style:yt,dimensions:wt}=a;ht.transform&&(wt&&(yt.transform=ht.transform),delete ht.transform),wt&&(et!==void 0||tt!==void 0||yt.transform)&&(yt.transformOrigin=calcSVGTransformOrigin(wt,et!==void 0?et:.5,tt!==void 0?tt:.5)),_!==void 0&&(ht.x=_),$!==void 0&&(ht.y=$),j!==void 0&&(ht.scale=j),rt!==void 0&&buildSVGPath(ht,rt,nt,it,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=a=>typeof a=="string"&&a.toLowerCase()==="svg";function useSVGProps(a,_,$,j){const et=reactExports.useMemo(()=>{const tt=createSvgRenderState();return buildSVGAttrs(tt,_,{enableHardwareAcceleration:!1},isSVGTag(j),a.transformTemplate),{...tt.attrs,style:{...tt.style}}},[_]);if(a.style){const tt={};copyRawValuesOnly(tt,a.style,a),et.style={...tt,...et.style}}return et}function createUseRender(a=!1){return($,j,et,{latestValues:tt},rt)=>{const it=(isSVGComponent($)?useSVGProps:useHTMLProps)(j,tt,rt,$),st=filterProps(j,typeof $=="string",a),ot=$!==reactExports.Fragment?{...st,...it,ref:et}:{},{children:at}=j,ut=reactExports.useMemo(()=>isMotionValue(at)?at.get():at,[at]);return reactExports.createElement($,{...ot,children:ut})}}function renderHTML(a,{style:_,vars:$},j,et){Object.assign(a.style,_,et&&et.getProjectionStyles(j));for(const tt in $)a.style.setProperty(tt,$[tt])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(a,_,$,j){renderHTML(a,_,void 0,j);for(const et in _.attrs)a.setAttribute(camelCaseAttributes.has(et)?et:camelToDash(et),_.attrs[et])}function scrapeMotionValuesFromProps$1(a,_,$){var j;const{style:et}=a,tt={};for(const rt in et)(isMotionValue(et[rt])||_.style&&isMotionValue(_.style[rt])||isForcedMotionValue(rt,a)||((j=$==null?void 0:$.getValue(rt))===null||j===void 0?void 0:j.liveStyle)!==void 0)&&(tt[rt]=et[rt]);return tt}function scrapeMotionValuesFromProps(a,_,$){const j=scrapeMotionValuesFromProps$1(a,_,$);for(const et in a)if(isMotionValue(a[et])||isMotionValue(_[et])){const tt=transformPropOrder.indexOf(et)!==-1?"attr"+et.charAt(0).toUpperCase()+et.substring(1):et;j[tt]=a[et]}return j}function getValueState(a){const _=[{},{}];return a==null||a.values.forEach(($,j)=>{_[0][j]=$.get(),_[1][j]=$.getVelocity()}),_}function resolveVariantFromProps(a,_,$,j){if(typeof _=="function"){const[et,tt]=getValueState(j);_=_($!==void 0?$:a.custom,et,tt)}if(typeof _=="string"&&(_=a.variants&&a.variants[_]),typeof _=="function"){const[et,tt]=getValueState(j);_=_($!==void 0?$:a.custom,et,tt)}return _}function useConstant(a){const _=reactExports.useRef(null);return _.current===null&&(_.current=a()),_.current}const isKeyframesTarget=a=>Array.isArray(a),isCustomValue=a=>!!(a&&typeof a=="object"&&a.mix&&a.toValue),resolveFinalValueInKeyframes=a=>isKeyframesTarget(a)?a[a.length-1]||0:a;function resolveMotionValue(a){const _=isMotionValue(a)?a.get():a;return isCustomValue(_)?_.toValue():_}function makeState({scrapeMotionValuesFromProps:a,createRenderState:_,onMount:$},j,et,tt){const rt={latestValues:makeLatestValues(j,et,tt,a),renderState:_()};return $&&(rt.mount=nt=>$(j,nt,rt)),rt}const makeUseVisualState=a=>(_,$)=>{const j=reactExports.useContext(MotionContext),et=reactExports.useContext(PresenceContext),tt=()=>makeState(a,_,j,et);return $?tt():useConstant(tt)};function makeLatestValues(a,_,$,j){const et={},tt=j(a,{});for(const ut in tt)et[ut]=resolveMotionValue(tt[ut]);let{initial:rt,animate:nt}=a;const it=isControllingVariants(a),st=isVariantNode(a);_&&st&&!it&&a.inherit!==!1&&(rt===void 0&&(rt=_.initial),nt===void 0&&(nt=_.animate));let ot=$?$.initial===!1:!1;ot=ot||rt===!1;const at=ot?nt:rt;return at&&typeof at!="boolean"&&!isAnimationControls(at)&&(Array.isArray(at)?at:[at]).forEach(ht=>{const yt=resolveVariantFromProps(a,ht);if(!yt)return;const{transitionEnd:wt,transition:Ct,...Pt}=yt;for(const $t in Pt){let Mt=Pt[$t];if(Array.isArray(Mt)){const Bt=ot?Mt.length-1:0;Mt=Mt[Bt]}Mt!==null&&(et[$t]=Mt)}for(const $t in wt)et[$t]=wt[$t]}),et}const noop$b=a=>a,{schedule:frame,cancel:cancelFrame,state:frameData,steps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$b,!0),svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(a,_,{renderState:$,latestValues:j})=>{frame.read(()=>{try{$.dimensions=typeof _.getBBox=="function"?_.getBBox():_.getBoundingClientRect()}catch{$.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs($,j,{enableHardwareAcceleration:!1},isSVGTag(_.tagName),a.transformTemplate),renderSVG(_,$)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(a,{forwardMotionProps:_=!1},$,j){return{...isSVGComponent(a)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:$,useRender:createUseRender(_),createVisualElement:j,Component:a}}function addDomEvent(a,_,$,j={passive:!0}){return a.addEventListener(_,$,j),()=>a.removeEventListener(_,$)}const isPrimaryPointer=a=>a.pointerType==="mouse"?typeof a.button!="number"||a.button<=0:a.isPrimary!==!1;function extractEventInfo(a,_="page"){return{point:{x:a[`${_}X`],y:a[`${_}Y`]}}}const addPointerInfo=a=>_=>isPrimaryPointer(_)&&a(_,extractEventInfo(_));function addPointerEvent(a,_,$,j){return addDomEvent(a,_,addPointerInfo($),j)}const combineFunctions=(a,_)=>$=>_(a($)),pipe$1=(...a)=>a.reduce(combineFunctions);function createLock(a){let _=null;return()=>{const $=()=>{_=null};return _===null?(_=a,$):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(a){let _=!1;if(a==="y")_=globalVerticalLock();else if(a==="x")_=globalHorizontalLock();else{const $=globalHorizontalLock(),j=globalVerticalLock();$&&j?_=()=>{$(),j()}:($&&$(),j&&j())}return _}function isDragActive(){const a=getGlobalLock(!0);return a?(a(),!1):!0}class Feature{constructor(_){this.isMounted=!1,this.node=_}update(){}}function addHoverEvent(a,_){const $=_?"pointerenter":"pointerleave",j=_?"onHoverStart":"onHoverEnd",et=(tt,rt)=>{if(tt.pointerType==="touch"||isDragActive())return;const nt=a.getProps();a.animationState&&nt.whileHover&&a.animationState.setActive("whileHover",_);const it=nt[j];it&&frame.postRender(()=>it(tt,rt))};return addPointerEvent(a.current,$,et,{passive:!a.getProps()[j]})}class HoverGesture extends Feature{mount(){this.unmount=pipe$1(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let _=!1;try{_=this.node.current.matches(":focus-visible")}catch{_=!0}!_||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe$1(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(a,_)=>_?a===_?!0:isNodeOrChild(a,_.parentElement):!1;function fireSyntheticPointerEvent(a,_){if(!_)return;const $=new PointerEvent("pointer"+a);_($,extractEventInfo($))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$b,this.removeEndListeners=noop$b,this.removeAccessibleListeners=noop$b,this.startPointerPress=(_,$)=>{if(this.isPressing)return;this.removeEndListeners();const j=this.node.getProps(),tt=addPointerEvent(window,"pointerup",(nt,it)=>{if(!this.checkPressEnd())return;const{onTap:st,onTapCancel:ot,globalTapTarget:at}=this.node.getProps(),ut=!at&&!isNodeOrChild(this.node.current,nt.target)?ot:st;ut&&frame.update(()=>ut(nt,it))},{passive:!(j.onTap||j.onPointerUp)}),rt=addPointerEvent(window,"pointercancel",(nt,it)=>this.cancelPress(nt,it),{passive:!(j.onTapCancel||j.onPointerCancel)});this.removeEndListeners=pipe$1(tt,rt),this.startPress(_,$)},this.startAccessiblePress=()=>{const _=tt=>{if(tt.key!=="Enter"||this.isPressing)return;const rt=nt=>{nt.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(it,st)=>{const{onTap:ot}=this.node.getProps();ot&&frame.postRender(()=>ot(it,st))})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",rt),fireSyntheticPointerEvent("down",(nt,it)=>{this.startPress(nt,it)})},$=addDomEvent(this.node.current,"keydown",_),j=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(tt,rt)=>this.cancelPress(tt,rt))},et=addDomEvent(this.node.current,"blur",j);this.removeAccessibleListeners=pipe$1($,et)}}startPress(_,$){this.isPressing=!0;const{onTapStart:j,whileTap:et}=this.node.getProps();et&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),j&&frame.postRender(()=>j(_,$))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(_,$){if(!this.checkPressEnd())return;const{onTapCancel:j}=this.node.getProps();j&&frame.postRender(()=>j(_,$))}mount(){const _=this.node.getProps(),$=addPointerEvent(_.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(_.onTapStart||_.onPointerStart)}),j=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe$1($,j)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=a=>{const _=observerCallbacks.get(a.target);_&&_(a)},fireAllObserverCallbacks=a=>{a.forEach(fireObserverCallback)};function initIntersectionObserver({root:a,..._}){const $=a||document;observers.has($)||observers.set($,{});const j=observers.get($),et=JSON.stringify(_);return j[et]||(j[et]=new IntersectionObserver(fireAllObserverCallbacks,{root:a,..._})),j[et]}function observeIntersection(a,_,$){const j=initIntersectionObserver(_);return observerCallbacks.set(a,$),j.observe(a),()=>{observerCallbacks.delete(a),j.unobserve(a)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:_={}}=this.node.getProps(),{root:$,margin:j,amount:et="some",once:tt}=_,rt={root:$?$.current:void 0,rootMargin:j,threshold:typeof et=="number"?et:thresholdNames[et]},nt=it=>{const{isIntersecting:st}=it;if(this.isInView===st||(this.isInView=st,tt&&!st&&this.hasEnteredView))return;st&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",st);const{onViewportEnter:ot,onViewportLeave:at}=this.node.getProps(),ut=st?ot:at;ut&&ut(it)};return observeIntersection(this.node.current,rt,nt)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:_,prevProps:$}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(_,$))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:a={}},{viewport:_={}}={}){return $=>a[$]!==_[$]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(a,_){if(!Array.isArray(_))return!1;const $=_.length;if($!==a.length)return!1;for(let j=0;j<$;j++)if(_[j]!==a[j])return!1;return!0}function resolveVariant(a,_,$){const j=a.getProps();return resolveVariantFromProps(j,_,$!==void 0?$:j.custom,a)}const secondsToMilliseconds$1=a=>a*1e3,millisecondsToSeconds=a=>a/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=a=>({type:"spring",stiffness:550,damping:a===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(a,{keyframes:_})=>_.length>2?keyframesTransition:transformProps.has(a)?a.startsWith("scale")?criticallyDampedSpring(_[1]):underDampedSpring:ease;function isTransitionDefined({when:a,delay:_,delayChildren:$,staggerChildren:j,staggerDirection:et,repeat:tt,repeatType:rt,repeatDelay:nt,from:it,elapsed:st,...ot}){return!!Object.keys(ot).length}function getValueTransition(a,_){return a[_]||a.default||a}const isNotNull=a=>a!==null;function getFinalKeyframe(a,{repeat:_,repeatType:$="loop"},j){const et=a.filter(isNotNull),tt=_&&$!=="loop"&&_%2===1?0:et.length-1;return!tt||j===void 0?et[tt]:j}let now$1;function clearTime(){now$1=void 0}const time={now:()=>(now$1===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now$1),set:a=>{now$1=a,queueMicrotask(clearTime)}},isZeroValueString=a=>/^0[^.\s]+$/u.test(a);function isNone(a){return typeof a=="number"?a===0:a!==null?a==="none"||a==="0"||isZeroValueString(a):!0}let invariant$1=noop$b;const isNumericalString=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a),splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(a){const _=splitCSSVariableRegex.exec(a);if(!_)return[,];const[,$,j,et]=_;return[`--${$??j}`,et]}function getVariableValue(a,_,$=1){const[j,et]=parseCSSVariable(a);if(!j)return;const tt=window.getComputedStyle(_).getPropertyValue(j);if(tt){const rt=tt.trim();return isNumericalString(rt)?parseFloat(rt):rt}return isCSSVariableToken(et)?getVariableValue(et,_,$+1):et}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=a=>a===number$2||a===px,getPosFromMatrix=(a,_)=>parseFloat(a.split(", ")[_]),getTranslateFromMatrix=(a,_)=>($,{transform:j})=>{if(j==="none"||!j)return 0;const et=j.match(/^matrix3d\((.+)\)$/u);if(et)return getPosFromMatrix(et[1],_);{const tt=j.match(/^matrix\((.+)\)$/u);return tt?getPosFromMatrix(tt[1],a):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(a=>!transformKeys.has(a));function removeNonTranslationalTransform(a){const _=[];return nonTranslationalTransformKeys.forEach($=>{const j=a.getValue($);j!==void 0&&(_.push([$,j.get()]),j.set($.startsWith("scale")?1:0))}),_}const positionalValues={width:({x:a},{paddingLeft:_="0",paddingRight:$="0"})=>a.max-a.min-parseFloat(_)-parseFloat($),height:({y:a},{paddingTop:_="0",paddingBottom:$="0"})=>a.max-a.min-parseFloat(_)-parseFloat($),top:(a,{top:_})=>parseFloat(_),left:(a,{left:_})=>parseFloat(_),bottom:({y:a},{top:_})=>parseFloat(_)+(a.max-a.min),right:({x:a},{left:_})=>parseFloat(_)+(a.max-a.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x;positionalValues.translateY=positionalValues.y;const testValueType=a=>_=>_.test(a),auto$1={test:a=>a==="auto",parse:a=>a},dimensionValueTypes=[number$2,px,percent,degrees,vw,vh,auto$1],findDimensionValueType=a=>dimensionValueTypes.find(testValueType(a)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const a=Array.from(toResolve).filter(j=>j.needsMeasurement),_=new Set(a.map(j=>j.element)),$=new Map;_.forEach(j=>{const et=removeNonTranslationalTransform(j);et.length&&($.set(j,et),j.render())}),a.forEach(j=>j.measureInitialState()),_.forEach(j=>{j.render();const et=$.get(j);et&&et.forEach(([tt,rt])=>{var nt;(nt=j.getValue(tt))===null||nt===void 0||nt.set(rt)})}),a.forEach(j=>j.measureEndState()),a.forEach(j=>{j.suspendedScrollY!==void 0&&window.scrollTo(0,j.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(a=>a.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(_,$,j,et,tt,rt=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[..._],this.onComplete=$,this.name=j,this.motionValue=et,this.element=tt,this.isAsync=rt}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:_,name:$,element:j,motionValue:et}=this;for(let tt=0;tt<_.length;tt++)if(_[tt]===null)if(tt===0){const rt=et==null?void 0:et.get(),nt=_[_.length-1];if(rt!==void 0)_[0]=rt;else if(j&&$){const it=j.readValue($,nt);it!=null&&(_[0]=it)}_[0]===void 0&&(_[0]=nt),et&&rt===void 0&&et.set(_[0])}else _[tt]=_[tt-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),toResolve.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,toResolve.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const isColorString=(a,_)=>$=>!!(isString$4($)&&singleColorRegex.test($)&&$.startsWith(a)||_&&Object.prototype.hasOwnProperty.call($,_)),splitColor=(a,_,$)=>j=>{if(!isString$4(j))return j;const[et,tt,rt,nt]=j.match(floatRegex);return{[a]:parseFloat(et),[_]:parseFloat(tt),[$]:parseFloat(rt),alpha:nt!==void 0?parseFloat(nt):1}},clampRgbUnit=a=>clamp(0,255,a),rgbUnit={...number$2,transform:a=>Math.round(clampRgbUnit(a))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:a,green:_,blue:$,alpha:j=1})=>"rgba("+rgbUnit.transform(a)+", "+rgbUnit.transform(_)+", "+rgbUnit.transform($)+", "+sanitize(alpha.transform(j))+")"};function parseHex$1(a){let _="",$="",j="",et="";return a.length>5?(_=a.substring(1,3),$=a.substring(3,5),j=a.substring(5,7),et=a.substring(7,9)):(_=a.substring(1,2),$=a.substring(2,3),j=a.substring(3,4),et=a.substring(4,5),_+=_,$+=$,j+=j,et+=et),{red:parseInt(_,16),green:parseInt($,16),blue:parseInt(j,16),alpha:et?parseInt(et,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex$1,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:a,saturation:_,lightness:$,alpha:j=1})=>"hsla("+Math.round(a)+", "+percent.transform(sanitize(_))+", "+percent.transform(sanitize($))+", "+sanitize(alpha.transform(j))+")"},color$1={test:a=>rgba.test(a)||hex.test(a)||hsla.test(a),parse:a=>rgba.test(a)?rgba.parse(a):hsla.test(a)?hsla.parse(a):hex.parse(a),transform:a=>isString$4(a)?a:a.hasOwnProperty("red")?rgba.transform(a):hsla.transform(a)};function test$1(a){var _,$;return isNaN(a)&&isString$4(a)&&(((_=a.match(floatRegex))===null||_===void 0?void 0:_.length)||0)+((($=a.match(colorRegex))===null||$===void 0?void 0:$.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(a){const _=a.toString(),$=[],j={color:[],number:[],var:[]},et=[];let tt=0;const nt=_.replace(complexRegex,it=>(color$1.test(it)?(j.color.push(tt),et.push(COLOR_TOKEN),$.push(color$1.parse(it))):it.startsWith(VAR_FUNCTION_TOKEN)?(j.var.push(tt),et.push(VAR_TOKEN),$.push(it)):(j.number.push(tt),et.push(NUMBER_TOKEN),$.push(parseFloat(it))),++tt,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:$,split:nt,indexes:j,types:et}}function parseComplexValue(a){return analyseComplexValue(a).values}function createTransformer(a){const{split:_,types:$}=analyseComplexValue(a),j=_.length;return et=>{let tt="";for(let rt=0;rttypeof a=="number"?0:a;function getAnimatableNone$1(a){const _=parseComplexValue(a);return createTransformer(a)(_.map(convertNumbersToZero))}const complex={test:test$1,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(a){const[_,$]=a.slice(0,-1).split("(");if(_==="drop-shadow")return a;const[j]=$.match(floatRegex)||[];if(!j)return a;const et=$.replace(j,"");let tt=maxDefaults.has(_)?1:0;return j!==$&&(tt*=100),_+"("+tt+et+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter$1={...complex,getAnimatableNone:a=>{const _=a.match(functionRegex);return _?_.map(applyDefaultFilter).join(" "):a}},defaultValueTypes={...numberValueTypes,color:color$1,backgroundColor:color$1,outlineColor:color$1,fill:color$1,stroke:color$1,borderColor:color$1,borderTopColor:color$1,borderRightColor:color$1,borderBottomColor:color$1,borderLeftColor:color$1,filter:filter$1,WebkitFilter:filter$1},getDefaultValueType=a=>defaultValueTypes[a];function getAnimatableNone(a,_){let $=getDefaultValueType(a);return $!==filter$1&&($=complex),$.getAnimatableNone?$.getAnimatableNone(_):void 0}const invalidTemplates=new Set(["auto","none","0"]);function makeNoneKeyframesAnimatable(a,_,$){let j=0,et;for(;j{$.getValue(it).set(st)}),this.resolveNoneKeyframes()}}function memo(a){let _;return()=>(_===void 0&&(_=a()),_)}const isAnimatable=(a,_)=>_==="zIndex"?!1:!!(typeof a=="number"||Array.isArray(a)||typeof a=="string"&&(complex.test(a)||a==="0")&&!a.startsWith("url("));function hasKeyframesChanged(a){const _=a[0];if(a.length===1)return!0;for(let $=0;${this.resolveFinishedPromise=_})}}function velocityPerSecond(a,_){return _?a*(1e3/_):0}const velocitySampleDuration=5;function calcGeneratorVelocity(a,_,$){const j=Math.max(_-velocitySampleDuration,0);return velocityPerSecond($-a(j),_-j)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:a=800,bounce:_=.25,velocity:$=0,mass:j=1}){let et,tt,rt=1-_;rt=clamp(minDamping,maxDamping,rt),a=clamp(minDuration,maxDuration$1,millisecondsToSeconds(a)),rt<1?(et=st=>{const ot=st*rt,at=ot*a,ut=ot-$,ht=calcAngularFreq(st,rt),yt=Math.exp(-at);return safeMin-ut/ht*yt},tt=st=>{const at=st*rt*a,ut=at*$+$,ht=Math.pow(rt,2)*Math.pow(st,2)*a,yt=Math.exp(-at),wt=calcAngularFreq(Math.pow(st,2),rt);return(-et(st)+safeMin>0?-1:1)*((ut-ht)*yt)/wt}):(et=st=>{const ot=Math.exp(-st*a),at=(st-$)*a+1;return-safeMin+ot*at},tt=st=>{const ot=Math.exp(-st*a),at=($-st)*(a*a);return ot*at});const nt=5/a,it=approximateRoot(et,tt,nt);if(a=secondsToMilliseconds$1(a),isNaN(it))return{stiffness:100,damping:10,duration:a};{const st=Math.pow(it,2)*j;return{stiffness:st,damping:rt*2*Math.sqrt(j*st),duration:a}}}const rootIterations=12;function approximateRoot(a,_,$){let j=$;for(let et=1;eta[$]!==void 0)}function getSpringOptions(a){let _={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...a};if(!isSpringType(a,physicsKeys)&&isSpringType(a,durationKeys)){const $=findSpring(a);_={..._,...$,mass:1},_.isResolvedFromDuration=!0}return _}function spring({keyframes:a,restDelta:_,restSpeed:$,...j}){const et=a[0],tt=a[a.length-1],rt={done:!1,value:et},{stiffness:nt,damping:it,mass:st,duration:ot,velocity:at,isResolvedFromDuration:ut}=getSpringOptions({...j,velocity:-millisecondsToSeconds(j.velocity||0)}),ht=at||0,yt=it/(2*Math.sqrt(nt*st)),wt=tt-et,Ct=millisecondsToSeconds(Math.sqrt(nt/st)),Pt=Math.abs(wt)<5;$||($=Pt?.01:2),_||(_=Pt?.005:.5);let $t;if(yt<1){const Mt=calcAngularFreq(Ct,yt);$t=Bt=>{const Dt=Math.exp(-yt*Ct*Bt);return tt-Dt*((ht+yt*Ct*wt)/Mt*Math.sin(Mt*Bt)+wt*Math.cos(Mt*Bt))}}else if(yt===1)$t=Mt=>tt-Math.exp(-Ct*Mt)*(wt+(ht+Ct*wt)*Mt);else{const Mt=Ct*Math.sqrt(yt*yt-1);$t=Bt=>{const Dt=Math.exp(-yt*Ct*Bt),zt=Math.min(Mt*Bt,300);return tt-Dt*((ht+yt*Ct*wt)*Math.sinh(zt)+Mt*wt*Math.cosh(zt))/Mt}}return{calculatedDuration:ut&&ot||null,next:Mt=>{const Bt=$t(Mt);if(ut)rt.done=Mt>=ot;else{let Dt=ht;Mt!==0&&(yt<1?Dt=calcGeneratorVelocity($t,Mt,Bt):Dt=0);const zt=Math.abs(Dt)<=$,Ot=Math.abs(tt-Bt)<=_;rt.done=zt&&Ot}return rt.value=rt.done?tt:Bt,rt}}}function inertia({keyframes:a,velocity:_=0,power:$=.8,timeConstant:j=325,bounceDamping:et=10,bounceStiffness:tt=500,modifyTarget:rt,min:nt,max:it,restDelta:st=.5,restSpeed:ot}){const at=a[0],ut={done:!1,value:at},ht=It=>nt!==void 0&&Itit,yt=It=>nt===void 0?it:it===void 0||Math.abs(nt-It)-wt*Math.exp(-It/j),Mt=It=>Pt+$t(It),Bt=It=>{const Lt=$t(It),Ft=Mt(It);ut.done=Math.abs(Lt)<=st,ut.value=ut.done?Pt:Ft};let Dt,zt;const Ot=It=>{ht(ut.value)&&(Dt=It,zt=spring({keyframes:[ut.value,yt(ut.value)],velocity:calcGeneratorVelocity(Mt,It,ut.value),damping:et,stiffness:tt,restDelta:st,restSpeed:ot}))};return Ot(0),{calculatedDuration:null,next:It=>{let Lt=!1;return!zt&&Dt===void 0&&(Lt=!0,Bt(It),Ot(It)),Dt!==void 0&&It>=Dt?zt.next(It-Dt):(!Lt&&Bt(It),ut)}}}const calcBezier=(a,_,$)=>(((1-3*$+3*_)*a+(3*$-6*_))*a+3*_)*a,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(a,_,$,j,et){let tt,rt,nt=0;do rt=_+($-_)/2,tt=calcBezier(rt,j,et)-a,tt>0?$=rt:_=rt;while(Math.abs(tt)>subdivisionPrecision&&++ntbinarySubdivide(tt,0,1,a,$);return tt=>tt===0||tt===1?tt:calcBezier(et(tt),_,j)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=a=>Array.isArray(a)&&typeof a[0]!="number",mirrorEasing=a=>_=>_<=.5?a(2*_)/2:(2-a(2*(1-_)))/2,reverseEasing=a=>_=>1-a(1-_),circIn=a=>1-Math.sin(Math.acos(a)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=a=>(a*=2)<1?.5*backIn(a):.5*(2-Math.pow(2,-10*(a-1))),easingLookup={linear:noop$b,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=a=>{if(Array.isArray(a)){invariant$1(a.length===4);const[_,$,j,et]=a;return cubicBezier(_,$,j,et)}else if(typeof a=="string")return invariant$1(easingLookup[a]!==void 0),easingLookup[a];return a},progress=(a,_,$)=>{const j=_-a;return j===0?1:($-a)/j},mixNumber$1=(a,_,$)=>a+(_-a)*$;function hueToRgb(a,_,$){return $<0&&($+=1),$>1&&($-=1),$<1/6?a+(_-a)*6*$:$<1/2?_:$<2/3?a+(_-a)*(2/3-$)*6:a}function hslaToRgba({hue:a,saturation:_,lightness:$,alpha:j}){a/=360,_/=100,$/=100;let et=0,tt=0,rt=0;if(!_)et=tt=rt=$;else{const nt=$<.5?$*(1+_):$+_-$*_,it=2*$-nt;et=hueToRgb(it,nt,a+1/3),tt=hueToRgb(it,nt,a),rt=hueToRgb(it,nt,a-1/3)}return{red:Math.round(et*255),green:Math.round(tt*255),blue:Math.round(rt*255),alpha:j}}const mixLinearColor=(a,_,$)=>{const j=a*a,et=$*(_*_-j)+j;return et<0?0:Math.sqrt(et)},colorTypes=[hex,rgba,hsla],getColorType=a=>colorTypes.find(_=>_.test(a));function asRGBA(a){const _=getColorType(a);let $=_.parse(a);return _===hsla&&($=hslaToRgba($)),$}const mixColor=(a,_)=>{const $=asRGBA(a),j=asRGBA(_),et={...$};return tt=>(et.red=mixLinearColor($.red,j.red,tt),et.green=mixLinearColor($.green,j.green,tt),et.blue=mixLinearColor($.blue,j.blue,tt),et.alpha=mixNumber$1($.alpha,j.alpha,tt),rgba.transform(et))},invisibleValues=new Set(["none","hidden"]);function mixVisibility(a,_){return invisibleValues.has(a)?$=>$<=0?a:_:$=>$>=1?_:a}function mixImmediate(a,_){return $=>$>0?_:a}function mixNumber(a,_){return $=>mixNumber$1(a,_,$)}function getMixer(a){return typeof a=="number"?mixNumber:typeof a=="string"?isCSSVariableToken(a)?mixImmediate:color$1.test(a)?mixColor:mixComplex:Array.isArray(a)?mixArray:typeof a=="object"?color$1.test(a)?mixColor:mixObject:mixImmediate}function mixArray(a,_){const $=[...a],j=$.length,et=a.map((tt,rt)=>getMixer(tt)(tt,_[rt]));return tt=>{for(let rt=0;rt{for(const tt in j)$[tt]=j[tt](et);return $}}function matchOrder(a,_){var $;const j=[],et={color:0,var:0,number:0};for(let tt=0;tt<_.values.length;tt++){const rt=_.types[tt],nt=a.indexes[rt][et[rt]],it=($=a.values[nt])!==null&&$!==void 0?$:0;j[tt]=it,et[rt]++}return j}const mixComplex=(a,_)=>{const $=complex.createTransformer(_),j=analyseComplexValue(a),et=analyseComplexValue(_);return j.indexes.var.length===et.indexes.var.length&&j.indexes.color.length===et.indexes.color.length&&j.indexes.number.length>=et.indexes.number.length?invisibleValues.has(a)&&!et.values.length||invisibleValues.has(_)&&!j.values.length?mixVisibility(a,_):pipe$1(mixArray(matchOrder(j,et),et.values),$):mixImmediate(a,_)};function mix(a,_,$){return typeof a=="number"&&typeof _=="number"&&typeof $=="number"?mixNumber$1(a,_,$):getMixer(a)(a,_)}function createMixers(a,_,$){const j=[],et=$||mix,tt=a.length-1;for(let rt=0;rt_[0];if(tt===2&&a[0]===a[1])return()=>_[1];a[0]>a[tt-1]&&(a=[...a].reverse(),_=[..._].reverse());const rt=createMixers(_,j,et),nt=rt.length,it=st=>{let ot=0;if(nt>1)for(;otit(clamp(a[0],a[tt-1],st)):it}function fillOffset(a,_){const $=a[a.length-1];for(let j=1;j<=_;j++){const et=progress(0,_,j);a.push(mixNumber$1($,1,et))}}function defaultOffset(a){const _=[0];return fillOffset(_,a.length-1),_}function convertOffsetToTimes(a,_){return a.map($=>$*_)}function defaultEasing(a,_){return a.map(()=>_||easeInOut).splice(0,a.length-1)}function keyframes({duration:a=300,keyframes:_,times:$,ease:j="easeInOut"}){const et=isEasingArray(j)?j.map(easingDefinitionToFunction):easingDefinitionToFunction(j),tt={done:!1,value:_[0]},rt=convertOffsetToTimes($&&$.length===_.length?$:defaultOffset(_),a),nt=interpolate(rt,_,{ease:Array.isArray(et)?et:defaultEasing(_,et)});return{calculatedDuration:a,next:it=>(tt.value=nt(it),tt.done=it>=a,tt)}}const maxGeneratorDuration=2e4;function calcGeneratorDuration(a){let _=0;const $=50;let j=a.next(_);for(;!j.done&&_=maxGeneratorDuration?1/0:_}const frameloopDriver=a=>{const _=({timestamp:$})=>a($);return{start:()=>frame.update(_,!0),stop:()=>cancelFrame(_),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=a=>a/100;class MainThreadAnimation extends BaseAnimation{constructor({KeyframeResolver:_=KeyframeResolver,...$}){super($),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:nt}=this.options;nt&&nt()};const{name:j,motionValue:et,keyframes:tt}=this.options,rt=(nt,it)=>this.onKeyframesResolved(nt,it);j&&et&&et.owner?this.resolver=et.owner.resolveKeyframes(tt,rt,j,et):this.resolver=new _(tt,rt,j,et),this.resolver.scheduleResolve()}initPlayback(_){const{type:$="keyframes",repeat:j=0,repeatDelay:et=0,repeatType:tt,velocity:rt=0}=this.options,nt=generators[$]||keyframes;let it,st;nt!==keyframes&&typeof _[0]!="number"&&(it=pipe$1(percentToProgress,mix(_[0],_[1])),_=[0,100]);const ot=nt({...this.options,keyframes:_});tt==="mirror"&&(st=nt({...this.options,keyframes:[..._].reverse(),velocity:-rt})),ot.calculatedDuration===null&&(ot.calculatedDuration=calcGeneratorDuration(ot));const{calculatedDuration:at}=ot,ut=at+et,ht=ut*(j+1)-et;return{generator:ot,mirroredGenerator:st,mapPercentToKeyframes:it,calculatedDuration:at,resolvedDuration:ut,totalDuration:ht}}onPostResolved(){const{autoplay:_=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!_?this.pause():this.state=this.pendingPlayState}tick(_,$=!1){const{resolved:j}=this;if(!j){const{keyframes:It}=this.options;return{done:!0,value:It[It.length-1]}}const{finalKeyframe:et,generator:tt,mirroredGenerator:rt,mapPercentToKeyframes:nt,keyframes:it,calculatedDuration:st,totalDuration:ot,resolvedDuration:at}=j;if(this.startTime===null)return tt.next(0);const{delay:ut,repeat:ht,repeatType:yt,repeatDelay:wt,onUpdate:Ct}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,_):this.speed<0&&(this.startTime=Math.min(_-ot/this.speed,this.startTime)),$?this.currentTime=_:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(_-this.startTime)*this.speed;const Pt=this.currentTime-ut*(this.speed>=0?1:-1),$t=this.speed>=0?Pt<0:Pt>ot;this.currentTime=Math.max(Pt,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=ot);let Mt=this.currentTime,Bt=tt;if(ht){const It=Math.min(this.currentTime,ot)/at;let Lt=Math.floor(It),Ft=It%1;!Ft&&It>=1&&(Ft=1),Ft===1&&Lt--,Lt=Math.min(Lt,ht+1),!!(Lt%2)&&(yt==="reverse"?(Ft=1-Ft,wt&&(Ft-=wt/at)):yt==="mirror"&&(Bt=rt)),Mt=clamp(0,1,Ft)*at}const Dt=$t?{done:!1,value:it[0]}:Bt.next(Mt);nt&&(Dt.value=nt(Dt.value));let{done:zt}=Dt;!$t&&st!==null&&(zt=this.speed>=0?this.currentTime>=ot:this.currentTime<=0);const Ot=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&zt);return Ot&&et!==void 0&&(Dt.value=getFinalKeyframe(it,this.options,et)),Ct&&Ct(Dt.value),Ot&&this.finish(),Dt}get duration(){const{resolved:_}=this;return _?millisecondsToSeconds(_.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(_){_=secondsToMilliseconds$1(_),this.currentTime=_,this.holdTime!==null||this.speed===0?this.holdTime=_:this.driver&&(this.startTime=this.driver.now()-_/this.speed)}get speed(){return this.playbackSpeed}set speed(_){const $=this.playbackSpeed!==_;this.playbackSpeed=_,$&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:_=frameloopDriver,onPlay:$}=this.options;this.driver||(this.driver=_(et=>this.tick(et))),$&&$();const j=this.driver.now();this.holdTime!==null?this.startTime=j-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=j),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var _;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(_=this.currentTime)!==null&&_!==void 0?_:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:_}=this.options;_&&_()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(_){return this.startTime=0,this.tick(_,!0)}}const isBezierDefinition=a=>Array.isArray(a)&&typeof a[0]=="number";function isWaapiSupportedEasing(a){return!!(!a||typeof a=="string"&&a in supportedWaapiEasing||isBezierDefinition(a)||Array.isArray(a)&&a.every(isWaapiSupportedEasing))}const cubicBezierAsString=([a,_,$,j])=>`cubic-bezier(${a}, ${_}, ${$}, ${j})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasingWithDefault(a){return mapEasingToNativeEasing(a)||supportedWaapiEasing.easeOut}function mapEasingToNativeEasing(a){if(a)return isBezierDefinition(a)?cubicBezierAsString(a):Array.isArray(a)?a.map(mapEasingToNativeEasingWithDefault):supportedWaapiEasing[a]}function animateStyle(a,_,$,{delay:j=0,duration:et=300,repeat:tt=0,repeatType:rt="loop",ease:nt,times:it}={}){const st={[_]:$};it&&(st.offset=it);const ot=mapEasingToNativeEasing(nt);return Array.isArray(ot)&&(st.easing=ot),a.animate(st,{delay:j,duration:et,easing:Array.isArray(ot)?"linear":ot,fill:"both",iterations:tt+1,direction:rt==="reverse"?"alternate":"normal"})}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),acceleratedValues=new Set(["opacity","clipPath","filter","transform"]),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(a){return a.type==="spring"||a.name==="backgroundColor"||!isWaapiSupportedEasing(a.ease)}function pregenerateKeyframes(a,_){const $=new MainThreadAnimation({..._,keyframes:a,repeat:0,delay:0,isGenerator:!0});let j={done:!1,value:a[0]};const et=[];let tt=0;for(;!j.done&&ttthis.onKeyframesResolved(tt,rt),$,j),this.resolver.scheduleResolve()}initPlayback(_,$){var j;let{duration:et=300,times:tt,ease:rt,type:nt,motionValue:it,name:st}=this.options;if(!(!((j=it.owner)===null||j===void 0)&&j.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:at,onUpdate:ut,motionValue:ht,...yt}=this.options,wt=pregenerateKeyframes(_,yt);_=wt.keyframes,_.length===1&&(_[1]=_[0]),et=wt.duration,tt=wt.times,rt=wt.ease,nt="keyframes"}const ot=animateStyle(it.owner.current,st,_,{...this.options,duration:et,times:tt,ease:rt});return ot.startTime=time.now(),this.pendingTimeline?(ot.timeline=this.pendingTimeline,this.pendingTimeline=void 0):ot.onfinish=()=>{const{onComplete:at}=this.options;it.set(getFinalKeyframe(_,this.options,$)),at&&at(),this.cancel(),this.resolveFinishedPromise()},{animation:ot,duration:et,times:tt,type:nt,ease:rt,keyframes:_}}get duration(){const{resolved:_}=this;if(!_)return 0;const{duration:$}=_;return millisecondsToSeconds($)}get time(){const{resolved:_}=this;if(!_)return 0;const{animation:$}=_;return millisecondsToSeconds($.currentTime||0)}set time(_){const{resolved:$}=this;if(!$)return;const{animation:j}=$;j.currentTime=secondsToMilliseconds$1(_)}get speed(){const{resolved:_}=this;if(!_)return 1;const{animation:$}=_;return $.playbackRate}set speed(_){const{resolved:$}=this;if(!$)return;const{animation:j}=$;j.playbackRate=_}get state(){const{resolved:_}=this;if(!_)return"idle";const{animation:$}=_;return $.playState}attachTimeline(_){if(!this._resolved)this.pendingTimeline=_;else{const{resolved:$}=this;if(!$)return noop$b;const{animation:j}=$;j.timeline=_,j.onfinish=null}return noop$b}play(){if(this.isStopped)return;const{resolved:_}=this;if(!_)return;const{animation:$}=_;$.playState==="finished"&&this.updateFinishedPromise(),$.play()}pause(){const{resolved:_}=this;if(!_)return;const{animation:$}=_;$.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:_}=this;if(!_)return;const{animation:$,keyframes:j,duration:et,type:tt,ease:rt,times:nt}=_;if(!($.playState==="idle"||$.playState==="finished")){if(this.time){const{motionValue:it,onUpdate:st,onComplete:ot,...at}=this.options,ut=new MainThreadAnimation({...at,keyframes:j,duration:et,type:tt,ease:rt,times:nt,isGenerator:!0}),ht=secondsToMilliseconds$1(this.time);it.setWithVelocity(ut.sample(ht-sampleDelta).value,ut.sample(ht).value,sampleDelta)}this.cancel()}}complete(){const{resolved:_}=this;_&&_.animation.finish()}cancel(){const{resolved:_}=this;_&&_.animation.cancel()}static supports(_){const{motionValue:$,name:j,repeatDelay:et,repeatType:tt,damping:rt,type:nt}=_;return supportsWaapi()&&j&&acceleratedValues.has(j)&&$&&$.owner&&$.owner.current instanceof HTMLElement&&!$.owner.getProps().onUpdate&&!et&&tt!=="mirror"&&rt!==0&&nt!=="inertia"}}const animateMotionValue=(a,_,$,j={},et,tt)=>rt=>{const nt=getValueTransition(j,a)||{},it=nt.delay||j.delay||0;let{elapsed:st=0}=j;st=st-secondsToMilliseconds$1(it);let ot={keyframes:Array.isArray($)?$:[null,$],ease:"easeOut",velocity:_.getVelocity(),...nt,delay:-st,onUpdate:ut=>{_.set(ut),nt.onUpdate&&nt.onUpdate(ut)},onComplete:()=>{rt(),nt.onComplete&&nt.onComplete()},name:a,motionValue:_,element:tt?void 0:et};isTransitionDefined(nt)||(ot={...ot,...getDefaultTransition(a,ot)}),ot.duration&&(ot.duration=secondsToMilliseconds$1(ot.duration)),ot.repeatDelay&&(ot.repeatDelay=secondsToMilliseconds$1(ot.repeatDelay)),ot.from!==void 0&&(ot.keyframes[0]=ot.from);let at=!1;if((ot.type===!1||ot.duration===0&&!ot.repeatDelay)&&(ot.duration=0,ot.delay===0&&(at=!0)),at&&!tt&&_.get()!==void 0){const ut=getFinalKeyframe(ot.keyframes,nt);if(ut!==void 0){frame.update(()=>{ot.onUpdate(ut),ot.onComplete()});return}}return!tt&&AcceleratedAnimation.supports(ot)?new AcceleratedAnimation(ot):new MainThreadAnimation(ot)};function isWillChangeMotionValue(a){return!!(isMotionValue(a)&&a.add)}function addUniqueItem(a,_){a.indexOf(_)===-1&&a.push(_)}function removeItem(a,_){const $=a.indexOf(_);$>-1&&a.splice($,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(_){return addUniqueItem(this.subscriptions,_),()=>removeItem(this.subscriptions,_)}notify(_,$,j){const et=this.subscriptions.length;if(et)if(et===1)this.subscriptions[0](_,$,j);else for(let tt=0;tt!isNaN(parseFloat(a));class MotionValue{constructor(_,$={}){this.version="11.2.5",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(j,et=!0)=>{const tt=time.now();this.updatedAt!==tt&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(j),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),et&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(_),this.owner=$.owner}setCurrent(_){this.current=_,this.updatedAt=time.now(),this.canTrackVelocity===null&&_!==void 0&&(this.canTrackVelocity=isFloat(this.current))}setPrevFrameValue(_=this.current){this.prevFrameValue=_,this.prevUpdatedAt=this.updatedAt}onChange(_){return this.on("change",_)}on(_,$){this.events[_]||(this.events[_]=new SubscriptionManager);const j=this.events[_].add($);return _==="change"?()=>{j(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:j}clearListeners(){for(const _ in this.events)this.events[_].clear()}attach(_,$){this.passiveEffect=_,this.stopPassiveEffect=$}set(_,$=!0){!$||!this.passiveEffect?this.updateAndNotify(_,$):this.passiveEffect(_,this.updateAndNotify)}setWithVelocity(_,$,j){this.set($),this.prev=void 0,this.prevFrameValue=_,this.prevUpdatedAt=this.updatedAt-j}jump(_,$=!0){this.updateAndNotify(_),this.prev=_,this.prevUpdatedAt=this.prevFrameValue=void 0,$&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const _=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||_-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const $=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),$)}start(_){return this.stop(),new Promise($=>{this.hasAnimated=!0,this.animation=_($),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(a,_){return new MotionValue(a,_)}function setMotionValue(a,_,$){a.hasValue(_)?a.getValue(_).set($):a.addValue(_,motionValue($))}function setTarget(a,_){const $=resolveVariant(a,_);let{transitionEnd:j={},transition:et={},...tt}=$||{};tt={...tt,...j};for(const rt in tt){const nt=resolveFinalValueInKeyframes(tt[rt]);setMotionValue(a,rt,nt)}}function shouldBlockAnimation({protectedKeys:a,needsAnimating:_},$){const j=a.hasOwnProperty($)&&_[$]!==!0;return _[$]=!1,j}function animateTarget(a,_,{delay:$=0,transitionOverride:j,type:et}={}){var tt;let{transition:rt=a.getDefaultTransition(),transitionEnd:nt,...it}=_;const st=a.getValue("willChange");j&&(rt=j);const ot=[],at=et&&a.animationState&&a.animationState.getState()[et];for(const ut in it){const ht=a.getValue(ut,(tt=a.latestValues[ut])!==null&&tt!==void 0?tt:null),yt=it[ut];if(yt===void 0||at&&shouldBlockAnimation(at,ut))continue;const wt={delay:$,elapsed:0,...getValueTransition(rt||{},ut)};let Ct=!1;if(window.HandoffAppearAnimations){const Mt=a.getProps()[optimizedAppearDataAttribute];if(Mt){const Bt=window.HandoffAppearAnimations(Mt,ut,ht,frame);Bt!==null&&(wt.elapsed=Bt,Ct=!0)}}ht.start(animateMotionValue(ut,ht,yt,a.shouldReduceMotion&&transformProps.has(ut)?{type:!1}:wt,a,Ct));const Pt=ht.animation;Pt&&(isWillChangeMotionValue(st)&&(st.add(ut),Pt.then(()=>st.remove(ut))),ot.push(Pt))}return nt&&Promise.all(ot).then(()=>{frame.update(()=>{nt&&setTarget(a,nt)})}),ot}function animateVariant(a,_,$={}){var j;const et=resolveVariant(a,_,$.type==="exit"?(j=a.presenceContext)===null||j===void 0?void 0:j.custom:void 0);let{transition:tt=a.getDefaultTransition()||{}}=et||{};$.transitionOverride&&(tt=$.transitionOverride);const rt=et?()=>Promise.all(animateTarget(a,et,$)):()=>Promise.resolve(),nt=a.variantChildren&&a.variantChildren.size?(st=0)=>{const{delayChildren:ot=0,staggerChildren:at,staggerDirection:ut}=tt;return animateChildren(a,_,ot+st,at,ut,$)}:()=>Promise.resolve(),{when:it}=tt;if(it){const[st,ot]=it==="beforeChildren"?[rt,nt]:[nt,rt];return st().then(()=>ot())}else return Promise.all([rt(),nt($.delay)])}function animateChildren(a,_,$=0,j=0,et=1,tt){const rt=[],nt=(a.variantChildren.size-1)*j,it=et===1?(st=0)=>st*j:(st=0)=>nt-st*j;return Array.from(a.variantChildren).sort(sortByTreeOrder).forEach((st,ot)=>{st.notify("AnimationStart",_),rt.push(animateVariant(st,_,{...tt,delay:$+it(ot)}).then(()=>st.notify("AnimationComplete",_)))}),Promise.all(rt)}function sortByTreeOrder(a,_){return a.sortNodePosition(_)}function animateVisualElement(a,_,$={}){a.notify("AnimationStart",_);let j;if(Array.isArray(_)){const et=_.map(tt=>animateVariant(a,tt,$));j=Promise.all(et)}else if(typeof _=="string")j=animateVariant(a,_,$);else{const et=typeof _=="function"?resolveVariant(a,_,$.custom):_;j=Promise.all(animateTarget(a,et,$))}return j.then(()=>{frame.postRender(()=>{a.notify("AnimationComplete",_)})})}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(a){return _=>Promise.all(_.map(({animation:$,options:j})=>animateVisualElement(a,$,j)))}function createAnimationState(a){let _=animateList(a);const $=createState();let j=!0;const et=it=>(st,ot)=>{var at;const ut=resolveVariant(a,ot,it==="exit"?(at=a.presenceContext)===null||at===void 0?void 0:at.custom:void 0);if(ut){const{transition:ht,transitionEnd:yt,...wt}=ut;st={...st,...wt,...yt}}return st};function tt(it){_=it(a)}function rt(it){const st=a.getProps(),ot=a.getVariantContext(!0)||{},at=[],ut=new Set;let ht={},yt=1/0;for(let Ct=0;Ctyt&&Bt,Lt=!1;const Ft=Array.isArray(Mt)?Mt:[Mt];let jt=Ft.reduce(et(Pt),{});Dt===!1&&(jt={});const{prevResolvedValues:bt={}}=$t,vt={...bt,...jt},ct=dt=>{It=!0,ut.has(dt)&&(Lt=!0,ut.delete(dt)),$t.needsAnimating[dt]=!0;const mt=a.getValue(dt);mt&&(mt.liveStyle=!1)};for(const dt in vt){const mt=jt[dt],xt=bt[dt];if(ht.hasOwnProperty(dt))continue;let At=!1;isKeyframesTarget(mt)&&isKeyframesTarget(xt)?At=!shallowCompare(mt,xt):At=mt!==xt,At?mt!=null?ct(dt):ut.add(dt):mt!==void 0&&ut.has(dt)?ct(dt):$t.protectedKeys[dt]=!0}$t.prevProp=Mt,$t.prevResolvedValues=jt,$t.isActive&&(ht={...ht,...jt}),j&&a.blockInitialAnimation&&(It=!1),It&&(!zt||Lt)&&at.push(...Ft.map(dt=>({animation:dt,options:{type:Pt}})))}if(ut.size){const Ct={};ut.forEach(Pt=>{const $t=a.getBaseTarget(Pt),Mt=a.getValue(Pt);Mt&&(Mt.liveStyle=!0),Ct[Pt]=$t??null}),at.push({animation:Ct})}let wt=!!at.length;return j&&(st.initial===!1||st.initial===st.animate)&&!a.manuallyAnimateOnMount&&(wt=!1),j=!1,wt?_(at):Promise.resolve()}function nt(it,st){var ot;if($[it].isActive===st)return Promise.resolve();(ot=a.variantChildren)===null||ot===void 0||ot.forEach(ut=>{var ht;return(ht=ut.animationState)===null||ht===void 0?void 0:ht.setActive(it,st)}),$[it].isActive=st;const at=rt(it);for(const ut in $)$[ut].protectedKeys={};return at}return{animateChanges:rt,setActive:nt,setAnimateFunction:tt,getState:()=>$}}function checkVariantsDidChange(a,_){return typeof _=="string"?_!==a:Array.isArray(_)?!shallowCompare(_,a):!1}function createTypeState(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(_){super(_),_.animationState||(_.animationState=createAnimationState(_))}updateAnimationControlsSubscription(){const{animate:_}=this.node.getProps();this.unmount(),isAnimationControls(_)&&(this.unmount=_.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:_}=this.node.getProps(),{animate:$}=this.node.prevProps||{};_!==$&&this.updateAnimationControlsSubscription()}unmount(){}}let id$2=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$2++}update(){if(!this.node.presenceContext)return;const{isPresent:_,onExitComplete:$}=this.node.presenceContext,{isPresent:j}=this.node.prevPresenceContext||{};if(!this.node.animationState||_===j)return;const et=this.node.animationState.setActive("exit",!_);$&&!_&&et.then(()=>$(this.id))}mount(){const{register:_}=this.node.presenceContext||{};_&&(this.unmount=_(this.id))}unmount(){}}const animations$1={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(a,_)=>Math.abs(a-_);function distance2D(a,_){const $=distance(a.x,_.x),j=distance(a.y,_.y);return Math.sqrt($**2+j**2)}class PanSession{constructor(_,$,{transformPagePoint:j,contextWindow:et,dragSnapToOrigin:tt=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const at=getPanInfo(this.lastMoveEventInfo,this.history),ut=this.startEvent!==null,ht=distance2D(at.offset,{x:0,y:0})>=3;if(!ut&&!ht)return;const{point:yt}=at,{timestamp:wt}=frameData;this.history.push({...yt,timestamp:wt});const{onStart:Ct,onMove:Pt}=this.handlers;ut||(Ct&&Ct(this.lastMoveEvent,at),this.startEvent=this.lastMoveEvent),Pt&&Pt(this.lastMoveEvent,at)},this.handlePointerMove=(at,ut)=>{this.lastMoveEvent=at,this.lastMoveEventInfo=transformPoint(ut,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(at,ut)=>{this.end();const{onEnd:ht,onSessionEnd:yt,resumeAnimation:wt}=this.handlers;if(this.dragSnapToOrigin&&wt&&wt(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const Ct=getPanInfo(at.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(ut,this.transformPagePoint),this.history);this.startEvent&&ht&&ht(at,Ct),yt&&yt(at,Ct)},!isPrimaryPointer(_))return;this.dragSnapToOrigin=tt,this.handlers=$,this.transformPagePoint=j,this.contextWindow=et||window;const rt=extractEventInfo(_),nt=transformPoint(rt,this.transformPagePoint),{point:it}=nt,{timestamp:st}=frameData;this.history=[{...it,timestamp:st}];const{onSessionStart:ot}=$;ot&&ot(_,getPanInfo(nt,this.history)),this.removeListeners=pipe$1(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(_){this.handlers=_}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(a,_){return _?{point:_(a.point)}:a}function subtractPoint(a,_){return{x:a.x-_.x,y:a.y-_.y}}function getPanInfo({point:a},_){return{point:a,delta:subtractPoint(a,lastDevicePoint(_)),offset:subtractPoint(a,startDevicePoint(_)),velocity:getVelocity(_,.1)}}function startDevicePoint(a){return a[0]}function lastDevicePoint(a){return a[a.length-1]}function getVelocity(a,_){if(a.length<2)return{x:0,y:0};let $=a.length-1,j=null;const et=lastDevicePoint(a);for(;$>=0&&(j=a[$],!(et.timestamp-j.timestamp>secondsToMilliseconds$1(_)));)$--;if(!j)return{x:0,y:0};const tt=millisecondsToSeconds(et.timestamp-j.timestamp);if(tt===0)return{x:0,y:0};const rt={x:(et.x-j.x)/tt,y:(et.y-j.y)/tt};return rt.x===1/0&&(rt.x=0),rt.y===1/0&&(rt.y=0),rt}function calcLength(a){return a.max-a.min}function isNear(a,_=0,$=.01){return Math.abs(a-_)<=$}function calcAxisDelta(a,_,$,j=.5){a.origin=j,a.originPoint=mixNumber$1(_.min,_.max,a.origin),a.scale=calcLength($)/calcLength(_),(isNear(a.scale,1,1e-4)||isNaN(a.scale))&&(a.scale=1),a.translate=mixNumber$1($.min,$.max,a.origin)-a.originPoint,(isNear(a.translate)||isNaN(a.translate))&&(a.translate=0)}function calcBoxDelta(a,_,$,j){calcAxisDelta(a.x,_.x,$.x,j?j.originX:void 0),calcAxisDelta(a.y,_.y,$.y,j?j.originY:void 0)}function calcRelativeAxis(a,_,$){a.min=$.min+_.min,a.max=a.min+calcLength(_)}function calcRelativeBox(a,_,$){calcRelativeAxis(a.x,_.x,$.x),calcRelativeAxis(a.y,_.y,$.y)}function calcRelativeAxisPosition(a,_,$){a.min=_.min-$.min,a.max=a.min+calcLength(_)}function calcRelativePosition(a,_,$){calcRelativeAxisPosition(a.x,_.x,$.x),calcRelativeAxisPosition(a.y,_.y,$.y)}function applyConstraints(a,{min:_,max:$},j){return _!==void 0&&a<_?a=j?mixNumber$1(_,a,j.min):Math.max(a,_):$!==void 0&&a>$&&(a=j?mixNumber$1($,a,j.max):Math.min(a,$)),a}function calcRelativeAxisConstraints(a,_,$){return{min:_!==void 0?a.min+_:void 0,max:$!==void 0?a.max+$-(a.max-a.min):void 0}}function calcRelativeConstraints(a,{top:_,left:$,bottom:j,right:et}){return{x:calcRelativeAxisConstraints(a.x,$,et),y:calcRelativeAxisConstraints(a.y,_,j)}}function calcViewportAxisConstraints(a,_){let $=_.min-a.min,j=_.max-a.max;return _.max-_.minj?$=progress(_.min,_.max-j,a.min):j>et&&($=progress(a.min,a.max-et,_.min)),clamp(0,1,$)}function rebaseAxisConstraints(a,_){const $={};return _.min!==void 0&&($.min=_.min-a.min),_.max!==void 0&&($.max=_.max-a.min),$}const defaultElastic=.35;function resolveDragElastic(a=defaultElastic){return a===!1?a=0:a===!0&&(a=defaultElastic),{x:resolveAxisElastic(a,"left","right"),y:resolveAxisElastic(a,"top","bottom")}}function resolveAxisElastic(a,_,$){return{min:resolvePointElastic(a,_),max:resolvePointElastic(a,$)}}function resolvePointElastic(a,_){return typeof a=="number"?a:a[_]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(a){return[a("x"),a("y")]}function convertBoundingBoxToBox({top:a,left:_,right:$,bottom:j}){return{x:{min:_,max:$},y:{min:a,max:j}}}function convertBoxToBoundingBox({x:a,y:_}){return{top:_.min,right:a.max,bottom:_.max,left:a.min}}function transformBoxPoints(a,_){if(!_)return a;const $=_({x:a.left,y:a.top}),j=_({x:a.right,y:a.bottom});return{top:$.y,left:$.x,bottom:j.y,right:j.x}}function isIdentityScale(a){return a===void 0||a===1}function hasScale({scale:a,scaleX:_,scaleY:$}){return!isIdentityScale(a)||!isIdentityScale(_)||!isIdentityScale($)}function hasTransform(a){return hasScale(a)||has2DTranslate(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function has2DTranslate(a){return is2DTranslate(a.x)||is2DTranslate(a.y)}function is2DTranslate(a){return a&&a!=="0%"}function scalePoint(a,_,$){const j=a-$,et=_*j;return $+et}function applyPointDelta(a,_,$,j,et){return et!==void 0&&(a=scalePoint(a,et,j)),scalePoint(a,$,j)+_}function applyAxisDelta(a,_=0,$=1,j,et){a.min=applyPointDelta(a.min,_,$,j,et),a.max=applyPointDelta(a.max,_,$,j,et)}function applyBoxDelta(a,{x:_,y:$}){applyAxisDelta(a.x,_.translate,_.scale,_.originPoint),applyAxisDelta(a.y,$.translate,$.scale,$.originPoint)}function applyTreeDeltas(a,_,$,j=!1){const et=$.length;if(!et)return;_.x=_.y=1;let tt,rt;for(let nt=0;nt1.0000000000001||a<.999999999999?a:1}function translateAxis(a,_){a.min=a.min+_,a.max=a.max+_}function transformAxis(a,_,[$,j,et]){const tt=_[et]!==void 0?_[et]:.5,rt=mixNumber$1(a.min,a.max,tt);applyAxisDelta(a,_[$],_[j],rt,_.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(a,_){transformAxis(a.x,_,xKeys$1),transformAxis(a.y,_,yKeys$1)}function measureViewportBox(a,_){return convertBoundingBoxToBox(transformBoxPoints(a.getBoundingClientRect(),_))}function measurePageBox(a,_,$){const j=measureViewportBox(a,$),{scroll:et}=_;return et&&(translateAxis(j.x,et.offset.x),translateAxis(j.y,et.offset.y)),j}const getContextWindow=({current:a})=>a?a.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(_){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=_}start(_,{snapToCursor:$=!1}={}){const{presenceContext:j}=this.visualElement;if(j&&j.isPresent===!1)return;const et=ot=>{const{dragSnapToOrigin:at}=this.getProps();at?this.pauseAnimation():this.stopAnimation(),$&&this.snapToCursor(extractEventInfo(ot,"page").point)},tt=(ot,at)=>{const{drag:ut,dragPropagation:ht,onDragStart:yt}=this.getProps();if(ut&&!ht&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(ut),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(Ct=>{let Pt=this.getAxisMotionValue(Ct).get()||0;if(percent.test(Pt)){const{projection:$t}=this.visualElement;if($t&&$t.layout){const Mt=$t.layout.layoutBox[Ct];Mt&&(Pt=calcLength(Mt)*(parseFloat(Pt)/100))}}this.originPoint[Ct]=Pt}),yt&&frame.postRender(()=>yt(ot,at));const{animationState:wt}=this.visualElement;wt&&wt.setActive("whileDrag",!0)},rt=(ot,at)=>{const{dragPropagation:ut,dragDirectionLock:ht,onDirectionLock:yt,onDrag:wt}=this.getProps();if(!ut&&!this.openGlobalLock)return;const{offset:Ct}=at;if(ht&&this.currentDirection===null){this.currentDirection=getCurrentDirection(Ct),this.currentDirection!==null&&yt&&yt(this.currentDirection);return}this.updateAxis("x",at.point,Ct),this.updateAxis("y",at.point,Ct),this.visualElement.render(),wt&&wt(ot,at)},nt=(ot,at)=>this.stop(ot,at),it=()=>eachAxis(ot=>{var at;return this.getAnimationState(ot)==="paused"&&((at=this.getAxisMotionValue(ot).animation)===null||at===void 0?void 0:at.play())}),{dragSnapToOrigin:st}=this.getProps();this.panSession=new PanSession(_,{onSessionStart:et,onStart:tt,onMove:rt,onSessionEnd:nt,resumeAnimation:it},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:st,contextWindow:getContextWindow(this.visualElement)})}stop(_,$){const j=this.isDragging;if(this.cancel(),!j)return;const{velocity:et}=$;this.startAnimation(et);const{onDragEnd:tt}=this.getProps();tt&&frame.postRender(()=>tt(_,$))}cancel(){this.isDragging=!1;const{projection:_,animationState:$}=this.visualElement;_&&(_.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:j}=this.getProps();!j&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),$&&$.setActive("whileDrag",!1)}updateAxis(_,$,j){const{drag:et}=this.getProps();if(!j||!shouldDrag(_,et,this.currentDirection))return;const tt=this.getAxisMotionValue(_);let rt=this.originPoint[_]+j[_];this.constraints&&this.constraints[_]&&(rt=applyConstraints(rt,this.constraints[_],this.elastic[_])),tt.set(rt)}resolveConstraints(){var _;const{dragConstraints:$,dragElastic:j}=this.getProps(),et=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(_=this.visualElement.projection)===null||_===void 0?void 0:_.layout,tt=this.constraints;$&&isRefObject$2($)?this.constraints||(this.constraints=this.resolveRefConstraints()):$&&et?this.constraints=calcRelativeConstraints(et.layoutBox,$):this.constraints=!1,this.elastic=resolveDragElastic(j),tt!==this.constraints&&et&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(rt=>{this.constraints!==!1&&this.getAxisMotionValue(rt)&&(this.constraints[rt]=rebaseAxisConstraints(et.layoutBox[rt],this.constraints[rt]))})}resolveRefConstraints(){const{dragConstraints:_,onMeasureDragConstraints:$}=this.getProps();if(!_||!isRefObject$2(_))return!1;const j=_.current,{projection:et}=this.visualElement;if(!et||!et.layout)return!1;const tt=measurePageBox(j,et.root,this.visualElement.getTransformPagePoint());let rt=calcViewportConstraints(et.layout.layoutBox,tt);if($){const nt=$(convertBoxToBoundingBox(rt));this.hasMutatedConstraints=!!nt,nt&&(rt=convertBoundingBoxToBox(nt))}return rt}startAnimation(_){const{drag:$,dragMomentum:j,dragElastic:et,dragTransition:tt,dragSnapToOrigin:rt,onDragTransitionEnd:nt}=this.getProps(),it=this.constraints||{},st=eachAxis(ot=>{if(!shouldDrag(ot,$,this.currentDirection))return;let at=it&&it[ot]||{};rt&&(at={min:0,max:0});const ut=et?200:1e6,ht=et?40:1e7,yt={type:"inertia",velocity:j?_[ot]:0,bounceStiffness:ut,bounceDamping:ht,timeConstant:750,restDelta:1,restSpeed:10,...tt,...at};return this.startAxisValueAnimation(ot,yt)});return Promise.all(st).then(nt)}startAxisValueAnimation(_,$){const j=this.getAxisMotionValue(_);return j.start(animateMotionValue(_,j,0,$,this.visualElement))}stopAnimation(){eachAxis(_=>this.getAxisMotionValue(_).stop())}pauseAnimation(){eachAxis(_=>{var $;return($=this.getAxisMotionValue(_).animation)===null||$===void 0?void 0:$.pause()})}getAnimationState(_){var $;return($=this.getAxisMotionValue(_).animation)===null||$===void 0?void 0:$.state}getAxisMotionValue(_){const $=`_drag${_.toUpperCase()}`,j=this.visualElement.getProps(),et=j[$];return et||this.visualElement.getValue(_,(j.initial?j.initial[_]:void 0)||0)}snapToCursor(_){eachAxis($=>{const{drag:j}=this.getProps();if(!shouldDrag($,j,this.currentDirection))return;const{projection:et}=this.visualElement,tt=this.getAxisMotionValue($);if(et&&et.layout){const{min:rt,max:nt}=et.layout.layoutBox[$];tt.set(_[$]-mixNumber$1(rt,nt,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:_,dragConstraints:$}=this.getProps(),{projection:j}=this.visualElement;if(!isRefObject$2($)||!j||!this.constraints)return;this.stopAnimation();const et={x:0,y:0};eachAxis(rt=>{const nt=this.getAxisMotionValue(rt);if(nt&&this.constraints!==!1){const it=nt.get();et[rt]=calcOrigin({min:it,max:it},this.constraints[rt])}});const{transformTemplate:tt}=this.visualElement.getProps();this.visualElement.current.style.transform=tt?tt({},""):"none",j.root&&j.root.updateScroll(),j.updateLayout(),this.resolveConstraints(),eachAxis(rt=>{if(!shouldDrag(rt,_,null))return;const nt=this.getAxisMotionValue(rt),{min:it,max:st}=this.constraints[rt];nt.set(mixNumber$1(it,st,et[rt]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const _=this.visualElement.current,$=addPointerEvent(_,"pointerdown",it=>{const{drag:st,dragListener:ot=!0}=this.getProps();st&&ot&&this.start(it)}),j=()=>{const{dragConstraints:it}=this.getProps();isRefObject$2(it)&&(this.constraints=this.resolveRefConstraints())},{projection:et}=this.visualElement,tt=et.addEventListener("measure",j);et&&!et.layout&&(et.root&&et.root.updateScroll(),et.updateLayout()),j();const rt=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),nt=et.addEventListener("didUpdate",({delta:it,hasLayoutChanged:st})=>{this.isDragging&&st&&(eachAxis(ot=>{const at=this.getAxisMotionValue(ot);at&&(this.originPoint[ot]+=it[ot].translate,at.set(at.get()+it[ot].translate))}),this.visualElement.render())});return()=>{rt(),$(),tt(),nt&&nt()}}getProps(){const _=this.visualElement.getProps(),{drag:$=!1,dragDirectionLock:j=!1,dragPropagation:et=!1,dragConstraints:tt=!1,dragElastic:rt=defaultElastic,dragMomentum:nt=!0}=_;return{..._,drag:$,dragDirectionLock:j,dragPropagation:et,dragConstraints:tt,dragElastic:rt,dragMomentum:nt}}}function shouldDrag(a,_,$){return(_===!0||_===a)&&($===null||$===a)}function getCurrentDirection(a,_=10){let $=null;return Math.abs(a.y)>_?$="y":Math.abs(a.x)>_&&($="x"),$}class DragGesture extends Feature{constructor(_){super(_),this.removeGroupControls=noop$b,this.removeListeners=noop$b,this.controls=new VisualElementDragControls(_)}mount(){const{dragControls:_}=this.node.getProps();_&&(this.removeGroupControls=_.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$b}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=a=>(_,$)=>{a&&frame.postRender(()=>a(_,$))};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$b}onPointerDown(_){this.session=new PanSession(_,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:_,onPanStart:$,onPan:j,onPanEnd:et}=this.node.getProps();return{onSessionStart:asyncHandler(_),onStart:asyncHandler($),onMove:j,onEnd:(tt,rt)=>{delete this.session,et&&frame.postRender(()=>et(tt,rt))}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",_=>this.onPointerDown(_))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const a=reactExports.useContext(PresenceContext);if(a===null)return[!0,null];const{isPresent:_,onExitComplete:$,register:j}=a,et=reactExports.useId();return reactExports.useEffect(()=>j(et),[]),!_&&$?[!1,()=>$&&$(et)]:[!0]}function useIsPresent(){return isPresent(reactExports.useContext(PresenceContext))}function isPresent(a){return a===null?!0:a.isPresent}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(a,_){return _.max===_.min?0:a/(_.max-_.min)*100}const correctBorderRadius={correct:(a,_)=>{if(!_.target)return a;if(typeof a=="string")if(px.test(a))a=parseFloat(a);else return a;const $=pixelsToPercent(a,_.target.x),j=pixelsToPercent(a,_.target.y);return`${$}% ${j}%`}},correctBoxShadow={correct:(a,{treeScale:_,projectionDelta:$})=>{const j=a,et=complex.parse(a);if(et.length>5)return j;const tt=complex.createTransformer(a),rt=typeof et[0]!="number"?1:0,nt=$.x.scale*_.x,it=$.y.scale*_.y;et[0+rt]/=nt,et[1+rt]/=it;const st=mixNumber$1(nt,it,.5);return typeof et[2+rt]=="number"&&(et[2+rt]/=st),typeof et[3+rt]=="number"&&(et[3+rt]/=st),tt(et)}};class MeasureLayoutWithContext extends reactExports.Component{componentDidMount(){const{visualElement:_,layoutGroup:$,switchLayoutGroup:j,layoutId:et}=this.props,{projection:tt}=_;addScaleCorrector(defaultScaleCorrectors),tt&&($.group&&$.group.add(tt),j&&j.register&&et&&j.register(tt),tt.root.didUpdate(),tt.addEventListener("animationComplete",()=>{this.safeToRemove()}),tt.setOptions({...tt.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(_){const{layoutDependency:$,visualElement:j,drag:et,isPresent:tt}=this.props,rt=j.projection;return rt&&(rt.isPresent=tt,et||_.layoutDependency!==$||$===void 0?rt.willUpdate():this.safeToRemove(),_.isPresent!==tt&&(tt?rt.promote():rt.relegate()||frame.postRender(()=>{const nt=rt.getStack();(!nt||!nt.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:_}=this.props.visualElement;_&&(_.root.didUpdate(),microtask.postRender(()=>{!_.currentAnimation&&_.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:_,layoutGroup:$,switchLayoutGroup:j}=this.props,{projection:et}=_;et&&(et.scheduleCheckAfterUnmount(),$&&$.group&&$.group.remove(et),j&&j.deregister&&j.deregister(et))}safeToRemove(){const{safeToRemove:_}=this.props;_&&_()}render(){return null}}function MeasureLayout(a){const[_,$]=usePresence(),j=reactExports.useContext(LayoutGroupContext);return jsxRuntimeExports.jsx(MeasureLayoutWithContext,{...a,layoutGroup:j,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:_,safeToRemove:$})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=a=>typeof a=="string"?parseFloat(a):a,isPx=a=>typeof a=="number"||px.test(a);function mixValues(a,_,$,j,et,tt){et?(a.opacity=mixNumber$1(0,$.opacity!==void 0?$.opacity:1,easeCrossfadeIn(j)),a.opacityExit=mixNumber$1(_.opacity!==void 0?_.opacity:1,0,easeCrossfadeOut(j))):tt&&(a.opacity=mixNumber$1(_.opacity!==void 0?_.opacity:1,$.opacity!==void 0?$.opacity:1,j));for(let rt=0;rtj_?1:$(progress(a,_,j))}function copyAxisInto(a,_){a.min=_.min,a.max=_.max}function copyBoxInto(a,_){copyAxisInto(a.x,_.x),copyAxisInto(a.y,_.y)}function removePointDelta(a,_,$,j,et){return a-=_,a=scalePoint(a,1/$,j),et!==void 0&&(a=scalePoint(a,1/et,j)),a}function removeAxisDelta(a,_=0,$=1,j=.5,et,tt=a,rt=a){if(percent.test(_)&&(_=parseFloat(_),_=mixNumber$1(rt.min,rt.max,_/100)-rt.min),typeof _!="number")return;let nt=mixNumber$1(tt.min,tt.max,j);a===tt&&(nt-=_),a.min=removePointDelta(a.min,_,$,nt,et),a.max=removePointDelta(a.max,_,$,nt,et)}function removeAxisTransforms(a,_,[$,j,et],tt,rt){removeAxisDelta(a,_[$],_[j],_[et],_.scale,tt,rt)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(a,_,$,j){removeAxisTransforms(a.x,_,xKeys,$?$.x:void 0,j?j.x:void 0),removeAxisTransforms(a.y,_,yKeys,$?$.y:void 0,j?j.y:void 0)}function isAxisDeltaZero(a){return a.translate===0&&a.scale===1}function isDeltaZero(a){return isAxisDeltaZero(a.x)&&isAxisDeltaZero(a.y)}function boxEquals(a,_){return a.x.min===_.x.min&&a.x.max===_.x.max&&a.y.min===_.y.min&&a.y.max===_.y.max}function boxEqualsRounded(a,_){return Math.round(a.x.min)===Math.round(_.x.min)&&Math.round(a.x.max)===Math.round(_.x.max)&&Math.round(a.y.min)===Math.round(_.y.min)&&Math.round(a.y.max)===Math.round(_.y.max)}function aspectRatio(a){return calcLength(a.x)/calcLength(a.y)}class NodeStack{constructor(){this.members=[]}add(_){addUniqueItem(this.members,_),_.scheduleRender()}remove(_){if(removeItem(this.members,_),_===this.prevLead&&(this.prevLead=void 0),_===this.lead){const $=this.members[this.members.length-1];$&&this.promote($)}}relegate(_){const $=this.members.findIndex(et=>_===et);if($===0)return!1;let j;for(let et=$;et>=0;et--){const tt=this.members[et];if(tt.isPresent!==!1){j=tt;break}}return j?(this.promote(j),!0):!1}promote(_,$){const j=this.lead;if(_!==j&&(this.prevLead=j,this.lead=_,_.show(),j)){j.instance&&j.scheduleRender(),_.scheduleRender(),_.resumeFrom=j,$&&(_.resumeFrom.preserveOpacity=!0),j.snapshot&&(_.snapshot=j.snapshot,_.snapshot.latestValues=j.animationValues||j.latestValues),_.root&&_.root.isUpdating&&(_.isLayoutDirty=!0);const{crossfade:et}=_.options;et===!1&&j.hide()}}exitAnimationComplete(){this.members.forEach(_=>{const{options:$,resumingFrom:j}=_;$.onExitComplete&&$.onExitComplete(),j&&j.options.onExitComplete&&j.options.onExitComplete()})}scheduleRender(){this.members.forEach(_=>{_.instance&&_.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(a,_,$){let j="";const et=a.x.translate/_.x,tt=a.y.translate/_.y,rt=($==null?void 0:$.z)||0;if((et||tt||rt)&&(j=`translate3d(${et}px, ${tt}px, ${rt}px) `),(_.x!==1||_.y!==1)&&(j+=`scale(${1/_.x}, ${1/_.y}) `),$){const{transformPerspective:st,rotate:ot,rotateX:at,rotateY:ut,skewX:ht,skewY:yt}=$;st&&(j=`perspective(${st}px) ${j}`),ot&&(j+=`rotate(${ot}deg) `),at&&(j+=`rotateX(${at}deg) `),ut&&(j+=`rotateY(${ut}deg) `),ht&&(j+=`skewX(${ht}deg) `),yt&&(j+=`skewY(${yt}deg) `)}const nt=a.x.scale*_.x,it=a.y.scale*_.y;return(nt!==1||it!==1)&&(j+=`scale(${nt}, ${it})`),j||"none"}const compareByDepth=(a,_)=>a.depth-_.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(_){addUniqueItem(this.children,_),this.isDirty=!0}remove(_){removeItem(this.children,_),this.isDirty=!0}forEach(_){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(_)}}function delay(a,_){const $=time.now(),j=({timestamp:et})=>{const tt=et-$;tt>=_&&(cancelFrame(j),a(tt-_))};return frame.read(j,!0),()=>cancelFrame(j)}function record(a){window.MotionDebug&&window.MotionDebug.record(a)}function isSVGElement(a){return a instanceof SVGElement&&a.tagName!=="svg"}function animateSingleValue(a,_,$){const j=isMotionValue(a)?a:motionValue(a);return j.start(animateMotionValue("",j,_,$)),j.animation}const transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id$1=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function resetDistortingTransform(a,_,$,j){const{latestValues:et}=_;et[a]&&($[a]=et[a],_.setStaticValue(a,0),j&&(j[a]=0))}function createProjectionNode({attachResizeListener:a,defaultParent:_,measureScroll:$,checkIsScrollRoot:j,resetTransform:et}){return class{constructor(rt={},nt=_==null?void 0:_()){this.id=id$1++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=rt,this.root=nt?nt.root||nt:this,this.path=nt?[...nt.path,nt]:[],this.parent=nt,this.depth=nt?nt.depth+1:0;for(let it=0;itthis.root.updateBlockedByResize=!1;a(rt,()=>{this.root.updateBlockedByResize=!0,at&&at(),at=delay(ut,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}it&&this.root.registerSharedNode(it,this),this.options.animate!==!1&&ot&&(it||st)&&this.addEventListener("didUpdate",({delta:at,hasLayoutChanged:ut,hasRelativeTargetChanged:ht,layout:yt})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const wt=this.options.transition||ot.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:Ct,onLayoutAnimationComplete:Pt}=ot.getProps(),$t=!this.targetLayout||!boxEqualsRounded(this.targetLayout,yt)||ht,Mt=!ut&&ht;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||Mt||ut&&($t||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(at,Mt);const Bt={...getValueTransition(wt,"layout"),onPlay:Ct,onComplete:Pt};(ot.shouldReduceMotion||this.options.layoutRoot)&&(Bt.delay=0,Bt.type=!1),this.startAnimation(Bt)}else ut||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=yt})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const rt=this.getStack();rt&&rt.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:rt}=this.options;return rt&&rt.getProps().transformTemplate}willUpdate(rt=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let ot=0;otthis.update()))}clearAllSnapshots(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let it=0;it{const Dt=Bt/1e3;mixAxisDelta(at.x,rt.x,Dt),mixAxisDelta(at.y,rt.y,Dt),this.setTargetDelta(at),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(ut,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,ut,Dt),Mt&&boxEquals(this.relativeTarget,Mt)&&(this.isProjectionDirty=!1),Mt||(Mt=createBox()),copyBoxInto(Mt,this.relativeTarget)),wt&&(this.animationValues=ot,mixValues(ot,st,this.latestValues,Dt,$t,Pt)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=Dt},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(rt){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...rt,onUpdate:nt=>{this.mixTargetDelta(nt),rt.onUpdate&&rt.onUpdate(nt)},onComplete:()=>{rt.onComplete&&rt.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const rt=this.getStack();rt&&rt.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const rt=this.getLead();let{targetWithTransforms:nt,target:it,layout:st,latestValues:ot}=rt;if(!(!nt||!it||!st)){if(this!==rt&&this.layout&&st&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,st.layoutBox)){it=this.target||createBox();const at=calcLength(this.layout.layoutBox.x);it.x.min=rt.target.x.min,it.x.max=it.x.min+at;const ut=calcLength(this.layout.layoutBox.y);it.y.min=rt.target.y.min,it.y.max=it.y.min+ut}copyBoxInto(nt,it),transformBox(nt,ot),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,nt,ot)}}registerSharedNode(rt,nt){this.sharedNodes.has(rt)||this.sharedNodes.set(rt,new NodeStack),this.sharedNodes.get(rt).add(nt);const st=nt.options.initialPromotionConfig;nt.promote({transition:st?st.transition:void 0,preserveFollowOpacity:st&&st.shouldPreserveFollowOpacity?st.shouldPreserveFollowOpacity(nt):void 0})}isLead(){const rt=this.getStack();return rt?rt.lead===this:!0}getLead(){var rt;const{layoutId:nt}=this.options;return nt?((rt=this.getStack())===null||rt===void 0?void 0:rt.lead)||this:this}getPrevLead(){var rt;const{layoutId:nt}=this.options;return nt?(rt=this.getStack())===null||rt===void 0?void 0:rt.prevLead:void 0}getStack(){const{layoutId:rt}=this.options;if(rt)return this.root.sharedNodes.get(rt)}promote({needsReset:rt,transition:nt,preserveFollowOpacity:it}={}){const st=this.getStack();st&&st.promote(this,it),rt&&(this.projectionDelta=void 0,this.needsReset=!0),nt&&this.setOptions({transition:nt})}relegate(){const rt=this.getStack();return rt?rt.relegate(this):!1}resetSkewAndRotation(){const{visualElement:rt}=this.options;if(!rt)return;let nt=!1;const{latestValues:it}=rt;if((it.z||it.rotate||it.rotateX||it.rotateY||it.rotateZ||it.skewX||it.skewY)&&(nt=!0),!nt)return;const st={};it.z&&resetDistortingTransform("z",rt,st,this.animationValues);for(let ot=0;ot{var nt;return(nt=rt.currentAnimation)===null||nt===void 0?void 0:nt.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(a){a.updateLayout()}function notifyLayoutUpdate(a){var _;const $=((_=a.resumeFrom)===null||_===void 0?void 0:_.snapshot)||a.snapshot;if(a.isLead()&&a.layout&&$&&a.hasListeners("didUpdate")){const{layoutBox:j,measuredBox:et}=a.layout,{animationType:tt}=a.options,rt=$.source!==a.layout.source;tt==="size"?eachAxis(at=>{const ut=rt?$.measuredBox[at]:$.layoutBox[at],ht=calcLength(ut);ut.min=j[at].min,ut.max=ut.min+ht}):shouldAnimatePositionOnly(tt,$.layoutBox,j)&&eachAxis(at=>{const ut=rt?$.measuredBox[at]:$.layoutBox[at],ht=calcLength(j[at]);ut.max=ut.min+ht,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[at].max=a.relativeTarget[at].min+ht)});const nt=createDelta();calcBoxDelta(nt,j,$.layoutBox);const it=createDelta();rt?calcBoxDelta(it,a.applyTransform(et,!0),$.measuredBox):calcBoxDelta(it,j,$.layoutBox);const st=!isDeltaZero(nt);let ot=!1;if(!a.resumeFrom){const at=a.getClosestProjectingParent();if(at&&!at.resumeFrom){const{snapshot:ut,layout:ht}=at;if(ut&&ht){const yt=createBox();calcRelativePosition(yt,$.layoutBox,ut.layoutBox);const wt=createBox();calcRelativePosition(wt,j,ht.layoutBox),boxEqualsRounded(yt,wt)||(ot=!0),at.options.layoutRoot&&(a.relativeTarget=wt,a.relativeTargetOrigin=yt,a.relativeParent=at)}}}a.notifyListeners("didUpdate",{layout:j,snapshot:$,delta:it,layoutDelta:nt,hasLayoutChanged:st,hasRelativeTargetChanged:ot})}else if(a.isLead()){const{onExitComplete:j}=a.options;j&&j()}a.options.transition=void 0}function propagateDirtyNodes(a){projectionFrameData.totalNodes++,a.parent&&(a.isProjecting()||(a.isProjectionDirty=a.parent.isProjectionDirty),a.isSharedProjectionDirty||(a.isSharedProjectionDirty=!!(a.isProjectionDirty||a.parent.isProjectionDirty||a.parent.isSharedProjectionDirty)),a.isTransformDirty||(a.isTransformDirty=a.parent.isTransformDirty))}function cleanDirtyNodes(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function clearSnapshot(a){a.clearSnapshot()}function clearMeasurements(a){a.clearMeasurements()}function clearIsLayoutDirty(a){a.isLayoutDirty=!1}function resetTransformStyle(a){const{visualElement:_}=a.options;_&&_.getProps().onBeforeLayoutMeasure&&_.notify("BeforeLayoutMeasure"),a.resetTransform()}function finishAnimation(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function resolveTargetDelta(a){a.resolveTargetDelta()}function calcProjection(a){a.calcProjection()}function resetSkewAndRotation(a){a.resetSkewAndRotation()}function removeLeadSnapshots(a){a.removeLeadSnapshot()}function mixAxisDelta(a,_,$){a.translate=mixNumber$1(_.translate,0,$),a.scale=mixNumber$1(_.scale,1,$),a.origin=_.origin,a.originPoint=_.originPoint}function mixAxis(a,_,$,j){a.min=mixNumber$1(_.min,$.min,j),a.max=mixNumber$1(_.max,$.max,j)}function mixBox(a,_,$,j){mixAxis(a.x,_.x,$.x,j),mixAxis(a.y,_.y,$.y,j)}function hasOpacityCrossfade(a){return a.animationValues&&a.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=a=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$b;function roundAxis(a){a.min=roundPoint(a.min),a.max=roundPoint(a.max)}function roundBox(a){roundAxis(a.x),roundAxis(a.y)}function shouldAnimatePositionOnly(a,_,$){return a==="position"||a==="preserve-aspect"&&!isNear(aspectRatio(_),aspectRatio($),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(a,_)=>addDomEvent(a,"resize",_),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const a=new DocumentProjectionNode({});a.mount(window),a.setOptions({layoutScroll:!0}),rootProjectionNode.current=a}return rootProjectionNode.current},resetTransform:(a,_)=>{a.style.transform=_!==void 0?_:"none"},checkIsScrollRoot:a=>window.getComputedStyle(a).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser$1)if(window.matchMedia){const a=window.matchMedia("(prefers-reduced-motion)"),_=()=>prefersReducedMotion.current=a.matches;a.addListener(_),_()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(a,_,$){const{willChange:j}=_;for(const et in _){const tt=_[et],rt=$[et];if(isMotionValue(tt))a.addValue(et,tt),isWillChangeMotionValue(j)&&j.add(et);else if(isMotionValue(rt))a.addValue(et,motionValue(tt,{owner:a})),isWillChangeMotionValue(j)&&j.remove(et);else if(rt!==tt)if(a.hasValue(et)){const nt=a.getValue(et);nt.liveStyle===!0?nt.jump(tt):nt.hasAnimated||nt.set(tt)}else{const nt=a.getStaticValue(et);a.addValue(et,motionValue(nt!==void 0?nt:tt,{owner:a}))}}for(const et in $)_[et]===void 0&&a.removeValue(et);return _}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color$1,complex],findValueType=a=>valueTypes.find(testValueType(a)),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;function getClosestProjectingNode(a){if(a)return a.options.allowProjection!==!1?a.projection:getClosestProjectingNode(a.parent)}class VisualElement{scrapeMotionValuesFromProps(_,$,j){return{}}constructor({parent:_,props:$,presenceContext:j,reducedMotionConfig:et,blockInitialAnimation:tt,visualState:rt},nt={}){this.resolveKeyframes=(ut,ht,yt,wt)=>new this.KeyframeResolver(ut,ht,yt,wt,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>frame.render(this.render,!1,!0);const{latestValues:it,renderState:st}=rt;this.latestValues=it,this.baseTarget={...it},this.initialValues=$.initial?{...it}:{},this.renderState=st,this.parent=_,this.props=$,this.presenceContext=j,this.depth=_?_.depth+1:0,this.reducedMotionConfig=et,this.options=nt,this.blockInitialAnimation=!!tt,this.isControllingVariants=isControllingVariants($),this.isVariantNode=isVariantNode($),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(_&&_.current);const{willChange:ot,...at}=this.scrapeMotionValuesFromProps($,{},this);for(const ut in at){const ht=at[ut];it[ut]!==void 0&&isMotionValue(ht)&&(ht.set(it[ut],!1),isWillChangeMotionValue(ot)&&ot.add(ut))}}mount(_){this.current=_,visualElementStore.set(_,this),this.projection&&!this.projection.instance&&this.projection.mount(_),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(($,j)=>this.bindToMotionValue(j,$)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){var _;visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach($=>$()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const $ in this.events)this.events[$].clear();for(const $ in this.features)(_=this.features[$])===null||_===void 0||_.unmount();this.current=null}bindToMotionValue(_,$){const j=transformProps.has(_),et=$.on("change",rt=>{this.latestValues[_]=rt,this.props.onUpdate&&frame.preRender(this.notifyUpdate),j&&this.projection&&(this.projection.isTransformDirty=!0)}),tt=$.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(_,()=>{et(),tt(),$.owner&&$.stop()})}sortNodePosition(_){return!this.current||!this.sortInstanceNodePosition||this.type!==_.type?0:this.sortInstanceNodePosition(this.current,_.current)}loadFeatures({children:_,...$},j,et,tt){let rt,nt;for(let it=0;itthis.scheduleRender(),animationType:typeof st=="string"?st:"both",initialPromotionConfig:tt,layoutScroll:ut,layoutRoot:ht})}return nt}updateFeatures(){for(const _ in this.features){const $=this.features[_];$.isMounted?$.update():($.mount(),$.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(_){return this.latestValues[_]}setStaticValue(_,$){this.latestValues[_]=$}update(_,$){(_.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=_,this.prevPresenceContext=this.presenceContext,this.presenceContext=$;for(let j=0;j$.variantChildren.delete(_)}addValue(_,$){const j=this.values.get(_);$!==j&&(j&&this.removeValue(_),this.bindToMotionValue(_,$),this.values.set(_,$),this.latestValues[_]=$.get())}removeValue(_){this.values.delete(_);const $=this.valueSubscriptions.get(_);$&&($(),this.valueSubscriptions.delete(_)),delete this.latestValues[_],this.removeValueFromRenderState(_,this.renderState)}hasValue(_){return this.values.has(_)}getValue(_,$){if(this.props.values&&this.props.values[_])return this.props.values[_];let j=this.values.get(_);return j===void 0&&$!==void 0&&(j=motionValue($===null?void 0:$,{owner:this}),this.addValue(_,j)),j}readValue(_,$){var j;let et=this.latestValues[_]!==void 0||!this.current?this.latestValues[_]:(j=this.getBaseTargetFromProps(this.props,_))!==null&&j!==void 0?j:this.readValueFromInstance(this.current,_,this.options);return et!=null&&(typeof et=="string"&&(isNumericalString(et)||isZeroValueString(et))?et=parseFloat(et):!findValueType(et)&&complex.test($)&&(et=getAnimatableNone(_,$)),this.setBaseTarget(_,isMotionValue(et)?et.get():et)),isMotionValue(et)?et.get():et}setBaseTarget(_,$){this.baseTarget[_]=$}getBaseTarget(_){var $;const{initial:j}=this.props;let et;if(typeof j=="string"||typeof j=="object"){const rt=resolveVariantFromProps(this.props,j,($=this.presenceContext)===null||$===void 0?void 0:$.custom);rt&&(et=rt[_])}if(j&&et!==void 0)return et;const tt=this.getBaseTargetFromProps(this.props,_);return tt!==void 0&&!isMotionValue(tt)?tt:this.initialValues[_]!==void 0&&et===void 0?void 0:this.baseTarget[_]}on(_,$){return this.events[_]||(this.events[_]=new SubscriptionManager),this.events[_].add($)}notify(_,...$){this.events[_]&&this.events[_].notify(...$)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(_,$){return _.compareDocumentPosition($)&2?1:-1}getBaseTargetFromProps(_,$){return _.style?_.style[$]:void 0}removeValueFromRenderState(_,{vars:$,style:j}){delete $[_],delete j[_]}}function getComputedStyle$2(a){return window.getComputedStyle(a)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html"}readValueFromInstance(_,$){if(transformProps.has($)){const j=getDefaultValueType($);return j&&j.default||0}else{const j=getComputedStyle$2(_),et=(isCSSVariableName($)?j.getPropertyValue($):j[$])||0;return typeof et=="string"?et.trim():et}}measureInstanceViewportBox(_,{transformPagePoint:$}){return measureViewportBox(_,$)}build(_,$,j,et){buildHTMLStyles(_,$,j,et.transformTemplate)}scrapeMotionValuesFromProps(_,$,j){return scrapeMotionValuesFromProps$1(_,$,j)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:_}=this.props;isMotionValue(_)&&(this.childSubscription=_.on("change",$=>{this.current&&(this.current.textContent=`${$}`)}))}renderInstance(_,$,j,et){renderHTML(_,$,j,et)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(_,$){return _[$]}readValueFromInstance(_,$){if(transformProps.has($)){const j=getDefaultValueType($);return j&&j.default||0}return $=camelCaseAttributes.has($)?$:camelToDash($),_.getAttribute($)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(_,$,j){return scrapeMotionValuesFromProps(_,$,j)}build(_,$,j,et){buildSVGAttrs(_,$,j,this.isSVGTag,et.transformTemplate)}renderInstance(_,$,j,et){renderSVG(_,$,j,et)}mount(_){this.isSVGTag=isSVGTag(_.tagName),super.mount(_)}}const createDomVisualElement=(a,_)=>isSVGComponent(a)?new SVGVisualElement(_,{enableHardwareAcceleration:!1}):new HTMLVisualElement(_,{allowProjection:a!==reactExports.Fragment,enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations$1,...gestureAnimations,...drag,...layout},motion=createMotionProxy((a,_)=>createDomMotionConfig(a,_,preloadedFeatures,createDomVisualElement));function useIsMounted(){const a=reactExports.useRef(!1);return useIsomorphicLayoutEffect$2(()=>(a.current=!0,()=>{a.current=!1}),[]),a}function useForceUpdate(){const a=useIsMounted(),[_,$]=reactExports.useState(0),j=reactExports.useCallback(()=>{a.current&&$(_+1)},[_]);return[reactExports.useCallback(()=>frame.postRender(j),[j]),_]}class PopChildMeasure extends reactExports.Component{getSnapshotBeforeUpdate(_){const $=this.props.childRef.current;if($&&_.isPresent&&!this.props.isPresent){const j=this.props.sizeRef.current;j.height=$.offsetHeight||0,j.width=$.offsetWidth||0,j.top=$.offsetTop,j.left=$.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function PopChild({children:a,isPresent:_}){const $=reactExports.useId(),j=reactExports.useRef(null),et=reactExports.useRef({width:0,height:0,top:0,left:0}),{nonce:tt}=reactExports.useContext(MotionConfigContext);return reactExports.useInsertionEffect(()=>{const{width:rt,height:nt,top:it,left:st}=et.current;if(_||!j.current||!rt||!nt)return;j.current.dataset.motionPopId=$;const ot=document.createElement("style");return tt&&(ot.nonce=tt),document.head.appendChild(ot),ot.sheet&&ot.sheet.insertRule(` [data-motion-pop-id="${$}"] { position: absolute !important; width: ${rt}px !important; @@ -348,7 +348,7 @@ Error generating stack: `+tt.message+` left: ${st}px !important; } `),()=>{document.head.removeChild(ot)}},[_]),jsxRuntimeExports.jsx(PopChildMeasure,{isPresent:_,childRef:j,sizeRef:et,children:reactExports.cloneElement(a,{ref:j})})}const PresenceChild=({children:a,initial:_,isPresent:$,onExitComplete:j,custom:et,presenceAffectsLayout:tt,mode:rt})=>{const nt=useConstant(newChildrenMap),it=reactExports.useId(),st=reactExports.useMemo(()=>({id:it,initial:_,isPresent:$,custom:et,onExitComplete:ot=>{nt.set(ot,!0);for(const at of nt.values())if(!at)return;j&&j()},register:ot=>(nt.set(ot,!1),()=>nt.delete(ot))}),tt?[Math.random()]:[$]);return reactExports.useMemo(()=>{nt.forEach((ot,at)=>nt.set(at,!1))},[$]),reactExports.useEffect(()=>{!$&&!nt.size&&j&&j()},[$]),rt==="popLayout"&&(a=jsxRuntimeExports.jsx(PopChild,{isPresent:$,children:a})),jsxRuntimeExports.jsx(PresenceContext.Provider,{value:st,children:a})};function newChildrenMap(){return new Map}function useUnmountEffect(a){return reactExports.useEffect(()=>()=>a(),[])}const getChildKey=a=>a.key||"";function updateChildLookup(a,_){a.forEach($=>{const j=getChildKey($);_.set(j,$)})}function onlyElements(a){const _=[];return reactExports.Children.forEach(a,$=>{reactExports.isValidElement($)&&_.push($)}),_}const AnimatePresence=({children:a,custom:_,initial:$=!0,onExitComplete:j,exitBeforeEnter:et,presenceAffectsLayout:tt=!0,mode:rt="sync"})=>{const nt=reactExports.useContext(LayoutGroupContext).forceRender||useForceUpdate()[0],it=useIsMounted(),st=onlyElements(a);let ot=st;const at=reactExports.useRef(new Map).current,ut=reactExports.useRef(ot),ht=reactExports.useRef(new Map).current,yt=reactExports.useRef(!0);if(useIsomorphicLayoutEffect$2(()=>{yt.current=!1,updateChildLookup(st,ht),ut.current=ot}),useUnmountEffect(()=>{yt.current=!0,ht.clear(),at.clear()}),yt.current)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ot.map($t=>jsxRuntimeExports.jsx(PresenceChild,{isPresent:!0,initial:$?void 0:!1,presenceAffectsLayout:tt,mode:rt,children:$t},getChildKey($t)))});ot=[...ot];const wt=ut.current.map(getChildKey),Ct=st.map(getChildKey),Pt=wt.length;for(let $t=0;$t{if(Ct.indexOf(Mt)!==-1)return;const Bt=ht.get(Mt);if(!Bt)return;const Dt=wt.indexOf(Mt);let zt=$t;if(!zt){const Ot=()=>{at.delete(Mt);const It=Array.from(ht.keys()).filter(Lt=>!Ct.includes(Lt));if(It.forEach(Lt=>ht.delete(Lt)),ut.current=st.filter(Lt=>{const Ft=getChildKey(Lt);return Ft===Mt||It.includes(Ft)}),!at.size){if(it.current===!1)return;nt(),j&&j()}};zt=jsxRuntimeExports.jsx(PresenceChild,{isPresent:!1,onExitComplete:Ot,custom:_,presenceAffectsLayout:tt,mode:rt,children:Bt},getChildKey(Bt)),at.set(Mt,zt)}ot.splice(Dt,0,zt)}),ot=ot.map($t=>{const Mt=$t.key;return at.has(Mt)?$t:jsxRuntimeExports.jsx(PresenceChild,{isPresent:!0,presenceAffectsLayout:tt,mode:rt,children:$t},getChildKey($t))}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:at.size?ot:ot.map($t=>reactExports.cloneElement($t))})};var toastMotionVariants={initial:a=>{const{position:_}=a,$=["top","bottom"].includes(_)?"y":"x";let j=["top-right","bottom-right"].includes(_)?1:-1;return _==="bottom"&&(j=1),{opacity:0,[$]:j*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},ToastComponent=reactExports.memo(a=>{const{id:_,message:$,onCloseComplete:j,onRequestRemove:et,requestClose:tt=!1,position:rt="bottom",duration:nt=5e3,containerStyle:it,motionVariants:st=toastMotionVariants,toastSpacing:ot="0.5rem"}=a,[at,ut]=reactExports.useState(nt),ht=useIsPresent();useUpdateEffect(()=>{ht||j==null||j()},[ht]),useUpdateEffect(()=>{ut(nt)},[nt]);const yt=()=>ut(null),wt=()=>ut(nt),Ct=()=>{ht&&et()};reactExports.useEffect(()=>{ht&&tt&&et()},[ht,tt,et]),useTimeout(Ct,at);const Pt=reactExports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:ot,...it}),[it,ot]),$t=reactExports.useMemo(()=>getToastStyle(rt),[rt]);return jsxRuntimeExports.jsx(motion.div,{layout:!0,className:"chakra-toast",variants:st,initial:"initial",animate:"animate",exit:"exit",onHoverStart:yt,onHoverEnd:wt,custom:{position:rt},style:$t,children:jsxRuntimeExports.jsx(chakra.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:Pt,children:runIfFn$2($,{id:_,onClose:Ct})})})});ToastComponent.displayName="ToastComponent";function getToastPlacement(a,_){var $;const j=a??"bottom",tt={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[j];return($=tt==null?void 0:tt[_])!=null?$:j}var fallbackIcon={path:jsxRuntimeExports.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),jsxRuntimeExports.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Icon=forwardRef((a,_)=>{const{as:$,viewBox:j,color:et="currentColor",focusable:tt=!1,children:rt,className:nt,__css:it,...st}=a,ot=cx("chakra-icon",nt),at=useStyleConfig("Icon",a),ut={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:et,...it,...at},ht={ref:_,focusable:tt,className:ot,__css:ut},yt=j??fallbackIcon.viewBox;if($&&typeof $!="string")return jsxRuntimeExports.jsx(chakra.svg,{as:$,...ht,...st});const wt=rt??fallbackIcon.path;return jsxRuntimeExports.jsx(chakra.svg,{verticalAlign:"middle",viewBox:yt,...ht,...st,children:wt})});Icon.displayName="Icon";function createIcon(a){const{viewBox:_="0 0 24 24",d:$,displayName:j,defaultProps:et={}}=a,tt=reactExports.Children.toArray(a.path),rt=forwardRef((nt,it)=>jsxRuntimeExports.jsx(Icon,{ref:it,viewBox:_,...et,...nt,children:tt.length?tt:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:$})}));return rt.displayName=j,rt}function CheckIcon$3(a){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...a,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function InfoIcon(a){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...a,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function WarningIcon$1(a){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...a,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var spin=keyframes$1({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Spinner=forwardRef((a,_)=>{const $=useStyleConfig("Spinner",a),{label:j="Loading...",thickness:et="2px",speed:tt="0.45s",emptyColor:rt="transparent",className:nt,...it}=omitThemingProps(a),st=cx("chakra-spinner",nt),ot={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:et,borderBottomColor:rt,borderLeftColor:rt,animation:`${spin} ${tt} linear infinite`,...$};return jsxRuntimeExports.jsx(chakra.div,{ref:_,__css:ot,className:st,...it,children:j&&jsxRuntimeExports.jsx(chakra.span,{srOnly:!0,children:j})})});Spinner.displayName="Spinner";var[AlertProvider,useAlertContext]=createContext$1({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[AlertStylesProvider,useAlertStyles]=createContext$1({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),STATUSES={info:{icon:InfoIcon,colorScheme:"blue"},warning:{icon:WarningIcon$1,colorScheme:"orange"},success:{icon:CheckIcon$3,colorScheme:"green"},error:{icon:WarningIcon$1,colorScheme:"red"},loading:{icon:Spinner,colorScheme:"blue"}};function getStatusColorScheme(a){return STATUSES[a].colorScheme}function getStatusIcon(a){return STATUSES[a].icon}var AlertDescription=forwardRef(function(_,$){const j=useAlertStyles(),{status:et}=useAlertContext(),tt={display:"inline",...j.description};return jsxRuntimeExports.jsx(chakra.div,{ref:$,"data-status":et,..._,className:cx("chakra-alert__desc",_.className),__css:tt})});AlertDescription.displayName="AlertDescription";function AlertIcon(a){const{status:_}=useAlertContext(),$=getStatusIcon(_),j=useAlertStyles(),et=_==="loading"?j.spinner:j.icon;return jsxRuntimeExports.jsx(chakra.span,{display:"inherit","data-status":_,...a,className:cx("chakra-alert__icon",a.className),__css:et,children:a.children||jsxRuntimeExports.jsx($,{h:"100%",w:"100%"})})}AlertIcon.displayName="AlertIcon";var AlertTitle=forwardRef(function(_,$){const j=useAlertStyles(),{status:et}=useAlertContext();return jsxRuntimeExports.jsx(chakra.div,{ref:$,"data-status":et,..._,className:cx("chakra-alert__title",_.className),__css:j.title})});AlertTitle.displayName="AlertTitle";var Alert=forwardRef(function(_,$){var j;const{status:et="info",addRole:tt=!0,...rt}=omitThemingProps(_),nt=(j=_.colorScheme)!=null?j:getStatusColorScheme(et),it=useMultiStyleConfig("Alert",{..._,colorScheme:nt}),st={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...it.container};return jsxRuntimeExports.jsx(AlertProvider,{value:{status:et},children:jsxRuntimeExports.jsx(AlertStylesProvider,{value:it,children:jsxRuntimeExports.jsx(chakra.div,{"data-status":et,role:tt?"alert":void 0,ref:$,...rt,className:cx("chakra-alert",_.className),__css:st})})})});Alert.displayName="Alert";function CloseIcon(a){return jsxRuntimeExports.jsx(Icon,{focusable:"false","aria-hidden":!0,...a,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var CloseButton=forwardRef(function(_,$){const j=useStyleConfig("CloseButton",_),{children:et,isDisabled:tt,__css:rt,...nt}=omitThemingProps(_),it={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return jsxRuntimeExports.jsx(chakra.button,{type:"button","aria-label":"Close",ref:$,disabled:tt,__css:{...it,...j,...rt},...nt,children:et||jsxRuntimeExports.jsx(CloseIcon,{width:"1em",height:"1em"})})});CloseButton.displayName="CloseButton";var initialState$b={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},toastStore=createStore$1(initialState$b);function createStore$1(a){let _=a;const $=new Set,j=et=>{_=et(_),$.forEach(tt=>tt())};return{getState:()=>_,subscribe:et=>($.add(et),()=>{j(()=>a),$.delete(et)}),removeToast:(et,tt)=>{j(rt=>({...rt,[tt]:rt[tt].filter(nt=>nt.id!=et)}))},notify:(et,tt)=>{const rt=createToast(et,tt),{position:nt,id:it}=rt;return j(st=>{var ot,at;const ht=nt.includes("top")?[rt,...(ot=st[nt])!=null?ot:[]]:[...(at=st[nt])!=null?at:[],rt];return{...st,[nt]:ht}}),it},update:(et,tt)=>{et&&j(rt=>{const nt={...rt},{position:it,index:st}=findToast(nt,et);return it&&st!==-1&&(nt[it][st]={...nt[it][st],...tt,message:createRenderToast(tt)}),nt})},closeAll:({positions:et}={})=>{j(tt=>(et??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((it,st)=>(it[st]=tt[st].map(ot=>({...ot,requestClose:!0})),it),{...tt}))},close:et=>{j(tt=>{const rt=getToastPosition(tt,et);return rt?{...tt,[rt]:tt[rt].map(nt=>nt.id==et?{...nt,requestClose:!0}:nt)}:tt})},isActive:et=>!!findToast(toastStore.getState(),et).position}}var counter=0;function createToast(a,_={}){var $,j;counter+=1;const et=($=_.id)!=null?$:counter,tt=(j=_.position)!=null?j:"bottom";return{id:et,message:a,position:tt,duration:_.duration,onCloseComplete:_.onCloseComplete,onRequestRemove:()=>toastStore.removeToast(String(et),tt),status:_.status,requestClose:!1,containerStyle:_.containerStyle}}var Toast=a=>{const{status:_,variant:$="solid",id:j,title:et,isClosable:tt,onClose:rt,description:nt,colorScheme:it,icon:st}=a,ot=j?{root:`toast-${j}`,title:`toast-${j}-title`,description:`toast-${j}-description`}:void 0;return jsxRuntimeExports.jsxs(Alert,{addRole:!1,status:_,variant:$,id:ot==null?void 0:ot.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:it,children:[jsxRuntimeExports.jsx(AlertIcon,{children:st}),jsxRuntimeExports.jsxs(chakra.div,{flex:"1",maxWidth:"100%",children:[et&&jsxRuntimeExports.jsx(AlertTitle,{id:ot==null?void 0:ot.title,children:et}),nt&&jsxRuntimeExports.jsx(AlertDescription,{id:ot==null?void 0:ot.description,display:"block",children:nt})]}),tt&&jsxRuntimeExports.jsx(CloseButton,{size:"sm",onClick:rt,position:"absolute",insetEnd:1,top:1})]})};function createRenderToast(a={}){const{render:_,toastComponent:$=Toast}=a;return et=>typeof _=="function"?_({...et,...a}):jsxRuntimeExports.jsx($,{...et,...a})}function createToastFn(a,_){const $=et=>{var tt;return{..._,...et,position:getToastPlacement((tt=et==null?void 0:et.position)!=null?tt:_==null?void 0:_.position,a)}},j=et=>{const tt=$(et),rt=createRenderToast(tt);return toastStore.notify(rt,tt)};return j.update=(et,tt)=>{toastStore.update(et,$(tt))},j.promise=(et,tt)=>{const rt=j({...tt.loading,status:"loading",duration:null});et.then(nt=>j.update(rt,{status:"success",duration:5e3,...runIfFn$2(tt.success,nt)})).catch(nt=>j.update(rt,{status:"error",duration:5e3,...runIfFn$2(tt.error,nt)}))},j.closeAll=toastStore.closeAll,j.close=toastStore.close,j.isActive=toastStore.isActive,j}var[ToastOptionProvider,useToastOptionContext]=createContext$1({name:"ToastOptionsContext",strict:!1}),ToastProvider=a=>{const _=reactExports.useSyncExternalStore(toastStore.subscribe,toastStore.getState,toastStore.getState),{motionVariants:$,component:j=ToastComponent,portalProps:et}=a,rt=Object.keys(_).map(nt=>{const it=_[nt];return jsxRuntimeExports.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${nt}`,id:`chakra-toast-manager-${nt}`,style:getToastListStyle(nt),children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:it.map(st=>jsxRuntimeExports.jsx(j,{motionVariants:$,...st},st.id))})},nt)});return jsxRuntimeExports.jsx(Portal,{...et,children:rt})};function useToast(a){const{theme:_}=useChakra(),$=useToastOptionContext();return reactExports.useMemo(()=>createToastFn(_.direction,{...$,...a}),[a,_.direction,$])}var createChakraProvider=a=>function({children:$,theme:j=a,toastOptions:et,...tt}){return jsxRuntimeExports.jsxs(ChakraProvider$1,{theme:j,...tt,children:[jsxRuntimeExports.jsx(ToastOptionProvider,{value:et==null?void 0:et.defaultOptions,children:$}),jsxRuntimeExports.jsx(ToastProvider,{...et})]})},ChakraProvider=createChakraProvider(theme$1),__defProp$8=Object.defineProperty,__defNormalProp$3=(a,_,$)=>_ in a?__defProp$8(a,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[_]=$,__publicField$3=(a,_,$)=>(__defNormalProp$3(a,typeof _!="symbol"?_+"":_,$),$);function sortNodes(a){return a.sort((_,$)=>{const j=_.compareDocumentPosition($);if(j&Node.DOCUMENT_POSITION_FOLLOWING||j&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(j&Node.DOCUMENT_POSITION_PRECEDING||j&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(j&Node.DOCUMENT_POSITION_DISCONNECTED||j&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var isElement$3=a=>typeof a=="object"&&"nodeType"in a&&a.nodeType===Node.ELEMENT_NODE;function getNextIndex(a,_,$){let j=a+1;return $&&j>=_&&(j=0),j}function getPrevIndex(a,_,$){let j=a-1;return $&&j<0&&(j=_),j}var useSafeLayoutEffect$1=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,cast=a=>a,DescendantsManager=class{constructor(){__publicField$3(this,"descendants",new Map),__publicField$3(this,"register",a=>{if(a!=null)return isElement$3(a)?this.registerNode(a):_=>{this.registerNode(_,a)}}),__publicField$3(this,"unregister",a=>{this.descendants.delete(a);const _=sortNodes(Array.from(this.descendants.keys()));this.assignIndex(_)}),__publicField$3(this,"destroy",()=>{this.descendants.clear()}),__publicField$3(this,"assignIndex",a=>{this.descendants.forEach(_=>{const $=a.indexOf(_.node);_.index=$,_.node.dataset.index=_.index.toString()})}),__publicField$3(this,"count",()=>this.descendants.size),__publicField$3(this,"enabledCount",()=>this.enabledValues().length),__publicField$3(this,"values",()=>Array.from(this.descendants.values()).sort((_,$)=>_.index-$.index)),__publicField$3(this,"enabledValues",()=>this.values().filter(a=>!a.disabled)),__publicField$3(this,"item",a=>{if(this.count()!==0)return this.values()[a]}),__publicField$3(this,"enabledItem",a=>{if(this.enabledCount()!==0)return this.enabledValues()[a]}),__publicField$3(this,"first",()=>this.item(0)),__publicField$3(this,"firstEnabled",()=>this.enabledItem(0)),__publicField$3(this,"last",()=>this.item(this.descendants.size-1)),__publicField$3(this,"lastEnabled",()=>{const a=this.enabledValues().length-1;return this.enabledItem(a)}),__publicField$3(this,"indexOf",a=>{var _,$;return a&&($=(_=this.descendants.get(a))==null?void 0:_.index)!=null?$:-1}),__publicField$3(this,"enabledIndexOf",a=>a==null?-1:this.enabledValues().findIndex(_=>_.node.isSameNode(a))),__publicField$3(this,"next",(a,_=!0)=>{const $=getNextIndex(a,this.count(),_);return this.item($)}),__publicField$3(this,"nextEnabled",(a,_=!0)=>{const $=this.item(a);if(!$)return;const j=this.enabledIndexOf($.node),et=getNextIndex(j,this.enabledCount(),_);return this.enabledItem(et)}),__publicField$3(this,"prev",(a,_=!0)=>{const $=getPrevIndex(a,this.count()-1,_);return this.item($)}),__publicField$3(this,"prevEnabled",(a,_=!0)=>{const $=this.item(a);if(!$)return;const j=this.enabledIndexOf($.node),et=getPrevIndex(j,this.enabledCount()-1,_);return this.enabledItem(et)}),__publicField$3(this,"registerNode",(a,_)=>{if(!a||this.descendants.has(a))return;const $=Array.from(this.descendants.keys()).concat(a),j=sortNodes($);_!=null&&_.disabled&&(_.disabled=!!_.disabled);const et={node:a,index:-1,..._};this.descendants.set(a,et),this.assignIndex(j)})}};function assignRef$1(a,_){if(a!=null){if(typeof a=="function"){a(_);return}try{a.current=_}catch{throw new Error(`Cannot assign value '${_}' to ref '${a}'`)}}}function mergeRefs(...a){return _=>{a.forEach($=>{assignRef$1($,_)})}}function useMergeRefs$1(...a){return reactExports.useMemo(()=>mergeRefs(...a),a)}function useDescendants(){const a=reactExports.useRef(new DescendantsManager);return useSafeLayoutEffect$1(()=>()=>a.current.destroy()),a.current}var[DescendantsContextProvider,useDescendantsContext]=createContext$1({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function useDescendant(a){const _=useDescendantsContext(),[$,j]=reactExports.useState(-1),et=reactExports.useRef(null);useSafeLayoutEffect$1(()=>()=>{et.current&&_.unregister(et.current)},[]),useSafeLayoutEffect$1(()=>{if(!et.current)return;const rt=Number(et.current.dataset.index);$!=rt&&!Number.isNaN(rt)&&j(rt)});const tt=cast(a?_.register(a):_.register);return{descendants:_,index:$,enabledIndex:_.enabledIndexOf(et.current),register:mergeRefs(tt,et)}}function createDescendantContext(){return[cast(DescendantsContextProvider),()=>cast(useDescendantsContext()),()=>useDescendants(),et=>useDescendant(et)]}var[AccordionStylesProvider,useAccordionStyles]=createContext$1({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[AccordionItemProvider,useAccordionItemContext]=createContext$1({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[AccordionDescendantsProvider,useAccordionDescendantsContext,useAccordionDescendants,useAccordionDescendant]=createDescendantContext(),AccordionButton=forwardRef(function(_,$){const{getButtonProps:j}=useAccordionItemContext(),et=j(_,$),rt={display:"flex",alignItems:"center",width:"100%",outline:0,...useAccordionStyles().button};return jsxRuntimeExports.jsx(chakra.button,{...et,className:cx("chakra-accordion__button",_.className),__css:rt})});AccordionButton.displayName="AccordionButton";function useControllableState(a){const{value:_,defaultValue:$,onChange:j,shouldUpdate:et=(ut,ht)=>ut!==ht}=a,tt=useCallbackRef$2(j),rt=useCallbackRef$2(et),[nt,it]=reactExports.useState($),st=_!==void 0,ot=st?_:nt,at=useCallbackRef$2(ut=>{const yt=typeof ut=="function"?ut(ot):ut;rt(ot,yt)&&(st||it(yt),tt(yt))},[st,tt,ot,rt]);return[ot,at]}function useAccordion(a){const{onChange:_,defaultIndex:$,index:j,allowMultiple:et,allowToggle:tt,...rt}=a;allowMultipleWarning(a),allowMultipleAndAllowToggleWarning(a);const nt=useAccordionDescendants(),[it,st]=reactExports.useState(-1);reactExports.useEffect(()=>()=>{st(-1)},[]);const[ot,at]=useControllableState({value:j,defaultValue(){return et?$??[]:$??-1},onChange:_});return{index:ot,setIndex:at,htmlProps:rt,getAccordionItemProps:ht=>{let yt=!1;return ht!==null&&(yt=Array.isArray(ot)?ot.includes(ht):ot===ht),{isOpen:yt,onChange:Ct=>{if(ht!==null)if(et&&Array.isArray(ot)){const Pt=Ct?ot.concat(ht):ot.filter($t=>$t!==ht);at(Pt)}else Ct?at(ht):tt&&at(-1)}}},focusedIndex:it,setFocusedIndex:st,descendants:nt}}var[AccordionProvider,useAccordionContext]=createContext$1({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function useAccordionItem(a){const{isDisabled:_,isFocusable:$,id:j,...et}=a,{getAccordionItemProps:tt,setFocusedIndex:rt}=useAccordionContext(),nt=reactExports.useRef(null),it=reactExports.useId(),st=j??it,ot=`accordion-button-${st}`,at=`accordion-panel-${st}`;focusableNotDisabledWarning(a);const{register:ut,index:ht,descendants:yt}=useAccordionDescendant({disabled:_&&!$}),{isOpen:wt,onChange:Ct}=tt(ht===-1?null:ht);warnIfOpenAndDisabled({isOpen:wt,isDisabled:_});const Pt=()=>{Ct==null||Ct(!0)},$t=()=>{Ct==null||Ct(!1)},Mt=reactExports.useCallback(()=>{Ct==null||Ct(!wt),rt(ht)},[ht,rt,wt,Ct]),Bt=reactExports.useCallback(It=>{const Ft={ArrowDown:()=>{const jt=yt.nextEnabled(ht);jt==null||jt.node.focus()},ArrowUp:()=>{const jt=yt.prevEnabled(ht);jt==null||jt.node.focus()},Home:()=>{const jt=yt.firstEnabled();jt==null||jt.node.focus()},End:()=>{const jt=yt.lastEnabled();jt==null||jt.node.focus()}}[It.key];Ft&&(It.preventDefault(),Ft(It))},[yt,ht]),Dt=reactExports.useCallback(()=>{rt(ht)},[rt,ht]),zt=reactExports.useCallback(function(Lt={},Ft=null){return{...Lt,type:"button",ref:mergeRefs(ut,nt,Ft),id:ot,disabled:!!_,"aria-expanded":!!wt,"aria-controls":at,onClick:callAllHandlers$1(Lt.onClick,Mt),onFocus:callAllHandlers$1(Lt.onFocus,Dt),onKeyDown:callAllHandlers$1(Lt.onKeyDown,Bt)}},[ot,_,wt,Mt,Dt,Bt,at,ut]),Ot=reactExports.useCallback(function(Lt={},Ft=null){return{...Lt,ref:Ft,role:"region",id:at,"aria-labelledby":ot,hidden:!wt}},[ot,wt,at]);return{isOpen:wt,isDisabled:_,isFocusable:$,onOpen:Pt,onClose:$t,getButtonProps:zt,getPanelProps:Ot,htmlProps:et}}function allowMultipleWarning(a){const _=a.index||a.defaultIndex,$=_!=null&&!Array.isArray(_)&&a.allowMultiple;warn({condition:!!$,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof _},`})}function allowMultipleAndAllowToggleWarning(a){warn({condition:!!(a.allowMultiple&&a.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function focusableNotDisabledWarning(a){warn({condition:!!(a.isFocusable&&!a.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. - `})}function warnIfOpenAndDisabled(a){warn({condition:a.isOpen&&!!a.isDisabled,message:"Cannot open a disabled accordion item"})}function AccordionIcon(a){const{isOpen:_,isDisabled:$}=useAccordionItemContext(),{reduceMotion:j}=useAccordionContext(),et=cx("chakra-accordion__icon",a.className),tt=useAccordionStyles(),rt={opacity:$?.4:1,transform:_?"rotate(-180deg)":void 0,transition:j?void 0:"transform 0.2s",transformOrigin:"center",...tt.icon};return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24","aria-hidden":!0,className:et,__css:rt,...a,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}AccordionIcon.displayName="AccordionIcon";var AccordionItem=forwardRef(function(_,$){const{children:j,className:et}=_,{htmlProps:tt,...rt}=useAccordionItem(_),it={...useAccordionStyles().container,overflowAnchor:"none"},st=reactExports.useMemo(()=>rt,[rt]);return jsxRuntimeExports.jsx(AccordionItemProvider,{value:st,children:jsxRuntimeExports.jsx(chakra.div,{ref:$,...tt,className:cx("chakra-accordion__item",et),__css:it,children:typeof j=="function"?j({isExpanded:!!rt.isOpen,isDisabled:!!rt.isDisabled}):j})})});AccordionItem.displayName="AccordionItem";var TRANSITION_EASINGS={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},TRANSITION_VARIANTS={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function getSlideTransition(a){var _;switch((_=a==null?void 0:a.direction)!=null?_:"right"){case"right":return TRANSITION_VARIANTS.slideRight;case"left":return TRANSITION_VARIANTS.slideLeft;case"bottom":return TRANSITION_VARIANTS.slideDown;case"top":return TRANSITION_VARIANTS.slideUp;default:return TRANSITION_VARIANTS.slideRight}}var TRANSITION_DEFAULTS={enter:{duration:.2,ease:TRANSITION_EASINGS.easeOut},exit:{duration:.1,ease:TRANSITION_EASINGS.easeIn}},withDelay={enter:(a,_)=>({...a,delay:typeof _=="number"?_:_==null?void 0:_.enter}),exit:(a,_)=>({...a,delay:typeof _=="number"?_:_==null?void 0:_.exit})},isNumeric$1=a=>a!=null&&parseInt(a.toString(),10)>0,defaultTransitions={exit:{height:{duration:.2,ease:TRANSITION_EASINGS.ease},opacity:{duration:.3,ease:TRANSITION_EASINGS.ease}},enter:{height:{duration:.3,ease:TRANSITION_EASINGS.ease},opacity:{duration:.4,ease:TRANSITION_EASINGS.ease}}},variants$4={exit:({animateOpacity:a,startingHeight:_,transition:$,transitionEnd:j,delay:et})=>{var tt;return{...a&&{opacity:isNumeric$1(_)?1:0},height:_,transitionEnd:j==null?void 0:j.exit,transition:(tt=$==null?void 0:$.exit)!=null?tt:withDelay.exit(defaultTransitions.exit,et)}},enter:({animateOpacity:a,endingHeight:_,transition:$,transitionEnd:j,delay:et})=>{var tt;return{...a&&{opacity:1},height:_,transitionEnd:j==null?void 0:j.enter,transition:(tt=$==null?void 0:$.enter)!=null?tt:withDelay.enter(defaultTransitions.enter,et)}}},Collapse=reactExports.forwardRef((a,_)=>{const{in:$,unmountOnExit:j,animateOpacity:et=!0,startingHeight:tt=0,endingHeight:rt="auto",style:nt,className:it,transition:st,transitionEnd:ot,...at}=a,[ut,ht]=reactExports.useState(!1);reactExports.useEffect(()=>{const $t=setTimeout(()=>{ht(!0)});return()=>clearTimeout($t)},[]),warn({condition:Number(tt)>0&&!!j,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const yt=parseFloat(tt.toString())>0,wt={startingHeight:tt,endingHeight:rt,animateOpacity:et,transition:ut?st:{enter:{duration:0}},transitionEnd:{enter:ot==null?void 0:ot.enter,exit:j?ot==null?void 0:ot.exit:{...ot==null?void 0:ot.exit,display:yt?"block":"none"}}},Ct=j?$:!0,Pt=$||j?"enter":"exit";return jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,custom:wt,children:Ct&&jsxRuntimeExports.jsx(motion.div,{ref:_,...at,className:cx("chakra-collapse",it),style:{overflow:"hidden",display:"block",...nt},custom:wt,variants:variants$4,initial:j?"exit":!1,animate:Pt,exit:"exit"})})});Collapse.displayName="Collapse";var variants$3={enter:({transition:a,transitionEnd:_,delay:$}={})=>{var j;return{opacity:1,transition:(j=a==null?void 0:a.enter)!=null?j:withDelay.enter(TRANSITION_DEFAULTS.enter,$),transitionEnd:_==null?void 0:_.enter}},exit:({transition:a,transitionEnd:_,delay:$}={})=>{var j;return{opacity:0,transition:(j=a==null?void 0:a.exit)!=null?j:withDelay.exit(TRANSITION_DEFAULTS.exit,$),transitionEnd:_==null?void 0:_.exit}}},fadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$3},Fade=reactExports.forwardRef(function(_,$){const{unmountOnExit:j,in:et,className:tt,transition:rt,transitionEnd:nt,delay:it,...st}=_,ot=et||j?"enter":"exit",at=j?et&&j:!0,ut={transition:rt,transitionEnd:nt,delay:it};return jsxRuntimeExports.jsx(AnimatePresence,{custom:ut,children:at&&jsxRuntimeExports.jsx(motion.div,{ref:$,className:cx("chakra-fade",tt),custom:ut,...fadeConfig,animate:ot,...st})})});Fade.displayName="Fade";var variants$2={exit:({reverse:a,initialScale:_,transition:$,transitionEnd:j,delay:et})=>{var tt;return{opacity:0,...a?{scale:_,transitionEnd:j==null?void 0:j.exit}:{transitionEnd:{scale:_,...j==null?void 0:j.exit}},transition:(tt=$==null?void 0:$.exit)!=null?tt:withDelay.exit(TRANSITION_DEFAULTS.exit,et)}},enter:({transitionEnd:a,transition:_,delay:$})=>{var j;return{opacity:1,scale:1,transition:(j=_==null?void 0:_.enter)!=null?j:withDelay.enter(TRANSITION_DEFAULTS.enter,$),transitionEnd:a==null?void 0:a.enter}}},scaleFadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$2},ScaleFade=reactExports.forwardRef(function(_,$){const{unmountOnExit:j,in:et,reverse:tt=!0,initialScale:rt=.95,className:nt,transition:it,transitionEnd:st,delay:ot,...at}=_,ut=j?et&&j:!0,ht=et||j?"enter":"exit",yt={initialScale:rt,reverse:tt,transition:it,transitionEnd:st,delay:ot};return jsxRuntimeExports.jsx(AnimatePresence,{custom:yt,children:ut&&jsxRuntimeExports.jsx(motion.div,{ref:$,className:cx("chakra-offset-slide",nt),...scaleFadeConfig,animate:ht,custom:yt,...at})})});ScaleFade.displayName="ScaleFade";var variants$1={initial:({offsetX:a,offsetY:_,transition:$,transitionEnd:j,delay:et})=>{var tt;return{opacity:0,x:a,y:_,transition:(tt=$==null?void 0:$.exit)!=null?tt:withDelay.exit(TRANSITION_DEFAULTS.exit,et),transitionEnd:j==null?void 0:j.exit}},enter:({transition:a,transitionEnd:_,delay:$})=>{var j;return{opacity:1,x:0,y:0,transition:(j=a==null?void 0:a.enter)!=null?j:withDelay.enter(TRANSITION_DEFAULTS.enter,$),transitionEnd:_==null?void 0:_.enter}},exit:({offsetY:a,offsetX:_,transition:$,transitionEnd:j,reverse:et,delay:tt})=>{var rt;const nt={x:_,y:a};return{opacity:0,transition:(rt=$==null?void 0:$.exit)!=null?rt:withDelay.exit(TRANSITION_DEFAULTS.exit,tt),...et?{...nt,transitionEnd:j==null?void 0:j.exit}:{transitionEnd:{...nt,...j==null?void 0:j.exit}}}}},slideFadeConfig={initial:"initial",animate:"enter",exit:"exit",variants:variants$1},SlideFade=reactExports.forwardRef(function(_,$){const{unmountOnExit:j,in:et,reverse:tt=!0,className:rt,offsetX:nt=0,offsetY:it=8,transition:st,transitionEnd:ot,delay:at,...ut}=_,ht=j?et&&j:!0,yt=et||j?"enter":"exit",wt={offsetX:nt,offsetY:it,reverse:tt,transition:st,transitionEnd:ot,delay:at};return jsxRuntimeExports.jsx(AnimatePresence,{custom:wt,children:ht&&jsxRuntimeExports.jsx(motion.div,{ref:$,className:cx("chakra-offset-slide",rt),custom:wt,...slideFadeConfig,animate:yt,...ut})})});SlideFade.displayName="SlideFade";var defaultTransition={exit:{duration:.15,ease:TRANSITION_EASINGS.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},variants={exit:({direction:a,transition:_,transitionEnd:$,delay:j})=>{var et;const{exit:tt}=getSlideTransition({direction:a});return{...tt,transition:(et=_==null?void 0:_.exit)!=null?et:withDelay.exit(defaultTransition.exit,j),transitionEnd:$==null?void 0:$.exit}},enter:({direction:a,transitionEnd:_,transition:$,delay:j})=>{var et;const{enter:tt}=getSlideTransition({direction:a});return{...tt,transition:(et=$==null?void 0:$.enter)!=null?et:withDelay.enter(defaultTransition.enter,j),transitionEnd:_==null?void 0:_.enter}}},Slide=reactExports.forwardRef(function(_,$){const{direction:j="right",style:et,unmountOnExit:tt,in:rt,className:nt,transition:it,transitionEnd:st,delay:ot,motionProps:at,...ut}=_,ht=getSlideTransition({direction:j}),yt=Object.assign({position:"fixed"},ht.position,et),wt=tt?rt&&tt:!0,Ct=rt||tt?"enter":"exit",Pt={transitionEnd:st,transition:it,direction:j,delay:ot};return jsxRuntimeExports.jsx(AnimatePresence,{custom:Pt,children:wt&&jsxRuntimeExports.jsx(motion.div,{...ut,ref:$,initial:"exit",className:cx("chakra-slide",nt),animate:Ct,exit:"exit",custom:Pt,variants,style:yt,...at})})});Slide.displayName="Slide";var AccordionPanel=forwardRef(function(_,$){const{className:j,motionProps:et,...tt}=_,{reduceMotion:rt}=useAccordionContext(),{getPanelProps:nt,isOpen:it}=useAccordionItemContext(),st=nt(tt,$),ot=cx("chakra-accordion__panel",j),at=useAccordionStyles();rt||delete st.hidden;const ut=jsxRuntimeExports.jsx(chakra.div,{...st,__css:at.panel,className:ot});return rt?ut:jsxRuntimeExports.jsx(Collapse,{in:it,...et,children:ut})});AccordionPanel.displayName="AccordionPanel";var Accordion=forwardRef(function({children:_,reduceMotion:$,...j},et){const tt=useMultiStyleConfig("Accordion",j),rt=omitThemingProps(j),{htmlProps:nt,descendants:it,...st}=useAccordion(rt),ot=reactExports.useMemo(()=>({...st,reduceMotion:!!$}),[st,$]);return jsxRuntimeExports.jsx(AccordionDescendantsProvider,{value:it,children:jsxRuntimeExports.jsx(AccordionProvider,{value:ot,children:jsxRuntimeExports.jsx(AccordionStylesProvider,{value:tt,children:jsxRuntimeExports.jsx(chakra.div,{ref:et,...nt,className:cx("chakra-accordion",j.className),__css:tt.root,children:_})})})})});Accordion.displayName="Accordion";var NativeImage=forwardRef(function(_,$){const{htmlWidth:j,htmlHeight:et,alt:tt,...rt}=_;return jsxRuntimeExports.jsx("img",{width:j,height:et,ref:$,alt:tt,...rt})});NativeImage.displayName="NativeImage";function useImage(a){const{loading:_,src:$,srcSet:j,onLoad:et,onError:tt,crossOrigin:rt,sizes:nt,ignoreFallback:it}=a,[st,ot]=reactExports.useState("pending");reactExports.useEffect(()=>{ot($?"loading":"pending")},[$]);const at=reactExports.useRef(),ut=reactExports.useCallback(()=>{if(!$)return;ht();const yt=new Image;yt.src=$,rt&&(yt.crossOrigin=rt),j&&(yt.srcset=j),nt&&(yt.sizes=nt),_&&(yt.loading=_),yt.onload=wt=>{ht(),ot("loaded"),et==null||et(wt)},yt.onerror=wt=>{ht(),ot("failed"),tt==null||tt(wt)},at.current=yt},[$,rt,j,nt,et,tt,_]),ht=()=>{at.current&&(at.current.onload=null,at.current.onerror=null,at.current=null)};return useSafeLayoutEffect$2(()=>{if(!it)return st==="loading"&&ut(),()=>{ht()}},[st,ut,it]),it?"loaded":st}var shouldShowFallbackImage=(a,_)=>a!=="loaded"&&_==="beforeLoadOrError"||a==="failed"&&_==="onError";function omit$4(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}var Image$1=forwardRef(function(_,$){const{fallbackSrc:j,fallback:et,src:tt,srcSet:rt,align:nt,fit:it,loading:st,ignoreFallback:ot,crossOrigin:at,fallbackStrategy:ut="beforeLoadOrError",referrerPolicy:ht,...yt}=_,wt=j!==void 0||et!==void 0,Ct=st!=null||ot||!wt,Pt=useImage({..._,crossOrigin:at,ignoreFallback:Ct}),$t=shouldShowFallbackImage(Pt,ut),Mt={ref:$,objectFit:it,objectPosition:nt,...Ct?yt:omit$4(yt,["onError","onLoad"])};return $t?et||jsxRuntimeExports.jsx(chakra.img,{as:NativeImage,className:"chakra-image__placeholder",src:j,...Mt}):jsxRuntimeExports.jsx(chakra.img,{as:NativeImage,src:tt,srcSet:rt,crossOrigin:at,loading:st,referrerPolicy:ht,className:"chakra-image",...Mt})});Image$1.displayName="Image";function getValidChildren(a){return reactExports.Children.toArray(a).filter(_=>reactExports.isValidElement(_))}var[ButtonGroupProvider,useButtonGroup]=createContext$1({strict:!1,name:"ButtonGroupContext"});function useButtonType(a){const[_,$]=reactExports.useState(!a);return{ref:reactExports.useCallback(tt=>{tt&&$(tt.tagName==="BUTTON")},[]),type:_?"button":void 0}}function ButtonIcon(a){const{children:_,className:$,...j}=a,et=reactExports.isValidElement(_)?reactExports.cloneElement(_,{"aria-hidden":!0,focusable:!1}):_,tt=cx("chakra-button__icon",$);return jsxRuntimeExports.jsx(chakra.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...j,className:tt,children:et})}ButtonIcon.displayName="ButtonIcon";function ButtonSpinner(a){const{label:_,placement:$,spacing:j="0.5rem",children:et=jsxRuntimeExports.jsx(Spinner,{color:"currentColor",width:"1em",height:"1em"}),className:tt,__css:rt,...nt}=a,it=cx("chakra-button__spinner",tt),st=$==="start"?"marginEnd":"marginStart",ot=reactExports.useMemo(()=>({display:"flex",alignItems:"center",position:_?"relative":"absolute",[st]:_?j:0,fontSize:"1em",lineHeight:"normal",...rt}),[rt,_,st,j]);return jsxRuntimeExports.jsx(chakra.div,{className:it,...nt,__css:ot,children:et})}ButtonSpinner.displayName="ButtonSpinner";var Button=forwardRef((a,_)=>{const $=useButtonGroup(),j=useStyleConfig("Button",{...$,...a}),{isDisabled:et=$==null?void 0:$.isDisabled,isLoading:tt,isActive:rt,children:nt,leftIcon:it,rightIcon:st,loadingText:ot,iconSpacing:at="0.5rem",type:ut,spinner:ht,spinnerPlacement:yt="start",className:wt,as:Ct,...Pt}=omitThemingProps(a),$t=reactExports.useMemo(()=>{const zt={...j==null?void 0:j._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...j,...!!$&&{_focus:zt}}},[j,$]),{ref:Mt,type:Bt}=useButtonType(Ct),Dt={rightIcon:st,leftIcon:it,iconSpacing:at,children:nt};return jsxRuntimeExports.jsxs(chakra.button,{ref:useMergeRefs$1(_,Mt),as:Ct,type:ut??Bt,"data-active":dataAttr(rt),"data-loading":dataAttr(tt),__css:$t,className:cx("chakra-button",wt),...Pt,disabled:et||tt,children:[tt&&yt==="start"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--start",label:ot,placement:"start",spacing:at,children:ht}),tt?ot||jsxRuntimeExports.jsx(chakra.span,{opacity:0,children:jsxRuntimeExports.jsx(ButtonContent,{...Dt})}):jsxRuntimeExports.jsx(ButtonContent,{...Dt}),tt&&yt==="end"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--end",label:ot,placement:"end",spacing:at,children:ht})]})});Button.displayName="Button";function ButtonContent(a){const{leftIcon:_,rightIcon:$,children:j,iconSpacing:et}=a;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[_&&jsxRuntimeExports.jsx(ButtonIcon,{marginEnd:et,children:_}),j,$&&jsxRuntimeExports.jsx(ButtonIcon,{marginStart:et,children:$})]})}var IconButton=forwardRef((a,_)=>{const{icon:$,children:j,isRound:et,"aria-label":tt,...rt}=a,nt=$||j,it=reactExports.isValidElement(nt)?reactExports.cloneElement(nt,{"aria-hidden":!0,focusable:!1}):null;return jsxRuntimeExports.jsx(Button,{padding:"0",borderRadius:et?"full":void 0,ref:_,"aria-label":tt,...rt,children:it})});IconButton.displayName="IconButton";var[CardStylesProvider,useCardStyles]=createStylesContext("Card"),CardBody=forwardRef(function(_,$){const{className:j,...et}=_,tt=useCardStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:$,className:cx("chakra-card__body",j),__css:tt.body,...et})}),Card=forwardRef(function(_,$){const{className:j,children:et,direction:tt="column",justify:rt,align:nt,...it}=omitThemingProps(_),st=useMultiStyleConfig("Card",_);return jsxRuntimeExports.jsx(chakra.div,{ref:$,className:cx("chakra-card",j),__css:{display:"flex",flexDirection:tt,justifyContent:rt,alignItems:nt,position:"relative",minWidth:0,wordWrap:"break-word",...st.container},...it,children:jsxRuntimeExports.jsx(CardStylesProvider,{value:st,children:et})})}),[CheckboxGroupProvider,useCheckboxGroupContext]=createContext$1({name:"CheckboxGroupContext",strict:!1});function useInitialAnimationState(a){const[_,$]=reactExports.useState(a),[j,et]=reactExports.useState(!1);return a!==_&&(et(!0),$(a)),j}function CheckIcon$2(a){return jsxRuntimeExports.jsx(chakra.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...a,children:jsxRuntimeExports.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function IndeterminateIcon(a){return jsxRuntimeExports.jsx(chakra.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...a,children:jsxRuntimeExports.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function CheckboxIcon(a){const{isIndeterminate:_,isChecked:$,...j}=a,et=_?IndeterminateIcon:CheckIcon$2;return $||_?jsxRuntimeExports.jsx(chakra.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:jsxRuntimeExports.jsx(et,{...j})}):null}var[FormControlStylesProvider,useFormControlStyles]=createContext$1({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[FormControlProvider,useFormControlContext]=createContext$1({strict:!1,name:"FormControlContext"});function useFormControlProvider(a){const{id:_,isRequired:$,isInvalid:j,isDisabled:et,isReadOnly:tt,...rt}=a,nt=reactExports.useId(),it=_||`field-${nt}`,st=`${it}-label`,ot=`${it}-feedback`,at=`${it}-helptext`,[ut,ht]=reactExports.useState(!1),[yt,wt]=reactExports.useState(!1),[Ct,Pt]=reactExports.useState(!1),$t=reactExports.useCallback((Ot={},It=null)=>({id:at,...Ot,ref:mergeRefs(It,Lt=>{Lt&&wt(!0)})}),[at]),Mt=reactExports.useCallback((Ot={},It=null)=>({...Ot,ref:It,"data-focus":dataAttr(Ct),"data-disabled":dataAttr(et),"data-invalid":dataAttr(j),"data-readonly":dataAttr(tt),id:Ot.id!==void 0?Ot.id:st,htmlFor:Ot.htmlFor!==void 0?Ot.htmlFor:it}),[it,et,Ct,j,tt,st]),Bt=reactExports.useCallback((Ot={},It=null)=>({id:ot,...Ot,ref:mergeRefs(It,Lt=>{Lt&&ht(!0)}),"aria-live":"polite"}),[ot]),Dt=reactExports.useCallback((Ot={},It=null)=>({...Ot,...rt,ref:It,role:"group","data-focus":dataAttr(Ct),"data-disabled":dataAttr(et),"data-invalid":dataAttr(j),"data-readonly":dataAttr(tt)}),[rt,et,Ct,j,tt]),zt=reactExports.useCallback((Ot={},It=null)=>({...Ot,ref:It,role:"presentation","aria-hidden":!0,children:Ot.children||"*"}),[]);return{isRequired:!!$,isInvalid:!!j,isReadOnly:!!tt,isDisabled:!!et,isFocused:!!Ct,onFocus:()=>Pt(!0),onBlur:()=>Pt(!1),hasFeedbackText:ut,setHasFeedbackText:ht,hasHelpText:yt,setHasHelpText:wt,id:it,labelId:st,feedbackId:ot,helpTextId:at,htmlProps:rt,getHelpTextProps:$t,getErrorMessageProps:Bt,getRootProps:Dt,getLabelProps:Mt,getRequiredIndicatorProps:zt}}var FormControl=forwardRef(function(_,$){const j=useMultiStyleConfig("Form",_),et=omitThemingProps(_),{getRootProps:tt,htmlProps:rt,...nt}=useFormControlProvider(et),it=cx("chakra-form-control",_.className);return jsxRuntimeExports.jsx(FormControlProvider,{value:nt,children:jsxRuntimeExports.jsx(FormControlStylesProvider,{value:j,children:jsxRuntimeExports.jsx(chakra.div,{...tt({},$),className:it,__css:j.container})})})});FormControl.displayName="FormControl";var FormHelperText=forwardRef(function(_,$){const j=useFormControlContext(),et=useFormControlStyles(),tt=cx("chakra-form__helper-text",_.className);return jsxRuntimeExports.jsx(chakra.div,{...j==null?void 0:j.getHelpTextProps(_,$),__css:et.helperText,className:tt})});FormHelperText.displayName="FormHelperText";var[FormErrorStylesProvider,useFormErrorStyles]=createContext$1({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),FormErrorMessage$1=forwardRef((a,_)=>{const $=useMultiStyleConfig("FormError",a),j=omitThemingProps(a),et=useFormControlContext();return et!=null&&et.isInvalid?jsxRuntimeExports.jsx(FormErrorStylesProvider,{value:$,children:jsxRuntimeExports.jsx(chakra.div,{...et==null?void 0:et.getErrorMessageProps(j,_),className:cx("chakra-form__error-message",a.className),__css:{display:"flex",alignItems:"center",...$.text}})}):null});FormErrorMessage$1.displayName="FormErrorMessage";var FormErrorIcon=forwardRef((a,_)=>{const $=useFormErrorStyles(),j=useFormControlContext();if(!(j!=null&&j.isInvalid))return null;const et=cx("chakra-form__error-icon",a.className);return jsxRuntimeExports.jsx(Icon,{ref:_,"aria-hidden":!0,...a,__css:$.icon,className:et,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})});FormErrorIcon.displayName="FormErrorIcon";var FormLabel=forwardRef(function(_,$){var j;const et=useStyleConfig("FormLabel",_),tt=omitThemingProps(_),{className:rt,children:nt,requiredIndicator:it=jsxRuntimeExports.jsx(RequiredIndicator,{}),optionalIndicator:st=null,...ot}=tt,at=useFormControlContext(),ut=(j=at==null?void 0:at.getLabelProps(ot,$))!=null?j:{ref:$,...ot};return jsxRuntimeExports.jsxs(chakra.label,{...ut,className:cx("chakra-form__label",tt.className),__css:{display:"block",textAlign:"start",...et},children:[nt,at!=null&&at.isRequired?it:st]})});FormLabel.displayName="FormLabel";var RequiredIndicator=forwardRef(function(_,$){const j=useFormControlContext(),et=useFormControlStyles();if(!(j!=null&&j.isRequired))return null;const tt=cx("chakra-form__required-indicator",_.className);return jsxRuntimeExports.jsx(chakra.span,{...j==null?void 0:j.getRequiredIndicatorProps(_,$),__css:et.requiredIndicator,className:tt})});RequiredIndicator.displayName="RequiredIndicator";function useFormControl(a){const{isDisabled:_,isInvalid:$,isReadOnly:j,isRequired:et,...tt}=useFormControlProps(a);return{...tt,disabled:_,readOnly:j,required:et,"aria-invalid":ariaAttr($),"aria-required":ariaAttr(et),"aria-readonly":ariaAttr(j)}}function useFormControlProps(a){var _,$,j;const et=useFormControlContext(),{id:tt,disabled:rt,readOnly:nt,required:it,isRequired:st,isInvalid:ot,isReadOnly:at,isDisabled:ut,onFocus:ht,onBlur:yt,...wt}=a,Ct=a["aria-describedby"]?[a["aria-describedby"]]:[];return et!=null&&et.hasFeedbackText&&(et!=null&&et.isInvalid)&&Ct.push(et.feedbackId),et!=null&&et.hasHelpText&&Ct.push(et.helpTextId),{...wt,"aria-describedby":Ct.join(" ")||void 0,id:tt??(et==null?void 0:et.id),isDisabled:(_=rt??ut)!=null?_:et==null?void 0:et.isDisabled,isReadOnly:($=nt??at)!=null?$:et==null?void 0:et.isReadOnly,isRequired:(j=it??st)!=null?j:et==null?void 0:et.isRequired,isInvalid:ot??(et==null?void 0:et.isInvalid),onFocus:callAllHandlers$1(et==null?void 0:et.onFocus,ht),onBlur:callAllHandlers$1(et==null?void 0:et.onBlur,yt)}}var visuallyHiddenStyle$1={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},isDom$1=()=>typeof document<"u",hasSetup=!1,modality=null,hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1,handlers=new Set;function trigger(a,_){handlers.forEach($=>$(a,_))}var isMac=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function isValidKey(a){return!(a.metaKey||!isMac&&a.altKey||a.ctrlKey||a.key==="Control"||a.key==="Shift"||a.key==="Meta")}function onKeyboardEvent(a){hasEventBeforeFocus=!0,isValidKey(a)&&(modality="keyboard",trigger("keyboard",a))}function onPointerEvent(a){if(modality="pointer",a.type==="mousedown"||a.type==="pointerdown"){hasEventBeforeFocus=!0;const _=a.composedPath?a.composedPath()[0]:a.target;let $=!1;try{$=_.matches(":focus-visible")}catch{}if($)return;trigger("pointer",a)}}function isVirtualClick(a){return a.mozInputSource===0&&a.isTrusted?!0:a.detail===0&&!a.pointerType}function onClickEvent(a){isVirtualClick(a)&&(hasEventBeforeFocus=!0,modality="virtual")}function onWindowFocus(a){a.target===window||a.target===document||(!hasEventBeforeFocus&&!hasBlurredWindowRecently&&(modality="virtual",trigger("virtual",a)),hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1)}function onWindowBlur$1(){hasEventBeforeFocus=!1,hasBlurredWindowRecently=!0}function isFocusVisible(){return modality!=="pointer"}function setupGlobalFocusEvents(){if(!isDom$1()||hasSetup)return;const{focus:a}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...$){hasEventBeforeFocus=!0,a.apply(this,$)},document.addEventListener("keydown",onKeyboardEvent,!0),document.addEventListener("keyup",onKeyboardEvent,!0),document.addEventListener("click",onClickEvent,!0),window.addEventListener("focus",onWindowFocus,!0),window.addEventListener("blur",onWindowBlur$1,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",onPointerEvent,!0),document.addEventListener("pointermove",onPointerEvent,!0),document.addEventListener("pointerup",onPointerEvent,!0)):(document.addEventListener("mousedown",onPointerEvent,!0),document.addEventListener("mousemove",onPointerEvent,!0),document.addEventListener("mouseup",onPointerEvent,!0)),hasSetup=!0}function trackFocusVisible(a){setupGlobalFocusEvents(),a(isFocusVisible());const _=()=>a(isFocusVisible());return handlers.add(_),()=>{handlers.delete(_)}}function omit$3(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}function useCheckbox(a={}){const _=useFormControlProps(a),{isDisabled:$,isReadOnly:j,isRequired:et,isInvalid:tt,id:rt,onBlur:nt,onFocus:it,"aria-describedby":st}=_,{defaultChecked:ot,isChecked:at,isFocusable:ut,onChange:ht,isIndeterminate:yt,name:wt,value:Ct,tabIndex:Pt=void 0,"aria-label":$t,"aria-labelledby":Mt,"aria-invalid":Bt,...Dt}=a,zt=omit$3(Dt,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),Ot=useCallbackRef$2(ht),It=useCallbackRef$2(nt),Lt=useCallbackRef$2(it),[Ft,jt]=reactExports.useState(!1),[bt,vt]=reactExports.useState(!1),[ct,dt]=reactExports.useState(!1),[mt,xt]=reactExports.useState(!1);reactExports.useEffect(()=>trackFocusVisible(jt),[]);const At=reactExports.useRef(null),[Rt,St]=reactExports.useState(!0),[Tt,Et]=reactExports.useState(!!ot),Nt=at!==void 0,tr=Nt?at:Tt,ir=reactExports.useCallback(pr=>{if(j||$){pr.preventDefault();return}Nt||Et(tr?pr.target.checked:yt?!0:pr.target.checked),Ot==null||Ot(pr)},[j,$,tr,Nt,yt,Ot]);useSafeLayoutEffect$2(()=>{At.current&&(At.current.indeterminate=!!yt)},[yt]),useUpdateEffect(()=>{$&&vt(!1)},[$,vt]),useSafeLayoutEffect$2(()=>{const pr=At.current;if(!(pr!=null&&pr.form))return;const Cr=()=>{Et(!!ot)};return pr.form.addEventListener("reset",Cr),()=>{var Mr;return(Mr=pr.form)==null?void 0:Mr.removeEventListener("reset",Cr)}},[]);const nr=$&&!ut,Zt=reactExports.useCallback(pr=>{pr.key===" "&&xt(!0)},[xt]),Kt=reactExports.useCallback(pr=>{pr.key===" "&&xt(!1)},[xt]);useSafeLayoutEffect$2(()=>{if(!At.current)return;At.current.checked!==tr&&Et(At.current.checked)},[At.current]);const Qt=reactExports.useCallback((pr={},Cr=null)=>{const Mr=lr=>{bt&&lr.preventDefault(),xt(!0)};return{...pr,ref:Cr,"data-active":dataAttr(mt),"data-hover":dataAttr(ct),"data-checked":dataAttr(tr),"data-focus":dataAttr(bt),"data-focus-visible":dataAttr(bt&&Ft),"data-indeterminate":dataAttr(yt),"data-disabled":dataAttr($),"data-invalid":dataAttr(tt),"data-readonly":dataAttr(j),"aria-hidden":!0,onMouseDown:callAllHandlers$1(pr.onMouseDown,Mr),onMouseUp:callAllHandlers$1(pr.onMouseUp,()=>xt(!1)),onMouseEnter:callAllHandlers$1(pr.onMouseEnter,()=>dt(!0)),onMouseLeave:callAllHandlers$1(pr.onMouseLeave,()=>dt(!1))}},[mt,tr,$,bt,Ft,ct,yt,tt,j]),Ht=reactExports.useCallback((pr={},Cr=null)=>({...pr,ref:Cr,"data-active":dataAttr(mt),"data-hover":dataAttr(ct),"data-checked":dataAttr(tr),"data-focus":dataAttr(bt),"data-focus-visible":dataAttr(bt&&Ft),"data-indeterminate":dataAttr(yt),"data-disabled":dataAttr($),"data-invalid":dataAttr(tt),"data-readonly":dataAttr(j)}),[mt,tr,$,bt,Ft,ct,yt,tt,j]),qt=reactExports.useCallback((pr={},Cr=null)=>({...zt,...pr,ref:mergeRefs(Cr,Mr=>{Mr&&St(Mr.tagName==="LABEL")}),onClick:callAllHandlers$1(pr.onClick,()=>{var Mr;Rt||((Mr=At.current)==null||Mr.click(),requestAnimationFrame(()=>{var lr;(lr=At.current)==null||lr.focus({preventScroll:!0})}))}),"data-disabled":dataAttr($),"data-checked":dataAttr(tr),"data-invalid":dataAttr(tt)}),[zt,$,tr,tt,Rt]),Jt=reactExports.useCallback((pr={},Cr=null)=>({...pr,ref:mergeRefs(At,Cr),type:"checkbox",name:wt,value:Ct,id:rt,tabIndex:Pt,onChange:callAllHandlers$1(pr.onChange,ir),onBlur:callAllHandlers$1(pr.onBlur,It,()=>vt(!1)),onFocus:callAllHandlers$1(pr.onFocus,Lt,()=>vt(!0)),onKeyDown:callAllHandlers$1(pr.onKeyDown,Zt),onKeyUp:callAllHandlers$1(pr.onKeyUp,Kt),required:et,checked:tr,disabled:nr,readOnly:j,"aria-label":$t,"aria-labelledby":Mt,"aria-invalid":Bt?!!Bt:tt,"aria-describedby":st,"aria-disabled":$,style:visuallyHiddenStyle$1}),[wt,Ct,rt,ir,It,Lt,Zt,Kt,et,tr,nr,j,$t,Mt,Bt,tt,st,$,Pt]),ur=reactExports.useCallback((pr={},Cr=null)=>({...pr,ref:Cr,onMouseDown:callAllHandlers$1(pr.onMouseDown,stopEvent$1),"data-disabled":dataAttr($),"data-checked":dataAttr(tr),"data-invalid":dataAttr(tt)}),[tr,$,tt]);return{state:{isInvalid:tt,isFocused:bt,isChecked:tr,isActive:mt,isHovered:ct,isIndeterminate:yt,isDisabled:$,isReadOnly:j,isRequired:et},getRootProps:qt,getCheckboxProps:Qt,getIndicatorProps:Ht,getInputProps:Jt,getLabelProps:ur,htmlProps:zt}}function stopEvent$1(a){a.preventDefault(),a.stopPropagation()}var controlStyles={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},rootStyles={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},checkAnim=keyframes$1({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),indeterminateOpacityAnim=keyframes$1({from:{opacity:0},to:{opacity:1}}),indeterminateScaleAnim=keyframes$1({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Checkbox=forwardRef(function(_,$){const j=useCheckboxGroupContext(),et={...j,..._},tt=useMultiStyleConfig("Checkbox",et),rt=omitThemingProps(_),{spacing:nt="0.5rem",className:it,children:st,iconColor:ot,iconSize:at,icon:ut=jsxRuntimeExports.jsx(CheckboxIcon,{}),isChecked:ht,isDisabled:yt=j==null?void 0:j.isDisabled,onChange:wt,inputProps:Ct,...Pt}=rt;let $t=ht;j!=null&&j.value&&rt.value&&($t=j.value.includes(rt.value));let Mt=wt;j!=null&&j.onChange&&rt.value&&(Mt=callAll(j.onChange,wt));const{state:Bt,getInputProps:Dt,getCheckboxProps:zt,getLabelProps:Ot,getRootProps:It}=useCheckbox({...Pt,isDisabled:yt,isChecked:$t,onChange:Mt}),Lt=useInitialAnimationState(Bt.isChecked),Ft=reactExports.useMemo(()=>({animation:Lt?Bt.isIndeterminate?`${indeterminateOpacityAnim} 20ms linear, ${indeterminateScaleAnim} 200ms linear`:`${checkAnim} 200ms linear`:void 0,fontSize:at,color:ot,...tt.icon}),[ot,at,Lt,Bt.isIndeterminate,tt.icon]),jt=reactExports.cloneElement(ut,{__css:Ft,isIndeterminate:Bt.isIndeterminate,isChecked:Bt.isChecked});return jsxRuntimeExports.jsxs(chakra.label,{__css:{...rootStyles,...tt.container},className:cx("chakra-checkbox",it),...It(),children:[jsxRuntimeExports.jsx("input",{className:"chakra-checkbox__input",...Dt(Ct,$)}),jsxRuntimeExports.jsx(chakra.span,{__css:{...controlStyles,...tt.control},className:"chakra-checkbox__control",...zt(),children:jt}),st&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-checkbox__label",...Ot(),__css:{marginStart:nt,...tt.label},children:st})]})});Checkbox.displayName="Checkbox";function useEventListener(a,_,$,j){const et=useCallbackRef$2($);return reactExports.useEffect(()=>{const tt=typeof a=="function"?a():a??document;if(!(!$||!tt))return tt.addEventListener(_,et,j),()=>{tt.removeEventListener(_,et,j)}},[_,a,j,et,$]),()=>{const tt=typeof a=="function"?a():a??document;tt==null||tt.removeEventListener(_,et,j)}}function isRefObject$1(a){return"current"in a}var isDom=()=>typeof window<"u";function getPlatform(){var a;const _=navigator.userAgentData;return(a=_==null?void 0:_.platform)!=null?a:navigator.platform}var vn=a=>isDom()&&a.test(navigator.vendor),pt=a=>isDom()&&a.test(getPlatform()),isApple=()=>pt(/mac|iphone|ipad|ipod/i),isSafari=()=>isApple()&&vn(/apple/i);function useFocusOnPointerDown(a){const{ref:_,elements:$,enabled:j}=a,et=()=>{var tt,rt;return(rt=(tt=_.current)==null?void 0:tt.ownerDocument)!=null?rt:document};useEventListener(et,"pointerdown",tt=>{if(!isSafari()||!j)return;const rt=tt.target,it=($??[_]).some(st=>{const ot=isRefObject$1(st)?st.current:st;return(ot==null?void 0:ot.contains(rt))||ot===rt});et().activeElement!==rt&&it&&(tt.preventDefault(),rt.focus())})}function _objectWithoutPropertiesLoose$3(a,_){if(a==null)return{};var $={},j=Object.keys(a),et,tt;for(tt=0;tt=0)&&($[et]=a[et]);return $}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(a){for(var _=1;_0&&tt[tt.length-1])&&(st[0]===6||st[0]===2)){$=0;continue}if(st[0]===3&&(!tt||st[1]>tt[0]&&st[1]=a.length&&(a=void 0),{value:a&&a[j++],done:!a}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(a,_){var $=typeof Symbol=="function"&&a[Symbol.iterator];if(!$)return a;var j=$.call(a),et,tt=[],rt;try{for(;(_===void 0||_-- >0)&&!(et=j.next()).done;)tt.push(et.value)}catch(nt){rt={error:nt}}finally{try{et&&!et.done&&($=j.return)&&$.call(j)}finally{if(rt)throw rt.error}}return tt}function __spreadArray(a,_,$){if($||arguments.length===2)for(var j=0,et=_.length,tt;j1||nt(ut,ht)})})}function nt(ut,ht){try{it(j[ut](ht))}catch(yt){at(tt[0][3],yt)}}function it(ut){ut.value instanceof __await?Promise.resolve(ut.value.v).then(st,ot):at(tt[0][2],ut)}function st(ut){nt("next",ut)}function ot(ut){nt("throw",ut)}function at(ut,ht){ut(ht),tt.shift(),tt.length&&nt(tt[0][0],tt[0][1])}}function __asyncValues(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var _=a[Symbol.asyncIterator],$;return _?_.call(a):(a=typeof __values=="function"?__values(a):a[Symbol.iterator](),$={},j("next"),j("throw"),j("return"),$[Symbol.asyncIterator]=function(){return this},$);function j(tt){$[tt]=a[tt]&&function(rt){return new Promise(function(nt,it){rt=a[tt](rt),et(nt,it,rt.done,rt.value)})}}function et(tt,rt,nt,it){Promise.resolve(it).then(function(st){tt({value:st,done:nt})},rt)}}typeof SuppressedError=="function"&&SuppressedError;function ItoI(a){return a}function innerCreateMedium(a,_){_===void 0&&(_=ItoI);var $=[],j=!1,et={read:function(){if(j)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return $.length?$[$.length-1]:a},useMedium:function(tt){var rt=_(tt,j);return $.push(rt),function(){$=$.filter(function(nt){return nt!==rt})}},assignSyncMedium:function(tt){for(j=!0;$.length;){var rt=$;$=[],rt.forEach(tt)}$={push:function(nt){return tt(nt)},filter:function(){return $}}},assignMedium:function(tt){j=!0;var rt=[];if($.length){var nt=$;$=[],nt.forEach(tt),rt=$}var it=function(){var ot=rt;rt=[],ot.forEach(tt)},st=function(){return Promise.resolve().then(it)};st(),$={push:function(ot){rt.push(ot),st()},filter:function(ot){return rt=rt.filter(ot),$}}}};return et}function createMedium(a,_){return _===void 0&&(_=ItoI),innerCreateMedium(a,_)}function createSidecarMedium(a){a===void 0&&(a={});var _=innerCreateMedium(null);return _.options=__assign({async:!0,ssr:!1},a),_}var SideCar$2=function(a){var _=a.sideCar,$=__rest$3(a,["sideCar"]);if(!_)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var j=_.read();if(!j)throw new Error("Sidecar medium not found");return reactExports.createElement(j,__assign({},$))};SideCar$2.isSideCarExport=!0;function exportSidecar(a,_){return a.useMedium(_),SideCar$2}var mediumFocus=createMedium({},function(a){var _=a.target,$=a.currentTarget;return{target:_,currentTarget:$}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0}),emptyArray=[],FocusLock$1=reactExports.forwardRef(function(_,$){var j,et=reactExports.useState(),tt=et[0],rt=et[1],nt=reactExports.useRef(),it=reactExports.useRef(!1),st=reactExports.useRef(null),ot=_.children,at=_.disabled,ut=_.noFocusGuards,ht=_.persistentFocus,yt=_.crossFrame,wt=_.autoFocus;_.allowTextSelection;var Ct=_.group,Pt=_.className,$t=_.whiteList,Mt=_.hasPositiveIndices,Bt=_.shards,Dt=Bt===void 0?emptyArray:Bt,zt=_.as,Ot=zt===void 0?"div":zt,It=_.lockProps,Lt=It===void 0?{}:It,Ft=_.sideCar,jt=_.returnFocus,bt=_.focusOptions,vt=_.onActivation,ct=_.onDeactivation,dt=reactExports.useState({}),mt=dt[0],xt=reactExports.useCallback(function(){st.current=st.current||document&&document.activeElement,nt.current&&vt&&vt(nt.current),it.current=!0},[vt]),At=reactExports.useCallback(function(){it.current=!1,ct&&ct(nt.current)},[ct]);reactExports.useEffect(function(){at||(st.current=null)},[]);var Rt=reactExports.useCallback(function(Zt){var Kt=st.current;if(Kt&&Kt.focus){var Qt=typeof jt=="function"?jt(Kt):jt;if(Qt){var Ht=typeof Qt=="object"?Qt:void 0;st.current=null,Zt?Promise.resolve().then(function(){return Kt.focus(Ht)}):Kt.focus(Ht)}}},[jt]),St=reactExports.useCallback(function(Zt){it.current&&mediumFocus.useMedium(Zt)},[]),Tt=mediumBlur.useMedium,Et=reactExports.useCallback(function(Zt){nt.current!==Zt&&(nt.current=Zt,rt(Zt))},[]),Nt=_extends$5((j={},j[FOCUS_DISABLED]=at&&"disabled",j[FOCUS_GROUP]=Ct,j),Lt),tr=ut!==!0,ir=tr&&ut!=="tail",nr=useMergeRefs([$,Et]);return reactExports.createElement(reactExports.Fragment,null,tr&&[reactExports.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:at?-1:0,style:hiddenGuard}),Mt?reactExports.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:at?-1:1,style:hiddenGuard}):null],!at&&reactExports.createElement(Ft,{id:mt,sideCar:mediumSidecar,observed:tt,disabled:at,persistentFocus:ht,crossFrame:yt,autoFocus:wt,whiteList:$t,shards:Dt,onActivation:xt,onDeactivation:At,returnFocus:Rt,focusOptions:bt}),reactExports.createElement(Ot,_extends$5({ref:nr},Nt,{className:Pt,onBlur:Tt,onFocus:St}),ot),ir&&reactExports.createElement("div",{"data-focus-guard":!0,tabIndex:at?-1:0,style:hiddenGuard}))});FocusLock$1.propTypes={};FocusLock$1.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};function _setPrototypeOf$2(a,_){return _setPrototypeOf$2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,et){return j.__proto__=et,j},_setPrototypeOf$2(a,_)}function _inheritsLoose$1(a,_){a.prototype=Object.create(_.prototype),a.prototype.constructor=a,_setPrototypeOf$2(a,_)}function _typeof$6(a){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},_typeof$6(a)}function _toPrimitive(a,_){if(_typeof$6(a)!=="object"||a===null)return a;var $=a[Symbol.toPrimitive];if($!==void 0){var j=$.call(a,_||"default");if(_typeof$6(j)!=="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(a)}function _toPropertyKey(a){var _=_toPrimitive(a,"string");return _typeof$6(_)==="symbol"?_:String(_)}function _defineProperty$8(a,_,$){return _=_toPropertyKey(_),_ in a?Object.defineProperty(a,_,{value:$,enumerable:!0,configurable:!0,writable:!0}):a[_]=$,a}function withSideEffect(a,_){function $(j){return j.displayName||j.name||"Component"}return function(et){var tt=[],rt;function nt(){rt=a(tt.map(function(st){return st.props})),_(rt)}var it=function(st){_inheritsLoose$1(ot,st);function ot(){return st.apply(this,arguments)||this}ot.peek=function(){return rt};var at=ot.prototype;return at.componentDidMount=function(){tt.push(this),nt()},at.componentDidUpdate=function(){nt()},at.componentWillUnmount=function(){var ht=tt.indexOf(this);tt.splice(ht,1),nt()},at.render=function(){return React$2.createElement(et,this.props)},ot}(reactExports.PureComponent);return _defineProperty$8(it,"displayName","SideEffect("+$(et)+")"),it}}var toArray$4=function(a){for(var _=Array(a.length),$=0;$=0}).sort(tabSort)},tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(a,_){return toArray$4((a.shadowRoot||a).children).reduce(function($,j){return $.concat(j.matches(_?queryGuardTabbables:queryTabbables)?[j]:[],getFocusablesWithShadowDom(j))},[])},getFocusablesWithIFrame=function(a,_){var $;return a instanceof HTMLIFrameElement&&(!(($=a.contentDocument)===null||$===void 0)&&$.body)?getFocusables([a.contentDocument.body],_):[a]},getFocusables=function(a,_){return a.reduce(function($,j){var et,tt=getFocusablesWithShadowDom(j,_),rt=(et=[]).concat.apply(et,tt.map(function(nt){return getFocusablesWithIFrame(nt,_)}));return $.concat(rt,j.parentNode?toArray$4(j.parentNode.querySelectorAll(queryTabbables)).filter(function(nt){return nt===j}):[])},[])},getParentAutofocusables=function(a){var _=a.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray$4(_).map(function($){return getFocusables([$])}).reduce(function($,j){return $.concat(j)},[])},filterFocusable=function(a,_){return toArray$4(a).filter(function($){return isVisibleCached(_,$)}).filter(function($){return notHiddenInput($)})},filterAutoFocusable=function(a,_){return _===void 0&&(_=new Map),toArray$4(a).filter(function($){return isAutoFocusAllowedCached(_,$)})},getTabbableNodes=function(a,_,$){return orderByTabIndex(filterFocusable(getFocusables(a,$),_),!0,$)},getFocusableNodes=function(a,_){return orderByTabIndex(filterFocusable(getFocusables(a),_),!1)},parentAutofocusables=function(a,_){return filterFocusable(getParentAutofocusables(a),_)},contains$2=function(a,_){return a.shadowRoot?contains$2(a.shadowRoot,_):Object.getPrototypeOf(a).contains!==void 0&&Object.getPrototypeOf(a).contains.call(a,_)?!0:toArray$4(a.children).some(function($){var j;if($ instanceof HTMLIFrameElement){var et=(j=$.contentDocument)===null||j===void 0?void 0:j.body;return et?contains$2(et,_):!1}return contains$2($,_)})},filterNested=function(a){for(var _=new Set,$=a.length,j=0;j<$;j+=1)for(var et=j+1;et<$;et+=1){var tt=a[j].compareDocumentPosition(a[et]);(tt&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&_.add(et),(tt&Node.DOCUMENT_POSITION_CONTAINS)>0&&_.add(j)}return a.filter(function(rt,nt){return!_.has(nt)})},getTopParent=function(a){return a.parentNode?getTopParent(a.parentNode):a},getAllAffectedNodes=function(a){var _=asArray(a);return _.filter(Boolean).reduce(function($,j){var et=j.getAttribute(FOCUS_GROUP);return $.push.apply($,et?filterNested(toArray$4(getTopParent(j).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(et,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[j]),$},[])},safeProbe=function(a){try{return a()}catch{return}},getActiveElement$1=function(a){if(a===void 0&&(a=document),!(!a||!a.activeElement)){var _=a.activeElement;return _.shadowRoot?getActiveElement$1(_.shadowRoot):_ instanceof HTMLIFrameElement&&safeProbe(function(){return _.contentWindow.document})?getActiveElement$1(_.contentWindow.document):_}},focusInFrame=function(a,_){return a===_},focusInsideIframe=function(a,_){return!!toArray$4(a.querySelectorAll("iframe")).some(function($){return focusInFrame($,_)})},focusInside=function(a,_){return _===void 0&&(_=getActiveElement$1(getFirst(a).ownerDocument)),!_||_.dataset&&_.dataset.focusGuard?!1:getAllAffectedNodes(a).some(function($){return contains$2($,_)||focusInsideIframe($,_)})},focusIsHidden=function(a){a===void 0&&(a=document);var _=getActiveElement$1(a);return _?toArray$4(a.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function($){return contains$2($,_)}):!1},findSelectedRadio=function(a,_){return _.filter(isRadioElement).filter(function($){return $.name===a.name}).filter(function($){return $.checked})[0]||a},correctNode=function(a,_){return isRadioElement(a)&&a.name?findSelectedRadio(a,_):a},correctNodes=function(a){var _=new Set;return a.forEach(function($){return _.add(correctNode($,a))}),a.filter(function($){return _.has($)})},pickFirstFocus=function(a){return a[0]&&a.length>1?correctNode(a[0],a):a[0]},pickFocusable=function(a,_){return a.length>1?a.indexOf(correctNode(a[_],a)):_},NEW_FOCUS="NEW_FOCUS",newFocus=function(a,_,$,j){var et=a.length,tt=a[0],rt=a[et-1],nt=isGuard($);if(!($&&a.indexOf($)>=0)){var it=$!==void 0?_.indexOf($):-1,st=j?_.indexOf(j):it,ot=j?a.indexOf(j):-1,at=it-st,ut=_.indexOf(tt),ht=_.indexOf(rt),yt=correctNodes(_),wt=$!==void 0?yt.indexOf($):-1,Ct=wt-(j?yt.indexOf(j):it),Pt=pickFocusable(a,0),$t=pickFocusable(a,et-1);if(it===-1||ot===-1)return NEW_FOCUS;if(!at&&ot>=0)return ot;if(it<=ut&&nt&&Math.abs(at)>1)return $t;if(it>=ht&&nt&&Math.abs(at)>1)return Pt;if(at&&Math.abs(Ct)>1)return ot;if(it<=ut)return $t;if(it>ht)return Pt;if(at)return Math.abs(at)>1?ot:(et+ot+at)%et}},findAutoFocused=function(a){return function(_){var $,j=($=getDataset(_))===null||$===void 0?void 0:$.autofocus;return _.autofocus||j!==void 0&&j!=="false"||a.indexOf(_)>=0}},pickAutofocus=function(a,_,$){var j=a.map(function(tt){var rt=tt.node;return rt}),et=filterAutoFocusable(j.filter(findAutoFocused($)));return et&&et.length?pickFirstFocus(et):pickFirstFocus(filterAutoFocusable(_))},getParents=function(a,_){return _===void 0&&(_=[]),_.push(a),a.parentNode&&getParents(a.parentNode.host||a.parentNode,_),_},getCommonParent=function(a,_){for(var $=getParents(a),j=getParents(_),et=0;et<$.length;et+=1){var tt=$[et];if(j.indexOf(tt)>=0)return tt}return!1},getTopCommonParent=function(a,_,$){var j=asArray(a),et=asArray(_),tt=j[0],rt=!1;return et.filter(Boolean).forEach(function(nt){rt=getCommonParent(rt||nt,nt)||rt,$.filter(Boolean).forEach(function(it){var st=getCommonParent(tt,it);st&&(!rt||contains$2(st,rt)?rt=st:rt=getCommonParent(st,rt))})}),rt},allParentAutofocusables=function(a,_){return a.reduce(function($,j){return $.concat(parentAutofocusables(j,_))},[])},reorderNodes=function(a,_){var $=new Map;return _.forEach(function(j){return $.set(j.node,j)}),a.map(function(j){return $.get(j)}).filter(isDefined)},focusSolver=function(a,_){var $=getActiveElement$1(asArray(a).length>0?document:getFirst(a).ownerDocument),j=getAllAffectedNodes(a).filter(isNotAGuard),et=getTopCommonParent($||a,a,j),tt=new Map,rt=getFocusableNodes(j,tt),nt=getTabbableNodes(j,tt).filter(function(ht){var yt=ht.node;return isNotAGuard(yt)});if(!(!nt[0]&&(nt=rt,!nt[0]))){var it=getFocusableNodes([et],tt).map(function(ht){var yt=ht.node;return yt}),st=reorderNodes(it,nt),ot=st.map(function(ht){var yt=ht.node;return yt}),at=newFocus(ot,it,$,_);if(at===NEW_FOCUS){var ut=pickAutofocus(rt,ot,allParentAutofocusables(j,tt));if(ut)return{node:ut};console.warn("focus-lock: cannot find any node to move focus into");return}return at===void 0?at:st[at]}},expandFocusableNodes=function(a){var _=getAllAffectedNodes(a).filter(isNotAGuard),$=getTopCommonParent(a,a,_),j=new Map,et=getTabbableNodes([$],j,!0),tt=getTabbableNodes(_,j).filter(function(rt){var nt=rt.node;return isNotAGuard(nt)}).map(function(rt){var nt=rt.node;return nt});return et.map(function(rt){var nt=rt.node,it=rt.index;return{node:nt,index:it,lockItem:tt.indexOf(nt)>=0,guard:isGuard(nt)}})},focusOn=function(a,_){"focus"in a&&a.focus(_),"contentWindow"in a&&a.contentWindow&&a.contentWindow.focus()},guardCount=0,lockDisabled=!1,moveFocusInside=function(a,_,$){$===void 0&&($={});var j=focusSolver(a,_);if(!lockDisabled&&j){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(j.node,$.focusOptions),guardCount--}};function deferAction(a){setTimeout(a,1)}var focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(_){return(lastActiveTrap.whiteList||defaultWhitelist)(_)},recordPortal=function(_,$){lastPortaledElement={observerNode:_,portaledElement:$}},focusIsPortaledPair=function(_){return lastPortaledElement&&lastPortaledElement.portaledElement===_};function autoGuard(a,_,$,j){var et=null,tt=a;do{var rt=j[tt];if(rt.guard)rt.node.dataset.focusAutoGuard&&(et=rt);else if(rt.lockItem){if(tt!==a)return;et=null}else break}while((tt+=$)!==_);et&&(et.node.tabIndex=0)}var extractRef$2=function(_){return _&&"current"in _?_.current:_},focusWasOutside=function(_){return _?!!focusWasOutsideWindow:focusWasOutsideWindow==="meanwhile"},checkInHost=function a(_,$,j){return $&&($.host===_&&(!$.activeElement||j.contains($.activeElement))||$.parentNode&&a(_,$.parentNode,j))},withinHost=function(_,$){return $.some(function(j){return checkInHost(_,j,j)})},activateTrap=function(){var _=!1;if(lastActiveTrap){var $=lastActiveTrap,j=$.observed,et=$.persistentFocus,tt=$.autoFocus,rt=$.shards,nt=$.crossFrame,it=$.focusOptions,st=j||lastPortaledElement&&lastPortaledElement.portaledElement,ot=document&&document.activeElement;if(st){var at=[st].concat(rt.map(extractRef$2).filter(Boolean));if((!ot||focusWhitelisted(ot))&&(et||focusWasOutside(nt)||!isFreeFocus()||!lastActiveFocus&&tt)&&(st&&!(focusInside(at)||ot&&withinHost(ot,at)||focusIsPortaledPair(ot))&&(document&&!lastActiveFocus&&ot&&!tt?(ot.blur&&ot.blur(),document.body.focus()):(_=moveFocusInside(at,lastActiveFocus,{focusOptions:it}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document){var ut=document&&document.activeElement,ht=expandFocusableNodes(at),yt=ht.map(function(wt){var Ct=wt.node;return Ct}).indexOf(ut);yt>-1&&(ht.filter(function(wt){var Ct=wt.guard,Pt=wt.node;return Ct&&Pt.dataset.focusAutoGuard}).forEach(function(wt){var Ct=wt.node;return Ct.removeAttribute("tabIndex")}),autoGuard(yt,ht.length,1,ht),autoGuard(yt,-1,-1,ht))}}}return _},onTrap=function(_){activateTrap()&&_&&(_.stopPropagation(),_.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(_){var $=_.target,j=_.currentTarget;j.contains($)||recordPortal(j,$)},FocusWatcher=function(){return null},onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(a){return a.filter(function(_){var $=_.disabled;return!$})}function handleStateChangeOnClient(a){var _=a.slice(-1)[0];_&&!lastActiveTrap&&attachHandler();var $=lastActiveTrap,j=$&&_&&_.id===$.id;lastActiveTrap=_,$&&!j&&($.onDeactivation(),a.filter(function(et){var tt=et.id;return tt===$.id}).length||$.returnFocus(!_)),_?(lastActiveFocus=null,(!j||$.observed!==_.observed)&&_.onActivation(),activateTrap(),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(a){return a({moveFocusInside,focusInside})});const FocusTrap$1=withSideEffect(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=reactExports.forwardRef(function(_,$){return reactExports.createElement(FocusLock$1,_extends$5({sideCar:FocusTrap$1,ref:$},_))}),_ref=FocusLock$1.propTypes||{};_ref.sideCar;_objectWithoutPropertiesLoose$3(_ref,["sideCar"]);FocusLockCombination.propTypes={};function isElement$2(a){return a!=null&&typeof a=="object"&&"nodeType"in a&&a.nodeType===Node.ELEMENT_NODE}function isHTMLElement$3(a){var _;if(!isElement$2(a))return!1;const $=(_=a.ownerDocument.defaultView)!=null?_:window;return a instanceof $.HTMLElement}function getOwnerWindow(a){var _,$;return($=(_=getOwnerDocument$2(a))==null?void 0:_.defaultView)!=null?$:window}function getOwnerDocument$2(a){return isElement$2(a)?a.ownerDocument:document}function getActiveElement(a){return getOwnerDocument$2(a).activeElement}function isScrollParent$1(a){const _=a.ownerDocument.defaultView||window,{overflow:$,overflowX:j,overflowY:et}=_.getComputedStyle(a);return/auto|scroll|overlay|hidden/.test($+et+j)}function getParent(a){return a.localName==="html"?a:a.assignedSlot||a.parentElement||a.ownerDocument.documentElement}function getScrollParent$1(a){return["html","body","#document"].includes(a.localName)?a.ownerDocument.body:isHTMLElement$3(a)&&isScrollParent$1(a)?a:getScrollParent$1(getParent(a))}var hasTabIndex=a=>a.hasAttribute("tabindex"),hasNegativeTabIndex=a=>hasTabIndex(a)&&a.tabIndex===-1;function isDisabled(a){return!!a.getAttribute("disabled")||!!a.getAttribute("aria-disabled")}function isHidden(a){return a.parentElement&&isHidden(a.parentElement)?!0:a.hidden}function isContentEditable(a){const _=a.getAttribute("contenteditable");return _!=="false"&&_!=null}function isFocusable(a){if(!isHTMLElement$3(a)||isHidden(a)||isDisabled(a))return!1;const{localName:_}=a;if(["input","select","textarea","button"].indexOf(_)>=0)return!0;const j={a:()=>a.hasAttribute("href"),audio:()=>a.hasAttribute("controls"),video:()=>a.hasAttribute("controls")};return _ in j?j[_]():isContentEditable(a)?!0:hasTabIndex(a)}function isTabbable(a){return a?isHTMLElement$3(a)&&isFocusable(a)&&!hasNegativeTabIndex(a):!1}var focusableElList=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],focusableElSelector=focusableElList.join(),isVisible=a=>a.offsetWidth>0&&a.offsetHeight>0;function getAllFocusable(a){const _=Array.from(a.querySelectorAll(focusableElSelector));return _.unshift(a),_.filter($=>isFocusable($)&&isVisible($))}var _a$3,FocusTrap=(_a$3=FocusLockCombination.default)!=null?_a$3:FocusLockCombination,FocusLock=a=>{const{initialFocusRef:_,finalFocusRef:$,contentRef:j,restoreFocus:et,children:tt,isDisabled:rt,autoFocus:nt,persistentFocus:it,lockFocusAcrossFrames:st}=a,ot=reactExports.useCallback(()=>{_!=null&&_.current?_.current.focus():j!=null&&j.current&&getAllFocusable(j.current).length===0&&requestAnimationFrame(()=>{var yt;(yt=j.current)==null||yt.focus()})},[_,j]),at=reactExports.useCallback(()=>{var ht;(ht=$==null?void 0:$.current)==null||ht.focus()},[$]),ut=et&&!$;return jsxRuntimeExports.jsx(FocusTrap,{crossFrame:st,persistentFocus:it,autoFocus:nt,disabled:rt,onActivation:ot,onDeactivation:at,returnFocus:ut,children:tt})};FocusLock.displayName="FocusLock";var useSafeLayoutEffect=isBrowser$2?reactExports.useLayoutEffect:reactExports.useEffect;function useCallbackRef(a,_=[]){const $=reactExports.useRef(a);return useSafeLayoutEffect(()=>{$.current=a}),reactExports.useCallback((...j)=>{var et;return(et=$.current)==null?void 0:et.call($,...j)},_)}function useOutsideClick$1(a){const{ref:_,handler:$,enabled:j=!0}=a,et=useCallbackRef($),rt=reactExports.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;reactExports.useEffect(()=>{if(!j)return;const nt=at=>{isValidEvent$1(at,_)&&(rt.isPointerDown=!0)},it=at=>{if(rt.ignoreEmulatedMouseEvents){rt.ignoreEmulatedMouseEvents=!1;return}rt.isPointerDown&&$&&isValidEvent$1(at,_)&&(rt.isPointerDown=!1,et(at))},st=at=>{rt.ignoreEmulatedMouseEvents=!0,$&&rt.isPointerDown&&isValidEvent$1(at,_)&&(rt.isPointerDown=!1,et(at))},ot=getOwnerDocument$3(_.current);return ot.addEventListener("mousedown",nt,!0),ot.addEventListener("mouseup",it,!0),ot.addEventListener("touchstart",nt,!0),ot.addEventListener("touchend",st,!0),()=>{ot.removeEventListener("mousedown",nt,!0),ot.removeEventListener("mouseup",it,!0),ot.removeEventListener("touchstart",nt,!0),ot.removeEventListener("touchend",st,!0)}},[$,_,et,rt,j])}function isValidEvent$1(a,_){var $;const j=a.target;return j&&!getOwnerDocument$3(j).contains(j)?!1:!(($=_.current)!=null&&$.contains(j))}function useId(a,_){const $=reactExports.useId();return reactExports.useMemo(()=>a||[_,$].filter(Boolean).join("-"),[a,_,$])}function useControllableProp(a,_){const $=a!==void 0;return[$,$&&typeof a<"u"?a:_]}function useDisclosure$1(a={}){const{onClose:_,onOpen:$,isOpen:j,id:et}=a,tt=useCallbackRef($),rt=useCallbackRef(_),[nt,it]=reactExports.useState(a.defaultIsOpen||!1),[st,ot]=useControllableProp(j,nt),at=useId(et,"disclosure"),ut=reactExports.useCallback(()=>{st||it(!1),rt==null||rt()},[st,rt]),ht=reactExports.useCallback(()=>{st||it(!0),tt==null||tt()},[st,tt]),yt=reactExports.useCallback(()=>{(ot?ut:ht)()},[ot,ht,ut]);return{isOpen:!!ot,onOpen:ht,onClose:ut,onToggle:yt,isControlled:st,getButtonProps:(wt={})=>({...wt,"aria-expanded":ot,"aria-controls":at,onClick:callAllHandlers(wt.onClick,yt)}),getDisclosureProps:(wt={})=>({...wt,hidden:!ot,id:at})}}var[InputGroupStylesProvider,useInputGroupStyles]=createContext$1({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),InputGroup=forwardRef(function(_,$){const j=useMultiStyleConfig("Input",_),{children:et,className:tt,...rt}=omitThemingProps(_),nt=cx("chakra-input__group",tt),it={},st=getValidChildren(et),ot=j.field;st.forEach(ut=>{var ht,yt;j&&(ot&&ut.type.id==="InputLeftElement"&&(it.paddingStart=(ht=ot.height)!=null?ht:ot.h),ot&&ut.type.id==="InputRightElement"&&(it.paddingEnd=(yt=ot.height)!=null?yt:ot.h),ut.type.id==="InputRightAddon"&&(it.borderEndRadius=0),ut.type.id==="InputLeftAddon"&&(it.borderStartRadius=0))});const at=st.map(ut=>{var ht,yt;const wt=compact$1({size:((ht=ut.props)==null?void 0:ht.size)||_.size,variant:((yt=ut.props)==null?void 0:yt.variant)||_.variant});return ut.type.id!=="Input"?reactExports.cloneElement(ut,wt):reactExports.cloneElement(ut,Object.assign(wt,it,ut.props))});return jsxRuntimeExports.jsx(chakra.div,{className:nt,ref:$,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...j.group},"data-group":!0,...rt,children:jsxRuntimeExports.jsx(InputGroupStylesProvider,{value:j,children:at})})});InputGroup.displayName="InputGroup";var StyledInputElement=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),InputElement=forwardRef(function(_,$){var j,et;const{placement:tt="left",...rt}=_,nt=useInputGroupStyles(),it=nt.field,ot={[tt==="left"?"insetStart":"insetEnd"]:"0",width:(j=it==null?void 0:it.height)!=null?j:it==null?void 0:it.h,height:(et=it==null?void 0:it.height)!=null?et:it==null?void 0:it.h,fontSize:it==null?void 0:it.fontSize,...nt.element};return jsxRuntimeExports.jsx(StyledInputElement,{ref:$,__css:ot,...rt})});InputElement.id="InputElement";InputElement.displayName="InputElement";var InputLeftElement=forwardRef(function(_,$){const{className:j,...et}=_,tt=cx("chakra-input__left-element",j);return jsxRuntimeExports.jsx(InputElement,{ref:$,placement:"left",className:tt,...et})});InputLeftElement.id="InputLeftElement";InputLeftElement.displayName="InputLeftElement";var InputRightElement=forwardRef(function(_,$){const{className:j,...et}=_,tt=cx("chakra-input__right-element",j);return jsxRuntimeExports.jsx(InputElement,{ref:$,placement:"right",className:tt,...et})});InputRightElement.id="InputRightElement";InputRightElement.displayName="InputRightElement";var Input=forwardRef(function(_,$){const{htmlSize:j,...et}=_,tt=useMultiStyleConfig("Input",et),rt=omitThemingProps(et),nt=useFormControl(rt),it=cx("chakra-input",_.className);return jsxRuntimeExports.jsx(chakra.input,{size:j,...nt,__css:tt.field,ref:$,className:it})});Input.displayName="Input";Input.id="Input";var Link$1=forwardRef(function(_,$){const j=useStyleConfig("Link",_),{className:et,isExternal:tt,...rt}=omitThemingProps(_);return jsxRuntimeExports.jsx(chakra.a,{target:tt?"_blank":void 0,rel:tt?"noopener":void 0,ref:$,className:cx("chakra-link",et),...rt,__css:j})});Link$1.displayName="Link";var[ListStylesProvider,useListStyles]=createContext$1({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),List=forwardRef(function(_,$){const j=useMultiStyleConfig("List",_),{children:et,styleType:tt="none",stylePosition:rt,spacing:nt,...it}=omitThemingProps(_),st=getValidChildren(et),at=nt?{["& > *:not(style) ~ *:not(style)"]:{mt:nt}}:{};return jsxRuntimeExports.jsx(ListStylesProvider,{value:j,children:jsxRuntimeExports.jsx(chakra.ul,{ref:$,listStyleType:tt,listStylePosition:rt,role:"list",__css:{...j.container,...at},...it,children:st})})});List.displayName="List";var OrderedList=forwardRef((a,_)=>{const{as:$,...j}=a;return jsxRuntimeExports.jsx(List,{ref:_,as:"ol",styleType:"decimal",marginStart:"1em",...j})});OrderedList.displayName="OrderedList";var UnorderedList=forwardRef(function(_,$){const{as:j,...et}=_;return jsxRuntimeExports.jsx(List,{ref:$,as:"ul",styleType:"initial",marginStart:"1em",...et})});UnorderedList.displayName="UnorderedList";var ListItem=forwardRef(function(_,$){const j=useListStyles();return jsxRuntimeExports.jsx(chakra.li,{ref:$,..._,__css:j.item})});ListItem.displayName="ListItem";var ListIcon=forwardRef(function(_,$){const j=useListStyles();return jsxRuntimeExports.jsx(Icon,{ref:$,role:"presentation",..._,__css:j.icon})});ListIcon.displayName="ListIcon";var Grid=forwardRef(function(_,$){const{templateAreas:j,gap:et,rowGap:tt,columnGap:rt,column:nt,row:it,autoFlow:st,autoRows:ot,templateRows:at,autoColumns:ut,templateColumns:ht,...yt}=_,wt={display:"grid",gridTemplateAreas:j,gridGap:et,gridRowGap:tt,gridColumnGap:rt,gridAutoColumns:ut,gridColumn:nt,gridRow:it,gridAutoFlow:st,gridAutoRows:ot,gridTemplateRows:at,gridTemplateColumns:ht};return jsxRuntimeExports.jsx(chakra.div,{ref:$,__css:wt,...yt})});Grid.displayName="Grid";function mapResponsive(a,_){return Array.isArray(a)?a.map($=>$===null?null:_($)):isObject$5(a)?Object.keys(a).reduce(($,j)=>($[j]=_(a[j]),$),{}):a!=null?_(a):null}var SimpleGrid=forwardRef(function(_,$){const{columns:j,spacingX:et,spacingY:tt,spacing:rt,minChildWidth:nt,...it}=_,st=useTheme(),ot=nt?widthToColumns(nt,st):countToColumns(j);return jsxRuntimeExports.jsx(Grid,{ref:$,gap:rt,columnGap:et,rowGap:tt,templateColumns:ot,...it})});SimpleGrid.displayName="SimpleGrid";function toPx(a){return typeof a=="number"?`${a}px`:a}function widthToColumns(a,_){return mapResponsive(a,$=>{const j=getToken("sizes",$,toPx($))(_);return $===null?null:`repeat(auto-fit, minmax(${j}, 1fr))`})}function countToColumns(a){return mapResponsive(a,_=>_===null?null:`repeat(${_}, minmax(0, 1fr))`)}var Text=forwardRef(function(_,$){const j=useStyleConfig("Text",_),{className:et,align:tt,decoration:rt,casing:nt,...it}=omitThemingProps(_),st=compact$1({textAlign:_.align,textDecoration:_.decoration,textTransform:_.casing});return jsxRuntimeExports.jsx(chakra.p,{ref:$,className:cx("chakra-text",_.className),...st,...it,__css:j})});Text.displayName="Text";var Wrap=forwardRef(function(_,$){const{spacing:j="0.5rem",spacingX:et,spacingY:tt,children:rt,justify:nt,direction:it,align:st,className:ot,shouldWrapChildren:at,...ut}=_,ht=reactExports.useMemo(()=>at?reactExports.Children.map(rt,(yt,wt)=>jsxRuntimeExports.jsx(WrapItem,{children:yt},wt)):rt,[rt,at]);return jsxRuntimeExports.jsx(chakra.div,{ref:$,className:cx("chakra-wrap",ot),...ut,children:jsxRuntimeExports.jsx(chakra.ul,{className:"chakra-wrap__list",__css:{display:"flex",flexWrap:"wrap",justifyContent:nt,alignItems:st,flexDirection:it,listStyleType:"none",gap:j,columnGap:et,rowGap:tt,padding:"0"},children:ht})})});Wrap.displayName="Wrap";var WrapItem=forwardRef(function(_,$){const{className:j,...et}=_;return jsxRuntimeExports.jsx(chakra.li,{ref:$,__css:{display:"flex",alignItems:"flex-start"},className:cx("chakra-wrap__listitem",j),...et})});WrapItem.displayName="WrapItem";var StackItem=a=>jsxRuntimeExports.jsx(chakra.div,{className:"chakra-stack__item",...a,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...a.__css}});StackItem.displayName="StackItem";function getDividerStyles(a){const{spacing:_,direction:$}=a,j={column:{my:_,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:_,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:_,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:_,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":mapResponsive($,et=>j[et])}}var Stack=forwardRef((a,_)=>{const{isInline:$,direction:j,align:et,justify:tt,spacing:rt="0.5rem",wrap:nt,children:it,divider:st,className:ot,shouldWrapChildren:at,...ut}=a,ht=$?"row":j??"column",yt=reactExports.useMemo(()=>getDividerStyles({spacing:rt,direction:ht}),[rt,ht]),wt=!!st,Ct=!at&&!wt,Pt=reactExports.useMemo(()=>{const Mt=getValidChildren(it);return Ct?Mt:Mt.map((Bt,Dt)=>{const zt=typeof Bt.key<"u"?Bt.key:Dt,Ot=Dt+1===Mt.length,Lt=at?jsxRuntimeExports.jsx(StackItem,{children:Bt},zt):Bt;if(!wt)return Lt;const Ft=reactExports.cloneElement(st,{__css:yt}),jt=Ot?null:Ft;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Lt,jt]},zt)})},[st,yt,wt,Ct,at,it]),$t=cx("chakra-stack",ot);return jsxRuntimeExports.jsx(chakra.div,{ref:_,display:"flex",alignItems:et,justifyContent:tt,flexDirection:ht,flexWrap:nt,gap:wt?void 0:rt,className:$t,...ut,children:Pt})});Stack.displayName="Stack";var VStack=forwardRef((a,_)=>jsxRuntimeExports.jsx(Stack,{align:"center",...a,direction:"column",ref:_}));VStack.displayName="VStack";function spanFn(a){return mapResponsive(a,_=>_==="auto"?"auto":`span ${_}/span ${_}`)}var GridItem=forwardRef(function(_,$){const{area:j,colSpan:et,colStart:tt,colEnd:rt,rowEnd:nt,rowSpan:it,rowStart:st,...ot}=_,at=compact$1({gridArea:j,gridColumn:spanFn(et),gridRow:spanFn(it),gridColumnStart:tt,gridColumnEnd:rt,gridRowStart:st,gridRowEnd:nt});return jsxRuntimeExports.jsx(chakra.div,{ref:$,__css:at,...ot})});GridItem.displayName="GridItem";var Heading=forwardRef(function(_,$){const j=useStyleConfig("Heading",_),{className:et,...tt}=omitThemingProps(_);return jsxRuntimeExports.jsx(chakra.h2,{ref:$,className:cx("chakra-heading",_.className),...tt,__css:j})});Heading.displayName="Heading";var Box=chakra("div");Box.displayName="Box";var Square=forwardRef(function(_,$){const{size:j,centerContent:et=!0,...tt}=_,rt=et?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return jsxRuntimeExports.jsx(Box,{ref:$,boxSize:j,__css:{...rt,flexShrink:0,flexGrow:0},...tt})});Square.displayName="Square";var Circle=forwardRef(function(_,$){const{size:j,...et}=_;return jsxRuntimeExports.jsx(Square,{size:j,ref:$,borderRadius:"9999px",...et})});Circle.displayName="Circle";var AspectRatio=forwardRef(function(a,_){const{ratio:$=4/3,children:j,className:et,...tt}=a,rt=reactExports.Children.only(j),nt=cx("chakra-aspect-ratio",et);return jsxRuntimeExports.jsx(chakra.div,{ref:_,position:"relative",className:nt,_before:{height:0,content:'""',display:"block",paddingBottom:mapResponsive($,it=>`${1/it*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...tt,children:rt})});AspectRatio.displayName="AspectRatio";var Center=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Center.displayName="Center";var centerStyles={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};forwardRef(function(_,$){const{axis:j="both",...et}=_;return jsxRuntimeExports.jsx(chakra.div,{ref:$,__css:centerStyles[j],...et,position:"absolute"})});var Divider=forwardRef(function(_,$){const{borderLeftWidth:j,borderBottomWidth:et,borderTopWidth:tt,borderRightWidth:rt,borderWidth:nt,borderStyle:it,borderColor:st,...ot}=useStyleConfig("Divider",_),{className:at,orientation:ut="horizontal",__css:ht,...yt}=omitThemingProps(_),wt={vertical:{borderLeftWidth:j||rt||nt||"1px",height:"100%"},horizontal:{borderBottomWidth:et||tt||nt||"1px",width:"100%"}};return jsxRuntimeExports.jsx(chakra.hr,{ref:$,"aria-orientation":ut,...yt,__css:{...ot,border:"0",borderColor:st,borderStyle:it,...wt[ut],...ht},className:cx("chakra-divider",at)})});Divider.displayName="Divider";var Flex=forwardRef(function(_,$){const{direction:j,align:et,justify:tt,wrap:rt,basis:nt,grow:it,shrink:st,...ot}=_,at={display:"flex",flexDirection:j,alignItems:et,justifyContent:tt,flexWrap:rt,flexBasis:nt,flexGrow:it,flexShrink:st};return jsxRuntimeExports.jsx(chakra.div,{ref:$,__css:at,...ot})});Flex.displayName="Flex";function useMediaQuery(a,_={}){const{ssr:$=!0,fallback:j}=_,{getWindow:et}=useEnvironment(),tt=Array.isArray(a)?a:[a];let rt=Array.isArray(j)?j:[j];rt=rt.filter(st=>st!=null);const[nt,it]=reactExports.useState(()=>tt.map((st,ot)=>({media:st,matches:$?!!rt[ot]:et().matchMedia(st).matches})));return reactExports.useEffect(()=>{const st=et();it(tt.map(ut=>({media:ut,matches:st.matchMedia(ut).matches})));const ot=tt.map(ut=>st.matchMedia(ut)),at=ut=>{it(ht=>ht.slice().map(yt=>yt.media===ut.media?{...yt,matches:ut.matches}:yt))};return ot.forEach(ut=>{typeof ut.addListener=="function"?ut.addListener(at):ut.addEventListener("change",at)}),()=>{ot.forEach(ut=>{typeof ut.removeListener=="function"?ut.removeListener(at):ut.removeEventListener("change",at)})}},[et]),nt.map(st=>st.matches)}function isPrintableCharacter(a){const{key:_}=a;return _.length===1||_.length>1&&/[^a-zA-Z0-9]/.test(_)}function useShortcut(a={}){const{timeout:_=300,preventDefault:$=()=>!0}=a,[j,et]=reactExports.useState([]),tt=reactExports.useRef(),rt=()=>{tt.current&&(clearTimeout(tt.current),tt.current=null)},nt=()=>{rt(),tt.current=setTimeout(()=>{et([]),tt.current=null},_)};reactExports.useEffect(()=>rt,[]);function it(st){return ot=>{if(ot.key==="Backspace"){const at=[...j];at.pop(),et(at);return}if(isPrintableCharacter(ot)){const at=j.concat(ot.key);$(ot)&&(ot.preventDefault(),ot.stopPropagation()),et(at),st(at.join("")),nt()}}}return it}function getNextItemFromSearch(a,_,$,j){if(_==null)return j;if(!j)return a.find(rt=>$(rt).toLowerCase().startsWith(_.toLowerCase()));const et=a.filter(tt=>$(tt).toLowerCase().startsWith(_.toLowerCase()));if(et.length>0){let tt;return et.includes(j)?(tt=et.indexOf(j)+1,tt===et.length&&(tt=0),et[tt]):(tt=a.indexOf(et[0]),a[tt])}return j}function useEventListeners(){const a=reactExports.useRef(new Map),_=a.current,$=reactExports.useCallback((et,tt,rt,nt)=>{a.current.set(rt,{type:tt,el:et,options:nt}),et.addEventListener(tt,rt,nt)},[]),j=reactExports.useCallback((et,tt,rt,nt)=>{et.removeEventListener(tt,rt,nt),a.current.delete(rt)},[]);return reactExports.useEffect(()=>()=>{_.forEach((et,tt)=>{j(et.el,et.type,tt,et.options)})},[j,_]),{add:$,remove:j}}function isValidElement(a){const _=a.target,{tagName:$,isContentEditable:j}=_;return $!=="INPUT"&&$!=="TEXTAREA"&&j!==!0}function useClickable(a={}){const{ref:_,isDisabled:$,isFocusable:j,clickOnEnter:et=!0,clickOnSpace:tt=!0,onMouseDown:rt,onMouseUp:nt,onClick:it,onKeyDown:st,onKeyUp:ot,tabIndex:at,onMouseOver:ut,onMouseLeave:ht,...yt}=a,[wt,Ct]=reactExports.useState(!0),[Pt,$t]=reactExports.useState(!1),Mt=useEventListeners(),Bt=xt=>{xt&&xt.tagName!=="BUTTON"&&Ct(!1)},Dt=wt?at:at||0,zt=$&&!j,Ot=reactExports.useCallback(xt=>{if($){xt.stopPropagation(),xt.preventDefault();return}xt.currentTarget.focus(),it==null||it(xt)},[$,it]),It=reactExports.useCallback(xt=>{Pt&&isValidElement(xt)&&(xt.preventDefault(),xt.stopPropagation(),$t(!1),Mt.remove(document,"keyup",It,!1))},[Pt,Mt]),Lt=reactExports.useCallback(xt=>{if(st==null||st(xt),$||xt.defaultPrevented||xt.metaKey||!isValidElement(xt.nativeEvent)||wt)return;const At=et&&xt.key==="Enter";tt&&xt.key===" "&&(xt.preventDefault(),$t(!0)),At&&(xt.preventDefault(),xt.currentTarget.click()),Mt.add(document,"keyup",It,!1)},[$,wt,st,et,tt,Mt,It]),Ft=reactExports.useCallback(xt=>{if(ot==null||ot(xt),$||xt.defaultPrevented||xt.metaKey||!isValidElement(xt.nativeEvent)||wt)return;tt&&xt.key===" "&&(xt.preventDefault(),$t(!1),xt.currentTarget.click())},[tt,wt,$,ot]),jt=reactExports.useCallback(xt=>{xt.button===0&&($t(!1),Mt.remove(document,"mouseup",jt,!1))},[Mt]),bt=reactExports.useCallback(xt=>{if(xt.button!==0)return;if($){xt.stopPropagation(),xt.preventDefault();return}wt||$t(!0),xt.currentTarget.focus({preventScroll:!0}),Mt.add(document,"mouseup",jt,!1),rt==null||rt(xt)},[$,wt,rt,Mt,jt]),vt=reactExports.useCallback(xt=>{xt.button===0&&(wt||$t(!1),nt==null||nt(xt))},[nt,wt]),ct=reactExports.useCallback(xt=>{if($){xt.preventDefault();return}ut==null||ut(xt)},[$,ut]),dt=reactExports.useCallback(xt=>{Pt&&(xt.preventDefault(),$t(!1)),ht==null||ht(xt)},[Pt,ht]),mt=mergeRefs(_,Bt);return wt?{...yt,ref:mt,type:"button","aria-disabled":zt?void 0:$,disabled:zt,onClick:Ot,onMouseDown:rt,onMouseUp:nt,onKeyUp:ot,onKeyDown:st,onMouseOver:ut,onMouseLeave:ht}:{...yt,ref:mt,role:"button","data-active":dataAttr(Pt),"aria-disabled":$?"true":void 0,tabIndex:zt?void 0:Dt,onClick:Ot,onMouseDown:bt,onMouseUp:vt,onKeyUp:Ft,onKeyDown:Lt,onMouseOver:ct,onMouseLeave:dt}}function preventReturnFocus(a){const _=a.current;if(!_)return!1;const $=getActiveElement(_);return!$||_.contains($)?!1:!!isTabbable($)}function useFocusOnHide(a,_){const{shouldFocus:$,visible:j,focusRef:et}=_,tt=$&&!j;useUpdateEffect(()=>{if(!tt||preventReturnFocus(a))return;const rt=(et==null?void 0:et.current)||a.current;let nt;if(rt)return nt=requestAnimationFrame(()=>{rt.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(nt)}},[tt,a,et])}var defaultOptions$2={preventScroll:!0,shouldFocus:!1};function useFocusOnShow(a,_=defaultOptions$2){const{focusRef:$,preventScroll:j,shouldFocus:et,visible:tt}=_,rt=isRefObject(a)?a.current:a,nt=et&&tt,it=reactExports.useRef(nt),st=reactExports.useRef(tt);useSafeLayoutEffect$2(()=>{!st.current&&tt&&(it.current=nt),st.current=tt},[tt,nt]);const ot=reactExports.useCallback(()=>{if(!(!tt||!rt||!it.current)&&(it.current=!1,!rt.contains(document.activeElement)))if($!=null&&$.current)requestAnimationFrame(()=>{var at;(at=$.current)==null||at.focus({preventScroll:j})});else{const at=getAllFocusable(rt);at.length>0&&requestAnimationFrame(()=>{at[0].focus({preventScroll:j})})}},[tt,j,rt,$]);useUpdateEffect(()=>{ot()},[ot]),useEventListener(rt,"transitionend",ot)}function isRefObject(a){return"current"in a}var toVar=(a,_)=>({var:a,varRef:_?`var(${a}, ${_})`:`var(${a})`}),cssVars={arrowShadowColor:toVar("--popper-arrow-shadow-color"),arrowSize:toVar("--popper-arrow-size","8px"),arrowSizeHalf:toVar("--popper-arrow-size-half"),arrowBg:toVar("--popper-arrow-bg"),transformOrigin:toVar("--popper-transform-origin"),arrowOffset:toVar("--popper-arrow-offset")};function getBoxShadow(a){if(a.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(a.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(a.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(a.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var transforms={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},toTransformOrigin=a=>transforms[a],defaultEventListeners={scroll:!0,resize:!0};function getEventListenerOptions(a){let _;return typeof a=="object"?_={enabled:!0,options:{...defaultEventListeners,...a}}:_={enabled:a,options:defaultEventListeners},_}var matchWidth={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:a})=>{a.styles.popper.width=`${a.rects.reference.width}px`},effect:({state:a})=>()=>{const _=a.elements.reference;a.elements.popper.style.width=`${_.offsetWidth}px`}},transformOrigin={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:a})=>{setTransformOrigin(a)},effect:({state:a})=>()=>{setTransformOrigin(a)}},setTransformOrigin=a=>{a.elements.popper.style.setProperty(cssVars.transformOrigin.var,toTransformOrigin(a.placement))},positionArrow={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:a})=>{setArrowStyles(a)}},setArrowStyles=a=>{var _;if(!a.placement)return;const $=getArrowStyle$1(a.placement);if((_=a.elements)!=null&&_.arrow&&$){Object.assign(a.elements.arrow.style,{[$.property]:$.value,width:cssVars.arrowSize.varRef,height:cssVars.arrowSize.varRef,zIndex:-1});const j={[cssVars.arrowSizeHalf.var]:`calc(${cssVars.arrowSize.varRef} / 2 - 1px)`,[cssVars.arrowOffset.var]:`calc(${cssVars.arrowSizeHalf.varRef} * -1)`};for(const et in j)a.elements.arrow.style.setProperty(et,j[et])}},getArrowStyle$1=a=>{if(a.startsWith("top"))return{property:"bottom",value:cssVars.arrowOffset.varRef};if(a.startsWith("bottom"))return{property:"top",value:cssVars.arrowOffset.varRef};if(a.startsWith("left"))return{property:"right",value:cssVars.arrowOffset.varRef};if(a.startsWith("right"))return{property:"left",value:cssVars.arrowOffset.varRef}},innerArrow={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:a})=>{setInnerArrowStyles(a)},effect:({state:a})=>()=>{setInnerArrowStyles(a)}},setInnerArrowStyles=a=>{if(!a.elements.arrow)return;const _=a.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!_)return;const $=getBoxShadow(a.placement);$&&_.style.setProperty("--popper-arrow-default-shadow",$),Object.assign(_.style,{transform:"rotate(45deg)",background:cssVars.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},logicals={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},opposites={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function getPopperPlacement(a,_="ltr"){var $,j;const et=(($=logicals[a])==null?void 0:$[_])||a;return _==="ltr"?et:(j=opposites[a])!=null?j:et}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(a,_){return a.concat([_+"-"+start,_+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(a,_){return a.concat([_,_+"-"+start,_+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main$4="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main$4,afterMain,beforeWrite,write,afterWrite];function getNodeName(a){return a?(a.nodeName||"").toLowerCase():null}function getWindow(a){if(a==null)return window;if(a.toString()!=="[object Window]"){var _=a.ownerDocument;return _&&_.defaultView||window}return a}function isElement$1(a){var _=getWindow(a).Element;return a instanceof _||a instanceof Element}function isHTMLElement$2(a){var _=getWindow(a).HTMLElement;return a instanceof _||a instanceof HTMLElement}function isShadowRoot(a){if(typeof ShadowRoot>"u")return!1;var _=getWindow(a).ShadowRoot;return a instanceof _||a instanceof ShadowRoot}function applyStyles(a){var _=a.state;Object.keys(_.elements).forEach(function($){var j=_.styles[$]||{},et=_.attributes[$]||{},tt=_.elements[$];!isHTMLElement$2(tt)||!getNodeName(tt)||(Object.assign(tt.style,j),Object.keys(et).forEach(function(rt){var nt=et[rt];nt===!1?tt.removeAttribute(rt):tt.setAttribute(rt,nt===!0?"":nt)}))})}function effect$2(a){var _=a.state,$={popper:{position:_.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(_.elements.popper.style,$.popper),_.styles=$,_.elements.arrow&&Object.assign(_.elements.arrow.style,$.arrow),function(){Object.keys(_.elements).forEach(function(j){var et=_.elements[j],tt=_.attributes[j]||{},rt=Object.keys(_.styles.hasOwnProperty(j)?_.styles[j]:$[j]),nt=rt.reduce(function(it,st){return it[st]="",it},{});!isHTMLElement$2(et)||!getNodeName(et)||(Object.assign(et.style,nt),Object.keys(tt).forEach(function(it){et.removeAttribute(it)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(a){return a.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function getUAString(){var a=navigator.userAgentData;return a!=null&&a.brands&&Array.isArray(a.brands)?a.brands.map(function(_){return _.brand+"/"+_.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(a,_,$){_===void 0&&(_=!1),$===void 0&&($=!1);var j=a.getBoundingClientRect(),et=1,tt=1;_&&isHTMLElement$2(a)&&(et=a.offsetWidth>0&&round(j.width)/a.offsetWidth||1,tt=a.offsetHeight>0&&round(j.height)/a.offsetHeight||1);var rt=isElement$1(a)?getWindow(a):window,nt=rt.visualViewport,it=!isLayoutViewport()&&$,st=(j.left+(it&&nt?nt.offsetLeft:0))/et,ot=(j.top+(it&&nt?nt.offsetTop:0))/tt,at=j.width/et,ut=j.height/tt;return{width:at,height:ut,top:ot,right:st+at,bottom:ot+ut,left:st,x:st,y:ot}}function getLayoutRect(a){var _=getBoundingClientRect(a),$=a.offsetWidth,j=a.offsetHeight;return Math.abs(_.width-$)<=1&&($=_.width),Math.abs(_.height-j)<=1&&(j=_.height),{x:a.offsetLeft,y:a.offsetTop,width:$,height:j}}function contains$1(a,_){var $=_.getRootNode&&_.getRootNode();if(a.contains(_))return!0;if($&&isShadowRoot($)){var j=_;do{if(j&&a.isSameNode(j))return!0;j=j.parentNode||j.host}while(j)}return!1}function getComputedStyle$1(a){return getWindow(a).getComputedStyle(a)}function isTableElement(a){return["table","td","th"].indexOf(getNodeName(a))>=0}function getDocumentElement(a){return((isElement$1(a)?a.ownerDocument:a.document)||window.document).documentElement}function getParentNode(a){return getNodeName(a)==="html"?a:a.assignedSlot||a.parentNode||(isShadowRoot(a)?a.host:null)||getDocumentElement(a)}function getTrueOffsetParent(a){return!isHTMLElement$2(a)||getComputedStyle$1(a).position==="fixed"?null:a.offsetParent}function getContainingBlock(a){var _=/firefox/i.test(getUAString()),$=/Trident/i.test(getUAString());if($&&isHTMLElement$2(a)){var j=getComputedStyle$1(a);if(j.position==="fixed")return null}var et=getParentNode(a);for(isShadowRoot(et)&&(et=et.host);isHTMLElement$2(et)&&["html","body"].indexOf(getNodeName(et))<0;){var tt=getComputedStyle$1(et);if(tt.transform!=="none"||tt.perspective!=="none"||tt.contain==="paint"||["transform","perspective"].indexOf(tt.willChange)!==-1||_&&tt.willChange==="filter"||_&&tt.filter&&tt.filter!=="none")return et;et=et.parentNode}return null}function getOffsetParent(a){for(var _=getWindow(a),$=getTrueOffsetParent(a);$&&isTableElement($)&&getComputedStyle$1($).position==="static";)$=getTrueOffsetParent($);return $&&(getNodeName($)==="html"||getNodeName($)==="body"&&getComputedStyle$1($).position==="static")?_:$||getContainingBlock(a)||_}function getMainAxisFromPlacement(a){return["top","bottom"].indexOf(a)>=0?"x":"y"}function within(a,_,$){return max(a,min(_,$))}function withinMaxClamp(a,_,$){var j=within(a,_,$);return j>$?$:j}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(a){return Object.assign({},getFreshSideObject(),a)}function expandToHashMap(a,_){return _.reduce(function($,j){return $[j]=a,$},{})}var toPaddingObject=function(_,$){return _=typeof _=="function"?_(Object.assign({},$.rects,{placement:$.placement})):_,mergePaddingObject(typeof _!="number"?_:expandToHashMap(_,basePlacements))};function arrow(a){var _,$=a.state,j=a.name,et=a.options,tt=$.elements.arrow,rt=$.modifiersData.popperOffsets,nt=getBasePlacement($.placement),it=getMainAxisFromPlacement(nt),st=[left,right].indexOf(nt)>=0,ot=st?"height":"width";if(!(!tt||!rt)){var at=toPaddingObject(et.padding,$),ut=getLayoutRect(tt),ht=it==="y"?top:left,yt=it==="y"?bottom:right,wt=$.rects.reference[ot]+$.rects.reference[it]-rt[it]-$.rects.popper[ot],Ct=rt[it]-$.rects.reference[it],Pt=getOffsetParent(tt),$t=Pt?it==="y"?Pt.clientHeight||0:Pt.clientWidth||0:0,Mt=wt/2-Ct/2,Bt=at[ht],Dt=$t-ut[ot]-at[yt],zt=$t/2-ut[ot]/2+Mt,Ot=within(Bt,zt,Dt),It=it;$.modifiersData[j]=(_={},_[It]=Ot,_.centerOffset=Ot-zt,_)}}function effect$1(a){var _=a.state,$=a.options,j=$.element,et=j===void 0?"[data-popper-arrow]":j;et!=null&&(typeof et=="string"&&(et=_.elements.popper.querySelector(et),!et)||contains$1(_.elements.popper,et)&&(_.elements.arrow=et))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(a){return a.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(a,_){var $=a.x,j=a.y,et=_.devicePixelRatio||1;return{x:round($*et)/et||0,y:round(j*et)/et||0}}function mapToStyles(a){var _,$=a.popper,j=a.popperRect,et=a.placement,tt=a.variation,rt=a.offsets,nt=a.position,it=a.gpuAcceleration,st=a.adaptive,ot=a.roundOffsets,at=a.isFixed,ut=rt.x,ht=ut===void 0?0:ut,yt=rt.y,wt=yt===void 0?0:yt,Ct=typeof ot=="function"?ot({x:ht,y:wt}):{x:ht,y:wt};ht=Ct.x,wt=Ct.y;var Pt=rt.hasOwnProperty("x"),$t=rt.hasOwnProperty("y"),Mt=left,Bt=top,Dt=window;if(st){var zt=getOffsetParent($),Ot="clientHeight",It="clientWidth";if(zt===getWindow($)&&(zt=getDocumentElement($),getComputedStyle$1(zt).position!=="static"&&nt==="absolute"&&(Ot="scrollHeight",It="scrollWidth")),zt=zt,et===top||(et===left||et===right)&&tt===end){Bt=bottom;var Lt=at&&zt===Dt&&Dt.visualViewport?Dt.visualViewport.height:zt[Ot];wt-=Lt-j.height,wt*=it?1:-1}if(et===left||(et===top||et===bottom)&&tt===end){Mt=right;var Ft=at&&zt===Dt&&Dt.visualViewport?Dt.visualViewport.width:zt[It];ht-=Ft-j.width,ht*=it?1:-1}}var jt=Object.assign({position:nt},st&&unsetSides),bt=ot===!0?roundOffsetsByDPR({x:ht,y:wt},getWindow($)):{x:ht,y:wt};if(ht=bt.x,wt=bt.y,it){var vt;return Object.assign({},jt,(vt={},vt[Bt]=$t?"0":"",vt[Mt]=Pt?"0":"",vt.transform=(Dt.devicePixelRatio||1)<=1?"translate("+ht+"px, "+wt+"px)":"translate3d("+ht+"px, "+wt+"px, 0)",vt))}return Object.assign({},jt,(_={},_[Bt]=$t?wt+"px":"",_[Mt]=Pt?ht+"px":"",_.transform="",_))}function computeStyles(a){var _=a.state,$=a.options,j=$.gpuAcceleration,et=j===void 0?!0:j,tt=$.adaptive,rt=tt===void 0?!0:tt,nt=$.roundOffsets,it=nt===void 0?!0:nt,st={placement:getBasePlacement(_.placement),variation:getVariation(_.placement),popper:_.elements.popper,popperRect:_.rects.popper,gpuAcceleration:et,isFixed:_.options.strategy==="fixed"};_.modifiersData.popperOffsets!=null&&(_.styles.popper=Object.assign({},_.styles.popper,mapToStyles(Object.assign({},st,{offsets:_.modifiersData.popperOffsets,position:_.options.strategy,adaptive:rt,roundOffsets:it})))),_.modifiersData.arrow!=null&&(_.styles.arrow=Object.assign({},_.styles.arrow,mapToStyles(Object.assign({},st,{offsets:_.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:it})))),_.attributes.popper=Object.assign({},_.attributes.popper,{"data-popper-placement":_.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(a){var _=a.state,$=a.instance,j=a.options,et=j.scroll,tt=et===void 0?!0:et,rt=j.resize,nt=rt===void 0?!0:rt,it=getWindow(_.elements.popper),st=[].concat(_.scrollParents.reference,_.scrollParents.popper);return tt&&st.forEach(function(ot){ot.addEventListener("scroll",$.update,passive)}),nt&&it.addEventListener("resize",$.update,passive),function(){tt&&st.forEach(function(ot){ot.removeEventListener("scroll",$.update,passive)}),nt&&it.removeEventListener("resize",$.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$7={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(a){return a.replace(/left|right|bottom|top/g,function(_){return hash$7[_]})}var hash$6={start:"end",end:"start"};function getOppositeVariationPlacement(a){return a.replace(/start|end/g,function(_){return hash$6[_]})}function getWindowScroll(a){var _=getWindow(a),$=_.pageXOffset,j=_.pageYOffset;return{scrollLeft:$,scrollTop:j}}function getWindowScrollBarX(a){return getBoundingClientRect(getDocumentElement(a)).left+getWindowScroll(a).scrollLeft}function getViewportRect(a,_){var $=getWindow(a),j=getDocumentElement(a),et=$.visualViewport,tt=j.clientWidth,rt=j.clientHeight,nt=0,it=0;if(et){tt=et.width,rt=et.height;var st=isLayoutViewport();(st||!st&&_==="fixed")&&(nt=et.offsetLeft,it=et.offsetTop)}return{width:tt,height:rt,x:nt+getWindowScrollBarX(a),y:it}}function getDocumentRect(a){var _,$=getDocumentElement(a),j=getWindowScroll(a),et=(_=a.ownerDocument)==null?void 0:_.body,tt=max($.scrollWidth,$.clientWidth,et?et.scrollWidth:0,et?et.clientWidth:0),rt=max($.scrollHeight,$.clientHeight,et?et.scrollHeight:0,et?et.clientHeight:0),nt=-j.scrollLeft+getWindowScrollBarX(a),it=-j.scrollTop;return getComputedStyle$1(et||$).direction==="rtl"&&(nt+=max($.clientWidth,et?et.clientWidth:0)-tt),{width:tt,height:rt,x:nt,y:it}}function isScrollParent(a){var _=getComputedStyle$1(a),$=_.overflow,j=_.overflowX,et=_.overflowY;return/auto|scroll|overlay|hidden/.test($+et+j)}function getScrollParent(a){return["html","body","#document"].indexOf(getNodeName(a))>=0?a.ownerDocument.body:isHTMLElement$2(a)&&isScrollParent(a)?a:getScrollParent(getParentNode(a))}function listScrollParents(a,_){var $;_===void 0&&(_=[]);var j=getScrollParent(a),et=j===(($=a.ownerDocument)==null?void 0:$.body),tt=getWindow(j),rt=et?[tt].concat(tt.visualViewport||[],isScrollParent(j)?j:[]):j,nt=_.concat(rt);return et?nt:nt.concat(listScrollParents(getParentNode(rt)))}function rectToClientRect(a){return Object.assign({},a,{left:a.x,top:a.y,right:a.x+a.width,bottom:a.y+a.height})}function getInnerBoundingClientRect(a,_){var $=getBoundingClientRect(a,!1,_==="fixed");return $.top=$.top+a.clientTop,$.left=$.left+a.clientLeft,$.bottom=$.top+a.clientHeight,$.right=$.left+a.clientWidth,$.width=a.clientWidth,$.height=a.clientHeight,$.x=$.left,$.y=$.top,$}function getClientRectFromMixedType(a,_,$){return _===viewport?rectToClientRect(getViewportRect(a,$)):isElement$1(_)?getInnerBoundingClientRect(_,$):rectToClientRect(getDocumentRect(getDocumentElement(a)))}function getClippingParents(a){var _=listScrollParents(getParentNode(a)),$=["absolute","fixed"].indexOf(getComputedStyle$1(a).position)>=0,j=$&&isHTMLElement$2(a)?getOffsetParent(a):a;return isElement$1(j)?_.filter(function(et){return isElement$1(et)&&contains$1(et,j)&&getNodeName(et)!=="body"}):[]}function getClippingRect(a,_,$,j){var et=_==="clippingParents"?getClippingParents(a):[].concat(_),tt=[].concat(et,[$]),rt=tt[0],nt=tt.reduce(function(it,st){var ot=getClientRectFromMixedType(a,st,j);return it.top=max(ot.top,it.top),it.right=min(ot.right,it.right),it.bottom=min(ot.bottom,it.bottom),it.left=max(ot.left,it.left),it},getClientRectFromMixedType(a,rt,j));return nt.width=nt.right-nt.left,nt.height=nt.bottom-nt.top,nt.x=nt.left,nt.y=nt.top,nt}function computeOffsets(a){var _=a.reference,$=a.element,j=a.placement,et=j?getBasePlacement(j):null,tt=j?getVariation(j):null,rt=_.x+_.width/2-$.width/2,nt=_.y+_.height/2-$.height/2,it;switch(et){case top:it={x:rt,y:_.y-$.height};break;case bottom:it={x:rt,y:_.y+_.height};break;case right:it={x:_.x+_.width,y:nt};break;case left:it={x:_.x-$.width,y:nt};break;default:it={x:_.x,y:_.y}}var st=et?getMainAxisFromPlacement(et):null;if(st!=null){var ot=st==="y"?"height":"width";switch(tt){case start:it[st]=it[st]-(_[ot]/2-$[ot]/2);break;case end:it[st]=it[st]+(_[ot]/2-$[ot]/2);break}}return it}function detectOverflow(a,_){_===void 0&&(_={});var $=_,j=$.placement,et=j===void 0?a.placement:j,tt=$.strategy,rt=tt===void 0?a.strategy:tt,nt=$.boundary,it=nt===void 0?clippingParents:nt,st=$.rootBoundary,ot=st===void 0?viewport:st,at=$.elementContext,ut=at===void 0?popper:at,ht=$.altBoundary,yt=ht===void 0?!1:ht,wt=$.padding,Ct=wt===void 0?0:wt,Pt=mergePaddingObject(typeof Ct!="number"?Ct:expandToHashMap(Ct,basePlacements)),$t=ut===popper?reference:popper,Mt=a.rects.popper,Bt=a.elements[yt?$t:ut],Dt=getClippingRect(isElement$1(Bt)?Bt:Bt.contextElement||getDocumentElement(a.elements.popper),it,ot,rt),zt=getBoundingClientRect(a.elements.reference),Ot=computeOffsets({reference:zt,element:Mt,strategy:"absolute",placement:et}),It=rectToClientRect(Object.assign({},Mt,Ot)),Lt=ut===popper?It:zt,Ft={top:Dt.top-Lt.top+Pt.top,bottom:Lt.bottom-Dt.bottom+Pt.bottom,left:Dt.left-Lt.left+Pt.left,right:Lt.right-Dt.right+Pt.right},jt=a.modifiersData.offset;if(ut===popper&&jt){var bt=jt[et];Object.keys(Ft).forEach(function(vt){var ct=[right,bottom].indexOf(vt)>=0?1:-1,dt=[top,bottom].indexOf(vt)>=0?"y":"x";Ft[vt]+=bt[dt]*ct})}return Ft}function computeAutoPlacement(a,_){_===void 0&&(_={});var $=_,j=$.placement,et=$.boundary,tt=$.rootBoundary,rt=$.padding,nt=$.flipVariations,it=$.allowedAutoPlacements,st=it===void 0?placements:it,ot=getVariation(j),at=ot?nt?variationPlacements:variationPlacements.filter(function(yt){return getVariation(yt)===ot}):basePlacements,ut=at.filter(function(yt){return st.indexOf(yt)>=0});ut.length===0&&(ut=at);var ht=ut.reduce(function(yt,wt){return yt[wt]=detectOverflow(a,{placement:wt,boundary:et,rootBoundary:tt,padding:rt})[getBasePlacement(wt)],yt},{});return Object.keys(ht).sort(function(yt,wt){return ht[yt]-ht[wt]})}function getExpandedFallbackPlacements(a){if(getBasePlacement(a)===auto)return[];var _=getOppositePlacement(a);return[getOppositeVariationPlacement(a),_,getOppositeVariationPlacement(_)]}function flip(a){var _=a.state,$=a.options,j=a.name;if(!_.modifiersData[j]._skip){for(var et=$.mainAxis,tt=et===void 0?!0:et,rt=$.altAxis,nt=rt===void 0?!0:rt,it=$.fallbackPlacements,st=$.padding,ot=$.boundary,at=$.rootBoundary,ut=$.altBoundary,ht=$.flipVariations,yt=ht===void 0?!0:ht,wt=$.allowedAutoPlacements,Ct=_.options.placement,Pt=getBasePlacement(Ct),$t=Pt===Ct,Mt=it||($t||!yt?[getOppositePlacement(Ct)]:getExpandedFallbackPlacements(Ct)),Bt=[Ct].concat(Mt).reduce(function(tr,ir){return tr.concat(getBasePlacement(ir)===auto?computeAutoPlacement(_,{placement:ir,boundary:ot,rootBoundary:at,padding:st,flipVariations:yt,allowedAutoPlacements:wt}):ir)},[]),Dt=_.rects.reference,zt=_.rects.popper,Ot=new Map,It=!0,Lt=Bt[0],Ft=0;Ft=0,dt=ct?"width":"height",mt=detectOverflow(_,{placement:jt,boundary:ot,rootBoundary:at,altBoundary:ut,padding:st}),xt=ct?vt?right:left:vt?bottom:top;Dt[dt]>zt[dt]&&(xt=getOppositePlacement(xt));var At=getOppositePlacement(xt),Rt=[];if(tt&&Rt.push(mt[bt]<=0),nt&&Rt.push(mt[xt]<=0,mt[At]<=0),Rt.every(function(tr){return tr})){Lt=jt,It=!1;break}Ot.set(jt,Rt)}if(It)for(var St=yt?3:1,Tt=function(ir){var nr=Bt.find(function(Zt){var Kt=Ot.get(Zt);if(Kt)return Kt.slice(0,ir).every(function(Qt){return Qt})});if(nr)return Lt=nr,"break"},Et=St;Et>0;Et--){var Nt=Tt(Et);if(Nt==="break")break}_.placement!==Lt&&(_.modifiersData[j]._skip=!0,_.placement=Lt,_.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(a,_,$){return $===void 0&&($={x:0,y:0}),{top:a.top-_.height-$.y,right:a.right-_.width+$.x,bottom:a.bottom-_.height+$.y,left:a.left-_.width-$.x}}function isAnySideFullyClipped(a){return[top,right,bottom,left].some(function(_){return a[_]>=0})}function hide(a){var _=a.state,$=a.name,j=_.rects.reference,et=_.rects.popper,tt=_.modifiersData.preventOverflow,rt=detectOverflow(_,{elementContext:"reference"}),nt=detectOverflow(_,{altBoundary:!0}),it=getSideOffsets(rt,j),st=getSideOffsets(nt,et,tt),ot=isAnySideFullyClipped(it),at=isAnySideFullyClipped(st);_.modifiersData[$]={referenceClippingOffsets:it,popperEscapeOffsets:st,isReferenceHidden:ot,hasPopperEscaped:at},_.attributes.popper=Object.assign({},_.attributes.popper,{"data-popper-reference-hidden":ot,"data-popper-escaped":at})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(a,_,$){var j=getBasePlacement(a),et=[left,top].indexOf(j)>=0?-1:1,tt=typeof $=="function"?$(Object.assign({},_,{placement:a})):$,rt=tt[0],nt=tt[1];return rt=rt||0,nt=(nt||0)*et,[left,right].indexOf(j)>=0?{x:nt,y:rt}:{x:rt,y:nt}}function offset(a){var _=a.state,$=a.options,j=a.name,et=$.offset,tt=et===void 0?[0,0]:et,rt=placements.reduce(function(ot,at){return ot[at]=distanceAndSkiddingToXY(at,_.rects,tt),ot},{}),nt=rt[_.placement],it=nt.x,st=nt.y;_.modifiersData.popperOffsets!=null&&(_.modifiersData.popperOffsets.x+=it,_.modifiersData.popperOffsets.y+=st),_.modifiersData[j]=rt}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(a){var _=a.state,$=a.name;_.modifiersData[$]=computeOffsets({reference:_.rects.reference,element:_.rects.popper,strategy:"absolute",placement:_.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(a){return a==="x"?"y":"x"}function preventOverflow(a){var _=a.state,$=a.options,j=a.name,et=$.mainAxis,tt=et===void 0?!0:et,rt=$.altAxis,nt=rt===void 0?!1:rt,it=$.boundary,st=$.rootBoundary,ot=$.altBoundary,at=$.padding,ut=$.tether,ht=ut===void 0?!0:ut,yt=$.tetherOffset,wt=yt===void 0?0:yt,Ct=detectOverflow(_,{boundary:it,rootBoundary:st,padding:at,altBoundary:ot}),Pt=getBasePlacement(_.placement),$t=getVariation(_.placement),Mt=!$t,Bt=getMainAxisFromPlacement(Pt),Dt=getAltAxis(Bt),zt=_.modifiersData.popperOffsets,Ot=_.rects.reference,It=_.rects.popper,Lt=typeof wt=="function"?wt(Object.assign({},_.rects,{placement:_.placement})):wt,Ft=typeof Lt=="number"?{mainAxis:Lt,altAxis:Lt}:Object.assign({mainAxis:0,altAxis:0},Lt),jt=_.modifiersData.offset?_.modifiersData.offset[_.placement]:null,bt={x:0,y:0};if(zt){if(tt){var vt,ct=Bt==="y"?top:left,dt=Bt==="y"?bottom:right,mt=Bt==="y"?"height":"width",xt=zt[Bt],At=xt+Ct[ct],Rt=xt-Ct[dt],St=ht?-It[mt]/2:0,Tt=$t===start?Ot[mt]:It[mt],Et=$t===start?-It[mt]:-Ot[mt],Nt=_.elements.arrow,tr=ht&&Nt?getLayoutRect(Nt):{width:0,height:0},ir=_.modifiersData["arrow#persistent"]?_.modifiersData["arrow#persistent"].padding:getFreshSideObject(),nr=ir[ct],Zt=ir[dt],Kt=within(0,Ot[mt],tr[mt]),Qt=Mt?Ot[mt]/2-St-Kt-nr-Ft.mainAxis:Tt-Kt-nr-Ft.mainAxis,Ht=Mt?-Ot[mt]/2+St+Kt+Zt+Ft.mainAxis:Et+Kt+Zt+Ft.mainAxis,qt=_.elements.arrow&&getOffsetParent(_.elements.arrow),Jt=qt?Bt==="y"?qt.clientTop||0:qt.clientLeft||0:0,ur=(vt=jt==null?void 0:jt[Bt])!=null?vt:0,xr=xt+Qt-ur-Jt,pr=xt+Ht-ur,Cr=within(ht?min(At,xr):At,xt,ht?max(Rt,pr):Rt);zt[Bt]=Cr,bt[Bt]=Cr-xt}if(nt){var Mr,lr=Bt==="x"?top:left,fr=Bt==="x"?bottom:right,_r=zt[Dt],Rr=Dt==="y"?"height":"width",kr=_r+Ct[lr],Ar=_r-Ct[fr],Pr=[top,left].indexOf(Pt)!==-1,Or=(Mr=jt==null?void 0:jt[Dt])!=null?Mr:0,Br=Pr?kr:_r-Ot[Rr]-It[Rr]-Or+Ft.altAxis,or=Pr?_r+Ot[Rr]+It[Rr]-Or-Ft.altAxis:Ar,Yt=ht&&Pr?withinMaxClamp(Br,_r,or):within(ht?Br:kr,_r,ht?or:Ar);zt[Dt]=Yt,bt[Dt]=Yt-_r}_.modifiersData[j]=bt}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(a){return{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}}function getNodeScroll(a){return a===getWindow(a)||!isHTMLElement$2(a)?getWindowScroll(a):getHTMLElementScroll(a)}function isElementScaled(a){var _=a.getBoundingClientRect(),$=round(_.width)/a.offsetWidth||1,j=round(_.height)/a.offsetHeight||1;return $!==1||j!==1}function getCompositeRect(a,_,$){$===void 0&&($=!1);var j=isHTMLElement$2(_),et=isHTMLElement$2(_)&&isElementScaled(_),tt=getDocumentElement(_),rt=getBoundingClientRect(a,et,$),nt={scrollLeft:0,scrollTop:0},it={x:0,y:0};return(j||!j&&!$)&&((getNodeName(_)!=="body"||isScrollParent(tt))&&(nt=getNodeScroll(_)),isHTMLElement$2(_)?(it=getBoundingClientRect(_,!0),it.x+=_.clientLeft,it.y+=_.clientTop):tt&&(it.x=getWindowScrollBarX(tt))),{x:rt.left+nt.scrollLeft-it.x,y:rt.top+nt.scrollTop-it.y,width:rt.width,height:rt.height}}function order(a){var _=new Map,$=new Set,j=[];a.forEach(function(tt){_.set(tt.name,tt)});function et(tt){$.add(tt.name);var rt=[].concat(tt.requires||[],tt.requiresIfExists||[]);rt.forEach(function(nt){if(!$.has(nt)){var it=_.get(nt);it&&et(it)}}),j.push(tt)}return a.forEach(function(tt){$.has(tt.name)||et(tt)}),j}function orderModifiers(a){var _=order(a);return modifierPhases.reduce(function($,j){return $.concat(_.filter(function(et){return et.phase===j}))},[])}function debounce(a){var _;return function(){return _||(_=new Promise(function($){Promise.resolve().then(function(){_=void 0,$(a())})})),_}}function mergeByName(a){var _=a.reduce(function($,j){var et=$[j.name];return $[j.name]=et?Object.assign({},et,j,{options:Object.assign({},et.options,j.options),data:Object.assign({},et.data,j.data)}):j,$},{});return Object.keys(_).map(function($){return _[$]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var a=arguments.length,_=new Array(a),$=0;${}),Mt=reactExports.useCallback(()=>{var Ft;!_||!yt.current||!wt.current||((Ft=$t.current)==null||Ft.call($t),Ct.current=createPopper(yt.current,wt.current,{placement:Pt,modifiers:[innerArrow,positionArrow,transformOrigin,{...matchWidth,enabled:!!ut},{name:"eventListeners",...getEventListenerOptions(rt)},{name:"arrow",options:{padding:tt}},{name:"offset",options:{offset:nt??[0,it]}},{name:"flip",enabled:!!st,options:{padding:8}},{name:"preventOverflow",enabled:!!at,options:{boundary:ot}},...$??[]],strategy:et}),Ct.current.forceUpdate(),$t.current=Ct.current.destroy)},[Pt,_,$,ut,rt,tt,nt,it,st,at,ot,et]);reactExports.useEffect(()=>()=>{var Ft;!yt.current&&!wt.current&&((Ft=Ct.current)==null||Ft.destroy(),Ct.current=null)},[]);const Bt=reactExports.useCallback(Ft=>{yt.current=Ft,Mt()},[Mt]),Dt=reactExports.useCallback((Ft={},jt=null)=>({...Ft,ref:mergeRefs(Bt,jt)}),[Bt]),zt=reactExports.useCallback(Ft=>{wt.current=Ft,Mt()},[Mt]),Ot=reactExports.useCallback((Ft={},jt=null)=>({...Ft,ref:mergeRefs(zt,jt),style:{...Ft.style,position:et,minWidth:ut?void 0:"max-content",inset:"0 auto auto 0"}}),[et,zt,ut]),It=reactExports.useCallback((Ft={},jt=null)=>{const{size:bt,shadowColor:vt,bg:ct,style:dt,...mt}=Ft;return{...mt,ref:jt,"data-popper-arrow":"",style:getArrowStyle(Ft)}},[]),Lt=reactExports.useCallback((Ft={},jt=null)=>({...Ft,ref:jt,"data-popper-arrow-inner":""}),[]);return{update(){var Ft;(Ft=Ct.current)==null||Ft.update()},forceUpdate(){var Ft;(Ft=Ct.current)==null||Ft.forceUpdate()},transformOrigin:cssVars.transformOrigin.varRef,referenceRef:Bt,popperRef:zt,getPopperProps:Ot,getArrowProps:It,getArrowInnerProps:Lt,getReferenceProps:Dt}}function getArrowStyle(a){const{size:_,shadowColor:$,bg:j,style:et}=a,tt={...et,position:"absolute"};return _&&(tt["--popper-arrow-size"]=_),$&&(tt["--popper-arrow-shadow-color"]=$),j&&(tt["--popper-arrow-bg"]=j),tt}function useDisclosure(a={}){const{onClose:_,onOpen:$,isOpen:j,id:et}=a,tt=useCallbackRef$2($),rt=useCallbackRef$2(_),[nt,it]=reactExports.useState(a.defaultIsOpen||!1),st=j!==void 0?j:nt,ot=j!==void 0,at=reactExports.useId(),ut=et??`disclosure-${at}`,ht=reactExports.useCallback(()=>{ot||it(!1),rt==null||rt()},[ot,rt]),yt=reactExports.useCallback(()=>{ot||it(!0),tt==null||tt()},[ot,tt]),wt=reactExports.useCallback(()=>{st?ht():yt()},[st,yt,ht]);function Ct($t={}){return{...$t,"aria-expanded":st,"aria-controls":ut,onClick(Mt){var Bt;(Bt=$t.onClick)==null||Bt.call($t,Mt),wt()}}}function Pt($t={}){return{...$t,hidden:!st,id:ut}}return{isOpen:st,onOpen:yt,onClose:ht,onToggle:wt,isControlled:ot,getButtonProps:Ct,getDisclosureProps:Pt}}function useOutsideClick(a){const{ref:_,handler:$,enabled:j=!0}=a,et=useCallbackRef$2($),rt=reactExports.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;reactExports.useEffect(()=>{if(!j)return;const nt=at=>{isValidEvent(at,_)&&(rt.isPointerDown=!0)},it=at=>{if(rt.ignoreEmulatedMouseEvents){rt.ignoreEmulatedMouseEvents=!1;return}rt.isPointerDown&&$&&isValidEvent(at,_)&&(rt.isPointerDown=!1,et(at))},st=at=>{rt.ignoreEmulatedMouseEvents=!0,$&&rt.isPointerDown&&isValidEvent(at,_)&&(rt.isPointerDown=!1,et(at))},ot=getOwnerDocument$1(_.current);return ot.addEventListener("mousedown",nt,!0),ot.addEventListener("mouseup",it,!0),ot.addEventListener("touchstart",nt,!0),ot.addEventListener("touchend",st,!0),()=>{ot.removeEventListener("mousedown",nt,!0),ot.removeEventListener("mouseup",it,!0),ot.removeEventListener("touchstart",nt,!0),ot.removeEventListener("touchend",st,!0)}},[$,_,et,rt,j])}function isValidEvent(a,_){var $;const j=a.target;return j&&!getOwnerDocument$1(j).contains(j)?!1:!(($=_.current)!=null&&$.contains(j))}function getOwnerDocument$1(a){var _;return(_=a==null?void 0:a.ownerDocument)!=null?_:document}function useAnimationState(a){const{isOpen:_,ref:$}=a,[j,et]=reactExports.useState(_),[tt,rt]=reactExports.useState(!1);return reactExports.useEffect(()=>{tt||(et(_),rt(!0))},[_,tt,j]),useEventListener(()=>$.current,"animationend",()=>{et(_)}),{present:!(_?!1:!j),onComplete(){var it;const st=getOwnerWindow($.current),ot=new st.CustomEvent("animationend",{bubbles:!0});(it=$.current)==null||it.dispatchEvent(ot)}}}function lazyDisclosure(a){const{wasSelected:_,enabled:$,isSelected:j,mode:et="unmount"}=a;return!!(!$||j||et==="keepMounted"&&_)}var[MenuDescendantsProvider,useMenuDescendantsContext,useMenuDescendants,useMenuDescendant]=createDescendantContext(),[MenuProvider,useMenuContext]=createContext$1({strict:!1,name:"MenuContext"});function useIds$1(a,..._){const $=reactExports.useId(),j=a||$;return reactExports.useMemo(()=>_.map(et=>`${et}-${j}`),[j,_])}function getOwnerDocument(a){var _;return(_=a==null?void 0:a.ownerDocument)!=null?_:document}function isActiveElement(a){return getOwnerDocument(a).activeElement===a}function useMenu(a={}){const{id:_,closeOnSelect:$=!0,closeOnBlur:j=!0,initialFocusRef:et,autoSelect:tt=!0,isLazy:rt,isOpen:nt,defaultIsOpen:it,onClose:st,onOpen:ot,placement:at="bottom-start",lazyBehavior:ut="unmount",direction:ht,computePositionOnMount:yt=!1,...wt}=a,Ct=reactExports.useRef(null),Pt=reactExports.useRef(null),$t=useMenuDescendants(),Mt=reactExports.useCallback(()=>{requestAnimationFrame(()=>{var Nt;(Nt=Ct.current)==null||Nt.focus({preventScroll:!1})})},[]),Bt=reactExports.useCallback(()=>{const Nt=setTimeout(()=>{var tr;if(et)(tr=et.current)==null||tr.focus();else{const ir=$t.firstEnabled();ir&&vt(ir.index)}});At.current.add(Nt)},[$t,et]),Dt=reactExports.useCallback(()=>{const Nt=setTimeout(()=>{const tr=$t.lastEnabled();tr&&vt(tr.index)});At.current.add(Nt)},[$t]),zt=reactExports.useCallback(()=>{ot==null||ot(),tt?Bt():Mt()},[tt,Bt,Mt,ot]),{isOpen:Ot,onOpen:It,onClose:Lt,onToggle:Ft}=useDisclosure({isOpen:nt,defaultIsOpen:it,onClose:st,onOpen:zt});useOutsideClick({enabled:Ot&&j,ref:Ct,handler:Nt=>{var tr;(tr=Pt.current)!=null&&tr.contains(Nt.target)||Lt()}});const jt=usePopper({...wt,enabled:Ot||yt,placement:at,direction:ht}),[bt,vt]=reactExports.useState(-1);useUpdateEffect(()=>{Ot||vt(-1)},[Ot]),useFocusOnHide(Ct,{focusRef:Pt,visible:Ot,shouldFocus:!0});const ct=useAnimationState({isOpen:Ot,ref:Ct}),[dt,mt]=useIds$1(_,"menu-button","menu-list"),xt=reactExports.useCallback(()=>{It(),Mt()},[It,Mt]),At=reactExports.useRef(new Set([]));reactExports.useEffect(()=>{const Nt=At.current;return()=>{Nt.forEach(tr=>clearTimeout(tr)),Nt.clear()}},[]);const Rt=reactExports.useCallback(()=>{It(),Bt()},[Bt,It]),St=reactExports.useCallback(()=>{It(),Dt()},[It,Dt]),Tt=reactExports.useCallback(()=>{var Nt,tr;const ir=getOwnerDocument(Ct.current),nr=(Nt=Ct.current)==null?void 0:Nt.contains(ir.activeElement);if(!(Ot&&!nr))return;const Kt=(tr=$t.item(bt))==null?void 0:tr.node;Kt==null||Kt.focus({preventScroll:!0})},[Ot,bt,$t]),Et=reactExports.useRef(null);return{openAndFocusMenu:xt,openAndFocusFirstItem:Rt,openAndFocusLastItem:St,onTransitionEnd:Tt,unstable__animationState:ct,descendants:$t,popper:jt,buttonId:dt,menuId:mt,forceUpdate:jt.forceUpdate,orientation:"vertical",isOpen:Ot,onToggle:Ft,onOpen:It,onClose:Lt,menuRef:Ct,buttonRef:Pt,focusedIndex:bt,closeOnSelect:$,closeOnBlur:j,autoSelect:tt,setFocusedIndex:vt,isLazy:rt,lazyBehavior:ut,initialFocusRef:et,rafId:Et}}function useMenuButton(a={},_=null){const $=useMenuContext(),{onToggle:j,popper:et,openAndFocusFirstItem:tt,openAndFocusLastItem:rt}=$,nt=reactExports.useCallback(it=>{const st=it.key,at={Enter:tt,ArrowDown:tt,ArrowUp:rt}[st];at&&(it.preventDefault(),it.stopPropagation(),at(it))},[tt,rt]);return{...a,ref:mergeRefs($.buttonRef,_,et.referenceRef),id:$.buttonId,"data-active":dataAttr($.isOpen),"aria-expanded":$.isOpen,"aria-haspopup":"menu","aria-controls":$.menuId,onClick:callAllHandlers$1(a.onClick,j),onKeyDown:callAllHandlers$1(a.onKeyDown,nt)}}function isTargetMenuItem(a){var _;return isHTMLElement$1(a)&&!!((_=a==null?void 0:a.getAttribute("role"))!=null&&_.startsWith("menuitem"))}function useMenuList(a={},_=null){const $=useMenuContext();if(!$)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:j,setFocusedIndex:et,menuRef:tt,isOpen:rt,onClose:nt,menuId:it,isLazy:st,lazyBehavior:ot,unstable__animationState:at}=$,ut=useMenuDescendantsContext(),ht=useShortcut({preventDefault:Pt=>Pt.key!==" "&&isTargetMenuItem(Pt.target)}),yt=reactExports.useCallback(Pt=>{if(!Pt.currentTarget.contains(Pt.target))return;const $t=Pt.key,Bt={Tab:zt=>zt.preventDefault(),Escape:nt,ArrowDown:()=>{const zt=ut.nextEnabled(j);zt&&et(zt.index)},ArrowUp:()=>{const zt=ut.prevEnabled(j);zt&&et(zt.index)}}[$t];if(Bt){Pt.preventDefault(),Bt(Pt);return}const Dt=ht(zt=>{const Ot=getNextItemFromSearch(ut.values(),zt,It=>{var Lt,Ft;return(Ft=(Lt=It==null?void 0:It.node)==null?void 0:Lt.textContent)!=null?Ft:""},ut.item(j));if(Ot){const It=ut.indexOf(Ot.node);et(It)}});isTargetMenuItem(Pt.target)&&Dt(Pt)},[ut,j,ht,nt,et]),wt=reactExports.useRef(!1);rt&&(wt.current=!0);const Ct=lazyDisclosure({wasSelected:wt.current,enabled:st,mode:ot,isSelected:at.present});return{...a,ref:mergeRefs(tt,_),children:Ct?a.children:null,tabIndex:-1,role:"menu",id:it,style:{...a.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:callAllHandlers$1(a.onKeyDown,yt)}}function useMenuPositioner(a={}){const{popper:_,isOpen:$}=useMenuContext();return _.getPopperProps({...a,style:{visibility:$?"visible":"hidden",...a.style}})}function useMenuItem(a={},_=null){const{onMouseEnter:$,onMouseMove:j,onMouseLeave:et,onClick:tt,onFocus:rt,isDisabled:nt,isFocusable:it,closeOnSelect:st,type:ot,...at}=a,ut=useMenuContext(),{setFocusedIndex:ht,focusedIndex:yt,closeOnSelect:wt,onClose:Ct,menuRef:Pt,isOpen:$t,menuId:Mt,rafId:Bt}=ut,Dt=reactExports.useRef(null),zt=`${Mt}-menuitem-${reactExports.useId()}`,{index:Ot,register:It}=useMenuDescendant({disabled:nt&&!it}),Lt=reactExports.useCallback(xt=>{$==null||$(xt),!nt&&ht(Ot)},[ht,Ot,nt,$]),Ft=reactExports.useCallback(xt=>{j==null||j(xt),Dt.current&&!isActiveElement(Dt.current)&&Lt(xt)},[Lt,j]),jt=reactExports.useCallback(xt=>{et==null||et(xt),!nt&&ht(-1)},[ht,nt,et]),bt=reactExports.useCallback(xt=>{tt==null||tt(xt),isTargetMenuItem(xt.currentTarget)&&(st??wt)&&Ct()},[Ct,tt,wt,st]),vt=reactExports.useCallback(xt=>{rt==null||rt(xt),ht(Ot)},[ht,rt,Ot]),ct=Ot===yt,dt=nt&&!it;useUpdateEffect(()=>{if($t)return ct&&!dt&&Dt.current?(Bt.current&&cancelAnimationFrame(Bt.current),Bt.current=requestAnimationFrame(()=>{var xt;(xt=Dt.current)==null||xt.focus({preventScroll:!0}),Bt.current=null})):Pt.current&&!isActiveElement(Pt.current)&&Pt.current.focus({preventScroll:!0}),()=>{Bt.current&&cancelAnimationFrame(Bt.current)}},[ct,dt,Pt,$t]);const mt=useClickable({onClick:bt,onFocus:vt,onMouseEnter:Lt,onMouseMove:Ft,onMouseLeave:jt,ref:mergeRefs(It,Dt,_),isDisabled:nt,isFocusable:it});return{...at,...mt,type:ot??mt.type,id:zt,role:"menuitem",tabIndex:ct?0:-1}}function isHTMLElement$1(a){var _;if(!isElement(a))return!1;const $=(_=a.ownerDocument.defaultView)!=null?_:window;return a instanceof $.HTMLElement}function isElement(a){return a!=null&&typeof a=="object"&&"nodeType"in a&&a.nodeType===Node.ELEMENT_NODE}var[MenuStylesProvider,useMenuStyles]=createContext$1({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Menu=a=>{const{children:_}=a,$=useMultiStyleConfig("Menu",a),j=omitThemingProps(a),{direction:et}=useTheme(),{descendants:tt,...rt}=useMenu({...j,direction:et}),nt=reactExports.useMemo(()=>rt,[rt]),{isOpen:it,onClose:st,forceUpdate:ot}=nt;return jsxRuntimeExports.jsx(MenuDescendantsProvider,{value:tt,children:jsxRuntimeExports.jsx(MenuProvider,{value:nt,children:jsxRuntimeExports.jsx(MenuStylesProvider,{value:$,children:runIfFn$2(_,{isOpen:it,onClose:st,forceUpdate:ot})})})})};Menu.displayName="Menu";var MenuCommand=forwardRef((a,_)=>{const $=useMenuStyles();return jsxRuntimeExports.jsx(chakra.span,{ref:_,...a,__css:$.command,className:"chakra-menu__command"})});MenuCommand.displayName="MenuCommand";var StyledMenuItem=forwardRef((a,_)=>{const{type:$,...j}=a,et=useMenuStyles(),tt=j.as||$?$??void 0:"button",rt=reactExports.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...et.item}),[et.item]);return jsxRuntimeExports.jsx(chakra.button,{ref:_,type:tt,...j,__css:rt})}),MenuIcon=a=>{const{className:_,children:$,...j}=a,et=useMenuStyles(),tt=reactExports.Children.only($),rt=reactExports.isValidElement(tt)?reactExports.cloneElement(tt,{focusable:"false","aria-hidden":!0,className:cx("chakra-menu__icon",tt.props.className)}):null,nt=cx("chakra-menu__icon-wrapper",_);return jsxRuntimeExports.jsx(chakra.span,{className:nt,...j,__css:et.icon,children:rt})};MenuIcon.displayName="MenuIcon";var MenuItem$1=forwardRef((a,_)=>{const{icon:$,iconSpacing:j="0.75rem",command:et,commandSpacing:tt="0.75rem",children:rt,...nt}=a,it=useMenuItem(nt,_),ot=$||et?jsxRuntimeExports.jsx("span",{style:{pointerEvents:"none",flex:1},children:rt}):rt;return jsxRuntimeExports.jsxs(StyledMenuItem,{...it,className:cx("chakra-menu__menuitem",it.className),children:[$&&jsxRuntimeExports.jsx(MenuIcon,{fontSize:"0.8em",marginEnd:j,children:$}),ot,et&&jsxRuntimeExports.jsx(MenuCommand,{marginStart:tt,children:et})]})});MenuItem$1.displayName="MenuItem";var motionVariants={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},MenuTransition=chakra(motion.div),MenuList=forwardRef(function(_,$){var j,et;const{rootProps:tt,motionProps:rt,...nt}=_,{isOpen:it,onTransitionEnd:st,unstable__animationState:ot}=useMenuContext(),at=useMenuList(nt,$),ut=useMenuPositioner(tt),ht=useMenuStyles();return jsxRuntimeExports.jsx(chakra.div,{...ut,__css:{zIndex:(et=_.zIndex)!=null?et:(j=ht.list)==null?void 0:j.zIndex},children:jsxRuntimeExports.jsx(MenuTransition,{variants:motionVariants,initial:!1,animate:it?"enter":"exit",__css:{outline:0,...ht.list},...rt,className:cx("chakra-menu__menu-list",at.className),...at,onUpdate:st,onAnimationComplete:callAll(ot.onComplete,at.onAnimationComplete)})})});MenuList.displayName="MenuList";var StyledMenuButton=forwardRef((a,_)=>{const $=useMenuStyles();return jsxRuntimeExports.jsx(chakra.button,{ref:_,...a,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...$.button}})}),MenuButton=forwardRef((a,_)=>{const{children:$,as:j,...et}=a,tt=useMenuButton(et,_),rt=j||StyledMenuButton;return jsxRuntimeExports.jsx(rt,{...tt,className:cx("chakra-menu__menu-button",a.className),children:jsxRuntimeExports.jsx(chakra.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:a.children})})});MenuButton.displayName="MenuButton";var transitions={slideInBottom:{...slideFadeConfig,custom:{offsetY:16,reverse:!0}},slideInRight:{...slideFadeConfig,custom:{offsetX:16,reverse:!0}},slideInTop:{...slideFadeConfig,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...slideFadeConfig,custom:{offsetX:-16,reverse:!0}},scale:{...scaleFadeConfig,custom:{initialScale:.95,reverse:!0}},none:{}},MotionSection$1=chakra(motion.section),getMotionProps=a=>transitions[a||"none"],ModalTransition=reactExports.forwardRef((a,_)=>{const{preset:$,motionProps:j=getMotionProps($),...et}=a;return jsxRuntimeExports.jsx(MotionSection$1,{ref:_,...j,...et})});ModalTransition.displayName="ModalTransition";var __defProp$7=Object.defineProperty,__defNormalProp$2=(a,_,$)=>_ in a?__defProp$7(a,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[_]=$,__publicField$2=(a,_,$)=>(__defNormalProp$2(a,_+"",$),$),ModalManager=class{constructor(){__publicField$2(this,"modals"),this.modals=new Map}add(a){return this.modals.set(a,this.modals.size+1),this.modals.size}remove(a){this.modals.delete(a)}isTopModal(a){return a?this.modals.get(a)===this.modals.size:!1}},modalManager=new ModalManager;function useModalManager(a,_){const[$,j]=reactExports.useState(0);return reactExports.useEffect(()=>{const et=a.current;if(et){if(_){const tt=modalManager.add(et);j(tt)}return()=>{modalManager.remove(et),j(0)}}},[_,a]),$}var getDefaultParent=function(a){if(typeof document>"u")return null;var _=Array.isArray(a)?a[0]:a;return _.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(a){return a&&(a.host||unwrapHost(a.parentNode))},correctTargets=function(a,_){return _.map(function($){if(a.contains($))return $;var j=unwrapHost($);return j&&a.contains(j)?j:(console.error("aria-hidden",$,"in not contained inside",a,". Doing nothing"),null)}).filter(function($){return!!$})},applyAttributeToOthers=function(a,_,$,j){var et=correctTargets(_,Array.isArray(a)?a:[a]);markerMap[$]||(markerMap[$]=new WeakMap);var tt=markerMap[$],rt=[],nt=new Set,it=new Set(et),st=function(at){!at||nt.has(at)||(nt.add(at),st(at.parentNode))};et.forEach(st);var ot=function(at){!at||it.has(at)||Array.prototype.forEach.call(at.children,function(ut){if(nt.has(ut))ot(ut);else{var ht=ut.getAttribute(j),yt=ht!==null&&ht!=="false",wt=(counterMap.get(ut)||0)+1,Ct=(tt.get(ut)||0)+1;counterMap.set(ut,wt),tt.set(ut,Ct),rt.push(ut),wt===1&&yt&&uncontrolledNodes.set(ut,!0),Ct===1&&ut.setAttribute($,"true"),yt||ut.setAttribute(j,"true")}})};return ot(_),nt.clear(),lockCount++,function(){rt.forEach(function(at){var ut=counterMap.get(at)-1,ht=tt.get(at)-1;counterMap.set(at,ut),tt.set(at,ht),ut||(uncontrolledNodes.has(at)||at.removeAttribute(j),uncontrolledNodes.delete(at)),ht||at.removeAttribute($)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(a,_,$){$===void 0&&($="data-aria-hidden");var j=Array.from(Array.isArray(a)?a:[a]),et=getDefaultParent(a);return et?(j.push.apply(j,Array.from(et.querySelectorAll("[aria-live]"))),applyAttributeToOthers(j,et,$,"aria-hidden")):function(){return null}};function useModal(a){const{isOpen:_,onClose:$,id:j,closeOnOverlayClick:et=!0,closeOnEsc:tt=!0,useInert:rt=!0,onOverlayClick:nt,onEsc:it}=a,st=reactExports.useRef(null),ot=reactExports.useRef(null),[at,ut,ht]=useIds(j,"chakra-modal","chakra-modal--header","chakra-modal--body");useAriaHidden(st,_&&rt);const yt=useModalManager(st,_),wt=reactExports.useRef(null),Ct=reactExports.useCallback(Lt=>{wt.current=Lt.target},[]),Pt=reactExports.useCallback(Lt=>{Lt.key==="Escape"&&(Lt.stopPropagation(),tt&&($==null||$()),it==null||it())},[tt,$,it]),[$t,Mt]=reactExports.useState(!1),[Bt,Dt]=reactExports.useState(!1),zt=reactExports.useCallback((Lt={},Ft=null)=>({role:"dialog",...Lt,ref:mergeRefs(Ft,st),id:at,tabIndex:-1,"aria-modal":!0,"aria-labelledby":$t?ut:void 0,"aria-describedby":Bt?ht:void 0,onClick:callAllHandlers$1(Lt.onClick,jt=>jt.stopPropagation())}),[ht,Bt,at,ut,$t]),Ot=reactExports.useCallback(Lt=>{Lt.stopPropagation(),wt.current===Lt.target&&modalManager.isTopModal(st.current)&&(et&&($==null||$()),nt==null||nt())},[$,et,nt]),It=reactExports.useCallback((Lt={},Ft=null)=>({...Lt,ref:mergeRefs(Ft,ot),onClick:callAllHandlers$1(Lt.onClick,Ot),onKeyDown:callAllHandlers$1(Lt.onKeyDown,Pt),onMouseDown:callAllHandlers$1(Lt.onMouseDown,Ct)}),[Pt,Ct,Ot]);return{isOpen:_,onClose:$,headerId:ut,bodyId:ht,setBodyMounted:Dt,setHeaderMounted:Mt,dialogRef:st,overlayRef:ot,getDialogProps:zt,getDialogContainerProps:It,index:yt}}function useAriaHidden(a,_){const $=a.current;reactExports.useEffect(()=>{if(!(!a.current||!_))return hideOthers(a.current)},[_,a,$])}function useIds(a,..._){const $=reactExports.useId(),j=a||$;return reactExports.useMemo(()=>_.map(et=>`${et}-${j}`),[j,_])}var[ModalStylesProvider,useModalStyles]=createContext$1({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[ModalContextProvider,useModalContext]=createContext$1({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Modal=a=>{const _={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...a},{portalProps:$,children:j,autoFocus:et,trapFocus:tt,initialFocusRef:rt,finalFocusRef:nt,returnFocusOnClose:it,blockScrollOnMount:st,allowPinchZoom:ot,preserveScrollBarGap:at,motionPreset:ut,lockFocusAcrossFrames:ht,onCloseComplete:yt}=_,wt=useMultiStyleConfig("Modal",_),Pt={...useModal(_),autoFocus:et,trapFocus:tt,initialFocusRef:rt,finalFocusRef:nt,returnFocusOnClose:it,blockScrollOnMount:st,allowPinchZoom:ot,preserveScrollBarGap:at,motionPreset:ut,lockFocusAcrossFrames:ht};return jsxRuntimeExports.jsx(ModalContextProvider,{value:Pt,children:jsxRuntimeExports.jsx(ModalStylesProvider,{value:wt,children:jsxRuntimeExports.jsx(AnimatePresence,{onExitComplete:yt,children:Pt.isOpen&&jsxRuntimeExports.jsx(Portal,{...$,children:j})})})})};Modal.displayName="Modal";var zeroRightClassName$1="right-scroll-bar-position",fullWidthClassName$1="width-before-scroll-bar",noScrollbarsClassName$1="with-scroll-bars-hidden",removedBarSizeVariable$1="--removed-body-scroll-bar-size",effectCar$1=createSidecarMedium(),nothing$1=function(){},RemoveScroll$1=reactExports.forwardRef(function(a,_){var $=reactExports.useRef(null),j=reactExports.useState({onScrollCapture:nothing$1,onWheelCapture:nothing$1,onTouchMoveCapture:nothing$1}),et=j[0],tt=j[1],rt=a.forwardProps,nt=a.children,it=a.className,st=a.removeScrollBar,ot=a.enabled,at=a.shards,ut=a.sideCar,ht=a.noIsolation,yt=a.inert,wt=a.allowPinchZoom,Ct=a.as,Pt=Ct===void 0?"div":Ct,$t=a.gapMode,Mt=__rest$3(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),Bt=ut,Dt=useMergeRefs([$,_]),zt=__assign(__assign({},Mt),et);return reactExports.createElement(reactExports.Fragment,null,ot&&reactExports.createElement(Bt,{sideCar:effectCar$1,removeScrollBar:st,shards:at,noIsolation:ht,inert:yt,setCallbacks:tt,allowPinchZoom:!!wt,lockRef:$,gapMode:$t}),rt?reactExports.cloneElement(reactExports.Children.only(nt),__assign(__assign({},zt),{ref:Dt})):reactExports.createElement(Pt,__assign({},zt,{className:it,ref:Dt}),nt))});RemoveScroll$1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll$1.classNames={fullWidth:fullWidthClassName$1,zeroRight:zeroRightClassName$1};var getNonce$1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var _=getNonce$1();return _&&a.setAttribute("nonce",_),a}function injectStyles(a,_){a.styleSheet?a.styleSheet.cssText=_:a.appendChild(document.createTextNode(_))}function insertStyleTag(a){var _=document.head||document.getElementsByTagName("head")[0];_.appendChild(a)}var stylesheetSingleton=function(){var a=0,_=null;return{add:function($){a==0&&(_=makeStyleTag())&&(injectStyles(_,$),insertStyleTag(_)),a++},remove:function(){a--,!a&&_&&(_.parentNode&&_.parentNode.removeChild(_),_=null)}}},styleHookSingleton=function(){var a=stylesheetSingleton();return function(_,$){reactExports.useEffect(function(){return a.add(_),function(){a.remove()}},[_&&$])}},styleSingleton=function(){var a=styleHookSingleton(),_=function($){var j=$.styles,et=$.dynamic;return a(j,et),null};return _},zeroGap$1={left:0,top:0,right:0,gap:0},parse$b=function(a){return parseInt(a||"",10)||0},getOffset$1=function(a){var _=window.getComputedStyle(document.body),$=_[a==="padding"?"paddingLeft":"marginLeft"],j=_[a==="padding"?"paddingTop":"marginTop"],et=_[a==="padding"?"paddingRight":"marginRight"];return[parse$b($),parse$b(j),parse$b(et)]},getGapWidth$1=function(a){if(a===void 0&&(a="margin"),typeof window>"u")return zeroGap$1;var _=getOffset$1(a),$=document.documentElement.clientWidth,j=window.innerWidth;return{left:_[0],top:_[1],right:_[2],gap:Math.max(0,j-$+_[2]-_[0])}},Style$1=styleSingleton(),getStyles$1=function(a,_,$,j){var et=a.left,tt=a.top,rt=a.right,nt=a.gap;return $===void 0&&($="margin"),` + `})}function warnIfOpenAndDisabled(a){warn({condition:a.isOpen&&!!a.isDisabled,message:"Cannot open a disabled accordion item"})}function AccordionIcon(a){const{isOpen:_,isDisabled:$}=useAccordionItemContext(),{reduceMotion:j}=useAccordionContext(),et=cx("chakra-accordion__icon",a.className),tt=useAccordionStyles(),rt={opacity:$?.4:1,transform:_?"rotate(-180deg)":void 0,transition:j?void 0:"transform 0.2s",transformOrigin:"center",...tt.icon};return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24","aria-hidden":!0,className:et,__css:rt,...a,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}AccordionIcon.displayName="AccordionIcon";var AccordionItem=forwardRef(function(_,$){const{children:j,className:et}=_,{htmlProps:tt,...rt}=useAccordionItem(_),it={...useAccordionStyles().container,overflowAnchor:"none"},st=reactExports.useMemo(()=>rt,[rt]);return jsxRuntimeExports.jsx(AccordionItemProvider,{value:st,children:jsxRuntimeExports.jsx(chakra.div,{ref:$,...tt,className:cx("chakra-accordion__item",et),__css:it,children:typeof j=="function"?j({isExpanded:!!rt.isOpen,isDisabled:!!rt.isDisabled}):j})})});AccordionItem.displayName="AccordionItem";var TRANSITION_EASINGS={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},TRANSITION_VARIANTS={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function getSlideTransition(a){var _;switch((_=a==null?void 0:a.direction)!=null?_:"right"){case"right":return TRANSITION_VARIANTS.slideRight;case"left":return TRANSITION_VARIANTS.slideLeft;case"bottom":return TRANSITION_VARIANTS.slideDown;case"top":return TRANSITION_VARIANTS.slideUp;default:return TRANSITION_VARIANTS.slideRight}}var TRANSITION_DEFAULTS={enter:{duration:.2,ease:TRANSITION_EASINGS.easeOut},exit:{duration:.1,ease:TRANSITION_EASINGS.easeIn}},withDelay={enter:(a,_)=>({...a,delay:typeof _=="number"?_:_==null?void 0:_.enter}),exit:(a,_)=>({...a,delay:typeof _=="number"?_:_==null?void 0:_.exit})},isNumeric$1=a=>a!=null&&parseInt(a.toString(),10)>0,defaultTransitions={exit:{height:{duration:.2,ease:TRANSITION_EASINGS.ease},opacity:{duration:.3,ease:TRANSITION_EASINGS.ease}},enter:{height:{duration:.3,ease:TRANSITION_EASINGS.ease},opacity:{duration:.4,ease:TRANSITION_EASINGS.ease}}},variants$4={exit:({animateOpacity:a,startingHeight:_,transition:$,transitionEnd:j,delay:et})=>{var tt;return{...a&&{opacity:isNumeric$1(_)?1:0},height:_,transitionEnd:j==null?void 0:j.exit,transition:(tt=$==null?void 0:$.exit)!=null?tt:withDelay.exit(defaultTransitions.exit,et)}},enter:({animateOpacity:a,endingHeight:_,transition:$,transitionEnd:j,delay:et})=>{var tt;return{...a&&{opacity:1},height:_,transitionEnd:j==null?void 0:j.enter,transition:(tt=$==null?void 0:$.enter)!=null?tt:withDelay.enter(defaultTransitions.enter,et)}}},Collapse=reactExports.forwardRef((a,_)=>{const{in:$,unmountOnExit:j,animateOpacity:et=!0,startingHeight:tt=0,endingHeight:rt="auto",style:nt,className:it,transition:st,transitionEnd:ot,...at}=a,[ut,ht]=reactExports.useState(!1);reactExports.useEffect(()=>{const $t=setTimeout(()=>{ht(!0)});return()=>clearTimeout($t)},[]),warn({condition:Number(tt)>0&&!!j,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const yt=parseFloat(tt.toString())>0,wt={startingHeight:tt,endingHeight:rt,animateOpacity:et,transition:ut?st:{enter:{duration:0}},transitionEnd:{enter:ot==null?void 0:ot.enter,exit:j?ot==null?void 0:ot.exit:{...ot==null?void 0:ot.exit,display:yt?"block":"none"}}},Ct=j?$:!0,Pt=$||j?"enter":"exit";return jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,custom:wt,children:Ct&&jsxRuntimeExports.jsx(motion.div,{ref:_,...at,className:cx("chakra-collapse",it),style:{overflow:"hidden",display:"block",...nt},custom:wt,variants:variants$4,initial:j?"exit":!1,animate:Pt,exit:"exit"})})});Collapse.displayName="Collapse";var variants$3={enter:({transition:a,transitionEnd:_,delay:$}={})=>{var j;return{opacity:1,transition:(j=a==null?void 0:a.enter)!=null?j:withDelay.enter(TRANSITION_DEFAULTS.enter,$),transitionEnd:_==null?void 0:_.enter}},exit:({transition:a,transitionEnd:_,delay:$}={})=>{var j;return{opacity:0,transition:(j=a==null?void 0:a.exit)!=null?j:withDelay.exit(TRANSITION_DEFAULTS.exit,$),transitionEnd:_==null?void 0:_.exit}}},fadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$3},Fade=reactExports.forwardRef(function(_,$){const{unmountOnExit:j,in:et,className:tt,transition:rt,transitionEnd:nt,delay:it,...st}=_,ot=et||j?"enter":"exit",at=j?et&&j:!0,ut={transition:rt,transitionEnd:nt,delay:it};return jsxRuntimeExports.jsx(AnimatePresence,{custom:ut,children:at&&jsxRuntimeExports.jsx(motion.div,{ref:$,className:cx("chakra-fade",tt),custom:ut,...fadeConfig,animate:ot,...st})})});Fade.displayName="Fade";var variants$2={exit:({reverse:a,initialScale:_,transition:$,transitionEnd:j,delay:et})=>{var tt;return{opacity:0,...a?{scale:_,transitionEnd:j==null?void 0:j.exit}:{transitionEnd:{scale:_,...j==null?void 0:j.exit}},transition:(tt=$==null?void 0:$.exit)!=null?tt:withDelay.exit(TRANSITION_DEFAULTS.exit,et)}},enter:({transitionEnd:a,transition:_,delay:$})=>{var j;return{opacity:1,scale:1,transition:(j=_==null?void 0:_.enter)!=null?j:withDelay.enter(TRANSITION_DEFAULTS.enter,$),transitionEnd:a==null?void 0:a.enter}}},scaleFadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$2},ScaleFade=reactExports.forwardRef(function(_,$){const{unmountOnExit:j,in:et,reverse:tt=!0,initialScale:rt=.95,className:nt,transition:it,transitionEnd:st,delay:ot,...at}=_,ut=j?et&&j:!0,ht=et||j?"enter":"exit",yt={initialScale:rt,reverse:tt,transition:it,transitionEnd:st,delay:ot};return jsxRuntimeExports.jsx(AnimatePresence,{custom:yt,children:ut&&jsxRuntimeExports.jsx(motion.div,{ref:$,className:cx("chakra-offset-slide",nt),...scaleFadeConfig,animate:ht,custom:yt,...at})})});ScaleFade.displayName="ScaleFade";var variants$1={initial:({offsetX:a,offsetY:_,transition:$,transitionEnd:j,delay:et})=>{var tt;return{opacity:0,x:a,y:_,transition:(tt=$==null?void 0:$.exit)!=null?tt:withDelay.exit(TRANSITION_DEFAULTS.exit,et),transitionEnd:j==null?void 0:j.exit}},enter:({transition:a,transitionEnd:_,delay:$})=>{var j;return{opacity:1,x:0,y:0,transition:(j=a==null?void 0:a.enter)!=null?j:withDelay.enter(TRANSITION_DEFAULTS.enter,$),transitionEnd:_==null?void 0:_.enter}},exit:({offsetY:a,offsetX:_,transition:$,transitionEnd:j,reverse:et,delay:tt})=>{var rt;const nt={x:_,y:a};return{opacity:0,transition:(rt=$==null?void 0:$.exit)!=null?rt:withDelay.exit(TRANSITION_DEFAULTS.exit,tt),...et?{...nt,transitionEnd:j==null?void 0:j.exit}:{transitionEnd:{...nt,...j==null?void 0:j.exit}}}}},slideFadeConfig={initial:"initial",animate:"enter",exit:"exit",variants:variants$1},SlideFade=reactExports.forwardRef(function(_,$){const{unmountOnExit:j,in:et,reverse:tt=!0,className:rt,offsetX:nt=0,offsetY:it=8,transition:st,transitionEnd:ot,delay:at,...ut}=_,ht=j?et&&j:!0,yt=et||j?"enter":"exit",wt={offsetX:nt,offsetY:it,reverse:tt,transition:st,transitionEnd:ot,delay:at};return jsxRuntimeExports.jsx(AnimatePresence,{custom:wt,children:ht&&jsxRuntimeExports.jsx(motion.div,{ref:$,className:cx("chakra-offset-slide",rt),custom:wt,...slideFadeConfig,animate:yt,...ut})})});SlideFade.displayName="SlideFade";var defaultTransition={exit:{duration:.15,ease:TRANSITION_EASINGS.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},variants={exit:({direction:a,transition:_,transitionEnd:$,delay:j})=>{var et;const{exit:tt}=getSlideTransition({direction:a});return{...tt,transition:(et=_==null?void 0:_.exit)!=null?et:withDelay.exit(defaultTransition.exit,j),transitionEnd:$==null?void 0:$.exit}},enter:({direction:a,transitionEnd:_,transition:$,delay:j})=>{var et;const{enter:tt}=getSlideTransition({direction:a});return{...tt,transition:(et=$==null?void 0:$.enter)!=null?et:withDelay.enter(defaultTransition.enter,j),transitionEnd:_==null?void 0:_.enter}}},Slide=reactExports.forwardRef(function(_,$){const{direction:j="right",style:et,unmountOnExit:tt,in:rt,className:nt,transition:it,transitionEnd:st,delay:ot,motionProps:at,...ut}=_,ht=getSlideTransition({direction:j}),yt=Object.assign({position:"fixed"},ht.position,et),wt=tt?rt&&tt:!0,Ct=rt||tt?"enter":"exit",Pt={transitionEnd:st,transition:it,direction:j,delay:ot};return jsxRuntimeExports.jsx(AnimatePresence,{custom:Pt,children:wt&&jsxRuntimeExports.jsx(motion.div,{...ut,ref:$,initial:"exit",className:cx("chakra-slide",nt),animate:Ct,exit:"exit",custom:Pt,variants,style:yt,...at})})});Slide.displayName="Slide";var AccordionPanel=forwardRef(function(_,$){const{className:j,motionProps:et,...tt}=_,{reduceMotion:rt}=useAccordionContext(),{getPanelProps:nt,isOpen:it}=useAccordionItemContext(),st=nt(tt,$),ot=cx("chakra-accordion__panel",j),at=useAccordionStyles();rt||delete st.hidden;const ut=jsxRuntimeExports.jsx(chakra.div,{...st,__css:at.panel,className:ot});return rt?ut:jsxRuntimeExports.jsx(Collapse,{in:it,...et,children:ut})});AccordionPanel.displayName="AccordionPanel";var Accordion=forwardRef(function({children:_,reduceMotion:$,...j},et){const tt=useMultiStyleConfig("Accordion",j),rt=omitThemingProps(j),{htmlProps:nt,descendants:it,...st}=useAccordion(rt),ot=reactExports.useMemo(()=>({...st,reduceMotion:!!$}),[st,$]);return jsxRuntimeExports.jsx(AccordionDescendantsProvider,{value:it,children:jsxRuntimeExports.jsx(AccordionProvider,{value:ot,children:jsxRuntimeExports.jsx(AccordionStylesProvider,{value:tt,children:jsxRuntimeExports.jsx(chakra.div,{ref:et,...nt,className:cx("chakra-accordion",j.className),__css:tt.root,children:_})})})})});Accordion.displayName="Accordion";var NativeImage=forwardRef(function(_,$){const{htmlWidth:j,htmlHeight:et,alt:tt,...rt}=_;return jsxRuntimeExports.jsx("img",{width:j,height:et,ref:$,alt:tt,...rt})});NativeImage.displayName="NativeImage";function useImage(a){const{loading:_,src:$,srcSet:j,onLoad:et,onError:tt,crossOrigin:rt,sizes:nt,ignoreFallback:it}=a,[st,ot]=reactExports.useState("pending");reactExports.useEffect(()=>{ot($?"loading":"pending")},[$]);const at=reactExports.useRef(),ut=reactExports.useCallback(()=>{if(!$)return;ht();const yt=new Image;yt.src=$,rt&&(yt.crossOrigin=rt),j&&(yt.srcset=j),nt&&(yt.sizes=nt),_&&(yt.loading=_),yt.onload=wt=>{ht(),ot("loaded"),et==null||et(wt)},yt.onerror=wt=>{ht(),ot("failed"),tt==null||tt(wt)},at.current=yt},[$,rt,j,nt,et,tt,_]),ht=()=>{at.current&&(at.current.onload=null,at.current.onerror=null,at.current=null)};return useSafeLayoutEffect$2(()=>{if(!it)return st==="loading"&&ut(),()=>{ht()}},[st,ut,it]),it?"loaded":st}var shouldShowFallbackImage=(a,_)=>a!=="loaded"&&_==="beforeLoadOrError"||a==="failed"&&_==="onError";function omit$4(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}var Image$1=forwardRef(function(_,$){const{fallbackSrc:j,fallback:et,src:tt,srcSet:rt,align:nt,fit:it,loading:st,ignoreFallback:ot,crossOrigin:at,fallbackStrategy:ut="beforeLoadOrError",referrerPolicy:ht,...yt}=_,wt=j!==void 0||et!==void 0,Ct=st!=null||ot||!wt,Pt=useImage({..._,crossOrigin:at,ignoreFallback:Ct}),$t=shouldShowFallbackImage(Pt,ut),Mt={ref:$,objectFit:it,objectPosition:nt,...Ct?yt:omit$4(yt,["onError","onLoad"])};return $t?et||jsxRuntimeExports.jsx(chakra.img,{as:NativeImage,className:"chakra-image__placeholder",src:j,...Mt}):jsxRuntimeExports.jsx(chakra.img,{as:NativeImage,src:tt,srcSet:rt,crossOrigin:at,loading:st,referrerPolicy:ht,className:"chakra-image",...Mt})});Image$1.displayName="Image";function getValidChildren(a){return reactExports.Children.toArray(a).filter(_=>reactExports.isValidElement(_))}var[ButtonGroupProvider,useButtonGroup]=createContext$1({strict:!1,name:"ButtonGroupContext"});function useButtonType(a){const[_,$]=reactExports.useState(!a);return{ref:reactExports.useCallback(tt=>{tt&&$(tt.tagName==="BUTTON")},[]),type:_?"button":void 0}}function ButtonIcon(a){const{children:_,className:$,...j}=a,et=reactExports.isValidElement(_)?reactExports.cloneElement(_,{"aria-hidden":!0,focusable:!1}):_,tt=cx("chakra-button__icon",$);return jsxRuntimeExports.jsx(chakra.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...j,className:tt,children:et})}ButtonIcon.displayName="ButtonIcon";function ButtonSpinner(a){const{label:_,placement:$,spacing:j="0.5rem",children:et=jsxRuntimeExports.jsx(Spinner,{color:"currentColor",width:"1em",height:"1em"}),className:tt,__css:rt,...nt}=a,it=cx("chakra-button__spinner",tt),st=$==="start"?"marginEnd":"marginStart",ot=reactExports.useMemo(()=>({display:"flex",alignItems:"center",position:_?"relative":"absolute",[st]:_?j:0,fontSize:"1em",lineHeight:"normal",...rt}),[rt,_,st,j]);return jsxRuntimeExports.jsx(chakra.div,{className:it,...nt,__css:ot,children:et})}ButtonSpinner.displayName="ButtonSpinner";var Button=forwardRef((a,_)=>{const $=useButtonGroup(),j=useStyleConfig("Button",{...$,...a}),{isDisabled:et=$==null?void 0:$.isDisabled,isLoading:tt,isActive:rt,children:nt,leftIcon:it,rightIcon:st,loadingText:ot,iconSpacing:at="0.5rem",type:ut,spinner:ht,spinnerPlacement:yt="start",className:wt,as:Ct,...Pt}=omitThemingProps(a),$t=reactExports.useMemo(()=>{const zt={...j==null?void 0:j._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...j,...!!$&&{_focus:zt}}},[j,$]),{ref:Mt,type:Bt}=useButtonType(Ct),Dt={rightIcon:st,leftIcon:it,iconSpacing:at,children:nt};return jsxRuntimeExports.jsxs(chakra.button,{ref:useMergeRefs$1(_,Mt),as:Ct,type:ut??Bt,"data-active":dataAttr(rt),"data-loading":dataAttr(tt),__css:$t,className:cx("chakra-button",wt),...Pt,disabled:et||tt,children:[tt&&yt==="start"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--start",label:ot,placement:"start",spacing:at,children:ht}),tt?ot||jsxRuntimeExports.jsx(chakra.span,{opacity:0,children:jsxRuntimeExports.jsx(ButtonContent,{...Dt})}):jsxRuntimeExports.jsx(ButtonContent,{...Dt}),tt&&yt==="end"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--end",label:ot,placement:"end",spacing:at,children:ht})]})});Button.displayName="Button";function ButtonContent(a){const{leftIcon:_,rightIcon:$,children:j,iconSpacing:et}=a;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[_&&jsxRuntimeExports.jsx(ButtonIcon,{marginEnd:et,children:_}),j,$&&jsxRuntimeExports.jsx(ButtonIcon,{marginStart:et,children:$})]})}var IconButton=forwardRef((a,_)=>{const{icon:$,children:j,isRound:et,"aria-label":tt,...rt}=a,nt=$||j,it=reactExports.isValidElement(nt)?reactExports.cloneElement(nt,{"aria-hidden":!0,focusable:!1}):null;return jsxRuntimeExports.jsx(Button,{padding:"0",borderRadius:et?"full":void 0,ref:_,"aria-label":tt,...rt,children:it})});IconButton.displayName="IconButton";var[CardStylesProvider,useCardStyles]=createStylesContext("Card"),CardBody=forwardRef(function(_,$){const{className:j,...et}=_,tt=useCardStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:$,className:cx("chakra-card__body",j),__css:tt.body,...et})}),Card=forwardRef(function(_,$){const{className:j,children:et,direction:tt="column",justify:rt,align:nt,...it}=omitThemingProps(_),st=useMultiStyleConfig("Card",_);return jsxRuntimeExports.jsx(chakra.div,{ref:$,className:cx("chakra-card",j),__css:{display:"flex",flexDirection:tt,justifyContent:rt,alignItems:nt,position:"relative",minWidth:0,wordWrap:"break-word",...st.container},...it,children:jsxRuntimeExports.jsx(CardStylesProvider,{value:st,children:et})})}),[CheckboxGroupProvider,useCheckboxGroupContext]=createContext$1({name:"CheckboxGroupContext",strict:!1});function useInitialAnimationState(a){const[_,$]=reactExports.useState(a),[j,et]=reactExports.useState(!1);return a!==_&&(et(!0),$(a)),j}function CheckIcon$2(a){return jsxRuntimeExports.jsx(chakra.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...a,children:jsxRuntimeExports.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function IndeterminateIcon(a){return jsxRuntimeExports.jsx(chakra.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...a,children:jsxRuntimeExports.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function CheckboxIcon(a){const{isIndeterminate:_,isChecked:$,...j}=a,et=_?IndeterminateIcon:CheckIcon$2;return $||_?jsxRuntimeExports.jsx(chakra.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:jsxRuntimeExports.jsx(et,{...j})}):null}var[FormControlStylesProvider,useFormControlStyles]=createContext$1({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[FormControlProvider,useFormControlContext]=createContext$1({strict:!1,name:"FormControlContext"});function useFormControlProvider(a){const{id:_,isRequired:$,isInvalid:j,isDisabled:et,isReadOnly:tt,...rt}=a,nt=reactExports.useId(),it=_||`field-${nt}`,st=`${it}-label`,ot=`${it}-feedback`,at=`${it}-helptext`,[ut,ht]=reactExports.useState(!1),[yt,wt]=reactExports.useState(!1),[Ct,Pt]=reactExports.useState(!1),$t=reactExports.useCallback((Ot={},It=null)=>({id:at,...Ot,ref:mergeRefs(It,Lt=>{Lt&&wt(!0)})}),[at]),Mt=reactExports.useCallback((Ot={},It=null)=>({...Ot,ref:It,"data-focus":dataAttr(Ct),"data-disabled":dataAttr(et),"data-invalid":dataAttr(j),"data-readonly":dataAttr(tt),id:Ot.id!==void 0?Ot.id:st,htmlFor:Ot.htmlFor!==void 0?Ot.htmlFor:it}),[it,et,Ct,j,tt,st]),Bt=reactExports.useCallback((Ot={},It=null)=>({id:ot,...Ot,ref:mergeRefs(It,Lt=>{Lt&&ht(!0)}),"aria-live":"polite"}),[ot]),Dt=reactExports.useCallback((Ot={},It=null)=>({...Ot,...rt,ref:It,role:"group","data-focus":dataAttr(Ct),"data-disabled":dataAttr(et),"data-invalid":dataAttr(j),"data-readonly":dataAttr(tt)}),[rt,et,Ct,j,tt]),zt=reactExports.useCallback((Ot={},It=null)=>({...Ot,ref:It,role:"presentation","aria-hidden":!0,children:Ot.children||"*"}),[]);return{isRequired:!!$,isInvalid:!!j,isReadOnly:!!tt,isDisabled:!!et,isFocused:!!Ct,onFocus:()=>Pt(!0),onBlur:()=>Pt(!1),hasFeedbackText:ut,setHasFeedbackText:ht,hasHelpText:yt,setHasHelpText:wt,id:it,labelId:st,feedbackId:ot,helpTextId:at,htmlProps:rt,getHelpTextProps:$t,getErrorMessageProps:Bt,getRootProps:Dt,getLabelProps:Mt,getRequiredIndicatorProps:zt}}var FormControl=forwardRef(function(_,$){const j=useMultiStyleConfig("Form",_),et=omitThemingProps(_),{getRootProps:tt,htmlProps:rt,...nt}=useFormControlProvider(et),it=cx("chakra-form-control",_.className);return jsxRuntimeExports.jsx(FormControlProvider,{value:nt,children:jsxRuntimeExports.jsx(FormControlStylesProvider,{value:j,children:jsxRuntimeExports.jsx(chakra.div,{...tt({},$),className:it,__css:j.container})})})});FormControl.displayName="FormControl";var FormHelperText=forwardRef(function(_,$){const j=useFormControlContext(),et=useFormControlStyles(),tt=cx("chakra-form__helper-text",_.className);return jsxRuntimeExports.jsx(chakra.div,{...j==null?void 0:j.getHelpTextProps(_,$),__css:et.helperText,className:tt})});FormHelperText.displayName="FormHelperText";var[FormErrorStylesProvider,useFormErrorStyles]=createContext$1({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),FormErrorMessage$1=forwardRef((a,_)=>{const $=useMultiStyleConfig("FormError",a),j=omitThemingProps(a),et=useFormControlContext();return et!=null&&et.isInvalid?jsxRuntimeExports.jsx(FormErrorStylesProvider,{value:$,children:jsxRuntimeExports.jsx(chakra.div,{...et==null?void 0:et.getErrorMessageProps(j,_),className:cx("chakra-form__error-message",a.className),__css:{display:"flex",alignItems:"center",...$.text}})}):null});FormErrorMessage$1.displayName="FormErrorMessage";var FormErrorIcon=forwardRef((a,_)=>{const $=useFormErrorStyles(),j=useFormControlContext();if(!(j!=null&&j.isInvalid))return null;const et=cx("chakra-form__error-icon",a.className);return jsxRuntimeExports.jsx(Icon,{ref:_,"aria-hidden":!0,...a,__css:$.icon,className:et,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})});FormErrorIcon.displayName="FormErrorIcon";var FormLabel=forwardRef(function(_,$){var j;const et=useStyleConfig("FormLabel",_),tt=omitThemingProps(_),{className:rt,children:nt,requiredIndicator:it=jsxRuntimeExports.jsx(RequiredIndicator,{}),optionalIndicator:st=null,...ot}=tt,at=useFormControlContext(),ut=(j=at==null?void 0:at.getLabelProps(ot,$))!=null?j:{ref:$,...ot};return jsxRuntimeExports.jsxs(chakra.label,{...ut,className:cx("chakra-form__label",tt.className),__css:{display:"block",textAlign:"start",...et},children:[nt,at!=null&&at.isRequired?it:st]})});FormLabel.displayName="FormLabel";var RequiredIndicator=forwardRef(function(_,$){const j=useFormControlContext(),et=useFormControlStyles();if(!(j!=null&&j.isRequired))return null;const tt=cx("chakra-form__required-indicator",_.className);return jsxRuntimeExports.jsx(chakra.span,{...j==null?void 0:j.getRequiredIndicatorProps(_,$),__css:et.requiredIndicator,className:tt})});RequiredIndicator.displayName="RequiredIndicator";function useFormControl(a){const{isDisabled:_,isInvalid:$,isReadOnly:j,isRequired:et,...tt}=useFormControlProps(a);return{...tt,disabled:_,readOnly:j,required:et,"aria-invalid":ariaAttr($),"aria-required":ariaAttr(et),"aria-readonly":ariaAttr(j)}}function useFormControlProps(a){var _,$,j;const et=useFormControlContext(),{id:tt,disabled:rt,readOnly:nt,required:it,isRequired:st,isInvalid:ot,isReadOnly:at,isDisabled:ut,onFocus:ht,onBlur:yt,...wt}=a,Ct=a["aria-describedby"]?[a["aria-describedby"]]:[];return et!=null&&et.hasFeedbackText&&(et!=null&&et.isInvalid)&&Ct.push(et.feedbackId),et!=null&&et.hasHelpText&&Ct.push(et.helpTextId),{...wt,"aria-describedby":Ct.join(" ")||void 0,id:tt??(et==null?void 0:et.id),isDisabled:(_=rt??ut)!=null?_:et==null?void 0:et.isDisabled,isReadOnly:($=nt??at)!=null?$:et==null?void 0:et.isReadOnly,isRequired:(j=it??st)!=null?j:et==null?void 0:et.isRequired,isInvalid:ot??(et==null?void 0:et.isInvalid),onFocus:callAllHandlers$1(et==null?void 0:et.onFocus,ht),onBlur:callAllHandlers$1(et==null?void 0:et.onBlur,yt)}}var visuallyHiddenStyle$1={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},isDom$1=()=>typeof document<"u",hasSetup=!1,modality=null,hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1,handlers=new Set;function trigger(a,_){handlers.forEach($=>$(a,_))}var isMac=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function isValidKey(a){return!(a.metaKey||!isMac&&a.altKey||a.ctrlKey||a.key==="Control"||a.key==="Shift"||a.key==="Meta")}function onKeyboardEvent(a){hasEventBeforeFocus=!0,isValidKey(a)&&(modality="keyboard",trigger("keyboard",a))}function onPointerEvent(a){if(modality="pointer",a.type==="mousedown"||a.type==="pointerdown"){hasEventBeforeFocus=!0;const _=a.composedPath?a.composedPath()[0]:a.target;let $=!1;try{$=_.matches(":focus-visible")}catch{}if($)return;trigger("pointer",a)}}function isVirtualClick(a){return a.mozInputSource===0&&a.isTrusted?!0:a.detail===0&&!a.pointerType}function onClickEvent(a){isVirtualClick(a)&&(hasEventBeforeFocus=!0,modality="virtual")}function onWindowFocus(a){a.target===window||a.target===document||(!hasEventBeforeFocus&&!hasBlurredWindowRecently&&(modality="virtual",trigger("virtual",a)),hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1)}function onWindowBlur$1(){hasEventBeforeFocus=!1,hasBlurredWindowRecently=!0}function isFocusVisible(){return modality!=="pointer"}function setupGlobalFocusEvents(){if(!isDom$1()||hasSetup)return;const{focus:a}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...$){hasEventBeforeFocus=!0,a.apply(this,$)},document.addEventListener("keydown",onKeyboardEvent,!0),document.addEventListener("keyup",onKeyboardEvent,!0),document.addEventListener("click",onClickEvent,!0),window.addEventListener("focus",onWindowFocus,!0),window.addEventListener("blur",onWindowBlur$1,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",onPointerEvent,!0),document.addEventListener("pointermove",onPointerEvent,!0),document.addEventListener("pointerup",onPointerEvent,!0)):(document.addEventListener("mousedown",onPointerEvent,!0),document.addEventListener("mousemove",onPointerEvent,!0),document.addEventListener("mouseup",onPointerEvent,!0)),hasSetup=!0}function trackFocusVisible(a){setupGlobalFocusEvents(),a(isFocusVisible());const _=()=>a(isFocusVisible());return handlers.add(_),()=>{handlers.delete(_)}}function omit$3(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}function useCheckbox(a={}){const _=useFormControlProps(a),{isDisabled:$,isReadOnly:j,isRequired:et,isInvalid:tt,id:rt,onBlur:nt,onFocus:it,"aria-describedby":st}=_,{defaultChecked:ot,isChecked:at,isFocusable:ut,onChange:ht,isIndeterminate:yt,name:wt,value:Ct,tabIndex:Pt=void 0,"aria-label":$t,"aria-labelledby":Mt,"aria-invalid":Bt,...Dt}=a,zt=omit$3(Dt,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),Ot=useCallbackRef$2(ht),It=useCallbackRef$2(nt),Lt=useCallbackRef$2(it),[Ft,jt]=reactExports.useState(!1),[bt,vt]=reactExports.useState(!1),[ct,dt]=reactExports.useState(!1),[mt,xt]=reactExports.useState(!1);reactExports.useEffect(()=>trackFocusVisible(jt),[]);const At=reactExports.useRef(null),[Rt,St]=reactExports.useState(!0),[Tt,Et]=reactExports.useState(!!ot),Nt=at!==void 0,tr=Nt?at:Tt,ir=reactExports.useCallback(pr=>{if(j||$){pr.preventDefault();return}Nt||Et(tr?pr.target.checked:yt?!0:pr.target.checked),Ot==null||Ot(pr)},[j,$,tr,Nt,yt,Ot]);useSafeLayoutEffect$2(()=>{At.current&&(At.current.indeterminate=!!yt)},[yt]),useUpdateEffect(()=>{$&&vt(!1)},[$,vt]),useSafeLayoutEffect$2(()=>{const pr=At.current;if(!(pr!=null&&pr.form))return;const Cr=()=>{Et(!!ot)};return pr.form.addEventListener("reset",Cr),()=>{var Mr;return(Mr=pr.form)==null?void 0:Mr.removeEventListener("reset",Cr)}},[]);const nr=$&&!ut,Zt=reactExports.useCallback(pr=>{pr.key===" "&&xt(!0)},[xt]),Kt=reactExports.useCallback(pr=>{pr.key===" "&&xt(!1)},[xt]);useSafeLayoutEffect$2(()=>{if(!At.current)return;At.current.checked!==tr&&Et(At.current.checked)},[At.current]);const Qt=reactExports.useCallback((pr={},Cr=null)=>{const Mr=lr=>{bt&&lr.preventDefault(),xt(!0)};return{...pr,ref:Cr,"data-active":dataAttr(mt),"data-hover":dataAttr(ct),"data-checked":dataAttr(tr),"data-focus":dataAttr(bt),"data-focus-visible":dataAttr(bt&&Ft),"data-indeterminate":dataAttr(yt),"data-disabled":dataAttr($),"data-invalid":dataAttr(tt),"data-readonly":dataAttr(j),"aria-hidden":!0,onMouseDown:callAllHandlers$1(pr.onMouseDown,Mr),onMouseUp:callAllHandlers$1(pr.onMouseUp,()=>xt(!1)),onMouseEnter:callAllHandlers$1(pr.onMouseEnter,()=>dt(!0)),onMouseLeave:callAllHandlers$1(pr.onMouseLeave,()=>dt(!1))}},[mt,tr,$,bt,Ft,ct,yt,tt,j]),Ht=reactExports.useCallback((pr={},Cr=null)=>({...pr,ref:Cr,"data-active":dataAttr(mt),"data-hover":dataAttr(ct),"data-checked":dataAttr(tr),"data-focus":dataAttr(bt),"data-focus-visible":dataAttr(bt&&Ft),"data-indeterminate":dataAttr(yt),"data-disabled":dataAttr($),"data-invalid":dataAttr(tt),"data-readonly":dataAttr(j)}),[mt,tr,$,bt,Ft,ct,yt,tt,j]),qt=reactExports.useCallback((pr={},Cr=null)=>({...zt,...pr,ref:mergeRefs(Cr,Mr=>{Mr&&St(Mr.tagName==="LABEL")}),onClick:callAllHandlers$1(pr.onClick,()=>{var Mr;Rt||((Mr=At.current)==null||Mr.click(),requestAnimationFrame(()=>{var lr;(lr=At.current)==null||lr.focus({preventScroll:!0})}))}),"data-disabled":dataAttr($),"data-checked":dataAttr(tr),"data-invalid":dataAttr(tt)}),[zt,$,tr,tt,Rt]),Jt=reactExports.useCallback((pr={},Cr=null)=>({...pr,ref:mergeRefs(At,Cr),type:"checkbox",name:wt,value:Ct,id:rt,tabIndex:Pt,onChange:callAllHandlers$1(pr.onChange,ir),onBlur:callAllHandlers$1(pr.onBlur,It,()=>vt(!1)),onFocus:callAllHandlers$1(pr.onFocus,Lt,()=>vt(!0)),onKeyDown:callAllHandlers$1(pr.onKeyDown,Zt),onKeyUp:callAllHandlers$1(pr.onKeyUp,Kt),required:et,checked:tr,disabled:nr,readOnly:j,"aria-label":$t,"aria-labelledby":Mt,"aria-invalid":Bt?!!Bt:tt,"aria-describedby":st,"aria-disabled":$,style:visuallyHiddenStyle$1}),[wt,Ct,rt,ir,It,Lt,Zt,Kt,et,tr,nr,j,$t,Mt,Bt,tt,st,$,Pt]),ur=reactExports.useCallback((pr={},Cr=null)=>({...pr,ref:Cr,onMouseDown:callAllHandlers$1(pr.onMouseDown,stopEvent$1),"data-disabled":dataAttr($),"data-checked":dataAttr(tr),"data-invalid":dataAttr(tt)}),[tr,$,tt]);return{state:{isInvalid:tt,isFocused:bt,isChecked:tr,isActive:mt,isHovered:ct,isIndeterminate:yt,isDisabled:$,isReadOnly:j,isRequired:et},getRootProps:qt,getCheckboxProps:Qt,getIndicatorProps:Ht,getInputProps:Jt,getLabelProps:ur,htmlProps:zt}}function stopEvent$1(a){a.preventDefault(),a.stopPropagation()}var controlStyles={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},rootStyles={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},checkAnim=keyframes$1({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),indeterminateOpacityAnim=keyframes$1({from:{opacity:0},to:{opacity:1}}),indeterminateScaleAnim=keyframes$1({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Checkbox=forwardRef(function(_,$){const j=useCheckboxGroupContext(),et={...j,..._},tt=useMultiStyleConfig("Checkbox",et),rt=omitThemingProps(_),{spacing:nt="0.5rem",className:it,children:st,iconColor:ot,iconSize:at,icon:ut=jsxRuntimeExports.jsx(CheckboxIcon,{}),isChecked:ht,isDisabled:yt=j==null?void 0:j.isDisabled,onChange:wt,inputProps:Ct,...Pt}=rt;let $t=ht;j!=null&&j.value&&rt.value&&($t=j.value.includes(rt.value));let Mt=wt;j!=null&&j.onChange&&rt.value&&(Mt=callAll(j.onChange,wt));const{state:Bt,getInputProps:Dt,getCheckboxProps:zt,getLabelProps:Ot,getRootProps:It}=useCheckbox({...Pt,isDisabled:yt,isChecked:$t,onChange:Mt}),Lt=useInitialAnimationState(Bt.isChecked),Ft=reactExports.useMemo(()=>({animation:Lt?Bt.isIndeterminate?`${indeterminateOpacityAnim} 20ms linear, ${indeterminateScaleAnim} 200ms linear`:`${checkAnim} 200ms linear`:void 0,fontSize:at,color:ot,...tt.icon}),[ot,at,Lt,Bt.isIndeterminate,tt.icon]),jt=reactExports.cloneElement(ut,{__css:Ft,isIndeterminate:Bt.isIndeterminate,isChecked:Bt.isChecked});return jsxRuntimeExports.jsxs(chakra.label,{__css:{...rootStyles,...tt.container},className:cx("chakra-checkbox",it),...It(),children:[jsxRuntimeExports.jsx("input",{className:"chakra-checkbox__input",...Dt(Ct,$)}),jsxRuntimeExports.jsx(chakra.span,{__css:{...controlStyles,...tt.control},className:"chakra-checkbox__control",...zt(),children:jt}),st&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-checkbox__label",...Ot(),__css:{marginStart:nt,...tt.label},children:st})]})});Checkbox.displayName="Checkbox";function useEventListener(a,_,$,j){const et=useCallbackRef$2($);return reactExports.useEffect(()=>{const tt=typeof a=="function"?a():a??document;if(!(!$||!tt))return tt.addEventListener(_,et,j),()=>{tt.removeEventListener(_,et,j)}},[_,a,j,et,$]),()=>{const tt=typeof a=="function"?a():a??document;tt==null||tt.removeEventListener(_,et,j)}}function isRefObject$1(a){return"current"in a}var isDom=()=>typeof window<"u";function getPlatform(){var a;const _=navigator.userAgentData;return(a=_==null?void 0:_.platform)!=null?a:navigator.platform}var vn=a=>isDom()&&a.test(navigator.vendor),pt=a=>isDom()&&a.test(getPlatform()),isApple=()=>pt(/mac|iphone|ipad|ipod/i),isSafari=()=>isApple()&&vn(/apple/i);function useFocusOnPointerDown(a){const{ref:_,elements:$,enabled:j}=a,et=()=>{var tt,rt;return(rt=(tt=_.current)==null?void 0:tt.ownerDocument)!=null?rt:document};useEventListener(et,"pointerdown",tt=>{if(!isSafari()||!j)return;const rt=tt.target,it=($??[_]).some(st=>{const ot=isRefObject$1(st)?st.current:st;return(ot==null?void 0:ot.contains(rt))||ot===rt});et().activeElement!==rt&&it&&(tt.preventDefault(),rt.focus())})}function _objectWithoutPropertiesLoose$3(a,_){if(a==null)return{};var $={},j=Object.keys(a),et,tt;for(tt=0;tt=0)&&($[et]=a[et]);return $}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(a){for(var _=1;_0&&tt[tt.length-1])&&(st[0]===6||st[0]===2)){$=0;continue}if(st[0]===3&&(!tt||st[1]>tt[0]&&st[1]=a.length&&(a=void 0),{value:a&&a[j++],done:!a}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(a,_){var $=typeof Symbol=="function"&&a[Symbol.iterator];if(!$)return a;var j=$.call(a),et,tt=[],rt;try{for(;(_===void 0||_-- >0)&&!(et=j.next()).done;)tt.push(et.value)}catch(nt){rt={error:nt}}finally{try{et&&!et.done&&($=j.return)&&$.call(j)}finally{if(rt)throw rt.error}}return tt}function __spreadArray(a,_,$){if($||arguments.length===2)for(var j=0,et=_.length,tt;j1||nt(ut,ht)})})}function nt(ut,ht){try{it(j[ut](ht))}catch(yt){at(tt[0][3],yt)}}function it(ut){ut.value instanceof __await?Promise.resolve(ut.value.v).then(st,ot):at(tt[0][2],ut)}function st(ut){nt("next",ut)}function ot(ut){nt("throw",ut)}function at(ut,ht){ut(ht),tt.shift(),tt.length&&nt(tt[0][0],tt[0][1])}}function __asyncValues(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var _=a[Symbol.asyncIterator],$;return _?_.call(a):(a=typeof __values=="function"?__values(a):a[Symbol.iterator](),$={},j("next"),j("throw"),j("return"),$[Symbol.asyncIterator]=function(){return this},$);function j(tt){$[tt]=a[tt]&&function(rt){return new Promise(function(nt,it){rt=a[tt](rt),et(nt,it,rt.done,rt.value)})}}function et(tt,rt,nt,it){Promise.resolve(it).then(function(st){tt({value:st,done:nt})},rt)}}typeof SuppressedError=="function"&&SuppressedError;function ItoI(a){return a}function innerCreateMedium(a,_){_===void 0&&(_=ItoI);var $=[],j=!1,et={read:function(){if(j)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return $.length?$[$.length-1]:a},useMedium:function(tt){var rt=_(tt,j);return $.push(rt),function(){$=$.filter(function(nt){return nt!==rt})}},assignSyncMedium:function(tt){for(j=!0;$.length;){var rt=$;$=[],rt.forEach(tt)}$={push:function(nt){return tt(nt)},filter:function(){return $}}},assignMedium:function(tt){j=!0;var rt=[];if($.length){var nt=$;$=[],nt.forEach(tt),rt=$}var it=function(){var ot=rt;rt=[],ot.forEach(tt)},st=function(){return Promise.resolve().then(it)};st(),$={push:function(ot){rt.push(ot),st()},filter:function(ot){return rt=rt.filter(ot),$}}}};return et}function createMedium(a,_){return _===void 0&&(_=ItoI),innerCreateMedium(a,_)}function createSidecarMedium(a){a===void 0&&(a={});var _=innerCreateMedium(null);return _.options=__assign({async:!0,ssr:!1},a),_}var SideCar$2=function(a){var _=a.sideCar,$=__rest$3(a,["sideCar"]);if(!_)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var j=_.read();if(!j)throw new Error("Sidecar medium not found");return reactExports.createElement(j,__assign({},$))};SideCar$2.isSideCarExport=!0;function exportSidecar(a,_){return a.useMedium(_),SideCar$2}var mediumFocus=createMedium({},function(a){var _=a.target,$=a.currentTarget;return{target:_,currentTarget:$}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0}),emptyArray=[],FocusLock$1=reactExports.forwardRef(function(_,$){var j,et=reactExports.useState(),tt=et[0],rt=et[1],nt=reactExports.useRef(),it=reactExports.useRef(!1),st=reactExports.useRef(null),ot=_.children,at=_.disabled,ut=_.noFocusGuards,ht=_.persistentFocus,yt=_.crossFrame,wt=_.autoFocus;_.allowTextSelection;var Ct=_.group,Pt=_.className,$t=_.whiteList,Mt=_.hasPositiveIndices,Bt=_.shards,Dt=Bt===void 0?emptyArray:Bt,zt=_.as,Ot=zt===void 0?"div":zt,It=_.lockProps,Lt=It===void 0?{}:It,Ft=_.sideCar,jt=_.returnFocus,bt=_.focusOptions,vt=_.onActivation,ct=_.onDeactivation,dt=reactExports.useState({}),mt=dt[0],xt=reactExports.useCallback(function(){st.current=st.current||document&&document.activeElement,nt.current&&vt&&vt(nt.current),it.current=!0},[vt]),At=reactExports.useCallback(function(){it.current=!1,ct&&ct(nt.current)},[ct]);reactExports.useEffect(function(){at||(st.current=null)},[]);var Rt=reactExports.useCallback(function(Zt){var Kt=st.current;if(Kt&&Kt.focus){var Qt=typeof jt=="function"?jt(Kt):jt;if(Qt){var Ht=typeof Qt=="object"?Qt:void 0;st.current=null,Zt?Promise.resolve().then(function(){return Kt.focus(Ht)}):Kt.focus(Ht)}}},[jt]),St=reactExports.useCallback(function(Zt){it.current&&mediumFocus.useMedium(Zt)},[]),Tt=mediumBlur.useMedium,Et=reactExports.useCallback(function(Zt){nt.current!==Zt&&(nt.current=Zt,rt(Zt))},[]),Nt=_extends$5((j={},j[FOCUS_DISABLED]=at&&"disabled",j[FOCUS_GROUP]=Ct,j),Lt),tr=ut!==!0,ir=tr&&ut!=="tail",nr=useMergeRefs([$,Et]);return reactExports.createElement(reactExports.Fragment,null,tr&&[reactExports.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:at?-1:0,style:hiddenGuard}),Mt?reactExports.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:at?-1:1,style:hiddenGuard}):null],!at&&reactExports.createElement(Ft,{id:mt,sideCar:mediumSidecar,observed:tt,disabled:at,persistentFocus:ht,crossFrame:yt,autoFocus:wt,whiteList:$t,shards:Dt,onActivation:xt,onDeactivation:At,returnFocus:Rt,focusOptions:bt}),reactExports.createElement(Ot,_extends$5({ref:nr},Nt,{className:Pt,onBlur:Tt,onFocus:St}),ot),ir&&reactExports.createElement("div",{"data-focus-guard":!0,tabIndex:at?-1:0,style:hiddenGuard}))});FocusLock$1.propTypes={};FocusLock$1.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};function _setPrototypeOf$2(a,_){return _setPrototypeOf$2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,et){return j.__proto__=et,j},_setPrototypeOf$2(a,_)}function _inheritsLoose$1(a,_){a.prototype=Object.create(_.prototype),a.prototype.constructor=a,_setPrototypeOf$2(a,_)}function _typeof$6(a){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},_typeof$6(a)}function _toPrimitive(a,_){if(_typeof$6(a)!=="object"||a===null)return a;var $=a[Symbol.toPrimitive];if($!==void 0){var j=$.call(a,_||"default");if(_typeof$6(j)!=="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(a)}function _toPropertyKey(a){var _=_toPrimitive(a,"string");return _typeof$6(_)==="symbol"?_:String(_)}function _defineProperty$8(a,_,$){return _=_toPropertyKey(_),_ in a?Object.defineProperty(a,_,{value:$,enumerable:!0,configurable:!0,writable:!0}):a[_]=$,a}function withSideEffect(a,_){function $(j){return j.displayName||j.name||"Component"}return function(et){var tt=[],rt;function nt(){rt=a(tt.map(function(st){return st.props})),_(rt)}var it=function(st){_inheritsLoose$1(ot,st);function ot(){return st.apply(this,arguments)||this}ot.peek=function(){return rt};var at=ot.prototype;return at.componentDidMount=function(){tt.push(this),nt()},at.componentDidUpdate=function(){nt()},at.componentWillUnmount=function(){var ht=tt.indexOf(this);tt.splice(ht,1),nt()},at.render=function(){return React$2.createElement(et,this.props)},ot}(reactExports.PureComponent);return _defineProperty$8(it,"displayName","SideEffect("+$(et)+")"),it}}var toArray$4=function(a){for(var _=Array(a.length),$=0;$=0}).sort(tabSort)},tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(a,_){return toArray$4((a.shadowRoot||a).children).reduce(function($,j){return $.concat(j.matches(_?queryGuardTabbables:queryTabbables)?[j]:[],getFocusablesWithShadowDom(j))},[])},getFocusablesWithIFrame=function(a,_){var $;return a instanceof HTMLIFrameElement&&(!(($=a.contentDocument)===null||$===void 0)&&$.body)?getFocusables([a.contentDocument.body],_):[a]},getFocusables=function(a,_){return a.reduce(function($,j){var et,tt=getFocusablesWithShadowDom(j,_),rt=(et=[]).concat.apply(et,tt.map(function(nt){return getFocusablesWithIFrame(nt,_)}));return $.concat(rt,j.parentNode?toArray$4(j.parentNode.querySelectorAll(queryTabbables)).filter(function(nt){return nt===j}):[])},[])},getParentAutofocusables=function(a){var _=a.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray$4(_).map(function($){return getFocusables([$])}).reduce(function($,j){return $.concat(j)},[])},filterFocusable=function(a,_){return toArray$4(a).filter(function($){return isVisibleCached(_,$)}).filter(function($){return notHiddenInput($)})},filterAutoFocusable=function(a,_){return _===void 0&&(_=new Map),toArray$4(a).filter(function($){return isAutoFocusAllowedCached(_,$)})},getTabbableNodes=function(a,_,$){return orderByTabIndex(filterFocusable(getFocusables(a,$),_),!0,$)},getFocusableNodes=function(a,_){return orderByTabIndex(filterFocusable(getFocusables(a),_),!1)},parentAutofocusables=function(a,_){return filterFocusable(getParentAutofocusables(a),_)},contains$2=function(a,_){return a.shadowRoot?contains$2(a.shadowRoot,_):Object.getPrototypeOf(a).contains!==void 0&&Object.getPrototypeOf(a).contains.call(a,_)?!0:toArray$4(a.children).some(function($){var j;if($ instanceof HTMLIFrameElement){var et=(j=$.contentDocument)===null||j===void 0?void 0:j.body;return et?contains$2(et,_):!1}return contains$2($,_)})},filterNested=function(a){for(var _=new Set,$=a.length,j=0;j<$;j+=1)for(var et=j+1;et<$;et+=1){var tt=a[j].compareDocumentPosition(a[et]);(tt&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&_.add(et),(tt&Node.DOCUMENT_POSITION_CONTAINS)>0&&_.add(j)}return a.filter(function(rt,nt){return!_.has(nt)})},getTopParent=function(a){return a.parentNode?getTopParent(a.parentNode):a},getAllAffectedNodes=function(a){var _=asArray(a);return _.filter(Boolean).reduce(function($,j){var et=j.getAttribute(FOCUS_GROUP);return $.push.apply($,et?filterNested(toArray$4(getTopParent(j).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(et,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[j]),$},[])},safeProbe=function(a){try{return a()}catch{return}},getActiveElement$1=function(a){if(a===void 0&&(a=document),!(!a||!a.activeElement)){var _=a.activeElement;return _.shadowRoot?getActiveElement$1(_.shadowRoot):_ instanceof HTMLIFrameElement&&safeProbe(function(){return _.contentWindow.document})?getActiveElement$1(_.contentWindow.document):_}},focusInFrame=function(a,_){return a===_},focusInsideIframe=function(a,_){return!!toArray$4(a.querySelectorAll("iframe")).some(function($){return focusInFrame($,_)})},focusInside=function(a,_){return _===void 0&&(_=getActiveElement$1(getFirst(a).ownerDocument)),!_||_.dataset&&_.dataset.focusGuard?!1:getAllAffectedNodes(a).some(function($){return contains$2($,_)||focusInsideIframe($,_)})},focusIsHidden=function(a){a===void 0&&(a=document);var _=getActiveElement$1(a);return _?toArray$4(a.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function($){return contains$2($,_)}):!1},findSelectedRadio=function(a,_){return _.filter(isRadioElement).filter(function($){return $.name===a.name}).filter(function($){return $.checked})[0]||a},correctNode=function(a,_){return isRadioElement(a)&&a.name?findSelectedRadio(a,_):a},correctNodes=function(a){var _=new Set;return a.forEach(function($){return _.add(correctNode($,a))}),a.filter(function($){return _.has($)})},pickFirstFocus=function(a){return a[0]&&a.length>1?correctNode(a[0],a):a[0]},pickFocusable=function(a,_){return a.length>1?a.indexOf(correctNode(a[_],a)):_},NEW_FOCUS="NEW_FOCUS",newFocus=function(a,_,$,j){var et=a.length,tt=a[0],rt=a[et-1],nt=isGuard($);if(!($&&a.indexOf($)>=0)){var it=$!==void 0?_.indexOf($):-1,st=j?_.indexOf(j):it,ot=j?a.indexOf(j):-1,at=it-st,ut=_.indexOf(tt),ht=_.indexOf(rt),yt=correctNodes(_),wt=$!==void 0?yt.indexOf($):-1,Ct=wt-(j?yt.indexOf(j):it),Pt=pickFocusable(a,0),$t=pickFocusable(a,et-1);if(it===-1||ot===-1)return NEW_FOCUS;if(!at&&ot>=0)return ot;if(it<=ut&&nt&&Math.abs(at)>1)return $t;if(it>=ht&&nt&&Math.abs(at)>1)return Pt;if(at&&Math.abs(Ct)>1)return ot;if(it<=ut)return $t;if(it>ht)return Pt;if(at)return Math.abs(at)>1?ot:(et+ot+at)%et}},findAutoFocused=function(a){return function(_){var $,j=($=getDataset(_))===null||$===void 0?void 0:$.autofocus;return _.autofocus||j!==void 0&&j!=="false"||a.indexOf(_)>=0}},pickAutofocus=function(a,_,$){var j=a.map(function(tt){var rt=tt.node;return rt}),et=filterAutoFocusable(j.filter(findAutoFocused($)));return et&&et.length?pickFirstFocus(et):pickFirstFocus(filterAutoFocusable(_))},getParents=function(a,_){return _===void 0&&(_=[]),_.push(a),a.parentNode&&getParents(a.parentNode.host||a.parentNode,_),_},getCommonParent=function(a,_){for(var $=getParents(a),j=getParents(_),et=0;et<$.length;et+=1){var tt=$[et];if(j.indexOf(tt)>=0)return tt}return!1},getTopCommonParent=function(a,_,$){var j=asArray(a),et=asArray(_),tt=j[0],rt=!1;return et.filter(Boolean).forEach(function(nt){rt=getCommonParent(rt||nt,nt)||rt,$.filter(Boolean).forEach(function(it){var st=getCommonParent(tt,it);st&&(!rt||contains$2(st,rt)?rt=st:rt=getCommonParent(st,rt))})}),rt},allParentAutofocusables=function(a,_){return a.reduce(function($,j){return $.concat(parentAutofocusables(j,_))},[])},reorderNodes=function(a,_){var $=new Map;return _.forEach(function(j){return $.set(j.node,j)}),a.map(function(j){return $.get(j)}).filter(isDefined)},focusSolver=function(a,_){var $=getActiveElement$1(asArray(a).length>0?document:getFirst(a).ownerDocument),j=getAllAffectedNodes(a).filter(isNotAGuard),et=getTopCommonParent($||a,a,j),tt=new Map,rt=getFocusableNodes(j,tt),nt=getTabbableNodes(j,tt).filter(function(ht){var yt=ht.node;return isNotAGuard(yt)});if(!(!nt[0]&&(nt=rt,!nt[0]))){var it=getFocusableNodes([et],tt).map(function(ht){var yt=ht.node;return yt}),st=reorderNodes(it,nt),ot=st.map(function(ht){var yt=ht.node;return yt}),at=newFocus(ot,it,$,_);if(at===NEW_FOCUS){var ut=pickAutofocus(rt,ot,allParentAutofocusables(j,tt));if(ut)return{node:ut};console.warn("focus-lock: cannot find any node to move focus into");return}return at===void 0?at:st[at]}},expandFocusableNodes=function(a){var _=getAllAffectedNodes(a).filter(isNotAGuard),$=getTopCommonParent(a,a,_),j=new Map,et=getTabbableNodes([$],j,!0),tt=getTabbableNodes(_,j).filter(function(rt){var nt=rt.node;return isNotAGuard(nt)}).map(function(rt){var nt=rt.node;return nt});return et.map(function(rt){var nt=rt.node,it=rt.index;return{node:nt,index:it,lockItem:tt.indexOf(nt)>=0,guard:isGuard(nt)}})},focusOn=function(a,_){"focus"in a&&a.focus(_),"contentWindow"in a&&a.contentWindow&&a.contentWindow.focus()},guardCount=0,lockDisabled=!1,moveFocusInside=function(a,_,$){$===void 0&&($={});var j=focusSolver(a,_);if(!lockDisabled&&j){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(j.node,$.focusOptions),guardCount--}};function deferAction(a){setTimeout(a,1)}var focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(_){return(lastActiveTrap.whiteList||defaultWhitelist)(_)},recordPortal=function(_,$){lastPortaledElement={observerNode:_,portaledElement:$}},focusIsPortaledPair=function(_){return lastPortaledElement&&lastPortaledElement.portaledElement===_};function autoGuard(a,_,$,j){var et=null,tt=a;do{var rt=j[tt];if(rt.guard)rt.node.dataset.focusAutoGuard&&(et=rt);else if(rt.lockItem){if(tt!==a)return;et=null}else break}while((tt+=$)!==_);et&&(et.node.tabIndex=0)}var extractRef$2=function(_){return _&&"current"in _?_.current:_},focusWasOutside=function(_){return _?!!focusWasOutsideWindow:focusWasOutsideWindow==="meanwhile"},checkInHost=function a(_,$,j){return $&&($.host===_&&(!$.activeElement||j.contains($.activeElement))||$.parentNode&&a(_,$.parentNode,j))},withinHost=function(_,$){return $.some(function(j){return checkInHost(_,j,j)})},activateTrap=function(){var _=!1;if(lastActiveTrap){var $=lastActiveTrap,j=$.observed,et=$.persistentFocus,tt=$.autoFocus,rt=$.shards,nt=$.crossFrame,it=$.focusOptions,st=j||lastPortaledElement&&lastPortaledElement.portaledElement,ot=document&&document.activeElement;if(st){var at=[st].concat(rt.map(extractRef$2).filter(Boolean));if((!ot||focusWhitelisted(ot))&&(et||focusWasOutside(nt)||!isFreeFocus()||!lastActiveFocus&&tt)&&(st&&!(focusInside(at)||ot&&withinHost(ot,at)||focusIsPortaledPair(ot))&&(document&&!lastActiveFocus&&ot&&!tt?(ot.blur&&ot.blur(),document.body.focus()):(_=moveFocusInside(at,lastActiveFocus,{focusOptions:it}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document){var ut=document&&document.activeElement,ht=expandFocusableNodes(at),yt=ht.map(function(wt){var Ct=wt.node;return Ct}).indexOf(ut);yt>-1&&(ht.filter(function(wt){var Ct=wt.guard,Pt=wt.node;return Ct&&Pt.dataset.focusAutoGuard}).forEach(function(wt){var Ct=wt.node;return Ct.removeAttribute("tabIndex")}),autoGuard(yt,ht.length,1,ht),autoGuard(yt,-1,-1,ht))}}}return _},onTrap=function(_){activateTrap()&&_&&(_.stopPropagation(),_.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(_){var $=_.target,j=_.currentTarget;j.contains($)||recordPortal(j,$)},FocusWatcher=function(){return null},onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(a){return a.filter(function(_){var $=_.disabled;return!$})}function handleStateChangeOnClient(a){var _=a.slice(-1)[0];_&&!lastActiveTrap&&attachHandler();var $=lastActiveTrap,j=$&&_&&_.id===$.id;lastActiveTrap=_,$&&!j&&($.onDeactivation(),a.filter(function(et){var tt=et.id;return tt===$.id}).length||$.returnFocus(!_)),_?(lastActiveFocus=null,(!j||$.observed!==_.observed)&&_.onActivation(),activateTrap(),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(a){return a({moveFocusInside,focusInside})});const FocusTrap$1=withSideEffect(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=reactExports.forwardRef(function(_,$){return reactExports.createElement(FocusLock$1,_extends$5({sideCar:FocusTrap$1,ref:$},_))}),_ref=FocusLock$1.propTypes||{};_ref.sideCar;_objectWithoutPropertiesLoose$3(_ref,["sideCar"]);FocusLockCombination.propTypes={};function isElement$2(a){return a!=null&&typeof a=="object"&&"nodeType"in a&&a.nodeType===Node.ELEMENT_NODE}function isHTMLElement$3(a){var _;if(!isElement$2(a))return!1;const $=(_=a.ownerDocument.defaultView)!=null?_:window;return a instanceof $.HTMLElement}function getOwnerWindow(a){var _,$;return($=(_=getOwnerDocument$2(a))==null?void 0:_.defaultView)!=null?$:window}function getOwnerDocument$2(a){return isElement$2(a)?a.ownerDocument:document}function getActiveElement(a){return getOwnerDocument$2(a).activeElement}function isScrollParent$1(a){const _=a.ownerDocument.defaultView||window,{overflow:$,overflowX:j,overflowY:et}=_.getComputedStyle(a);return/auto|scroll|overlay|hidden/.test($+et+j)}function getParent(a){return a.localName==="html"?a:a.assignedSlot||a.parentElement||a.ownerDocument.documentElement}function getScrollParent$1(a){return["html","body","#document"].includes(a.localName)?a.ownerDocument.body:isHTMLElement$3(a)&&isScrollParent$1(a)?a:getScrollParent$1(getParent(a))}var hasTabIndex=a=>a.hasAttribute("tabindex"),hasNegativeTabIndex=a=>hasTabIndex(a)&&a.tabIndex===-1;function isDisabled(a){return!!a.getAttribute("disabled")||!!a.getAttribute("aria-disabled")}function isHidden(a){return a.parentElement&&isHidden(a.parentElement)?!0:a.hidden}function isContentEditable(a){const _=a.getAttribute("contenteditable");return _!=="false"&&_!=null}function isFocusable(a){if(!isHTMLElement$3(a)||isHidden(a)||isDisabled(a))return!1;const{localName:_}=a;if(["input","select","textarea","button"].indexOf(_)>=0)return!0;const j={a:()=>a.hasAttribute("href"),audio:()=>a.hasAttribute("controls"),video:()=>a.hasAttribute("controls")};return _ in j?j[_]():isContentEditable(a)?!0:hasTabIndex(a)}function isTabbable(a){return a?isHTMLElement$3(a)&&isFocusable(a)&&!hasNegativeTabIndex(a):!1}var focusableElList=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],focusableElSelector=focusableElList.join(),isVisible=a=>a.offsetWidth>0&&a.offsetHeight>0;function getAllFocusable(a){const _=Array.from(a.querySelectorAll(focusableElSelector));return _.unshift(a),_.filter($=>isFocusable($)&&isVisible($))}var _a$3,FocusTrap=(_a$3=FocusLockCombination.default)!=null?_a$3:FocusLockCombination,FocusLock=a=>{const{initialFocusRef:_,finalFocusRef:$,contentRef:j,restoreFocus:et,children:tt,isDisabled:rt,autoFocus:nt,persistentFocus:it,lockFocusAcrossFrames:st}=a,ot=reactExports.useCallback(()=>{_!=null&&_.current?_.current.focus():j!=null&&j.current&&getAllFocusable(j.current).length===0&&requestAnimationFrame(()=>{var yt;(yt=j.current)==null||yt.focus()})},[_,j]),at=reactExports.useCallback(()=>{var ht;(ht=$==null?void 0:$.current)==null||ht.focus()},[$]),ut=et&&!$;return jsxRuntimeExports.jsx(FocusTrap,{crossFrame:st,persistentFocus:it,autoFocus:nt,disabled:rt,onActivation:ot,onDeactivation:at,returnFocus:ut,children:tt})};FocusLock.displayName="FocusLock";var useSafeLayoutEffect=isBrowser$2?reactExports.useLayoutEffect:reactExports.useEffect;function useCallbackRef(a,_=[]){const $=reactExports.useRef(a);return useSafeLayoutEffect(()=>{$.current=a}),reactExports.useCallback((...j)=>{var et;return(et=$.current)==null?void 0:et.call($,...j)},_)}function useOutsideClick$1(a){const{ref:_,handler:$,enabled:j=!0}=a,et=useCallbackRef($),rt=reactExports.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;reactExports.useEffect(()=>{if(!j)return;const nt=at=>{isValidEvent$1(at,_)&&(rt.isPointerDown=!0)},it=at=>{if(rt.ignoreEmulatedMouseEvents){rt.ignoreEmulatedMouseEvents=!1;return}rt.isPointerDown&&$&&isValidEvent$1(at,_)&&(rt.isPointerDown=!1,et(at))},st=at=>{rt.ignoreEmulatedMouseEvents=!0,$&&rt.isPointerDown&&isValidEvent$1(at,_)&&(rt.isPointerDown=!1,et(at))},ot=getOwnerDocument$3(_.current);return ot.addEventListener("mousedown",nt,!0),ot.addEventListener("mouseup",it,!0),ot.addEventListener("touchstart",nt,!0),ot.addEventListener("touchend",st,!0),()=>{ot.removeEventListener("mousedown",nt,!0),ot.removeEventListener("mouseup",it,!0),ot.removeEventListener("touchstart",nt,!0),ot.removeEventListener("touchend",st,!0)}},[$,_,et,rt,j])}function isValidEvent$1(a,_){var $;const j=a.target;return j&&!getOwnerDocument$3(j).contains(j)?!1:!(($=_.current)!=null&&$.contains(j))}function useId(a,_){const $=reactExports.useId();return reactExports.useMemo(()=>a||[_,$].filter(Boolean).join("-"),[a,_,$])}function useControllableProp(a,_){const $=a!==void 0;return[$,$&&typeof a<"u"?a:_]}function useDisclosure$1(a={}){const{onClose:_,onOpen:$,isOpen:j,id:et}=a,tt=useCallbackRef($),rt=useCallbackRef(_),[nt,it]=reactExports.useState(a.defaultIsOpen||!1),[st,ot]=useControllableProp(j,nt),at=useId(et,"disclosure"),ut=reactExports.useCallback(()=>{st||it(!1),rt==null||rt()},[st,rt]),ht=reactExports.useCallback(()=>{st||it(!0),tt==null||tt()},[st,tt]),yt=reactExports.useCallback(()=>{(ot?ut:ht)()},[ot,ht,ut]);return{isOpen:!!ot,onOpen:ht,onClose:ut,onToggle:yt,isControlled:st,getButtonProps:(wt={})=>({...wt,"aria-expanded":ot,"aria-controls":at,onClick:callAllHandlers(wt.onClick,yt)}),getDisclosureProps:(wt={})=>({...wt,hidden:!ot,id:at})}}var[InputGroupStylesProvider,useInputGroupStyles]=createContext$1({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),InputGroup=forwardRef(function(_,$){const j=useMultiStyleConfig("Input",_),{children:et,className:tt,...rt}=omitThemingProps(_),nt=cx("chakra-input__group",tt),it={},st=getValidChildren(et),ot=j.field;st.forEach(ut=>{var ht,yt;j&&(ot&&ut.type.id==="InputLeftElement"&&(it.paddingStart=(ht=ot.height)!=null?ht:ot.h),ot&&ut.type.id==="InputRightElement"&&(it.paddingEnd=(yt=ot.height)!=null?yt:ot.h),ut.type.id==="InputRightAddon"&&(it.borderEndRadius=0),ut.type.id==="InputLeftAddon"&&(it.borderStartRadius=0))});const at=st.map(ut=>{var ht,yt;const wt=compact$1({size:((ht=ut.props)==null?void 0:ht.size)||_.size,variant:((yt=ut.props)==null?void 0:yt.variant)||_.variant});return ut.type.id!=="Input"?reactExports.cloneElement(ut,wt):reactExports.cloneElement(ut,Object.assign(wt,it,ut.props))});return jsxRuntimeExports.jsx(chakra.div,{className:nt,ref:$,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...j.group},"data-group":!0,...rt,children:jsxRuntimeExports.jsx(InputGroupStylesProvider,{value:j,children:at})})});InputGroup.displayName="InputGroup";var StyledInputElement=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),InputElement=forwardRef(function(_,$){var j,et;const{placement:tt="left",...rt}=_,nt=useInputGroupStyles(),it=nt.field,ot={[tt==="left"?"insetStart":"insetEnd"]:"0",width:(j=it==null?void 0:it.height)!=null?j:it==null?void 0:it.h,height:(et=it==null?void 0:it.height)!=null?et:it==null?void 0:it.h,fontSize:it==null?void 0:it.fontSize,...nt.element};return jsxRuntimeExports.jsx(StyledInputElement,{ref:$,__css:ot,...rt})});InputElement.id="InputElement";InputElement.displayName="InputElement";var InputLeftElement=forwardRef(function(_,$){const{className:j,...et}=_,tt=cx("chakra-input__left-element",j);return jsxRuntimeExports.jsx(InputElement,{ref:$,placement:"left",className:tt,...et})});InputLeftElement.id="InputLeftElement";InputLeftElement.displayName="InputLeftElement";var InputRightElement=forwardRef(function(_,$){const{className:j,...et}=_,tt=cx("chakra-input__right-element",j);return jsxRuntimeExports.jsx(InputElement,{ref:$,placement:"right",className:tt,...et})});InputRightElement.id="InputRightElement";InputRightElement.displayName="InputRightElement";var Input=forwardRef(function(_,$){const{htmlSize:j,...et}=_,tt=useMultiStyleConfig("Input",et),rt=omitThemingProps(et),nt=useFormControl(rt),it=cx("chakra-input",_.className);return jsxRuntimeExports.jsx(chakra.input,{size:j,...nt,__css:tt.field,ref:$,className:it})});Input.displayName="Input";Input.id="Input";var Link$1=forwardRef(function(_,$){const j=useStyleConfig("Link",_),{className:et,isExternal:tt,...rt}=omitThemingProps(_);return jsxRuntimeExports.jsx(chakra.a,{target:tt?"_blank":void 0,rel:tt?"noopener":void 0,ref:$,className:cx("chakra-link",et),...rt,__css:j})});Link$1.displayName="Link";var[ListStylesProvider,useListStyles]=createContext$1({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),List=forwardRef(function(_,$){const j=useMultiStyleConfig("List",_),{children:et,styleType:tt="none",stylePosition:rt,spacing:nt,...it}=omitThemingProps(_),st=getValidChildren(et),at=nt?{["& > *:not(style) ~ *:not(style)"]:{mt:nt}}:{};return jsxRuntimeExports.jsx(ListStylesProvider,{value:j,children:jsxRuntimeExports.jsx(chakra.ul,{ref:$,listStyleType:tt,listStylePosition:rt,role:"list",__css:{...j.container,...at},...it,children:st})})});List.displayName="List";var OrderedList=forwardRef((a,_)=>{const{as:$,...j}=a;return jsxRuntimeExports.jsx(List,{ref:_,as:"ol",styleType:"decimal",marginStart:"1em",...j})});OrderedList.displayName="OrderedList";var UnorderedList=forwardRef(function(_,$){const{as:j,...et}=_;return jsxRuntimeExports.jsx(List,{ref:$,as:"ul",styleType:"initial",marginStart:"1em",...et})});UnorderedList.displayName="UnorderedList";var ListItem=forwardRef(function(_,$){const j=useListStyles();return jsxRuntimeExports.jsx(chakra.li,{ref:$,..._,__css:j.item})});ListItem.displayName="ListItem";var ListIcon=forwardRef(function(_,$){const j=useListStyles();return jsxRuntimeExports.jsx(Icon,{ref:$,role:"presentation",..._,__css:j.icon})});ListIcon.displayName="ListIcon";var Grid=forwardRef(function(_,$){const{templateAreas:j,gap:et,rowGap:tt,columnGap:rt,column:nt,row:it,autoFlow:st,autoRows:ot,templateRows:at,autoColumns:ut,templateColumns:ht,...yt}=_,wt={display:"grid",gridTemplateAreas:j,gridGap:et,gridRowGap:tt,gridColumnGap:rt,gridAutoColumns:ut,gridColumn:nt,gridRow:it,gridAutoFlow:st,gridAutoRows:ot,gridTemplateRows:at,gridTemplateColumns:ht};return jsxRuntimeExports.jsx(chakra.div,{ref:$,__css:wt,...yt})});Grid.displayName="Grid";function mapResponsive(a,_){return Array.isArray(a)?a.map($=>$===null?null:_($)):isObject$5(a)?Object.keys(a).reduce(($,j)=>($[j]=_(a[j]),$),{}):a!=null?_(a):null}var SimpleGrid=forwardRef(function(_,$){const{columns:j,spacingX:et,spacingY:tt,spacing:rt,minChildWidth:nt,...it}=_,st=useTheme(),ot=nt?widthToColumns(nt,st):countToColumns(j);return jsxRuntimeExports.jsx(Grid,{ref:$,gap:rt,columnGap:et,rowGap:tt,templateColumns:ot,...it})});SimpleGrid.displayName="SimpleGrid";function toPx(a){return typeof a=="number"?`${a}px`:a}function widthToColumns(a,_){return mapResponsive(a,$=>{const j=getToken("sizes",$,toPx($))(_);return $===null?null:`repeat(auto-fit, minmax(${j}, 1fr))`})}function countToColumns(a){return mapResponsive(a,_=>_===null?null:`repeat(${_}, minmax(0, 1fr))`)}var Text=forwardRef(function(_,$){const j=useStyleConfig("Text",_),{className:et,align:tt,decoration:rt,casing:nt,...it}=omitThemingProps(_),st=compact$1({textAlign:_.align,textDecoration:_.decoration,textTransform:_.casing});return jsxRuntimeExports.jsx(chakra.p,{ref:$,className:cx("chakra-text",_.className),...st,...it,__css:j})});Text.displayName="Text";var Wrap=forwardRef(function(_,$){const{spacing:j="0.5rem",spacingX:et,spacingY:tt,children:rt,justify:nt,direction:it,align:st,className:ot,shouldWrapChildren:at,...ut}=_,ht=reactExports.useMemo(()=>at?reactExports.Children.map(rt,(yt,wt)=>jsxRuntimeExports.jsx(WrapItem,{children:yt},wt)):rt,[rt,at]);return jsxRuntimeExports.jsx(chakra.div,{ref:$,className:cx("chakra-wrap",ot),...ut,children:jsxRuntimeExports.jsx(chakra.ul,{className:"chakra-wrap__list",__css:{display:"flex",flexWrap:"wrap",justifyContent:nt,alignItems:st,flexDirection:it,listStyleType:"none",gap:j,columnGap:et,rowGap:tt,padding:"0"},children:ht})})});Wrap.displayName="Wrap";var WrapItem=forwardRef(function(_,$){const{className:j,...et}=_;return jsxRuntimeExports.jsx(chakra.li,{ref:$,__css:{display:"flex",alignItems:"flex-start"},className:cx("chakra-wrap__listitem",j),...et})});WrapItem.displayName="WrapItem";var StackItem=a=>jsxRuntimeExports.jsx(chakra.div,{className:"chakra-stack__item",...a,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...a.__css}});StackItem.displayName="StackItem";function getDividerStyles(a){const{spacing:_,direction:$}=a,j={column:{my:_,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:_,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:_,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:_,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":mapResponsive($,et=>j[et])}}var Stack=forwardRef((a,_)=>{const{isInline:$,direction:j,align:et,justify:tt,spacing:rt="0.5rem",wrap:nt,children:it,divider:st,className:ot,shouldWrapChildren:at,...ut}=a,ht=$?"row":j??"column",yt=reactExports.useMemo(()=>getDividerStyles({spacing:rt,direction:ht}),[rt,ht]),wt=!!st,Ct=!at&&!wt,Pt=reactExports.useMemo(()=>{const Mt=getValidChildren(it);return Ct?Mt:Mt.map((Bt,Dt)=>{const zt=typeof Bt.key<"u"?Bt.key:Dt,Ot=Dt+1===Mt.length,Lt=at?jsxRuntimeExports.jsx(StackItem,{children:Bt},zt):Bt;if(!wt)return Lt;const Ft=reactExports.cloneElement(st,{__css:yt}),jt=Ot?null:Ft;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Lt,jt]},zt)})},[st,yt,wt,Ct,at,it]),$t=cx("chakra-stack",ot);return jsxRuntimeExports.jsx(chakra.div,{ref:_,display:"flex",alignItems:et,justifyContent:tt,flexDirection:ht,flexWrap:nt,gap:wt?void 0:rt,className:$t,...ut,children:Pt})});Stack.displayName="Stack";var VStack=forwardRef((a,_)=>jsxRuntimeExports.jsx(Stack,{align:"center",...a,direction:"column",ref:_}));VStack.displayName="VStack";function spanFn(a){return mapResponsive(a,_=>_==="auto"?"auto":`span ${_}/span ${_}`)}var GridItem=forwardRef(function(_,$){const{area:j,colSpan:et,colStart:tt,colEnd:rt,rowEnd:nt,rowSpan:it,rowStart:st,...ot}=_,at=compact$1({gridArea:j,gridColumn:spanFn(et),gridRow:spanFn(it),gridColumnStart:tt,gridColumnEnd:rt,gridRowStart:st,gridRowEnd:nt});return jsxRuntimeExports.jsx(chakra.div,{ref:$,__css:at,...ot})});GridItem.displayName="GridItem";var Heading=forwardRef(function(_,$){const j=useStyleConfig("Heading",_),{className:et,...tt}=omitThemingProps(_);return jsxRuntimeExports.jsx(chakra.h2,{ref:$,className:cx("chakra-heading",_.className),...tt,__css:j})});Heading.displayName="Heading";var Box=chakra("div");Box.displayName="Box";var Square=forwardRef(function(_,$){const{size:j,centerContent:et=!0,...tt}=_,rt=et?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return jsxRuntimeExports.jsx(Box,{ref:$,boxSize:j,__css:{...rt,flexShrink:0,flexGrow:0},...tt})});Square.displayName="Square";var Circle=forwardRef(function(_,$){const{size:j,...et}=_;return jsxRuntimeExports.jsx(Square,{size:j,ref:$,borderRadius:"9999px",...et})});Circle.displayName="Circle";var AspectRatio=forwardRef(function(a,_){const{ratio:$=4/3,children:j,className:et,...tt}=a,rt=reactExports.Children.only(j),nt=cx("chakra-aspect-ratio",et);return jsxRuntimeExports.jsx(chakra.div,{ref:_,position:"relative",className:nt,_before:{height:0,content:'""',display:"block",paddingBottom:mapResponsive($,it=>`${1/it*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...tt,children:rt})});AspectRatio.displayName="AspectRatio";var Center=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Center.displayName="Center";var centerStyles={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};forwardRef(function(_,$){const{axis:j="both",...et}=_;return jsxRuntimeExports.jsx(chakra.div,{ref:$,__css:centerStyles[j],...et,position:"absolute"})});var Divider=forwardRef(function(_,$){const{borderLeftWidth:j,borderBottomWidth:et,borderTopWidth:tt,borderRightWidth:rt,borderWidth:nt,borderStyle:it,borderColor:st,...ot}=useStyleConfig("Divider",_),{className:at,orientation:ut="horizontal",__css:ht,...yt}=omitThemingProps(_),wt={vertical:{borderLeftWidth:j||rt||nt||"1px",height:"100%"},horizontal:{borderBottomWidth:et||tt||nt||"1px",width:"100%"}};return jsxRuntimeExports.jsx(chakra.hr,{ref:$,"aria-orientation":ut,...yt,__css:{...ot,border:"0",borderColor:st,borderStyle:it,...wt[ut],...ht},className:cx("chakra-divider",at)})});Divider.displayName="Divider";var Flex=forwardRef(function(_,$){const{direction:j,align:et,justify:tt,wrap:rt,basis:nt,grow:it,shrink:st,...ot}=_,at={display:"flex",flexDirection:j,alignItems:et,justifyContent:tt,flexWrap:rt,flexBasis:nt,flexGrow:it,flexShrink:st};return jsxRuntimeExports.jsx(chakra.div,{ref:$,__css:at,...ot})});Flex.displayName="Flex";function useMediaQuery(a,_={}){const{ssr:$=!0,fallback:j}=_,{getWindow:et}=useEnvironment(),tt=Array.isArray(a)?a:[a];let rt=Array.isArray(j)?j:[j];rt=rt.filter(st=>st!=null);const[nt,it]=reactExports.useState(()=>tt.map((st,ot)=>({media:st,matches:$?!!rt[ot]:et().matchMedia(st).matches})));return reactExports.useEffect(()=>{const st=et();it(tt.map(ut=>({media:ut,matches:st.matchMedia(ut).matches})));const ot=tt.map(ut=>st.matchMedia(ut)),at=ut=>{it(ht=>ht.slice().map(yt=>yt.media===ut.media?{...yt,matches:ut.matches}:yt))};return ot.forEach(ut=>{typeof ut.addListener=="function"?ut.addListener(at):ut.addEventListener("change",at)}),()=>{ot.forEach(ut=>{typeof ut.removeListener=="function"?ut.removeListener(at):ut.removeEventListener("change",at)})}},[et]),nt.map(st=>st.matches)}function isPrintableCharacter(a){const{key:_}=a;return _.length===1||_.length>1&&/[^a-zA-Z0-9]/.test(_)}function useShortcut(a={}){const{timeout:_=300,preventDefault:$=()=>!0}=a,[j,et]=reactExports.useState([]),tt=reactExports.useRef(),rt=()=>{tt.current&&(clearTimeout(tt.current),tt.current=null)},nt=()=>{rt(),tt.current=setTimeout(()=>{et([]),tt.current=null},_)};reactExports.useEffect(()=>rt,[]);function it(st){return ot=>{if(ot.key==="Backspace"){const at=[...j];at.pop(),et(at);return}if(isPrintableCharacter(ot)){const at=j.concat(ot.key);$(ot)&&(ot.preventDefault(),ot.stopPropagation()),et(at),st(at.join("")),nt()}}}return it}function getNextItemFromSearch(a,_,$,j){if(_==null)return j;if(!j)return a.find(rt=>$(rt).toLowerCase().startsWith(_.toLowerCase()));const et=a.filter(tt=>$(tt).toLowerCase().startsWith(_.toLowerCase()));if(et.length>0){let tt;return et.includes(j)?(tt=et.indexOf(j)+1,tt===et.length&&(tt=0),et[tt]):(tt=a.indexOf(et[0]),a[tt])}return j}function useEventListeners(){const a=reactExports.useRef(new Map),_=a.current,$=reactExports.useCallback((et,tt,rt,nt)=>{a.current.set(rt,{type:tt,el:et,options:nt}),et.addEventListener(tt,rt,nt)},[]),j=reactExports.useCallback((et,tt,rt,nt)=>{et.removeEventListener(tt,rt,nt),a.current.delete(rt)},[]);return reactExports.useEffect(()=>()=>{_.forEach((et,tt)=>{j(et.el,et.type,tt,et.options)})},[j,_]),{add:$,remove:j}}function isValidElement(a){const _=a.target,{tagName:$,isContentEditable:j}=_;return $!=="INPUT"&&$!=="TEXTAREA"&&j!==!0}function useClickable(a={}){const{ref:_,isDisabled:$,isFocusable:j,clickOnEnter:et=!0,clickOnSpace:tt=!0,onMouseDown:rt,onMouseUp:nt,onClick:it,onKeyDown:st,onKeyUp:ot,tabIndex:at,onMouseOver:ut,onMouseLeave:ht,...yt}=a,[wt,Ct]=reactExports.useState(!0),[Pt,$t]=reactExports.useState(!1),Mt=useEventListeners(),Bt=xt=>{xt&&xt.tagName!=="BUTTON"&&Ct(!1)},Dt=wt?at:at||0,zt=$&&!j,Ot=reactExports.useCallback(xt=>{if($){xt.stopPropagation(),xt.preventDefault();return}xt.currentTarget.focus(),it==null||it(xt)},[$,it]),It=reactExports.useCallback(xt=>{Pt&&isValidElement(xt)&&(xt.preventDefault(),xt.stopPropagation(),$t(!1),Mt.remove(document,"keyup",It,!1))},[Pt,Mt]),Lt=reactExports.useCallback(xt=>{if(st==null||st(xt),$||xt.defaultPrevented||xt.metaKey||!isValidElement(xt.nativeEvent)||wt)return;const At=et&&xt.key==="Enter";tt&&xt.key===" "&&(xt.preventDefault(),$t(!0)),At&&(xt.preventDefault(),xt.currentTarget.click()),Mt.add(document,"keyup",It,!1)},[$,wt,st,et,tt,Mt,It]),Ft=reactExports.useCallback(xt=>{if(ot==null||ot(xt),$||xt.defaultPrevented||xt.metaKey||!isValidElement(xt.nativeEvent)||wt)return;tt&&xt.key===" "&&(xt.preventDefault(),$t(!1),xt.currentTarget.click())},[tt,wt,$,ot]),jt=reactExports.useCallback(xt=>{xt.button===0&&($t(!1),Mt.remove(document,"mouseup",jt,!1))},[Mt]),bt=reactExports.useCallback(xt=>{if(xt.button!==0)return;if($){xt.stopPropagation(),xt.preventDefault();return}wt||$t(!0),xt.currentTarget.focus({preventScroll:!0}),Mt.add(document,"mouseup",jt,!1),rt==null||rt(xt)},[$,wt,rt,Mt,jt]),vt=reactExports.useCallback(xt=>{xt.button===0&&(wt||$t(!1),nt==null||nt(xt))},[nt,wt]),ct=reactExports.useCallback(xt=>{if($){xt.preventDefault();return}ut==null||ut(xt)},[$,ut]),dt=reactExports.useCallback(xt=>{Pt&&(xt.preventDefault(),$t(!1)),ht==null||ht(xt)},[Pt,ht]),mt=mergeRefs(_,Bt);return wt?{...yt,ref:mt,type:"button","aria-disabled":zt?void 0:$,disabled:zt,onClick:Ot,onMouseDown:rt,onMouseUp:nt,onKeyUp:ot,onKeyDown:st,onMouseOver:ut,onMouseLeave:ht}:{...yt,ref:mt,role:"button","data-active":dataAttr(Pt),"aria-disabled":$?"true":void 0,tabIndex:zt?void 0:Dt,onClick:Ot,onMouseDown:bt,onMouseUp:vt,onKeyUp:Ft,onKeyDown:Lt,onMouseOver:ct,onMouseLeave:dt}}function preventReturnFocus(a){const _=a.current;if(!_)return!1;const $=getActiveElement(_);return!$||_.contains($)?!1:!!isTabbable($)}function useFocusOnHide(a,_){const{shouldFocus:$,visible:j,focusRef:et}=_,tt=$&&!j;useUpdateEffect(()=>{if(!tt||preventReturnFocus(a))return;const rt=(et==null?void 0:et.current)||a.current;let nt;if(rt)return nt=requestAnimationFrame(()=>{rt.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(nt)}},[tt,a,et])}var defaultOptions$2={preventScroll:!0,shouldFocus:!1};function useFocusOnShow(a,_=defaultOptions$2){const{focusRef:$,preventScroll:j,shouldFocus:et,visible:tt}=_,rt=isRefObject(a)?a.current:a,nt=et&&tt,it=reactExports.useRef(nt),st=reactExports.useRef(tt);useSafeLayoutEffect$2(()=>{!st.current&&tt&&(it.current=nt),st.current=tt},[tt,nt]);const ot=reactExports.useCallback(()=>{if(!(!tt||!rt||!it.current)&&(it.current=!1,!rt.contains(document.activeElement)))if($!=null&&$.current)requestAnimationFrame(()=>{var at;(at=$.current)==null||at.focus({preventScroll:j})});else{const at=getAllFocusable(rt);at.length>0&&requestAnimationFrame(()=>{at[0].focus({preventScroll:j})})}},[tt,j,rt,$]);useUpdateEffect(()=>{ot()},[ot]),useEventListener(rt,"transitionend",ot)}function isRefObject(a){return"current"in a}var toVar=(a,_)=>({var:a,varRef:_?`var(${a}, ${_})`:`var(${a})`}),cssVars={arrowShadowColor:toVar("--popper-arrow-shadow-color"),arrowSize:toVar("--popper-arrow-size","8px"),arrowSizeHalf:toVar("--popper-arrow-size-half"),arrowBg:toVar("--popper-arrow-bg"),transformOrigin:toVar("--popper-transform-origin"),arrowOffset:toVar("--popper-arrow-offset")};function getBoxShadow(a){if(a.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(a.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(a.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(a.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var transforms={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},toTransformOrigin=a=>transforms[a],defaultEventListeners={scroll:!0,resize:!0};function getEventListenerOptions(a){let _;return typeof a=="object"?_={enabled:!0,options:{...defaultEventListeners,...a}}:_={enabled:a,options:defaultEventListeners},_}var matchWidth={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:a})=>{a.styles.popper.width=`${a.rects.reference.width}px`},effect:({state:a})=>()=>{const _=a.elements.reference;a.elements.popper.style.width=`${_.offsetWidth}px`}},transformOrigin={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:a})=>{setTransformOrigin(a)},effect:({state:a})=>()=>{setTransformOrigin(a)}},setTransformOrigin=a=>{a.elements.popper.style.setProperty(cssVars.transformOrigin.var,toTransformOrigin(a.placement))},positionArrow={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:a})=>{setArrowStyles(a)}},setArrowStyles=a=>{var _;if(!a.placement)return;const $=getArrowStyle$1(a.placement);if((_=a.elements)!=null&&_.arrow&&$){Object.assign(a.elements.arrow.style,{[$.property]:$.value,width:cssVars.arrowSize.varRef,height:cssVars.arrowSize.varRef,zIndex:-1});const j={[cssVars.arrowSizeHalf.var]:`calc(${cssVars.arrowSize.varRef} / 2 - 1px)`,[cssVars.arrowOffset.var]:`calc(${cssVars.arrowSizeHalf.varRef} * -1)`};for(const et in j)a.elements.arrow.style.setProperty(et,j[et])}},getArrowStyle$1=a=>{if(a.startsWith("top"))return{property:"bottom",value:cssVars.arrowOffset.varRef};if(a.startsWith("bottom"))return{property:"top",value:cssVars.arrowOffset.varRef};if(a.startsWith("left"))return{property:"right",value:cssVars.arrowOffset.varRef};if(a.startsWith("right"))return{property:"left",value:cssVars.arrowOffset.varRef}},innerArrow={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:a})=>{setInnerArrowStyles(a)},effect:({state:a})=>()=>{setInnerArrowStyles(a)}},setInnerArrowStyles=a=>{if(!a.elements.arrow)return;const _=a.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!_)return;const $=getBoxShadow(a.placement);$&&_.style.setProperty("--popper-arrow-default-shadow",$),Object.assign(_.style,{transform:"rotate(45deg)",background:cssVars.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},logicals={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},opposites={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function getPopperPlacement(a,_="ltr"){var $,j;const et=(($=logicals[a])==null?void 0:$[_])||a;return _==="ltr"?et:(j=opposites[a])!=null?j:et}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(a,_){return a.concat([_+"-"+start,_+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(a,_){return a.concat([_,_+"-"+start,_+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main$4="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main$4,afterMain,beforeWrite,write,afterWrite];function getNodeName(a){return a?(a.nodeName||"").toLowerCase():null}function getWindow(a){if(a==null)return window;if(a.toString()!=="[object Window]"){var _=a.ownerDocument;return _&&_.defaultView||window}return a}function isElement$1(a){var _=getWindow(a).Element;return a instanceof _||a instanceof Element}function isHTMLElement$2(a){var _=getWindow(a).HTMLElement;return a instanceof _||a instanceof HTMLElement}function isShadowRoot(a){if(typeof ShadowRoot>"u")return!1;var _=getWindow(a).ShadowRoot;return a instanceof _||a instanceof ShadowRoot}function applyStyles(a){var _=a.state;Object.keys(_.elements).forEach(function($){var j=_.styles[$]||{},et=_.attributes[$]||{},tt=_.elements[$];!isHTMLElement$2(tt)||!getNodeName(tt)||(Object.assign(tt.style,j),Object.keys(et).forEach(function(rt){var nt=et[rt];nt===!1?tt.removeAttribute(rt):tt.setAttribute(rt,nt===!0?"":nt)}))})}function effect$2(a){var _=a.state,$={popper:{position:_.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(_.elements.popper.style,$.popper),_.styles=$,_.elements.arrow&&Object.assign(_.elements.arrow.style,$.arrow),function(){Object.keys(_.elements).forEach(function(j){var et=_.elements[j],tt=_.attributes[j]||{},rt=Object.keys(_.styles.hasOwnProperty(j)?_.styles[j]:$[j]),nt=rt.reduce(function(it,st){return it[st]="",it},{});!isHTMLElement$2(et)||!getNodeName(et)||(Object.assign(et.style,nt),Object.keys(tt).forEach(function(it){et.removeAttribute(it)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(a){return a.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function getUAString(){var a=navigator.userAgentData;return a!=null&&a.brands&&Array.isArray(a.brands)?a.brands.map(function(_){return _.brand+"/"+_.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(a,_,$){_===void 0&&(_=!1),$===void 0&&($=!1);var j=a.getBoundingClientRect(),et=1,tt=1;_&&isHTMLElement$2(a)&&(et=a.offsetWidth>0&&round(j.width)/a.offsetWidth||1,tt=a.offsetHeight>0&&round(j.height)/a.offsetHeight||1);var rt=isElement$1(a)?getWindow(a):window,nt=rt.visualViewport,it=!isLayoutViewport()&&$,st=(j.left+(it&&nt?nt.offsetLeft:0))/et,ot=(j.top+(it&&nt?nt.offsetTop:0))/tt,at=j.width/et,ut=j.height/tt;return{width:at,height:ut,top:ot,right:st+at,bottom:ot+ut,left:st,x:st,y:ot}}function getLayoutRect(a){var _=getBoundingClientRect(a),$=a.offsetWidth,j=a.offsetHeight;return Math.abs(_.width-$)<=1&&($=_.width),Math.abs(_.height-j)<=1&&(j=_.height),{x:a.offsetLeft,y:a.offsetTop,width:$,height:j}}function contains$1(a,_){var $=_.getRootNode&&_.getRootNode();if(a.contains(_))return!0;if($&&isShadowRoot($)){var j=_;do{if(j&&a.isSameNode(j))return!0;j=j.parentNode||j.host}while(j)}return!1}function getComputedStyle$1(a){return getWindow(a).getComputedStyle(a)}function isTableElement(a){return["table","td","th"].indexOf(getNodeName(a))>=0}function getDocumentElement(a){return((isElement$1(a)?a.ownerDocument:a.document)||window.document).documentElement}function getParentNode(a){return getNodeName(a)==="html"?a:a.assignedSlot||a.parentNode||(isShadowRoot(a)?a.host:null)||getDocumentElement(a)}function getTrueOffsetParent(a){return!isHTMLElement$2(a)||getComputedStyle$1(a).position==="fixed"?null:a.offsetParent}function getContainingBlock(a){var _=/firefox/i.test(getUAString()),$=/Trident/i.test(getUAString());if($&&isHTMLElement$2(a)){var j=getComputedStyle$1(a);if(j.position==="fixed")return null}var et=getParentNode(a);for(isShadowRoot(et)&&(et=et.host);isHTMLElement$2(et)&&["html","body"].indexOf(getNodeName(et))<0;){var tt=getComputedStyle$1(et);if(tt.transform!=="none"||tt.perspective!=="none"||tt.contain==="paint"||["transform","perspective"].indexOf(tt.willChange)!==-1||_&&tt.willChange==="filter"||_&&tt.filter&&tt.filter!=="none")return et;et=et.parentNode}return null}function getOffsetParent(a){for(var _=getWindow(a),$=getTrueOffsetParent(a);$&&isTableElement($)&&getComputedStyle$1($).position==="static";)$=getTrueOffsetParent($);return $&&(getNodeName($)==="html"||getNodeName($)==="body"&&getComputedStyle$1($).position==="static")?_:$||getContainingBlock(a)||_}function getMainAxisFromPlacement(a){return["top","bottom"].indexOf(a)>=0?"x":"y"}function within(a,_,$){return max(a,min(_,$))}function withinMaxClamp(a,_,$){var j=within(a,_,$);return j>$?$:j}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(a){return Object.assign({},getFreshSideObject(),a)}function expandToHashMap(a,_){return _.reduce(function($,j){return $[j]=a,$},{})}var toPaddingObject=function(_,$){return _=typeof _=="function"?_(Object.assign({},$.rects,{placement:$.placement})):_,mergePaddingObject(typeof _!="number"?_:expandToHashMap(_,basePlacements))};function arrow(a){var _,$=a.state,j=a.name,et=a.options,tt=$.elements.arrow,rt=$.modifiersData.popperOffsets,nt=getBasePlacement($.placement),it=getMainAxisFromPlacement(nt),st=[left,right].indexOf(nt)>=0,ot=st?"height":"width";if(!(!tt||!rt)){var at=toPaddingObject(et.padding,$),ut=getLayoutRect(tt),ht=it==="y"?top:left,yt=it==="y"?bottom:right,wt=$.rects.reference[ot]+$.rects.reference[it]-rt[it]-$.rects.popper[ot],Ct=rt[it]-$.rects.reference[it],Pt=getOffsetParent(tt),$t=Pt?it==="y"?Pt.clientHeight||0:Pt.clientWidth||0:0,Mt=wt/2-Ct/2,Bt=at[ht],Dt=$t-ut[ot]-at[yt],zt=$t/2-ut[ot]/2+Mt,Ot=within(Bt,zt,Dt),It=it;$.modifiersData[j]=(_={},_[It]=Ot,_.centerOffset=Ot-zt,_)}}function effect$1(a){var _=a.state,$=a.options,j=$.element,et=j===void 0?"[data-popper-arrow]":j;et!=null&&(typeof et=="string"&&(et=_.elements.popper.querySelector(et),!et)||contains$1(_.elements.popper,et)&&(_.elements.arrow=et))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(a){return a.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(a,_){var $=a.x,j=a.y,et=_.devicePixelRatio||1;return{x:round($*et)/et||0,y:round(j*et)/et||0}}function mapToStyles(a){var _,$=a.popper,j=a.popperRect,et=a.placement,tt=a.variation,rt=a.offsets,nt=a.position,it=a.gpuAcceleration,st=a.adaptive,ot=a.roundOffsets,at=a.isFixed,ut=rt.x,ht=ut===void 0?0:ut,yt=rt.y,wt=yt===void 0?0:yt,Ct=typeof ot=="function"?ot({x:ht,y:wt}):{x:ht,y:wt};ht=Ct.x,wt=Ct.y;var Pt=rt.hasOwnProperty("x"),$t=rt.hasOwnProperty("y"),Mt=left,Bt=top,Dt=window;if(st){var zt=getOffsetParent($),Ot="clientHeight",It="clientWidth";if(zt===getWindow($)&&(zt=getDocumentElement($),getComputedStyle$1(zt).position!=="static"&&nt==="absolute"&&(Ot="scrollHeight",It="scrollWidth")),zt=zt,et===top||(et===left||et===right)&&tt===end){Bt=bottom;var Lt=at&&zt===Dt&&Dt.visualViewport?Dt.visualViewport.height:zt[Ot];wt-=Lt-j.height,wt*=it?1:-1}if(et===left||(et===top||et===bottom)&&tt===end){Mt=right;var Ft=at&&zt===Dt&&Dt.visualViewport?Dt.visualViewport.width:zt[It];ht-=Ft-j.width,ht*=it?1:-1}}var jt=Object.assign({position:nt},st&&unsetSides),bt=ot===!0?roundOffsetsByDPR({x:ht,y:wt},getWindow($)):{x:ht,y:wt};if(ht=bt.x,wt=bt.y,it){var vt;return Object.assign({},jt,(vt={},vt[Bt]=$t?"0":"",vt[Mt]=Pt?"0":"",vt.transform=(Dt.devicePixelRatio||1)<=1?"translate("+ht+"px, "+wt+"px)":"translate3d("+ht+"px, "+wt+"px, 0)",vt))}return Object.assign({},jt,(_={},_[Bt]=$t?wt+"px":"",_[Mt]=Pt?ht+"px":"",_.transform="",_))}function computeStyles(a){var _=a.state,$=a.options,j=$.gpuAcceleration,et=j===void 0?!0:j,tt=$.adaptive,rt=tt===void 0?!0:tt,nt=$.roundOffsets,it=nt===void 0?!0:nt,st={placement:getBasePlacement(_.placement),variation:getVariation(_.placement),popper:_.elements.popper,popperRect:_.rects.popper,gpuAcceleration:et,isFixed:_.options.strategy==="fixed"};_.modifiersData.popperOffsets!=null&&(_.styles.popper=Object.assign({},_.styles.popper,mapToStyles(Object.assign({},st,{offsets:_.modifiersData.popperOffsets,position:_.options.strategy,adaptive:rt,roundOffsets:it})))),_.modifiersData.arrow!=null&&(_.styles.arrow=Object.assign({},_.styles.arrow,mapToStyles(Object.assign({},st,{offsets:_.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:it})))),_.attributes.popper=Object.assign({},_.attributes.popper,{"data-popper-placement":_.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(a){var _=a.state,$=a.instance,j=a.options,et=j.scroll,tt=et===void 0?!0:et,rt=j.resize,nt=rt===void 0?!0:rt,it=getWindow(_.elements.popper),st=[].concat(_.scrollParents.reference,_.scrollParents.popper);return tt&&st.forEach(function(ot){ot.addEventListener("scroll",$.update,passive)}),nt&&it.addEventListener("resize",$.update,passive),function(){tt&&st.forEach(function(ot){ot.removeEventListener("scroll",$.update,passive)}),nt&&it.removeEventListener("resize",$.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$7={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(a){return a.replace(/left|right|bottom|top/g,function(_){return hash$7[_]})}var hash$6={start:"end",end:"start"};function getOppositeVariationPlacement(a){return a.replace(/start|end/g,function(_){return hash$6[_]})}function getWindowScroll(a){var _=getWindow(a),$=_.pageXOffset,j=_.pageYOffset;return{scrollLeft:$,scrollTop:j}}function getWindowScrollBarX(a){return getBoundingClientRect(getDocumentElement(a)).left+getWindowScroll(a).scrollLeft}function getViewportRect(a,_){var $=getWindow(a),j=getDocumentElement(a),et=$.visualViewport,tt=j.clientWidth,rt=j.clientHeight,nt=0,it=0;if(et){tt=et.width,rt=et.height;var st=isLayoutViewport();(st||!st&&_==="fixed")&&(nt=et.offsetLeft,it=et.offsetTop)}return{width:tt,height:rt,x:nt+getWindowScrollBarX(a),y:it}}function getDocumentRect(a){var _,$=getDocumentElement(a),j=getWindowScroll(a),et=(_=a.ownerDocument)==null?void 0:_.body,tt=max($.scrollWidth,$.clientWidth,et?et.scrollWidth:0,et?et.clientWidth:0),rt=max($.scrollHeight,$.clientHeight,et?et.scrollHeight:0,et?et.clientHeight:0),nt=-j.scrollLeft+getWindowScrollBarX(a),it=-j.scrollTop;return getComputedStyle$1(et||$).direction==="rtl"&&(nt+=max($.clientWidth,et?et.clientWidth:0)-tt),{width:tt,height:rt,x:nt,y:it}}function isScrollParent(a){var _=getComputedStyle$1(a),$=_.overflow,j=_.overflowX,et=_.overflowY;return/auto|scroll|overlay|hidden/.test($+et+j)}function getScrollParent(a){return["html","body","#document"].indexOf(getNodeName(a))>=0?a.ownerDocument.body:isHTMLElement$2(a)&&isScrollParent(a)?a:getScrollParent(getParentNode(a))}function listScrollParents(a,_){var $;_===void 0&&(_=[]);var j=getScrollParent(a),et=j===(($=a.ownerDocument)==null?void 0:$.body),tt=getWindow(j),rt=et?[tt].concat(tt.visualViewport||[],isScrollParent(j)?j:[]):j,nt=_.concat(rt);return et?nt:nt.concat(listScrollParents(getParentNode(rt)))}function rectToClientRect(a){return Object.assign({},a,{left:a.x,top:a.y,right:a.x+a.width,bottom:a.y+a.height})}function getInnerBoundingClientRect(a,_){var $=getBoundingClientRect(a,!1,_==="fixed");return $.top=$.top+a.clientTop,$.left=$.left+a.clientLeft,$.bottom=$.top+a.clientHeight,$.right=$.left+a.clientWidth,$.width=a.clientWidth,$.height=a.clientHeight,$.x=$.left,$.y=$.top,$}function getClientRectFromMixedType(a,_,$){return _===viewport?rectToClientRect(getViewportRect(a,$)):isElement$1(_)?getInnerBoundingClientRect(_,$):rectToClientRect(getDocumentRect(getDocumentElement(a)))}function getClippingParents(a){var _=listScrollParents(getParentNode(a)),$=["absolute","fixed"].indexOf(getComputedStyle$1(a).position)>=0,j=$&&isHTMLElement$2(a)?getOffsetParent(a):a;return isElement$1(j)?_.filter(function(et){return isElement$1(et)&&contains$1(et,j)&&getNodeName(et)!=="body"}):[]}function getClippingRect(a,_,$,j){var et=_==="clippingParents"?getClippingParents(a):[].concat(_),tt=[].concat(et,[$]),rt=tt[0],nt=tt.reduce(function(it,st){var ot=getClientRectFromMixedType(a,st,j);return it.top=max(ot.top,it.top),it.right=min(ot.right,it.right),it.bottom=min(ot.bottom,it.bottom),it.left=max(ot.left,it.left),it},getClientRectFromMixedType(a,rt,j));return nt.width=nt.right-nt.left,nt.height=nt.bottom-nt.top,nt.x=nt.left,nt.y=nt.top,nt}function computeOffsets(a){var _=a.reference,$=a.element,j=a.placement,et=j?getBasePlacement(j):null,tt=j?getVariation(j):null,rt=_.x+_.width/2-$.width/2,nt=_.y+_.height/2-$.height/2,it;switch(et){case top:it={x:rt,y:_.y-$.height};break;case bottom:it={x:rt,y:_.y+_.height};break;case right:it={x:_.x+_.width,y:nt};break;case left:it={x:_.x-$.width,y:nt};break;default:it={x:_.x,y:_.y}}var st=et?getMainAxisFromPlacement(et):null;if(st!=null){var ot=st==="y"?"height":"width";switch(tt){case start:it[st]=it[st]-(_[ot]/2-$[ot]/2);break;case end:it[st]=it[st]+(_[ot]/2-$[ot]/2);break}}return it}function detectOverflow(a,_){_===void 0&&(_={});var $=_,j=$.placement,et=j===void 0?a.placement:j,tt=$.strategy,rt=tt===void 0?a.strategy:tt,nt=$.boundary,it=nt===void 0?clippingParents:nt,st=$.rootBoundary,ot=st===void 0?viewport:st,at=$.elementContext,ut=at===void 0?popper:at,ht=$.altBoundary,yt=ht===void 0?!1:ht,wt=$.padding,Ct=wt===void 0?0:wt,Pt=mergePaddingObject(typeof Ct!="number"?Ct:expandToHashMap(Ct,basePlacements)),$t=ut===popper?reference:popper,Mt=a.rects.popper,Bt=a.elements[yt?$t:ut],Dt=getClippingRect(isElement$1(Bt)?Bt:Bt.contextElement||getDocumentElement(a.elements.popper),it,ot,rt),zt=getBoundingClientRect(a.elements.reference),Ot=computeOffsets({reference:zt,element:Mt,strategy:"absolute",placement:et}),It=rectToClientRect(Object.assign({},Mt,Ot)),Lt=ut===popper?It:zt,Ft={top:Dt.top-Lt.top+Pt.top,bottom:Lt.bottom-Dt.bottom+Pt.bottom,left:Dt.left-Lt.left+Pt.left,right:Lt.right-Dt.right+Pt.right},jt=a.modifiersData.offset;if(ut===popper&&jt){var bt=jt[et];Object.keys(Ft).forEach(function(vt){var ct=[right,bottom].indexOf(vt)>=0?1:-1,dt=[top,bottom].indexOf(vt)>=0?"y":"x";Ft[vt]+=bt[dt]*ct})}return Ft}function computeAutoPlacement(a,_){_===void 0&&(_={});var $=_,j=$.placement,et=$.boundary,tt=$.rootBoundary,rt=$.padding,nt=$.flipVariations,it=$.allowedAutoPlacements,st=it===void 0?placements:it,ot=getVariation(j),at=ot?nt?variationPlacements:variationPlacements.filter(function(yt){return getVariation(yt)===ot}):basePlacements,ut=at.filter(function(yt){return st.indexOf(yt)>=0});ut.length===0&&(ut=at);var ht=ut.reduce(function(yt,wt){return yt[wt]=detectOverflow(a,{placement:wt,boundary:et,rootBoundary:tt,padding:rt})[getBasePlacement(wt)],yt},{});return Object.keys(ht).sort(function(yt,wt){return ht[yt]-ht[wt]})}function getExpandedFallbackPlacements(a){if(getBasePlacement(a)===auto)return[];var _=getOppositePlacement(a);return[getOppositeVariationPlacement(a),_,getOppositeVariationPlacement(_)]}function flip(a){var _=a.state,$=a.options,j=a.name;if(!_.modifiersData[j]._skip){for(var et=$.mainAxis,tt=et===void 0?!0:et,rt=$.altAxis,nt=rt===void 0?!0:rt,it=$.fallbackPlacements,st=$.padding,ot=$.boundary,at=$.rootBoundary,ut=$.altBoundary,ht=$.flipVariations,yt=ht===void 0?!0:ht,wt=$.allowedAutoPlacements,Ct=_.options.placement,Pt=getBasePlacement(Ct),$t=Pt===Ct,Mt=it||($t||!yt?[getOppositePlacement(Ct)]:getExpandedFallbackPlacements(Ct)),Bt=[Ct].concat(Mt).reduce(function(tr,ir){return tr.concat(getBasePlacement(ir)===auto?computeAutoPlacement(_,{placement:ir,boundary:ot,rootBoundary:at,padding:st,flipVariations:yt,allowedAutoPlacements:wt}):ir)},[]),Dt=_.rects.reference,zt=_.rects.popper,Ot=new Map,It=!0,Lt=Bt[0],Ft=0;Ft=0,dt=ct?"width":"height",mt=detectOverflow(_,{placement:jt,boundary:ot,rootBoundary:at,altBoundary:ut,padding:st}),xt=ct?vt?right:left:vt?bottom:top;Dt[dt]>zt[dt]&&(xt=getOppositePlacement(xt));var At=getOppositePlacement(xt),Rt=[];if(tt&&Rt.push(mt[bt]<=0),nt&&Rt.push(mt[xt]<=0,mt[At]<=0),Rt.every(function(tr){return tr})){Lt=jt,It=!1;break}Ot.set(jt,Rt)}if(It)for(var St=yt?3:1,Tt=function(ir){var nr=Bt.find(function(Zt){var Kt=Ot.get(Zt);if(Kt)return Kt.slice(0,ir).every(function(Qt){return Qt})});if(nr)return Lt=nr,"break"},Et=St;Et>0;Et--){var Nt=Tt(Et);if(Nt==="break")break}_.placement!==Lt&&(_.modifiersData[j]._skip=!0,_.placement=Lt,_.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(a,_,$){return $===void 0&&($={x:0,y:0}),{top:a.top-_.height-$.y,right:a.right-_.width+$.x,bottom:a.bottom-_.height+$.y,left:a.left-_.width-$.x}}function isAnySideFullyClipped(a){return[top,right,bottom,left].some(function(_){return a[_]>=0})}function hide(a){var _=a.state,$=a.name,j=_.rects.reference,et=_.rects.popper,tt=_.modifiersData.preventOverflow,rt=detectOverflow(_,{elementContext:"reference"}),nt=detectOverflow(_,{altBoundary:!0}),it=getSideOffsets(rt,j),st=getSideOffsets(nt,et,tt),ot=isAnySideFullyClipped(it),at=isAnySideFullyClipped(st);_.modifiersData[$]={referenceClippingOffsets:it,popperEscapeOffsets:st,isReferenceHidden:ot,hasPopperEscaped:at},_.attributes.popper=Object.assign({},_.attributes.popper,{"data-popper-reference-hidden":ot,"data-popper-escaped":at})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(a,_,$){var j=getBasePlacement(a),et=[left,top].indexOf(j)>=0?-1:1,tt=typeof $=="function"?$(Object.assign({},_,{placement:a})):$,rt=tt[0],nt=tt[1];return rt=rt||0,nt=(nt||0)*et,[left,right].indexOf(j)>=0?{x:nt,y:rt}:{x:rt,y:nt}}function offset(a){var _=a.state,$=a.options,j=a.name,et=$.offset,tt=et===void 0?[0,0]:et,rt=placements.reduce(function(ot,at){return ot[at]=distanceAndSkiddingToXY(at,_.rects,tt),ot},{}),nt=rt[_.placement],it=nt.x,st=nt.y;_.modifiersData.popperOffsets!=null&&(_.modifiersData.popperOffsets.x+=it,_.modifiersData.popperOffsets.y+=st),_.modifiersData[j]=rt}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(a){var _=a.state,$=a.name;_.modifiersData[$]=computeOffsets({reference:_.rects.reference,element:_.rects.popper,strategy:"absolute",placement:_.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(a){return a==="x"?"y":"x"}function preventOverflow(a){var _=a.state,$=a.options,j=a.name,et=$.mainAxis,tt=et===void 0?!0:et,rt=$.altAxis,nt=rt===void 0?!1:rt,it=$.boundary,st=$.rootBoundary,ot=$.altBoundary,at=$.padding,ut=$.tether,ht=ut===void 0?!0:ut,yt=$.tetherOffset,wt=yt===void 0?0:yt,Ct=detectOverflow(_,{boundary:it,rootBoundary:st,padding:at,altBoundary:ot}),Pt=getBasePlacement(_.placement),$t=getVariation(_.placement),Mt=!$t,Bt=getMainAxisFromPlacement(Pt),Dt=getAltAxis(Bt),zt=_.modifiersData.popperOffsets,Ot=_.rects.reference,It=_.rects.popper,Lt=typeof wt=="function"?wt(Object.assign({},_.rects,{placement:_.placement})):wt,Ft=typeof Lt=="number"?{mainAxis:Lt,altAxis:Lt}:Object.assign({mainAxis:0,altAxis:0},Lt),jt=_.modifiersData.offset?_.modifiersData.offset[_.placement]:null,bt={x:0,y:0};if(zt){if(tt){var vt,ct=Bt==="y"?top:left,dt=Bt==="y"?bottom:right,mt=Bt==="y"?"height":"width",xt=zt[Bt],At=xt+Ct[ct],Rt=xt-Ct[dt],St=ht?-It[mt]/2:0,Tt=$t===start?Ot[mt]:It[mt],Et=$t===start?-It[mt]:-Ot[mt],Nt=_.elements.arrow,tr=ht&&Nt?getLayoutRect(Nt):{width:0,height:0},ir=_.modifiersData["arrow#persistent"]?_.modifiersData["arrow#persistent"].padding:getFreshSideObject(),nr=ir[ct],Zt=ir[dt],Kt=within(0,Ot[mt],tr[mt]),Qt=Mt?Ot[mt]/2-St-Kt-nr-Ft.mainAxis:Tt-Kt-nr-Ft.mainAxis,Ht=Mt?-Ot[mt]/2+St+Kt+Zt+Ft.mainAxis:Et+Kt+Zt+Ft.mainAxis,qt=_.elements.arrow&&getOffsetParent(_.elements.arrow),Jt=qt?Bt==="y"?qt.clientTop||0:qt.clientLeft||0:0,ur=(vt=jt==null?void 0:jt[Bt])!=null?vt:0,xr=xt+Qt-ur-Jt,pr=xt+Ht-ur,Cr=within(ht?min(At,xr):At,xt,ht?max(Rt,pr):Rt);zt[Bt]=Cr,bt[Bt]=Cr-xt}if(nt){var Mr,lr=Bt==="x"?top:left,fr=Bt==="x"?bottom:right,_r=zt[Dt],Sr=Dt==="y"?"height":"width",kr=_r+Ct[lr],Ar=_r-Ct[fr],$r=[top,left].indexOf(Pt)!==-1,Or=(Mr=jt==null?void 0:jt[Dt])!=null?Mr:0,Br=$r?kr:_r-Ot[Sr]-It[Sr]-Or+Ft.altAxis,or=$r?_r+Ot[Sr]+It[Sr]-Or-Ft.altAxis:Ar,Yt=ht&&$r?withinMaxClamp(Br,_r,or):within(ht?Br:kr,_r,ht?or:Ar);zt[Dt]=Yt,bt[Dt]=Yt-_r}_.modifiersData[j]=bt}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(a){return{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}}function getNodeScroll(a){return a===getWindow(a)||!isHTMLElement$2(a)?getWindowScroll(a):getHTMLElementScroll(a)}function isElementScaled(a){var _=a.getBoundingClientRect(),$=round(_.width)/a.offsetWidth||1,j=round(_.height)/a.offsetHeight||1;return $!==1||j!==1}function getCompositeRect(a,_,$){$===void 0&&($=!1);var j=isHTMLElement$2(_),et=isHTMLElement$2(_)&&isElementScaled(_),tt=getDocumentElement(_),rt=getBoundingClientRect(a,et,$),nt={scrollLeft:0,scrollTop:0},it={x:0,y:0};return(j||!j&&!$)&&((getNodeName(_)!=="body"||isScrollParent(tt))&&(nt=getNodeScroll(_)),isHTMLElement$2(_)?(it=getBoundingClientRect(_,!0),it.x+=_.clientLeft,it.y+=_.clientTop):tt&&(it.x=getWindowScrollBarX(tt))),{x:rt.left+nt.scrollLeft-it.x,y:rt.top+nt.scrollTop-it.y,width:rt.width,height:rt.height}}function order(a){var _=new Map,$=new Set,j=[];a.forEach(function(tt){_.set(tt.name,tt)});function et(tt){$.add(tt.name);var rt=[].concat(tt.requires||[],tt.requiresIfExists||[]);rt.forEach(function(nt){if(!$.has(nt)){var it=_.get(nt);it&&et(it)}}),j.push(tt)}return a.forEach(function(tt){$.has(tt.name)||et(tt)}),j}function orderModifiers(a){var _=order(a);return modifierPhases.reduce(function($,j){return $.concat(_.filter(function(et){return et.phase===j}))},[])}function debounce(a){var _;return function(){return _||(_=new Promise(function($){Promise.resolve().then(function(){_=void 0,$(a())})})),_}}function mergeByName(a){var _=a.reduce(function($,j){var et=$[j.name];return $[j.name]=et?Object.assign({},et,j,{options:Object.assign({},et.options,j.options),data:Object.assign({},et.data,j.data)}):j,$},{});return Object.keys(_).map(function($){return _[$]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var a=arguments.length,_=new Array(a),$=0;${}),Mt=reactExports.useCallback(()=>{var Ft;!_||!yt.current||!wt.current||((Ft=$t.current)==null||Ft.call($t),Ct.current=createPopper(yt.current,wt.current,{placement:Pt,modifiers:[innerArrow,positionArrow,transformOrigin,{...matchWidth,enabled:!!ut},{name:"eventListeners",...getEventListenerOptions(rt)},{name:"arrow",options:{padding:tt}},{name:"offset",options:{offset:nt??[0,it]}},{name:"flip",enabled:!!st,options:{padding:8}},{name:"preventOverflow",enabled:!!at,options:{boundary:ot}},...$??[]],strategy:et}),Ct.current.forceUpdate(),$t.current=Ct.current.destroy)},[Pt,_,$,ut,rt,tt,nt,it,st,at,ot,et]);reactExports.useEffect(()=>()=>{var Ft;!yt.current&&!wt.current&&((Ft=Ct.current)==null||Ft.destroy(),Ct.current=null)},[]);const Bt=reactExports.useCallback(Ft=>{yt.current=Ft,Mt()},[Mt]),Dt=reactExports.useCallback((Ft={},jt=null)=>({...Ft,ref:mergeRefs(Bt,jt)}),[Bt]),zt=reactExports.useCallback(Ft=>{wt.current=Ft,Mt()},[Mt]),Ot=reactExports.useCallback((Ft={},jt=null)=>({...Ft,ref:mergeRefs(zt,jt),style:{...Ft.style,position:et,minWidth:ut?void 0:"max-content",inset:"0 auto auto 0"}}),[et,zt,ut]),It=reactExports.useCallback((Ft={},jt=null)=>{const{size:bt,shadowColor:vt,bg:ct,style:dt,...mt}=Ft;return{...mt,ref:jt,"data-popper-arrow":"",style:getArrowStyle(Ft)}},[]),Lt=reactExports.useCallback((Ft={},jt=null)=>({...Ft,ref:jt,"data-popper-arrow-inner":""}),[]);return{update(){var Ft;(Ft=Ct.current)==null||Ft.update()},forceUpdate(){var Ft;(Ft=Ct.current)==null||Ft.forceUpdate()},transformOrigin:cssVars.transformOrigin.varRef,referenceRef:Bt,popperRef:zt,getPopperProps:Ot,getArrowProps:It,getArrowInnerProps:Lt,getReferenceProps:Dt}}function getArrowStyle(a){const{size:_,shadowColor:$,bg:j,style:et}=a,tt={...et,position:"absolute"};return _&&(tt["--popper-arrow-size"]=_),$&&(tt["--popper-arrow-shadow-color"]=$),j&&(tt["--popper-arrow-bg"]=j),tt}function useDisclosure(a={}){const{onClose:_,onOpen:$,isOpen:j,id:et}=a,tt=useCallbackRef$2($),rt=useCallbackRef$2(_),[nt,it]=reactExports.useState(a.defaultIsOpen||!1),st=j!==void 0?j:nt,ot=j!==void 0,at=reactExports.useId(),ut=et??`disclosure-${at}`,ht=reactExports.useCallback(()=>{ot||it(!1),rt==null||rt()},[ot,rt]),yt=reactExports.useCallback(()=>{ot||it(!0),tt==null||tt()},[ot,tt]),wt=reactExports.useCallback(()=>{st?ht():yt()},[st,yt,ht]);function Ct($t={}){return{...$t,"aria-expanded":st,"aria-controls":ut,onClick(Mt){var Bt;(Bt=$t.onClick)==null||Bt.call($t,Mt),wt()}}}function Pt($t={}){return{...$t,hidden:!st,id:ut}}return{isOpen:st,onOpen:yt,onClose:ht,onToggle:wt,isControlled:ot,getButtonProps:Ct,getDisclosureProps:Pt}}function useOutsideClick(a){const{ref:_,handler:$,enabled:j=!0}=a,et=useCallbackRef$2($),rt=reactExports.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;reactExports.useEffect(()=>{if(!j)return;const nt=at=>{isValidEvent(at,_)&&(rt.isPointerDown=!0)},it=at=>{if(rt.ignoreEmulatedMouseEvents){rt.ignoreEmulatedMouseEvents=!1;return}rt.isPointerDown&&$&&isValidEvent(at,_)&&(rt.isPointerDown=!1,et(at))},st=at=>{rt.ignoreEmulatedMouseEvents=!0,$&&rt.isPointerDown&&isValidEvent(at,_)&&(rt.isPointerDown=!1,et(at))},ot=getOwnerDocument$1(_.current);return ot.addEventListener("mousedown",nt,!0),ot.addEventListener("mouseup",it,!0),ot.addEventListener("touchstart",nt,!0),ot.addEventListener("touchend",st,!0),()=>{ot.removeEventListener("mousedown",nt,!0),ot.removeEventListener("mouseup",it,!0),ot.removeEventListener("touchstart",nt,!0),ot.removeEventListener("touchend",st,!0)}},[$,_,et,rt,j])}function isValidEvent(a,_){var $;const j=a.target;return j&&!getOwnerDocument$1(j).contains(j)?!1:!(($=_.current)!=null&&$.contains(j))}function getOwnerDocument$1(a){var _;return(_=a==null?void 0:a.ownerDocument)!=null?_:document}function useAnimationState(a){const{isOpen:_,ref:$}=a,[j,et]=reactExports.useState(_),[tt,rt]=reactExports.useState(!1);return reactExports.useEffect(()=>{tt||(et(_),rt(!0))},[_,tt,j]),useEventListener(()=>$.current,"animationend",()=>{et(_)}),{present:!(_?!1:!j),onComplete(){var it;const st=getOwnerWindow($.current),ot=new st.CustomEvent("animationend",{bubbles:!0});(it=$.current)==null||it.dispatchEvent(ot)}}}function lazyDisclosure(a){const{wasSelected:_,enabled:$,isSelected:j,mode:et="unmount"}=a;return!!(!$||j||et==="keepMounted"&&_)}var[MenuDescendantsProvider,useMenuDescendantsContext,useMenuDescendants,useMenuDescendant]=createDescendantContext(),[MenuProvider,useMenuContext]=createContext$1({strict:!1,name:"MenuContext"});function useIds$1(a,..._){const $=reactExports.useId(),j=a||$;return reactExports.useMemo(()=>_.map(et=>`${et}-${j}`),[j,_])}function getOwnerDocument(a){var _;return(_=a==null?void 0:a.ownerDocument)!=null?_:document}function isActiveElement(a){return getOwnerDocument(a).activeElement===a}function useMenu(a={}){const{id:_,closeOnSelect:$=!0,closeOnBlur:j=!0,initialFocusRef:et,autoSelect:tt=!0,isLazy:rt,isOpen:nt,defaultIsOpen:it,onClose:st,onOpen:ot,placement:at="bottom-start",lazyBehavior:ut="unmount",direction:ht,computePositionOnMount:yt=!1,...wt}=a,Ct=reactExports.useRef(null),Pt=reactExports.useRef(null),$t=useMenuDescendants(),Mt=reactExports.useCallback(()=>{requestAnimationFrame(()=>{var Nt;(Nt=Ct.current)==null||Nt.focus({preventScroll:!1})})},[]),Bt=reactExports.useCallback(()=>{const Nt=setTimeout(()=>{var tr;if(et)(tr=et.current)==null||tr.focus();else{const ir=$t.firstEnabled();ir&&vt(ir.index)}});At.current.add(Nt)},[$t,et]),Dt=reactExports.useCallback(()=>{const Nt=setTimeout(()=>{const tr=$t.lastEnabled();tr&&vt(tr.index)});At.current.add(Nt)},[$t]),zt=reactExports.useCallback(()=>{ot==null||ot(),tt?Bt():Mt()},[tt,Bt,Mt,ot]),{isOpen:Ot,onOpen:It,onClose:Lt,onToggle:Ft}=useDisclosure({isOpen:nt,defaultIsOpen:it,onClose:st,onOpen:zt});useOutsideClick({enabled:Ot&&j,ref:Ct,handler:Nt=>{var tr;(tr=Pt.current)!=null&&tr.contains(Nt.target)||Lt()}});const jt=usePopper({...wt,enabled:Ot||yt,placement:at,direction:ht}),[bt,vt]=reactExports.useState(-1);useUpdateEffect(()=>{Ot||vt(-1)},[Ot]),useFocusOnHide(Ct,{focusRef:Pt,visible:Ot,shouldFocus:!0});const ct=useAnimationState({isOpen:Ot,ref:Ct}),[dt,mt]=useIds$1(_,"menu-button","menu-list"),xt=reactExports.useCallback(()=>{It(),Mt()},[It,Mt]),At=reactExports.useRef(new Set([]));reactExports.useEffect(()=>{const Nt=At.current;return()=>{Nt.forEach(tr=>clearTimeout(tr)),Nt.clear()}},[]);const Rt=reactExports.useCallback(()=>{It(),Bt()},[Bt,It]),St=reactExports.useCallback(()=>{It(),Dt()},[It,Dt]),Tt=reactExports.useCallback(()=>{var Nt,tr;const ir=getOwnerDocument(Ct.current),nr=(Nt=Ct.current)==null?void 0:Nt.contains(ir.activeElement);if(!(Ot&&!nr))return;const Kt=(tr=$t.item(bt))==null?void 0:tr.node;Kt==null||Kt.focus({preventScroll:!0})},[Ot,bt,$t]),Et=reactExports.useRef(null);return{openAndFocusMenu:xt,openAndFocusFirstItem:Rt,openAndFocusLastItem:St,onTransitionEnd:Tt,unstable__animationState:ct,descendants:$t,popper:jt,buttonId:dt,menuId:mt,forceUpdate:jt.forceUpdate,orientation:"vertical",isOpen:Ot,onToggle:Ft,onOpen:It,onClose:Lt,menuRef:Ct,buttonRef:Pt,focusedIndex:bt,closeOnSelect:$,closeOnBlur:j,autoSelect:tt,setFocusedIndex:vt,isLazy:rt,lazyBehavior:ut,initialFocusRef:et,rafId:Et}}function useMenuButton(a={},_=null){const $=useMenuContext(),{onToggle:j,popper:et,openAndFocusFirstItem:tt,openAndFocusLastItem:rt}=$,nt=reactExports.useCallback(it=>{const st=it.key,at={Enter:tt,ArrowDown:tt,ArrowUp:rt}[st];at&&(it.preventDefault(),it.stopPropagation(),at(it))},[tt,rt]);return{...a,ref:mergeRefs($.buttonRef,_,et.referenceRef),id:$.buttonId,"data-active":dataAttr($.isOpen),"aria-expanded":$.isOpen,"aria-haspopup":"menu","aria-controls":$.menuId,onClick:callAllHandlers$1(a.onClick,j),onKeyDown:callAllHandlers$1(a.onKeyDown,nt)}}function isTargetMenuItem(a){var _;return isHTMLElement$1(a)&&!!((_=a==null?void 0:a.getAttribute("role"))!=null&&_.startsWith("menuitem"))}function useMenuList(a={},_=null){const $=useMenuContext();if(!$)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:j,setFocusedIndex:et,menuRef:tt,isOpen:rt,onClose:nt,menuId:it,isLazy:st,lazyBehavior:ot,unstable__animationState:at}=$,ut=useMenuDescendantsContext(),ht=useShortcut({preventDefault:Pt=>Pt.key!==" "&&isTargetMenuItem(Pt.target)}),yt=reactExports.useCallback(Pt=>{if(!Pt.currentTarget.contains(Pt.target))return;const $t=Pt.key,Bt={Tab:zt=>zt.preventDefault(),Escape:nt,ArrowDown:()=>{const zt=ut.nextEnabled(j);zt&&et(zt.index)},ArrowUp:()=>{const zt=ut.prevEnabled(j);zt&&et(zt.index)}}[$t];if(Bt){Pt.preventDefault(),Bt(Pt);return}const Dt=ht(zt=>{const Ot=getNextItemFromSearch(ut.values(),zt,It=>{var Lt,Ft;return(Ft=(Lt=It==null?void 0:It.node)==null?void 0:Lt.textContent)!=null?Ft:""},ut.item(j));if(Ot){const It=ut.indexOf(Ot.node);et(It)}});isTargetMenuItem(Pt.target)&&Dt(Pt)},[ut,j,ht,nt,et]),wt=reactExports.useRef(!1);rt&&(wt.current=!0);const Ct=lazyDisclosure({wasSelected:wt.current,enabled:st,mode:ot,isSelected:at.present});return{...a,ref:mergeRefs(tt,_),children:Ct?a.children:null,tabIndex:-1,role:"menu",id:it,style:{...a.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:callAllHandlers$1(a.onKeyDown,yt)}}function useMenuPositioner(a={}){const{popper:_,isOpen:$}=useMenuContext();return _.getPopperProps({...a,style:{visibility:$?"visible":"hidden",...a.style}})}function useMenuItem(a={},_=null){const{onMouseEnter:$,onMouseMove:j,onMouseLeave:et,onClick:tt,onFocus:rt,isDisabled:nt,isFocusable:it,closeOnSelect:st,type:ot,...at}=a,ut=useMenuContext(),{setFocusedIndex:ht,focusedIndex:yt,closeOnSelect:wt,onClose:Ct,menuRef:Pt,isOpen:$t,menuId:Mt,rafId:Bt}=ut,Dt=reactExports.useRef(null),zt=`${Mt}-menuitem-${reactExports.useId()}`,{index:Ot,register:It}=useMenuDescendant({disabled:nt&&!it}),Lt=reactExports.useCallback(xt=>{$==null||$(xt),!nt&&ht(Ot)},[ht,Ot,nt,$]),Ft=reactExports.useCallback(xt=>{j==null||j(xt),Dt.current&&!isActiveElement(Dt.current)&&Lt(xt)},[Lt,j]),jt=reactExports.useCallback(xt=>{et==null||et(xt),!nt&&ht(-1)},[ht,nt,et]),bt=reactExports.useCallback(xt=>{tt==null||tt(xt),isTargetMenuItem(xt.currentTarget)&&(st??wt)&&Ct()},[Ct,tt,wt,st]),vt=reactExports.useCallback(xt=>{rt==null||rt(xt),ht(Ot)},[ht,rt,Ot]),ct=Ot===yt,dt=nt&&!it;useUpdateEffect(()=>{if($t)return ct&&!dt&&Dt.current?(Bt.current&&cancelAnimationFrame(Bt.current),Bt.current=requestAnimationFrame(()=>{var xt;(xt=Dt.current)==null||xt.focus({preventScroll:!0}),Bt.current=null})):Pt.current&&!isActiveElement(Pt.current)&&Pt.current.focus({preventScroll:!0}),()=>{Bt.current&&cancelAnimationFrame(Bt.current)}},[ct,dt,Pt,$t]);const mt=useClickable({onClick:bt,onFocus:vt,onMouseEnter:Lt,onMouseMove:Ft,onMouseLeave:jt,ref:mergeRefs(It,Dt,_),isDisabled:nt,isFocusable:it});return{...at,...mt,type:ot??mt.type,id:zt,role:"menuitem",tabIndex:ct?0:-1}}function isHTMLElement$1(a){var _;if(!isElement(a))return!1;const $=(_=a.ownerDocument.defaultView)!=null?_:window;return a instanceof $.HTMLElement}function isElement(a){return a!=null&&typeof a=="object"&&"nodeType"in a&&a.nodeType===Node.ELEMENT_NODE}var[MenuStylesProvider,useMenuStyles]=createContext$1({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Menu=a=>{const{children:_}=a,$=useMultiStyleConfig("Menu",a),j=omitThemingProps(a),{direction:et}=useTheme(),{descendants:tt,...rt}=useMenu({...j,direction:et}),nt=reactExports.useMemo(()=>rt,[rt]),{isOpen:it,onClose:st,forceUpdate:ot}=nt;return jsxRuntimeExports.jsx(MenuDescendantsProvider,{value:tt,children:jsxRuntimeExports.jsx(MenuProvider,{value:nt,children:jsxRuntimeExports.jsx(MenuStylesProvider,{value:$,children:runIfFn$2(_,{isOpen:it,onClose:st,forceUpdate:ot})})})})};Menu.displayName="Menu";var MenuCommand=forwardRef((a,_)=>{const $=useMenuStyles();return jsxRuntimeExports.jsx(chakra.span,{ref:_,...a,__css:$.command,className:"chakra-menu__command"})});MenuCommand.displayName="MenuCommand";var StyledMenuItem=forwardRef((a,_)=>{const{type:$,...j}=a,et=useMenuStyles(),tt=j.as||$?$??void 0:"button",rt=reactExports.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...et.item}),[et.item]);return jsxRuntimeExports.jsx(chakra.button,{ref:_,type:tt,...j,__css:rt})}),MenuIcon=a=>{const{className:_,children:$,...j}=a,et=useMenuStyles(),tt=reactExports.Children.only($),rt=reactExports.isValidElement(tt)?reactExports.cloneElement(tt,{focusable:"false","aria-hidden":!0,className:cx("chakra-menu__icon",tt.props.className)}):null,nt=cx("chakra-menu__icon-wrapper",_);return jsxRuntimeExports.jsx(chakra.span,{className:nt,...j,__css:et.icon,children:rt})};MenuIcon.displayName="MenuIcon";var MenuItem$1=forwardRef((a,_)=>{const{icon:$,iconSpacing:j="0.75rem",command:et,commandSpacing:tt="0.75rem",children:rt,...nt}=a,it=useMenuItem(nt,_),ot=$||et?jsxRuntimeExports.jsx("span",{style:{pointerEvents:"none",flex:1},children:rt}):rt;return jsxRuntimeExports.jsxs(StyledMenuItem,{...it,className:cx("chakra-menu__menuitem",it.className),children:[$&&jsxRuntimeExports.jsx(MenuIcon,{fontSize:"0.8em",marginEnd:j,children:$}),ot,et&&jsxRuntimeExports.jsx(MenuCommand,{marginStart:tt,children:et})]})});MenuItem$1.displayName="MenuItem";var motionVariants={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},MenuTransition=chakra(motion.div),MenuList=forwardRef(function(_,$){var j,et;const{rootProps:tt,motionProps:rt,...nt}=_,{isOpen:it,onTransitionEnd:st,unstable__animationState:ot}=useMenuContext(),at=useMenuList(nt,$),ut=useMenuPositioner(tt),ht=useMenuStyles();return jsxRuntimeExports.jsx(chakra.div,{...ut,__css:{zIndex:(et=_.zIndex)!=null?et:(j=ht.list)==null?void 0:j.zIndex},children:jsxRuntimeExports.jsx(MenuTransition,{variants:motionVariants,initial:!1,animate:it?"enter":"exit",__css:{outline:0,...ht.list},...rt,className:cx("chakra-menu__menu-list",at.className),...at,onUpdate:st,onAnimationComplete:callAll(ot.onComplete,at.onAnimationComplete)})})});MenuList.displayName="MenuList";var StyledMenuButton=forwardRef((a,_)=>{const $=useMenuStyles();return jsxRuntimeExports.jsx(chakra.button,{ref:_,...a,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...$.button}})}),MenuButton=forwardRef((a,_)=>{const{children:$,as:j,...et}=a,tt=useMenuButton(et,_),rt=j||StyledMenuButton;return jsxRuntimeExports.jsx(rt,{...tt,className:cx("chakra-menu__menu-button",a.className),children:jsxRuntimeExports.jsx(chakra.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:a.children})})});MenuButton.displayName="MenuButton";var transitions={slideInBottom:{...slideFadeConfig,custom:{offsetY:16,reverse:!0}},slideInRight:{...slideFadeConfig,custom:{offsetX:16,reverse:!0}},slideInTop:{...slideFadeConfig,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...slideFadeConfig,custom:{offsetX:-16,reverse:!0}},scale:{...scaleFadeConfig,custom:{initialScale:.95,reverse:!0}},none:{}},MotionSection$1=chakra(motion.section),getMotionProps=a=>transitions[a||"none"],ModalTransition=reactExports.forwardRef((a,_)=>{const{preset:$,motionProps:j=getMotionProps($),...et}=a;return jsxRuntimeExports.jsx(MotionSection$1,{ref:_,...j,...et})});ModalTransition.displayName="ModalTransition";var __defProp$7=Object.defineProperty,__defNormalProp$2=(a,_,$)=>_ in a?__defProp$7(a,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[_]=$,__publicField$2=(a,_,$)=>(__defNormalProp$2(a,_+"",$),$),ModalManager=class{constructor(){__publicField$2(this,"modals"),this.modals=new Map}add(a){return this.modals.set(a,this.modals.size+1),this.modals.size}remove(a){this.modals.delete(a)}isTopModal(a){return a?this.modals.get(a)===this.modals.size:!1}},modalManager=new ModalManager;function useModalManager(a,_){const[$,j]=reactExports.useState(0);return reactExports.useEffect(()=>{const et=a.current;if(et){if(_){const tt=modalManager.add(et);j(tt)}return()=>{modalManager.remove(et),j(0)}}},[_,a]),$}var getDefaultParent=function(a){if(typeof document>"u")return null;var _=Array.isArray(a)?a[0]:a;return _.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(a){return a&&(a.host||unwrapHost(a.parentNode))},correctTargets=function(a,_){return _.map(function($){if(a.contains($))return $;var j=unwrapHost($);return j&&a.contains(j)?j:(console.error("aria-hidden",$,"in not contained inside",a,". Doing nothing"),null)}).filter(function($){return!!$})},applyAttributeToOthers=function(a,_,$,j){var et=correctTargets(_,Array.isArray(a)?a:[a]);markerMap[$]||(markerMap[$]=new WeakMap);var tt=markerMap[$],rt=[],nt=new Set,it=new Set(et),st=function(at){!at||nt.has(at)||(nt.add(at),st(at.parentNode))};et.forEach(st);var ot=function(at){!at||it.has(at)||Array.prototype.forEach.call(at.children,function(ut){if(nt.has(ut))ot(ut);else{var ht=ut.getAttribute(j),yt=ht!==null&&ht!=="false",wt=(counterMap.get(ut)||0)+1,Ct=(tt.get(ut)||0)+1;counterMap.set(ut,wt),tt.set(ut,Ct),rt.push(ut),wt===1&&yt&&uncontrolledNodes.set(ut,!0),Ct===1&&ut.setAttribute($,"true"),yt||ut.setAttribute(j,"true")}})};return ot(_),nt.clear(),lockCount++,function(){rt.forEach(function(at){var ut=counterMap.get(at)-1,ht=tt.get(at)-1;counterMap.set(at,ut),tt.set(at,ht),ut||(uncontrolledNodes.has(at)||at.removeAttribute(j),uncontrolledNodes.delete(at)),ht||at.removeAttribute($)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(a,_,$){$===void 0&&($="data-aria-hidden");var j=Array.from(Array.isArray(a)?a:[a]),et=getDefaultParent(a);return et?(j.push.apply(j,Array.from(et.querySelectorAll("[aria-live]"))),applyAttributeToOthers(j,et,$,"aria-hidden")):function(){return null}};function useModal(a){const{isOpen:_,onClose:$,id:j,closeOnOverlayClick:et=!0,closeOnEsc:tt=!0,useInert:rt=!0,onOverlayClick:nt,onEsc:it}=a,st=reactExports.useRef(null),ot=reactExports.useRef(null),[at,ut,ht]=useIds(j,"chakra-modal","chakra-modal--header","chakra-modal--body");useAriaHidden(st,_&&rt);const yt=useModalManager(st,_),wt=reactExports.useRef(null),Ct=reactExports.useCallback(Lt=>{wt.current=Lt.target},[]),Pt=reactExports.useCallback(Lt=>{Lt.key==="Escape"&&(Lt.stopPropagation(),tt&&($==null||$()),it==null||it())},[tt,$,it]),[$t,Mt]=reactExports.useState(!1),[Bt,Dt]=reactExports.useState(!1),zt=reactExports.useCallback((Lt={},Ft=null)=>({role:"dialog",...Lt,ref:mergeRefs(Ft,st),id:at,tabIndex:-1,"aria-modal":!0,"aria-labelledby":$t?ut:void 0,"aria-describedby":Bt?ht:void 0,onClick:callAllHandlers$1(Lt.onClick,jt=>jt.stopPropagation())}),[ht,Bt,at,ut,$t]),Ot=reactExports.useCallback(Lt=>{Lt.stopPropagation(),wt.current===Lt.target&&modalManager.isTopModal(st.current)&&(et&&($==null||$()),nt==null||nt())},[$,et,nt]),It=reactExports.useCallback((Lt={},Ft=null)=>({...Lt,ref:mergeRefs(Ft,ot),onClick:callAllHandlers$1(Lt.onClick,Ot),onKeyDown:callAllHandlers$1(Lt.onKeyDown,Pt),onMouseDown:callAllHandlers$1(Lt.onMouseDown,Ct)}),[Pt,Ct,Ot]);return{isOpen:_,onClose:$,headerId:ut,bodyId:ht,setBodyMounted:Dt,setHeaderMounted:Mt,dialogRef:st,overlayRef:ot,getDialogProps:zt,getDialogContainerProps:It,index:yt}}function useAriaHidden(a,_){const $=a.current;reactExports.useEffect(()=>{if(!(!a.current||!_))return hideOthers(a.current)},[_,a,$])}function useIds(a,..._){const $=reactExports.useId(),j=a||$;return reactExports.useMemo(()=>_.map(et=>`${et}-${j}`),[j,_])}var[ModalStylesProvider,useModalStyles]=createContext$1({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[ModalContextProvider,useModalContext]=createContext$1({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Modal=a=>{const _={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...a},{portalProps:$,children:j,autoFocus:et,trapFocus:tt,initialFocusRef:rt,finalFocusRef:nt,returnFocusOnClose:it,blockScrollOnMount:st,allowPinchZoom:ot,preserveScrollBarGap:at,motionPreset:ut,lockFocusAcrossFrames:ht,onCloseComplete:yt}=_,wt=useMultiStyleConfig("Modal",_),Pt={...useModal(_),autoFocus:et,trapFocus:tt,initialFocusRef:rt,finalFocusRef:nt,returnFocusOnClose:it,blockScrollOnMount:st,allowPinchZoom:ot,preserveScrollBarGap:at,motionPreset:ut,lockFocusAcrossFrames:ht};return jsxRuntimeExports.jsx(ModalContextProvider,{value:Pt,children:jsxRuntimeExports.jsx(ModalStylesProvider,{value:wt,children:jsxRuntimeExports.jsx(AnimatePresence,{onExitComplete:yt,children:Pt.isOpen&&jsxRuntimeExports.jsx(Portal,{...$,children:j})})})})};Modal.displayName="Modal";var zeroRightClassName$1="right-scroll-bar-position",fullWidthClassName$1="width-before-scroll-bar",noScrollbarsClassName$1="with-scroll-bars-hidden",removedBarSizeVariable$1="--removed-body-scroll-bar-size",effectCar$1=createSidecarMedium(),nothing$1=function(){},RemoveScroll$1=reactExports.forwardRef(function(a,_){var $=reactExports.useRef(null),j=reactExports.useState({onScrollCapture:nothing$1,onWheelCapture:nothing$1,onTouchMoveCapture:nothing$1}),et=j[0],tt=j[1],rt=a.forwardProps,nt=a.children,it=a.className,st=a.removeScrollBar,ot=a.enabled,at=a.shards,ut=a.sideCar,ht=a.noIsolation,yt=a.inert,wt=a.allowPinchZoom,Ct=a.as,Pt=Ct===void 0?"div":Ct,$t=a.gapMode,Mt=__rest$3(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),Bt=ut,Dt=useMergeRefs([$,_]),zt=__assign(__assign({},Mt),et);return reactExports.createElement(reactExports.Fragment,null,ot&&reactExports.createElement(Bt,{sideCar:effectCar$1,removeScrollBar:st,shards:at,noIsolation:ht,inert:yt,setCallbacks:tt,allowPinchZoom:!!wt,lockRef:$,gapMode:$t}),rt?reactExports.cloneElement(reactExports.Children.only(nt),__assign(__assign({},zt),{ref:Dt})):reactExports.createElement(Pt,__assign({},zt,{className:it,ref:Dt}),nt))});RemoveScroll$1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll$1.classNames={fullWidth:fullWidthClassName$1,zeroRight:zeroRightClassName$1};var getNonce$1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var _=getNonce$1();return _&&a.setAttribute("nonce",_),a}function injectStyles(a,_){a.styleSheet?a.styleSheet.cssText=_:a.appendChild(document.createTextNode(_))}function insertStyleTag(a){var _=document.head||document.getElementsByTagName("head")[0];_.appendChild(a)}var stylesheetSingleton=function(){var a=0,_=null;return{add:function($){a==0&&(_=makeStyleTag())&&(injectStyles(_,$),insertStyleTag(_)),a++},remove:function(){a--,!a&&_&&(_.parentNode&&_.parentNode.removeChild(_),_=null)}}},styleHookSingleton=function(){var a=stylesheetSingleton();return function(_,$){reactExports.useEffect(function(){return a.add(_),function(){a.remove()}},[_&&$])}},styleSingleton=function(){var a=styleHookSingleton(),_=function($){var j=$.styles,et=$.dynamic;return a(j,et),null};return _},zeroGap$1={left:0,top:0,right:0,gap:0},parse$b=function(a){return parseInt(a||"",10)||0},getOffset$1=function(a){var _=window.getComputedStyle(document.body),$=_[a==="padding"?"paddingLeft":"marginLeft"],j=_[a==="padding"?"paddingTop":"marginTop"],et=_[a==="padding"?"paddingRight":"marginRight"];return[parse$b($),parse$b(j),parse$b(et)]},getGapWidth$1=function(a){if(a===void 0&&(a="margin"),typeof window>"u")return zeroGap$1;var _=getOffset$1(a),$=document.documentElement.clientWidth,j=window.innerWidth;return{left:_[0],top:_[1],right:_[2],gap:Math.max(0,j-$+_[2]-_[0])}},Style$1=styleSingleton(),getStyles$1=function(a,_,$,j){var et=a.left,tt=a.top,rt=a.right,nt=a.gap;return $===void 0&&($="margin"),` .`.concat(noScrollbarsClassName$1,` { overflow: hidden `).concat(j,`; padding-right: `).concat(nt,"px ").concat(j,`; @@ -388,16 +388,16 @@ Error generating stack: `+tt.message+` `)},RemoveScrollBar$1=function(a){var _=a.noRelative,$=a.noImportant,j=a.gapMode,et=j===void 0?"margin":j,tt=reactExports.useMemo(function(){return getGapWidth$1(et)},[et]);return reactExports.createElement(Style$1,{styles:getStyles$1(tt,!_,et,$?"":"!important")})},passiveSupported$1=!1;if(typeof window<"u")try{var options$1=Object.defineProperty({},"passive",{get:function(){return passiveSupported$1=!0,!0}});window.addEventListener("test",options$1,options$1),window.removeEventListener("test",options$1,options$1)}catch{passiveSupported$1=!1}var nonPassive$1=passiveSupported$1?{passive:!1}:!1,alwaysContainsScroll$1=function(a){return a.tagName==="TEXTAREA"},elementCanBeScrolled$1=function(a,_){var $=window.getComputedStyle(a);return $[_]!=="hidden"&&!($.overflowY===$.overflowX&&!alwaysContainsScroll$1(a)&&$[_]==="visible")},elementCouldBeVScrolled$1=function(a){return elementCanBeScrolled$1(a,"overflowY")},elementCouldBeHScrolled$1=function(a){return elementCanBeScrolled$1(a,"overflowX")},locationCouldBeScrolled$1=function(a,_){var $=_.ownerDocument,j=_;do{typeof ShadowRoot<"u"&&j instanceof ShadowRoot&&(j=j.host);var et=elementCouldBeScrolled$1(a,j);if(et){var tt=getScrollVariables$1(a,j),rt=tt[1],nt=tt[2];if(rt>nt)return!0}j=j.parentNode}while(j&&j!==$.body);return!1},getVScrollVariables$1=function(a){var _=a.scrollTop,$=a.scrollHeight,j=a.clientHeight;return[_,$,j]},getHScrollVariables$1=function(a){var _=a.scrollLeft,$=a.scrollWidth,j=a.clientWidth;return[_,$,j]},elementCouldBeScrolled$1=function(a,_){return a==="v"?elementCouldBeVScrolled$1(_):elementCouldBeHScrolled$1(_)},getScrollVariables$1=function(a,_){return a==="v"?getVScrollVariables$1(_):getHScrollVariables$1(_)},getDirectionFactor$1=function(a,_){return a==="h"&&_==="rtl"?-1:1},handleScroll$1=function(a,_,$,j,et){var tt=getDirectionFactor$1(a,window.getComputedStyle(_).direction),rt=tt*j,nt=$.target,it=_.contains(nt),st=!1,ot=rt>0,at=0,ut=0;do{var ht=getScrollVariables$1(a,nt),yt=ht[0],wt=ht[1],Ct=ht[2],Pt=wt-Ct-tt*yt;(yt||Pt)&&elementCouldBeScrolled$1(a,nt)&&(at+=Pt,ut+=yt),nt instanceof ShadowRoot?nt=nt.host:nt=nt.parentNode}while(!it&&nt!==document.body||it&&(_.contains(nt)||_===nt));return(ot&&(Math.abs(at)<1||!et)||!ot&&(Math.abs(ut)<1||!et))&&(st=!0),st},getTouchXY$1=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},getDeltaXY$1=function(a){return[a.deltaX,a.deltaY]},extractRef$1=function(a){return a&&"current"in a?a.current:a},deltaCompare$1=function(a,_){return a[0]===_[0]&&a[1]===_[1]},generateStyle$1=function(a){return` .block-interactivity-`.concat(a,` {pointer-events: none;} .allow-interactivity-`).concat(a,` {pointer-events: all;} -`)},idCounter$1=0,lockStack$1=[];function RemoveScrollSideCar$1(a){var _=reactExports.useRef([]),$=reactExports.useRef([0,0]),j=reactExports.useRef(),et=reactExports.useState(idCounter$1++)[0],tt=reactExports.useState(styleSingleton)[0],rt=reactExports.useRef(a);reactExports.useEffect(function(){rt.current=a},[a]),reactExports.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(et));var wt=__spreadArray([a.lockRef.current],(a.shards||[]).map(extractRef$1),!0).filter(Boolean);return wt.forEach(function(Ct){return Ct.classList.add("allow-interactivity-".concat(et))}),function(){document.body.classList.remove("block-interactivity-".concat(et)),wt.forEach(function(Ct){return Ct.classList.remove("allow-interactivity-".concat(et))})}}},[a.inert,a.lockRef.current,a.shards]);var nt=reactExports.useCallback(function(wt,Ct){if("touches"in wt&&wt.touches.length===2)return!rt.current.allowPinchZoom;var Pt=getTouchXY$1(wt),$t=$.current,Mt="deltaX"in wt?wt.deltaX:$t[0]-Pt[0],Bt="deltaY"in wt?wt.deltaY:$t[1]-Pt[1],Dt,zt=wt.target,Ot=Math.abs(Mt)>Math.abs(Bt)?"h":"v";if("touches"in wt&&Ot==="h"&&zt.type==="range")return!1;var It=locationCouldBeScrolled$1(Ot,zt);if(!It)return!0;if(It?Dt=Ot:(Dt=Ot==="v"?"h":"v",It=locationCouldBeScrolled$1(Ot,zt)),!It)return!1;if(!j.current&&"changedTouches"in wt&&(Mt||Bt)&&(j.current=Dt),!Dt)return!0;var Lt=j.current||Dt;return handleScroll$1(Lt,Ct,wt,Lt==="h"?Mt:Bt,!0)},[]),it=reactExports.useCallback(function(wt){var Ct=wt;if(!(!lockStack$1.length||lockStack$1[lockStack$1.length-1]!==tt)){var Pt="deltaY"in Ct?getDeltaXY$1(Ct):getTouchXY$1(Ct),$t=_.current.filter(function(Dt){return Dt.name===Ct.type&&(Dt.target===Ct.target||Ct.target===Dt.shadowParent)&&deltaCompare$1(Dt.delta,Pt)})[0];if($t&&$t.should){Ct.cancelable&&Ct.preventDefault();return}if(!$t){var Mt=(rt.current.shards||[]).map(extractRef$1).filter(Boolean).filter(function(Dt){return Dt.contains(Ct.target)}),Bt=Mt.length>0?nt(Ct,Mt[0]):!rt.current.noIsolation;Bt&&Ct.cancelable&&Ct.preventDefault()}}},[]),st=reactExports.useCallback(function(wt,Ct,Pt,$t){var Mt={name:wt,delta:Ct,target:Pt,should:$t,shadowParent:getOutermostShadowParent$1(Pt)};_.current.push(Mt),setTimeout(function(){_.current=_.current.filter(function(Bt){return Bt!==Mt})},1)},[]),ot=reactExports.useCallback(function(wt){$.current=getTouchXY$1(wt),j.current=void 0},[]),at=reactExports.useCallback(function(wt){st(wt.type,getDeltaXY$1(wt),wt.target,nt(wt,a.lockRef.current))},[]),ut=reactExports.useCallback(function(wt){st(wt.type,getTouchXY$1(wt),wt.target,nt(wt,a.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack$1.push(tt),a.setCallbacks({onScrollCapture:at,onWheelCapture:at,onTouchMoveCapture:ut}),document.addEventListener("wheel",it,nonPassive$1),document.addEventListener("touchmove",it,nonPassive$1),document.addEventListener("touchstart",ot,nonPassive$1),function(){lockStack$1=lockStack$1.filter(function(wt){return wt!==tt}),document.removeEventListener("wheel",it,nonPassive$1),document.removeEventListener("touchmove",it,nonPassive$1),document.removeEventListener("touchstart",ot,nonPassive$1)}},[]);var ht=a.removeScrollBar,yt=a.inert;return reactExports.createElement(reactExports.Fragment,null,yt?reactExports.createElement(tt,{styles:generateStyle$1(et)}):null,ht?reactExports.createElement(RemoveScrollBar$1,{gapMode:a.gapMode}):null)}function getOutermostShadowParent$1(a){for(var _=null;a!==null;)a instanceof ShadowRoot&&(_=a.host,a=a.host),a=a.parentNode;return _}const SideCar$1=exportSidecar(effectCar$1,RemoveScrollSideCar$1);var ReactRemoveScroll$1=reactExports.forwardRef(function(a,_){return reactExports.createElement(RemoveScroll$1,__assign({},a,{ref:_,sideCar:SideCar$1}))});ReactRemoveScroll$1.classNames=RemoveScroll$1.classNames;function ModalFocusScope(a){const{autoFocus:_,trapFocus:$,dialogRef:j,initialFocusRef:et,blockScrollOnMount:tt,allowPinchZoom:rt,finalFocusRef:nt,returnFocusOnClose:it,preserveScrollBarGap:st,lockFocusAcrossFrames:ot,isOpen:at}=useModalContext(),[ut,ht]=usePresence();reactExports.useEffect(()=>{!ut&&ht&&setTimeout(ht)},[ut,ht]);const yt=useModalManager(j,at);return jsxRuntimeExports.jsx(FocusLock,{autoFocus:_,isDisabled:!$,initialFocusRef:et,finalFocusRef:nt,restoreFocus:it,contentRef:j,lockFocusAcrossFrames:ot,children:jsxRuntimeExports.jsx(ReactRemoveScroll$1,{removeScrollBar:!st,allowPinchZoom:rt,enabled:yt===1&&tt,forwardProps:!0,children:a.children})})}var ModalContent=forwardRef((a,_)=>{const{className:$,children:j,containerProps:et,motionProps:tt,...rt}=a,{getDialogProps:nt,getDialogContainerProps:it}=useModalContext(),st=nt(rt,_),ot=it(et),at=cx("chakra-modal__content",$),ut=useModalStyles(),ht={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...ut.dialog},yt={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...ut.dialogContainer},{motionPreset:wt}=useModalContext();return jsxRuntimeExports.jsx(ModalFocusScope,{children:jsxRuntimeExports.jsx(chakra.div,{...ot,className:"chakra-modal__content-container",tabIndex:-1,__css:yt,children:jsxRuntimeExports.jsx(ModalTransition,{preset:wt,motionProps:tt,className:at,...st,__css:ht,children:j})})})});ModalContent.displayName="ModalContent";var[DrawerContextProvider,useDrawerContext]=createContext$1(),placementMap={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function getDrawerPlacement(a,_){var $,j;if(a)return(j=($=placementMap[a])==null?void 0:$[_])!=null?j:a}function Drawer(a){var _;const{isOpen:$,onClose:j,placement:et="right",children:tt,...rt}=a,nt=useTheme(),it=(_=nt.components)==null?void 0:_.Drawer,st=getDrawerPlacement(et,nt.direction);return jsxRuntimeExports.jsx(DrawerContextProvider,{value:{placement:st},children:jsxRuntimeExports.jsx(Modal,{isOpen:$,onClose:j,styleConfig:it,...rt,children:tt})})}var MotionDiv$2=chakra(Slide),DrawerContent=forwardRef((a,_)=>{const{className:$,children:j,motionProps:et,containerProps:tt,...rt}=a,{getDialogProps:nt,getDialogContainerProps:it,isOpen:st}=useModalContext(),ot=nt(rt,_),at=it(tt),ut=cx("chakra-modal__content",$),ht=useModalStyles(),yt={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...ht.dialog},wt={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...ht.dialogContainer},{placement:Ct}=useDrawerContext();return jsxRuntimeExports.jsx(ModalFocusScope,{children:jsxRuntimeExports.jsx(chakra.div,{...at,className:"chakra-modal__content-container",__css:wt,children:jsxRuntimeExports.jsx(MotionDiv$2,{motionProps:et,direction:Ct,in:st,className:ut,...ot,__css:yt,children:j})})})});DrawerContent.displayName="DrawerContent";var ModalFooter=forwardRef((a,_)=>{const{className:$,...j}=a,et=cx("chakra-modal__footer",$),rt={display:"flex",alignItems:"center",justifyContent:"flex-end",...useModalStyles().footer};return jsxRuntimeExports.jsx(chakra.footer,{ref:_,...j,__css:rt,className:et})});ModalFooter.displayName="ModalFooter";var ModalHeader=forwardRef((a,_)=>{const{className:$,...j}=a,{headerId:et,setHeaderMounted:tt}=useModalContext();reactExports.useEffect(()=>(tt(!0),()=>tt(!1)),[tt]);const rt=cx("chakra-modal__header",$),it={flex:0,...useModalStyles().header};return jsxRuntimeExports.jsx(chakra.header,{ref:_,className:rt,id:et,...j,__css:it})});ModalHeader.displayName="ModalHeader";var MotionDiv$1=chakra(motion.div),ModalOverlay=forwardRef((a,_)=>{const{className:$,transition:j,motionProps:et,...tt}=a,rt=cx("chakra-modal__overlay",$),it={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...useModalStyles().overlay},{motionPreset:st}=useModalContext(),at=et||(st==="none"?{}:fadeConfig);return jsxRuntimeExports.jsx(MotionDiv$1,{...at,__css:it,ref:_,className:rt,...tt})});ModalOverlay.displayName="ModalOverlay";var ModalBody=forwardRef((a,_)=>{const{className:$,...j}=a,{bodyId:et,setBodyMounted:tt}=useModalContext();reactExports.useEffect(()=>(tt(!0),()=>tt(!1)),[tt]);const rt=cx("chakra-modal__body",$),nt=useModalStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:_,className:rt,id:et,...j,__css:nt.body})});ModalBody.displayName="ModalBody";var ModalCloseButton=forwardRef((a,_)=>{const{onClick:$,className:j,...et}=a,{onClose:tt}=useModalContext(),rt=cx("chakra-modal__close-btn",j),nt=useModalStyles();return jsxRuntimeExports.jsx(CloseButton,{ref:_,__css:nt.closeButton,className:rt,onClick:callAllHandlers$1($,it=>{it.stopPropagation(),tt()}),...et})});ModalCloseButton.displayName="ModalCloseButton";var[PopoverProvider,usePopoverContext]=createContext$1({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[PopoverStylesProvider,usePopoverStyles]=createContext$1({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `});function PopoverTrigger(a){const _=reactExports.Children.only(a.children),{getTriggerProps:$}=usePopoverContext();return reactExports.cloneElement(_,$(_.props,_.ref))}PopoverTrigger.displayName="PopoverTrigger";var TRIGGER={click:"click",hover:"hover"};function usePopover(a={}){const{closeOnBlur:_=!0,closeOnEsc:$=!0,initialFocusRef:j,id:et,returnFocusOnClose:tt=!0,autoFocus:rt=!0,arrowSize:nt,arrowShadowColor:it,trigger:st=TRIGGER.click,openDelay:ot=200,closeDelay:at=200,isLazy:ut,lazyBehavior:ht="unmount",computePositionOnMount:yt,...wt}=a,{isOpen:Ct,onClose:Pt,onOpen:$t,onToggle:Mt}=useDisclosure(a),Bt=reactExports.useRef(null),Dt=reactExports.useRef(null),zt=reactExports.useRef(null),Ot=reactExports.useRef(!1),It=reactExports.useRef(!1);Ct&&(It.current=!0);const[Lt,Ft]=reactExports.useState(!1),[jt,bt]=reactExports.useState(!1),vt=reactExports.useId(),ct=et??vt,[dt,mt,xt,At]=["popover-trigger","popover-content","popover-header","popover-body"].map(pr=>`${pr}-${ct}`),{referenceRef:Rt,getArrowProps:St,getPopperProps:Tt,getArrowInnerProps:Et,forceUpdate:Nt}=usePopper({...wt,enabled:Ct||!!yt}),tr=useAnimationState({isOpen:Ct,ref:zt});useFocusOnPointerDown({enabled:Ct,ref:Dt}),useFocusOnHide(zt,{focusRef:Dt,visible:Ct,shouldFocus:tt&&st===TRIGGER.click}),useFocusOnShow(zt,{focusRef:j,visible:Ct,shouldFocus:rt&&st===TRIGGER.click});const ir=lazyDisclosure({wasSelected:It.current,enabled:ut,mode:ht,isSelected:tr.present}),nr=reactExports.useCallback((pr={},Cr=null)=>{const Mr={...pr,style:{...pr.style,transformOrigin:cssVars.transformOrigin.varRef,[cssVars.arrowSize.var]:nt?`${nt}px`:void 0,[cssVars.arrowShadowColor.var]:it},ref:mergeRefs(zt,Cr),children:ir?pr.children:null,id:mt,tabIndex:-1,role:"dialog",onKeyDown:callAllHandlers$1(pr.onKeyDown,lr=>{$&&lr.key==="Escape"&&Pt()}),onBlur:callAllHandlers$1(pr.onBlur,lr=>{const fr=getRelatedTarget(lr),_r=contains(zt.current,fr),Rr=contains(Dt.current,fr);Ct&&_&&(!_r&&!Rr)&&Pt()}),"aria-labelledby":Lt?xt:void 0,"aria-describedby":jt?At:void 0};return st===TRIGGER.hover&&(Mr.role="tooltip",Mr.onMouseEnter=callAllHandlers$1(pr.onMouseEnter,()=>{Ot.current=!0}),Mr.onMouseLeave=callAllHandlers$1(pr.onMouseLeave,lr=>{lr.nativeEvent.relatedTarget!==null&&(Ot.current=!1,setTimeout(()=>Pt(),at))})),Mr},[ir,mt,Lt,xt,jt,At,st,$,Pt,Ct,_,at,it,nt]),Zt=reactExports.useCallback((pr={},Cr=null)=>Tt({...pr,style:{visibility:Ct?"visible":"hidden",...pr.style}},Cr),[Ct,Tt]),Kt=reactExports.useCallback((pr,Cr=null)=>({...pr,ref:mergeRefs(Cr,Bt,Rt)}),[Bt,Rt]),Qt=reactExports.useRef(),Ht=reactExports.useRef(),qt=reactExports.useCallback(pr=>{Bt.current==null&&Rt(pr)},[Rt]),Jt=reactExports.useCallback((pr={},Cr=null)=>{const Mr={...pr,ref:mergeRefs(Dt,Cr,qt),id:dt,"aria-haspopup":"dialog","aria-expanded":Ct,"aria-controls":mt};return st===TRIGGER.click&&(Mr.onClick=callAllHandlers$1(pr.onClick,Mt)),st===TRIGGER.hover&&(Mr.onFocus=callAllHandlers$1(pr.onFocus,()=>{Qt.current===void 0&&$t()}),Mr.onBlur=callAllHandlers$1(pr.onBlur,lr=>{const fr=getRelatedTarget(lr),_r=!contains(zt.current,fr);Ct&&_&&_r&&Pt()}),Mr.onKeyDown=callAllHandlers$1(pr.onKeyDown,lr=>{lr.key==="Escape"&&Pt()}),Mr.onMouseEnter=callAllHandlers$1(pr.onMouseEnter,()=>{Ot.current=!0,Qt.current=window.setTimeout(()=>$t(),ot)}),Mr.onMouseLeave=callAllHandlers$1(pr.onMouseLeave,()=>{Ot.current=!1,Qt.current&&(clearTimeout(Qt.current),Qt.current=void 0),Ht.current=window.setTimeout(()=>{Ot.current===!1&&Pt()},at)})),Mr},[dt,Ct,mt,st,qt,Mt,$t,_,Pt,ot,at]);reactExports.useEffect(()=>()=>{Qt.current&&clearTimeout(Qt.current),Ht.current&&clearTimeout(Ht.current)},[]);const ur=reactExports.useCallback((pr={},Cr=null)=>({...pr,id:xt,ref:mergeRefs(Cr,Mr=>{Ft(!!Mr)})}),[xt]),xr=reactExports.useCallback((pr={},Cr=null)=>({...pr,id:At,ref:mergeRefs(Cr,Mr=>{bt(!!Mr)})}),[At]);return{forceUpdate:Nt,isOpen:Ct,onAnimationComplete:tr.onComplete,onClose:Pt,getAnchorProps:Kt,getArrowProps:St,getArrowInnerProps:Et,getPopoverPositionerProps:Zt,getPopoverProps:nr,getTriggerProps:Jt,getHeaderProps:ur,getBodyProps:xr}}function contains(a,_){return a===_||(a==null?void 0:a.contains(_))}function getRelatedTarget(a){var _;const $=a.currentTarget.ownerDocument.activeElement;return(_=a.relatedTarget)!=null?_:$}function Popover(a){const _=useMultiStyleConfig("Popover",a),{children:$,...j}=omitThemingProps(a),et=useTheme(),tt=usePopover({...j,direction:et.direction});return jsxRuntimeExports.jsx(PopoverProvider,{value:tt,children:jsxRuntimeExports.jsx(PopoverStylesProvider,{value:_,children:runIfFn$2($,{isOpen:tt.isOpen,onClose:tt.onClose,forceUpdate:tt.forceUpdate})})})}Popover.displayName="Popover";var resolveVar=(a,_)=>_?`${a}.${_}, ${_}`:void 0;function PopoverArrow(a){var _;const{bg:$,bgColor:j,backgroundColor:et,shadow:tt,boxShadow:rt,shadowColor:nt}=a,{getArrowProps:it,getArrowInnerProps:st}=usePopoverContext(),ot=usePopoverStyles(),at=(_=$??j)!=null?_:et,ut=tt??rt;return jsxRuntimeExports.jsx(chakra.div,{...it(),className:"chakra-popover__arrow-positioner",children:jsxRuntimeExports.jsx(chakra.div,{className:cx("chakra-popover__arrow",a.className),...st(a),__css:{"--popper-arrow-shadow-color":resolveVar("colors",nt),"--popper-arrow-bg":resolveVar("colors",at),"--popper-arrow-shadow":resolveVar("shadows",ut),...ot.arrow}})})}PopoverArrow.displayName="PopoverArrow";var PopoverBody=forwardRef(function(_,$){const{getBodyProps:j}=usePopoverContext(),et=usePopoverStyles();return jsxRuntimeExports.jsx(chakra.div,{...j(_,$),className:cx("chakra-popover__body",_.className),__css:et.body})});PopoverBody.displayName="PopoverBody";function mergeVariants(a){if(a)return{enter:{...a.enter,visibility:"visible"},exit:{...a.exit,transitionEnd:{visibility:"hidden"}}}}var scaleFade={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},MotionSection=chakra(motion.section),PopoverTransition=forwardRef(function(_,$){const{variants:j=scaleFade,...et}=_,{isOpen:tt}=usePopoverContext();return jsxRuntimeExports.jsx(MotionSection,{ref:$,variants:mergeVariants(j),initial:!1,animate:tt?"enter":"exit",...et})});PopoverTransition.displayName="PopoverTransition";var PopoverContent=forwardRef(function(_,$){const{rootProps:j,motionProps:et,...tt}=_,{getPopoverProps:rt,getPopoverPositionerProps:nt,onAnimationComplete:it}=usePopoverContext(),st=usePopoverStyles(),ot={position:"relative",display:"flex",flexDirection:"column",...st.content};return jsxRuntimeExports.jsx(chakra.div,{...nt(j),__css:st.popper,className:"chakra-popover__popper",children:jsxRuntimeExports.jsx(PopoverTransition,{...et,...rt(tt,$),onAnimationComplete:callAll(it,tt.onAnimationComplete),className:cx("chakra-popover__content",_.className),__css:ot})})});PopoverContent.displayName="PopoverContent";function isInputEvent(a){return a&&isObject$5(a)&&isObject$5(a.target)}function useRadioGroup(a={}){const{onChange:_,value:$,defaultValue:j,name:et,isDisabled:tt,isFocusable:rt,isNative:nt,...it}=a,[st,ot]=reactExports.useState(j||""),at=typeof $<"u",ut=at?$:st,ht=reactExports.useRef(null),yt=reactExports.useCallback(()=>{const Dt=ht.current;if(!Dt)return;let zt="input:not(:disabled):checked";const Ot=Dt.querySelector(zt);if(Ot){Ot.focus();return}zt="input:not(:disabled)";const It=Dt.querySelector(zt);It==null||It.focus()},[]),Ct=`radio-${reactExports.useId()}`,Pt=et||Ct,$t=reactExports.useCallback(Dt=>{const zt=isInputEvent(Dt)?Dt.target.value:Dt;at||ot(zt),_==null||_(String(zt))},[_,at]),Mt=reactExports.useCallback((Dt={},zt=null)=>({...Dt,ref:mergeRefs(zt,ht),role:"radiogroup"}),[]),Bt=reactExports.useCallback((Dt={},zt=null)=>({...Dt,ref:zt,name:Pt,[nt?"checked":"isChecked"]:ut!=null?Dt.value===ut:void 0,onChange(It){$t(It)},"data-radiogroup":!0}),[nt,Pt,$t,ut]);return{getRootProps:Mt,getRadioProps:Bt,name:Pt,ref:ht,focus:yt,setValue:ot,value:ut,onChange:$t,isDisabled:tt,isFocusable:rt,htmlProps:it}}var[RadioGroupProvider,useRadioGroupContext]=createContext$1({name:"RadioGroupContext",strict:!1}),RadioGroup=forwardRef((a,_)=>{const{colorScheme:$,size:j,variant:et,children:tt,className:rt,isDisabled:nt,isFocusable:it,...st}=a,{value:ot,onChange:at,getRootProps:ut,name:ht,htmlProps:yt}=useRadioGroup(st),wt=reactExports.useMemo(()=>({name:ht,size:j,onChange:at,colorScheme:$,value:ot,variant:et,isDisabled:nt,isFocusable:it}),[ht,j,at,$,ot,et,nt,it]);return jsxRuntimeExports.jsx(RadioGroupProvider,{value:wt,children:jsxRuntimeExports.jsx(chakra.div,{...ut(yt,_),className:cx("chakra-radio-group",rt),children:tt})})});RadioGroup.displayName="RadioGroup";var visuallyHiddenStyle={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function useRadio(a={}){const{defaultChecked:_,isChecked:$,isFocusable:j,isDisabled:et,isReadOnly:tt,isRequired:rt,onChange:nt,isInvalid:it,name:st,value:ot,id:at,"data-radiogroup":ut,"aria-describedby":ht,...yt}=a,wt=`radio-${reactExports.useId()}`,Ct=useFormControlContext(),$t=!!useRadioGroupContext()||!!ut;let Bt=!!Ct&&!$t?Ct.id:wt;Bt=at??Bt;const Dt=et??(Ct==null?void 0:Ct.isDisabled),zt=tt??(Ct==null?void 0:Ct.isReadOnly),Ot=rt??(Ct==null?void 0:Ct.isRequired),It=it??(Ct==null?void 0:Ct.isInvalid),[Lt,Ft]=reactExports.useState(!1),[jt,bt]=reactExports.useState(!1),[vt,ct]=reactExports.useState(!1),[dt,mt]=reactExports.useState(!1),[xt,At]=reactExports.useState(!!_),Rt=typeof $<"u",St=Rt?$:xt;reactExports.useEffect(()=>trackFocusVisible(Ft),[]);const Tt=reactExports.useCallback(qt=>{if(zt||Dt){qt.preventDefault();return}Rt||At(qt.target.checked),nt==null||nt(qt)},[Rt,Dt,zt,nt]),Et=reactExports.useCallback(qt=>{qt.key===" "&&mt(!0)},[mt]),Nt=reactExports.useCallback(qt=>{qt.key===" "&&mt(!1)},[mt]),tr=reactExports.useCallback((qt={},Jt=null)=>({...qt,ref:Jt,"data-active":dataAttr(dt),"data-hover":dataAttr(vt),"data-disabled":dataAttr(Dt),"data-invalid":dataAttr(It),"data-checked":dataAttr(St),"data-focus":dataAttr(jt),"data-focus-visible":dataAttr(jt&&Lt),"data-readonly":dataAttr(zt),"aria-hidden":!0,onMouseDown:callAllHandlers$1(qt.onMouseDown,()=>mt(!0)),onMouseUp:callAllHandlers$1(qt.onMouseUp,()=>mt(!1)),onMouseEnter:callAllHandlers$1(qt.onMouseEnter,()=>ct(!0)),onMouseLeave:callAllHandlers$1(qt.onMouseLeave,()=>ct(!1))}),[dt,vt,Dt,It,St,jt,zt,Lt]),{onFocus:ir,onBlur:nr}=Ct??{},Zt=reactExports.useCallback((qt={},Jt=null)=>{const ur=Dt&&!j;return{...qt,id:Bt,ref:Jt,type:"radio",name:st,value:ot,onChange:callAllHandlers$1(qt.onChange,Tt),onBlur:callAllHandlers$1(nr,qt.onBlur,()=>bt(!1)),onFocus:callAllHandlers$1(ir,qt.onFocus,()=>bt(!0)),onKeyDown:callAllHandlers$1(qt.onKeyDown,Et),onKeyUp:callAllHandlers$1(qt.onKeyUp,Nt),checked:St,disabled:ur,readOnly:zt,required:Ot,"aria-invalid":ariaAttr(It),"aria-disabled":ariaAttr(ur),"aria-required":ariaAttr(Ot),"data-readonly":dataAttr(zt),"aria-describedby":ht,style:visuallyHiddenStyle}},[Dt,j,Bt,st,ot,Tt,nr,ir,Et,Nt,St,zt,Ot,It,ht]);return{state:{isInvalid:It,isFocused:jt,isChecked:St,isActive:dt,isHovered:vt,isDisabled:Dt,isReadOnly:zt,isRequired:Ot},getCheckboxProps:tr,getRadioProps:tr,getInputProps:Zt,getLabelProps:(qt={},Jt=null)=>({...qt,ref:Jt,onMouseDown:callAllHandlers$1(qt.onMouseDown,stopEvent),"data-disabled":dataAttr(Dt),"data-checked":dataAttr(St),"data-invalid":dataAttr(It)}),getRootProps:(qt,Jt=null)=>({...qt,ref:Jt,"data-disabled":dataAttr(Dt),"data-checked":dataAttr(St),"data-invalid":dataAttr(It)}),htmlProps:yt}}function stopEvent(a){a.preventDefault(),a.stopPropagation()}function split$1(a,_){const $={},j={};for(const[et,tt]of Object.entries(a))_.includes(et)?$[et]=tt:j[et]=tt;return[$,j]}var Radio=forwardRef((a,_)=>{var $;const j=useRadioGroupContext(),{onChange:et,value:tt}=a,rt=useMultiStyleConfig("Radio",{...j,...a}),nt=omitThemingProps(a),{spacing:it="0.5rem",children:st,isDisabled:ot=j==null?void 0:j.isDisabled,isFocusable:at=j==null?void 0:j.isFocusable,inputProps:ut,...ht}=nt;let yt=a.isChecked;(j==null?void 0:j.value)!=null&&tt!=null&&(yt=j.value===tt);let wt=et;j!=null&&j.onChange&&tt!=null&&(wt=callAll(j.onChange,et));const Ct=($=a==null?void 0:a.name)!=null?$:j==null?void 0:j.name,{getInputProps:Pt,getCheckboxProps:$t,getLabelProps:Mt,getRootProps:Bt,htmlProps:Dt}=useRadio({...ht,isChecked:yt,isFocusable:at,isDisabled:ot,onChange:wt,name:Ct}),[zt,Ot]=split$1(Dt,layoutPropNames),It=$t(Ot),Lt=Pt(ut,_),Ft=Mt(),jt=Object.assign({},zt,Bt()),bt={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...rt.container},vt={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...rt.control},ct={userSelect:"none",marginStart:it,...rt.label};return jsxRuntimeExports.jsxs(chakra.label,{className:"chakra-radio",...jt,__css:bt,children:[jsxRuntimeExports.jsx("input",{className:"chakra-radio__input",...Lt}),jsxRuntimeExports.jsx(chakra.span,{className:"chakra-radio__control",...It,__css:vt}),st&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-radio__label",...Ft,__css:ct,children:st})]})});Radio.displayName="Radio";var SelectField=forwardRef(function(_,$){const{children:j,placeholder:et,className:tt,...rt}=_;return jsxRuntimeExports.jsxs(chakra.select,{...rt,ref:$,className:cx("chakra-select",tt),children:[et&&jsxRuntimeExports.jsx("option",{value:"",children:et}),j]})});SelectField.displayName="SelectField";function split(a,_){const $={},j={};for(const[et,tt]of Object.entries(a))_.includes(et)?$[et]=tt:j[et]=tt;return[$,j]}var Select$1=forwardRef((a,_)=>{var $;const j=useMultiStyleConfig("Select",a),{rootProps:et,placeholder:tt,icon:rt,color:nt,height:it,h:st,minH:ot,minHeight:at,iconColor:ut,iconSize:ht,...yt}=omitThemingProps(a),[wt,Ct]=split(yt,layoutPropNames),Pt=useFormControl(Ct),$t={width:"100%",height:"fit-content",position:"relative",color:nt},Mt={paddingEnd:"2rem",...j.field,_focus:{zIndex:"unset",...($=j.field)==null?void 0:$._focus}};return jsxRuntimeExports.jsxs(chakra.div,{className:"chakra-select__wrapper",__css:$t,...wt,...et,children:[jsxRuntimeExports.jsx(SelectField,{ref:_,height:st??it,minH:ot??at,placeholder:tt,...Pt,__css:Mt,children:a.children}),jsxRuntimeExports.jsx(SelectIcon,{"data-disabled":dataAttr(Pt.disabled),...(ut||nt)&&{color:ut||nt},__css:j.icon,...ht&&{fontSize:ht},children:rt})]})});Select$1.displayName="Select";var DefaultIcon=a=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",...a,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),IconWrapper=chakra("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),SelectIcon=a=>{const{children:_=jsxRuntimeExports.jsx(DefaultIcon,{}),...$}=a,j=reactExports.cloneElement(_,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return jsxRuntimeExports.jsx(IconWrapper,{...$,className:"chakra-select__icon-wrapper",children:reactExports.isValidElement(_)?j:null})};SelectIcon.displayName="SelectIcon";var Switch=forwardRef(function(_,$){const j=useMultiStyleConfig("Switch",_),{spacing:et="0.5rem",children:tt,...rt}=omitThemingProps(_),{getIndicatorProps:nt,getInputProps:it,getCheckboxProps:st,getRootProps:ot,getLabelProps:at}=useCheckbox(rt),ut=reactExports.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...j.container}),[j.container]),ht=reactExports.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...j.track}),[j.track]),yt=reactExports.useMemo(()=>({userSelect:"none",marginStart:et,...j.label}),[et,j.label]);return jsxRuntimeExports.jsxs(chakra.label,{...ot(),className:cx("chakra-switch",_.className),__css:ut,children:[jsxRuntimeExports.jsx("input",{className:"chakra-switch__input",...it({},$)}),jsxRuntimeExports.jsx(chakra.span,{...st(),className:"chakra-switch__track",__css:ht,children:jsxRuntimeExports.jsx(chakra.span,{__css:j.thumb,className:"chakra-switch__thumb",...nt()})}),tt&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-switch__label",...at(),__css:yt,children:tt})]})});Switch.displayName="Switch";var[TableStylesProvider,useTableStyles]=createContext$1({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Table=forwardRef((a,_)=>{const $=useMultiStyleConfig("Table",a),{className:j,layout:et,...tt}=omitThemingProps(a);return jsxRuntimeExports.jsx(TableStylesProvider,{value:$,children:jsxRuntimeExports.jsx(chakra.table,{ref:_,__css:{tableLayout:et,...$.table},className:cx("chakra-table",j),...tt})})});Table.displayName="Table";var Tr=forwardRef((a,_)=>{const $=useTableStyles();return jsxRuntimeExports.jsx(chakra.tr,{...a,ref:_,__css:$.tr})}),TableContainer=forwardRef((a,_)=>{var $;const{overflow:j,overflowX:et,className:tt,...rt}=a;return jsxRuntimeExports.jsx(chakra.div,{ref:_,className:cx("chakra-table__container",tt),...rt,__css:{display:"block",whiteSpace:"nowrap",WebkitOverflowScrolling:"touch",overflowX:($=j??et)!=null?$:"auto",overflowY:"hidden",maxWidth:"100%"}})}),Tbody=forwardRef((a,_)=>{const $=useTableStyles();return jsxRuntimeExports.jsx(chakra.tbody,{...a,ref:_,__css:$.tbody})}),Td=forwardRef(({isNumeric:a,..._},$)=>{const j=useTableStyles();return jsxRuntimeExports.jsx(chakra.td,{..._,ref:$,__css:j.td,"data-is-numeric":a})}),[TabsDescendantsProvider,useTabsDescendantsContext,useTabsDescendants,useTabsDescendant]=createDescendantContext();function useTabs(a){var _;const{defaultIndex:$,onChange:j,index:et,isManual:tt,isLazy:rt,lazyBehavior:nt="unmount",orientation:it="horizontal",direction:st="ltr",...ot}=a,[at,ut]=reactExports.useState($??0),[ht,yt]=useControllableState({defaultValue:$??0,value:et,onChange:j});reactExports.useEffect(()=>{et!=null&&ut(et)},[et]);const wt=useTabsDescendants(),Ct=reactExports.useId();return{id:`tabs-${(_=a.id)!=null?_:Ct}`,selectedIndex:ht,focusedIndex:at,setSelectedIndex:yt,setFocusedIndex:ut,isManual:tt,isLazy:rt,lazyBehavior:nt,orientation:it,descendants:wt,direction:st,htmlProps:ot}}var[TabsProvider,useTabsContext]=createContext$1({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function useTabList(a){const{focusedIndex:_,orientation:$,direction:j}=useTabsContext(),et=useTabsDescendantsContext(),tt=reactExports.useCallback(rt=>{const nt=()=>{var $t;const Mt=et.nextEnabled(_);Mt&&(($t=Mt.node)==null||$t.focus())},it=()=>{var $t;const Mt=et.prevEnabled(_);Mt&&(($t=Mt.node)==null||$t.focus())},st=()=>{var $t;const Mt=et.firstEnabled();Mt&&(($t=Mt.node)==null||$t.focus())},ot=()=>{var $t;const Mt=et.lastEnabled();Mt&&(($t=Mt.node)==null||$t.focus())},at=$==="horizontal",ut=$==="vertical",ht=rt.key,yt=j==="ltr"?"ArrowLeft":"ArrowRight",wt=j==="ltr"?"ArrowRight":"ArrowLeft",Pt={[yt]:()=>at&&it(),[wt]:()=>at&&nt(),ArrowDown:()=>ut&&nt(),ArrowUp:()=>ut&&it(),Home:st,End:ot}[ht];Pt&&(rt.preventDefault(),Pt(rt))},[et,_,$,j]);return{...a,role:"tablist","aria-orientation":$,onKeyDown:callAllHandlers$1(a.onKeyDown,tt)}}function useTab(a){const{isDisabled:_=!1,isFocusable:$=!1,...j}=a,{setSelectedIndex:et,isManual:tt,id:rt,setFocusedIndex:nt,selectedIndex:it}=useTabsContext(),{index:st,register:ot}=useTabsDescendant({disabled:_&&!$}),at=st===it,ut=()=>{et(st)},ht=()=>{nt(st),!tt&&!(_&&$)&&et(st)};return{...useClickable({...j,ref:mergeRefs(ot,a.ref),isDisabled:_,isFocusable:$,onClick:callAllHandlers$1(a.onClick,ut)}),id:makeTabId(rt,st),role:"tab",tabIndex:at?0:-1,type:"button","aria-selected":at,"aria-controls":makeTabPanelId(rt,st),onFocus:_?void 0:callAllHandlers$1(a.onFocus,ht)}}var[TabPanelProvider,useTabPanelContext]=createContext$1({});function useTabPanels(a){const _=useTabsContext(),{id:$,selectedIndex:j}=_,tt=getValidChildren(a.children).map((rt,nt)=>reactExports.createElement(TabPanelProvider,{key:nt,value:{isSelected:nt===j,id:makeTabPanelId($,nt),tabId:makeTabId($,nt),selectedIndex:j}},rt));return{...a,children:tt}}function useTabPanel(a){const{children:_,...$}=a,{isLazy:j,lazyBehavior:et}=useTabsContext(),{isSelected:tt,id:rt,tabId:nt}=useTabPanelContext(),it=reactExports.useRef(!1);tt&&(it.current=!0);const st=lazyDisclosure({wasSelected:it.current,isSelected:tt,enabled:j,mode:et});return{tabIndex:0,...$,children:st?_:null,role:"tabpanel","aria-labelledby":nt,hidden:!tt,id:rt}}function makeTabId(a,_){return`${a}--tab-${_}`}function makeTabPanelId(a,_){return`${a}--tabpanel-${_}`}var[TabsStylesProvider,useTabsStyles]=createContext$1({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Tabs=forwardRef(function(_,$){const j=useMultiStyleConfig("Tabs",_),{children:et,className:tt,...rt}=omitThemingProps(_),{htmlProps:nt,descendants:it,...st}=useTabs(rt),ot=reactExports.useMemo(()=>st,[st]),{isFitted:at,...ut}=nt,ht={position:"relative",...j.root};return jsxRuntimeExports.jsx(TabsDescendantsProvider,{value:it,children:jsxRuntimeExports.jsx(TabsProvider,{value:ot,children:jsxRuntimeExports.jsx(TabsStylesProvider,{value:j,children:jsxRuntimeExports.jsx(chakra.div,{className:cx("chakra-tabs",tt),ref:$,...ut,__css:ht,children:et})})})})});Tabs.displayName="Tabs";var TabList=forwardRef(function(_,$){const j=useTabList({..._,ref:$}),tt={display:"flex",...useTabsStyles().tablist};return jsxRuntimeExports.jsx(chakra.div,{...j,className:cx("chakra-tabs__tablist",_.className),__css:tt})});TabList.displayName="TabList";var TabPanel=forwardRef(function(_,$){const j=useTabPanel({..._,ref:$}),et=useTabsStyles();return jsxRuntimeExports.jsx(chakra.div,{outline:"0",...j,className:cx("chakra-tabs__tab-panel",_.className),__css:et.tabpanel})});TabPanel.displayName="TabPanel";var TabPanels=forwardRef(function(_,$){const j=useTabPanels(_),et=useTabsStyles();return jsxRuntimeExports.jsx(chakra.div,{...j,width:"100%",ref:$,className:cx("chakra-tabs__tab-panels",_.className),__css:et.tabpanels})});TabPanels.displayName="TabPanels";var Tab=forwardRef(function(_,$){const j=useTabsStyles(),et=useTab({..._,ref:$}),tt={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...j.tab};return jsxRuntimeExports.jsx(chakra.button,{...et,className:cx("chakra-tabs__tab",_.className),__css:tt})});Tab.displayName="Tab";function omit$2(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}var omitted=["h","minH","height","minHeight"],Textarea=forwardRef((a,_)=>{const $=useStyleConfig("Textarea",a),{className:j,rows:et,...tt}=omitThemingProps(a),rt=useFormControl(tt),nt=et?omit$2($,omitted):$;return jsxRuntimeExports.jsx(chakra.textarea,{ref:_,rows:et,...rt,className:cx("chakra-textarea",j),__css:nt})});Textarea.displayName="Textarea";var scale={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},getDoc=a=>{var _;return((_=a.current)==null?void 0:_.ownerDocument)||document},getWin=a=>{var _,$;return(($=(_=a.current)==null?void 0:_.ownerDocument)==null?void 0:$.defaultView)||window};function useTooltip(a={}){const{openDelay:_=0,closeDelay:$=0,closeOnClick:j=!0,closeOnMouseDown:et,closeOnScroll:tt,closeOnPointerDown:rt=et,closeOnEsc:nt=!0,onOpen:it,onClose:st,placement:ot,id:at,isOpen:ut,defaultIsOpen:ht,arrowSize:yt=10,arrowShadowColor:wt,arrowPadding:Ct,modifiers:Pt,isDisabled:$t,gutter:Mt,offset:Bt,direction:Dt,...zt}=a,{isOpen:Ot,onOpen:It,onClose:Lt}=useDisclosure({isOpen:ut,defaultIsOpen:ht,onOpen:it,onClose:st}),{referenceRef:Ft,getPopperProps:jt,getArrowInnerProps:bt,getArrowProps:vt}=usePopper({enabled:Ot,placement:ot,arrowPadding:Ct,modifiers:Pt,gutter:Mt,offset:Bt,direction:Dt}),ct=reactExports.useId(),mt=`tooltip-${at??ct}`,xt=reactExports.useRef(null),At=reactExports.useRef(),Rt=reactExports.useCallback(()=>{At.current&&(clearTimeout(At.current),At.current=void 0)},[]),St=reactExports.useRef(),Tt=reactExports.useCallback(()=>{St.current&&(clearTimeout(St.current),St.current=void 0)},[]),Et=reactExports.useCallback(()=>{Tt(),Lt()},[Lt,Tt]),Nt=useCloseEvent(xt,Et),tr=reactExports.useCallback(()=>{if(!$t&&!At.current){Ot&&Nt();const Jt=getWin(xt);At.current=Jt.setTimeout(It,_)}},[Nt,$t,Ot,It,_]),ir=reactExports.useCallback(()=>{Rt();const Jt=getWin(xt);St.current=Jt.setTimeout(Et,$)},[$,Et,Rt]),nr=reactExports.useCallback(()=>{Ot&&j&&ir()},[j,ir,Ot]),Zt=reactExports.useCallback(()=>{Ot&&rt&&ir()},[rt,ir,Ot]),Kt=reactExports.useCallback(Jt=>{Ot&&Jt.key==="Escape"&&ir()},[Ot,ir]);useEventListener(()=>getDoc(xt),"keydown",nt?Kt:void 0),useEventListener(()=>{if(!tt)return null;const Jt=xt.current;if(!Jt)return null;const ur=getScrollParent$1(Jt);return ur.localName==="body"?getWin(xt):ur},"scroll",()=>{Ot&&tt&&Et()},{passive:!0,capture:!0}),reactExports.useEffect(()=>{$t&&(Rt(),Ot&&Lt())},[$t,Ot,Lt,Rt]),reactExports.useEffect(()=>()=>{Rt(),Tt()},[Rt,Tt]),useEventListener(()=>xt.current,"pointerleave",ir);const Qt=reactExports.useCallback((Jt={},ur=null)=>({...Jt,ref:mergeRefs(xt,ur,Ft),onPointerEnter:callAllHandlers$1(Jt.onPointerEnter,pr=>{pr.pointerType!=="touch"&&tr()}),onClick:callAllHandlers$1(Jt.onClick,nr),onPointerDown:callAllHandlers$1(Jt.onPointerDown,Zt),onFocus:callAllHandlers$1(Jt.onFocus,tr),onBlur:callAllHandlers$1(Jt.onBlur,ir),"aria-describedby":Ot?mt:void 0}),[tr,ir,Zt,Ot,mt,nr,Ft]),Ht=reactExports.useCallback((Jt={},ur=null)=>jt({...Jt,style:{...Jt.style,[cssVars.arrowSize.var]:yt?`${yt}px`:void 0,[cssVars.arrowShadowColor.var]:wt}},ur),[jt,yt,wt]),qt=reactExports.useCallback((Jt={},ur=null)=>{const xr={...Jt.style,position:"relative",transformOrigin:cssVars.transformOrigin.varRef};return{ref:ur,...zt,...Jt,id:mt,role:"tooltip",style:xr}},[zt,mt]);return{isOpen:Ot,show:tr,hide:ir,getTriggerProps:Qt,getTooltipProps:qt,getTooltipPositionerProps:Ht,getArrowProps:vt,getArrowInnerProps:bt}}var closeEventName="chakra-ui:close-tooltip";function useCloseEvent(a,_){return reactExports.useEffect(()=>{const $=getDoc(a);return $.addEventListener(closeEventName,_),()=>$.removeEventListener(closeEventName,_)},[_,a]),()=>{const $=getDoc(a),j=getWin(a);$.dispatchEvent(new j.CustomEvent(closeEventName))}}function omit$1(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}function pick$1(a,_){const $={};for(const j of _)j in a&&($[j]=a[j]);return $}var MotionDiv=chakra(motion.div),Tooltip=forwardRef((a,_)=>{var $,j;const et=useStyleConfig("Tooltip",a),tt=omitThemingProps(a),rt=useTheme(),{children:nt,label:it,shouldWrapChildren:st,"aria-label":ot,hasArrow:at,bg:ut,portalProps:ht,background:yt,backgroundColor:wt,bgColor:Ct,motionProps:Pt,...$t}=tt,Mt=(j=($=yt??wt)!=null?$:ut)!=null?j:Ct;if(Mt){et.bg=Mt;const jt=getCSSVar(rt,"colors",Mt);et[cssVars.arrowBg.var]=jt}const Bt=useTooltip({...$t,direction:rt.direction}),Dt=typeof nt=="string"||st;let zt;if(Dt)zt=jsxRuntimeExports.jsx(chakra.span,{display:"inline-block",tabIndex:0,...Bt.getTriggerProps(),children:nt});else{const jt=reactExports.Children.only(nt);zt=reactExports.cloneElement(jt,Bt.getTriggerProps(jt.props,jt.ref))}const Ot=!!ot,It=Bt.getTooltipProps({},_),Lt=Ot?omit$1(It,["role","id"]):It,Ft=pick$1(It,["role","id"]);return it?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[zt,jsxRuntimeExports.jsx(AnimatePresence,{children:Bt.isOpen&&jsxRuntimeExports.jsx(Portal,{...ht,children:jsxRuntimeExports.jsx(chakra.div,{...Bt.getTooltipPositionerProps(),__css:{zIndex:et.zIndex,pointerEvents:"none"},children:jsxRuntimeExports.jsxs(MotionDiv,{variants:scale,initial:"exit",animate:"enter",exit:"exit",...Pt,...Lt,__css:et,children:[it,Ot&&jsxRuntimeExports.jsx(chakra.span,{srOnly:!0,...Ft,children:ot}),at&&jsxRuntimeExports.jsx(chakra.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:jsxRuntimeExports.jsx(chakra.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:et.bg}})})]})})})})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:nt})});Tooltip.displayName="Tooltip";var lodash={exports:{}};/** +`)},idCounter$1=0,lockStack$1=[];function RemoveScrollSideCar$1(a){var _=reactExports.useRef([]),$=reactExports.useRef([0,0]),j=reactExports.useRef(),et=reactExports.useState(idCounter$1++)[0],tt=reactExports.useState(styleSingleton)[0],rt=reactExports.useRef(a);reactExports.useEffect(function(){rt.current=a},[a]),reactExports.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(et));var wt=__spreadArray([a.lockRef.current],(a.shards||[]).map(extractRef$1),!0).filter(Boolean);return wt.forEach(function(Ct){return Ct.classList.add("allow-interactivity-".concat(et))}),function(){document.body.classList.remove("block-interactivity-".concat(et)),wt.forEach(function(Ct){return Ct.classList.remove("allow-interactivity-".concat(et))})}}},[a.inert,a.lockRef.current,a.shards]);var nt=reactExports.useCallback(function(wt,Ct){if("touches"in wt&&wt.touches.length===2)return!rt.current.allowPinchZoom;var Pt=getTouchXY$1(wt),$t=$.current,Mt="deltaX"in wt?wt.deltaX:$t[0]-Pt[0],Bt="deltaY"in wt?wt.deltaY:$t[1]-Pt[1],Dt,zt=wt.target,Ot=Math.abs(Mt)>Math.abs(Bt)?"h":"v";if("touches"in wt&&Ot==="h"&&zt.type==="range")return!1;var It=locationCouldBeScrolled$1(Ot,zt);if(!It)return!0;if(It?Dt=Ot:(Dt=Ot==="v"?"h":"v",It=locationCouldBeScrolled$1(Ot,zt)),!It)return!1;if(!j.current&&"changedTouches"in wt&&(Mt||Bt)&&(j.current=Dt),!Dt)return!0;var Lt=j.current||Dt;return handleScroll$1(Lt,Ct,wt,Lt==="h"?Mt:Bt,!0)},[]),it=reactExports.useCallback(function(wt){var Ct=wt;if(!(!lockStack$1.length||lockStack$1[lockStack$1.length-1]!==tt)){var Pt="deltaY"in Ct?getDeltaXY$1(Ct):getTouchXY$1(Ct),$t=_.current.filter(function(Dt){return Dt.name===Ct.type&&(Dt.target===Ct.target||Ct.target===Dt.shadowParent)&&deltaCompare$1(Dt.delta,Pt)})[0];if($t&&$t.should){Ct.cancelable&&Ct.preventDefault();return}if(!$t){var Mt=(rt.current.shards||[]).map(extractRef$1).filter(Boolean).filter(function(Dt){return Dt.contains(Ct.target)}),Bt=Mt.length>0?nt(Ct,Mt[0]):!rt.current.noIsolation;Bt&&Ct.cancelable&&Ct.preventDefault()}}},[]),st=reactExports.useCallback(function(wt,Ct,Pt,$t){var Mt={name:wt,delta:Ct,target:Pt,should:$t,shadowParent:getOutermostShadowParent$1(Pt)};_.current.push(Mt),setTimeout(function(){_.current=_.current.filter(function(Bt){return Bt!==Mt})},1)},[]),ot=reactExports.useCallback(function(wt){$.current=getTouchXY$1(wt),j.current=void 0},[]),at=reactExports.useCallback(function(wt){st(wt.type,getDeltaXY$1(wt),wt.target,nt(wt,a.lockRef.current))},[]),ut=reactExports.useCallback(function(wt){st(wt.type,getTouchXY$1(wt),wt.target,nt(wt,a.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack$1.push(tt),a.setCallbacks({onScrollCapture:at,onWheelCapture:at,onTouchMoveCapture:ut}),document.addEventListener("wheel",it,nonPassive$1),document.addEventListener("touchmove",it,nonPassive$1),document.addEventListener("touchstart",ot,nonPassive$1),function(){lockStack$1=lockStack$1.filter(function(wt){return wt!==tt}),document.removeEventListener("wheel",it,nonPassive$1),document.removeEventListener("touchmove",it,nonPassive$1),document.removeEventListener("touchstart",ot,nonPassive$1)}},[]);var ht=a.removeScrollBar,yt=a.inert;return reactExports.createElement(reactExports.Fragment,null,yt?reactExports.createElement(tt,{styles:generateStyle$1(et)}):null,ht?reactExports.createElement(RemoveScrollBar$1,{gapMode:a.gapMode}):null)}function getOutermostShadowParent$1(a){for(var _=null;a!==null;)a instanceof ShadowRoot&&(_=a.host,a=a.host),a=a.parentNode;return _}const SideCar$1=exportSidecar(effectCar$1,RemoveScrollSideCar$1);var ReactRemoveScroll$1=reactExports.forwardRef(function(a,_){return reactExports.createElement(RemoveScroll$1,__assign({},a,{ref:_,sideCar:SideCar$1}))});ReactRemoveScroll$1.classNames=RemoveScroll$1.classNames;function ModalFocusScope(a){const{autoFocus:_,trapFocus:$,dialogRef:j,initialFocusRef:et,blockScrollOnMount:tt,allowPinchZoom:rt,finalFocusRef:nt,returnFocusOnClose:it,preserveScrollBarGap:st,lockFocusAcrossFrames:ot,isOpen:at}=useModalContext(),[ut,ht]=usePresence();reactExports.useEffect(()=>{!ut&&ht&&setTimeout(ht)},[ut,ht]);const yt=useModalManager(j,at);return jsxRuntimeExports.jsx(FocusLock,{autoFocus:_,isDisabled:!$,initialFocusRef:et,finalFocusRef:nt,restoreFocus:it,contentRef:j,lockFocusAcrossFrames:ot,children:jsxRuntimeExports.jsx(ReactRemoveScroll$1,{removeScrollBar:!st,allowPinchZoom:rt,enabled:yt===1&&tt,forwardProps:!0,children:a.children})})}var ModalContent=forwardRef((a,_)=>{const{className:$,children:j,containerProps:et,motionProps:tt,...rt}=a,{getDialogProps:nt,getDialogContainerProps:it}=useModalContext(),st=nt(rt,_),ot=it(et),at=cx("chakra-modal__content",$),ut=useModalStyles(),ht={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...ut.dialog},yt={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...ut.dialogContainer},{motionPreset:wt}=useModalContext();return jsxRuntimeExports.jsx(ModalFocusScope,{children:jsxRuntimeExports.jsx(chakra.div,{...ot,className:"chakra-modal__content-container",tabIndex:-1,__css:yt,children:jsxRuntimeExports.jsx(ModalTransition,{preset:wt,motionProps:tt,className:at,...st,__css:ht,children:j})})})});ModalContent.displayName="ModalContent";var[DrawerContextProvider,useDrawerContext]=createContext$1(),placementMap={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function getDrawerPlacement(a,_){var $,j;if(a)return(j=($=placementMap[a])==null?void 0:$[_])!=null?j:a}function Drawer(a){var _;const{isOpen:$,onClose:j,placement:et="right",children:tt,...rt}=a,nt=useTheme(),it=(_=nt.components)==null?void 0:_.Drawer,st=getDrawerPlacement(et,nt.direction);return jsxRuntimeExports.jsx(DrawerContextProvider,{value:{placement:st},children:jsxRuntimeExports.jsx(Modal,{isOpen:$,onClose:j,styleConfig:it,...rt,children:tt})})}var MotionDiv$2=chakra(Slide),DrawerContent=forwardRef((a,_)=>{const{className:$,children:j,motionProps:et,containerProps:tt,...rt}=a,{getDialogProps:nt,getDialogContainerProps:it,isOpen:st}=useModalContext(),ot=nt(rt,_),at=it(tt),ut=cx("chakra-modal__content",$),ht=useModalStyles(),yt={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...ht.dialog},wt={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...ht.dialogContainer},{placement:Ct}=useDrawerContext();return jsxRuntimeExports.jsx(ModalFocusScope,{children:jsxRuntimeExports.jsx(chakra.div,{...at,className:"chakra-modal__content-container",__css:wt,children:jsxRuntimeExports.jsx(MotionDiv$2,{motionProps:et,direction:Ct,in:st,className:ut,...ot,__css:yt,children:j})})})});DrawerContent.displayName="DrawerContent";var ModalFooter=forwardRef((a,_)=>{const{className:$,...j}=a,et=cx("chakra-modal__footer",$),rt={display:"flex",alignItems:"center",justifyContent:"flex-end",...useModalStyles().footer};return jsxRuntimeExports.jsx(chakra.footer,{ref:_,...j,__css:rt,className:et})});ModalFooter.displayName="ModalFooter";var ModalHeader=forwardRef((a,_)=>{const{className:$,...j}=a,{headerId:et,setHeaderMounted:tt}=useModalContext();reactExports.useEffect(()=>(tt(!0),()=>tt(!1)),[tt]);const rt=cx("chakra-modal__header",$),it={flex:0,...useModalStyles().header};return jsxRuntimeExports.jsx(chakra.header,{ref:_,className:rt,id:et,...j,__css:it})});ModalHeader.displayName="ModalHeader";var MotionDiv$1=chakra(motion.div),ModalOverlay=forwardRef((a,_)=>{const{className:$,transition:j,motionProps:et,...tt}=a,rt=cx("chakra-modal__overlay",$),it={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...useModalStyles().overlay},{motionPreset:st}=useModalContext(),at=et||(st==="none"?{}:fadeConfig);return jsxRuntimeExports.jsx(MotionDiv$1,{...at,__css:it,ref:_,className:rt,...tt})});ModalOverlay.displayName="ModalOverlay";var ModalBody=forwardRef((a,_)=>{const{className:$,...j}=a,{bodyId:et,setBodyMounted:tt}=useModalContext();reactExports.useEffect(()=>(tt(!0),()=>tt(!1)),[tt]);const rt=cx("chakra-modal__body",$),nt=useModalStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:_,className:rt,id:et,...j,__css:nt.body})});ModalBody.displayName="ModalBody";var ModalCloseButton=forwardRef((a,_)=>{const{onClick:$,className:j,...et}=a,{onClose:tt}=useModalContext(),rt=cx("chakra-modal__close-btn",j),nt=useModalStyles();return jsxRuntimeExports.jsx(CloseButton,{ref:_,__css:nt.closeButton,className:rt,onClick:callAllHandlers$1($,it=>{it.stopPropagation(),tt()}),...et})});ModalCloseButton.displayName="ModalCloseButton";var[PopoverProvider,usePopoverContext]=createContext$1({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[PopoverStylesProvider,usePopoverStyles]=createContext$1({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `});function PopoverTrigger(a){const _=reactExports.Children.only(a.children),{getTriggerProps:$}=usePopoverContext();return reactExports.cloneElement(_,$(_.props,_.ref))}PopoverTrigger.displayName="PopoverTrigger";var TRIGGER={click:"click",hover:"hover"};function usePopover(a={}){const{closeOnBlur:_=!0,closeOnEsc:$=!0,initialFocusRef:j,id:et,returnFocusOnClose:tt=!0,autoFocus:rt=!0,arrowSize:nt,arrowShadowColor:it,trigger:st=TRIGGER.click,openDelay:ot=200,closeDelay:at=200,isLazy:ut,lazyBehavior:ht="unmount",computePositionOnMount:yt,...wt}=a,{isOpen:Ct,onClose:Pt,onOpen:$t,onToggle:Mt}=useDisclosure(a),Bt=reactExports.useRef(null),Dt=reactExports.useRef(null),zt=reactExports.useRef(null),Ot=reactExports.useRef(!1),It=reactExports.useRef(!1);Ct&&(It.current=!0);const[Lt,Ft]=reactExports.useState(!1),[jt,bt]=reactExports.useState(!1),vt=reactExports.useId(),ct=et??vt,[dt,mt,xt,At]=["popover-trigger","popover-content","popover-header","popover-body"].map(pr=>`${pr}-${ct}`),{referenceRef:Rt,getArrowProps:St,getPopperProps:Tt,getArrowInnerProps:Et,forceUpdate:Nt}=usePopper({...wt,enabled:Ct||!!yt}),tr=useAnimationState({isOpen:Ct,ref:zt});useFocusOnPointerDown({enabled:Ct,ref:Dt}),useFocusOnHide(zt,{focusRef:Dt,visible:Ct,shouldFocus:tt&&st===TRIGGER.click}),useFocusOnShow(zt,{focusRef:j,visible:Ct,shouldFocus:rt&&st===TRIGGER.click});const ir=lazyDisclosure({wasSelected:It.current,enabled:ut,mode:ht,isSelected:tr.present}),nr=reactExports.useCallback((pr={},Cr=null)=>{const Mr={...pr,style:{...pr.style,transformOrigin:cssVars.transformOrigin.varRef,[cssVars.arrowSize.var]:nt?`${nt}px`:void 0,[cssVars.arrowShadowColor.var]:it},ref:mergeRefs(zt,Cr),children:ir?pr.children:null,id:mt,tabIndex:-1,role:"dialog",onKeyDown:callAllHandlers$1(pr.onKeyDown,lr=>{$&&lr.key==="Escape"&&Pt()}),onBlur:callAllHandlers$1(pr.onBlur,lr=>{const fr=getRelatedTarget(lr),_r=contains(zt.current,fr),Sr=contains(Dt.current,fr);Ct&&_&&(!_r&&!Sr)&&Pt()}),"aria-labelledby":Lt?xt:void 0,"aria-describedby":jt?At:void 0};return st===TRIGGER.hover&&(Mr.role="tooltip",Mr.onMouseEnter=callAllHandlers$1(pr.onMouseEnter,()=>{Ot.current=!0}),Mr.onMouseLeave=callAllHandlers$1(pr.onMouseLeave,lr=>{lr.nativeEvent.relatedTarget!==null&&(Ot.current=!1,setTimeout(()=>Pt(),at))})),Mr},[ir,mt,Lt,xt,jt,At,st,$,Pt,Ct,_,at,it,nt]),Zt=reactExports.useCallback((pr={},Cr=null)=>Tt({...pr,style:{visibility:Ct?"visible":"hidden",...pr.style}},Cr),[Ct,Tt]),Kt=reactExports.useCallback((pr,Cr=null)=>({...pr,ref:mergeRefs(Cr,Bt,Rt)}),[Bt,Rt]),Qt=reactExports.useRef(),Ht=reactExports.useRef(),qt=reactExports.useCallback(pr=>{Bt.current==null&&Rt(pr)},[Rt]),Jt=reactExports.useCallback((pr={},Cr=null)=>{const Mr={...pr,ref:mergeRefs(Dt,Cr,qt),id:dt,"aria-haspopup":"dialog","aria-expanded":Ct,"aria-controls":mt};return st===TRIGGER.click&&(Mr.onClick=callAllHandlers$1(pr.onClick,Mt)),st===TRIGGER.hover&&(Mr.onFocus=callAllHandlers$1(pr.onFocus,()=>{Qt.current===void 0&&$t()}),Mr.onBlur=callAllHandlers$1(pr.onBlur,lr=>{const fr=getRelatedTarget(lr),_r=!contains(zt.current,fr);Ct&&_&&_r&&Pt()}),Mr.onKeyDown=callAllHandlers$1(pr.onKeyDown,lr=>{lr.key==="Escape"&&Pt()}),Mr.onMouseEnter=callAllHandlers$1(pr.onMouseEnter,()=>{Ot.current=!0,Qt.current=window.setTimeout(()=>$t(),ot)}),Mr.onMouseLeave=callAllHandlers$1(pr.onMouseLeave,()=>{Ot.current=!1,Qt.current&&(clearTimeout(Qt.current),Qt.current=void 0),Ht.current=window.setTimeout(()=>{Ot.current===!1&&Pt()},at)})),Mr},[dt,Ct,mt,st,qt,Mt,$t,_,Pt,ot,at]);reactExports.useEffect(()=>()=>{Qt.current&&clearTimeout(Qt.current),Ht.current&&clearTimeout(Ht.current)},[]);const ur=reactExports.useCallback((pr={},Cr=null)=>({...pr,id:xt,ref:mergeRefs(Cr,Mr=>{Ft(!!Mr)})}),[xt]),xr=reactExports.useCallback((pr={},Cr=null)=>({...pr,id:At,ref:mergeRefs(Cr,Mr=>{bt(!!Mr)})}),[At]);return{forceUpdate:Nt,isOpen:Ct,onAnimationComplete:tr.onComplete,onClose:Pt,getAnchorProps:Kt,getArrowProps:St,getArrowInnerProps:Et,getPopoverPositionerProps:Zt,getPopoverProps:nr,getTriggerProps:Jt,getHeaderProps:ur,getBodyProps:xr}}function contains(a,_){return a===_||(a==null?void 0:a.contains(_))}function getRelatedTarget(a){var _;const $=a.currentTarget.ownerDocument.activeElement;return(_=a.relatedTarget)!=null?_:$}function Popover(a){const _=useMultiStyleConfig("Popover",a),{children:$,...j}=omitThemingProps(a),et=useTheme(),tt=usePopover({...j,direction:et.direction});return jsxRuntimeExports.jsx(PopoverProvider,{value:tt,children:jsxRuntimeExports.jsx(PopoverStylesProvider,{value:_,children:runIfFn$2($,{isOpen:tt.isOpen,onClose:tt.onClose,forceUpdate:tt.forceUpdate})})})}Popover.displayName="Popover";var resolveVar=(a,_)=>_?`${a}.${_}, ${_}`:void 0;function PopoverArrow(a){var _;const{bg:$,bgColor:j,backgroundColor:et,shadow:tt,boxShadow:rt,shadowColor:nt}=a,{getArrowProps:it,getArrowInnerProps:st}=usePopoverContext(),ot=usePopoverStyles(),at=(_=$??j)!=null?_:et,ut=tt??rt;return jsxRuntimeExports.jsx(chakra.div,{...it(),className:"chakra-popover__arrow-positioner",children:jsxRuntimeExports.jsx(chakra.div,{className:cx("chakra-popover__arrow",a.className),...st(a),__css:{"--popper-arrow-shadow-color":resolveVar("colors",nt),"--popper-arrow-bg":resolveVar("colors",at),"--popper-arrow-shadow":resolveVar("shadows",ut),...ot.arrow}})})}PopoverArrow.displayName="PopoverArrow";var PopoverBody=forwardRef(function(_,$){const{getBodyProps:j}=usePopoverContext(),et=usePopoverStyles();return jsxRuntimeExports.jsx(chakra.div,{...j(_,$),className:cx("chakra-popover__body",_.className),__css:et.body})});PopoverBody.displayName="PopoverBody";function mergeVariants(a){if(a)return{enter:{...a.enter,visibility:"visible"},exit:{...a.exit,transitionEnd:{visibility:"hidden"}}}}var scaleFade={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},MotionSection=chakra(motion.section),PopoverTransition=forwardRef(function(_,$){const{variants:j=scaleFade,...et}=_,{isOpen:tt}=usePopoverContext();return jsxRuntimeExports.jsx(MotionSection,{ref:$,variants:mergeVariants(j),initial:!1,animate:tt?"enter":"exit",...et})});PopoverTransition.displayName="PopoverTransition";var PopoverContent=forwardRef(function(_,$){const{rootProps:j,motionProps:et,...tt}=_,{getPopoverProps:rt,getPopoverPositionerProps:nt,onAnimationComplete:it}=usePopoverContext(),st=usePopoverStyles(),ot={position:"relative",display:"flex",flexDirection:"column",...st.content};return jsxRuntimeExports.jsx(chakra.div,{...nt(j),__css:st.popper,className:"chakra-popover__popper",children:jsxRuntimeExports.jsx(PopoverTransition,{...et,...rt(tt,$),onAnimationComplete:callAll(it,tt.onAnimationComplete),className:cx("chakra-popover__content",_.className),__css:ot})})});PopoverContent.displayName="PopoverContent";function isInputEvent(a){return a&&isObject$5(a)&&isObject$5(a.target)}function useRadioGroup(a={}){const{onChange:_,value:$,defaultValue:j,name:et,isDisabled:tt,isFocusable:rt,isNative:nt,...it}=a,[st,ot]=reactExports.useState(j||""),at=typeof $<"u",ut=at?$:st,ht=reactExports.useRef(null),yt=reactExports.useCallback(()=>{const Dt=ht.current;if(!Dt)return;let zt="input:not(:disabled):checked";const Ot=Dt.querySelector(zt);if(Ot){Ot.focus();return}zt="input:not(:disabled)";const It=Dt.querySelector(zt);It==null||It.focus()},[]),Ct=`radio-${reactExports.useId()}`,Pt=et||Ct,$t=reactExports.useCallback(Dt=>{const zt=isInputEvent(Dt)?Dt.target.value:Dt;at||ot(zt),_==null||_(String(zt))},[_,at]),Mt=reactExports.useCallback((Dt={},zt=null)=>({...Dt,ref:mergeRefs(zt,ht),role:"radiogroup"}),[]),Bt=reactExports.useCallback((Dt={},zt=null)=>({...Dt,ref:zt,name:Pt,[nt?"checked":"isChecked"]:ut!=null?Dt.value===ut:void 0,onChange(It){$t(It)},"data-radiogroup":!0}),[nt,Pt,$t,ut]);return{getRootProps:Mt,getRadioProps:Bt,name:Pt,ref:ht,focus:yt,setValue:ot,value:ut,onChange:$t,isDisabled:tt,isFocusable:rt,htmlProps:it}}var[RadioGroupProvider,useRadioGroupContext]=createContext$1({name:"RadioGroupContext",strict:!1}),RadioGroup=forwardRef((a,_)=>{const{colorScheme:$,size:j,variant:et,children:tt,className:rt,isDisabled:nt,isFocusable:it,...st}=a,{value:ot,onChange:at,getRootProps:ut,name:ht,htmlProps:yt}=useRadioGroup(st),wt=reactExports.useMemo(()=>({name:ht,size:j,onChange:at,colorScheme:$,value:ot,variant:et,isDisabled:nt,isFocusable:it}),[ht,j,at,$,ot,et,nt,it]);return jsxRuntimeExports.jsx(RadioGroupProvider,{value:wt,children:jsxRuntimeExports.jsx(chakra.div,{...ut(yt,_),className:cx("chakra-radio-group",rt),children:tt})})});RadioGroup.displayName="RadioGroup";var visuallyHiddenStyle={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function useRadio(a={}){const{defaultChecked:_,isChecked:$,isFocusable:j,isDisabled:et,isReadOnly:tt,isRequired:rt,onChange:nt,isInvalid:it,name:st,value:ot,id:at,"data-radiogroup":ut,"aria-describedby":ht,...yt}=a,wt=`radio-${reactExports.useId()}`,Ct=useFormControlContext(),$t=!!useRadioGroupContext()||!!ut;let Bt=!!Ct&&!$t?Ct.id:wt;Bt=at??Bt;const Dt=et??(Ct==null?void 0:Ct.isDisabled),zt=tt??(Ct==null?void 0:Ct.isReadOnly),Ot=rt??(Ct==null?void 0:Ct.isRequired),It=it??(Ct==null?void 0:Ct.isInvalid),[Lt,Ft]=reactExports.useState(!1),[jt,bt]=reactExports.useState(!1),[vt,ct]=reactExports.useState(!1),[dt,mt]=reactExports.useState(!1),[xt,At]=reactExports.useState(!!_),Rt=typeof $<"u",St=Rt?$:xt;reactExports.useEffect(()=>trackFocusVisible(Ft),[]);const Tt=reactExports.useCallback(qt=>{if(zt||Dt){qt.preventDefault();return}Rt||At(qt.target.checked),nt==null||nt(qt)},[Rt,Dt,zt,nt]),Et=reactExports.useCallback(qt=>{qt.key===" "&&mt(!0)},[mt]),Nt=reactExports.useCallback(qt=>{qt.key===" "&&mt(!1)},[mt]),tr=reactExports.useCallback((qt={},Jt=null)=>({...qt,ref:Jt,"data-active":dataAttr(dt),"data-hover":dataAttr(vt),"data-disabled":dataAttr(Dt),"data-invalid":dataAttr(It),"data-checked":dataAttr(St),"data-focus":dataAttr(jt),"data-focus-visible":dataAttr(jt&&Lt),"data-readonly":dataAttr(zt),"aria-hidden":!0,onMouseDown:callAllHandlers$1(qt.onMouseDown,()=>mt(!0)),onMouseUp:callAllHandlers$1(qt.onMouseUp,()=>mt(!1)),onMouseEnter:callAllHandlers$1(qt.onMouseEnter,()=>ct(!0)),onMouseLeave:callAllHandlers$1(qt.onMouseLeave,()=>ct(!1))}),[dt,vt,Dt,It,St,jt,zt,Lt]),{onFocus:ir,onBlur:nr}=Ct??{},Zt=reactExports.useCallback((qt={},Jt=null)=>{const ur=Dt&&!j;return{...qt,id:Bt,ref:Jt,type:"radio",name:st,value:ot,onChange:callAllHandlers$1(qt.onChange,Tt),onBlur:callAllHandlers$1(nr,qt.onBlur,()=>bt(!1)),onFocus:callAllHandlers$1(ir,qt.onFocus,()=>bt(!0)),onKeyDown:callAllHandlers$1(qt.onKeyDown,Et),onKeyUp:callAllHandlers$1(qt.onKeyUp,Nt),checked:St,disabled:ur,readOnly:zt,required:Ot,"aria-invalid":ariaAttr(It),"aria-disabled":ariaAttr(ur),"aria-required":ariaAttr(Ot),"data-readonly":dataAttr(zt),"aria-describedby":ht,style:visuallyHiddenStyle}},[Dt,j,Bt,st,ot,Tt,nr,ir,Et,Nt,St,zt,Ot,It,ht]);return{state:{isInvalid:It,isFocused:jt,isChecked:St,isActive:dt,isHovered:vt,isDisabled:Dt,isReadOnly:zt,isRequired:Ot},getCheckboxProps:tr,getRadioProps:tr,getInputProps:Zt,getLabelProps:(qt={},Jt=null)=>({...qt,ref:Jt,onMouseDown:callAllHandlers$1(qt.onMouseDown,stopEvent),"data-disabled":dataAttr(Dt),"data-checked":dataAttr(St),"data-invalid":dataAttr(It)}),getRootProps:(qt,Jt=null)=>({...qt,ref:Jt,"data-disabled":dataAttr(Dt),"data-checked":dataAttr(St),"data-invalid":dataAttr(It)}),htmlProps:yt}}function stopEvent(a){a.preventDefault(),a.stopPropagation()}function split$1(a,_){const $={},j={};for(const[et,tt]of Object.entries(a))_.includes(et)?$[et]=tt:j[et]=tt;return[$,j]}var Radio=forwardRef((a,_)=>{var $;const j=useRadioGroupContext(),{onChange:et,value:tt}=a,rt=useMultiStyleConfig("Radio",{...j,...a}),nt=omitThemingProps(a),{spacing:it="0.5rem",children:st,isDisabled:ot=j==null?void 0:j.isDisabled,isFocusable:at=j==null?void 0:j.isFocusable,inputProps:ut,...ht}=nt;let yt=a.isChecked;(j==null?void 0:j.value)!=null&&tt!=null&&(yt=j.value===tt);let wt=et;j!=null&&j.onChange&&tt!=null&&(wt=callAll(j.onChange,et));const Ct=($=a==null?void 0:a.name)!=null?$:j==null?void 0:j.name,{getInputProps:Pt,getCheckboxProps:$t,getLabelProps:Mt,getRootProps:Bt,htmlProps:Dt}=useRadio({...ht,isChecked:yt,isFocusable:at,isDisabled:ot,onChange:wt,name:Ct}),[zt,Ot]=split$1(Dt,layoutPropNames),It=$t(Ot),Lt=Pt(ut,_),Ft=Mt(),jt=Object.assign({},zt,Bt()),bt={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...rt.container},vt={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...rt.control},ct={userSelect:"none",marginStart:it,...rt.label};return jsxRuntimeExports.jsxs(chakra.label,{className:"chakra-radio",...jt,__css:bt,children:[jsxRuntimeExports.jsx("input",{className:"chakra-radio__input",...Lt}),jsxRuntimeExports.jsx(chakra.span,{className:"chakra-radio__control",...It,__css:vt}),st&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-radio__label",...Ft,__css:ct,children:st})]})});Radio.displayName="Radio";var SelectField=forwardRef(function(_,$){const{children:j,placeholder:et,className:tt,...rt}=_;return jsxRuntimeExports.jsxs(chakra.select,{...rt,ref:$,className:cx("chakra-select",tt),children:[et&&jsxRuntimeExports.jsx("option",{value:"",children:et}),j]})});SelectField.displayName="SelectField";function split(a,_){const $={},j={};for(const[et,tt]of Object.entries(a))_.includes(et)?$[et]=tt:j[et]=tt;return[$,j]}var Select$1=forwardRef((a,_)=>{var $;const j=useMultiStyleConfig("Select",a),{rootProps:et,placeholder:tt,icon:rt,color:nt,height:it,h:st,minH:ot,minHeight:at,iconColor:ut,iconSize:ht,...yt}=omitThemingProps(a),[wt,Ct]=split(yt,layoutPropNames),Pt=useFormControl(Ct),$t={width:"100%",height:"fit-content",position:"relative",color:nt},Mt={paddingEnd:"2rem",...j.field,_focus:{zIndex:"unset",...($=j.field)==null?void 0:$._focus}};return jsxRuntimeExports.jsxs(chakra.div,{className:"chakra-select__wrapper",__css:$t,...wt,...et,children:[jsxRuntimeExports.jsx(SelectField,{ref:_,height:st??it,minH:ot??at,placeholder:tt,...Pt,__css:Mt,children:a.children}),jsxRuntimeExports.jsx(SelectIcon,{"data-disabled":dataAttr(Pt.disabled),...(ut||nt)&&{color:ut||nt},__css:j.icon,...ht&&{fontSize:ht},children:rt})]})});Select$1.displayName="Select";var DefaultIcon=a=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",...a,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),IconWrapper=chakra("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),SelectIcon=a=>{const{children:_=jsxRuntimeExports.jsx(DefaultIcon,{}),...$}=a,j=reactExports.cloneElement(_,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return jsxRuntimeExports.jsx(IconWrapper,{...$,className:"chakra-select__icon-wrapper",children:reactExports.isValidElement(_)?j:null})};SelectIcon.displayName="SelectIcon";var Switch=forwardRef(function(_,$){const j=useMultiStyleConfig("Switch",_),{spacing:et="0.5rem",children:tt,...rt}=omitThemingProps(_),{getIndicatorProps:nt,getInputProps:it,getCheckboxProps:st,getRootProps:ot,getLabelProps:at}=useCheckbox(rt),ut=reactExports.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...j.container}),[j.container]),ht=reactExports.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...j.track}),[j.track]),yt=reactExports.useMemo(()=>({userSelect:"none",marginStart:et,...j.label}),[et,j.label]);return jsxRuntimeExports.jsxs(chakra.label,{...ot(),className:cx("chakra-switch",_.className),__css:ut,children:[jsxRuntimeExports.jsx("input",{className:"chakra-switch__input",...it({},$)}),jsxRuntimeExports.jsx(chakra.span,{...st(),className:"chakra-switch__track",__css:ht,children:jsxRuntimeExports.jsx(chakra.span,{__css:j.thumb,className:"chakra-switch__thumb",...nt()})}),tt&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-switch__label",...at(),__css:yt,children:tt})]})});Switch.displayName="Switch";var[TableStylesProvider,useTableStyles]=createContext$1({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "
" `}),Table=forwardRef((a,_)=>{const $=useMultiStyleConfig("Table",a),{className:j,layout:et,...tt}=omitThemingProps(a);return jsxRuntimeExports.jsx(TableStylesProvider,{value:$,children:jsxRuntimeExports.jsx(chakra.table,{ref:_,__css:{tableLayout:et,...$.table},className:cx("chakra-table",j),...tt})})});Table.displayName="Table";var Tr=forwardRef((a,_)=>{const $=useTableStyles();return jsxRuntimeExports.jsx(chakra.tr,{...a,ref:_,__css:$.tr})}),TableContainer=forwardRef((a,_)=>{var $;const{overflow:j,overflowX:et,className:tt,...rt}=a;return jsxRuntimeExports.jsx(chakra.div,{ref:_,className:cx("chakra-table__container",tt),...rt,__css:{display:"block",whiteSpace:"nowrap",WebkitOverflowScrolling:"touch",overflowX:($=j??et)!=null?$:"auto",overflowY:"hidden",maxWidth:"100%"}})}),Tbody=forwardRef((a,_)=>{const $=useTableStyles();return jsxRuntimeExports.jsx(chakra.tbody,{...a,ref:_,__css:$.tbody})}),Td=forwardRef(({isNumeric:a,..._},$)=>{const j=useTableStyles();return jsxRuntimeExports.jsx(chakra.td,{..._,ref:$,__css:j.td,"data-is-numeric":a})}),[TabsDescendantsProvider,useTabsDescendantsContext,useTabsDescendants,useTabsDescendant]=createDescendantContext();function useTabs(a){var _;const{defaultIndex:$,onChange:j,index:et,isManual:tt,isLazy:rt,lazyBehavior:nt="unmount",orientation:it="horizontal",direction:st="ltr",...ot}=a,[at,ut]=reactExports.useState($??0),[ht,yt]=useControllableState({defaultValue:$??0,value:et,onChange:j});reactExports.useEffect(()=>{et!=null&&ut(et)},[et]);const wt=useTabsDescendants(),Ct=reactExports.useId();return{id:`tabs-${(_=a.id)!=null?_:Ct}`,selectedIndex:ht,focusedIndex:at,setSelectedIndex:yt,setFocusedIndex:ut,isManual:tt,isLazy:rt,lazyBehavior:nt,orientation:it,descendants:wt,direction:st,htmlProps:ot}}var[TabsProvider,useTabsContext]=createContext$1({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function useTabList(a){const{focusedIndex:_,orientation:$,direction:j}=useTabsContext(),et=useTabsDescendantsContext(),tt=reactExports.useCallback(rt=>{const nt=()=>{var $t;const Mt=et.nextEnabled(_);Mt&&(($t=Mt.node)==null||$t.focus())},it=()=>{var $t;const Mt=et.prevEnabled(_);Mt&&(($t=Mt.node)==null||$t.focus())},st=()=>{var $t;const Mt=et.firstEnabled();Mt&&(($t=Mt.node)==null||$t.focus())},ot=()=>{var $t;const Mt=et.lastEnabled();Mt&&(($t=Mt.node)==null||$t.focus())},at=$==="horizontal",ut=$==="vertical",ht=rt.key,yt=j==="ltr"?"ArrowLeft":"ArrowRight",wt=j==="ltr"?"ArrowRight":"ArrowLeft",Pt={[yt]:()=>at&&it(),[wt]:()=>at&&nt(),ArrowDown:()=>ut&&nt(),ArrowUp:()=>ut&&it(),Home:st,End:ot}[ht];Pt&&(rt.preventDefault(),Pt(rt))},[et,_,$,j]);return{...a,role:"tablist","aria-orientation":$,onKeyDown:callAllHandlers$1(a.onKeyDown,tt)}}function useTab(a){const{isDisabled:_=!1,isFocusable:$=!1,...j}=a,{setSelectedIndex:et,isManual:tt,id:rt,setFocusedIndex:nt,selectedIndex:it}=useTabsContext(),{index:st,register:ot}=useTabsDescendant({disabled:_&&!$}),at=st===it,ut=()=>{et(st)},ht=()=>{nt(st),!tt&&!(_&&$)&&et(st)};return{...useClickable({...j,ref:mergeRefs(ot,a.ref),isDisabled:_,isFocusable:$,onClick:callAllHandlers$1(a.onClick,ut)}),id:makeTabId(rt,st),role:"tab",tabIndex:at?0:-1,type:"button","aria-selected":at,"aria-controls":makeTabPanelId(rt,st),onFocus:_?void 0:callAllHandlers$1(a.onFocus,ht)}}var[TabPanelProvider,useTabPanelContext]=createContext$1({});function useTabPanels(a){const _=useTabsContext(),{id:$,selectedIndex:j}=_,tt=getValidChildren(a.children).map((rt,nt)=>reactExports.createElement(TabPanelProvider,{key:nt,value:{isSelected:nt===j,id:makeTabPanelId($,nt),tabId:makeTabId($,nt),selectedIndex:j}},rt));return{...a,children:tt}}function useTabPanel(a){const{children:_,...$}=a,{isLazy:j,lazyBehavior:et}=useTabsContext(),{isSelected:tt,id:rt,tabId:nt}=useTabPanelContext(),it=reactExports.useRef(!1);tt&&(it.current=!0);const st=lazyDisclosure({wasSelected:it.current,isSelected:tt,enabled:j,mode:et});return{tabIndex:0,...$,children:st?_:null,role:"tabpanel","aria-labelledby":nt,hidden:!tt,id:rt}}function makeTabId(a,_){return`${a}--tab-${_}`}function makeTabPanelId(a,_){return`${a}--tabpanel-${_}`}var[TabsStylesProvider,useTabsStyles]=createContext$1({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Tabs=forwardRef(function(_,$){const j=useMultiStyleConfig("Tabs",_),{children:et,className:tt,...rt}=omitThemingProps(_),{htmlProps:nt,descendants:it,...st}=useTabs(rt),ot=reactExports.useMemo(()=>st,[st]),{isFitted:at,...ut}=nt,ht={position:"relative",...j.root};return jsxRuntimeExports.jsx(TabsDescendantsProvider,{value:it,children:jsxRuntimeExports.jsx(TabsProvider,{value:ot,children:jsxRuntimeExports.jsx(TabsStylesProvider,{value:j,children:jsxRuntimeExports.jsx(chakra.div,{className:cx("chakra-tabs",tt),ref:$,...ut,__css:ht,children:et})})})})});Tabs.displayName="Tabs";var TabList=forwardRef(function(_,$){const j=useTabList({..._,ref:$}),tt={display:"flex",...useTabsStyles().tablist};return jsxRuntimeExports.jsx(chakra.div,{...j,className:cx("chakra-tabs__tablist",_.className),__css:tt})});TabList.displayName="TabList";var TabPanel=forwardRef(function(_,$){const j=useTabPanel({..._,ref:$}),et=useTabsStyles();return jsxRuntimeExports.jsx(chakra.div,{outline:"0",...j,className:cx("chakra-tabs__tab-panel",_.className),__css:et.tabpanel})});TabPanel.displayName="TabPanel";var TabPanels=forwardRef(function(_,$){const j=useTabPanels(_),et=useTabsStyles();return jsxRuntimeExports.jsx(chakra.div,{...j,width:"100%",ref:$,className:cx("chakra-tabs__tab-panels",_.className),__css:et.tabpanels})});TabPanels.displayName="TabPanels";var Tab=forwardRef(function(_,$){const j=useTabsStyles(),et=useTab({..._,ref:$}),tt={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...j.tab};return jsxRuntimeExports.jsx(chakra.button,{...et,className:cx("chakra-tabs__tab",_.className),__css:tt})});Tab.displayName="Tab";function omit$2(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}var omitted=["h","minH","height","minHeight"],Textarea=forwardRef((a,_)=>{const $=useStyleConfig("Textarea",a),{className:j,rows:et,...tt}=omitThemingProps(a),rt=useFormControl(tt),nt=et?omit$2($,omitted):$;return jsxRuntimeExports.jsx(chakra.textarea,{ref:_,rows:et,...rt,className:cx("chakra-textarea",j),__css:nt})});Textarea.displayName="Textarea";var scale={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},getDoc=a=>{var _;return((_=a.current)==null?void 0:_.ownerDocument)||document},getWin=a=>{var _,$;return(($=(_=a.current)==null?void 0:_.ownerDocument)==null?void 0:$.defaultView)||window};function useTooltip(a={}){const{openDelay:_=0,closeDelay:$=0,closeOnClick:j=!0,closeOnMouseDown:et,closeOnScroll:tt,closeOnPointerDown:rt=et,closeOnEsc:nt=!0,onOpen:it,onClose:st,placement:ot,id:at,isOpen:ut,defaultIsOpen:ht,arrowSize:yt=10,arrowShadowColor:wt,arrowPadding:Ct,modifiers:Pt,isDisabled:$t,gutter:Mt,offset:Bt,direction:Dt,...zt}=a,{isOpen:Ot,onOpen:It,onClose:Lt}=useDisclosure({isOpen:ut,defaultIsOpen:ht,onOpen:it,onClose:st}),{referenceRef:Ft,getPopperProps:jt,getArrowInnerProps:bt,getArrowProps:vt}=usePopper({enabled:Ot,placement:ot,arrowPadding:Ct,modifiers:Pt,gutter:Mt,offset:Bt,direction:Dt}),ct=reactExports.useId(),mt=`tooltip-${at??ct}`,xt=reactExports.useRef(null),At=reactExports.useRef(),Rt=reactExports.useCallback(()=>{At.current&&(clearTimeout(At.current),At.current=void 0)},[]),St=reactExports.useRef(),Tt=reactExports.useCallback(()=>{St.current&&(clearTimeout(St.current),St.current=void 0)},[]),Et=reactExports.useCallback(()=>{Tt(),Lt()},[Lt,Tt]),Nt=useCloseEvent(xt,Et),tr=reactExports.useCallback(()=>{if(!$t&&!At.current){Ot&&Nt();const Jt=getWin(xt);At.current=Jt.setTimeout(It,_)}},[Nt,$t,Ot,It,_]),ir=reactExports.useCallback(()=>{Rt();const Jt=getWin(xt);St.current=Jt.setTimeout(Et,$)},[$,Et,Rt]),nr=reactExports.useCallback(()=>{Ot&&j&&ir()},[j,ir,Ot]),Zt=reactExports.useCallback(()=>{Ot&&rt&&ir()},[rt,ir,Ot]),Kt=reactExports.useCallback(Jt=>{Ot&&Jt.key==="Escape"&&ir()},[Ot,ir]);useEventListener(()=>getDoc(xt),"keydown",nt?Kt:void 0),useEventListener(()=>{if(!tt)return null;const Jt=xt.current;if(!Jt)return null;const ur=getScrollParent$1(Jt);return ur.localName==="body"?getWin(xt):ur},"scroll",()=>{Ot&&tt&&Et()},{passive:!0,capture:!0}),reactExports.useEffect(()=>{$t&&(Rt(),Ot&&Lt())},[$t,Ot,Lt,Rt]),reactExports.useEffect(()=>()=>{Rt(),Tt()},[Rt,Tt]),useEventListener(()=>xt.current,"pointerleave",ir);const Qt=reactExports.useCallback((Jt={},ur=null)=>({...Jt,ref:mergeRefs(xt,ur,Ft),onPointerEnter:callAllHandlers$1(Jt.onPointerEnter,pr=>{pr.pointerType!=="touch"&&tr()}),onClick:callAllHandlers$1(Jt.onClick,nr),onPointerDown:callAllHandlers$1(Jt.onPointerDown,Zt),onFocus:callAllHandlers$1(Jt.onFocus,tr),onBlur:callAllHandlers$1(Jt.onBlur,ir),"aria-describedby":Ot?mt:void 0}),[tr,ir,Zt,Ot,mt,nr,Ft]),Ht=reactExports.useCallback((Jt={},ur=null)=>jt({...Jt,style:{...Jt.style,[cssVars.arrowSize.var]:yt?`${yt}px`:void 0,[cssVars.arrowShadowColor.var]:wt}},ur),[jt,yt,wt]),qt=reactExports.useCallback((Jt={},ur=null)=>{const xr={...Jt.style,position:"relative",transformOrigin:cssVars.transformOrigin.varRef};return{ref:ur,...zt,...Jt,id:mt,role:"tooltip",style:xr}},[zt,mt]);return{isOpen:Ot,show:tr,hide:ir,getTriggerProps:Qt,getTooltipProps:qt,getTooltipPositionerProps:Ht,getArrowProps:vt,getArrowInnerProps:bt}}var closeEventName="chakra-ui:close-tooltip";function useCloseEvent(a,_){return reactExports.useEffect(()=>{const $=getDoc(a);return $.addEventListener(closeEventName,_),()=>$.removeEventListener(closeEventName,_)},[_,a]),()=>{const $=getDoc(a),j=getWin(a);$.dispatchEvent(new j.CustomEvent(closeEventName))}}function omit$1(a,_=[]){const $=Object.assign({},a);for(const j of _)j in $&&delete $[j];return $}function pick$1(a,_){const $={};for(const j of _)j in a&&($[j]=a[j]);return $}var MotionDiv=chakra(motion.div),Tooltip=forwardRef((a,_)=>{var $,j;const et=useStyleConfig("Tooltip",a),tt=omitThemingProps(a),rt=useTheme(),{children:nt,label:it,shouldWrapChildren:st,"aria-label":ot,hasArrow:at,bg:ut,portalProps:ht,background:yt,backgroundColor:wt,bgColor:Ct,motionProps:Pt,...$t}=tt,Mt=(j=($=yt??wt)!=null?$:ut)!=null?j:Ct;if(Mt){et.bg=Mt;const jt=getCSSVar(rt,"colors",Mt);et[cssVars.arrowBg.var]=jt}const Bt=useTooltip({...$t,direction:rt.direction}),Dt=typeof nt=="string"||st;let zt;if(Dt)zt=jsxRuntimeExports.jsx(chakra.span,{display:"inline-block",tabIndex:0,...Bt.getTriggerProps(),children:nt});else{const jt=reactExports.Children.only(nt);zt=reactExports.cloneElement(jt,Bt.getTriggerProps(jt.props,jt.ref))}const Ot=!!ot,It=Bt.getTooltipProps({},_),Lt=Ot?omit$1(It,["role","id"]):It,Ft=pick$1(It,["role","id"]);return it?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[zt,jsxRuntimeExports.jsx(AnimatePresence,{children:Bt.isOpen&&jsxRuntimeExports.jsx(Portal,{...ht,children:jsxRuntimeExports.jsx(chakra.div,{...Bt.getTooltipPositionerProps(),__css:{zIndex:et.zIndex,pointerEvents:"none"},children:jsxRuntimeExports.jsxs(MotionDiv,{variants:scale,initial:"exit",animate:"enter",exit:"exit",...Pt,...Lt,__css:et,children:[it,Ot&&jsxRuntimeExports.jsx(chakra.span,{srOnly:!0,...Ft,children:ot}),at&&jsxRuntimeExports.jsx(chakra.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:jsxRuntimeExports.jsx(chakra.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:et.bg}})})]})})})})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:nt})});Tooltip.displayName="Tooltip";var lodash={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */lodash.exports;(function(a,_){(function(){var $,j="4.17.21",et=200,tt="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",rt="Expected a function",nt="Invalid `variable` option passed into `_.template`",it="__lodash_hash_undefined__",st=500,ot="__lodash_placeholder__",at=1,ut=2,ht=4,yt=1,wt=2,Ct=1,Pt=2,$t=4,Mt=8,Bt=16,Dt=32,zt=64,Ot=128,It=256,Lt=512,Ft=30,jt="...",bt=800,vt=16,ct=1,dt=2,mt=3,xt=1/0,At=9007199254740991,Rt=17976931348623157e292,St=NaN,Tt=4294967295,Et=Tt-1,Nt=Tt>>>1,tr=[["ary",Ot],["bind",Ct],["bindKey",Pt],["curry",Mt],["curryRight",Bt],["flip",Lt],["partial",Dt],["partialRight",zt],["rearg",It]],ir="[object Arguments]",nr="[object Array]",Zt="[object AsyncFunction]",Kt="[object Boolean]",Qt="[object Date]",Ht="[object DOMException]",qt="[object Error]",Jt="[object Function]",ur="[object GeneratorFunction]",xr="[object Map]",pr="[object Number]",Cr="[object Null]",Mr="[object Object]",lr="[object Promise]",fr="[object Proxy]",_r="[object RegExp]",Rr="[object Set]",kr="[object String]",Ar="[object Symbol]",Pr="[object Undefined]",Or="[object WeakMap]",Br="[object WeakSet]",or="[object ArrayBuffer]",Yt="[object DataView]",er="[object Float32Array]",Gt="[object Float64Array]",Vt="[object Int8Array]",Wt="[object Int16Array]",ar="[object Int32Array]",yr="[object Uint8Array]",Er="[object Uint8ClampedArray]",Sr="[object Uint16Array]",Wr="[object Uint32Array]",Hr=/\b__p \+= '';/g,Fr=/\b(__p \+=) '' \+/g,pn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Jr=/&(?:amp|lt|gt|quot|#39);/g,Qr=/[&<>"']/g,mn=RegExp(Jr.source),ln=RegExp(Qr.source),qr=/<%-([\s\S]+?)%>/g,En=/<%([\s\S]+?)%>/g,un=/<%=([\s\S]+?)%>/g,Vr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hn=/^\w*$/,fn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kr=/[\\^$.*+?()[\]{}|]/g,Rn=RegExp(Kr.source),dn=/^\s+/,Gr=/\s/,gn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,Zr=/,? & /,An=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Sn=/[()=,{}\[\]\/\s]/,nn=/\\(\\)?/g,Pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yn=/\w*$/,_n=/^[-+]0x[0-9a-f]+$/i,ds=/^0b[01]+$/i,fs=/^\[object .+?Constructor\]$/,hs=/^0o[0-7]+$/i,ps=/^(?:0|[1-9]\d*)$/,Vn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ss=/($^)/,Jn=/['\n\r\u2028\u2029\\]/g,Yn="\\ud800-\\udfff",ms="\\u0300-\\u036f",Qn="\\ufe20-\\ufe2f",es="\\u20d0-\\u20ff",ls=ms+Qn+es,us="\\u2700-\\u27bf",Wn="a-z\\xdf-\\xf6\\xf8-\\xff",as="\\xac\\xb1\\xd7\\xf7",gs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vs="\\u2000-\\u206f",Ts=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$s="A-Z\\xc0-\\xd6\\xd8-\\xde",yl="\\ufe0e\\ufe0f",Eo=as+gs+vs+Ts,Wo="['’]",wo="["+Yn+"]",Go="["+Eo+"]",So="["+ls+"]",Zs="\\d+",Ro="["+us+"]",xl="["+Wn+"]",_l="[^"+Yn+Eo+Zs+us+Wn+$s+"]",lo="\\ud83c[\\udffb-\\udfff]",Yl="(?:"+So+"|"+lo+")",El="[^"+Yn+"]",jo="(?:\\ud83c[\\udde6-\\uddff]){2}",Ys="[\\ud800-\\udbff][\\udc00-\\udfff]",Ls="["+$s+"]",wl="\\u200d",Sl="(?:"+xl+"|"+_l+")",Ms="(?:"+Ls+"|"+_l+")",Rl="(?:"+Wo+"(?:d|ll|m|re|s|t|ve))?",Al="(?:"+Wo+"(?:D|LL|M|RE|S|T|VE))?",$l=Yl+"?",Xs="["+yl+"]?",Ao="(?:"+wl+"(?:"+[El,jo,Ys].join("|")+")"+Xs+$l+")*",Bs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Tl=Xs+$l+Ao,fo="(?:"+[Ro,jo,Ys].join("|")+")"+Tl,$o="(?:"+[El+So+"?",So,jo,Ys,wo].join("|")+")",To=RegExp(Wo,"g"),Ps=RegExp(So,"g"),Is=RegExp(lo+"(?="+lo+")|"+$o+Tl,"g"),Pl=RegExp([Ls+"?"+xl+"+"+Rl+"(?="+[Go,Ls,"$"].join("|")+")",Ms+"+"+Al+"(?="+[Go,Ls+Sl,"$"].join("|")+")",Ls+"?"+Sl+"+"+Rl,Ls+"+"+Al,uo,Bs,Zs,fo].join("|"),"g"),No=RegExp("["+wl+Yn+ls+yl+"]"),Po=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xl=-1,rs={};rs[er]=rs[Gt]=rs[Vt]=rs[Wt]=rs[ar]=rs[yr]=rs[Er]=rs[Sr]=rs[Wr]=!0,rs[ir]=rs[nr]=rs[or]=rs[Kt]=rs[Yt]=rs[Qt]=rs[qt]=rs[Jt]=rs[xr]=rs[pr]=rs[Mr]=rs[_r]=rs[Rr]=rs[kr]=rs[Or]=!1;var Xn={};Xn[ir]=Xn[nr]=Xn[or]=Xn[Yt]=Xn[Kt]=Xn[Qt]=Xn[er]=Xn[Gt]=Xn[Vt]=Xn[Wt]=Xn[ar]=Xn[xr]=Xn[pr]=Xn[Mr]=Xn[_r]=Xn[Rr]=Xn[kr]=Xn[Ar]=Xn[yr]=Xn[Er]=Xn[Sr]=Xn[Wr]=!0,Xn[qt]=Xn[Jt]=Xn[Or]=!1;var wr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Xt={"&":"&","<":"<",">":">",'"':""","'":"'"},cr={"&":"&","<":"<",">":">",""":'"',"'":"'"},gr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Dr=parseFloat,rn=parseInt,xn=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Tn=typeof self=="object"&&self&&self.Object===Object&&self,cn=xn||Tn||Function("return this")(),wn=_&&!_.nodeType&&_,Ln=wn&&!0&&a&&!a.nodeType&&a,Fn=Ln&&Ln.exports===wn,ts=Fn&&xn.process,_i=function(){try{var jr=Ln&&Ln.require&&Ln.require("util").types;return jr||ts&&ts.binding&&ts.binding("util")}catch{}}(),_s=_i&&_i.isArrayBuffer,Ds=_i&&_i.isDate,ho=_i&&_i.isMap,Bo=_i&&_i.isRegExp,Uu=_i&&_i.isSet,Jl=_i&&_i.isTypedArray;function Os(jr,Xr,Ur){switch(Ur.length){case 0:return jr.call(Xr);case 1:return jr.call(Xr,Ur[0]);case 2:return jr.call(Xr,Ur[0],Ur[1]);case 3:return jr.call(Xr,Ur[0],Ur[1],Ur[2])}return jr.apply(Xr,Ur)}function Tv(jr,Xr,Ur,Cn){for(var Bn=-1,ns=jr==null?0:jr.length;++Bn-1}function s0(jr,Xr,Ur){for(var Cn=-1,Bn=jr==null?0:jr.length;++Cn-1;);return Ur}function Sm(jr,Xr){for(var Ur=jr.length;Ur--&&mu(Xr,jr[Ur],0)>-1;);return Ur}function Lv(jr,Xr){for(var Ur=jr.length,Cn=0;Ur--;)jr[Ur]===Xr&&++Cn;return Cn}var Bv=l0(wr),Dv=l0(Xt);function Fv(jr){return"\\"+gr[jr]}function zv(jr,Xr){return jr==null?$:jr[Xr]}function gu(jr){return No.test(jr)}function Uv(jr){return Po.test(jr)}function Hv(jr){for(var Xr,Ur=[];!(Xr=jr.next()).done;)Ur.push(Xr.value);return Ur}function h0(jr){var Xr=-1,Ur=Array(jr.size);return jr.forEach(function(Cn,Bn){Ur[++Xr]=[Bn,Cn]}),Ur}function Rm(jr,Xr){return function(Ur){return jr(Xr(Ur))}}function Il(jr,Xr){for(var Ur=-1,Cn=jr.length,Bn=0,ns=[];++Ur-1}function Cy(_t,kt){var Ut=this.__data__,rr=Op(Ut,_t);return rr<0?(++this.size,Ut.push([_t,kt])):Ut[rr][1]=kt,this}Zo.prototype.clear=Ay,Zo.prototype.delete=$y,Zo.prototype.get=Ty,Zo.prototype.has=Py,Zo.prototype.set=Cy;function Yo(_t){var kt=-1,Ut=_t==null?0:_t.length;for(this.clear();++kt=kt?_t:kt)),_t}function vo(_t,kt,Ut,rr,dr,br){var $r,Ir=kt&at,Nr=kt&ut,en=kt&ht;if(Ut&&($r=dr?Ut(_t,rr,dr,br):Ut(_t)),$r!==$)return $r;if(!Es(_t))return _t;var tn=Dn(_t);if(tn){if($r=Nx(_t),!Ir)return Js(_t,$r)}else{var sn=Us(_t),$n=sn==Jt||sn==ur;if(Fl(_t))return a1(_t,Ir);if(sn==Mr||sn==ir||$n&&!dr){if($r=Nr||$n?{}:$1(_t),!Ir)return Nr?Rx(_t,Ky($r,_t)):Sx(_t,Lm($r,_t))}else{if(!Xn[sn])return dr?_t:{};$r=Lx(_t,sn,Ir)}}br||(br=new ko);var Mn=br.get(_t);if(Mn)return Mn;br.set(_t,$r),rv(_t)?_t.forEach(function(Nn){$r.add(vo(Nn,kt,Ut,Nn,_t,br))}):ev(_t)&&_t.forEach(function(Nn,qn){$r.set(qn,vo(Nn,kt,Ut,qn,_t,br))});var jn=en?Nr?D0:B0:Nr?eo:Ns,Un=tn?$:jn(_t);return po(Un||_t,function(Nn,qn){Un&&(qn=Nn,Nn=_t[qn]),Zu($r,qn,vo(Nn,kt,Ut,qn,_t,br))}),$r}function Wy(_t){var kt=Ns(_t);return function(Ut){return Bm(Ut,_t,kt)}}function Bm(_t,kt,Ut){var rr=Ut.length;if(_t==null)return!rr;for(_t=ys(_t);rr--;){var dr=Ut[rr],br=kt[dr],$r=_t[dr];if($r===$&&!(dr in _t)||!br($r))return!1}return!0}function Dm(_t,kt,Ut){if(typeof _t!="function")throw new mo(rt);return rp(function(){_t.apply($,Ut)},kt)}function Yu(_t,kt,Ut,rr){var dr=-1,br=vp,$r=!0,Ir=_t.length,Nr=[],en=kt.length;if(!Ir)return Nr;Ut&&(kt=xs(kt,no(Ut))),rr?(br=s0,$r=!1):kt.length>=et&&(br=Hu,$r=!1,kt=new tu(kt));e:for(;++drdr?0:dr+Ut),rr=rr===$||rr>dr?dr:zn(rr),rr<0&&(rr+=dr),rr=Ut>rr?0:iv(rr);Ut0&&Ut(Ir)?kt>1?Fs(Ir,kt-1,Ut,rr,dr):Ml(dr,Ir):rr||(dr[dr.length]=Ir)}return dr}var x0=h1(),Um=h1(!0);function Do(_t,kt){return _t&&x0(_t,kt,Ns)}function _0(_t,kt){return _t&&Um(_t,kt,Ns)}function Np(_t,kt){return Cl(kt,function(Ut){return ga(_t[Ut])})}function nu(_t,kt){kt=Bl(kt,_t);for(var Ut=0,rr=kt.length;_t!=null&&Utkt}function Yy(_t,kt){return _t!=null&&cs.call(_t,kt)}function Xy(_t,kt){return _t!=null&&kt in ys(_t)}function Jy(_t,kt,Ut){return _t>=zs(kt,Ut)&&_t=120&&tn.length>=120)?new tu($r&&tn):$}tn=_t[0];var sn=-1,$n=Ir[0];e:for(;++sn-1;)Ir!==_t&&$p.call(Ir,Nr,1),$p.call(_t,Nr,1);return _t}function Qm(_t,kt){for(var Ut=_t?kt.length:0,rr=Ut-1;Ut--;){var dr=kt[Ut];if(Ut==rr||dr!==br){var br=dr;na(dr)?$p.call(_t,dr,1):k0(_t,dr)}}return _t}function T0(_t,kt){return _t+Cp(Im()*(kt-_t+1))}function fx(_t,kt,Ut,rr){for(var dr=-1,br=ks(Pp((kt-_t)/(Ut||1)),0),$r=Ur(br);br--;)$r[rr?br:++dr]=_t,_t+=Ut;return $r}function P0(_t,kt){var Ut="";if(!_t||kt<1||kt>At)return Ut;do kt%2&&(Ut+=_t),kt=Cp(kt/2),kt&&(_t+=_t);while(kt);return Ut}function Hn(_t,kt){return K0(C1(_t,kt,to),_t+"")}function hx(_t){return Nm($u(_t))}function mx(_t,kt){var Ut=$u(_t);return Wp(Ut,ru(kt,0,Ut.length))}function Qu(_t,kt,Ut,rr){if(!Es(_t))return _t;kt=Bl(kt,_t);for(var dr=-1,br=kt.length,$r=br-1,Ir=_t;Ir!=null&&++drdr?0:dr+kt),Ut=Ut>dr?dr:Ut,Ut<0&&(Ut+=dr),dr=kt>Ut?0:Ut-kt>>>0,kt>>>=0;for(var br=Ur(dr);++rr>>1,$r=_t[br];$r!==null&&!so($r)&&(Ut?$r<=kt:$r=et){var en=kt?null:Px(_t);if(en)return bp(en);$r=!1,dr=Hu,Nr=new tu}else Nr=kt?[]:Ir;e:for(;++rr=rr?_t:yo(_t,kt,Ut)}var o1=iy||function(_t){return cn.clearTimeout(_t)};function a1(_t,kt){if(kt)return _t.slice();var Ut=_t.length,rr=Tm?Tm(Ut):new _t.constructor(Ut);return _t.copy(rr),rr}function j0(_t){var kt=new _t.constructor(_t.byteLength);return new Rp(kt).set(new Rp(_t)),kt}function xx(_t,kt){var Ut=kt?j0(_t.buffer):_t.buffer;return new _t.constructor(Ut,_t.byteOffset,_t.byteLength)}function _x(_t){var kt=new _t.constructor(_t.source,yn.exec(_t));return kt.lastIndex=_t.lastIndex,kt}function Ex(_t){return Gu?ys(Gu.call(_t)):{}}function c1(_t,kt){var Ut=kt?j0(_t.buffer):_t.buffer;return new _t.constructor(Ut,_t.byteOffset,_t.length)}function l1(_t,kt){if(_t!==kt){var Ut=_t!==$,rr=_t===null,dr=_t===_t,br=so(_t),$r=kt!==$,Ir=kt===null,Nr=kt===kt,en=so(kt);if(!Ir&&!en&&!br&&_t>kt||br&&$r&&Nr&&!Ir&&!en||rr&&$r&&Nr||!Ut&&Nr||!dr)return 1;if(!rr&&!br&&!en&&_t=Ir)return Nr;var en=Ut[rr];return Nr*(en=="desc"?-1:1)}}return _t.index-kt.index}function u1(_t,kt,Ut,rr){for(var dr=-1,br=_t.length,$r=Ut.length,Ir=-1,Nr=kt.length,en=ks(br-$r,0),tn=Ur(Nr+en),sn=!rr;++Ir1?Ut[dr-1]:$,$r=dr>2?Ut[2]:$;for(br=_t.length>3&&typeof br=="function"?(dr--,br):$,$r&&Vs(Ut[0],Ut[1],$r)&&(br=dr<3?$:br,dr=1),kt=ys(kt);++rr-1?dr[br?kt[$r]:$r]:$}}function g1(_t){return Qo(function(kt){var Ut=kt.length,rr=Ut,dr=go.prototype.thru;for(_t&&kt.reverse();rr--;){var br=kt[rr];if(typeof br!="function")throw new mo(rt);if(dr&&!$r&&qp(br)=="wrapper")var $r=new go([],!0)}for(rr=$r?rr:Ut;++rr1&&Gn.reverse(),tn&&NrIr))return!1;var en=br.get(_t),tn=br.get(kt);if(en&&tn)return en==kt&&tn==_t;var sn=-1,$n=!0,Mn=Ut&wt?new tu:$;for(br.set(_t,kt),br.set(kt,_t);++sn1?"& ":"")+kt[rr],kt=kt.join(Ut>2?", ":" "),_t.replace(gn,`{ + */lodash.exports;(function(a,_){(function(){var $,j="4.17.21",et=200,tt="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",rt="Expected a function",nt="Invalid `variable` option passed into `_.template`",it="__lodash_hash_undefined__",st=500,ot="__lodash_placeholder__",at=1,ut=2,ht=4,yt=1,wt=2,Ct=1,Pt=2,$t=4,Mt=8,Bt=16,Dt=32,zt=64,Ot=128,It=256,Lt=512,Ft=30,jt="...",bt=800,vt=16,ct=1,dt=2,mt=3,xt=1/0,At=9007199254740991,Rt=17976931348623157e292,St=NaN,Tt=4294967295,Et=Tt-1,Nt=Tt>>>1,tr=[["ary",Ot],["bind",Ct],["bindKey",Pt],["curry",Mt],["curryRight",Bt],["flip",Lt],["partial",Dt],["partialRight",zt],["rearg",It]],ir="[object Arguments]",nr="[object Array]",Zt="[object AsyncFunction]",Kt="[object Boolean]",Qt="[object Date]",Ht="[object DOMException]",qt="[object Error]",Jt="[object Function]",ur="[object GeneratorFunction]",xr="[object Map]",pr="[object Number]",Cr="[object Null]",Mr="[object Object]",lr="[object Promise]",fr="[object Proxy]",_r="[object RegExp]",Sr="[object Set]",kr="[object String]",Ar="[object Symbol]",$r="[object Undefined]",Or="[object WeakMap]",Br="[object WeakSet]",or="[object ArrayBuffer]",Yt="[object DataView]",er="[object Float32Array]",Gt="[object Float64Array]",Vt="[object Int8Array]",Wt="[object Int16Array]",ar="[object Int32Array]",yr="[object Uint8Array]",Er="[object Uint8ClampedArray]",Rr="[object Uint16Array]",Wr="[object Uint32Array]",Hr=/\b__p \+= '';/g,Fr=/\b(__p \+=) '' \+/g,pn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Jr=/&(?:amp|lt|gt|quot|#39);/g,Qr=/[&<>"']/g,mn=RegExp(Jr.source),ln=RegExp(Qr.source),qr=/<%-([\s\S]+?)%>/g,En=/<%([\s\S]+?)%>/g,un=/<%=([\s\S]+?)%>/g,Vr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hn=/^\w*$/,fn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kr=/[\\^$.*+?()[\]{}|]/g,Rn=RegExp(Kr.source),dn=/^\s+/,Gr=/\s/,gn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,Zr=/,? & /,An=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Sn=/[()=,{}\[\]\/\s]/,nn=/\\(\\)?/g,Pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yn=/\w*$/,_n=/^[-+]0x[0-9a-f]+$/i,ds=/^0b[01]+$/i,fs=/^\[object .+?Constructor\]$/,hs=/^0o[0-7]+$/i,ps=/^(?:0|[1-9]\d*)$/,Vn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ss=/($^)/,Jn=/['\n\r\u2028\u2029\\]/g,Yn="\\ud800-\\udfff",ms="\\u0300-\\u036f",Qn="\\ufe20-\\ufe2f",es="\\u20d0-\\u20ff",ls=ms+Qn+es,us="\\u2700-\\u27bf",Wn="a-z\\xdf-\\xf6\\xf8-\\xff",as="\\xac\\xb1\\xd7\\xf7",gs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vs="\\u2000-\\u206f",Ts=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$s="A-Z\\xc0-\\xd6\\xd8-\\xde",yl="\\ufe0e\\ufe0f",Eo=as+gs+vs+Ts,Wo="['’]",wo="["+Yn+"]",Go="["+Eo+"]",So="["+ls+"]",Zs="\\d+",Ro="["+us+"]",xl="["+Wn+"]",_l="[^"+Yn+Eo+Zs+us+Wn+$s+"]",lo="\\ud83c[\\udffb-\\udfff]",Yl="(?:"+So+"|"+lo+")",El="[^"+Yn+"]",jo="(?:\\ud83c[\\udde6-\\uddff]){2}",Ys="[\\ud800-\\udbff][\\udc00-\\udfff]",Ls="["+$s+"]",wl="\\u200d",Sl="(?:"+xl+"|"+_l+")",Ms="(?:"+Ls+"|"+_l+")",Rl="(?:"+Wo+"(?:d|ll|m|re|s|t|ve))?",Al="(?:"+Wo+"(?:D|LL|M|RE|S|T|VE))?",$l=Yl+"?",Xs="["+yl+"]?",Ao="(?:"+wl+"(?:"+[El,jo,Ys].join("|")+")"+Xs+$l+")*",Bs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Tl=Xs+$l+Ao,fo="(?:"+[Ro,jo,Ys].join("|")+")"+Tl,$o="(?:"+[El+So+"?",So,jo,Ys,wo].join("|")+")",To=RegExp(Wo,"g"),Ps=RegExp(So,"g"),Is=RegExp(lo+"(?="+lo+")|"+$o+Tl,"g"),Pl=RegExp([Ls+"?"+xl+"+"+Rl+"(?="+[Go,Ls,"$"].join("|")+")",Ms+"+"+Al+"(?="+[Go,Ls+Sl,"$"].join("|")+")",Ls+"?"+Sl+"+"+Rl,Ls+"+"+Al,uo,Bs,Zs,fo].join("|"),"g"),No=RegExp("["+wl+Yn+ls+yl+"]"),Po=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xl=-1,rs={};rs[er]=rs[Gt]=rs[Vt]=rs[Wt]=rs[ar]=rs[yr]=rs[Er]=rs[Rr]=rs[Wr]=!0,rs[ir]=rs[nr]=rs[or]=rs[Kt]=rs[Yt]=rs[Qt]=rs[qt]=rs[Jt]=rs[xr]=rs[pr]=rs[Mr]=rs[_r]=rs[Sr]=rs[kr]=rs[Or]=!1;var Xn={};Xn[ir]=Xn[nr]=Xn[or]=Xn[Yt]=Xn[Kt]=Xn[Qt]=Xn[er]=Xn[Gt]=Xn[Vt]=Xn[Wt]=Xn[ar]=Xn[xr]=Xn[pr]=Xn[Mr]=Xn[_r]=Xn[Sr]=Xn[kr]=Xn[Ar]=Xn[yr]=Xn[Er]=Xn[Rr]=Xn[Wr]=!0,Xn[qt]=Xn[Jt]=Xn[Or]=!1;var wr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Xt={"&":"&","<":"<",">":">",'"':""","'":"'"},cr={"&":"&","<":"<",">":">",""":'"',"'":"'"},gr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Dr=parseFloat,rn=parseInt,xn=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Tn=typeof self=="object"&&self&&self.Object===Object&&self,cn=xn||Tn||Function("return this")(),wn=_&&!_.nodeType&&_,Ln=wn&&!0&&a&&!a.nodeType&&a,Fn=Ln&&Ln.exports===wn,ts=Fn&&xn.process,_i=function(){try{var jr=Ln&&Ln.require&&Ln.require("util").types;return jr||ts&&ts.binding&&ts.binding("util")}catch{}}(),_s=_i&&_i.isArrayBuffer,Ds=_i&&_i.isDate,ho=_i&&_i.isMap,Bo=_i&&_i.isRegExp,Uu=_i&&_i.isSet,Jl=_i&&_i.isTypedArray;function Os(jr,Xr,Ur){switch(Ur.length){case 0:return jr.call(Xr);case 1:return jr.call(Xr,Ur[0]);case 2:return jr.call(Xr,Ur[0],Ur[1]);case 3:return jr.call(Xr,Ur[0],Ur[1],Ur[2])}return jr.apply(Xr,Ur)}function Tv(jr,Xr,Ur,Cn){for(var Bn=-1,ns=jr==null?0:jr.length;++Bn-1}function s0(jr,Xr,Ur){for(var Cn=-1,Bn=jr==null?0:jr.length;++Cn-1;);return Ur}function Sm(jr,Xr){for(var Ur=jr.length;Ur--&&mu(Xr,jr[Ur],0)>-1;);return Ur}function Lv(jr,Xr){for(var Ur=jr.length,Cn=0;Ur--;)jr[Ur]===Xr&&++Cn;return Cn}var Bv=l0(wr),Dv=l0(Xt);function Fv(jr){return"\\"+gr[jr]}function zv(jr,Xr){return jr==null?$:jr[Xr]}function gu(jr){return No.test(jr)}function Uv(jr){return Po.test(jr)}function Hv(jr){for(var Xr,Ur=[];!(Xr=jr.next()).done;)Ur.push(Xr.value);return Ur}function h0(jr){var Xr=-1,Ur=Array(jr.size);return jr.forEach(function(Cn,Bn){Ur[++Xr]=[Bn,Cn]}),Ur}function Rm(jr,Xr){return function(Ur){return jr(Xr(Ur))}}function Il(jr,Xr){for(var Ur=-1,Cn=jr.length,Bn=0,ns=[];++Ur-1}function Cy(_t,kt){var Ut=this.__data__,rr=Op(Ut,_t);return rr<0?(++this.size,Ut.push([_t,kt])):Ut[rr][1]=kt,this}Zo.prototype.clear=Ay,Zo.prototype.delete=$y,Zo.prototype.get=Ty,Zo.prototype.has=Py,Zo.prototype.set=Cy;function Yo(_t){var kt=-1,Ut=_t==null?0:_t.length;for(this.clear();++kt=kt?_t:kt)),_t}function vo(_t,kt,Ut,rr,dr,br){var Pr,Ir=kt&at,Nr=kt&ut,en=kt&ht;if(Ut&&(Pr=dr?Ut(_t,rr,dr,br):Ut(_t)),Pr!==$)return Pr;if(!Es(_t))return _t;var tn=Dn(_t);if(tn){if(Pr=Nx(_t),!Ir)return Js(_t,Pr)}else{var sn=Us(_t),$n=sn==Jt||sn==ur;if(Fl(_t))return a1(_t,Ir);if(sn==Mr||sn==ir||$n&&!dr){if(Pr=Nr||$n?{}:$1(_t),!Ir)return Nr?Rx(_t,Ky(Pr,_t)):Sx(_t,Lm(Pr,_t))}else{if(!Xn[sn])return dr?_t:{};Pr=Lx(_t,sn,Ir)}}br||(br=new ko);var Mn=br.get(_t);if(Mn)return Mn;br.set(_t,Pr),rv(_t)?_t.forEach(function(Nn){Pr.add(vo(Nn,kt,Ut,Nn,_t,br))}):ev(_t)&&_t.forEach(function(Nn,qn){Pr.set(qn,vo(Nn,kt,Ut,qn,_t,br))});var jn=en?Nr?D0:B0:Nr?eo:Ns,Un=tn?$:jn(_t);return po(Un||_t,function(Nn,qn){Un&&(qn=Nn,Nn=_t[qn]),Zu(Pr,qn,vo(Nn,kt,Ut,qn,_t,br))}),Pr}function Wy(_t){var kt=Ns(_t);return function(Ut){return Bm(Ut,_t,kt)}}function Bm(_t,kt,Ut){var rr=Ut.length;if(_t==null)return!rr;for(_t=ys(_t);rr--;){var dr=Ut[rr],br=kt[dr],Pr=_t[dr];if(Pr===$&&!(dr in _t)||!br(Pr))return!1}return!0}function Dm(_t,kt,Ut){if(typeof _t!="function")throw new mo(rt);return rp(function(){_t.apply($,Ut)},kt)}function Yu(_t,kt,Ut,rr){var dr=-1,br=vp,Pr=!0,Ir=_t.length,Nr=[],en=kt.length;if(!Ir)return Nr;Ut&&(kt=xs(kt,no(Ut))),rr?(br=s0,Pr=!1):kt.length>=et&&(br=Hu,Pr=!1,kt=new tu(kt));e:for(;++drdr?0:dr+Ut),rr=rr===$||rr>dr?dr:zn(rr),rr<0&&(rr+=dr),rr=Ut>rr?0:iv(rr);Ut0&&Ut(Ir)?kt>1?Fs(Ir,kt-1,Ut,rr,dr):Ml(dr,Ir):rr||(dr[dr.length]=Ir)}return dr}var x0=h1(),Um=h1(!0);function Do(_t,kt){return _t&&x0(_t,kt,Ns)}function _0(_t,kt){return _t&&Um(_t,kt,Ns)}function Np(_t,kt){return Cl(kt,function(Ut){return ga(_t[Ut])})}function nu(_t,kt){kt=Bl(kt,_t);for(var Ut=0,rr=kt.length;_t!=null&&Utkt}function Yy(_t,kt){return _t!=null&&cs.call(_t,kt)}function Xy(_t,kt){return _t!=null&&kt in ys(_t)}function Jy(_t,kt,Ut){return _t>=zs(kt,Ut)&&_t=120&&tn.length>=120)?new tu(Pr&&tn):$}tn=_t[0];var sn=-1,$n=Ir[0];e:for(;++sn-1;)Ir!==_t&&$p.call(Ir,Nr,1),$p.call(_t,Nr,1);return _t}function Qm(_t,kt){for(var Ut=_t?kt.length:0,rr=Ut-1;Ut--;){var dr=kt[Ut];if(Ut==rr||dr!==br){var br=dr;na(dr)?$p.call(_t,dr,1):k0(_t,dr)}}return _t}function T0(_t,kt){return _t+Cp(Im()*(kt-_t+1))}function fx(_t,kt,Ut,rr){for(var dr=-1,br=ks(Pp((kt-_t)/(Ut||1)),0),Pr=Ur(br);br--;)Pr[rr?br:++dr]=_t,_t+=Ut;return Pr}function P0(_t,kt){var Ut="";if(!_t||kt<1||kt>At)return Ut;do kt%2&&(Ut+=_t),kt=Cp(kt/2),kt&&(_t+=_t);while(kt);return Ut}function Hn(_t,kt){return K0(C1(_t,kt,to),_t+"")}function hx(_t){return Nm($u(_t))}function mx(_t,kt){var Ut=$u(_t);return Wp(Ut,ru(kt,0,Ut.length))}function Qu(_t,kt,Ut,rr){if(!Es(_t))return _t;kt=Bl(kt,_t);for(var dr=-1,br=kt.length,Pr=br-1,Ir=_t;Ir!=null&&++drdr?0:dr+kt),Ut=Ut>dr?dr:Ut,Ut<0&&(Ut+=dr),dr=kt>Ut?0:Ut-kt>>>0,kt>>>=0;for(var br=Ur(dr);++rr>>1,Pr=_t[br];Pr!==null&&!so(Pr)&&(Ut?Pr<=kt:Pr=et){var en=kt?null:Px(_t);if(en)return bp(en);Pr=!1,dr=Hu,Nr=new tu}else Nr=kt?[]:Ir;e:for(;++rr=rr?_t:yo(_t,kt,Ut)}var o1=iy||function(_t){return cn.clearTimeout(_t)};function a1(_t,kt){if(kt)return _t.slice();var Ut=_t.length,rr=Tm?Tm(Ut):new _t.constructor(Ut);return _t.copy(rr),rr}function j0(_t){var kt=new _t.constructor(_t.byteLength);return new Rp(kt).set(new Rp(_t)),kt}function xx(_t,kt){var Ut=kt?j0(_t.buffer):_t.buffer;return new _t.constructor(Ut,_t.byteOffset,_t.byteLength)}function _x(_t){var kt=new _t.constructor(_t.source,yn.exec(_t));return kt.lastIndex=_t.lastIndex,kt}function Ex(_t){return Gu?ys(Gu.call(_t)):{}}function c1(_t,kt){var Ut=kt?j0(_t.buffer):_t.buffer;return new _t.constructor(Ut,_t.byteOffset,_t.length)}function l1(_t,kt){if(_t!==kt){var Ut=_t!==$,rr=_t===null,dr=_t===_t,br=so(_t),Pr=kt!==$,Ir=kt===null,Nr=kt===kt,en=so(kt);if(!Ir&&!en&&!br&&_t>kt||br&&Pr&&Nr&&!Ir&&!en||rr&&Pr&&Nr||!Ut&&Nr||!dr)return 1;if(!rr&&!br&&!en&&_t=Ir)return Nr;var en=Ut[rr];return Nr*(en=="desc"?-1:1)}}return _t.index-kt.index}function u1(_t,kt,Ut,rr){for(var dr=-1,br=_t.length,Pr=Ut.length,Ir=-1,Nr=kt.length,en=ks(br-Pr,0),tn=Ur(Nr+en),sn=!rr;++Ir1?Ut[dr-1]:$,Pr=dr>2?Ut[2]:$;for(br=_t.length>3&&typeof br=="function"?(dr--,br):$,Pr&&Vs(Ut[0],Ut[1],Pr)&&(br=dr<3?$:br,dr=1),kt=ys(kt);++rr-1?dr[br?kt[Pr]:Pr]:$}}function g1(_t){return Qo(function(kt){var Ut=kt.length,rr=Ut,dr=go.prototype.thru;for(_t&&kt.reverse();rr--;){var br=kt[rr];if(typeof br!="function")throw new mo(rt);if(dr&&!Pr&&qp(br)=="wrapper")var Pr=new go([],!0)}for(rr=Pr?rr:Ut;++rr1&&Gn.reverse(),tn&&NrIr))return!1;var en=br.get(_t),tn=br.get(kt);if(en&&tn)return en==kt&&tn==_t;var sn=-1,$n=!0,Mn=Ut&wt?new tu:$;for(br.set(_t,kt),br.set(kt,_t);++sn1?"& ":"")+kt[rr],kt=kt.join(Ut>2?", ":" "),_t.replace(gn,`{ /* [wrapped with `+kt+`] */ -`)}function Dx(_t){return Dn(_t)||ou(_t)||!!(km&&_t&&_t[km])}function na(_t,kt){var Ut=typeof _t;return kt=kt??At,!!kt&&(Ut=="number"||Ut!="symbol"&&ps.test(_t))&&_t>-1&&_t%1==0&&_t0){if(++kt>=bt)return arguments[0]}else kt=0;return _t.apply($,arguments)}}function Wp(_t,kt){var Ut=-1,rr=_t.length,dr=rr-1;for(kt=kt===$?rr:kt;++Ut1?_t[kt-1]:$;return Ut=typeof Ut=="function"?(_t.pop(),Ut):$,U1(_t,Ut)});function H1(_t){var kt=vr(_t);return kt.__chain__=!0,kt}function Y2(_t,kt){return kt(_t),_t}function Gp(_t,kt){return kt(_t)}var X2=Qo(function(_t){var kt=_t.length,Ut=kt?_t[0]:0,rr=this.__wrapped__,dr=function(br){return b0(br,_t)};return kt>1||this.__actions__.length||!(rr instanceof Kn)||!na(Ut)?this.thru(dr):(rr=rr.slice(Ut,+Ut+(kt?1:0)),rr.__actions__.push({func:Gp,args:[dr],thisArg:$}),new go(rr,this.__chain__).thru(function(br){return kt&&!br.length&&br.push($),br}))});function J2(){return H1(this)}function Q2(){return new go(this.value(),this.__chain__)}function e_(){this.__values__===$&&(this.__values__=nv(this.value()));var _t=this.__index__>=this.__values__.length,kt=_t?$:this.__values__[this.__index__++];return{done:_t,value:kt}}function t_(){return this}function r_(_t){for(var kt,Ut=this;Ut instanceof Ip;){var rr=N1(Ut);rr.__index__=0,rr.__values__=$,kt?dr.__wrapped__=rr:kt=rr;var dr=rr;Ut=Ut.__wrapped__}return dr.__wrapped__=_t,kt}function n_(){var _t=this.__wrapped__;if(_t instanceof Kn){var kt=_t;return this.__actions__.length&&(kt=new Kn(this)),kt=kt.reverse(),kt.__actions__.push({func:Gp,args:[W0],thisArg:$}),new go(kt,this.__chain__)}return this.thru(W0)}function i_(){return i1(this.__wrapped__,this.__actions__)}var s_=Fp(function(_t,kt,Ut){cs.call(_t,Ut)?++_t[Ut]:Xo(_t,Ut,1)});function o_(_t,kt,Ut){var rr=Dn(_t)?vm:Gy;return Ut&&Vs(_t,kt,Ut)&&(kt=$),rr(_t,On(kt,3))}function a_(_t,kt){var Ut=Dn(_t)?Cl:zm;return Ut(_t,On(kt,3))}var c_=m1(L1),l_=m1(B1);function u_(_t,kt){return Fs(Zp(_t,kt),1)}function d_(_t,kt){return Fs(Zp(_t,kt),xt)}function f_(_t,kt,Ut){return Ut=Ut===$?1:zn(Ut),Fs(Zp(_t,kt),Ut)}function V1(_t,kt){var Ut=Dn(_t)?po:Nl;return Ut(_t,On(kt,3))}function q1(_t,kt){var Ut=Dn(_t)?Pv:Fm;return Ut(_t,On(kt,3))}var h_=Fp(function(_t,kt,Ut){cs.call(_t,Ut)?_t[Ut].push(kt):Xo(_t,Ut,[kt])});function p_(_t,kt,Ut,rr){_t=Qs(_t)?_t:$u(_t),Ut=Ut&&!rr?zn(Ut):0;var dr=_t.length;return Ut<0&&(Ut=ks(dr+Ut,0)),e0(_t)?Ut<=dr&&_t.indexOf(kt,Ut)>-1:!!dr&&mu(_t,kt,Ut)>-1}var m_=Hn(function(_t,kt,Ut){var rr=-1,dr=typeof kt=="function",br=Qs(_t)?Ur(_t.length):[];return Nl(_t,function($r){br[++rr]=dr?Os(kt,$r,Ut):Xu($r,kt,Ut)}),br}),g_=Fp(function(_t,kt,Ut){Xo(_t,Ut,kt)});function Zp(_t,kt){var Ut=Dn(_t)?xs:Wm;return Ut(_t,On(kt,3))}function v_(_t,kt,Ut,rr){return _t==null?[]:(Dn(kt)||(kt=kt==null?[]:[kt]),Ut=rr?$:Ut,Dn(Ut)||(Ut=Ut==null?[]:[Ut]),Xm(_t,kt,Ut))}var y_=Fp(function(_t,kt,Ut){_t[Ut?0:1].push(kt)},function(){return[[],[]]});function b_(_t,kt,Ut){var rr=Dn(_t)?o0:_m,dr=arguments.length<3;return rr(_t,On(kt,4),Ut,dr,Nl)}function x_(_t,kt,Ut){var rr=Dn(_t)?Cv:_m,dr=arguments.length<3;return rr(_t,On(kt,4),Ut,dr,Fm)}function __(_t,kt){var Ut=Dn(_t)?Cl:zm;return Ut(_t,Jp(On(kt,3)))}function E_(_t){var kt=Dn(_t)?Nm:hx;return kt(_t)}function w_(_t,kt,Ut){(Ut?Vs(_t,kt,Ut):kt===$)?kt=1:kt=zn(kt);var rr=Dn(_t)?Hy:mx;return rr(_t,kt)}function S_(_t){var kt=Dn(_t)?Vy:vx;return kt(_t)}function R_(_t){if(_t==null)return 0;if(Qs(_t))return e0(_t)?vu(_t):_t.length;var kt=Us(_t);return kt==xr||kt==Rr?_t.size:R0(_t).length}function A_(_t,kt,Ut){var rr=Dn(_t)?a0:yx;return Ut&&Vs(_t,kt,Ut)&&(kt=$),rr(_t,On(kt,3))}var $_=Hn(function(_t,kt){if(_t==null)return[];var Ut=kt.length;return Ut>1&&Vs(_t,kt[0],kt[1])?kt=[]:Ut>2&&Vs(kt[0],kt[1],kt[2])&&(kt=[kt[0]]),Xm(_t,Fs(kt,1),[])}),Yp=sy||function(){return cn.Date.now()};function T_(_t,kt){if(typeof kt!="function")throw new mo(rt);return _t=zn(_t),function(){if(--_t<1)return kt.apply(this,arguments)}}function K1(_t,kt,Ut){return kt=Ut?$:kt,kt=_t&&kt==null?_t.length:kt,Jo(_t,Ot,$,$,$,$,kt)}function W1(_t,kt){var Ut;if(typeof kt!="function")throw new mo(rt);return _t=zn(_t),function(){return--_t>0&&(Ut=kt.apply(this,arguments)),_t<=1&&(kt=$),Ut}}var Z0=Hn(function(_t,kt,Ut){var rr=Ct;if(Ut.length){var dr=Il(Ut,Ru(Z0));rr|=Dt}return Jo(_t,rr,kt,Ut,dr)}),G1=Hn(function(_t,kt,Ut){var rr=Ct|Pt;if(Ut.length){var dr=Il(Ut,Ru(G1));rr|=Dt}return Jo(kt,rr,_t,Ut,dr)});function Z1(_t,kt,Ut){kt=Ut?$:kt;var rr=Jo(_t,Mt,$,$,$,$,$,kt);return rr.placeholder=Z1.placeholder,rr}function Y1(_t,kt,Ut){kt=Ut?$:kt;var rr=Jo(_t,Bt,$,$,$,$,$,kt);return rr.placeholder=Y1.placeholder,rr}function X1(_t,kt,Ut){var rr,dr,br,$r,Ir,Nr,en=0,tn=!1,sn=!1,$n=!0;if(typeof _t!="function")throw new mo(rt);kt=xo(kt)||0,Es(Ut)&&(tn=!!Ut.leading,sn="maxWait"in Ut,br=sn?ks(xo(Ut.maxWait)||0,kt):br,$n="trailing"in Ut?!!Ut.trailing:$n);function Mn(As){var Io=rr,xa=dr;return rr=dr=$,en=As,$r=_t.apply(xa,Io),$r}function jn(As){return en=As,Ir=rp(qn,kt),tn?Mn(As):$r}function Un(As){var Io=As-Nr,xa=As-en,gv=kt-Io;return sn?zs(gv,br-xa):gv}function Nn(As){var Io=As-Nr,xa=As-en;return Nr===$||Io>=kt||Io<0||sn&&xa>=br}function qn(){var As=Yp();if(Nn(As))return Gn(As);Ir=rp(qn,Un(As))}function Gn(As){return Ir=$,$n&&rr?Mn(As):(rr=dr=$,$r)}function oo(){Ir!==$&&o1(Ir),en=0,rr=Nr=dr=Ir=$}function qs(){return Ir===$?$r:Gn(Yp())}function ao(){var As=Yp(),Io=Nn(As);if(rr=arguments,dr=this,Nr=As,Io){if(Ir===$)return jn(Nr);if(sn)return o1(Ir),Ir=rp(qn,kt),Mn(Nr)}return Ir===$&&(Ir=rp(qn,kt)),$r}return ao.cancel=oo,ao.flush=qs,ao}var P_=Hn(function(_t,kt){return Dm(_t,1,kt)}),C_=Hn(function(_t,kt,Ut){return Dm(_t,xo(kt)||0,Ut)});function k_(_t){return Jo(_t,Lt)}function Xp(_t,kt){if(typeof _t!="function"||kt!=null&&typeof kt!="function")throw new mo(rt);var Ut=function(){var rr=arguments,dr=kt?kt.apply(this,rr):rr[0],br=Ut.cache;if(br.has(dr))return br.get(dr);var $r=_t.apply(this,rr);return Ut.cache=br.set(dr,$r)||br,$r};return Ut.cache=new(Xp.Cache||Yo),Ut}Xp.Cache=Yo;function Jp(_t){if(typeof _t!="function")throw new mo(rt);return function(){var kt=arguments;switch(kt.length){case 0:return!_t.call(this);case 1:return!_t.call(this,kt[0]);case 2:return!_t.call(this,kt[0],kt[1]);case 3:return!_t.call(this,kt[0],kt[1],kt[2])}return!_t.apply(this,kt)}}function M_(_t){return W1(2,_t)}var I_=bx(function(_t,kt){kt=kt.length==1&&Dn(kt[0])?xs(kt[0],no(On())):xs(Fs(kt,1),no(On()));var Ut=kt.length;return Hn(function(rr){for(var dr=-1,br=zs(rr.length,Ut);++dr=kt}),ou=Vm(function(){return arguments}())?Vm:function(_t){return ws(_t)&&cs.call(_t,"callee")&&!Cm.call(_t,"callee")},Dn=Ur.isArray,G_=_s?no(_s):ex;function Qs(_t){return _t!=null&&Qp(_t.length)&&!ga(_t)}function Rs(_t){return ws(_t)&&Qs(_t)}function Z_(_t){return _t===!0||_t===!1||ws(_t)&&Hs(_t)==Kt}var Fl=ay||am,Y_=Ds?no(Ds):tx;function X_(_t){return ws(_t)&&_t.nodeType===1&&!np(_t)}function J_(_t){if(_t==null)return!0;if(Qs(_t)&&(Dn(_t)||typeof _t=="string"||typeof _t.splice=="function"||Fl(_t)||Au(_t)||ou(_t)))return!_t.length;var kt=Us(_t);if(kt==xr||kt==Rr)return!_t.size;if(tp(_t))return!R0(_t).length;for(var Ut in _t)if(cs.call(_t,Ut))return!1;return!0}function Q_(_t,kt){return Ju(_t,kt)}function eE(_t,kt,Ut){Ut=typeof Ut=="function"?Ut:$;var rr=Ut?Ut(_t,kt):$;return rr===$?Ju(_t,kt,$,Ut):!!rr}function X0(_t){if(!ws(_t))return!1;var kt=Hs(_t);return kt==qt||kt==Ht||typeof _t.message=="string"&&typeof _t.name=="string"&&!np(_t)}function tE(_t){return typeof _t=="number"&&Mm(_t)}function ga(_t){if(!Es(_t))return!1;var kt=Hs(_t);return kt==Jt||kt==ur||kt==Zt||kt==fr}function Q1(_t){return typeof _t=="number"&&_t==zn(_t)}function Qp(_t){return typeof _t=="number"&&_t>-1&&_t%1==0&&_t<=At}function Es(_t){var kt=typeof _t;return _t!=null&&(kt=="object"||kt=="function")}function ws(_t){return _t!=null&&typeof _t=="object"}var ev=ho?no(ho):nx;function rE(_t,kt){return _t===kt||S0(_t,kt,z0(kt))}function nE(_t,kt,Ut){return Ut=typeof Ut=="function"?Ut:$,S0(_t,kt,z0(kt),Ut)}function iE(_t){return tv(_t)&&_t!=+_t}function sE(_t){if(Ux(_t))throw new Bn(tt);return qm(_t)}function oE(_t){return _t===null}function aE(_t){return _t==null}function tv(_t){return typeof _t=="number"||ws(_t)&&Hs(_t)==pr}function np(_t){if(!ws(_t)||Hs(_t)!=Mr)return!1;var kt=Ap(_t);if(kt===null)return!0;var Ut=cs.call(kt,"constructor")&&kt.constructor;return typeof Ut=="function"&&Ut instanceof Ut&&Ep.call(Ut)==ty}var J0=Bo?no(Bo):ix;function cE(_t){return Q1(_t)&&_t>=-At&&_t<=At}var rv=Uu?no(Uu):sx;function e0(_t){return typeof _t=="string"||!Dn(_t)&&ws(_t)&&Hs(_t)==kr}function so(_t){return typeof _t=="symbol"||ws(_t)&&Hs(_t)==Ar}var Au=Jl?no(Jl):ox;function lE(_t){return _t===$}function uE(_t){return ws(_t)&&Us(_t)==Or}function dE(_t){return ws(_t)&&Hs(_t)==Br}var fE=Vp(A0),hE=Vp(function(_t,kt){return _t<=kt});function nv(_t){if(!_t)return[];if(Qs(_t))return e0(_t)?Co(_t):Js(_t);if(Vu&&_t[Vu])return Hv(_t[Vu]());var kt=Us(_t),Ut=kt==xr?h0:kt==Rr?bp:$u;return Ut(_t)}function ba(_t){if(!_t)return _t===0?_t:0;if(_t=xo(_t),_t===xt||_t===-xt){var kt=_t<0?-1:1;return kt*Rt}return _t===_t?_t:0}function zn(_t){var kt=ba(_t),Ut=kt%1;return kt===kt?Ut?kt-Ut:kt:0}function iv(_t){return _t?ru(zn(_t),0,Tt):0}function xo(_t){if(typeof _t=="number")return _t;if(so(_t))return St;if(Es(_t)){var kt=typeof _t.valueOf=="function"?_t.valueOf():_t;_t=Es(kt)?kt+"":kt}if(typeof _t!="string")return _t===0?_t:+_t;_t=Em(_t);var Ut=ds.test(_t);return Ut||hs.test(_t)?rn(_t.slice(2),Ut?2:8):_n.test(_t)?St:+_t}function sv(_t){return Fo(_t,eo(_t))}function pE(_t){return _t?ru(zn(_t),-At,At):_t===0?_t:0}function os(_t){return _t==null?"":io(_t)}var mE=wu(function(_t,kt){if(tp(kt)||Qs(kt)){Fo(kt,Ns(kt),_t);return}for(var Ut in kt)cs.call(kt,Ut)&&Zu(_t,Ut,kt[Ut])}),ov=wu(function(_t,kt){Fo(kt,eo(kt),_t)}),t0=wu(function(_t,kt,Ut,rr){Fo(kt,eo(kt),_t,rr)}),gE=wu(function(_t,kt,Ut,rr){Fo(kt,Ns(kt),_t,rr)}),vE=Qo(b0);function yE(_t,kt){var Ut=Eu(_t);return kt==null?Ut:Lm(Ut,kt)}var bE=Hn(function(_t,kt){_t=ys(_t);var Ut=-1,rr=kt.length,dr=rr>2?kt[2]:$;for(dr&&Vs(kt[0],kt[1],dr)&&(rr=1);++Ut1),br}),Fo(_t,D0(_t),Ut),rr&&(Ut=vo(Ut,at|ut|ht,Cx));for(var dr=kt.length;dr--;)k0(Ut,kt[dr]);return Ut});function BE(_t,kt){return cv(_t,Jp(On(kt)))}var DE=Qo(function(_t,kt){return _t==null?{}:ux(_t,kt)});function cv(_t,kt){if(_t==null)return{};var Ut=xs(D0(_t),function(rr){return[rr]});return kt=On(kt),Jm(_t,Ut,function(rr,dr){return kt(rr,dr[0])})}function FE(_t,kt,Ut){kt=Bl(kt,_t);var rr=-1,dr=kt.length;for(dr||(dr=1,_t=$);++rrkt){var rr=_t;_t=kt,kt=rr}if(Ut||_t%1||kt%1){var dr=Im();return zs(_t+dr*(kt-_t+Dr("1e-"+((dr+"").length-1))),kt)}return T0(_t,kt)}var XE=Su(function(_t,kt,Ut){return kt=kt.toLowerCase(),_t+(Ut?dv(kt):kt)});function dv(_t){return tm(os(_t).toLowerCase())}function fv(_t){return _t=os(_t),_t&&_t.replace(Vn,Bv).replace(Ps,"")}function JE(_t,kt,Ut){_t=os(_t),kt=io(kt);var rr=_t.length;Ut=Ut===$?rr:ru(zn(Ut),0,rr);var dr=Ut;return Ut-=kt.length,Ut>=0&&_t.slice(Ut,dr)==kt}function QE(_t){return _t=os(_t),_t&&ln.test(_t)?_t.replace(Qr,Dv):_t}function ew(_t){return _t=os(_t),_t&&Rn.test(_t)?_t.replace(Kr,"\\$&"):_t}var tw=Su(function(_t,kt,Ut){return _t+(Ut?"-":"")+kt.toLowerCase()}),rw=Su(function(_t,kt,Ut){return _t+(Ut?" ":"")+kt.toLowerCase()}),nw=p1("toLowerCase");function iw(_t,kt,Ut){_t=os(_t),kt=zn(kt);var rr=kt?vu(_t):0;if(!kt||rr>=kt)return _t;var dr=(kt-rr)/2;return Hp(Cp(dr),Ut)+_t+Hp(Pp(dr),Ut)}function sw(_t,kt,Ut){_t=os(_t),kt=zn(kt);var rr=kt?vu(_t):0;return kt&&rr>>0,Ut?(_t=os(_t),_t&&(typeof kt=="string"||kt!=null&&!J0(kt))&&(kt=io(kt),!kt&&gu(_t))?Dl(Co(_t),0,Ut):_t.split(kt,Ut)):[]}var fw=Su(function(_t,kt,Ut){return _t+(Ut?" ":"")+tm(kt)});function hw(_t,kt,Ut){return _t=os(_t),Ut=Ut==null?0:ru(zn(Ut),0,_t.length),kt=io(kt),_t.slice(Ut,Ut+kt.length)==kt}function pw(_t,kt,Ut){var rr=vr.templateSettings;Ut&&Vs(_t,kt,Ut)&&(kt=$),_t=os(_t),kt=t0({},kt,rr,E1);var dr=t0({},kt.imports,rr.imports,E1),br=Ns(dr),$r=f0(dr,br),Ir,Nr,en=0,tn=kt.interpolate||ss,sn="__p += '",$n=p0((kt.escape||ss).source+"|"+tn.source+"|"+(tn===un?Pn:ss).source+"|"+(kt.evaluate||ss).source+"|$","g"),Mn="//# sourceURL="+(cs.call(kt,"sourceURL")?(kt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Xl+"]")+` +`)}function Dx(_t){return Dn(_t)||ou(_t)||!!(km&&_t&&_t[km])}function na(_t,kt){var Ut=typeof _t;return kt=kt??At,!!kt&&(Ut=="number"||Ut!="symbol"&&ps.test(_t))&&_t>-1&&_t%1==0&&_t0){if(++kt>=bt)return arguments[0]}else kt=0;return _t.apply($,arguments)}}function Wp(_t,kt){var Ut=-1,rr=_t.length,dr=rr-1;for(kt=kt===$?rr:kt;++Ut1?_t[kt-1]:$;return Ut=typeof Ut=="function"?(_t.pop(),Ut):$,U1(_t,Ut)});function H1(_t){var kt=vr(_t);return kt.__chain__=!0,kt}function Y2(_t,kt){return kt(_t),_t}function Gp(_t,kt){return kt(_t)}var X2=Qo(function(_t){var kt=_t.length,Ut=kt?_t[0]:0,rr=this.__wrapped__,dr=function(br){return b0(br,_t)};return kt>1||this.__actions__.length||!(rr instanceof Kn)||!na(Ut)?this.thru(dr):(rr=rr.slice(Ut,+Ut+(kt?1:0)),rr.__actions__.push({func:Gp,args:[dr],thisArg:$}),new go(rr,this.__chain__).thru(function(br){return kt&&!br.length&&br.push($),br}))});function J2(){return H1(this)}function Q2(){return new go(this.value(),this.__chain__)}function e_(){this.__values__===$&&(this.__values__=nv(this.value()));var _t=this.__index__>=this.__values__.length,kt=_t?$:this.__values__[this.__index__++];return{done:_t,value:kt}}function t_(){return this}function r_(_t){for(var kt,Ut=this;Ut instanceof Ip;){var rr=N1(Ut);rr.__index__=0,rr.__values__=$,kt?dr.__wrapped__=rr:kt=rr;var dr=rr;Ut=Ut.__wrapped__}return dr.__wrapped__=_t,kt}function n_(){var _t=this.__wrapped__;if(_t instanceof Kn){var kt=_t;return this.__actions__.length&&(kt=new Kn(this)),kt=kt.reverse(),kt.__actions__.push({func:Gp,args:[W0],thisArg:$}),new go(kt,this.__chain__)}return this.thru(W0)}function i_(){return i1(this.__wrapped__,this.__actions__)}var s_=Fp(function(_t,kt,Ut){cs.call(_t,Ut)?++_t[Ut]:Xo(_t,Ut,1)});function o_(_t,kt,Ut){var rr=Dn(_t)?vm:Gy;return Ut&&Vs(_t,kt,Ut)&&(kt=$),rr(_t,On(kt,3))}function a_(_t,kt){var Ut=Dn(_t)?Cl:zm;return Ut(_t,On(kt,3))}var c_=m1(L1),l_=m1(B1);function u_(_t,kt){return Fs(Zp(_t,kt),1)}function d_(_t,kt){return Fs(Zp(_t,kt),xt)}function f_(_t,kt,Ut){return Ut=Ut===$?1:zn(Ut),Fs(Zp(_t,kt),Ut)}function V1(_t,kt){var Ut=Dn(_t)?po:Nl;return Ut(_t,On(kt,3))}function q1(_t,kt){var Ut=Dn(_t)?Pv:Fm;return Ut(_t,On(kt,3))}var h_=Fp(function(_t,kt,Ut){cs.call(_t,Ut)?_t[Ut].push(kt):Xo(_t,Ut,[kt])});function p_(_t,kt,Ut,rr){_t=Qs(_t)?_t:$u(_t),Ut=Ut&&!rr?zn(Ut):0;var dr=_t.length;return Ut<0&&(Ut=ks(dr+Ut,0)),e0(_t)?Ut<=dr&&_t.indexOf(kt,Ut)>-1:!!dr&&mu(_t,kt,Ut)>-1}var m_=Hn(function(_t,kt,Ut){var rr=-1,dr=typeof kt=="function",br=Qs(_t)?Ur(_t.length):[];return Nl(_t,function(Pr){br[++rr]=dr?Os(kt,Pr,Ut):Xu(Pr,kt,Ut)}),br}),g_=Fp(function(_t,kt,Ut){Xo(_t,Ut,kt)});function Zp(_t,kt){var Ut=Dn(_t)?xs:Wm;return Ut(_t,On(kt,3))}function v_(_t,kt,Ut,rr){return _t==null?[]:(Dn(kt)||(kt=kt==null?[]:[kt]),Ut=rr?$:Ut,Dn(Ut)||(Ut=Ut==null?[]:[Ut]),Xm(_t,kt,Ut))}var y_=Fp(function(_t,kt,Ut){_t[Ut?0:1].push(kt)},function(){return[[],[]]});function b_(_t,kt,Ut){var rr=Dn(_t)?o0:_m,dr=arguments.length<3;return rr(_t,On(kt,4),Ut,dr,Nl)}function x_(_t,kt,Ut){var rr=Dn(_t)?Cv:_m,dr=arguments.length<3;return rr(_t,On(kt,4),Ut,dr,Fm)}function __(_t,kt){var Ut=Dn(_t)?Cl:zm;return Ut(_t,Jp(On(kt,3)))}function E_(_t){var kt=Dn(_t)?Nm:hx;return kt(_t)}function w_(_t,kt,Ut){(Ut?Vs(_t,kt,Ut):kt===$)?kt=1:kt=zn(kt);var rr=Dn(_t)?Hy:mx;return rr(_t,kt)}function S_(_t){var kt=Dn(_t)?Vy:vx;return kt(_t)}function R_(_t){if(_t==null)return 0;if(Qs(_t))return e0(_t)?vu(_t):_t.length;var kt=Us(_t);return kt==xr||kt==Sr?_t.size:R0(_t).length}function A_(_t,kt,Ut){var rr=Dn(_t)?a0:yx;return Ut&&Vs(_t,kt,Ut)&&(kt=$),rr(_t,On(kt,3))}var $_=Hn(function(_t,kt){if(_t==null)return[];var Ut=kt.length;return Ut>1&&Vs(_t,kt[0],kt[1])?kt=[]:Ut>2&&Vs(kt[0],kt[1],kt[2])&&(kt=[kt[0]]),Xm(_t,Fs(kt,1),[])}),Yp=sy||function(){return cn.Date.now()};function T_(_t,kt){if(typeof kt!="function")throw new mo(rt);return _t=zn(_t),function(){if(--_t<1)return kt.apply(this,arguments)}}function K1(_t,kt,Ut){return kt=Ut?$:kt,kt=_t&&kt==null?_t.length:kt,Jo(_t,Ot,$,$,$,$,kt)}function W1(_t,kt){var Ut;if(typeof kt!="function")throw new mo(rt);return _t=zn(_t),function(){return--_t>0&&(Ut=kt.apply(this,arguments)),_t<=1&&(kt=$),Ut}}var Z0=Hn(function(_t,kt,Ut){var rr=Ct;if(Ut.length){var dr=Il(Ut,Ru(Z0));rr|=Dt}return Jo(_t,rr,kt,Ut,dr)}),G1=Hn(function(_t,kt,Ut){var rr=Ct|Pt;if(Ut.length){var dr=Il(Ut,Ru(G1));rr|=Dt}return Jo(kt,rr,_t,Ut,dr)});function Z1(_t,kt,Ut){kt=Ut?$:kt;var rr=Jo(_t,Mt,$,$,$,$,$,kt);return rr.placeholder=Z1.placeholder,rr}function Y1(_t,kt,Ut){kt=Ut?$:kt;var rr=Jo(_t,Bt,$,$,$,$,$,kt);return rr.placeholder=Y1.placeholder,rr}function X1(_t,kt,Ut){var rr,dr,br,Pr,Ir,Nr,en=0,tn=!1,sn=!1,$n=!0;if(typeof _t!="function")throw new mo(rt);kt=xo(kt)||0,Es(Ut)&&(tn=!!Ut.leading,sn="maxWait"in Ut,br=sn?ks(xo(Ut.maxWait)||0,kt):br,$n="trailing"in Ut?!!Ut.trailing:$n);function Mn(As){var Io=rr,xa=dr;return rr=dr=$,en=As,Pr=_t.apply(xa,Io),Pr}function jn(As){return en=As,Ir=rp(qn,kt),tn?Mn(As):Pr}function Un(As){var Io=As-Nr,xa=As-en,gv=kt-Io;return sn?zs(gv,br-xa):gv}function Nn(As){var Io=As-Nr,xa=As-en;return Nr===$||Io>=kt||Io<0||sn&&xa>=br}function qn(){var As=Yp();if(Nn(As))return Gn(As);Ir=rp(qn,Un(As))}function Gn(As){return Ir=$,$n&&rr?Mn(As):(rr=dr=$,Pr)}function oo(){Ir!==$&&o1(Ir),en=0,rr=Nr=dr=Ir=$}function qs(){return Ir===$?Pr:Gn(Yp())}function ao(){var As=Yp(),Io=Nn(As);if(rr=arguments,dr=this,Nr=As,Io){if(Ir===$)return jn(Nr);if(sn)return o1(Ir),Ir=rp(qn,kt),Mn(Nr)}return Ir===$&&(Ir=rp(qn,kt)),Pr}return ao.cancel=oo,ao.flush=qs,ao}var P_=Hn(function(_t,kt){return Dm(_t,1,kt)}),C_=Hn(function(_t,kt,Ut){return Dm(_t,xo(kt)||0,Ut)});function k_(_t){return Jo(_t,Lt)}function Xp(_t,kt){if(typeof _t!="function"||kt!=null&&typeof kt!="function")throw new mo(rt);var Ut=function(){var rr=arguments,dr=kt?kt.apply(this,rr):rr[0],br=Ut.cache;if(br.has(dr))return br.get(dr);var Pr=_t.apply(this,rr);return Ut.cache=br.set(dr,Pr)||br,Pr};return Ut.cache=new(Xp.Cache||Yo),Ut}Xp.Cache=Yo;function Jp(_t){if(typeof _t!="function")throw new mo(rt);return function(){var kt=arguments;switch(kt.length){case 0:return!_t.call(this);case 1:return!_t.call(this,kt[0]);case 2:return!_t.call(this,kt[0],kt[1]);case 3:return!_t.call(this,kt[0],kt[1],kt[2])}return!_t.apply(this,kt)}}function M_(_t){return W1(2,_t)}var I_=bx(function(_t,kt){kt=kt.length==1&&Dn(kt[0])?xs(kt[0],no(On())):xs(Fs(kt,1),no(On()));var Ut=kt.length;return Hn(function(rr){for(var dr=-1,br=zs(rr.length,Ut);++dr=kt}),ou=Vm(function(){return arguments}())?Vm:function(_t){return ws(_t)&&cs.call(_t,"callee")&&!Cm.call(_t,"callee")},Dn=Ur.isArray,G_=_s?no(_s):ex;function Qs(_t){return _t!=null&&Qp(_t.length)&&!ga(_t)}function Rs(_t){return ws(_t)&&Qs(_t)}function Z_(_t){return _t===!0||_t===!1||ws(_t)&&Hs(_t)==Kt}var Fl=ay||am,Y_=Ds?no(Ds):tx;function X_(_t){return ws(_t)&&_t.nodeType===1&&!np(_t)}function J_(_t){if(_t==null)return!0;if(Qs(_t)&&(Dn(_t)||typeof _t=="string"||typeof _t.splice=="function"||Fl(_t)||Au(_t)||ou(_t)))return!_t.length;var kt=Us(_t);if(kt==xr||kt==Sr)return!_t.size;if(tp(_t))return!R0(_t).length;for(var Ut in _t)if(cs.call(_t,Ut))return!1;return!0}function Q_(_t,kt){return Ju(_t,kt)}function eE(_t,kt,Ut){Ut=typeof Ut=="function"?Ut:$;var rr=Ut?Ut(_t,kt):$;return rr===$?Ju(_t,kt,$,Ut):!!rr}function X0(_t){if(!ws(_t))return!1;var kt=Hs(_t);return kt==qt||kt==Ht||typeof _t.message=="string"&&typeof _t.name=="string"&&!np(_t)}function tE(_t){return typeof _t=="number"&&Mm(_t)}function ga(_t){if(!Es(_t))return!1;var kt=Hs(_t);return kt==Jt||kt==ur||kt==Zt||kt==fr}function Q1(_t){return typeof _t=="number"&&_t==zn(_t)}function Qp(_t){return typeof _t=="number"&&_t>-1&&_t%1==0&&_t<=At}function Es(_t){var kt=typeof _t;return _t!=null&&(kt=="object"||kt=="function")}function ws(_t){return _t!=null&&typeof _t=="object"}var ev=ho?no(ho):nx;function rE(_t,kt){return _t===kt||S0(_t,kt,z0(kt))}function nE(_t,kt,Ut){return Ut=typeof Ut=="function"?Ut:$,S0(_t,kt,z0(kt),Ut)}function iE(_t){return tv(_t)&&_t!=+_t}function sE(_t){if(Ux(_t))throw new Bn(tt);return qm(_t)}function oE(_t){return _t===null}function aE(_t){return _t==null}function tv(_t){return typeof _t=="number"||ws(_t)&&Hs(_t)==pr}function np(_t){if(!ws(_t)||Hs(_t)!=Mr)return!1;var kt=Ap(_t);if(kt===null)return!0;var Ut=cs.call(kt,"constructor")&&kt.constructor;return typeof Ut=="function"&&Ut instanceof Ut&&Ep.call(Ut)==ty}var J0=Bo?no(Bo):ix;function cE(_t){return Q1(_t)&&_t>=-At&&_t<=At}var rv=Uu?no(Uu):sx;function e0(_t){return typeof _t=="string"||!Dn(_t)&&ws(_t)&&Hs(_t)==kr}function so(_t){return typeof _t=="symbol"||ws(_t)&&Hs(_t)==Ar}var Au=Jl?no(Jl):ox;function lE(_t){return _t===$}function uE(_t){return ws(_t)&&Us(_t)==Or}function dE(_t){return ws(_t)&&Hs(_t)==Br}var fE=Vp(A0),hE=Vp(function(_t,kt){return _t<=kt});function nv(_t){if(!_t)return[];if(Qs(_t))return e0(_t)?Co(_t):Js(_t);if(Vu&&_t[Vu])return Hv(_t[Vu]());var kt=Us(_t),Ut=kt==xr?h0:kt==Sr?bp:$u;return Ut(_t)}function ba(_t){if(!_t)return _t===0?_t:0;if(_t=xo(_t),_t===xt||_t===-xt){var kt=_t<0?-1:1;return kt*Rt}return _t===_t?_t:0}function zn(_t){var kt=ba(_t),Ut=kt%1;return kt===kt?Ut?kt-Ut:kt:0}function iv(_t){return _t?ru(zn(_t),0,Tt):0}function xo(_t){if(typeof _t=="number")return _t;if(so(_t))return St;if(Es(_t)){var kt=typeof _t.valueOf=="function"?_t.valueOf():_t;_t=Es(kt)?kt+"":kt}if(typeof _t!="string")return _t===0?_t:+_t;_t=Em(_t);var Ut=ds.test(_t);return Ut||hs.test(_t)?rn(_t.slice(2),Ut?2:8):_n.test(_t)?St:+_t}function sv(_t){return Fo(_t,eo(_t))}function pE(_t){return _t?ru(zn(_t),-At,At):_t===0?_t:0}function os(_t){return _t==null?"":io(_t)}var mE=wu(function(_t,kt){if(tp(kt)||Qs(kt)){Fo(kt,Ns(kt),_t);return}for(var Ut in kt)cs.call(kt,Ut)&&Zu(_t,Ut,kt[Ut])}),ov=wu(function(_t,kt){Fo(kt,eo(kt),_t)}),t0=wu(function(_t,kt,Ut,rr){Fo(kt,eo(kt),_t,rr)}),gE=wu(function(_t,kt,Ut,rr){Fo(kt,Ns(kt),_t,rr)}),vE=Qo(b0);function yE(_t,kt){var Ut=Eu(_t);return kt==null?Ut:Lm(Ut,kt)}var bE=Hn(function(_t,kt){_t=ys(_t);var Ut=-1,rr=kt.length,dr=rr>2?kt[2]:$;for(dr&&Vs(kt[0],kt[1],dr)&&(rr=1);++Ut1),br}),Fo(_t,D0(_t),Ut),rr&&(Ut=vo(Ut,at|ut|ht,Cx));for(var dr=kt.length;dr--;)k0(Ut,kt[dr]);return Ut});function BE(_t,kt){return cv(_t,Jp(On(kt)))}var DE=Qo(function(_t,kt){return _t==null?{}:ux(_t,kt)});function cv(_t,kt){if(_t==null)return{};var Ut=xs(D0(_t),function(rr){return[rr]});return kt=On(kt),Jm(_t,Ut,function(rr,dr){return kt(rr,dr[0])})}function FE(_t,kt,Ut){kt=Bl(kt,_t);var rr=-1,dr=kt.length;for(dr||(dr=1,_t=$);++rrkt){var rr=_t;_t=kt,kt=rr}if(Ut||_t%1||kt%1){var dr=Im();return zs(_t+dr*(kt-_t+Dr("1e-"+((dr+"").length-1))),kt)}return T0(_t,kt)}var XE=Su(function(_t,kt,Ut){return kt=kt.toLowerCase(),_t+(Ut?dv(kt):kt)});function dv(_t){return tm(os(_t).toLowerCase())}function fv(_t){return _t=os(_t),_t&&_t.replace(Vn,Bv).replace(Ps,"")}function JE(_t,kt,Ut){_t=os(_t),kt=io(kt);var rr=_t.length;Ut=Ut===$?rr:ru(zn(Ut),0,rr);var dr=Ut;return Ut-=kt.length,Ut>=0&&_t.slice(Ut,dr)==kt}function QE(_t){return _t=os(_t),_t&&ln.test(_t)?_t.replace(Qr,Dv):_t}function ew(_t){return _t=os(_t),_t&&Rn.test(_t)?_t.replace(Kr,"\\$&"):_t}var tw=Su(function(_t,kt,Ut){return _t+(Ut?"-":"")+kt.toLowerCase()}),rw=Su(function(_t,kt,Ut){return _t+(Ut?" ":"")+kt.toLowerCase()}),nw=p1("toLowerCase");function iw(_t,kt,Ut){_t=os(_t),kt=zn(kt);var rr=kt?vu(_t):0;if(!kt||rr>=kt)return _t;var dr=(kt-rr)/2;return Hp(Cp(dr),Ut)+_t+Hp(Pp(dr),Ut)}function sw(_t,kt,Ut){_t=os(_t),kt=zn(kt);var rr=kt?vu(_t):0;return kt&&rr>>0,Ut?(_t=os(_t),_t&&(typeof kt=="string"||kt!=null&&!J0(kt))&&(kt=io(kt),!kt&&gu(_t))?Dl(Co(_t),0,Ut):_t.split(kt,Ut)):[]}var fw=Su(function(_t,kt,Ut){return _t+(Ut?" ":"")+tm(kt)});function hw(_t,kt,Ut){return _t=os(_t),Ut=Ut==null?0:ru(zn(Ut),0,_t.length),kt=io(kt),_t.slice(Ut,Ut+kt.length)==kt}function pw(_t,kt,Ut){var rr=vr.templateSettings;Ut&&Vs(_t,kt,Ut)&&(kt=$),_t=os(_t),kt=t0({},kt,rr,E1);var dr=t0({},kt.imports,rr.imports,E1),br=Ns(dr),Pr=f0(dr,br),Ir,Nr,en=0,tn=kt.interpolate||ss,sn="__p += '",$n=p0((kt.escape||ss).source+"|"+tn.source+"|"+(tn===un?Pn:ss).source+"|"+(kt.evaluate||ss).source+"|$","g"),Mn="//# sourceURL="+(cs.call(kt,"sourceURL")?(kt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Xl+"]")+` `;_t.replace($n,function(Nn,qn,Gn,oo,qs,ao){return Gn||(Gn=oo),sn+=_t.slice(en,ao).replace(Jn,Fv),qn&&(Ir=!0,sn+=`' + __e(`+qn+`) + '`),qs&&(Nr=!0,sn+=`'; @@ -414,17 +414,17 @@ __p += '`),Gn&&(sn+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+sn+`return __p -}`;var Un=pv(function(){return ns(br,Mn+"return "+sn).apply($,$r)});if(Un.source=sn,X0(Un))throw Un;return Un}function mw(_t){return os(_t).toLowerCase()}function gw(_t){return os(_t).toUpperCase()}function yw(_t,kt,Ut){if(_t=os(_t),_t&&(Ut||kt===$))return Em(_t);if(!_t||!(kt=io(kt)))return _t;var rr=Co(_t),dr=Co(kt),br=wm(rr,dr),$r=Sm(rr,dr)+1;return Dl(rr,br,$r).join("")}function bw(_t,kt,Ut){if(_t=os(_t),_t&&(Ut||kt===$))return _t.slice(0,Am(_t)+1);if(!_t||!(kt=io(kt)))return _t;var rr=Co(_t),dr=Sm(rr,Co(kt))+1;return Dl(rr,0,dr).join("")}function xw(_t,kt,Ut){if(_t=os(_t),_t&&(Ut||kt===$))return _t.replace(dn,"");if(!_t||!(kt=io(kt)))return _t;var rr=Co(_t),dr=wm(rr,Co(kt));return Dl(rr,dr).join("")}function _w(_t,kt){var Ut=Ft,rr=jt;if(Es(kt)){var dr="separator"in kt?kt.separator:dr;Ut="length"in kt?zn(kt.length):Ut,rr="omission"in kt?io(kt.omission):rr}_t=os(_t);var br=_t.length;if(gu(_t)){var $r=Co(_t);br=$r.length}if(Ut>=br)return _t;var Ir=Ut-vu(rr);if(Ir<1)return rr;var Nr=$r?Dl($r,0,Ir).join(""):_t.slice(0,Ir);if(dr===$)return Nr+rr;if($r&&(Ir+=Nr.length-Ir),J0(dr)){if(_t.slice(Ir).search(dr)){var en,tn=Nr;for(dr.global||(dr=p0(dr.source,os(yn.exec(dr))+"g")),dr.lastIndex=0;en=dr.exec(tn);)var sn=en.index;Nr=Nr.slice(0,sn===$?Ir:sn)}}else if(_t.indexOf(io(dr),Ir)!=Ir){var $n=Nr.lastIndexOf(dr);$n>-1&&(Nr=Nr.slice(0,$n))}return Nr+rr}function Ew(_t){return _t=os(_t),_t&&mn.test(_t)?_t.replace(Jr,Wv):_t}var ww=Su(function(_t,kt,Ut){return _t+(Ut?" ":"")+kt.toUpperCase()}),tm=p1("toUpperCase");function hv(_t,kt,Ut){return _t=os(_t),kt=Ut?$:kt,kt===$?Uv(_t)?Yv(_t):Iv(_t):_t.match(kt)||[]}var pv=Hn(function(_t,kt){try{return Os(_t,$,kt)}catch(Ut){return X0(Ut)?Ut:new Bn(Ut)}}),Sw=Qo(function(_t,kt){return po(kt,function(Ut){Ut=zo(Ut),Xo(_t,Ut,Z0(_t[Ut],_t))}),_t});function Rw(_t){var kt=_t==null?0:_t.length,Ut=On();return _t=kt?xs(_t,function(rr){if(typeof rr[1]!="function")throw new mo(rt);return[Ut(rr[0]),rr[1]]}):[],Hn(function(rr){for(var dr=-1;++drAt)return[];var Ut=Tt,rr=zs(_t,Tt);kt=On(kt),_t-=Tt;for(var dr=d0(rr,kt);++Ut<_t;)kt(Ut);return dr}function Kw(_t){return Dn(_t)?xs(_t,zo):so(_t)?[_t]:Js(j1(os(_t)))}function Ww(_t){var kt=++ey;return os(_t)+kt}var Gw=Up(function(_t,kt){return _t+kt},0),Zw=L0("ceil"),Yw=Up(function(_t,kt){return _t/kt},1),Xw=L0("floor");function Jw(_t){return _t&&_t.length?jp(_t,to,E0):$}function Qw(_t,kt){return _t&&_t.length?jp(_t,On(kt,2),E0):$}function eS(_t){return xm(_t,to)}function tS(_t,kt){return xm(_t,On(kt,2))}function rS(_t){return _t&&_t.length?jp(_t,to,A0):$}function nS(_t,kt){return _t&&_t.length?jp(_t,On(kt,2),A0):$}var iS=Up(function(_t,kt){return _t*kt},1),sS=L0("round"),oS=Up(function(_t,kt){return _t-kt},0);function aS(_t){return _t&&_t.length?u0(_t,to):0}function cS(_t,kt){return _t&&_t.length?u0(_t,On(kt,2)):0}return vr.after=T_,vr.ary=K1,vr.assign=mE,vr.assignIn=ov,vr.assignInWith=t0,vr.assignWith=gE,vr.at=vE,vr.before=W1,vr.bind=Z0,vr.bindAll=Sw,vr.bindKey=G1,vr.castArray=F_,vr.chain=H1,vr.chunk=Zx,vr.compact=Yx,vr.concat=Xx,vr.cond=Rw,vr.conforms=Aw,vr.constant=rm,vr.countBy=s_,vr.create=yE,vr.curry=Z1,vr.curryRight=Y1,vr.debounce=X1,vr.defaults=bE,vr.defaultsDeep=xE,vr.defer=P_,vr.delay=C_,vr.difference=Jx,vr.differenceBy=Qx,vr.differenceWith=e2,vr.drop=t2,vr.dropRight=r2,vr.dropRightWhile=n2,vr.dropWhile=i2,vr.fill=s2,vr.filter=a_,vr.flatMap=u_,vr.flatMapDeep=d_,vr.flatMapDepth=f_,vr.flatten=D1,vr.flattenDeep=o2,vr.flattenDepth=a2,vr.flip=k_,vr.flow=Tw,vr.flowRight=Pw,vr.fromPairs=c2,vr.functions=TE,vr.functionsIn=PE,vr.groupBy=h_,vr.initial=u2,vr.intersection=d2,vr.intersectionBy=f2,vr.intersectionWith=h2,vr.invert=kE,vr.invertBy=ME,vr.invokeMap=m_,vr.iteratee=nm,vr.keyBy=g_,vr.keys=Ns,vr.keysIn=eo,vr.map=Zp,vr.mapKeys=OE,vr.mapValues=jE,vr.matches=Cw,vr.matchesProperty=kw,vr.memoize=Xp,vr.merge=NE,vr.mergeWith=av,vr.method=Mw,vr.methodOf=Iw,vr.mixin=im,vr.negate=Jp,vr.nthArg=jw,vr.omit=LE,vr.omitBy=BE,vr.once=M_,vr.orderBy=v_,vr.over=Nw,vr.overArgs=I_,vr.overEvery=Lw,vr.overSome=Bw,vr.partial=Y0,vr.partialRight=J1,vr.partition=y_,vr.pick=DE,vr.pickBy=cv,vr.property=mv,vr.propertyOf=Dw,vr.pull=v2,vr.pullAll=z1,vr.pullAllBy=y2,vr.pullAllWith=b2,vr.pullAt=x2,vr.range=Fw,vr.rangeRight=zw,vr.rearg=O_,vr.reject=__,vr.remove=_2,vr.rest=j_,vr.reverse=W0,vr.sampleSize=w_,vr.set=zE,vr.setWith=UE,vr.shuffle=S_,vr.slice=E2,vr.sortBy=$_,vr.sortedUniq=P2,vr.sortedUniqBy=C2,vr.split=dw,vr.spread=N_,vr.tail=k2,vr.take=M2,vr.takeRight=I2,vr.takeRightWhile=O2,vr.takeWhile=j2,vr.tap=Y2,vr.throttle=L_,vr.thru=Gp,vr.toArray=nv,vr.toPairs=lv,vr.toPairsIn=uv,vr.toPath=Kw,vr.toPlainObject=sv,vr.transform=HE,vr.unary=B_,vr.union=N2,vr.unionBy=L2,vr.unionWith=B2,vr.uniq=D2,vr.uniqBy=F2,vr.uniqWith=z2,vr.unset=VE,vr.unzip=G0,vr.unzipWith=U1,vr.update=qE,vr.updateWith=KE,vr.values=$u,vr.valuesIn=WE,vr.without=U2,vr.words=hv,vr.wrap=D_,vr.xor=H2,vr.xorBy=V2,vr.xorWith=q2,vr.zip=K2,vr.zipObject=W2,vr.zipObjectDeep=G2,vr.zipWith=Z2,vr.entries=lv,vr.entriesIn=uv,vr.extend=ov,vr.extendWith=t0,im(vr,vr),vr.add=Gw,vr.attempt=pv,vr.camelCase=XE,vr.capitalize=dv,vr.ceil=Zw,vr.clamp=GE,vr.clone=z_,vr.cloneDeep=H_,vr.cloneDeepWith=V_,vr.cloneWith=U_,vr.conformsTo=q_,vr.deburr=fv,vr.defaultTo=$w,vr.divide=Yw,vr.endsWith=JE,vr.eq=Mo,vr.escape=QE,vr.escapeRegExp=ew,vr.every=o_,vr.find=c_,vr.findIndex=L1,vr.findKey=_E,vr.findLast=l_,vr.findLastIndex=B1,vr.findLastKey=wE,vr.floor=Xw,vr.forEach=V1,vr.forEachRight=q1,vr.forIn=SE,vr.forInRight=RE,vr.forOwn=AE,vr.forOwnRight=$E,vr.get=Q0,vr.gt=K_,vr.gte=W_,vr.has=CE,vr.hasIn=em,vr.head=F1,vr.identity=to,vr.includes=p_,vr.indexOf=l2,vr.inRange=ZE,vr.invoke=IE,vr.isArguments=ou,vr.isArray=Dn,vr.isArrayBuffer=G_,vr.isArrayLike=Qs,vr.isArrayLikeObject=Rs,vr.isBoolean=Z_,vr.isBuffer=Fl,vr.isDate=Y_,vr.isElement=X_,vr.isEmpty=J_,vr.isEqual=Q_,vr.isEqualWith=eE,vr.isError=X0,vr.isFinite=tE,vr.isFunction=ga,vr.isInteger=Q1,vr.isLength=Qp,vr.isMap=ev,vr.isMatch=rE,vr.isMatchWith=nE,vr.isNaN=iE,vr.isNative=sE,vr.isNil=aE,vr.isNull=oE,vr.isNumber=tv,vr.isObject=Es,vr.isObjectLike=ws,vr.isPlainObject=np,vr.isRegExp=J0,vr.isSafeInteger=cE,vr.isSet=rv,vr.isString=e0,vr.isSymbol=so,vr.isTypedArray=Au,vr.isUndefined=lE,vr.isWeakMap=uE,vr.isWeakSet=dE,vr.join=p2,vr.kebabCase=tw,vr.last=bo,vr.lastIndexOf=m2,vr.lowerCase=rw,vr.lowerFirst=nw,vr.lt=fE,vr.lte=hE,vr.max=Jw,vr.maxBy=Qw,vr.mean=eS,vr.meanBy=tS,vr.min=rS,vr.minBy=nS,vr.stubArray=om,vr.stubFalse=am,vr.stubObject=Uw,vr.stubString=Hw,vr.stubTrue=Vw,vr.multiply=iS,vr.nth=g2,vr.noConflict=Ow,vr.noop=sm,vr.now=Yp,vr.pad=iw,vr.padEnd=sw,vr.padStart=ow,vr.parseInt=aw,vr.random=YE,vr.reduce=b_,vr.reduceRight=x_,vr.repeat=cw,vr.replace=lw,vr.result=FE,vr.round=sS,vr.runInContext=jr,vr.sample=E_,vr.size=R_,vr.snakeCase=uw,vr.some=A_,vr.sortedIndex=w2,vr.sortedIndexBy=S2,vr.sortedIndexOf=R2,vr.sortedLastIndex=A2,vr.sortedLastIndexBy=$2,vr.sortedLastIndexOf=T2,vr.startCase=fw,vr.startsWith=hw,vr.subtract=oS,vr.sum=aS,vr.sumBy=cS,vr.template=pw,vr.times=qw,vr.toFinite=ba,vr.toInteger=zn,vr.toLength=iv,vr.toLower=mw,vr.toNumber=xo,vr.toSafeInteger=pE,vr.toString=os,vr.toUpper=gw,vr.trim=yw,vr.trimEnd=bw,vr.trimStart=xw,vr.truncate=_w,vr.unescape=Ew,vr.uniqueId=Ww,vr.upperCase=ww,vr.upperFirst=tm,vr.each=V1,vr.eachRight=q1,vr.first=F1,im(vr,function(){var _t={};return Do(vr,function(kt,Ut){cs.call(vr.prototype,Ut)||(_t[Ut]=kt)}),_t}(),{chain:!1}),vr.VERSION=j,po(["bind","bindKey","curry","curryRight","partial","partialRight"],function(_t){vr[_t].placeholder=vr}),po(["drop","take"],function(_t,kt){Kn.prototype[_t]=function(Ut){Ut=Ut===$?1:ks(zn(Ut),0);var rr=this.__filtered__&&!kt?new Kn(this):this.clone();return rr.__filtered__?rr.__takeCount__=zs(Ut,rr.__takeCount__):rr.__views__.push({size:zs(Ut,Tt),type:_t+(rr.__dir__<0?"Right":"")}),rr},Kn.prototype[_t+"Right"]=function(Ut){return this.reverse()[_t](Ut).reverse()}}),po(["filter","map","takeWhile"],function(_t,kt){var Ut=kt+1,rr=Ut==ct||Ut==mt;Kn.prototype[_t]=function(dr){var br=this.clone();return br.__iteratees__.push({iteratee:On(dr,3),type:Ut}),br.__filtered__=br.__filtered__||rr,br}}),po(["head","last"],function(_t,kt){var Ut="take"+(kt?"Right":"");Kn.prototype[_t]=function(){return this[Ut](1).value()[0]}}),po(["initial","tail"],function(_t,kt){var Ut="drop"+(kt?"":"Right");Kn.prototype[_t]=function(){return this.__filtered__?new Kn(this):this[Ut](1)}}),Kn.prototype.compact=function(){return this.filter(to)},Kn.prototype.find=function(_t){return this.filter(_t).head()},Kn.prototype.findLast=function(_t){return this.reverse().find(_t)},Kn.prototype.invokeMap=Hn(function(_t,kt){return typeof _t=="function"?new Kn(this):this.map(function(Ut){return Xu(Ut,_t,kt)})}),Kn.prototype.reject=function(_t){return this.filter(Jp(On(_t)))},Kn.prototype.slice=function(_t,kt){_t=zn(_t);var Ut=this;return Ut.__filtered__&&(_t>0||kt<0)?new Kn(Ut):(_t<0?Ut=Ut.takeRight(-_t):_t&&(Ut=Ut.drop(_t)),kt!==$&&(kt=zn(kt),Ut=kt<0?Ut.dropRight(-kt):Ut.take(kt-_t)),Ut)},Kn.prototype.takeRightWhile=function(_t){return this.reverse().takeWhile(_t).reverse()},Kn.prototype.toArray=function(){return this.take(Tt)},Do(Kn.prototype,function(_t,kt){var Ut=/^(?:filter|find|map|reject)|While$/.test(kt),rr=/^(?:head|last)$/.test(kt),dr=vr[rr?"take"+(kt=="last"?"Right":""):kt],br=rr||/^find/.test(kt);dr&&(vr.prototype[kt]=function(){var $r=this.__wrapped__,Ir=rr?[1]:arguments,Nr=$r instanceof Kn,en=Ir[0],tn=Nr||Dn($r),sn=function(qn){var Gn=dr.apply(vr,Ml([qn],Ir));return rr&&$n?Gn[0]:Gn};tn&&Ut&&typeof en=="function"&&en.length!=1&&(Nr=tn=!1);var $n=this.__chain__,Mn=!!this.__actions__.length,jn=br&&!$n,Un=Nr&&!Mn;if(!br&&tn){$r=Un?$r:new Kn(this);var Nn=_t.apply($r,Ir);return Nn.__actions__.push({func:Gp,args:[sn],thisArg:$}),new go(Nn,$n)}return jn&&Un?_t.apply(this,Ir):(Nn=this.thru(sn),jn?rr?Nn.value()[0]:Nn.value():Nn)})}),po(["pop","push","shift","sort","splice","unshift"],function(_t){var kt=xp[_t],Ut=/^(?:push|sort|unshift)$/.test(_t)?"tap":"thru",rr=/^(?:pop|shift)$/.test(_t);vr.prototype[_t]=function(){var dr=arguments;if(rr&&!this.__chain__){var br=this.value();return kt.apply(Dn(br)?br:[],dr)}return this[Ut](function($r){return kt.apply(Dn($r)?$r:[],dr)})}}),Do(Kn.prototype,function(_t,kt){var Ut=vr[kt];if(Ut){var rr=Ut.name+"";cs.call(_u,rr)||(_u[rr]=[]),_u[rr].push({name:kt,func:Ut})}}),_u[zp($,Pt).name]=[{name:"wrapper",func:$}],Kn.prototype.clone=yy,Kn.prototype.reverse=by,Kn.prototype.value=xy,vr.prototype.at=X2,vr.prototype.chain=J2,vr.prototype.commit=Q2,vr.prototype.next=e_,vr.prototype.plant=r_,vr.prototype.reverse=n_,vr.prototype.toJSON=vr.prototype.valueOf=vr.prototype.value=i_,vr.prototype.first=vr.prototype.head,Vu&&(vr.prototype[Vu]=t_),vr},yu=Xv();Ln?((Ln.exports=yu)._=yu,wn._=yu):cn._=yu}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports,isCheckBoxInput=a=>a.type==="checkbox",isDateObject=a=>a instanceof Date,isNullOrUndefined=a=>a==null;const isObjectType=a=>typeof a=="object";var isObject$4=a=>!isNullOrUndefined(a)&&!Array.isArray(a)&&isObjectType(a)&&!isDateObject(a),getEventValue=a=>isObject$4(a)&&a.target?isCheckBoxInput(a.target)?a.target.checked:a.target.value:a,getNodeParentName=a=>a.substring(0,a.search(/\.\d+(\.|$)/))||a,isNameInFieldArray=(a,_)=>a.has(getNodeParentName(_)),isPlainObject$6=a=>{const _=a.constructor&&a.constructor.prototype;return isObject$4(_)&&_.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(a){let _;const $=Array.isArray(a);if(a instanceof Date)_=new Date(a);else if(a instanceof Set)_=new Set(a);else if(!(isWeb&&(a instanceof Blob||a instanceof FileList))&&($||isObject$4(a)))if(_=$?[]:{},!$&&!isPlainObject$6(a))_=a;else for(const j in a)a.hasOwnProperty(j)&&(_[j]=cloneObject(a[j]));else return a;return _}var compact=a=>Array.isArray(a)?a.filter(Boolean):[],isUndefined$2=a=>a===void 0,get$2=(a,_,$)=>{if(!_||!isObject$4(a))return $;const j=compact(_.split(/[,[\].]+?/)).reduce((et,tt)=>isNullOrUndefined(et)?et:et[tt],a);return isUndefined$2(j)||j===a?isUndefined$2(a[_])?$:a[_]:j},isBoolean$3=a=>typeof a=="boolean";const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$2.createContext(null),useFormContext=()=>React$2.useContext(HookFormContext),FormProvider=a=>{const{children:_,...$}=a;return React$2.createElement(HookFormContext.Provider,{value:$},_)};var getProxyFormState=(a,_,$,j=!0)=>{const et={defaultValues:_._defaultValues};for(const tt in a)Object.defineProperty(et,tt,{get:()=>{const rt=tt;return _._proxyFormState[rt]!==VALIDATION_MODE.all&&(_._proxyFormState[rt]=!j||VALIDATION_MODE.all),a[rt]}});return et},isEmptyObject=a=>isObject$4(a)&&!Object.keys(a).length,shouldRenderFormState=(a,_,$,j)=>{$(a);const{name:et,...tt}=a;return isEmptyObject(tt)||Object.keys(tt).length>=Object.keys(_).length||Object.keys(tt).find(rt=>_[rt]===VALIDATION_MODE.all)},convertToArrayPayload=a=>Array.isArray(a)?a:[a];function useSubscribe(a){const _=React$2.useRef(a);_.current=a,React$2.useEffect(()=>{const $=!a.disabled&&_.current.subject&&_.current.subject.subscribe({next:_.current.next});return()=>{$&&$.unsubscribe()}},[a.disabled])}var isString$3=a=>typeof a=="string",generateWatchOutput=(a,_,$,j,et)=>isString$3(a)?(j&&_.watch.add(a),get$2($,a,et)):Array.isArray(a)?a.map(tt=>(j&&_.watch.add(tt),get$2($,tt))):(j&&(_.watchAll=!0),$),isKey=a=>/^\w*$/.test(a),stringToPath$2=a=>compact(a.replace(/["|']|\]/g,"").split(/\.|\[/)),set$2=(a,_,$)=>{let j=-1;const et=isKey(_)?[_]:stringToPath$2(_),tt=et.length,rt=tt-1;for(;++j_?{...$[a],types:{...$[a]&&$[a].types?$[a].types:{},[j]:et||!0}}:{},generateId=()=>{const a=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,_=>{const $=(Math.random()*16+a)%16|0;return(_=="x"?$:$&3|8).toString(16)})},getFocusFieldName=(a,_,$={})=>$.shouldFocus||isUndefined$2($.shouldFocus)?$.focusName||`${a}.${isUndefined$2($.focusIndex)?_:$.focusIndex}.`:"",getValidationModes=a=>({isOnSubmit:!a||a===VALIDATION_MODE.onSubmit,isOnBlur:a===VALIDATION_MODE.onBlur,isOnChange:a===VALIDATION_MODE.onChange,isOnAll:a===VALIDATION_MODE.all,isOnTouch:a===VALIDATION_MODE.onTouched}),isWatched=(a,_,$)=>!$&&(_.watchAll||_.watch.has(a)||[..._.watch].some(j=>a.startsWith(j)&&/^\.\w+/.test(a.slice(j.length))));const iterateFieldsByAction=(a,_,$,j)=>{for(const et of $||Object.keys(a)){const tt=get$2(a,et);if(tt){const{_f:rt,...nt}=tt;if(rt){if(rt.refs&&rt.refs[0]&&_(rt.refs[0],et)&&!j)break;if(rt.ref&&_(rt.ref,rt.name)&&!j)break;iterateFieldsByAction(nt,_)}else isObject$4(nt)&&iterateFieldsByAction(nt,_)}}};var updateFieldArrayRootError=(a,_,$)=>{const j=compact(get$2(a,$));return set$2(j,"root",_[$]),set$2(a,$,j),a},isFileInput=a=>a.type==="file",isFunction$4=a=>typeof a=="function",isHTMLElement=a=>{if(!isWeb)return!1;const _=a?a.ownerDocument:0;return a instanceof(_&&_.defaultView?_.defaultView.HTMLElement:HTMLElement)},isMessage=a=>isString$3(a),isRadioInput=a=>a.type==="radio",isRegex=a=>a instanceof RegExp;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=a=>{if(Array.isArray(a)){if(a.length>1){const _=a.filter($=>$&&$.checked&&!$.disabled).map($=>$.value);return{value:_,isValid:!!_.length}}return a[0].checked&&!a[0].disabled?a[0].attributes&&!isUndefined$2(a[0].attributes.value)?isUndefined$2(a[0].value)||a[0].value===""?validResult:{value:a[0].value,isValid:!0}:validResult:defaultResult}return defaultResult};const defaultReturn={isValid:!1,value:null};var getRadioValue=a=>Array.isArray(a)?a.reduce((_,$)=>$&&$.checked&&!$.disabled?{isValid:!0,value:$.value}:_,defaultReturn):defaultReturn;function getValidateError(a,_,$="validate"){if(isMessage(a)||Array.isArray(a)&&a.every(isMessage)||isBoolean$3(a)&&!a)return{type:$,message:isMessage(a)?a:"",ref:_}}var getValueAndMessage=a=>isObject$4(a)&&!isRegex(a)?a:{value:a,message:""},validateField=async(a,_,$,j,et)=>{const{ref:tt,refs:rt,required:nt,maxLength:it,minLength:st,min:ot,max:at,pattern:ut,validate:ht,name:yt,valueAsNumber:wt,mount:Ct,disabled:Pt}=a._f,$t=get$2(_,yt);if(!Ct||Pt)return{};const Mt=rt?rt[0]:tt,Bt=bt=>{j&&Mt.reportValidity&&(Mt.setCustomValidity(isBoolean$3(bt)?"":bt||""),Mt.reportValidity())},Dt={},zt=isRadioInput(tt),Ot=isCheckBoxInput(tt),It=zt||Ot,Lt=(wt||isFileInput(tt))&&isUndefined$2(tt.value)&&isUndefined$2($t)||isHTMLElement(tt)&&tt.value===""||$t===""||Array.isArray($t)&&!$t.length,Ft=appendErrors.bind(null,yt,$,Dt),jt=(bt,vt,ct,dt=INPUT_VALIDATION_RULES.maxLength,mt=INPUT_VALIDATION_RULES.minLength)=>{const xt=bt?vt:ct;Dt[yt]={type:bt?dt:mt,message:xt,ref:tt,...Ft(bt?dt:mt,xt)}};if(et?!Array.isArray($t)||!$t.length:nt&&(!It&&(Lt||isNullOrUndefined($t))||isBoolean$3($t)&&!$t||Ot&&!getCheckboxValue(rt).isValid||zt&&!getRadioValue(rt).isValid)){const{value:bt,message:vt}=isMessage(nt)?{value:!!nt,message:nt}:getValueAndMessage(nt);if(bt&&(Dt[yt]={type:INPUT_VALIDATION_RULES.required,message:vt,ref:Mt,...Ft(INPUT_VALIDATION_RULES.required,vt)},!$))return Bt(vt),Dt}if(!Lt&&(!isNullOrUndefined(ot)||!isNullOrUndefined(at))){let bt,vt;const ct=getValueAndMessage(at),dt=getValueAndMessage(ot);if(!isNullOrUndefined($t)&&!isNaN($t)){const mt=tt.valueAsNumber||$t&&+$t;isNullOrUndefined(ct.value)||(bt=mt>ct.value),isNullOrUndefined(dt.value)||(vt=mtnew Date(new Date().toDateString()+" "+St),At=tt.type=="time",Rt=tt.type=="week";isString$3(ct.value)&&$t&&(bt=At?xt($t)>xt(ct.value):Rt?$t>ct.value:mt>new Date(ct.value)),isString$3(dt.value)&&$t&&(vt=At?xt($t)+bt.value,dt=!isNullOrUndefined(vt.value)&&$t.length<+vt.value;if((ct||dt)&&(jt(ct,bt.message,vt.message),!$))return Bt(Dt[yt].message),Dt}if(ut&&!Lt&&isString$3($t)){const{value:bt,message:vt}=getValueAndMessage(ut);if(isRegex(bt)&&!$t.match(bt)&&(Dt[yt]={type:INPUT_VALIDATION_RULES.pattern,message:vt,ref:tt,...Ft(INPUT_VALIDATION_RULES.pattern,vt)},!$))return Bt(vt),Dt}if(ht){if(isFunction$4(ht)){const bt=await ht($t,_),vt=getValidateError(bt,Mt);if(vt&&(Dt[yt]={...vt,...Ft(INPUT_VALIDATION_RULES.validate,vt.message)},!$))return Bt(vt.message),Dt}else if(isObject$4(ht)){let bt={};for(const vt in ht){if(!isEmptyObject(bt)&&!$)break;const ct=getValidateError(await ht[vt]($t,_),Mt,vt);ct&&(bt={...ct,...Ft(vt,ct.message)},Bt(ct.message),$&&(Dt[yt]=bt))}if(!isEmptyObject(bt)&&(Dt[yt]={ref:Mt,...bt},!$))return Dt}}return Bt(!0),Dt},appendAt=(a,_)=>[...a,...convertToArrayPayload(_)],fillEmptyArray=a=>Array.isArray(a)?a.map(()=>{}):void 0;function insert$1(a,_,$){return[...a.slice(0,_),...convertToArrayPayload($),...a.slice(_)]}var moveArrayAt=(a,_,$)=>Array.isArray(a)?(isUndefined$2(a[$])&&(a[$]=void 0),a.splice($,0,a.splice(_,1)[0]),a):[],prependAt=(a,_)=>[...convertToArrayPayload(_),...convertToArrayPayload(a)];function removeAtIndexes(a,_){let $=0;const j=[...a];for(const et of _)j.splice(et-$,1),$++;return compact(j).length?j:[]}var removeArrayAt=(a,_)=>isUndefined$2(_)?[]:removeAtIndexes(a,convertToArrayPayload(_).sort(($,j)=>$-j)),swapArrayAt=(a,_,$)=>{[a[_],a[$]]=[a[$],a[_]]};function baseGet(a,_){const $=_.slice(0,-1).length;let j=0;for(;j<$;)a=isUndefined$2(a)?j++:a[_[j++]];return a}function isEmptyArray(a){for(const _ in a)if(a.hasOwnProperty(_)&&!isUndefined$2(a[_]))return!1;return!0}function unset(a,_){const $=Array.isArray(_)?_:isKey(_)?[_]:stringToPath$2(_),j=$.length===1?a:baseGet(a,$),et=$.length-1,tt=$[et];return j&&delete j[tt],et!==0&&(isObject$4(j)&&isEmptyObject(j)||Array.isArray(j)&&isEmptyArray(j))&&unset(a,$.slice(0,-1)),a}var updateAt=(a,_,$)=>(a[_]=$,a);function useFieldArray(a){const _=useFormContext(),{control:$=_.control,name:j,keyName:et="id",shouldUnregister:tt}=a,[rt,nt]=React$2.useState($._getFieldArray(j)),it=React$2.useRef($._getFieldArray(j).map(generateId)),st=React$2.useRef(rt),ot=React$2.useRef(j),at=React$2.useRef(!1);ot.current=j,st.current=rt,$._names.array.add(j),a.rules&&$.register(j,a.rules),useSubscribe({next:({values:Dt,name:zt})=>{if(zt===ot.current||!zt){const Ot=get$2(Dt,ot.current);Array.isArray(Ot)&&(nt(Ot),it.current=Ot.map(generateId))}},subject:$._subjects.array});const ut=React$2.useCallback(Dt=>{at.current=!0,$._updateFieldArray(j,Dt)},[$,j]),ht=(Dt,zt)=>{const Ot=convertToArrayPayload(cloneObject(Dt)),It=appendAt($._getFieldArray(j),Ot);$._names.focus=getFocusFieldName(j,It.length-1,zt),it.current=appendAt(it.current,Ot.map(generateId)),ut(It),nt(It),$._updateFieldArray(j,It,appendAt,{argA:fillEmptyArray(Dt)})},yt=(Dt,zt)=>{const Ot=convertToArrayPayload(cloneObject(Dt)),It=prependAt($._getFieldArray(j),Ot);$._names.focus=getFocusFieldName(j,0,zt),it.current=prependAt(it.current,Ot.map(generateId)),ut(It),nt(It),$._updateFieldArray(j,It,prependAt,{argA:fillEmptyArray(Dt)})},wt=Dt=>{const zt=removeArrayAt($._getFieldArray(j),Dt);it.current=removeArrayAt(it.current,Dt),ut(zt),nt(zt),$._updateFieldArray(j,zt,removeArrayAt,{argA:Dt})},Ct=(Dt,zt,Ot)=>{const It=convertToArrayPayload(cloneObject(zt)),Lt=insert$1($._getFieldArray(j),Dt,It);$._names.focus=getFocusFieldName(j,Dt,Ot),it.current=insert$1(it.current,Dt,It.map(generateId)),ut(Lt),nt(Lt),$._updateFieldArray(j,Lt,insert$1,{argA:Dt,argB:fillEmptyArray(zt)})},Pt=(Dt,zt)=>{const Ot=$._getFieldArray(j);swapArrayAt(Ot,Dt,zt),swapArrayAt(it.current,Dt,zt),ut(Ot),nt(Ot),$._updateFieldArray(j,Ot,swapArrayAt,{argA:Dt,argB:zt},!1)},$t=(Dt,zt)=>{const Ot=$._getFieldArray(j);moveArrayAt(Ot,Dt,zt),moveArrayAt(it.current,Dt,zt),ut(Ot),nt(Ot),$._updateFieldArray(j,Ot,moveArrayAt,{argA:Dt,argB:zt},!1)},Mt=(Dt,zt)=>{const Ot=cloneObject(zt),It=updateAt($._getFieldArray(j),Dt,Ot);it.current=[...It].map((Lt,Ft)=>!Lt||Ft===Dt?generateId():it.current[Ft]),ut(It),nt([...It]),$._updateFieldArray(j,It,updateAt,{argA:Dt,argB:Ot},!0,!1)},Bt=Dt=>{const zt=convertToArrayPayload(cloneObject(Dt));it.current=zt.map(generateId),ut([...zt]),nt([...zt]),$._updateFieldArray(j,[...zt],Ot=>Ot,{},!0,!1)};return React$2.useEffect(()=>{if($._state.action=!1,isWatched(j,$._names)&&$._subjects.state.next({...$._formState}),at.current&&(!getValidationModes($._options.mode).isOnSubmit||$._formState.isSubmitted))if($._options.resolver)$._executeSchema([j]).then(Dt=>{const zt=get$2(Dt.errors,j),Ot=get$2($._formState.errors,j);(Ot?!zt&&Ot.type||zt&&(Ot.type!==zt.type||Ot.message!==zt.message):zt&&zt.type)&&(zt?set$2($._formState.errors,j,zt):unset($._formState.errors,j),$._subjects.state.next({errors:$._formState.errors}))});else{const Dt=get$2($._fields,j);Dt&&Dt._f&&!(getValidationModes($._options.reValidateMode).isOnSubmit&&getValidationModes($._options.mode).isOnSubmit)&&validateField(Dt,$._formValues,$._options.criteriaMode===VALIDATION_MODE.all,$._options.shouldUseNativeValidation,!0).then(zt=>!isEmptyObject(zt)&&$._subjects.state.next({errors:updateFieldArrayRootError($._formState.errors,zt,j)}))}$._subjects.values.next({name:j,values:{...$._formValues}}),$._names.focus&&iterateFieldsByAction($._fields,(Dt,zt)=>{if($._names.focus&&zt.startsWith($._names.focus)&&Dt.focus)return Dt.focus(),1}),$._names.focus="",$._updateValid(),at.current=!1},[rt,j,$]),React$2.useEffect(()=>(!get$2($._formValues,j)&&$._updateFieldArray(j),()=>{($._options.shouldUnregister||tt)&&$.unregister(j)}),[j,$,et,tt]),{swap:React$2.useCallback(Pt,[ut,j,$]),move:React$2.useCallback($t,[ut,j,$]),prepend:React$2.useCallback(yt,[ut,j,$]),append:React$2.useCallback(ht,[ut,j,$]),remove:React$2.useCallback(wt,[ut,j,$]),insert:React$2.useCallback(Ct,[ut,j,$]),update:React$2.useCallback(Mt,[ut,j,$]),replace:React$2.useCallback(Bt,[ut,j,$]),fields:React$2.useMemo(()=>rt.map((Dt,zt)=>({...Dt,[et]:it.current[zt]||generateId()})),[rt,et])}}var createSubject=()=>{let a=[];return{get observers(){return a},next:et=>{for(const tt of a)tt.next&&tt.next(et)},subscribe:et=>(a.push(et),{unsubscribe:()=>{a=a.filter(tt=>tt!==et)}}),unsubscribe:()=>{a=[]}}},isPrimitive=a=>isNullOrUndefined(a)||!isObjectType(a);function deepEqual$1(a,_){if(isPrimitive(a)||isPrimitive(_))return a===_;if(isDateObject(a)&&isDateObject(_))return a.getTime()===_.getTime();const $=Object.keys(a),j=Object.keys(_);if($.length!==j.length)return!1;for(const et of $){const tt=a[et];if(!j.includes(et))return!1;if(et!=="ref"){const rt=_[et];if(isDateObject(tt)&&isDateObject(rt)||isObject$4(tt)&&isObject$4(rt)||Array.isArray(tt)&&Array.isArray(rt)?!deepEqual$1(tt,rt):tt!==rt)return!1}}return!0}var isMultipleSelect=a=>a.type==="select-multiple",isRadioOrCheckbox=a=>isRadioInput(a)||isCheckBoxInput(a),live=a=>isHTMLElement(a)&&a.isConnected,objectHasFunction=a=>{for(const _ in a)if(isFunction$4(a[_]))return!0;return!1};function markFieldsDirty(a,_={}){const $=Array.isArray(a);if(isObject$4(a)||$)for(const j in a)Array.isArray(a[j])||isObject$4(a[j])&&!objectHasFunction(a[j])?(_[j]=Array.isArray(a[j])?[]:{},markFieldsDirty(a[j],_[j])):isNullOrUndefined(a[j])||(_[j]=!0);return _}function getDirtyFieldsFromDefaultValues(a,_,$){const j=Array.isArray(a);if(isObject$4(a)||j)for(const et in a)Array.isArray(a[et])||isObject$4(a[et])&&!objectHasFunction(a[et])?isUndefined$2(_)||isPrimitive($[et])?$[et]=Array.isArray(a[et])?markFieldsDirty(a[et],[]):{...markFieldsDirty(a[et])}:getDirtyFieldsFromDefaultValues(a[et],isNullOrUndefined(_)?{}:_[et],$[et]):$[et]=!deepEqual$1(a[et],_[et]);return $}var getDirtyFields=(a,_)=>getDirtyFieldsFromDefaultValues(a,_,markFieldsDirty(_)),getFieldValueAs=(a,{valueAsNumber:_,valueAsDate:$,setValueAs:j})=>isUndefined$2(a)?a:_?a===""?NaN:a&&+a:$&&isString$3(a)?new Date(a):j?j(a):a;function getFieldValue(a){const _=a.ref;if(!(a.refs?a.refs.every($=>$.disabled):_.disabled))return isFileInput(_)?_.files:isRadioInput(_)?getRadioValue(a.refs).value:isMultipleSelect(_)?[..._.selectedOptions].map(({value:$})=>$):isCheckBoxInput(_)?getCheckboxValue(a.refs).value:getFieldValueAs(isUndefined$2(_.value)?a.ref.value:_.value,a)}var getResolverOptions=(a,_,$,j)=>{const et={};for(const tt of a){const rt=get$2(_,tt);rt&&set$2(et,tt,rt._f)}return{criteriaMode:$,names:[...a],fields:et,shouldUseNativeValidation:j}},getRuleValue=a=>isUndefined$2(a)?a:isRegex(a)?a.source:isObject$4(a)?isRegex(a.value)?a.value.source:a.value:a,hasValidation=a=>a.mount&&(a.required||a.min||a.max||a.maxLength||a.minLength||a.pattern||a.validate);function schemaErrorLookup(a,_,$){const j=get$2(a,$);if(j||isKey($))return{error:j,name:$};const et=$.split(".");for(;et.length;){const tt=et.join("."),rt=get$2(_,tt),nt=get$2(a,tt);if(rt&&!Array.isArray(rt)&&$!==tt)return{name:$};if(nt&&nt.type)return{name:tt,error:nt};et.pop()}return{name:$}}var skipValidation=(a,_,$,j,et)=>et.isOnAll?!1:!$&&et.isOnTouch?!(_||a):($?j.isOnBlur:et.isOnBlur)?!a:($?j.isOnChange:et.isOnChange)?a:!0,unsetEmptyArray=(a,_)=>!compact(get$2(a,_)).length&&unset(a,_);const defaultOptions$1={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(a={}){let _={...defaultOptions$1,...a},$={submitCount:0,isDirty:!1,isLoading:isFunction$4(_.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:_.errors||{},disabled:_.disabled||!1},j={},et=isObject$4(_.defaultValues)||isObject$4(_.values)?cloneObject(_.defaultValues||_.values)||{}:{},tt=_.shouldUnregister?{}:cloneObject(et),rt={action:!1,mount:!1,watch:!1},nt={mount:new Set,unMount:new Set,array:new Set,watch:new Set},it,st=0;const ot={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},at={values:createSubject(),array:createSubject(),state:createSubject()},ut=getValidationModes(_.mode),ht=getValidationModes(_.reValidateMode),yt=_.criteriaMode===VALIDATION_MODE.all,wt=lr=>fr=>{clearTimeout(st),st=setTimeout(lr,fr)},Ct=async lr=>{if(ot.isValid||lr){const fr=_.resolver?isEmptyObject((await It()).errors):await Ft(j,!0);fr!==$.isValid&&at.state.next({isValid:fr})}},Pt=(lr,fr)=>{(ot.isValidating||ot.validatingFields)&&((lr||Array.from(nt.mount)).forEach(_r=>{_r&&(fr?set$2($.validatingFields,_r,fr):unset($.validatingFields,_r))}),at.state.next({validatingFields:$.validatingFields,isValidating:!isEmptyObject($.validatingFields)}))},$t=(lr,fr=[],_r,Rr,kr=!0,Ar=!0)=>{if(Rr&&_r){if(rt.action=!0,Ar&&Array.isArray(get$2(j,lr))){const Pr=_r(get$2(j,lr),Rr.argA,Rr.argB);kr&&set$2(j,lr,Pr)}if(Ar&&Array.isArray(get$2($.errors,lr))){const Pr=_r(get$2($.errors,lr),Rr.argA,Rr.argB);kr&&set$2($.errors,lr,Pr),unsetEmptyArray($.errors,lr)}if(ot.touchedFields&&Ar&&Array.isArray(get$2($.touchedFields,lr))){const Pr=_r(get$2($.touchedFields,lr),Rr.argA,Rr.argB);kr&&set$2($.touchedFields,lr,Pr)}ot.dirtyFields&&($.dirtyFields=getDirtyFields(et,tt)),at.state.next({name:lr,isDirty:bt(lr,fr),dirtyFields:$.dirtyFields,errors:$.errors,isValid:$.isValid})}else set$2(tt,lr,fr)},Mt=(lr,fr)=>{set$2($.errors,lr,fr),at.state.next({errors:$.errors})},Bt=lr=>{$.errors=lr,at.state.next({errors:$.errors,isValid:!1})},Dt=(lr,fr,_r,Rr)=>{const kr=get$2(j,lr);if(kr){const Ar=get$2(tt,lr,isUndefined$2(_r)?get$2(et,lr):_r);isUndefined$2(Ar)||Rr&&Rr.defaultChecked||fr?set$2(tt,lr,fr?Ar:getFieldValue(kr._f)):dt(lr,Ar),rt.mount&&Ct()}},zt=(lr,fr,_r,Rr,kr)=>{let Ar=!1,Pr=!1;const Or={name:lr},Br=!!(get$2(j,lr)&&get$2(j,lr)._f.disabled);if(!_r||Rr){ot.isDirty&&(Pr=$.isDirty,$.isDirty=Or.isDirty=bt(),Ar=Pr!==Or.isDirty);const or=Br||deepEqual$1(get$2(et,lr),fr);Pr=!!(!Br&&get$2($.dirtyFields,lr)),or||Br?unset($.dirtyFields,lr):set$2($.dirtyFields,lr,!0),Or.dirtyFields=$.dirtyFields,Ar=Ar||ot.dirtyFields&&Pr!==!or}if(_r){const or=get$2($.touchedFields,lr);or||(set$2($.touchedFields,lr,_r),Or.touchedFields=$.touchedFields,Ar=Ar||ot.touchedFields&&or!==_r)}return Ar&&kr&&at.state.next(Or),Ar?Or:{}},Ot=(lr,fr,_r,Rr)=>{const kr=get$2($.errors,lr),Ar=ot.isValid&&isBoolean$3(fr)&&$.isValid!==fr;if(a.delayError&&_r?(it=wt(()=>Mt(lr,_r)),it(a.delayError)):(clearTimeout(st),it=null,_r?set$2($.errors,lr,_r):unset($.errors,lr)),(_r?!deepEqual$1(kr,_r):kr)||!isEmptyObject(Rr)||Ar){const Pr={...Rr,...Ar&&isBoolean$3(fr)?{isValid:fr}:{},errors:$.errors,name:lr};$={...$,...Pr},at.state.next(Pr)}},It=async lr=>{Pt(lr,!0);const fr=await _.resolver(tt,_.context,getResolverOptions(lr||nt.mount,j,_.criteriaMode,_.shouldUseNativeValidation));return Pt(lr),fr},Lt=async lr=>{const{errors:fr}=await It(lr);if(lr)for(const _r of lr){const Rr=get$2(fr,_r);Rr?set$2($.errors,_r,Rr):unset($.errors,_r)}else $.errors=fr;return fr},Ft=async(lr,fr,_r={valid:!0})=>{for(const Rr in lr){const kr=lr[Rr];if(kr){const{_f:Ar,...Pr}=kr;if(Ar){const Or=nt.array.has(Ar.name);Pt([Rr],!0);const Br=await validateField(kr,tt,yt,_.shouldUseNativeValidation&&!fr,Or);if(Pt([Rr]),Br[Ar.name]&&(_r.valid=!1,fr))break;!fr&&(get$2(Br,Ar.name)?Or?updateFieldArrayRootError($.errors,Br,Ar.name):set$2($.errors,Ar.name,Br[Ar.name]):unset($.errors,Ar.name))}Pr&&await Ft(Pr,fr,_r)}}return _r.valid},jt=()=>{for(const lr of nt.unMount){const fr=get$2(j,lr);fr&&(fr._f.refs?fr._f.refs.every(_r=>!live(_r)):!live(fr._f.ref))&&nr(lr)}nt.unMount=new Set},bt=(lr,fr)=>(lr&&fr&&set$2(tt,lr,fr),!deepEqual$1(Tt(),et)),vt=(lr,fr,_r)=>generateWatchOutput(lr,nt,{...rt.mount?tt:isUndefined$2(fr)?et:isString$3(lr)?{[lr]:fr}:fr},_r,fr),ct=lr=>compact(get$2(rt.mount?tt:et,lr,a.shouldUnregister?get$2(et,lr,[]):[])),dt=(lr,fr,_r={})=>{const Rr=get$2(j,lr);let kr=fr;if(Rr){const Ar=Rr._f;Ar&&(!Ar.disabled&&set$2(tt,lr,getFieldValueAs(fr,Ar)),kr=isHTMLElement(Ar.ref)&&isNullOrUndefined(fr)?"":fr,isMultipleSelect(Ar.ref)?[...Ar.ref.options].forEach(Pr=>Pr.selected=kr.includes(Pr.value)):Ar.refs?isCheckBoxInput(Ar.ref)?Ar.refs.length>1?Ar.refs.forEach(Pr=>(!Pr.defaultChecked||!Pr.disabled)&&(Pr.checked=Array.isArray(kr)?!!kr.find(Or=>Or===Pr.value):kr===Pr.value)):Ar.refs[0]&&(Ar.refs[0].checked=!!kr):Ar.refs.forEach(Pr=>Pr.checked=Pr.value===kr):isFileInput(Ar.ref)?Ar.ref.value="":(Ar.ref.value=kr,Ar.ref.type||at.values.next({name:lr,values:{...tt}})))}(_r.shouldDirty||_r.shouldTouch)&&zt(lr,kr,_r.shouldTouch,_r.shouldDirty,!0),_r.shouldValidate&&St(lr)},mt=(lr,fr,_r)=>{for(const Rr in fr){const kr=fr[Rr],Ar=`${lr}.${Rr}`,Pr=get$2(j,Ar);(nt.array.has(lr)||!isPrimitive(kr)||Pr&&!Pr._f)&&!isDateObject(kr)?mt(Ar,kr,_r):dt(Ar,kr,_r)}},xt=(lr,fr,_r={})=>{const Rr=get$2(j,lr),kr=nt.array.has(lr),Ar=cloneObject(fr);set$2(tt,lr,Ar),kr?(at.array.next({name:lr,values:{...tt}}),(ot.isDirty||ot.dirtyFields)&&_r.shouldDirty&&at.state.next({name:lr,dirtyFields:getDirtyFields(et,tt),isDirty:bt(lr,Ar)})):Rr&&!Rr._f&&!isNullOrUndefined(Ar)?mt(lr,Ar,_r):dt(lr,Ar,_r),isWatched(lr,nt)&&at.state.next({...$}),at.values.next({name:rt.mount?lr:void 0,values:{...tt}})},At=async lr=>{rt.mount=!0;const fr=lr.target;let _r=fr.name,Rr=!0;const kr=get$2(j,_r),Ar=()=>fr.type?getFieldValue(kr._f):getEventValue(lr),Pr=Or=>{Rr=Number.isNaN(Or)||Or===get$2(tt,_r,Or)};if(kr){let Or,Br;const or=Ar(),Yt=lr.type===EVENTS.BLUR||lr.type===EVENTS.FOCUS_OUT,er=!hasValidation(kr._f)&&!_.resolver&&!get$2($.errors,_r)&&!kr._f.deps||skipValidation(Yt,get$2($.touchedFields,_r),$.isSubmitted,ht,ut),Gt=isWatched(_r,nt,Yt);set$2(tt,_r,or),Yt?(kr._f.onBlur&&kr._f.onBlur(lr),it&&it(0)):kr._f.onChange&&kr._f.onChange(lr);const Vt=zt(_r,or,Yt,!1),Wt=!isEmptyObject(Vt)||Gt;if(!Yt&&at.values.next({name:_r,type:lr.type,values:{...tt}}),er)return ot.isValid&&Ct(),Wt&&at.state.next({name:_r,...Gt?{}:Vt});if(!Yt&&Gt&&at.state.next({...$}),_.resolver){const{errors:ar}=await It([_r]);if(Pr(or),Rr){const yr=schemaErrorLookup($.errors,j,_r),Er=schemaErrorLookup(ar,j,yr.name||_r);Or=Er.error,_r=Er.name,Br=isEmptyObject(ar)}}else Pt([_r],!0),Or=(await validateField(kr,tt,yt,_.shouldUseNativeValidation))[_r],Pt([_r]),Pr(or),Rr&&(Or?Br=!1:ot.isValid&&(Br=await Ft(j,!0)));Rr&&(kr._f.deps&&St(kr._f.deps),Ot(_r,Br,Or,Vt))}},Rt=(lr,fr)=>{if(get$2($.errors,fr)&&lr.focus)return lr.focus(),1},St=async(lr,fr={})=>{let _r,Rr;const kr=convertToArrayPayload(lr);if(_.resolver){const Ar=await Lt(isUndefined$2(lr)?lr:kr);_r=isEmptyObject(Ar),Rr=lr?!kr.some(Pr=>get$2(Ar,Pr)):_r}else lr?(Rr=(await Promise.all(kr.map(async Ar=>{const Pr=get$2(j,Ar);return await Ft(Pr&&Pr._f?{[Ar]:Pr}:Pr)}))).every(Boolean),!(!Rr&&!$.isValid)&&Ct()):Rr=_r=await Ft(j);return at.state.next({...!isString$3(lr)||ot.isValid&&_r!==$.isValid?{}:{name:lr},..._.resolver||!lr?{isValid:_r}:{},errors:$.errors}),fr.shouldFocus&&!Rr&&iterateFieldsByAction(j,Rt,lr?kr:nt.mount),Rr},Tt=lr=>{const fr={...rt.mount?tt:et};return isUndefined$2(lr)?fr:isString$3(lr)?get$2(fr,lr):lr.map(_r=>get$2(fr,_r))},Et=(lr,fr)=>({invalid:!!get$2((fr||$).errors,lr),isDirty:!!get$2((fr||$).dirtyFields,lr),isTouched:!!get$2((fr||$).touchedFields,lr),isValidating:!!get$2((fr||$).validatingFields,lr),error:get$2((fr||$).errors,lr)}),Nt=lr=>{lr&&convertToArrayPayload(lr).forEach(fr=>unset($.errors,fr)),at.state.next({errors:lr?$.errors:{}})},tr=(lr,fr,_r)=>{const Rr=(get$2(j,lr,{_f:{}})._f||{}).ref;set$2($.errors,lr,{...fr,ref:Rr}),at.state.next({name:lr,errors:$.errors,isValid:!1}),_r&&_r.shouldFocus&&Rr&&Rr.focus&&Rr.focus()},ir=(lr,fr)=>isFunction$4(lr)?at.values.subscribe({next:_r=>lr(vt(void 0,fr),_r)}):vt(lr,fr,!0),nr=(lr,fr={})=>{for(const _r of lr?convertToArrayPayload(lr):nt.mount)nt.mount.delete(_r),nt.array.delete(_r),fr.keepValue||(unset(j,_r),unset(tt,_r)),!fr.keepError&&unset($.errors,_r),!fr.keepDirty&&unset($.dirtyFields,_r),!fr.keepTouched&&unset($.touchedFields,_r),!fr.keepIsValidating&&unset($.validatingFields,_r),!_.shouldUnregister&&!fr.keepDefaultValue&&unset(et,_r);at.values.next({values:{...tt}}),at.state.next({...$,...fr.keepDirty?{isDirty:bt()}:{}}),!fr.keepIsValid&&Ct()},Zt=({disabled:lr,name:fr,field:_r,fields:Rr,value:kr})=>{if(isBoolean$3(lr)){const Ar=lr?void 0:isUndefined$2(kr)?getFieldValue(_r?_r._f:get$2(Rr,fr)._f):kr;set$2(tt,fr,Ar),zt(fr,Ar,!1,!1,!0)}},Kt=(lr,fr={})=>{let _r=get$2(j,lr);const Rr=isBoolean$3(fr.disabled);return set$2(j,lr,{..._r||{},_f:{..._r&&_r._f?_r._f:{ref:{name:lr}},name:lr,mount:!0,...fr}}),nt.mount.add(lr),_r?Zt({field:_r,disabled:fr.disabled,name:lr,value:fr.value}):Dt(lr,!0,fr.value),{...Rr?{disabled:fr.disabled}:{},..._.progressive?{required:!!fr.required,min:getRuleValue(fr.min),max:getRuleValue(fr.max),minLength:getRuleValue(fr.minLength),maxLength:getRuleValue(fr.maxLength),pattern:getRuleValue(fr.pattern)}:{},name:lr,onChange:At,onBlur:At,ref:kr=>{if(kr){Kt(lr,fr),_r=get$2(j,lr);const Ar=isUndefined$2(kr.value)&&kr.querySelectorAll&&kr.querySelectorAll("input,select,textarea")[0]||kr,Pr=isRadioOrCheckbox(Ar),Or=_r._f.refs||[];if(Pr?Or.find(Br=>Br===Ar):Ar===_r._f.ref)return;set$2(j,lr,{_f:{..._r._f,...Pr?{refs:[...Or.filter(live),Ar,...Array.isArray(get$2(et,lr))?[{}]:[]],ref:{type:Ar.type,name:lr}}:{ref:Ar}}}),Dt(lr,!1,void 0,Ar)}else _r=get$2(j,lr,{}),_r._f&&(_r._f.mount=!1),(_.shouldUnregister||fr.shouldUnregister)&&!(isNameInFieldArray(nt.array,lr)&&rt.action)&&nt.unMount.add(lr)}}},Qt=()=>_.shouldFocusError&&iterateFieldsByAction(j,Rt,nt.mount),Ht=lr=>{isBoolean$3(lr)&&(at.state.next({disabled:lr}),iterateFieldsByAction(j,(fr,_r)=>{let Rr=lr;const kr=get$2(j,_r);kr&&isBoolean$3(kr._f.disabled)&&(Rr||(Rr=kr._f.disabled)),fr.disabled=Rr},0,!1))},qt=(lr,fr)=>async _r=>{let Rr;_r&&(_r.preventDefault&&_r.preventDefault(),_r.persist&&_r.persist());let kr=cloneObject(tt);if(at.state.next({isSubmitting:!0}),_.resolver){const{errors:Ar,values:Pr}=await It();$.errors=Ar,kr=Pr}else await Ft(j);if(unset($.errors,"root"),isEmptyObject($.errors)){at.state.next({errors:{}});try{await lr(kr,_r)}catch(Ar){Rr=Ar}}else fr&&await fr({...$.errors},_r),Qt(),setTimeout(Qt);if(at.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject($.errors)&&!Rr,submitCount:$.submitCount+1,errors:$.errors}),Rr)throw Rr},Jt=(lr,fr={})=>{get$2(j,lr)&&(isUndefined$2(fr.defaultValue)?xt(lr,cloneObject(get$2(et,lr))):(xt(lr,fr.defaultValue),set$2(et,lr,cloneObject(fr.defaultValue))),fr.keepTouched||unset($.touchedFields,lr),fr.keepDirty||(unset($.dirtyFields,lr),$.isDirty=fr.defaultValue?bt(lr,cloneObject(get$2(et,lr))):bt()),fr.keepError||(unset($.errors,lr),ot.isValid&&Ct()),at.state.next({...$}))},ur=(lr,fr={})=>{const _r=lr?cloneObject(lr):et,Rr=cloneObject(_r),kr=isEmptyObject(lr),Ar=kr?et:Rr;if(fr.keepDefaultValues||(et=_r),!fr.keepValues){if(fr.keepDirtyValues)for(const Pr of nt.mount)get$2($.dirtyFields,Pr)?set$2(Ar,Pr,get$2(tt,Pr)):xt(Pr,get$2(Ar,Pr));else{if(isWeb&&isUndefined$2(lr))for(const Pr of nt.mount){const Or=get$2(j,Pr);if(Or&&Or._f){const Br=Array.isArray(Or._f.refs)?Or._f.refs[0]:Or._f.ref;if(isHTMLElement(Br)){const or=Br.closest("form");if(or){or.reset();break}}}}j={}}tt=a.shouldUnregister?fr.keepDefaultValues?cloneObject(et):{}:cloneObject(Ar),at.array.next({values:{...Ar}}),at.values.next({values:{...Ar}})}nt={mount:fr.keepDirtyValues?nt.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},rt.mount=!ot.isValid||!!fr.keepIsValid||!!fr.keepDirtyValues,rt.watch=!!a.shouldUnregister,at.state.next({submitCount:fr.keepSubmitCount?$.submitCount:0,isDirty:kr?!1:fr.keepDirty?$.isDirty:!!(fr.keepDefaultValues&&!deepEqual$1(lr,et)),isSubmitted:fr.keepIsSubmitted?$.isSubmitted:!1,dirtyFields:kr?[]:fr.keepDirtyValues?fr.keepDefaultValues&&tt?getDirtyFields(et,tt):$.dirtyFields:fr.keepDefaultValues&&lr?getDirtyFields(et,lr):{},touchedFields:fr.keepTouched?$.touchedFields:{},errors:fr.keepErrors?$.errors:{},isSubmitSuccessful:fr.keepIsSubmitSuccessful?$.isSubmitSuccessful:!1,isSubmitting:!1})},xr=(lr,fr)=>ur(isFunction$4(lr)?lr(tt):lr,fr);return{control:{register:Kt,unregister:nr,getFieldState:Et,handleSubmit:qt,setError:tr,_executeSchema:It,_getWatch:vt,_getDirty:bt,_updateValid:Ct,_removeUnmounted:jt,_updateFieldArray:$t,_updateDisabledField:Zt,_getFieldArray:ct,_reset:ur,_resetDefaultValues:()=>isFunction$4(_.defaultValues)&&_.defaultValues().then(lr=>{xr(lr,_.resetOptions),at.state.next({isLoading:!1})}),_updateFormState:lr=>{$={...$,...lr}},_disableForm:Ht,_subjects:at,_proxyFormState:ot,_setErrors:Bt,get _fields(){return j},get _formValues(){return tt},get _state(){return rt},set _state(lr){rt=lr},get _defaultValues(){return et},get _names(){return nt},set _names(lr){nt=lr},get _formState(){return $},set _formState(lr){$=lr},get _options(){return _},set _options(lr){_={..._,...lr}}},trigger:St,register:Kt,handleSubmit:qt,watch:ir,setValue:xt,getValues:Tt,reset:xr,resetField:Jt,clearErrors:Nt,unregister:nr,setError:tr,setFocus:(lr,fr={})=>{const _r=get$2(j,lr),Rr=_r&&_r._f;if(Rr){const kr=Rr.refs?Rr.refs[0]:Rr.ref;kr.focus&&(kr.focus(),fr.shouldSelect&&kr.select())}},getFieldState:Et}}function useForm(a={}){const _=React$2.useRef(),$=React$2.useRef(),[j,et]=React$2.useState({isDirty:!1,isValidating:!1,isLoading:isFunction$4(a.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:a.errors||{},disabled:a.disabled||!1,defaultValues:isFunction$4(a.defaultValues)?void 0:a.defaultValues});_.current||(_.current={...createFormControl(a),formState:j});const tt=_.current.control;return tt._options=a,useSubscribe({subject:tt._subjects.state,next:rt=>{shouldRenderFormState(rt,tt._proxyFormState,tt._updateFormState)&&et({...tt._formState})}}),React$2.useEffect(()=>tt._disableForm(a.disabled),[tt,a.disabled]),React$2.useEffect(()=>{if(tt._proxyFormState.isDirty){const rt=tt._getDirty();rt!==j.isDirty&&tt._subjects.state.next({isDirty:rt})}},[tt,j.isDirty]),React$2.useEffect(()=>{a.values&&!deepEqual$1(a.values,$.current)?(tt._reset(a.values,tt._options.resetOptions),$.current=a.values,et(rt=>({...rt}))):tt._resetDefaultValues()},[a.values,tt]),React$2.useEffect(()=>{a.errors&&tt._setErrors(a.errors)},[a.errors,tt]),React$2.useEffect(()=>{tt._state.mount||(tt._updateValid(),tt._state.mount=!0),tt._state.watch&&(tt._state.watch=!1,tt._subjects.state.next({...tt._formState})),tt._removeUnmounted()}),React$2.useEffect(()=>{a.shouldUnregister&&tt._subjects.values.next({values:tt._getWatch()})},[a.shouldUnregister,tt]),_.current.formState=getProxyFormState(j,tt),_.current}const colors={orange:"#FB4F57",orangeL:"#FC7884",blue:"#0D99FF",blueL:"#4FA2FF",green:"#00C39A",greenL:"#00E7B6",black:"#000000",white:"#FFFFFF",gray:{900:"#121212",800:"#181818",700:"#282828",600:"#2C2B2B",500:"#414141",450:"#707070",400:"#C2C2C2",300:"#D6D6D6",200:"#EBEBEB",100:"#F0F0F0",50:"#F5F5F5"}},AccountsIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"24px",height:"24px",fill:"none",textAlign:"center",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntimeExports.jsx("path",{d:"M14 5.6C14 5.03995 14 4.75992 14.109 4.54601C14.2049 4.35785 14.3578 4.20487 14.546 4.10899C14.7599 4 15.0399 4 15.6 4H18.4C18.9601 4 19.2401 4 19.454 4.10899C19.6422 4.20487 19.7951 4.35785 19.891 4.54601C20 4.75992 20 5.03995 20 5.6V8.4C20 8.96005 20 9.24008 19.891 9.45399C19.7951 9.64215 19.6422 9.79513 19.454 9.89101C19.2401 10 18.9601 10 18.4 10H15.6C15.0399 10 14.7599 10 14.546 9.89101C14.3578 9.79513 14.2049 9.64215 14.109 9.45399C14 9.24008 14 8.96005 14 8.4V5.6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M4 5.6C4 5.03995 4 4.75992 4.10899 4.54601C4.20487 4.35785 4.35785 4.20487 4.54601 4.10899C4.75992 4 5.03995 4 5.6 4H8.4C8.96005 4 9.24008 4 9.45399 4.10899C9.64215 4.20487 9.79513 4.35785 9.89101 4.54601C10 4.75992 10 5.03995 10 5.6V8.4C10 8.96005 10 9.24008 9.89101 9.45399C9.79513 9.64215 9.64215 9.79513 9.45399 9.89101C9.24008 10 8.96005 10 8.4 10H5.6C5.03995 10 4.75992 10 4.54601 9.89101C4.35785 9.79513 4.20487 9.64215 4.10899 9.45399C4 9.24008 4 8.96005 4 8.4V5.6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M4 15.6C4 15.0399 4 14.7599 4.10899 14.546C4.20487 14.3578 4.35785 14.2049 4.54601 14.109C4.75992 14 5.03995 14 5.6 14H8.4C8.96005 14 9.24008 14 9.45399 14.109C9.64215 14.2049 9.79513 14.3578 9.89101 14.546C10 14.7599 10 15.0399 10 15.6V18.4C10 18.9601 10 19.2401 9.89101 19.454C9.79513 19.6422 9.64215 19.7951 9.45399 19.891C9.24008 20 8.96005 20 8.4 20H5.6C5.03995 20 4.75992 20 4.54601 19.891C4.35785 19.7951 4.20487 19.6422 4.10899 19.454C4 19.2401 4 18.9601 4 18.4V15.6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M14 15.6C14 15.0399 14 14.7599 14.109 14.546C14.2049 14.3578 14.3578 14.2049 14.546 14.109C14.7599 14 15.0399 14 15.6 14H18.4C18.9601 14 19.2401 14 19.454 14.109C19.6422 14.2049 19.7951 14.3578 19.891 14.546C20 14.7599 20 15.0399 20 15.6V18.4C20 18.9601 20 19.2401 19.891 19.454C19.7951 19.6422 19.6422 19.7951 19.454 19.891C19.2401 20 18.9601 20 18.4 20H15.6C15.0399 20 14.7599 20 14.546 19.891C14.3578 19.7951 14.2049 19.6422 14.109 19.454C14 19.2401 14 18.9601 14 18.4V15.6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})]}),AddAccountIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M8.25 13.5H4.65C3.80992 13.5 3.38988 13.5 3.06901 13.3365C2.78677 13.1927 2.5573 12.9632 2.41349 12.681C2.25 12.3601 2.25 11.9401 2.25 11.1V5.4C2.25 4.55992 2.25 4.13988 2.41349 3.81901C2.5573 3.53677 2.78677 3.3073 3.06901 3.16349C3.38988 3 3.80992 3 4.65 3H13.35C14.1901 3 14.6101 3 14.931 3.16349C15.2132 3.3073 15.4427 3.53677 15.5865 3.81901C15.75 4.13988 15.75 4.55992 15.75 5.4V8.25M2.25 6H15.75M13.5 15V10.5M15.75 12.7506L11.25 12.75",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),AddContactIcon=a=>jsxRuntimeExports.jsx(Icon,{fill:"none",viewBox:"0 0 13 17",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M13 12.5L10.75 12.5M10.75 12.5L8.5 12.5M10.75 12.5V10.25M10.75 12.5V14.75M6.25 14.75H1C1 11.8505 3.35051 9.5 6.25 9.5C6.77123 9.5 7.27472 9.57596 7.75 9.71741M9.25 4.25C9.25 5.90685 7.90685 7.25 6.25 7.25C4.59315 7.25 3.25 5.90685 3.25 4.25C3.25 2.59315 4.59315 1.25 6.25 1.25C7.90685 1.25 9.25 2.59315 9.25 4.25Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),AddressBookIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M13.5 15.5C13.2164 14.3589 11.981 13.5 10.5 13.5C9.019 13.5 7.78364 14.3589 7.5 15.5M21 5V7M21 11V13M21 17V19M6.2 21H14.8C15.9201 21 16.4802 21 16.908 20.782C17.2843 20.5903 17.5903 20.2843 17.782 19.908C18 19.4802 18 18.9201 18 17.8V6.2C18 5.0799 18 4.51984 17.782 4.09202C17.5903 3.71569 17.2843 3.40973 16.908 3.21799C16.4802 3 15.9201 3 14.8 3H6.2C5.0799 3 4.51984 3 4.09202 3.21799C3.71569 3.40973 3.40973 3.71569 3.21799 4.09202C3 4.51984 3 5.07989 3 6.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21ZM11.5 9.5C11.5 10.0523 11.0523 10.5 10.5 10.5C9.94772 10.5 9.5 10.0523 9.5 9.5C9.5 8.94772 9.94772 8.5 10.5 8.5C11.0523 8.5 11.5 8.94772 11.5 9.5Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),BakerIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],"data-testid":"baker-icon",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3.74946 5.25V8.25M7.49946 1.5V4.5M13.4995 12V15M2.24946 6.75H5.24946M5.99946 3H8.99946M11.9995 13.5H14.9995M10.4995 5.25L12.6208 7.37132M14.6369 2.80959L15.0612 3.23385C15.3582 3.53086 15.5067 3.67937 15.5624 3.85062C15.6113 4.00125 15.6113 4.16351 15.5624 4.31414C15.5067 4.48539 15.3582 4.6339 15.0612 4.93091L4.89356 15.0985C4.59655 15.3955 4.44804 15.5441 4.2768 15.5997C4.12617 15.6486 3.9639 15.6486 3.81327 15.5997C3.64203 15.5441 3.49352 15.3955 3.19651 15.0985L2.77224 14.6743C2.47523 14.3773 2.32672 14.2288 2.27108 14.0575C2.22214 13.9069 2.22214 13.7446 2.27108 13.594C2.32672 13.4227 2.47523 13.2742 2.77224 12.9772L12.9399 2.80959C13.2369 2.51258 13.3854 2.36407 13.5566 2.30843C13.7073 2.25948 13.8695 2.25948 14.0202 2.30843C14.1914 2.36407 14.3399 2.51258 14.6369 2.80959Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),BatchIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",strokeWidth:"1.2",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M10 4V20M14 4V20M4 8C4 8.92997 4 9.39496 4.10222 9.77646C4.37962 10.8117 5.18827 11.6204 6.22354 11.8978C6.60504 12 7.07003 12 8 12H16C16.93 12 17.395 12 17.7765 11.8978C18.8117 11.6204 19.6204 10.8117 19.8978 9.77646C20 9.39496 20 8.92997 20 8M4 8C4 7.07003 4 6.60504 4.10222 6.22354C4.37962 5.18827 5.18827 4.37962 6.22354 4.10222C6.60504 4 7.07003 4 8 4H16C16.93 4 17.395 4 17.7765 4.10222C18.8117 4.37962 19.6204 5.18827 19.8978 6.22354C20 6.60504 20 7.07003 20 8M4 8V16C4 16.93 4 17.395 4.10222 17.7765C4.37962 18.8117 5.18827 19.6204 6.22354 19.8978C6.60504 20 7.07003 20 8 20H16C16.93 20 17.395 20 17.7765 19.8978C18.8117 19.6204 19.6204 18.8117 19.8978 17.7765C20 17.395 20 16.93 20 16V8M10 16H8C7.07003 16 6.60504 16 6.22354 15.8978C5.18827 15.6204 4.37962 14.8117 4.10222 13.7765C4 13.395 4 12.93 4 12M14 16H16C16.93 16 17.395 16 17.7765 15.8978C18.8117 15.6204 19.6204 14.8117 19.8978 13.7765C20 13.395 20 12.93 20 12M7 8H7.01M17 8H17.01",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round"})}),BurgerMenuIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],textAlign:"center",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4 6H20M4 12H20M4 18H20",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),CheckmarkIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M6 9.25L7.84615 11.25L12 6.75M15.75 9C15.75 12.7279 12.7279 15.75 9 15.75C5.27208 15.75 2.25 12.7279 2.25 9C2.25 5.27208 5.27208 2.25 9 2.25C12.7279 2.25 15.75 5.27208 15.75 9Z",stroke:"#00C39A",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ChevronDownIcon$1=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4.5 6.75L9 11.25L13.5 6.75",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ChevronRightIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M7 14L11.5 9.5L7 5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ChevronUpIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4.5 11.25L9 6.75L13.5 11.25",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),CoinIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12 10V14M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12ZM17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ContactIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none","data-testid":"contact-icon",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3.75 15.75C3.75 12.8505 6.10051 10.5 9 10.5C11.8995 10.5 14.25 12.8505 14.25 15.75M12 5.25C12 6.90685 10.6569 8.25 9 8.25C7.34315 8.25 6 6.90685 6 5.25C6 3.59315 7.34315 2.25 9 2.25C10.6569 2.25 12 3.59315 12 5.25Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ContractIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M7.5 12.75L6 11.25L7.5 9.75M10.5 9.75L12 11.25L10.5 12.75M9.75 2.25H6.15C5.30992 2.25 4.88988 2.25 4.56901 2.41349C4.28677 2.5573 4.0573 2.78677 3.91349 3.06901C3.75 3.38988 3.75 3.80992 3.75 4.65V13.35C3.75 14.1901 3.75 14.6101 3.91349 14.931C4.0573 15.2132 4.28677 15.4427 4.56901 15.5865C4.88988 15.75 5.30992 15.75 6.15 15.75H11.85C12.6901 15.75 13.1101 15.75 13.431 15.5865C13.7132 15.4427 13.9427 15.2132 14.0865 14.931C14.25 14.6101 14.25 14.1901 14.25 13.35V6.75M9.75 2.25L14.25 6.75M9.75 2.25V6C9.75 6.41421 10.0858 6.75 10.5 6.75H14.25",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),CrossedCircleIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M13.773 13.773C14.9945 12.5515 15.75 10.864 15.75 9C15.75 5.27208 12.7279 2.25 9 2.25C7.13604 2.25 5.44854 3.00552 4.22703 4.22703M13.773 13.773C12.5515 14.9945 10.864 15.75 9 15.75C5.27208 15.75 2.25 12.7279 2.25 9C2.25 7.13604 3.00552 5.44854 4.22703 4.22703M13.773 13.773L4.22703 4.22703",stroke:"#FB4F57",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),DiamondIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3.125 9H20.875M12 3L8 9L12 20.6667L16 9L12 3ZM12.64 20.1467L20.64 9.48C20.7691 9.30787 20.8336 9.22181 20.8585 9.12728C20.8805 9.04385 20.8805 8.95615 20.8585 8.87272C20.8336 8.77819 20.7691 8.69213 20.64 8.52L16.74 3.32C16.652 3.20267 16.608 3.144 16.5522 3.10169C16.5028 3.06421 16.4469 3.03625 16.3873 3.01922C16.32 3 16.2467 3 16.1 3H7.9C7.75333 3 7.68 3 7.61269 3.01922C7.55308 3.03625 7.49715 3.06421 7.44776 3.10169C7.392 3.144 7.348 3.20267 7.26 3.32L3.36 8.52C3.2309 8.69213 3.16635 8.77819 3.14147 8.87271C3.11951 8.95615 3.11951 9.04385 3.14147 9.12728C3.16635 9.2218 3.2309 9.30787 3.36 9.48L11.36 20.1467C11.5771 20.4362 11.6857 20.5809 11.8188 20.6327C11.9353 20.678 12.0647 20.678 12.1812 20.6327C12.3143 20.5809 12.4229 20.4362 12.64 20.1467Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),DocumentIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M9 17H13M9 13H13M9 9H10M17 18V21M17 15H17.01M13 3H8.2C7.0799 3 6.51984 3 6.09202 3.21799C5.71569 3.40973 5.40973 3.71569 5.21799 4.09202C5 4.51984 5 5.0799 5 6.2V17.8C5 18.9201 5 19.4802 5.21799 19.908C5.40973 20.2843 5.71569 20.5903 6.09202 20.782C6.51984 21 7.0799 21 8.2 21H13M13 3L19 9M13 3V7.4C13 7.96005 13 8.24008 13.109 8.45399C13.2049 8.64215 13.3578 8.79513 13.546 8.89101C13.7599 9 14.0399 9 14.6 9H19M19 9V11.5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),DoubleCheckmarkIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4 14L9 19L20 8M6 8.88889L9.07692 12L16 5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),DownloadIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"16px",height:"16px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M5 7.25L8 10.25M8 10.25L11 7.25M8 10.25V1.25M14.75 7.25V12.3494C14.75 13.1895 14.75 13.6095 14.5865 13.9304C14.4427 14.2126 14.2132 14.4421 13.931 14.5859C13.6101 14.7494 13.1901 14.7494 12.35 14.7494H3.65C2.80992 14.7494 2.38988 14.7494 2.06901 14.5859C1.78677 14.4421 1.5573 14.2126 1.41349 13.9304C1.25 13.6095 1.25 13.1895 1.25 12.3494V7.25",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),EditAccountIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M8.5 21H4C4 17.134 7.13401 14 11 14C11.1681 14 11.3348 14.0059 11.5 14.0176M15 7C15 9.20914 13.2091 11 11 11C8.79086 11 7 9.20914 7 7C7 4.79086 8.79086 3 11 3C13.2091 3 15 4.79086 15 7ZM12.5898 21L14.6148 20.595C14.7914 20.5597 14.8797 20.542 14.962 20.5097C15.0351 20.4811 15.1045 20.4439 15.1689 20.399C15.2414 20.3484 15.3051 20.2848 15.4324 20.1574L19.5898 16C20.1421 15.4477 20.1421 14.5523 19.5898 14C19.0376 13.4477 18.1421 13.4477 17.5898 14L13.4324 18.1574C13.3051 18.2848 13.2414 18.3484 13.1908 18.421C13.1459 18.4853 13.1088 18.5548 13.0801 18.6279C13.0478 18.7102 13.0302 18.7985 12.9948 18.975L12.5898 21Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ExclamationIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"12px",height:"12px",fill:"none",stroke:colors.orange,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M6 3.66667V6.58333M6 8.33333H6.00583M11.25 6C11.25 8.89949 8.89949 11.25 6 11.25C3.1005 11.25 0.75 8.89949 0.75 6C0.75 3.1005 3.1005 0.75 6 0.75C8.89949 0.75 11.25 3.1005 11.25 6Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ExitArrowIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M15 3V15M3 9H12M12 9L9 6M12 9L9 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ExternalLinkIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M15 3L9 9M15 3V6.375M15 3H11.625M14.25 9.375V12.6C14.25 13.4401 14.25 13.8601 14.0865 14.181C13.9427 14.4632 13.7132 14.6927 13.431 14.8365C13.1101 15 12.6901 15 11.85 15H5.4C4.55992 15 4.13988 15 3.81901 14.8365C3.53677 14.6927 3.3073 14.4632 3.16349 14.181C3 13.8601 3 13.4401 3 12.6V6.15C3 5.30992 3 4.88988 3.16349 4.56901C3.3073 4.28677 3.53677 4.0573 3.81901 3.91349C4.13988 3.75 4.55992 3.75 5.4 3.75H8.625",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),EyeIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"16px",height:"12px",fill:"none",viewBox:"0 0 16 12",xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntimeExports.jsx("path",{d:"M10.2501 6C10.2501 7.24264 9.2427 8.25 8.00006 8.25C6.75742 8.25 5.75006 7.24264 5.75006 6C5.75006 4.75736 6.75742 3.75 8.00006 3.75C9.2427 3.75 10.2501 4.75736 10.2501 6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M8.00039 0.75C4.64217 0.75 1.79946 2.95716 0.84375 5.99997C1.79944 9.04282 4.64217 11.25 8.00041 11.25C11.3586 11.25 14.2013 9.04284 15.157 6.00003C14.2014 2.95719 11.3586 0.75 8.00039 0.75Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})]}),EyeSlashIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M2.25024 2.25L15.7502 15.75M7.38345 7.43523C6.99147 7.84016 6.75024 8.39191 6.75024 9C6.75024 10.2426 7.7576 11.25 9.00024 11.25C9.6171 11.25 10.176 11.0018 10.5824 10.5997M4.87524 4.98536C3.45076 5.92525 2.36577 7.33796 1.84375 8.99997C2.79944 12.0428 5.64217 14.25 9.00041 14.25C10.4921 14.25 11.882 13.8145 13.0501 13.0638M8.25024 3.78705C8.49697 3.76254 8.74722 3.75 9.00039 3.75C12.3586 3.75 15.2014 5.95719 16.157 9.00003C15.9465 9.67048 15.6443 10.3004 15.2651 10.875",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),FA12Icon=a=>jsxRuntimeExports.jsx(Icon,{width:"30px",height:"15px",fill:colors.gray[450],viewBox:"1 1 30 15",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M1.2429 13V4.27273H7.02131V5.79403H3.08807V7.87358H6.63778V9.39489H3.08807V13H1.2429ZM8.67685 13H6.69957L9.71236 4.27273H12.0902L15.0987 13H13.1214L10.9354 6.26705H10.8672L8.67685 13ZM8.55327 9.5696H13.2237V11.0099H8.55327V9.5696ZM19.4847 4.27273V13H17.6396V6.02415H17.5884L15.5898 7.27699V5.64062L17.7504 4.27273H19.4847ZM22.1683 13.1108C21.8871 13.1108 21.6456 13.0114 21.4439 12.8125C21.245 12.6108 21.1456 12.3693 21.1456 12.0881C21.1456 11.8097 21.245 11.571 21.4439 11.3722C21.6456 11.1733 21.8871 11.0739 22.1683 11.0739C22.4411 11.0739 22.6797 11.1733 22.8842 11.3722C23.0888 11.571 23.1911 11.8097 23.1911 12.0881C23.1911 12.2756 23.1428 12.4474 23.0462 12.6037C22.9524 12.7571 22.8288 12.8807 22.6754 12.9744C22.522 13.0653 22.353 13.1108 22.1683 13.1108ZM24.6644 13V11.6705L27.771 8.79403C28.0352 8.53835 28.2567 8.30824 28.4357 8.10369C28.6175 7.89915 28.7553 7.69886 28.8491 7.50284C28.9428 7.30398 28.9897 7.08949 28.9897 6.85938C28.9897 6.60369 28.9315 6.38352 28.815 6.19886C28.6985 6.01136 28.5394 5.8679 28.3377 5.76847C28.136 5.66619 27.9073 5.61506 27.6516 5.61506C27.3846 5.61506 27.1516 5.66903 26.9528 5.77699C26.7539 5.88494 26.6005 6.03977 26.4925 6.24148C26.3846 6.44318 26.3306 6.68324 26.3306 6.96165H24.5792C24.5792 6.39062 24.7085 5.89489 24.967 5.47443C25.2255 5.05398 25.5877 4.72869 26.0536 4.49858C26.5195 4.26847 27.0565 4.15341 27.6644 4.15341C28.2894 4.15341 28.8335 4.2642 29.2965 4.4858C29.7624 4.70455 30.1246 5.00852 30.3832 5.39773C30.6417 5.78693 30.771 6.23295 30.771 6.7358C30.771 7.06534 30.7056 7.39062 30.5749 7.71165C30.4471 8.03267 30.2184 8.3892 29.8888 8.78125C29.5593 9.17045 29.0948 9.63778 28.4954 10.1832L27.2212 11.4318V11.4915H30.886V13H24.6644Z"})}),FA2Icon=a=>jsxRuntimeExports.jsx(Icon,{width:"23px",height:"18px",fill:colors.gray[450],viewBox:"0 0 23 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M1.0261 13V4.27273H6.80451V5.79403H2.87127V7.87358H6.42099V9.39489H2.87127V13H1.0261ZM8.46005 13H6.48278L9.49556 4.27273H11.8734L14.8819 13H12.9047L10.7186 6.26705H10.6504L8.46005 13ZM8.33647 9.5696H13.0069V11.0099H8.33647V9.5696ZM15.8812 13V11.6705L18.9877 8.79403C19.252 8.53835 19.4735 8.30824 19.6525 8.10369C19.8343 7.89915 19.9721 7.69886 20.0659 7.50284C20.1596 7.30398 20.2065 7.08949 20.2065 6.85938C20.2065 6.60369 20.1483 6.38352 20.0318 6.19886C19.9153 6.01136 19.7562 5.8679 19.5545 5.76847C19.3528 5.66619 19.1241 5.61506 18.8684 5.61506C18.6014 5.61506 18.3684 5.66903 18.1696 5.77699C17.9707 5.88494 17.8173 6.03977 17.7093 6.24148C17.6014 6.44318 17.5474 6.68324 17.5474 6.96165H15.796C15.796 6.39062 15.9252 5.89489 16.1838 5.47443C16.4423 5.05398 16.8045 4.72869 17.2704 4.49858C17.7363 4.26847 18.2733 4.15341 18.8812 4.15341C19.5062 4.15341 20.0502 4.2642 20.5133 4.4858C20.9792 4.70455 21.3414 5.00852 21.6 5.39773C21.8585 5.78693 21.9877 6.23295 21.9877 6.7358C21.9877 7.06534 21.9224 7.39062 21.7917 7.71165C21.6639 8.03267 21.4352 8.3892 21.1056 8.78125C20.7761 9.17045 20.3116 9.63778 19.7122 10.1832L18.438 11.4318V11.4915H22.1028V13H15.8812Z"})}),FetchingIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"19px",height:"19px",fill:"none",stroke:colors.gray[400],viewBox:"0 0 19 19",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M15.7842 10.2916C15.8165 10.0323 15.8332 9.76807 15.8332 9.49996C15.8332 6.00216 12.9976 3.16663 9.49984 3.16663C7.52021 3.16663 5.75273 4.07488 4.59135 5.49742M3.2155 8.70829C3.18316 8.96764 3.1665 9.23185 3.1665 9.49996C3.1665 12.9978 6.00203 15.8333 9.49984 15.8333C11.3914 15.8333 13.0893 15.004 14.2498 13.6892M11.8748 13.4583H14.2498V13.6892M4.59135 3.16663V5.49742M4.59135 5.49742V5.54157L6.96635 5.54163M14.2498 15.8333V13.6892",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),FileArrowDownIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M9 8.25V12.75M9 12.75L7.5 11.25M9 12.75L10.5 11.25M9.75 2.25H6.15C5.30992 2.25 4.88988 2.25 4.56901 2.41349C4.28677 2.5573 4.0573 2.78677 3.91349 3.06901C3.75 3.38988 3.75 3.80992 3.75 4.65V13.35C3.75 14.1901 3.75 14.6101 3.91349 14.931C4.0573 15.2132 4.28677 15.4427 4.56901 15.5865C4.88988 15.75 5.30992 15.75 6.15 15.75H11.85C12.6901 15.75 13.1101 15.75 13.431 15.5865C13.7132 15.4427 13.9427 15.2132 14.0865 14.931C14.25 14.6101 14.25 14.1901 14.25 13.35V6.75M9.75 2.25L14.25 6.75M9.75 2.25V5.55C9.75 5.97004 9.75 6.18006 9.83175 6.34049C9.90365 6.48161 10.0184 6.59635 10.1595 6.66825C10.3199 6.75 10.53 6.75 10.95 6.75H14.25",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),FileCopyIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M11.25 2.25V4.8C11.25 5.22004 11.25 5.43006 11.3317 5.59049C11.4037 5.73161 11.5184 5.84635 11.6595 5.91825C11.8199 6 12.03 6 12.45 6H15M7.5 6H4.5C3.67157 6 3 6.67157 3 7.5V14.25C3 15.0784 3.67157 15.75 4.5 15.75H9C9.82843 15.75 10.5 15.0784 10.5 14.25V12M12 2.25H9.9C9.05992 2.25 8.63988 2.25 8.31901 2.41349C8.03677 2.5573 7.8073 2.78677 7.66349 3.06901C7.5 3.38988 7.5 3.80992 7.5 4.65V9.6C7.5 10.4401 7.5 10.8601 7.66349 11.181C7.8073 11.4632 8.03677 11.6927 8.31901 11.8365C8.63988 12 9.05992 12 9.9 12H12.6C13.4401 12 13.8601 12 14.181 11.8365C14.4632 11.6927 14.6927 11.4632 14.8365 11.181C15 10.8601 15 10.4401 15 9.6V5.25L12 2.25Z",strokeLinejoin:"round",strokeWidth:"1.2"})}),FlipForwardEnergy=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:"black",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M2.95314 5.997C4.05824 3.77605 6.35091 2.25 9 2.25C12.4718 2.25 15.3314 4.87105 15.708 8.24231M2.2912 9.74998C2.66427 13.125 5.52558 15.75 9 15.75C11.6496 15.75 13.9427 14.2234 15.0475 12.0017M2.25 3V6.375H5.625M15.75 15.375V12H12.375M8.625 6.75L7.5 9H10.5L9.375 11.25",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),FolderInfoIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[400],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12 10H12.01M12 13V16M12.0627 6.06274L11.9373 5.93726C11.5914 5.59135 11.4184 5.4184 11.2166 5.29472C11.0376 5.18506 10.8425 5.10425 10.6385 5.05526C10.4083 5 10.1637 5 9.67452 5H6.2C5.0799 5 4.51984 5 4.09202 5.21799C3.71569 5.40973 3.40973 5.71569 3.21799 6.09202C3 6.51984 3 7.07989 3 8.2V15.8C3 16.9201 3 17.4802 3.21799 17.908C3.40973 18.2843 3.71569 18.5903 4.09202 18.782C4.51984 19 5.07989 19 6.2 19H17.8C18.9201 19 19.4802 19 19.908 18.782C20.2843 18.5903 20.5903 18.2843 20.782 17.908C21 17.4802 21 16.9201 21 15.8V10.2C21 9.0799 21 8.51984 20.782 8.09202C20.5903 7.71569 20.2843 7.40973 19.908 7.21799C19.4802 7 18.9201 7 17.8 7H14.3255C13.8363 7 13.5917 7 13.3615 6.94474C13.1575 6.89575 12.9624 6.81494 12.7834 6.70528C12.5816 6.5816 12.4086 6.40865 12.0627 6.06274Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),GearIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntimeExports.jsx("path",{d:"M15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M12.9046 3.06005C12.6988 3 12.4659 3 12 3C11.5341 3 11.3012 3 11.0954 3.06005C10.7942 3.14794 10.5281 3.32808 10.3346 3.57511C10.2024 3.74388 10.1159 3.96016 9.94291 4.39272C9.69419 5.01452 9.00393 5.33471 8.36857 5.123L7.79779 4.93281C7.3929 4.79785 7.19045 4.73036 6.99196 4.7188C6.70039 4.70181 6.4102 4.77032 6.15701 4.9159C5.98465 5.01501 5.83376 5.16591 5.53197 5.4677C5.21122 5.78845 5.05084 5.94882 4.94896 6.13189C4.79927 6.40084 4.73595 6.70934 4.76759 7.01551C4.78912 7.2239 4.87335 7.43449 5.04182 7.85566C5.30565 8.51523 5.05184 9.26878 4.44272 9.63433L4.16521 9.80087C3.74031 10.0558 3.52786 10.1833 3.37354 10.3588C3.23698 10.5141 3.13401 10.696 3.07109 10.893C3 11.1156 3 11.3658 3 11.8663C3 12.4589 3 12.7551 3.09462 13.0088C3.17823 13.2329 3.31422 13.4337 3.49124 13.5946C3.69158 13.7766 3.96395 13.8856 4.50866 14.1035C5.06534 14.3261 5.35196 14.9441 5.16236 15.5129L4.94721 16.1584C4.79819 16.6054 4.72367 16.829 4.7169 17.0486C4.70875 17.3127 4.77049 17.5742 4.89587 17.8067C5.00015 18.0002 5.16678 18.1668 5.5 18.5C5.83323 18.8332 5.99985 18.9998 6.19325 19.1041C6.4258 19.2295 6.68733 19.2913 6.9514 19.2831C7.17102 19.2763 7.39456 19.2018 7.84164 19.0528L8.36862 18.8771C9.00393 18.6654 9.6942 18.9855 9.94291 19.6073C10.1159 20.0398 10.2024 20.2561 10.3346 20.4249C10.5281 20.6719 10.7942 20.8521 11.0954 20.94C11.3012 21 11.5341 21 12 21C12.4659 21 12.6988 21 12.9046 20.94C13.2058 20.8521 13.4719 20.6719 13.6654 20.4249C13.7976 20.2561 13.8841 20.0398 14.0571 19.6073C14.3058 18.9855 14.9961 18.6654 15.6313 18.8773L16.1579 19.0529C16.605 19.2019 16.8286 19.2764 17.0482 19.2832C17.3123 19.2913 17.5738 19.2296 17.8063 19.1042C17.9997 18.9999 18.1664 18.8333 18.4996 18.5001C18.8328 18.1669 18.9994 18.0002 19.1037 17.8068C19.2291 17.5743 19.2908 17.3127 19.2827 17.0487C19.2759 16.8291 19.2014 16.6055 19.0524 16.1584L18.8374 15.5134C18.6477 14.9444 18.9344 14.3262 19.4913 14.1035C20.036 13.8856 20.3084 13.7766 20.5088 13.5946C20.6858 13.4337 20.8218 13.2329 20.9054 13.0088C21 12.7551 21 12.4589 21 11.8663C21 11.3658 21 11.1156 20.9289 10.893C20.866 10.696 20.763 10.5141 20.6265 10.3588C20.4721 10.1833 20.2597 10.0558 19.8348 9.80087L19.5569 9.63416C18.9478 9.26867 18.6939 8.51514 18.9578 7.85558C19.1262 7.43443 19.2105 7.22383 19.232 7.01543C19.2636 6.70926 19.2003 6.40077 19.0506 6.13181C18.9487 5.94875 18.7884 5.78837 18.4676 5.46762C18.1658 5.16584 18.0149 5.01494 17.8426 4.91583C17.5894 4.77024 17.2992 4.70174 17.0076 4.71872C16.8091 4.73029 16.6067 4.79777 16.2018 4.93273L15.6314 5.12287C14.9961 5.33464 14.3058 5.0145 14.0571 4.39272C13.8841 3.96016 13.7976 3.74388 13.6654 3.57511C13.4719 3.32808 13.2058 3.14794 12.9046 3.06005Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})]}),GoogleIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntimeExports.jsx("path",{d:"M23.5198 12.2729C23.5198 11.422 23.4435 10.6038 23.3016 9.81836H12V14.4601H18.4581C18.1799 15.9601 17.3345 17.231 16.0636 18.0819V21.0927H19.9417C22.2107 19.0037 23.5198 15.9274 23.5198 12.2729Z",fill:"#4285F4",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M12.0008 24.0011C15.2408 24.0011 17.9571 22.9266 19.9425 21.0939L16.0644 18.083C14.9899 18.803 13.6153 19.2284 12.0008 19.2284C8.8754 19.2284 6.22999 17.1176 5.28637 14.2812H1.27734V17.3903C3.25186 21.312 7.30997 24.0011 12.0008 24.0011Z",fill:"#34A853",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M5.28537 14.2803C5.04537 13.5603 4.90901 12.7912 4.90901 12.0003C4.90901 11.2094 5.04537 10.4404 5.28537 9.72037V6.61133H1.27634C0.463629 8.2313 0 10.064 0 12.0003C0 13.9367 0.463629 15.7694 1.27634 17.3893L5.28537 14.2803Z",fill:"#FBBC05",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M12.0008 4.77265C13.7626 4.77265 15.3444 5.3781 16.588 6.56717L20.0298 3.1254C17.9516 1.18907 15.2353 0 12.0008 0C7.30997 0 3.25186 2.68905 1.27734 6.6108L5.28637 9.71984C6.22999 6.88353 8.8754 4.77265 12.0008 4.77265Z",fill:"#EA4335",clipRule:"evenodd",fillRule:"evenodd"})]}),HelpIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M18.3795 5.65166L14.1055 9.86303M9.89445 14.137L5.63994 18.3679M5.63408 5.63799L9.89445 9.86303M14.1056 14.137L18.364 18.364M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12ZM15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),HourglassIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M15 2.25H3M15 15.75H3M3.75 2.25C3.75 4.13267 4.65921 5.89944 6.1912 6.99371L11.8088 11.0063C13.3408 12.1006 14.25 13.8673 14.25 15.75M14.25 2.25C14.25 4.13267 13.3408 5.89944 11.8088 6.99371L6.1912 11.0063C4.65921 12.1006 3.75 13.8673 3.75 15.75",stroke:"#FB4F57",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),OutgoingArrow=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],"data-testid":"outgoing-arrow-icon",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M5.25 12.75L12.75 5.25M12.75 5.25H6M12.75 5.25V12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),IncomingArrow=a=>jsxRuntimeExports.jsx(OutgoingArrow,{css:{rotate:"180deg"},...a}),KeyIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none","data-testid":"key-icon",strokeWidth:"1.2",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M9.24092 8.01389L3 14.25L4.5 15.75M5.25 12L6.75 13.5M15 5.625C15 7.48896 13.489 9 11.625 9C9.76104 9 8.25 7.48896 8.25 5.625C8.25 3.76104 9.76104 2.25 11.625 2.25C13.489 2.25 15 3.76104 15 5.625Z",strokeLinecap:"round",strokeLinejoin:"round"})}),LedgerIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:colors.gray[400],"data-testid":"ledger-icon",strokeWidth:"0",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M11.666 7.29183H12.3952V8.75016H9.47852V4.37516H10.9368L8.74935 1.4585L6.56185 4.37516H8.02018V10.2085H5.10352V8.54818C5.5381 8.29516 5.83268 7.82995 5.83268 7.29183C5.83268 6.90506 5.67904 6.53412 5.40555 6.26063C5.13206 5.98714 4.76112 5.8335 4.37435 5.8335C3.98757 5.8335 3.61664 5.98714 3.34315 6.26063C3.06966 6.53412 2.91602 6.90506 2.91602 7.29183C2.91602 7.82995 3.2106 8.29516 3.64518 8.54818V10.2085C3.64518 11.0128 4.29924 11.6668 5.10352 11.6668H8.02018V13.3271C7.79896 13.454 7.61508 13.6369 7.48707 13.8575C7.35906 14.0781 7.29143 14.3285 7.29102 14.5835C7.29102 14.9703 7.44466 15.3412 7.71815 15.6147C7.99164 15.8882 8.36257 16.0418 8.74935 16.0418C9.13612 16.0418 9.50706 15.8882 9.78055 15.6147C10.054 15.3412 10.2077 14.9703 10.2077 14.5835C10.2077 14.0454 9.9131 13.5802 9.47852 13.3271V10.2085H12.3952C13.1995 10.2085 13.8535 9.55443 13.8535 8.75016V7.29183H14.5827V4.37516H11.666V7.29183Z"})}),LinkIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M9.16586 17.6508C8.9261 17.8747 8.74055 18.0245 8.55093 18.134C7.62273 18.6699 6.47914 18.6699 5.55093 18.134C5.20889 17.9365 4.88009 17.6077 4.22251 16.9501C3.56492 16.2925 3.23612 15.9637 3.03864 15.6217C2.50274 14.6935 2.50274 13.5499 3.03864 12.6217C3.23612 12.2797 3.56492 11.9509 4.2225 11.2933L7.05093 8.46484C7.70852 7.80725 8.03732 7.47846 8.37936 7.28098C9.30756 6.74508 10.4512 6.74508 11.3794 7.28098C11.7214 7.47846 12.0502 7.80725 12.7078 8.46484C13.3654 9.12243 13.6942 9.45123 13.8916 9.79327C14.4275 10.7215 14.4275 11.8651 13.8916 12.7933C13.7822 12.9829 13.6323 13.1684 13.4085 13.4082M10.5929 10.5926C10.369 10.8323 10.2192 11.0179 10.1097 11.2075C9.57381 12.1357 9.57381 13.2793 10.1097 14.2075C10.3072 14.5495 10.636 14.8783 11.2936 15.5359C11.9512 16.1935 12.28 16.5223 12.622 16.7198C13.5502 17.2557 14.6938 17.2557 15.622 16.7198C15.964 16.5223 16.2928 16.1935 16.9504 15.5359L19.7789 12.7075C20.4364 12.0499 20.7652 11.7211 20.9627 11.3791C21.4986 10.4509 21.4986 9.30726 20.9627 8.37906C20.7652 8.03701 20.4364 7.70822 19.7789 7.05063C19.1213 6.39304 18.7925 6.06425 18.4504 5.86677C17.5222 5.33087 16.3786 5.33087 15.4504 5.86677C15.2608 5.97625 15.0753 6.12608 14.8355 6.34992",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),LockIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12 14.5V16.5M7 10.0288C7.47142 10 8.05259 10 8.8 10H15.2C15.9474 10 16.5286 10 17 10.0288M7 10.0288C6.41168 10.0647 5.99429 10.1455 5.63803 10.327C5.07354 10.6146 4.6146 11.0735 4.32698 11.638C4 12.2798 4 13.1198 4 14.8V16.2C4 17.8802 4 18.7202 4.32698 19.362C4.6146 19.9265 5.07354 20.3854 5.63803 20.673C6.27976 21 7.11984 21 8.8 21H15.2C16.8802 21 17.7202 21 18.362 20.673C18.9265 20.3854 19.3854 19.9265 19.673 19.362C20 18.7202 20 17.8802 20 16.2V14.8C20 13.1198 20 12.2798 19.673 11.638C19.3854 11.0735 18.9265 10.6146 18.362 10.327C18.0057 10.1455 17.5883 10.0647 17 10.0288M7 10.0288V8C7 5.23858 9.23858 3 12 3C14.7614 3 17 5.23858 17 8V10.0288",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),MaintenanceIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:"black",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12.182 5.81859C13.9393 7.57595 13.9393 10.4252 12.182 12.1825M5.81802 12.1825C4.06066 10.4252 4.06066 7.57592 5.81802 5.81856M3.6967 14.3039C0.767767 11.3749 0.767767 6.6262 3.6967 3.69727M14.3033 3.6973C17.2322 6.62623 17.2322 11.375 14.3033 14.3039M10.5 9.00057C10.5 9.82899 9.82843 10.5006 9 10.5006C8.17157 10.5006 7.5 9.82899 7.5 9.00057C7.5 8.17214 8.17157 7.50057 9 7.50057C9.82843 7.50057 10.5 8.17214 10.5 9.00057Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),MakiIcon=({fishColor:a,..._})=>jsxRuntimeExports.jsxs(Icon,{width:"38px",height:"38px",fill:"none",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",..._,children:[jsxRuntimeExports.jsx("path",{d:"M34.9985 26.2751C34.6599 26.8629 34.2436 27.4106 33.7512 27.9032C32.2815 29.3727 30.3277 30.1819 28.2496 30.1819H24.8477V34.9996H26.8032H28.2497C30.0524 34.9996 31.7472 34.2976 33.022 33.0229C34.2967 31.7481 34.9986 30.0533 34.9985 28.2507V26.2751Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M34.9989 20.9441C34.6603 21.5318 34.2439 22.0796 33.7514 22.572C32.2819 24.0416 30.328 24.8509 28.2499 24.8509H18.9983C17.8104 24.8511 16.8477 25.814 16.8477 27.0019C16.8477 28.1898 17.8104 29.1528 18.9983 29.153H28.25C30.0526 29.153 31.7474 28.4511 33.0222 27.1763C34.2965 25.902 34.9986 24.2076 34.9989 22.4054V20.9441ZM18.9988 27.8361C18.5381 27.8361 18.1645 27.4626 18.1645 27.0018C18.1645 26.5412 18.5381 26.1675 18.9988 26.1675C19.4596 26.1675 19.8331 26.5412 19.8331 27.0018C19.8331 27.4626 19.4596 27.8361 18.9988 27.8361Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M35 9.74895C35 6.02751 31.9724 3 28.2509 3H9.74908C6.02761 3 3 6.02751 3 9.74895V28.2511C3 31.9725 6.02761 35 9.74899 35H23.8176V30.1824H18.9995C17.2418 30.1824 15.8171 28.7576 15.8171 27.0001C15.8171 25.2426 17.2418 23.8179 18.9995 23.8179H23.8176V18.9998H9.74899C6.5911 18.9998 4.03113 16.4402 4.03113 13.2824V9.74905C4.03113 6.59127 6.5911 4.03131 9.74899 4.03131H28.2508C31.4087 4.03131 33.9686 6.59127 33.9686 9.74905V13.2824C33.9686 16.4403 31.4089 19.0001 28.251 19.0001L24.8491 18.9998V23.8179H28.2511C30.0539 23.8179 31.7487 23.1159 33.0233 21.8411C34.2977 20.5668 34.9997 18.8725 35 17.0703V9.74895Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M28.251 4.03174C31.4088 4.03174 33.9687 6.59167 33.9687 9.74952V13.2828C33.9687 16.4406 31.4089 19.0005 28.2511 19.0005L9.74908 19.0003C6.59124 19.0003 4.03125 16.4406 4.03125 13.2829V9.74954C4.03125 6.59167 6.5912 4.03174 9.74908 4.03174H28.251Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M28.2511 6.73267C29.611 6.73267 30.7641 7.6364 31.1394 8.87525C31.1926 9.05118 31.0527 9.22558 30.869 9.21814C28.2867 9.11348 25.877 8.32896 23.8154 7.038C23.6751 6.95014 23.739 6.73267 23.9045 6.73267H28.2511Z",fill:a}),jsxRuntimeExports.jsx("path",{d:"M21.9973 7.02488C24.4283 8.9081 27.4326 10.0842 30.7 10.2428C31.0172 10.2581 31.2679 10.5166 31.2679 10.8342V12.8702C31.2674 12.9124 31.2661 13.0446 31.2638 13.1857C31.2603 13.4148 31.069 13.5949 30.8401 13.5876C25.3913 13.4117 20.5215 10.9067 17.1937 7.03888C17.0905 6.91878 17.175 6.73267 17.3334 6.73267H21.1443C21.4533 6.73267 21.753 6.83569 21.9973 7.02488Z",fill:a}),jsxRuntimeExports.jsx("path",{d:"M15.9653 7.17305C19.4649 11.5395 24.7681 14.4013 30.735 14.6156C30.8376 14.6193 30.9004 14.7309 30.8481 14.8191C30.3219 15.7056 29.3544 16.3012 28.2505 16.3012H23.1255C22.9317 16.3012 22.7392 16.2646 22.5603 16.1899C18.0848 14.3242 14.3146 11.0926 11.7745 7.01866C11.6968 6.89417 11.7878 6.73267 11.9345 6.73267H15.0503C15.4065 6.73267 15.7426 6.89513 15.9653 7.17305Z",fill:a}),jsxRuntimeExports.jsx("path",{d:"M9.75058 6.73267H10.1145C10.294 6.73267 10.4589 6.82889 10.5496 6.98379C12.776 10.7844 16.0081 13.9276 19.8791 16.0439C20.0039 16.1122 19.9556 16.3012 19.8134 16.3012H15.1194C14.5651 16.3012 14.0261 16.1087 13.6043 15.7491C11.1433 13.6507 9.05479 11.1267 7.45371 8.29236C7.34983 8.10846 7.3762 7.87733 7.51835 7.72112C8.07107 7.11383 8.86658 6.73267 9.75058 6.73267Z",fill:a}),jsxRuntimeExports.jsx("path",{d:"M12.3071 15.9829C12.4313 16.0951 12.3514 16.3013 12.184 16.3013H9.71437C8.06547 16.2829 6.73047 14.9363 6.73047 13.2836V9.7504L6.73065 9.54576C6.73077 9.42446 6.89048 9.37962 6.95305 9.48354C8.41152 11.9061 10.2194 14.096 12.3071 15.9829Z",fill:a})]}),NoticeIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12 8H12.01M12 11V16M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),OutlineExclamationCircleIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"16px",height:"16px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M8 5V8.75M8 11H8.0075M14.75 8C14.75 11.7279 11.7279 14.75 8 14.75C4.27208 14.75 1.25 11.7279 1.25 8C1.25 4.27208 4.27208 1.25 8 1.25C11.7279 1.25 14.75 4.27208 14.75 8Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),PenIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M11.3348 4.66483L13.2208 6.55082M3 15L3.03164 14.7785C3.1436 13.9948 3.19958 13.6029 3.32692 13.2371C3.43992 12.9124 3.59428 12.6037 3.78619 12.3185C4.00247 11.9971 4.28237 11.7172 4.84218 11.1574L12.609 3.3906C13.1298 2.8698 13.9742 2.8698 14.495 3.3906C15.0158 3.9114 15.0158 4.75578 14.495 5.27658L6.58565 13.1859C6.07779 13.6938 5.82386 13.9477 5.53462 14.1497C5.27789 14.3289 5.001 14.4774 4.70965 14.5921C4.3814 14.7213 4.02937 14.7923 3.32535 14.9344L3 15Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),PlusIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[300],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4 12H20M12 4V20",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),RefreshClockIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18",height:"18",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3 9C3 12.3137 5.68629 15 9 15C12.3137 15 15 12.3137 15 9C15 5.68629 12.3137 3 9 3C7.20796 3 5.59942 3.78563 4.5 5.03126C4.43696 5.10268 4.3756 5.17562 4.31597 5.25M9 6V9L10.875 10.875M4.31543 3.00293V5.25293H6.56543",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ReloadIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"22px",height:"22px",strokeWidth:"0",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M16.1791 5.82018C15.5007 5.13713 14.6938 4.59511 13.8049 4.22539C12.916 3.85568 11.9627 3.66556 10.9999 3.66602C6.94828 3.66602 3.67578 6.94768 3.67578 10.9993C3.67578 15.051 6.94828 18.3327 10.9999 18.3327C14.4191 18.3327 17.2699 15.9952 18.0858 12.8327H16.1791C15.8015 13.9047 15.1005 14.8332 14.1728 15.4899C13.2452 16.1467 12.1366 16.4994 10.9999 16.4993C7.96578 16.4993 5.49995 14.0335 5.49995 10.9993C5.49995 7.96518 7.96578 5.49935 10.9999 5.49935C12.5216 5.49935 13.8783 6.13185 14.8683 7.13102L11.9166 10.0827H18.3333V3.66602L16.1791 5.82018Z"})}),RotateIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],"data-testid":"rotate-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12.5 18.5C17.1944 18.5 21 14.6944 21 10C21 5.30558 17.1944 1.5 12.5 1.5C7.80558 1.5 4 5.30558 4 10C4 11.5433 4.41128 12.9905 5.13022 14.238M1.5 13L5.13022 14.238M6.82531 10.3832L5.47107 14.3542L5.13022 14.238",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),SlashIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M16 3L8 21",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),SlidersIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"32px",height:"32px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M16 7.33333C16 9.17428 14.5076 10.6667 12.6667 10.6667C10.8257 10.6667 9.33333 9.17428 9.33333 7.33333M16 7.33333C16 5.49238 14.5076 4 12.6667 4C10.8257 4 9.33333 5.49238 9.33333 7.33333M16 7.33333H28M9.33333 7.33333H4M25.3333 16C25.3333 17.8409 23.8409 19.3333 22 19.3333C20.1591 19.3333 18.6667 17.8409 18.6667 16M25.3333 16C25.3333 14.1591 23.8409 12.6667 22 12.6667C20.1591 12.6667 18.6667 14.1591 18.6667 16M25.3333 16H28M18.6667 16H4M13.3333 24.6667C13.3333 26.5076 11.8409 28 10 28C8.15905 28 6.66667 26.5076 6.66667 24.6667M13.3333 24.6667C13.3333 22.8257 11.8409 21.3333 10 21.3333C8.15905 21.3333 6.66667 22.8257 6.66667 24.6667M13.3333 24.6667H28M6.66667 24.6667H4",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),SocialIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"28px",height:"28px",fill:"none",stroke:"transparent","data-testid":"social-icon",viewBox:"0 0 28 28",...a,children:jsxRuntimeExports.jsx("g",{id:"Group 40429",children:jsxRuntimeExports.jsx("g",{id:"Group 40428",children:jsxRuntimeExports.jsxs("g",{id:"Group 39769",children:[jsxRuntimeExports.jsx("path",{d:"M27.4398 14.3177C27.4398 13.325 27.3507 12.3705 27.1852 11.4541H14V16.8695H21.5344C21.2099 18.6194 20.2235 20.1021 18.7408 21.0949V24.6075H23.2653C25.9125 22.1703 27.4398 18.5813 27.4398 14.3177Z",fill:"#4285F4",clipRule:"evenodd",fillRule:"evenodd",id:"Shape"}),jsxRuntimeExports.jsx("path",{d:"M14.0009 28C17.7809 28 20.9499 26.7464 23.2663 24.6082L18.7418 21.0955C17.4882 21.9355 15.8846 22.4319 14.0009 22.4319C10.3546 22.4319 7.26832 19.9692 6.16743 16.6602H1.49023V20.2874C3.79383 24.8628 8.5283 28 14.0009 28Z",fill:"#34A853",clipRule:"evenodd",fillRule:"evenodd",id:"Shape_2"}),jsxRuntimeExports.jsx("path",{d:"M6.16627 16.66C5.88627 15.82 5.72718 14.9228 5.72718 14.0001C5.72718 13.0774 5.88627 12.1801 6.16627 11.3401V7.71289H1.48907C0.5409 9.60286 0 11.741 0 14.0001C0 16.2591 0.5409 18.3973 1.48907 20.2872L6.16627 16.66Z",fill:"#FBBC05",clipRule:"evenodd",fillRule:"evenodd",id:"Shape_3"}),jsxRuntimeExports.jsx("path",{d:"M14.0009 5.56809C16.0564 5.56809 17.9018 6.27445 19.3527 7.6617L23.3681 3.64631C20.9436 1.38725 17.7745 0 14.0009 0C8.5283 0 3.79383 3.13722 1.49023 7.7126L6.16743 11.3398C7.26832 8.03078 10.3546 5.56809 14.0009 5.56809Z",fill:"#EA4335",clipRule:"evenodd",fillRule:"evenodd",id:"Shape_4"})]})})})}),TezIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"30px",height:"30px",fill:"none","data-testid":"tez-icon",viewBox:"0 0 30 30",...a,children:[jsxRuntimeExports.jsx("rect",{width:"30",height:"30",fill:"white",rx:"4"}),jsxRuntimeExports.jsx("rect",{width:"30",height:"30",fill:"url(#pattern0)",rx:"4"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsx("pattern",{width:"1",height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",children:jsxRuntimeExports.jsx("use",{transform:"translate(0.1753 0.101557) scale(0.00532296)",xlinkHref:"#image0_2912_38337"})}),jsxRuntimeExports.jsx("image",{width:"122",height:"150",id:"image0_2912_38337",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHoAAACWCAYAAAAR35wdAAAMP2lDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEBooUsJvQkiNYCUEFrovdkISYBQYgwEFXtZVHDtogI2dFVEwQqIBUUUC4ti74sFFWVdLNiVNymg677yvfm+ufPff87858y5M/feAUDtBEckykPVAcgXForjQgLoKalpdNJTQAS6gAyUgTOHWyBixsREAFiG2r+Xd9cBIm2vOEi1/tn/X4sGj1/ABQCJgTiDV8DNh/ggAHgVVyQuBIAo5c2nFIqkGFagJYYBQrxIirPkuEqKM+R4r8wmIY4FcRsASiocjjgLANVLkKcXcbOghmo/xE5CnkAIgBodYt/8/Ek8iNMhtoE2Ioil+oyMH3Sy/qaZMazJ4WQNY/lcZEUpUFAgyuNM+z/T8b9Lfp5kyIcVrCrZ4tA46Zxh3m7mTgqXYhWI+4QZUdEQa0L8QcCT2UOMUrIloYlye9SQW8CCOQM6EDvxOIHhEBtCHCzMi4pQ8BmZgmA2xHCFoFMFhewEiPUgXsQvCIpX2GwWT4pT+EIbMsUspoI/yxHL/Ep93ZfkJjIV+q+z+WyFPqZanJ2QDDEFYosiQVIUxKoQOxbkxocrbMYUZ7OihmzEkjhp/BYQx/GFIQFyfawoUxwcp7AvzS8Ymi+2OVvAjlLg/YXZCaHy/GBtXI4sfjgX7BJfyEwc0uEXpEQMzYXHDwySzx17xhcmxit0PogKA+LkY3GKKC9GYY+b8fNCpLwZxK4FRfGKsXhSIVyQcn08U1QYkyCPEy/O4YTFyOPBl4MIwAKBgA4ksGaASSAHCDr7GvvgnbwnGHCAGGQBPnBQMEMjkmU9QniNB8XgT4j4oGB4XICslw+KIP91mJVfHUCmrLdINiIXPIE4H4SDPHgvkY0SDntLAo8hI/iHdw6sXBhvHqzS/n/PD7HfGSZkIhSMZMgjXW3IkhhEDCSGEoOJtrgB7ot74xHw6g+rM87APYfm8d2e8ITQRXhIuEboJtyaKJgn/inKSNAN9YMVucj4MRe4FdR0wwNwH6gOlXEd3AA44K7QDxP3g57dIMtSxC3NCv0n7b/N4IenobAjO5FRsi7Zn2zz80hVO1W3YRVprn/MjzzWjOF8s4Z7fvbP+iH7PNiG/2yJLcIOYO3YSewcdhRrBHSsBWvCOrBjUjy8uh7LVteQtzhZPLlQR/APf0NPVprJAqdap16nL/K+Qv5U6TsasCaJpokFWdmFdCb8IvDpbCHXcSTd2cnZBQDp90X++noTK/tuIDod37n5fwDg0zI4OHjkOxfWAsA+D7j9D3/nbBjw06EMwNnDXIm4SM7h0gsBviXU4E7TB8bAHNjA+TgDd+AN/EEQCAPRIAGkggkw+my4zsVgCpgB5oISUAaWgzWgAmwCW8FOsAfsB43gKDgJzoAL4BK4Bu7A1dMDXoB+8A58RhCEhFARGqKPmCCWiD3ijDAQXyQIiUDikFQkHclChIgEmYHMR8qQlUgFsgWpQfYhh5GTyDmkC7mFPEB6kdfIJxRDVVAt1Ai1QkehDJSJhqMJ6Hg0C52MFqML0KXoOrQa3Y02oCfRC+g1tBt9gQ5gAFPGdDBTzAFjYCwsGkvDMjExNgsrxcqxaqwOa4bP+QrWjfVhH3EiTsPpuANcwaF4Is7FJ+Oz8CV4Bb4Tb8Db8Cv4A7wf/0agEgwJ9gQvApuQQsgiTCGUEMoJ2wmHCKfhXuohvCMSiTpEa6IH3IupxBzidOIS4gZiPfEEsYv4iDhAIpH0SfYkH1I0iUMqJJWQ1pN2k1pIl0k9pA9KykomSs5KwUppSkKleUrlSruUjitdVnqq9JmsTrYke5GjyTzyNPIy8jZyM/kiuYf8maJBsab4UBIoOZS5lHWUOsppyl3KG2VlZTNlT+VYZYHyHOV1ynuVzyo/UP6ooqlip8JSGaciUVmqskPlhMotlTdUKtWK6k9NoxZSl1JrqKeo96kfVGmqjqpsVZ7qbNVK1QbVy6ov1chqlmpMtQlqxWrlagfULqr1qZPVrdRZ6hz1WeqV6ofVb6gPaNA0RmtEa+RrLNHYpXFO45kmSdNKM0iTp7lAc6vmKc1HNIxmTmPRuLT5tG2007QeLaKWtRZbK0erTGuPVqdWv7amtqt2kvZU7UrtY9rdOpiOlQ5bJ09nmc5+nes6n3SNdJm6fN3FunW6l3Xf643Q89fj65Xq1etd0/ukT9cP0s/VX6HfqH/PADewM4g1mGKw0eC0Qd8IrRHeI7gjSkfsH3HbEDW0M4wznG641bDDcMDI2CjESGS03uiUUZ+xjrG/cY7xauPjxr0mNBNfE4HJapMWk+d0bTqTnkdfR2+j95samoaaSky3mHaafjazNks0m2dWb3bPnGLOMM80X23eat5vYWIRaTHDotbitiXZkmGZbbnWst3yvZW1VbLVQqtGq2fWetZs62LrWuu7NlQbP5vJNtU2V22JtgzbXNsNtpfsUDs3u2y7SruL9qi9u73AfoN910jCSM+RwpHVI284qDgwHYocah0eOOo4RjjOc2x0fDnKYlTaqBWj2kd9c3JzynPa5nRntObosNHzRjePfu1s58x1rnS+6kJ1CXaZ7dLk8srV3pXvutH1phvNLdJtoVur21d3D3exe517r4eFR7pHlccNhhYjhrGEcdaT4BngOdvzqOdHL3evQq/9Xn95O3jneu/yfjbGegx/zLYxj3zMfDg+W3y6fem+6b6bfbv9TP04ftV+D/3N/Xn+2/2fMm2ZOczdzJcBTgHigEMB71lerJmsE4FYYEhgaWBnkGZQYlBF0P1gs+Cs4Nrg/hC3kOkhJ0IJoeGhK0JvsI3YXHYNuz/MI2xmWFu4Snh8eEX4wwi7CHFEcyQaGRa5KvJulGWUMKoxGkSzo1dF34uxjpkccySWGBsTWxn7JG503Iy49nha/MT4XfHvEgISliXcSbRJlCS2JqkljUuqSXqfHJi8Mrk7ZVTKzJQLqQapgtSmNFJaUtr2tIGxQWPXjO0Z5zauZNz18dbjp44/N8FgQt6EYxPVJnImHkgnpCen70r/wonmVHMGMtgZVRn9XBZ3LfcFz5+3mtfL9+Gv5D/N9MlcmfksyydrVVZvtl92eXafgCWoELzKCc3ZlPM+Nzp3R+5gXnJefb5Sfnr+YaGmMFfYNsl40tRJXSJ7UYmoe7LX5DWT+8Xh4u0FSMH4gqZCLfgj3yGxkfwieVDkW1RZ9GFK0pQDUzWmCqd2TLObtnja0+Lg4t+m49O501tnmM6YO+PBTObMLbOQWRmzWmebz14wu2dOyJydcylzc+f+Ps9p3sp5b+cnz29eYLRgzoJHv4T8UluiWiIuubHQe+GmRfgiwaLOxS6L1y/+VsorPV/mVFZe9mUJd8n5X0f/uu7XwaWZSzuXuS/buJy4XLj8+gq/FTtXaqwsXvloVeSqhtX01aWr366ZuOZcuWv5prWUtZK13esi1jWtt1i/fP2XiuyKa5UBlfVVhlWLq95v4G24vNF/Y90mo01lmz5tFmy+uSVkS0O1VXX5VuLWoq1PtiVta/+N8VvNdoPtZdu/7hDu6N4Zt7OtxqOmZpfhrmW1aK2ktnf3uN2X9gTuaapzqNtSr1Nfthfslex9vi993/X94ftbDzAO1B20PFh1iHaotAFpmNbQ35jd2N2U2tR1OOxwa7N386Ejjkd2HDU9WnlM+9iy45TjC44PthS3DJwQneg7mXXyUevE1junUk5dbYtt6zwdfvrsmeAzp9qZ7S1nfc4ePed17vB5xvnGC+4XGjrcOg797vb7oU73zoaLHhebLnleau4a03X8st/lk1cCr5y5yr564VrUta7riddv3hh3o/sm7+azW3m3Xt0uuv35zpy7hLul99Tvld83vF/9h+0f9d3u3cceBD7oeBj/8M4j7qMXjwsef+lZ8IT6pPypydOaZ87PjvYG9156PvZ5zwvRi899JX9q/Fn10ublwb/8/+roT+nveSV+Nfh6yRv9Nzveur5tHYgZuP8u/93n96Uf9D/s/Mj42P4p+dPTz1O+kL6s+2r7tflb+Le7g/mDgyKOmCP7FcBgRTMzAXi9AwBqKgA0eD6jjJWf/2QFkZ9ZZQj8Jyw/I8qKOwB18P89tg/+3dwAYO82ePyC+mrjAIihApDgCVAXl+E6dFaTnSulhQjPAZujvmbkZ4B/U+Rnzh/i/rkFUlVX8HP7L34RfGukfYUwAAAAOGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAACoAIABAAAAAEAAAB6oAMABAAAAAEAAACWAAAAAGjynq0AABD3SURBVHgB7V0JcFXVGf7Pey8QEnCp2ta97rYuHRW0VqkLilapSm1MAgVCwLQ4WrRDq6gVHWt1Ojpt1cEOkhBAshgqFRe6WIvLWHEsMxW07tS1xVYQRba8906/88gN9yU3efcs797zknOHcO899/z/+f//O//Zz3lE7nIWcBZwFnAWcBZwFnAWcBaIzQIstpRDJlzVwHcv66RvZBmdzBiNIk5HtzaxI0OSu2hdFkjZZIm6Ol6+JUknJQigchrFBbgZOowjwJcjP7VJ5lKRJTagq6p4sqySjssmaBQ89WQOYLcRHZskwj9cQNYHbqnY01o5IwO6aho/PJVF0StA3VkEn4j7MA9MgO2uIlqgaEDX1PHRLEnnoU4dCflPxd9uhCJYXDlMFYFF5uA7ubj/ZSxQNKBZgm6FIGeYLn9RdytmERmzDLy4XT428BRzGuVbwAGdb48B+1Y0oNHXPbO1kbHUDhpOWZqEivV1E1Z0dbSaFSOt72qn8Vsg5k1qou6kQobZ1NbI9tDhMRhpi+bRQcaEh89Bm/mPQd9cWHEtECnQQhW0xu8urkqOe5AFIgd66w5aFSRI2DDXvQprqfx4kQO9bBH7GPXs5nwxwr+5xlh4W/ljRg50V+I7/ELIPDuPlrHWrrhxAb1LAvcUiQUc0JGYOf5EHNDxYxCJBA7oSMwcfyIO6PgxiEQCB3QkZo4/EQd0/BhEIoEDOhIzx5+IAzp+DCKRwAEdiZnjT8QBHT8GkUgQeuHBRfV8RCXROizN2ysSyfpLhNNT/X0eiN/EZA42M8xobWavqugXehVoRRYAJy0AWWjJsLp0kF05j0xSLdSeo6J66KI7k3LLbFUMbJIG07tlqvxCA62agKOzwwKhgU6m3Q6J2CHjtFVVhtBAu6Jb1cSG6Dg9uamSfqnKLTTQqgk4OgMWAMifVNIFK+5h21W5OaBVLRcVHadndUEWoobuXnWmaWMyQWIBvvaFLbI/ApM9VRlhL7UROVTTl6JjNARdo9lSNF5kjBdsTul5sscq1z3zXqK610zjbyLhw1TTa20UG3CxTNDyq6GBl32aoeXQ9XxpUeHJ6c9obEcHU26A+dN0RbffGgafxYkOtoAs1HJAGwTXYyVATo6gh2zwZE8mB7RnCUP3bpAZXSTN0nBx7U/fAe23hubzzTfzRM6TLQNZqOWA1gTXIxcgv/outaNHYZUne/I5oD1LaN056wL5e9Jsilhc+2UJ3Y/2E7lnvwU4q62nxZjbkwYZ4wGrMga7UH6pej47j+5pEan3bpAnSpEhsgAZR1+OMdVPLpS+A7qQhfr53uXJyiAvXsw+74e90U+u6FY0J0b3GkFaEiALFZ1HKwAtQMZgSL0sqVdcR+nJnowOaM8SIe+lCLJQzQEdEmARDSDPLTVP9tRzQHuWKHDvAnlGgWi9PsdZXPuFcY0xvzX6eK6t57/Cp5IFWajlPLoPcL3gHMiMrvbew95t8WRPXge0Z4mAuwbIq8VgSByt6wA1ckGu6O7DMgD5dgxrqnjy6uR2OmvxkugGQ/pQIS/YeXSeOXa+1NTzmwHydQGf+g1CcZ0DeckSZt0PvDiP7gEdWtfXogslvb/JZpCFis6jfUB3gXyHLyjUo+0gCyUc0F1QVk/jM+HJAxJkB7QPZOT4X3e9hr6Vgid7ygz6OhoNrx/Ckwc0yALsQV1050BmdJ+X68PeS8mTPZ0GLdCqIGPz8BrRT7axC+WBGnQflEV37VQ+Ff1kaU8WILNtdMaSFvv6yUHg+sMGnUcLkHHwi1gdInd1gdzSwjbKEdoRu0Q9Wm2DHfrJ9TC7WB0ifzG6oVRBFsoOGo/Gb25NAcDynrwrSyxHRlkNPpfsCiqdpxL1aDkDY4LiUlA0y1H1jo2McgJCl4Hfx7g3wU3uap3P1veOaV/IYPHoC42aXhyqx+gn+CnGf4mpzPGT+BeN8i8Cs0EBNBpfxSm5GJWLqczyIbQe3bV54sfQi4CREZaDAmg03ZQPYgtrZWyuuxy56Q0AvsBGDx8UQOMMjKFhAdONB8Drysvojep6/mNdXibpSxRoFMYyF6NhMtG14zLaLcHoLtTfL02Yzk/S5meAQYkCLdePRuzIPDoPE0bHYVz8RXTL5k6cyHfL+xbxS4kCLWcl+P8QOQqzsVH8zMgMpdcw511llnN4boMCaIxRL4RnPYa/D8ObxmxM1N1fhrEfhHevqJnKDzTLvTA3ubquML9QMaCs5jljMJviNX4y32tYkkbCy8Xgx4XoHp2uyEqdjNPHyHQXti1gq9SZyFEqG0wumfzY+kCLoVu5ejpfgl1vtQ18b56mixEyHqCfA4NEUp8DaPGLuzVtTWzZLmmK9xQL0GiNvg6jHqGqVmujukf3l2bu5yQ4jqhI5E66P7e/uMa+ZenG1gXsNmP8+mAUF9AvAejj+pCpYHCxgPYnLAY9hg7BRndOs5Ct9vN/M/0M774fnt1gmq+fXyxAY/ToeRjvFL8gMs9RAO2XByXQVXi/EZmzaGPaAPvRz1NU/cg8tsWftqnnuFrdWjM+OJ0v0gGQ1iZ2D07ZPQRGvx6AGDmEtSeAyPjjhqfpie808Iqe30y8xwI0lHpfR/hERXGL0iDZhKehJLk9lcKpxJwWBcXRDmN0amWG/lBXx8u1efVgEAvQPEuv9ZBD6jWRUq/fpRIKiPzAPPZvePgU6HAaAH8lIIpWEOrS0duS9KgWkwDiWICGR68OkCV0EIrPE0NHLlJE9IGfA+DHQJZbTScBsMegXbDUJN9YgEZ9pwU0DDDGpBF0eKG1fBN+Ye4EzJCt0+HTi5bRpRgyvbJXuGJALK1uISvWXj2G2wWKchOMe2RLM3tDld40HRYdfCHF6WG0zI2OtGWzdFL7AqbrGPEtDkSR16Fj7GxS/kwRnfQK0XY0sg0oykcj3gOF4sp8ZwlaKgZyZGiC4sZSdAtB0Fn8XZBAYcNQFF1TW8ePDhs/qnhomU9CWvNNpQc9D6lk+u2A2IBe3sQ+Q712r45BeFJht4UvQawC+brv1dgjwL4cJdZvjTEkmllVx5VHEoUcsQEtEkfr++firnoht5+JCZInZNdooUV7Kf7eQvrVqmkXokMjbQbiaFVP/jSSmpk6VqDFmmg0Nq7wKyT7DLDHYI3WK7n9VP0Qf7+B74tMMQvDr2vQYFqKv0NBm+2HRPsTPPsyePZz2ozAALKehlZ4jSov0Md/5fqM6E5oS8JJVAdroNSbuL8DfllYaAgmNEfhfk5P/gDhF/C8G3qGm3wXrfGk2LdlYmIEfNDgO15Fvlg92hMY/erJMPo/vHflO6MRMOg3Aepk3H+GvzkAfXYQyCINfEd+KO4lWuPIaKKBpn9hxg8l19kqjKwAWowjb++ksTB7pP1iZC6tMfewBsd885PQ7a6w8fuLh5Uxs/r73tc3K4AWwi1bzD5Kp1G8cr1x8L4UDQrHb20aH1MOSkeEocidheLjzb6+hw1HKfRtlR0h1gAtFO1YxN5NdZJYB22stdqPAeuWzGeReHS3DNjN0f2s8ZAkkt7RaRXQQndxfqZoraJeHYuida2GPQJJ4VXPiOFTpLEwMEIRA9vms5Uosf6mmwTq/HGyPNBWsftCi/x01EtToVw1wK/UkPb3oF0IgMU9tqt6Kr84kSBtGdJJ2qNjHtsUVhHrgfYUEZPx25P4eV6emzQYCc88GPXVV7zvve6cPkGcp5E52rF4fnnHXLa5V5yYAnRXwQqxMR9ehanS0FOZqZh0lU62uRnHxFDOE/K8QSzXTe+gfZMp7Fnuungnvde+kL3lvdt2R+l0HzLgnVpyJXJz8gMP6L6M0jqP/Q/fxF/JXChGl6G00QIaPL4qo7B1jTEZ4Us1bksTextAr9ORH/RHydA7oGWsZTAuPPJFHXbOo3WsFyEtPFJrgaQQtWoyPyisyM6jw1rKdDxOH+iyxMheaPxCR9QVytH3sAAj7R8gZanwmwkc0D3sH9Uriu5O3bSGpin0gIkDWtfaivSYo9Y6hQHDw1u7xhZCSVAyAyaeNlghsh9P0EHZDH2KQ6U+kBkG9HjYcMfSlgq0nNUvJlfHlwTQGO++DEVdFYY8xcL9PTGyRBgvJsrkfhj0XbyvzGL5MNY/RzbtqI5QN+WXup8UHpBJ1smQWQ107XR+PBYDLcNwoVjfFXgh/CB8n4zjnibD21djE9w4sT8qMLJdgbp7rqX2fVlbR+dmrbL0vAA5LD7w+BMzGXoB/cv9w9LEFQ8Z9HCdtFFHr5GhtxLo3EAAo+UATmUf9AHw6kUyRoglLqNjdNJFrfWsDL2VQAOoNiixp4wieXEZnS3q9bwwi14mTucHQBz1OhqnGnU0MamRNeuArp7Ov4vi+lRdXNBeu1aXR7HosZb9FC3ejJ6UpbcOaJalKbJKBMUX9fWECVy9VAhiaigMmXCsDivQPyJLbx/QBvc+Z4dhjbed13gdsZLbsD1X8rKqe5U7hEZvXVie+lhuE3p2J4+wiC+5BfiM9lFNAt78kMpvblnl0cnhtLeqAQLp1FrtgayMBWou+UW3rFlFFqs8OsGpHDnW2AWjrDPGzACjqql8HzQ0lTfKoe/8AfaKSdfPQnSrPDoxhIyu1MSY+KsG8DHGAvPH12gxY3STKj0yvV0XzjYx4tTg8hxy/2m2aDehnh+K9enKK1Ohz1roo7wZ3iqPFqBAIa21VB6wmB260Xu24Y7cO1dHDtD/VIfeOqBRxDyto1COltPsB5vYX7X5GGKAUbqrUDefp8Hu8fYmtkKD3q46WiiC4u1xHYVAext2Lt6hycMYeXUdF5vw71ZlCE/eku7UP4HJOo9ua2R/QfH9XwXDvIzRsJHYW2VNkY2jKI5NJOUHN/J053S12GWaF6bwYh3QQgcAdq+CLk+0zGd/V6ArCgkaleejGhI7J/dVTQAZfikaYPer0vvprAQ6jWOpUGRt8gsa4nlmTR0fHSJe0aMAZNENWgGghysnxukpgGzsV3WsBFqc+4Fdk1fLGoklqR0NH+2ZL9l0vfiiC4WdksKLb/HClO5YVJDYThcp0fZBhExn74WlQQ+jGFdReM7mJN1ZrNPse1pMrGjBHPo1KIWugLwqiyW6WaK4fi+TpZM7mtl/ugMNPFgN9KRJvDJdRi+g1fo1aV05fQ7Dt2HN2cK2ZvaMNH0Igsum8W/hmIkrEdVMEQtPTmdprGmQhSpWAy0EFMt7IeRKSHqEeFe6doIuNsU/Bfq1qK/WtjSyd1R44cSCcViBejGqFvHzSd17slV4+WngyY2ZcrSwi7Rh33qghTHEZECS0Z9RLJo+u/N9sF8PI4ti8kMAtx4AYjnWzgvG2R2lwgG4749vByJULAEye3H6CKN4kzAg8iezjPO5lQTQQmTxI544ouI3ALsuX4XSfUMGezTDaEqu8VlkNUoGaM8OWOt9LrxuId6V+6cer7juKCVexwjg7Pb57KGoZCg5oIVhRCOts4xmQvjrUKSOiMpYuukA4Ocx534fTjxYpMtLlr4kgfaU7Pp5g+vhHT+AIuqDEx7D4tzXA+AW/DW1N7K1xUmiMNeSBtpTT6w1Sw3H6cCM6vF3lhce1x2gbsF+sHbxMwkYltWdpDGixoAA2m+JCdP4wdhwNxaAnwBjn4678mS9n2+hZzSsVsGYTwPclbaA65d5wAHtV048i58ArNyB80UTdCReD0Wr/QiAcggUPwqZoN/6HfG2gmYD/jaCbgM8dSMyj3jfANqP8P4yqo230aj6J8KsvgY80IWsf0kd36M8QRXo5lSk8Ic+bQV60jtM/ARRobTdd2cBZwFnAWcBZwFnAWeB/wO9yrSXP8OnPQAAAABJRU5ErkJggg=="})]})]}),ThreeDotsIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[300],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M13.5 9H13.5075M9 9H9.0075M4.5 9H4.5075M9.75 9C9.75 9.41421 9.41421 9.75 9 9.75C8.58579 9.75 8.25 9.41421 8.25 9C8.25 8.58579 8.58579 8.25 9 8.25C9.41421 8.25 9.75 8.58579 9.75 9ZM14.25 9C14.25 9.41421 13.9142 9.75 13.5 9.75C13.0858 9.75 12.75 9.41421 12.75 9C12.75 8.58579 13.0858 8.25 13.5 8.25C13.9142 8.25 14.25 8.58579 14.25 9ZM5.25 9C5.25 9.41421 4.91421 9.75 4.5 9.75C4.08579 9.75 3.75 9.41421 3.75 9C3.75 8.58579 4.08579 8.25 4.5 8.25C4.91421 8.25 5.25 8.58579 5.25 9Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}),TokenIcon=({contract:a,..._})=>{const $=`https://services.tzkt.io/v1/avatars/${a}`;return jsxRuntimeExports.jsx(Image$1,{fallbackSrc:"./static/media/coin-front.svg",src:$,..._})},TrashIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3 4.5H15M12 4.5L11.797 3.89105C11.6003 3.30094 11.502 3.00588 11.3195 2.78774C11.1584 2.5951 10.9516 2.44599 10.7179 2.35408C10.4532 2.25 10.1422 2.25 9.52018 2.25H8.47982C7.85779 2.25 7.54677 2.25 7.28213 2.35408C7.04844 2.44599 6.84156 2.5951 6.68047 2.78774C6.49804 3.00588 6.39969 3.30094 6.20298 3.89105L6 4.5M13.5 4.5V12.15C13.5 13.4101 13.5 14.0402 13.2548 14.5215C13.039 14.9448 12.6948 15.289 12.2715 15.5048C11.7902 15.75 11.1601 15.75 9.9 15.75H8.1C6.83988 15.75 6.20982 15.75 5.72852 15.5048C5.30516 15.289 4.96095 14.9448 4.74524 14.5215C4.5 14.0402 4.5 13.4101 4.5 12.15V4.5M10.5 7.5V12.75M7.5 7.5V12.75",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),UnknownContactIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none","data-testid":"unknown-contact-icon",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3.16602 15.5625C3.16602 12.7435 5.45123 10.4583 8.27018 10.4583C8.51775 10.4583 8.7612 10.476 8.99935 10.51M13.3722 13.375C14.1014 12.6458 14.8305 12.3575 14.8305 11.5521C14.8305 10.7467 14.1776 10.0938 13.3722 10.0938C12.6927 10.0938 12.1217 10.5585 11.9598 11.1875M13.3722 15.5625H13.3795M11.1868 5.35417C11.1868 6.965 9.88101 8.27083 8.27018 8.27083C6.65935 8.27083 5.35352 6.965 5.35352 5.35417C5.35352 3.74334 6.65935 2.4375 8.27018 2.4375C9.88101 2.4375 11.1868 3.74334 11.1868 5.35417Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),USBIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M20.5 11L18.7396 7.60473C18.253 6.65855 18.0097 6.18545 17.6514 5.84012C17.3346 5.5347 16.9544 5.30272 16.5379 5.16065C16.067 5 15.535 5 14.471 5H9.52901C8.46503 5 7.93304 5 7.46209 5.16065C7.04558 5.30272 6.66542 5.5347 6.34859 5.84012C5.99034 6.18545 5.74703 6.65855 5.26042 7.60473L3.5 11M20.5 11C20.6981 11.3853 20.7658 11.5446 20.8357 11.747C20.8977 11.9267 20.9426 12.1119 20.9696 12.3002C21 12.5121 21 12.7287 21 13.162V14.2C21 15.8802 21 16.7202 20.673 17.362C20.3854 17.9265 19.9265 18.3854 19.362 18.673C18.7202 19 17.8802 19 16.2 19H7.8C6.11984 19 5.27976 19 4.63803 18.673C4.07354 18.3854 3.6146 17.9265 3.32698 17.362C3 16.7202 3 15.8802 3 14.2V13.162C3 12.7287 3 12.5121 3.03041 12.3002C3.05741 12.1119 3.10225 11.9267 3.16432 11.747C3.23421 11.5446 3.30186 11.3853 3.5 11M20.5 11H3.5M15 15H17",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),VerifiedIcon=()=>jsxRuntimeExports.jsxs(Flex,{position:"relative",alignItems:"center",justifyContent:"center","data-testid":"verified-icon",children:[jsxRuntimeExports.jsx(StarIcon,{}),jsxRuntimeExports.jsx(Flex,{position:"absolute",alignItems:"center",justifyContent:"center",children:jsxRuntimeExports.jsx(CheckIcon$1,{})})]}),StarIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"14px",height:"14px",fill:colors.gray[450],viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M6.51019 0.479749C6.78233 0.213196 7.21767 0.213195 7.48981 0.479749L8.86158 1.82333C8.99061 1.94972 9.16351 2.02134 9.34412 2.02321L11.2642 2.04314C11.6451 2.04709 11.9529 2.35492 11.9569 2.73584L11.9768 4.65588C11.9787 4.83649 12.0503 5.00939 12.1767 5.13842L13.5203 6.51019C13.7868 6.78233 13.7868 7.21767 13.5203 7.48981L12.1767 8.86158C12.0503 8.99061 11.9787 9.16351 11.9768 9.34412L11.9569 11.2642C11.9529 11.6451 11.6451 11.9529 11.2642 11.9569L9.34412 11.9768C9.16351 11.9787 8.99061 12.0503 8.86158 12.1767L7.48981 13.5203C7.21767 13.7868 6.78233 13.7868 6.51019 13.5203L5.13842 12.1767C5.00939 12.0503 4.83649 11.9787 4.65588 11.9768L2.73584 11.9569C2.35492 11.9529 2.04709 11.6451 2.04314 11.2642L2.02321 9.34412C2.02134 9.16351 1.94972 8.99061 1.82333 8.86158L0.479749 7.48981C0.213196 7.21767 0.213195 6.78233 0.479749 6.51019L1.82333 5.13842C1.94972 5.00939 2.02134 4.83649 2.02321 4.65588L2.04314 2.73584C2.04709 2.35492 2.35492 2.04709 2.73584 2.04314L4.65588 2.02321C4.83649 2.02134 5.00939 1.94972 5.13842 1.82333L6.51019 0.479749Z",strokeLinecap:"square",strokeLinejoin:"round"})}),CheckIcon$1=a=>jsxRuntimeExports.jsx(Icon,{width:"7px",height:"5px",fill:"none",stroke:"white",viewBox:"0 0 7 5",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M1.66699 2.19314L3.0281 3.55425L5.75033 0.832031",strokeLinecap:"square",strokeLinejoin:"round"})}),WalletPlusIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M10 16V14.0003M10 14.0003V12M10 14.0003L12 14.0005M10 14.0003L8 14M21 12V11.2C21 10.0799 21 9.51984 20.782 9.09202C20.5903 8.7157 20.2843 8.40973 19.908 8.21799C19.4802 8 18.9201 8 17.8 8H3M21 12V16M21 12H19C17.8954 12 17 12.8954 17 14C17 15.1046 17.8954 16 19 16H21M21 16V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8V8M18 8V7.2C18 6.0799 18 5.51984 17.782 5.09202C17.5903 4.71569 17.2843 4.40973 16.908 4.21799C16.4802 4 15.9201 4 14.8 4H6.2C5.07989 4 4.51984 4 4.09202 4.21799C3.71569 4.40973 3.40973 4.71569 3.21799 5.09202C3 5.51984 3 6.0799 3 7.2V8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),WarningIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"36px",height:"32px",fill:"none",stroke:colors.orangeL,viewBox:"0 0 36 32",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M18.0004 24.3332H18.0171M18.0004 12.6665V19.3332M8.68719 30.9999H27.3136C30.2831 30.9999 31.7678 30.9999 32.6386 30.3754C33.3985 29.8305 33.8946 28.9915 34.0058 28.0631C34.1333 26.9991 33.4178 25.6982 31.9868 23.0963L22.6736 6.16318C21.1499 3.39292 20.3881 2.00779 19.3814 1.54954C18.5041 1.15015 17.4968 1.15015 16.6194 1.54954C15.6127 2.00779 14.8509 3.39292 13.3273 6.16317L4.01404 23.0963C2.58301 25.6982 1.8675 26.9991 1.99498 28.0631C2.10622 28.9915 2.6023 29.8305 3.36219 30.3754C4.23304 30.9999 5.71776 30.9999 8.68719 30.9999Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}),XMark=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4.5 4.5L13.5 13.5M13.5 4.5L4.5 13.5","data-testid":"xmark-icon-path",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})});function keys(a){return Object.keys(a)}var ExposedPromiseStatus;(function(a){a.PENDING="pending",a.RESOLVED="resolved",a.REJECTED="rejected"})(ExposedPromiseStatus||(ExposedPromiseStatus={}));const notInitialized$1=()=>{throw new Error("ExposedPromise not initialized yet.")};class ExposedPromise{constructor(){Yr(this,"_promise");Yr(this,"_resolve",notInitialized$1);Yr(this,"_reject",notInitialized$1);Yr(this,"_status",ExposedPromiseStatus.PENDING);Yr(this,"_promiseResult");Yr(this,"_promiseError");this._promise=new Promise((_,$)=>{this._resolve=j=>{this.isSettled()||(this._promiseResult=j,_(j),this._status=ExposedPromiseStatus.RESOLVED)},this._reject=j=>{this.isSettled()||(this._promiseError=j,$(j),this._status=ExposedPromiseStatus.REJECTED)}})}get promise(){return this._promise}get resolve(){return this._resolve}get reject(){return this._reject}get status(){return this._status}get promiseResult(){return this._promiseResult}get promiseError(){return this._promiseError}static resolve(_){const $=new ExposedPromise;return $.resolve(_),$}static reject(_){const $=new ExposedPromise;return $.reject(_),$}isPending(){return this.status===ExposedPromiseStatus.PENDING}isResolved(){return this.status===ExposedPromiseStatus.RESOLVED}isRejected(){return this.status===ExposedPromiseStatus.REJECTED}isSettled(){return this.isResolved()||this.isRejected()}}var buffer$2={},base64Js$1={};base64Js$1.byteLength=byteLength$2;base64Js$1.toByteArray=toByteArray$1;base64Js$1.fromByteArray=fromByteArray$1;var lookup$3=[],revLookup$1=[],Arr$1=typeof Uint8Array<"u"?Uint8Array:Array,code$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$2=0,len$1=code$1.length;i$20)throw new Error("Invalid string. Length must be a multiple of 4");var $=a.indexOf("=");$===-1&&($=_);var j=$===_?0:4-$%4;return[$,j]}function byteLength$2(a){var _=getLens$1(a),$=_[0],j=_[1];return($+j)*3/4-j}function _byteLength$1(a,_,$){return(_+$)*3/4-$}function toByteArray$1(a){var _,$=getLens$1(a),j=$[0],et=$[1],tt=new Arr$1(_byteLength$1(a,j,et)),rt=0,nt=et>0?j-4:j,it;for(it=0;it>16&255,tt[rt++]=_>>8&255,tt[rt++]=_&255;return et===2&&(_=revLookup$1[a.charCodeAt(it)]<<2|revLookup$1[a.charCodeAt(it+1)]>>4,tt[rt++]=_&255),et===1&&(_=revLookup$1[a.charCodeAt(it)]<<10|revLookup$1[a.charCodeAt(it+1)]<<4|revLookup$1[a.charCodeAt(it+2)]>>2,tt[rt++]=_>>8&255,tt[rt++]=_&255),tt}function tripletToBase64$1(a){return lookup$3[a>>18&63]+lookup$3[a>>12&63]+lookup$3[a>>6&63]+lookup$3[a&63]}function encodeChunk$1(a,_,$){for(var j,et=[],tt=_;tt<$;tt+=3)j=(a[tt]<<16&16711680)+(a[tt+1]<<8&65280)+(a[tt+2]&255),et.push(tripletToBase64$1(j));return et.join("")}function fromByteArray$1(a){for(var _,$=a.length,j=$%3,et=[],tt=16383,rt=0,nt=$-j;rtnt?nt:rt+tt));return j===1?(_=a[$-1],et.push(lookup$3[_>>2]+lookup$3[_<<4&63]+"==")):j===2&&(_=(a[$-2]<<8)+a[$-1],et.push(lookup$3[_>>10]+lookup$3[_>>4&63]+lookup$3[_<<2&63]+"=")),et.join("")}var ieee754$1={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754$1.read=function(a,_,$,j,et){var tt,rt,nt=et*8-j-1,it=(1<>1,ot=-7,at=$?et-1:0,ut=$?-1:1,ht=a[_+at];for(at+=ut,tt=ht&(1<<-ot)-1,ht>>=-ot,ot+=nt;ot>0;tt=tt*256+a[_+at],at+=ut,ot-=8);for(rt=tt&(1<<-ot)-1,tt>>=-ot,ot+=j;ot>0;rt=rt*256+a[_+at],at+=ut,ot-=8);if(tt===0)tt=1-st;else{if(tt===it)return rt?NaN:(ht?-1:1)*(1/0);rt=rt+Math.pow(2,j),tt=tt-st}return(ht?-1:1)*rt*Math.pow(2,tt-j)};ieee754$1.write=function(a,_,$,j,et,tt){var rt,nt,it,st=tt*8-et-1,ot=(1<>1,ut=et===23?Math.pow(2,-24)-Math.pow(2,-77):0,ht=j?0:tt-1,yt=j?1:-1,wt=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(nt=isNaN(_)?1:0,rt=ot):(rt=Math.floor(Math.log(_)/Math.LN2),_*(it=Math.pow(2,-rt))<1&&(rt--,it*=2),rt+at>=1?_+=ut/it:_+=ut*Math.pow(2,1-at),_*it>=2&&(rt++,it/=2),rt+at>=ot?(nt=0,rt=ot):rt+at>=1?(nt=(_*it-1)*Math.pow(2,et),rt=rt+at):(nt=_*Math.pow(2,at-1)*Math.pow(2,et),rt=0));et>=8;a[$+ht]=nt&255,ht+=yt,nt/=256,et-=8);for(rt=rt<0;a[$+ht]=rt&255,ht+=yt,rt/=256,st-=8);a[$+ht-yt]|=wt*128};/*! +}`;var Un=pv(function(){return ns(br,Mn+"return "+sn).apply($,Pr)});if(Un.source=sn,X0(Un))throw Un;return Un}function mw(_t){return os(_t).toLowerCase()}function gw(_t){return os(_t).toUpperCase()}function yw(_t,kt,Ut){if(_t=os(_t),_t&&(Ut||kt===$))return Em(_t);if(!_t||!(kt=io(kt)))return _t;var rr=Co(_t),dr=Co(kt),br=wm(rr,dr),Pr=Sm(rr,dr)+1;return Dl(rr,br,Pr).join("")}function bw(_t,kt,Ut){if(_t=os(_t),_t&&(Ut||kt===$))return _t.slice(0,Am(_t)+1);if(!_t||!(kt=io(kt)))return _t;var rr=Co(_t),dr=Sm(rr,Co(kt))+1;return Dl(rr,0,dr).join("")}function xw(_t,kt,Ut){if(_t=os(_t),_t&&(Ut||kt===$))return _t.replace(dn,"");if(!_t||!(kt=io(kt)))return _t;var rr=Co(_t),dr=wm(rr,Co(kt));return Dl(rr,dr).join("")}function _w(_t,kt){var Ut=Ft,rr=jt;if(Es(kt)){var dr="separator"in kt?kt.separator:dr;Ut="length"in kt?zn(kt.length):Ut,rr="omission"in kt?io(kt.omission):rr}_t=os(_t);var br=_t.length;if(gu(_t)){var Pr=Co(_t);br=Pr.length}if(Ut>=br)return _t;var Ir=Ut-vu(rr);if(Ir<1)return rr;var Nr=Pr?Dl(Pr,0,Ir).join(""):_t.slice(0,Ir);if(dr===$)return Nr+rr;if(Pr&&(Ir+=Nr.length-Ir),J0(dr)){if(_t.slice(Ir).search(dr)){var en,tn=Nr;for(dr.global||(dr=p0(dr.source,os(yn.exec(dr))+"g")),dr.lastIndex=0;en=dr.exec(tn);)var sn=en.index;Nr=Nr.slice(0,sn===$?Ir:sn)}}else if(_t.indexOf(io(dr),Ir)!=Ir){var $n=Nr.lastIndexOf(dr);$n>-1&&(Nr=Nr.slice(0,$n))}return Nr+rr}function Ew(_t){return _t=os(_t),_t&&mn.test(_t)?_t.replace(Jr,Wv):_t}var ww=Su(function(_t,kt,Ut){return _t+(Ut?" ":"")+kt.toUpperCase()}),tm=p1("toUpperCase");function hv(_t,kt,Ut){return _t=os(_t),kt=Ut?$:kt,kt===$?Uv(_t)?Yv(_t):Iv(_t):_t.match(kt)||[]}var pv=Hn(function(_t,kt){try{return Os(_t,$,kt)}catch(Ut){return X0(Ut)?Ut:new Bn(Ut)}}),Sw=Qo(function(_t,kt){return po(kt,function(Ut){Ut=zo(Ut),Xo(_t,Ut,Z0(_t[Ut],_t))}),_t});function Rw(_t){var kt=_t==null?0:_t.length,Ut=On();return _t=kt?xs(_t,function(rr){if(typeof rr[1]!="function")throw new mo(rt);return[Ut(rr[0]),rr[1]]}):[],Hn(function(rr){for(var dr=-1;++drAt)return[];var Ut=Tt,rr=zs(_t,Tt);kt=On(kt),_t-=Tt;for(var dr=d0(rr,kt);++Ut<_t;)kt(Ut);return dr}function Kw(_t){return Dn(_t)?xs(_t,zo):so(_t)?[_t]:Js(j1(os(_t)))}function Ww(_t){var kt=++ey;return os(_t)+kt}var Gw=Up(function(_t,kt){return _t+kt},0),Zw=L0("ceil"),Yw=Up(function(_t,kt){return _t/kt},1),Xw=L0("floor");function Jw(_t){return _t&&_t.length?jp(_t,to,E0):$}function Qw(_t,kt){return _t&&_t.length?jp(_t,On(kt,2),E0):$}function eS(_t){return xm(_t,to)}function tS(_t,kt){return xm(_t,On(kt,2))}function rS(_t){return _t&&_t.length?jp(_t,to,A0):$}function nS(_t,kt){return _t&&_t.length?jp(_t,On(kt,2),A0):$}var iS=Up(function(_t,kt){return _t*kt},1),sS=L0("round"),oS=Up(function(_t,kt){return _t-kt},0);function aS(_t){return _t&&_t.length?u0(_t,to):0}function cS(_t,kt){return _t&&_t.length?u0(_t,On(kt,2)):0}return vr.after=T_,vr.ary=K1,vr.assign=mE,vr.assignIn=ov,vr.assignInWith=t0,vr.assignWith=gE,vr.at=vE,vr.before=W1,vr.bind=Z0,vr.bindAll=Sw,vr.bindKey=G1,vr.castArray=F_,vr.chain=H1,vr.chunk=Zx,vr.compact=Yx,vr.concat=Xx,vr.cond=Rw,vr.conforms=Aw,vr.constant=rm,vr.countBy=s_,vr.create=yE,vr.curry=Z1,vr.curryRight=Y1,vr.debounce=X1,vr.defaults=bE,vr.defaultsDeep=xE,vr.defer=P_,vr.delay=C_,vr.difference=Jx,vr.differenceBy=Qx,vr.differenceWith=e2,vr.drop=t2,vr.dropRight=r2,vr.dropRightWhile=n2,vr.dropWhile=i2,vr.fill=s2,vr.filter=a_,vr.flatMap=u_,vr.flatMapDeep=d_,vr.flatMapDepth=f_,vr.flatten=D1,vr.flattenDeep=o2,vr.flattenDepth=a2,vr.flip=k_,vr.flow=Tw,vr.flowRight=Pw,vr.fromPairs=c2,vr.functions=TE,vr.functionsIn=PE,vr.groupBy=h_,vr.initial=u2,vr.intersection=d2,vr.intersectionBy=f2,vr.intersectionWith=h2,vr.invert=kE,vr.invertBy=ME,vr.invokeMap=m_,vr.iteratee=nm,vr.keyBy=g_,vr.keys=Ns,vr.keysIn=eo,vr.map=Zp,vr.mapKeys=OE,vr.mapValues=jE,vr.matches=Cw,vr.matchesProperty=kw,vr.memoize=Xp,vr.merge=NE,vr.mergeWith=av,vr.method=Mw,vr.methodOf=Iw,vr.mixin=im,vr.negate=Jp,vr.nthArg=jw,vr.omit=LE,vr.omitBy=BE,vr.once=M_,vr.orderBy=v_,vr.over=Nw,vr.overArgs=I_,vr.overEvery=Lw,vr.overSome=Bw,vr.partial=Y0,vr.partialRight=J1,vr.partition=y_,vr.pick=DE,vr.pickBy=cv,vr.property=mv,vr.propertyOf=Dw,vr.pull=v2,vr.pullAll=z1,vr.pullAllBy=y2,vr.pullAllWith=b2,vr.pullAt=x2,vr.range=Fw,vr.rangeRight=zw,vr.rearg=O_,vr.reject=__,vr.remove=_2,vr.rest=j_,vr.reverse=W0,vr.sampleSize=w_,vr.set=zE,vr.setWith=UE,vr.shuffle=S_,vr.slice=E2,vr.sortBy=$_,vr.sortedUniq=P2,vr.sortedUniqBy=C2,vr.split=dw,vr.spread=N_,vr.tail=k2,vr.take=M2,vr.takeRight=I2,vr.takeRightWhile=O2,vr.takeWhile=j2,vr.tap=Y2,vr.throttle=L_,vr.thru=Gp,vr.toArray=nv,vr.toPairs=lv,vr.toPairsIn=uv,vr.toPath=Kw,vr.toPlainObject=sv,vr.transform=HE,vr.unary=B_,vr.union=N2,vr.unionBy=L2,vr.unionWith=B2,vr.uniq=D2,vr.uniqBy=F2,vr.uniqWith=z2,vr.unset=VE,vr.unzip=G0,vr.unzipWith=U1,vr.update=qE,vr.updateWith=KE,vr.values=$u,vr.valuesIn=WE,vr.without=U2,vr.words=hv,vr.wrap=D_,vr.xor=H2,vr.xorBy=V2,vr.xorWith=q2,vr.zip=K2,vr.zipObject=W2,vr.zipObjectDeep=G2,vr.zipWith=Z2,vr.entries=lv,vr.entriesIn=uv,vr.extend=ov,vr.extendWith=t0,im(vr,vr),vr.add=Gw,vr.attempt=pv,vr.camelCase=XE,vr.capitalize=dv,vr.ceil=Zw,vr.clamp=GE,vr.clone=z_,vr.cloneDeep=H_,vr.cloneDeepWith=V_,vr.cloneWith=U_,vr.conformsTo=q_,vr.deburr=fv,vr.defaultTo=$w,vr.divide=Yw,vr.endsWith=JE,vr.eq=Mo,vr.escape=QE,vr.escapeRegExp=ew,vr.every=o_,vr.find=c_,vr.findIndex=L1,vr.findKey=_E,vr.findLast=l_,vr.findLastIndex=B1,vr.findLastKey=wE,vr.floor=Xw,vr.forEach=V1,vr.forEachRight=q1,vr.forIn=SE,vr.forInRight=RE,vr.forOwn=AE,vr.forOwnRight=$E,vr.get=Q0,vr.gt=K_,vr.gte=W_,vr.has=CE,vr.hasIn=em,vr.head=F1,vr.identity=to,vr.includes=p_,vr.indexOf=l2,vr.inRange=ZE,vr.invoke=IE,vr.isArguments=ou,vr.isArray=Dn,vr.isArrayBuffer=G_,vr.isArrayLike=Qs,vr.isArrayLikeObject=Rs,vr.isBoolean=Z_,vr.isBuffer=Fl,vr.isDate=Y_,vr.isElement=X_,vr.isEmpty=J_,vr.isEqual=Q_,vr.isEqualWith=eE,vr.isError=X0,vr.isFinite=tE,vr.isFunction=ga,vr.isInteger=Q1,vr.isLength=Qp,vr.isMap=ev,vr.isMatch=rE,vr.isMatchWith=nE,vr.isNaN=iE,vr.isNative=sE,vr.isNil=aE,vr.isNull=oE,vr.isNumber=tv,vr.isObject=Es,vr.isObjectLike=ws,vr.isPlainObject=np,vr.isRegExp=J0,vr.isSafeInteger=cE,vr.isSet=rv,vr.isString=e0,vr.isSymbol=so,vr.isTypedArray=Au,vr.isUndefined=lE,vr.isWeakMap=uE,vr.isWeakSet=dE,vr.join=p2,vr.kebabCase=tw,vr.last=bo,vr.lastIndexOf=m2,vr.lowerCase=rw,vr.lowerFirst=nw,vr.lt=fE,vr.lte=hE,vr.max=Jw,vr.maxBy=Qw,vr.mean=eS,vr.meanBy=tS,vr.min=rS,vr.minBy=nS,vr.stubArray=om,vr.stubFalse=am,vr.stubObject=Uw,vr.stubString=Hw,vr.stubTrue=Vw,vr.multiply=iS,vr.nth=g2,vr.noConflict=Ow,vr.noop=sm,vr.now=Yp,vr.pad=iw,vr.padEnd=sw,vr.padStart=ow,vr.parseInt=aw,vr.random=YE,vr.reduce=b_,vr.reduceRight=x_,vr.repeat=cw,vr.replace=lw,vr.result=FE,vr.round=sS,vr.runInContext=jr,vr.sample=E_,vr.size=R_,vr.snakeCase=uw,vr.some=A_,vr.sortedIndex=w2,vr.sortedIndexBy=S2,vr.sortedIndexOf=R2,vr.sortedLastIndex=A2,vr.sortedLastIndexBy=$2,vr.sortedLastIndexOf=T2,vr.startCase=fw,vr.startsWith=hw,vr.subtract=oS,vr.sum=aS,vr.sumBy=cS,vr.template=pw,vr.times=qw,vr.toFinite=ba,vr.toInteger=zn,vr.toLength=iv,vr.toLower=mw,vr.toNumber=xo,vr.toSafeInteger=pE,vr.toString=os,vr.toUpper=gw,vr.trim=yw,vr.trimEnd=bw,vr.trimStart=xw,vr.truncate=_w,vr.unescape=Ew,vr.uniqueId=Ww,vr.upperCase=ww,vr.upperFirst=tm,vr.each=V1,vr.eachRight=q1,vr.first=F1,im(vr,function(){var _t={};return Do(vr,function(kt,Ut){cs.call(vr.prototype,Ut)||(_t[Ut]=kt)}),_t}(),{chain:!1}),vr.VERSION=j,po(["bind","bindKey","curry","curryRight","partial","partialRight"],function(_t){vr[_t].placeholder=vr}),po(["drop","take"],function(_t,kt){Kn.prototype[_t]=function(Ut){Ut=Ut===$?1:ks(zn(Ut),0);var rr=this.__filtered__&&!kt?new Kn(this):this.clone();return rr.__filtered__?rr.__takeCount__=zs(Ut,rr.__takeCount__):rr.__views__.push({size:zs(Ut,Tt),type:_t+(rr.__dir__<0?"Right":"")}),rr},Kn.prototype[_t+"Right"]=function(Ut){return this.reverse()[_t](Ut).reverse()}}),po(["filter","map","takeWhile"],function(_t,kt){var Ut=kt+1,rr=Ut==ct||Ut==mt;Kn.prototype[_t]=function(dr){var br=this.clone();return br.__iteratees__.push({iteratee:On(dr,3),type:Ut}),br.__filtered__=br.__filtered__||rr,br}}),po(["head","last"],function(_t,kt){var Ut="take"+(kt?"Right":"");Kn.prototype[_t]=function(){return this[Ut](1).value()[0]}}),po(["initial","tail"],function(_t,kt){var Ut="drop"+(kt?"":"Right");Kn.prototype[_t]=function(){return this.__filtered__?new Kn(this):this[Ut](1)}}),Kn.prototype.compact=function(){return this.filter(to)},Kn.prototype.find=function(_t){return this.filter(_t).head()},Kn.prototype.findLast=function(_t){return this.reverse().find(_t)},Kn.prototype.invokeMap=Hn(function(_t,kt){return typeof _t=="function"?new Kn(this):this.map(function(Ut){return Xu(Ut,_t,kt)})}),Kn.prototype.reject=function(_t){return this.filter(Jp(On(_t)))},Kn.prototype.slice=function(_t,kt){_t=zn(_t);var Ut=this;return Ut.__filtered__&&(_t>0||kt<0)?new Kn(Ut):(_t<0?Ut=Ut.takeRight(-_t):_t&&(Ut=Ut.drop(_t)),kt!==$&&(kt=zn(kt),Ut=kt<0?Ut.dropRight(-kt):Ut.take(kt-_t)),Ut)},Kn.prototype.takeRightWhile=function(_t){return this.reverse().takeWhile(_t).reverse()},Kn.prototype.toArray=function(){return this.take(Tt)},Do(Kn.prototype,function(_t,kt){var Ut=/^(?:filter|find|map|reject)|While$/.test(kt),rr=/^(?:head|last)$/.test(kt),dr=vr[rr?"take"+(kt=="last"?"Right":""):kt],br=rr||/^find/.test(kt);dr&&(vr.prototype[kt]=function(){var Pr=this.__wrapped__,Ir=rr?[1]:arguments,Nr=Pr instanceof Kn,en=Ir[0],tn=Nr||Dn(Pr),sn=function(qn){var Gn=dr.apply(vr,Ml([qn],Ir));return rr&&$n?Gn[0]:Gn};tn&&Ut&&typeof en=="function"&&en.length!=1&&(Nr=tn=!1);var $n=this.__chain__,Mn=!!this.__actions__.length,jn=br&&!$n,Un=Nr&&!Mn;if(!br&&tn){Pr=Un?Pr:new Kn(this);var Nn=_t.apply(Pr,Ir);return Nn.__actions__.push({func:Gp,args:[sn],thisArg:$}),new go(Nn,$n)}return jn&&Un?_t.apply(this,Ir):(Nn=this.thru(sn),jn?rr?Nn.value()[0]:Nn.value():Nn)})}),po(["pop","push","shift","sort","splice","unshift"],function(_t){var kt=xp[_t],Ut=/^(?:push|sort|unshift)$/.test(_t)?"tap":"thru",rr=/^(?:pop|shift)$/.test(_t);vr.prototype[_t]=function(){var dr=arguments;if(rr&&!this.__chain__){var br=this.value();return kt.apply(Dn(br)?br:[],dr)}return this[Ut](function(Pr){return kt.apply(Dn(Pr)?Pr:[],dr)})}}),Do(Kn.prototype,function(_t,kt){var Ut=vr[kt];if(Ut){var rr=Ut.name+"";cs.call(_u,rr)||(_u[rr]=[]),_u[rr].push({name:kt,func:Ut})}}),_u[zp($,Pt).name]=[{name:"wrapper",func:$}],Kn.prototype.clone=yy,Kn.prototype.reverse=by,Kn.prototype.value=xy,vr.prototype.at=X2,vr.prototype.chain=J2,vr.prototype.commit=Q2,vr.prototype.next=e_,vr.prototype.plant=r_,vr.prototype.reverse=n_,vr.prototype.toJSON=vr.prototype.valueOf=vr.prototype.value=i_,vr.prototype.first=vr.prototype.head,Vu&&(vr.prototype[Vu]=t_),vr},yu=Xv();Ln?((Ln.exports=yu)._=yu,wn._=yu):cn._=yu}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports,isCheckBoxInput=a=>a.type==="checkbox",isDateObject=a=>a instanceof Date,isNullOrUndefined=a=>a==null;const isObjectType=a=>typeof a=="object";var isObject$4=a=>!isNullOrUndefined(a)&&!Array.isArray(a)&&isObjectType(a)&&!isDateObject(a),getEventValue=a=>isObject$4(a)&&a.target?isCheckBoxInput(a.target)?a.target.checked:a.target.value:a,getNodeParentName=a=>a.substring(0,a.search(/\.\d+(\.|$)/))||a,isNameInFieldArray=(a,_)=>a.has(getNodeParentName(_)),isPlainObject$6=a=>{const _=a.constructor&&a.constructor.prototype;return isObject$4(_)&&_.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(a){let _;const $=Array.isArray(a);if(a instanceof Date)_=new Date(a);else if(a instanceof Set)_=new Set(a);else if(!(isWeb&&(a instanceof Blob||a instanceof FileList))&&($||isObject$4(a)))if(_=$?[]:{},!$&&!isPlainObject$6(a))_=a;else for(const j in a)a.hasOwnProperty(j)&&(_[j]=cloneObject(a[j]));else return a;return _}var compact=a=>Array.isArray(a)?a.filter(Boolean):[],isUndefined$2=a=>a===void 0,get$2=(a,_,$)=>{if(!_||!isObject$4(a))return $;const j=compact(_.split(/[,[\].]+?/)).reduce((et,tt)=>isNullOrUndefined(et)?et:et[tt],a);return isUndefined$2(j)||j===a?isUndefined$2(a[_])?$:a[_]:j},isBoolean$3=a=>typeof a=="boolean",isKey=a=>/^\w*$/.test(a),stringToPath$2=a=>compact(a.replace(/["|']|\]/g,"").split(/\.|\[/)),set$2=(a,_,$)=>{let j=-1;const et=isKey(_)?[_]:stringToPath$2(_),tt=et.length,rt=tt-1;for(;++jReact$2.useContext(HookFormContext),FormProvider=a=>{const{children:_,...$}=a;return React$2.createElement(HookFormContext.Provider,{value:$},_)};var getProxyFormState=(a,_,$,j=!0)=>{const et={defaultValues:_._defaultValues};for(const tt in a)Object.defineProperty(et,tt,{get:()=>{const rt=tt;return _._proxyFormState[rt]!==VALIDATION_MODE.all&&(_._proxyFormState[rt]=!j||VALIDATION_MODE.all),a[rt]}});return et},isEmptyObject=a=>isObject$4(a)&&!Object.keys(a).length,shouldRenderFormState=(a,_,$,j)=>{$(a);const{name:et,...tt}=a;return isEmptyObject(tt)||Object.keys(tt).length>=Object.keys(_).length||Object.keys(tt).find(rt=>_[rt]===VALIDATION_MODE.all)},convertToArrayPayload=a=>Array.isArray(a)?a:[a];function useSubscribe(a){const _=React$2.useRef(a);_.current=a,React$2.useEffect(()=>{const $=!a.disabled&&_.current.subject&&_.current.subject.subscribe({next:_.current.next});return()=>{$&&$.unsubscribe()}},[a.disabled])}var isString$3=a=>typeof a=="string",generateWatchOutput=(a,_,$,j,et)=>isString$3(a)?(j&&_.watch.add(a),get$2($,a,et)):Array.isArray(a)?a.map(tt=>(j&&_.watch.add(tt),get$2($,tt))):(j&&(_.watchAll=!0),$),appendErrors=(a,_,$,j,et)=>_?{...$[a],types:{...$[a]&&$[a].types?$[a].types:{},[j]:et||!0}}:{},generateId=()=>{const a=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,_=>{const $=(Math.random()*16+a)%16|0;return(_=="x"?$:$&3|8).toString(16)})},getFocusFieldName=(a,_,$={})=>$.shouldFocus||isUndefined$2($.shouldFocus)?$.focusName||`${a}.${isUndefined$2($.focusIndex)?_:$.focusIndex}.`:"",getValidationModes=a=>({isOnSubmit:!a||a===VALIDATION_MODE.onSubmit,isOnBlur:a===VALIDATION_MODE.onBlur,isOnChange:a===VALIDATION_MODE.onChange,isOnAll:a===VALIDATION_MODE.all,isOnTouch:a===VALIDATION_MODE.onTouched}),isWatched=(a,_,$)=>!$&&(_.watchAll||_.watch.has(a)||[..._.watch].some(j=>a.startsWith(j)&&/^\.\w+/.test(a.slice(j.length))));const iterateFieldsByAction=(a,_,$,j)=>{for(const et of $||Object.keys(a)){const tt=get$2(a,et);if(tt){const{_f:rt,...nt}=tt;if(rt){if(rt.refs&&rt.refs[0]&&_(rt.refs[0],et)&&!j)break;if(rt.ref&&_(rt.ref,rt.name)&&!j)break;iterateFieldsByAction(nt,_)}else isObject$4(nt)&&iterateFieldsByAction(nt,_)}}};var updateFieldArrayRootError=(a,_,$)=>{const j=compact(get$2(a,$));return set$2(j,"root",_[$]),set$2(a,$,j),a},isFileInput=a=>a.type==="file",isFunction$4=a=>typeof a=="function",isHTMLElement=a=>{if(!isWeb)return!1;const _=a?a.ownerDocument:0;return a instanceof(_&&_.defaultView?_.defaultView.HTMLElement:HTMLElement)},isMessage=a=>isString$3(a),isRadioInput=a=>a.type==="radio",isRegex=a=>a instanceof RegExp;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=a=>{if(Array.isArray(a)){if(a.length>1){const _=a.filter($=>$&&$.checked&&!$.disabled).map($=>$.value);return{value:_,isValid:!!_.length}}return a[0].checked&&!a[0].disabled?a[0].attributes&&!isUndefined$2(a[0].attributes.value)?isUndefined$2(a[0].value)||a[0].value===""?validResult:{value:a[0].value,isValid:!0}:validResult:defaultResult}return defaultResult};const defaultReturn={isValid:!1,value:null};var getRadioValue=a=>Array.isArray(a)?a.reduce((_,$)=>$&&$.checked&&!$.disabled?{isValid:!0,value:$.value}:_,defaultReturn):defaultReturn;function getValidateError(a,_,$="validate"){if(isMessage(a)||Array.isArray(a)&&a.every(isMessage)||isBoolean$3(a)&&!a)return{type:$,message:isMessage(a)?a:"",ref:_}}var getValueAndMessage=a=>isObject$4(a)&&!isRegex(a)?a:{value:a,message:""},validateField=async(a,_,$,j,et)=>{const{ref:tt,refs:rt,required:nt,maxLength:it,minLength:st,min:ot,max:at,pattern:ut,validate:ht,name:yt,valueAsNumber:wt,mount:Ct,disabled:Pt}=a._f,$t=get$2(_,yt);if(!Ct||Pt)return{};const Mt=rt?rt[0]:tt,Bt=bt=>{j&&Mt.reportValidity&&(Mt.setCustomValidity(isBoolean$3(bt)?"":bt||""),Mt.reportValidity())},Dt={},zt=isRadioInput(tt),Ot=isCheckBoxInput(tt),It=zt||Ot,Lt=(wt||isFileInput(tt))&&isUndefined$2(tt.value)&&isUndefined$2($t)||isHTMLElement(tt)&&tt.value===""||$t===""||Array.isArray($t)&&!$t.length,Ft=appendErrors.bind(null,yt,$,Dt),jt=(bt,vt,ct,dt=INPUT_VALIDATION_RULES.maxLength,mt=INPUT_VALIDATION_RULES.minLength)=>{const xt=bt?vt:ct;Dt[yt]={type:bt?dt:mt,message:xt,ref:tt,...Ft(bt?dt:mt,xt)}};if(et?!Array.isArray($t)||!$t.length:nt&&(!It&&(Lt||isNullOrUndefined($t))||isBoolean$3($t)&&!$t||Ot&&!getCheckboxValue(rt).isValid||zt&&!getRadioValue(rt).isValid)){const{value:bt,message:vt}=isMessage(nt)?{value:!!nt,message:nt}:getValueAndMessage(nt);if(bt&&(Dt[yt]={type:INPUT_VALIDATION_RULES.required,message:vt,ref:Mt,...Ft(INPUT_VALIDATION_RULES.required,vt)},!$))return Bt(vt),Dt}if(!Lt&&(!isNullOrUndefined(ot)||!isNullOrUndefined(at))){let bt,vt;const ct=getValueAndMessage(at),dt=getValueAndMessage(ot);if(!isNullOrUndefined($t)&&!isNaN($t)){const mt=tt.valueAsNumber||$t&&+$t;isNullOrUndefined(ct.value)||(bt=mt>ct.value),isNullOrUndefined(dt.value)||(vt=mtnew Date(new Date().toDateString()+" "+St),At=tt.type=="time",Rt=tt.type=="week";isString$3(ct.value)&&$t&&(bt=At?xt($t)>xt(ct.value):Rt?$t>ct.value:mt>new Date(ct.value)),isString$3(dt.value)&&$t&&(vt=At?xt($t)+bt.value,dt=!isNullOrUndefined(vt.value)&&$t.length<+vt.value;if((ct||dt)&&(jt(ct,bt.message,vt.message),!$))return Bt(Dt[yt].message),Dt}if(ut&&!Lt&&isString$3($t)){const{value:bt,message:vt}=getValueAndMessage(ut);if(isRegex(bt)&&!$t.match(bt)&&(Dt[yt]={type:INPUT_VALIDATION_RULES.pattern,message:vt,ref:tt,...Ft(INPUT_VALIDATION_RULES.pattern,vt)},!$))return Bt(vt),Dt}if(ht){if(isFunction$4(ht)){const bt=await ht($t,_),vt=getValidateError(bt,Mt);if(vt&&(Dt[yt]={...vt,...Ft(INPUT_VALIDATION_RULES.validate,vt.message)},!$))return Bt(vt.message),Dt}else if(isObject$4(ht)){let bt={};for(const vt in ht){if(!isEmptyObject(bt)&&!$)break;const ct=getValidateError(await ht[vt]($t,_),Mt,vt);ct&&(bt={...ct,...Ft(vt,ct.message)},Bt(ct.message),$&&(Dt[yt]=bt))}if(!isEmptyObject(bt)&&(Dt[yt]={ref:Mt,...bt},!$))return Dt}}return Bt(!0),Dt},appendAt=(a,_)=>[...a,...convertToArrayPayload(_)],fillEmptyArray=a=>Array.isArray(a)?a.map(()=>{}):void 0;function insert$1(a,_,$){return[...a.slice(0,_),...convertToArrayPayload($),...a.slice(_)]}var moveArrayAt=(a,_,$)=>Array.isArray(a)?(isUndefined$2(a[$])&&(a[$]=void 0),a.splice($,0,a.splice(_,1)[0]),a):[],prependAt=(a,_)=>[...convertToArrayPayload(_),...convertToArrayPayload(a)];function removeAtIndexes(a,_){let $=0;const j=[...a];for(const et of _)j.splice(et-$,1),$++;return compact(j).length?j:[]}var removeArrayAt=(a,_)=>isUndefined$2(_)?[]:removeAtIndexes(a,convertToArrayPayload(_).sort(($,j)=>$-j)),swapArrayAt=(a,_,$)=>{[a[_],a[$]]=[a[$],a[_]]};function baseGet(a,_){const $=_.slice(0,-1).length;let j=0;for(;j<$;)a=isUndefined$2(a)?j++:a[_[j++]];return a}function isEmptyArray(a){for(const _ in a)if(a.hasOwnProperty(_)&&!isUndefined$2(a[_]))return!1;return!0}function unset(a,_){const $=Array.isArray(_)?_:isKey(_)?[_]:stringToPath$2(_),j=$.length===1?a:baseGet(a,$),et=$.length-1,tt=$[et];return j&&delete j[tt],et!==0&&(isObject$4(j)&&isEmptyObject(j)||Array.isArray(j)&&isEmptyArray(j))&&unset(a,$.slice(0,-1)),a}var updateAt=(a,_,$)=>(a[_]=$,a);function useFieldArray(a){const _=useFormContext(),{control:$=_.control,name:j,keyName:et="id",shouldUnregister:tt}=a,[rt,nt]=React$2.useState($._getFieldArray(j)),it=React$2.useRef($._getFieldArray(j).map(generateId)),st=React$2.useRef(rt),ot=React$2.useRef(j),at=React$2.useRef(!1);ot.current=j,st.current=rt,$._names.array.add(j),a.rules&&$.register(j,a.rules),useSubscribe({next:({values:Dt,name:zt})=>{if(zt===ot.current||!zt){const Ot=get$2(Dt,ot.current);Array.isArray(Ot)&&(nt(Ot),it.current=Ot.map(generateId))}},subject:$._subjects.array});const ut=React$2.useCallback(Dt=>{at.current=!0,$._updateFieldArray(j,Dt)},[$,j]),ht=(Dt,zt)=>{const Ot=convertToArrayPayload(cloneObject(Dt)),It=appendAt($._getFieldArray(j),Ot);$._names.focus=getFocusFieldName(j,It.length-1,zt),it.current=appendAt(it.current,Ot.map(generateId)),ut(It),nt(It),$._updateFieldArray(j,It,appendAt,{argA:fillEmptyArray(Dt)})},yt=(Dt,zt)=>{const Ot=convertToArrayPayload(cloneObject(Dt)),It=prependAt($._getFieldArray(j),Ot);$._names.focus=getFocusFieldName(j,0,zt),it.current=prependAt(it.current,Ot.map(generateId)),ut(It),nt(It),$._updateFieldArray(j,It,prependAt,{argA:fillEmptyArray(Dt)})},wt=Dt=>{const zt=removeArrayAt($._getFieldArray(j),Dt);it.current=removeArrayAt(it.current,Dt),ut(zt),nt(zt),$._updateFieldArray(j,zt,removeArrayAt,{argA:Dt})},Ct=(Dt,zt,Ot)=>{const It=convertToArrayPayload(cloneObject(zt)),Lt=insert$1($._getFieldArray(j),Dt,It);$._names.focus=getFocusFieldName(j,Dt,Ot),it.current=insert$1(it.current,Dt,It.map(generateId)),ut(Lt),nt(Lt),$._updateFieldArray(j,Lt,insert$1,{argA:Dt,argB:fillEmptyArray(zt)})},Pt=(Dt,zt)=>{const Ot=$._getFieldArray(j);swapArrayAt(Ot,Dt,zt),swapArrayAt(it.current,Dt,zt),ut(Ot),nt(Ot),$._updateFieldArray(j,Ot,swapArrayAt,{argA:Dt,argB:zt},!1)},$t=(Dt,zt)=>{const Ot=$._getFieldArray(j);moveArrayAt(Ot,Dt,zt),moveArrayAt(it.current,Dt,zt),ut(Ot),nt(Ot),$._updateFieldArray(j,Ot,moveArrayAt,{argA:Dt,argB:zt},!1)},Mt=(Dt,zt)=>{const Ot=cloneObject(zt),It=updateAt($._getFieldArray(j),Dt,Ot);it.current=[...It].map((Lt,Ft)=>!Lt||Ft===Dt?generateId():it.current[Ft]),ut(It),nt([...It]),$._updateFieldArray(j,It,updateAt,{argA:Dt,argB:Ot},!0,!1)},Bt=Dt=>{const zt=convertToArrayPayload(cloneObject(Dt));it.current=zt.map(generateId),ut([...zt]),nt([...zt]),$._updateFieldArray(j,[...zt],Ot=>Ot,{},!0,!1)};return React$2.useEffect(()=>{if($._state.action=!1,isWatched(j,$._names)&&$._subjects.state.next({...$._formState}),at.current&&(!getValidationModes($._options.mode).isOnSubmit||$._formState.isSubmitted))if($._options.resolver)$._executeSchema([j]).then(Dt=>{const zt=get$2(Dt.errors,j),Ot=get$2($._formState.errors,j);(Ot?!zt&&Ot.type||zt&&(Ot.type!==zt.type||Ot.message!==zt.message):zt&&zt.type)&&(zt?set$2($._formState.errors,j,zt):unset($._formState.errors,j),$._subjects.state.next({errors:$._formState.errors}))});else{const Dt=get$2($._fields,j);Dt&&Dt._f&&!(getValidationModes($._options.reValidateMode).isOnSubmit&&getValidationModes($._options.mode).isOnSubmit)&&validateField(Dt,$._formValues,$._options.criteriaMode===VALIDATION_MODE.all,$._options.shouldUseNativeValidation,!0).then(zt=>!isEmptyObject(zt)&&$._subjects.state.next({errors:updateFieldArrayRootError($._formState.errors,zt,j)}))}$._subjects.values.next({name:j,values:{...$._formValues}}),$._names.focus&&iterateFieldsByAction($._fields,(Dt,zt)=>{if($._names.focus&&zt.startsWith($._names.focus)&&Dt.focus)return Dt.focus(),1}),$._names.focus="",$._updateValid(),at.current=!1},[rt,j,$]),React$2.useEffect(()=>(!get$2($._formValues,j)&&$._updateFieldArray(j),()=>{($._options.shouldUnregister||tt)&&$.unregister(j)}),[j,$,et,tt]),{swap:React$2.useCallback(Pt,[ut,j,$]),move:React$2.useCallback($t,[ut,j,$]),prepend:React$2.useCallback(yt,[ut,j,$]),append:React$2.useCallback(ht,[ut,j,$]),remove:React$2.useCallback(wt,[ut,j,$]),insert:React$2.useCallback(Ct,[ut,j,$]),update:React$2.useCallback(Mt,[ut,j,$]),replace:React$2.useCallback(Bt,[ut,j,$]),fields:React$2.useMemo(()=>rt.map((Dt,zt)=>({...Dt,[et]:it.current[zt]||generateId()})),[rt,et])}}var createSubject=()=>{let a=[];return{get observers(){return a},next:et=>{for(const tt of a)tt.next&&tt.next(et)},subscribe:et=>(a.push(et),{unsubscribe:()=>{a=a.filter(tt=>tt!==et)}}),unsubscribe:()=>{a=[]}}},isPrimitive=a=>isNullOrUndefined(a)||!isObjectType(a);function deepEqual$1(a,_){if(isPrimitive(a)||isPrimitive(_))return a===_;if(isDateObject(a)&&isDateObject(_))return a.getTime()===_.getTime();const $=Object.keys(a),j=Object.keys(_);if($.length!==j.length)return!1;for(const et of $){const tt=a[et];if(!j.includes(et))return!1;if(et!=="ref"){const rt=_[et];if(isDateObject(tt)&&isDateObject(rt)||isObject$4(tt)&&isObject$4(rt)||Array.isArray(tt)&&Array.isArray(rt)?!deepEqual$1(tt,rt):tt!==rt)return!1}}return!0}var isMultipleSelect=a=>a.type==="select-multiple",isRadioOrCheckbox=a=>isRadioInput(a)||isCheckBoxInput(a),live=a=>isHTMLElement(a)&&a.isConnected,objectHasFunction=a=>{for(const _ in a)if(isFunction$4(a[_]))return!0;return!1};function markFieldsDirty(a,_={}){const $=Array.isArray(a);if(isObject$4(a)||$)for(const j in a)Array.isArray(a[j])||isObject$4(a[j])&&!objectHasFunction(a[j])?(_[j]=Array.isArray(a[j])?[]:{},markFieldsDirty(a[j],_[j])):isNullOrUndefined(a[j])||(_[j]=!0);return _}function getDirtyFieldsFromDefaultValues(a,_,$){const j=Array.isArray(a);if(isObject$4(a)||j)for(const et in a)Array.isArray(a[et])||isObject$4(a[et])&&!objectHasFunction(a[et])?isUndefined$2(_)||isPrimitive($[et])?$[et]=Array.isArray(a[et])?markFieldsDirty(a[et],[]):{...markFieldsDirty(a[et])}:getDirtyFieldsFromDefaultValues(a[et],isNullOrUndefined(_)?{}:_[et],$[et]):$[et]=!deepEqual$1(a[et],_[et]);return $}var getDirtyFields=(a,_)=>getDirtyFieldsFromDefaultValues(a,_,markFieldsDirty(_)),getFieldValueAs=(a,{valueAsNumber:_,valueAsDate:$,setValueAs:j})=>isUndefined$2(a)?a:_?a===""?NaN:a&&+a:$&&isString$3(a)?new Date(a):j?j(a):a;function getFieldValue(a){const _=a.ref;if(!(a.refs?a.refs.every($=>$.disabled):_.disabled))return isFileInput(_)?_.files:isRadioInput(_)?getRadioValue(a.refs).value:isMultipleSelect(_)?[..._.selectedOptions].map(({value:$})=>$):isCheckBoxInput(_)?getCheckboxValue(a.refs).value:getFieldValueAs(isUndefined$2(_.value)?a.ref.value:_.value,a)}var getResolverOptions=(a,_,$,j)=>{const et={};for(const tt of a){const rt=get$2(_,tt);rt&&set$2(et,tt,rt._f)}return{criteriaMode:$,names:[...a],fields:et,shouldUseNativeValidation:j}},getRuleValue=a=>isUndefined$2(a)?a:isRegex(a)?a.source:isObject$4(a)?isRegex(a.value)?a.value.source:a.value:a,hasValidation=a=>a.mount&&(a.required||a.min||a.max||a.maxLength||a.minLength||a.pattern||a.validate);function schemaErrorLookup(a,_,$){const j=get$2(a,$);if(j||isKey($))return{error:j,name:$};const et=$.split(".");for(;et.length;){const tt=et.join("."),rt=get$2(_,tt),nt=get$2(a,tt);if(rt&&!Array.isArray(rt)&&$!==tt)return{name:$};if(nt&&nt.type)return{name:tt,error:nt};et.pop()}return{name:$}}var skipValidation=(a,_,$,j,et)=>et.isOnAll?!1:!$&&et.isOnTouch?!(_||a):($?j.isOnBlur:et.isOnBlur)?!a:($?j.isOnChange:et.isOnChange)?a:!0,unsetEmptyArray=(a,_)=>!compact(get$2(a,_)).length&&unset(a,_);const defaultOptions$1={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(a={}){let _={...defaultOptions$1,...a},$={submitCount:0,isDirty:!1,isLoading:isFunction$4(_.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:_.errors||{},disabled:_.disabled||!1},j={},et=isObject$4(_.defaultValues)||isObject$4(_.values)?cloneObject(_.defaultValues||_.values)||{}:{},tt=_.shouldUnregister?{}:cloneObject(et),rt={action:!1,mount:!1,watch:!1},nt={mount:new Set,unMount:new Set,array:new Set,watch:new Set},it,st=0;const ot={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},at={values:createSubject(),array:createSubject(),state:createSubject()},ut=getValidationModes(_.mode),ht=getValidationModes(_.reValidateMode),yt=_.criteriaMode===VALIDATION_MODE.all,wt=lr=>fr=>{clearTimeout(st),st=setTimeout(lr,fr)},Ct=async lr=>{if(ot.isValid||lr){const fr=_.resolver?isEmptyObject((await It()).errors):await Ft(j,!0);fr!==$.isValid&&at.state.next({isValid:fr})}},Pt=(lr,fr)=>{(ot.isValidating||ot.validatingFields)&&((lr||Array.from(nt.mount)).forEach(_r=>{_r&&(fr?set$2($.validatingFields,_r,fr):unset($.validatingFields,_r))}),at.state.next({validatingFields:$.validatingFields,isValidating:!isEmptyObject($.validatingFields)}))},$t=(lr,fr=[],_r,Sr,kr=!0,Ar=!0)=>{if(Sr&&_r){if(rt.action=!0,Ar&&Array.isArray(get$2(j,lr))){const $r=_r(get$2(j,lr),Sr.argA,Sr.argB);kr&&set$2(j,lr,$r)}if(Ar&&Array.isArray(get$2($.errors,lr))){const $r=_r(get$2($.errors,lr),Sr.argA,Sr.argB);kr&&set$2($.errors,lr,$r),unsetEmptyArray($.errors,lr)}if(ot.touchedFields&&Ar&&Array.isArray(get$2($.touchedFields,lr))){const $r=_r(get$2($.touchedFields,lr),Sr.argA,Sr.argB);kr&&set$2($.touchedFields,lr,$r)}ot.dirtyFields&&($.dirtyFields=getDirtyFields(et,tt)),at.state.next({name:lr,isDirty:bt(lr,fr),dirtyFields:$.dirtyFields,errors:$.errors,isValid:$.isValid})}else set$2(tt,lr,fr)},Mt=(lr,fr)=>{set$2($.errors,lr,fr),at.state.next({errors:$.errors})},Bt=lr=>{$.errors=lr,at.state.next({errors:$.errors,isValid:!1})},Dt=(lr,fr,_r,Sr)=>{const kr=get$2(j,lr);if(kr){const Ar=get$2(tt,lr,isUndefined$2(_r)?get$2(et,lr):_r);isUndefined$2(Ar)||Sr&&Sr.defaultChecked||fr?set$2(tt,lr,fr?Ar:getFieldValue(kr._f)):dt(lr,Ar),rt.mount&&Ct()}},zt=(lr,fr,_r,Sr,kr)=>{let Ar=!1,$r=!1;const Or={name:lr},Br=!!(get$2(j,lr)&&get$2(j,lr)._f.disabled);if(!_r||Sr){ot.isDirty&&($r=$.isDirty,$.isDirty=Or.isDirty=bt(),Ar=$r!==Or.isDirty);const or=Br||deepEqual$1(get$2(et,lr),fr);$r=!!(!Br&&get$2($.dirtyFields,lr)),or||Br?unset($.dirtyFields,lr):set$2($.dirtyFields,lr,!0),Or.dirtyFields=$.dirtyFields,Ar=Ar||ot.dirtyFields&&$r!==!or}if(_r){const or=get$2($.touchedFields,lr);or||(set$2($.touchedFields,lr,_r),Or.touchedFields=$.touchedFields,Ar=Ar||ot.touchedFields&&or!==_r)}return Ar&&kr&&at.state.next(Or),Ar?Or:{}},Ot=(lr,fr,_r,Sr)=>{const kr=get$2($.errors,lr),Ar=ot.isValid&&isBoolean$3(fr)&&$.isValid!==fr;if(a.delayError&&_r?(it=wt(()=>Mt(lr,_r)),it(a.delayError)):(clearTimeout(st),it=null,_r?set$2($.errors,lr,_r):unset($.errors,lr)),(_r?!deepEqual$1(kr,_r):kr)||!isEmptyObject(Sr)||Ar){const $r={...Sr,...Ar&&isBoolean$3(fr)?{isValid:fr}:{},errors:$.errors,name:lr};$={...$,...$r},at.state.next($r)}},It=async lr=>{Pt(lr,!0);const fr=await _.resolver(tt,_.context,getResolverOptions(lr||nt.mount,j,_.criteriaMode,_.shouldUseNativeValidation));return Pt(lr),fr},Lt=async lr=>{const{errors:fr}=await It(lr);if(lr)for(const _r of lr){const Sr=get$2(fr,_r);Sr?set$2($.errors,_r,Sr):unset($.errors,_r)}else $.errors=fr;return fr},Ft=async(lr,fr,_r={valid:!0})=>{for(const Sr in lr){const kr=lr[Sr];if(kr){const{_f:Ar,...$r}=kr;if(Ar){const Or=nt.array.has(Ar.name);Pt([Sr],!0);const Br=await validateField(kr,tt,yt,_.shouldUseNativeValidation&&!fr,Or);if(Pt([Sr]),Br[Ar.name]&&(_r.valid=!1,fr))break;!fr&&(get$2(Br,Ar.name)?Or?updateFieldArrayRootError($.errors,Br,Ar.name):set$2($.errors,Ar.name,Br[Ar.name]):unset($.errors,Ar.name))}$r&&await Ft($r,fr,_r)}}return _r.valid},jt=()=>{for(const lr of nt.unMount){const fr=get$2(j,lr);fr&&(fr._f.refs?fr._f.refs.every(_r=>!live(_r)):!live(fr._f.ref))&&nr(lr)}nt.unMount=new Set},bt=(lr,fr)=>(lr&&fr&&set$2(tt,lr,fr),!deepEqual$1(Tt(),et)),vt=(lr,fr,_r)=>generateWatchOutput(lr,nt,{...rt.mount?tt:isUndefined$2(fr)?et:isString$3(lr)?{[lr]:fr}:fr},_r,fr),ct=lr=>compact(get$2(rt.mount?tt:et,lr,a.shouldUnregister?get$2(et,lr,[]):[])),dt=(lr,fr,_r={})=>{const Sr=get$2(j,lr);let kr=fr;if(Sr){const Ar=Sr._f;Ar&&(!Ar.disabled&&set$2(tt,lr,getFieldValueAs(fr,Ar)),kr=isHTMLElement(Ar.ref)&&isNullOrUndefined(fr)?"":fr,isMultipleSelect(Ar.ref)?[...Ar.ref.options].forEach($r=>$r.selected=kr.includes($r.value)):Ar.refs?isCheckBoxInput(Ar.ref)?Ar.refs.length>1?Ar.refs.forEach($r=>(!$r.defaultChecked||!$r.disabled)&&($r.checked=Array.isArray(kr)?!!kr.find(Or=>Or===$r.value):kr===$r.value)):Ar.refs[0]&&(Ar.refs[0].checked=!!kr):Ar.refs.forEach($r=>$r.checked=$r.value===kr):isFileInput(Ar.ref)?Ar.ref.value="":(Ar.ref.value=kr,Ar.ref.type||at.values.next({name:lr,values:{...tt}})))}(_r.shouldDirty||_r.shouldTouch)&&zt(lr,kr,_r.shouldTouch,_r.shouldDirty,!0),_r.shouldValidate&&St(lr)},mt=(lr,fr,_r)=>{for(const Sr in fr){const kr=fr[Sr],Ar=`${lr}.${Sr}`,$r=get$2(j,Ar);(nt.array.has(lr)||!isPrimitive(kr)||$r&&!$r._f)&&!isDateObject(kr)?mt(Ar,kr,_r):dt(Ar,kr,_r)}},xt=(lr,fr,_r={})=>{const Sr=get$2(j,lr),kr=nt.array.has(lr),Ar=cloneObject(fr);set$2(tt,lr,Ar),kr?(at.array.next({name:lr,values:{...tt}}),(ot.isDirty||ot.dirtyFields)&&_r.shouldDirty&&at.state.next({name:lr,dirtyFields:getDirtyFields(et,tt),isDirty:bt(lr,Ar)})):Sr&&!Sr._f&&!isNullOrUndefined(Ar)?mt(lr,Ar,_r):dt(lr,Ar,_r),isWatched(lr,nt)&&at.state.next({...$}),at.values.next({name:rt.mount?lr:void 0,values:{...tt}})},At=async lr=>{rt.mount=!0;const fr=lr.target;let _r=fr.name,Sr=!0;const kr=get$2(j,_r),Ar=()=>fr.type?getFieldValue(kr._f):getEventValue(lr),$r=Or=>{Sr=Number.isNaN(Or)||Or===get$2(tt,_r,Or)};if(kr){let Or,Br;const or=Ar(),Yt=lr.type===EVENTS.BLUR||lr.type===EVENTS.FOCUS_OUT,er=!hasValidation(kr._f)&&!_.resolver&&!get$2($.errors,_r)&&!kr._f.deps||skipValidation(Yt,get$2($.touchedFields,_r),$.isSubmitted,ht,ut),Gt=isWatched(_r,nt,Yt);set$2(tt,_r,or),Yt?(kr._f.onBlur&&kr._f.onBlur(lr),it&&it(0)):kr._f.onChange&&kr._f.onChange(lr);const Vt=zt(_r,or,Yt,!1),Wt=!isEmptyObject(Vt)||Gt;if(!Yt&&at.values.next({name:_r,type:lr.type,values:{...tt}}),er)return ot.isValid&&Ct(),Wt&&at.state.next({name:_r,...Gt?{}:Vt});if(!Yt&&Gt&&at.state.next({...$}),_.resolver){const{errors:ar}=await It([_r]);if($r(or),Sr){const yr=schemaErrorLookup($.errors,j,_r),Er=schemaErrorLookup(ar,j,yr.name||_r);Or=Er.error,_r=Er.name,Br=isEmptyObject(ar)}}else Pt([_r],!0),Or=(await validateField(kr,tt,yt,_.shouldUseNativeValidation))[_r],Pt([_r]),$r(or),Sr&&(Or?Br=!1:ot.isValid&&(Br=await Ft(j,!0)));Sr&&(kr._f.deps&&St(kr._f.deps),Ot(_r,Br,Or,Vt))}},Rt=(lr,fr)=>{if(get$2($.errors,fr)&&lr.focus)return lr.focus(),1},St=async(lr,fr={})=>{let _r,Sr;const kr=convertToArrayPayload(lr);if(_.resolver){const Ar=await Lt(isUndefined$2(lr)?lr:kr);_r=isEmptyObject(Ar),Sr=lr?!kr.some($r=>get$2(Ar,$r)):_r}else lr?(Sr=(await Promise.all(kr.map(async Ar=>{const $r=get$2(j,Ar);return await Ft($r&&$r._f?{[Ar]:$r}:$r)}))).every(Boolean),!(!Sr&&!$.isValid)&&Ct()):Sr=_r=await Ft(j);return at.state.next({...!isString$3(lr)||ot.isValid&&_r!==$.isValid?{}:{name:lr},..._.resolver||!lr?{isValid:_r}:{},errors:$.errors}),fr.shouldFocus&&!Sr&&iterateFieldsByAction(j,Rt,lr?kr:nt.mount),Sr},Tt=lr=>{const fr={...rt.mount?tt:et};return isUndefined$2(lr)?fr:isString$3(lr)?get$2(fr,lr):lr.map(_r=>get$2(fr,_r))},Et=(lr,fr)=>({invalid:!!get$2((fr||$).errors,lr),isDirty:!!get$2((fr||$).dirtyFields,lr),isTouched:!!get$2((fr||$).touchedFields,lr),isValidating:!!get$2((fr||$).validatingFields,lr),error:get$2((fr||$).errors,lr)}),Nt=lr=>{lr&&convertToArrayPayload(lr).forEach(fr=>unset($.errors,fr)),at.state.next({errors:lr?$.errors:{}})},tr=(lr,fr,_r)=>{const Sr=(get$2(j,lr,{_f:{}})._f||{}).ref,kr=get$2($.errors,lr)||{},{ref:Ar,message:$r,type:Or,...Br}=kr;set$2($.errors,lr,{...Br,...fr,ref:Sr}),at.state.next({name:lr,errors:$.errors,isValid:!1}),_r&&_r.shouldFocus&&Sr&&Sr.focus&&Sr.focus()},ir=(lr,fr)=>isFunction$4(lr)?at.values.subscribe({next:_r=>lr(vt(void 0,fr),_r)}):vt(lr,fr,!0),nr=(lr,fr={})=>{for(const _r of lr?convertToArrayPayload(lr):nt.mount)nt.mount.delete(_r),nt.array.delete(_r),fr.keepValue||(unset(j,_r),unset(tt,_r)),!fr.keepError&&unset($.errors,_r),!fr.keepDirty&&unset($.dirtyFields,_r),!fr.keepTouched&&unset($.touchedFields,_r),!fr.keepIsValidating&&unset($.validatingFields,_r),!_.shouldUnregister&&!fr.keepDefaultValue&&unset(et,_r);at.values.next({values:{...tt}}),at.state.next({...$,...fr.keepDirty?{isDirty:bt()}:{}}),!fr.keepIsValid&&Ct()},Zt=({disabled:lr,name:fr,field:_r,fields:Sr,value:kr})=>{if(isBoolean$3(lr)&&rt.mount||lr){const Ar=lr?void 0:isUndefined$2(kr)?getFieldValue(_r?_r._f:get$2(Sr,fr)._f):kr;set$2(tt,fr,Ar),zt(fr,Ar,!1,!1,!0)}},Kt=(lr,fr={})=>{let _r=get$2(j,lr);const Sr=isBoolean$3(fr.disabled);return set$2(j,lr,{..._r||{},_f:{..._r&&_r._f?_r._f:{ref:{name:lr}},name:lr,mount:!0,...fr}}),nt.mount.add(lr),_r?Zt({field:_r,disabled:fr.disabled,name:lr,value:fr.value}):Dt(lr,!0,fr.value),{...Sr?{disabled:fr.disabled}:{},..._.progressive?{required:!!fr.required,min:getRuleValue(fr.min),max:getRuleValue(fr.max),minLength:getRuleValue(fr.minLength),maxLength:getRuleValue(fr.maxLength),pattern:getRuleValue(fr.pattern)}:{},name:lr,onChange:At,onBlur:At,ref:kr=>{if(kr){Kt(lr,fr),_r=get$2(j,lr);const Ar=isUndefined$2(kr.value)&&kr.querySelectorAll&&kr.querySelectorAll("input,select,textarea")[0]||kr,$r=isRadioOrCheckbox(Ar),Or=_r._f.refs||[];if($r?Or.find(Br=>Br===Ar):Ar===_r._f.ref)return;set$2(j,lr,{_f:{..._r._f,...$r?{refs:[...Or.filter(live),Ar,...Array.isArray(get$2(et,lr))?[{}]:[]],ref:{type:Ar.type,name:lr}}:{ref:Ar}}}),Dt(lr,!1,void 0,Ar)}else _r=get$2(j,lr,{}),_r._f&&(_r._f.mount=!1),(_.shouldUnregister||fr.shouldUnregister)&&!(isNameInFieldArray(nt.array,lr)&&rt.action)&&nt.unMount.add(lr)}}},Qt=()=>_.shouldFocusError&&iterateFieldsByAction(j,Rt,nt.mount),Ht=lr=>{isBoolean$3(lr)&&(at.state.next({disabled:lr}),iterateFieldsByAction(j,(fr,_r)=>{const Sr=get$2(j,_r);Sr&&(fr.disabled=Sr._f.disabled||lr,Array.isArray(Sr._f.refs)&&Sr._f.refs.forEach(kr=>{kr.disabled=Sr._f.disabled||lr}))},0,!1))},qt=(lr,fr)=>async _r=>{let Sr;_r&&(_r.preventDefault&&_r.preventDefault(),_r.persist&&_r.persist());let kr=cloneObject(tt);if(at.state.next({isSubmitting:!0}),_.resolver){const{errors:Ar,values:$r}=await It();$.errors=Ar,kr=$r}else await Ft(j);if(unset($.errors,"root"),isEmptyObject($.errors)){at.state.next({errors:{}});try{await lr(kr,_r)}catch(Ar){Sr=Ar}}else fr&&await fr({...$.errors},_r),Qt(),setTimeout(Qt);if(at.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject($.errors)&&!Sr,submitCount:$.submitCount+1,errors:$.errors}),Sr)throw Sr},Jt=(lr,fr={})=>{get$2(j,lr)&&(isUndefined$2(fr.defaultValue)?xt(lr,cloneObject(get$2(et,lr))):(xt(lr,fr.defaultValue),set$2(et,lr,cloneObject(fr.defaultValue))),fr.keepTouched||unset($.touchedFields,lr),fr.keepDirty||(unset($.dirtyFields,lr),$.isDirty=fr.defaultValue?bt(lr,cloneObject(get$2(et,lr))):bt()),fr.keepError||(unset($.errors,lr),ot.isValid&&Ct()),at.state.next({...$}))},ur=(lr,fr={})=>{const _r=lr?cloneObject(lr):et,Sr=cloneObject(_r),kr=isEmptyObject(lr),Ar=kr?et:Sr;if(fr.keepDefaultValues||(et=_r),!fr.keepValues){if(fr.keepDirtyValues)for(const $r of nt.mount)get$2($.dirtyFields,$r)?set$2(Ar,$r,get$2(tt,$r)):xt($r,get$2(Ar,$r));else{if(isWeb&&isUndefined$2(lr))for(const $r of nt.mount){const Or=get$2(j,$r);if(Or&&Or._f){const Br=Array.isArray(Or._f.refs)?Or._f.refs[0]:Or._f.ref;if(isHTMLElement(Br)){const or=Br.closest("form");if(or){or.reset();break}}}}j={}}tt=a.shouldUnregister?fr.keepDefaultValues?cloneObject(et):{}:cloneObject(Ar),at.array.next({values:{...Ar}}),at.values.next({values:{...Ar}})}nt={mount:fr.keepDirtyValues?nt.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},rt.mount=!ot.isValid||!!fr.keepIsValid||!!fr.keepDirtyValues,rt.watch=!!a.shouldUnregister,at.state.next({submitCount:fr.keepSubmitCount?$.submitCount:0,isDirty:kr?!1:fr.keepDirty?$.isDirty:!!(fr.keepDefaultValues&&!deepEqual$1(lr,et)),isSubmitted:fr.keepIsSubmitted?$.isSubmitted:!1,dirtyFields:kr?[]:fr.keepDirtyValues?fr.keepDefaultValues&&tt?getDirtyFields(et,tt):$.dirtyFields:fr.keepDefaultValues&&lr?getDirtyFields(et,lr):{},touchedFields:fr.keepTouched?$.touchedFields:{},errors:fr.keepErrors?$.errors:{},isSubmitSuccessful:fr.keepIsSubmitSuccessful?$.isSubmitSuccessful:!1,isSubmitting:!1})},xr=(lr,fr)=>ur(isFunction$4(lr)?lr(tt):lr,fr);return{control:{register:Kt,unregister:nr,getFieldState:Et,handleSubmit:qt,setError:tr,_executeSchema:It,_getWatch:vt,_getDirty:bt,_updateValid:Ct,_removeUnmounted:jt,_updateFieldArray:$t,_updateDisabledField:Zt,_getFieldArray:ct,_reset:ur,_resetDefaultValues:()=>isFunction$4(_.defaultValues)&&_.defaultValues().then(lr=>{xr(lr,_.resetOptions),at.state.next({isLoading:!1})}),_updateFormState:lr=>{$={...$,...lr}},_disableForm:Ht,_subjects:at,_proxyFormState:ot,_setErrors:Bt,get _fields(){return j},get _formValues(){return tt},get _state(){return rt},set _state(lr){rt=lr},get _defaultValues(){return et},get _names(){return nt},set _names(lr){nt=lr},get _formState(){return $},set _formState(lr){$=lr},get _options(){return _},set _options(lr){_={..._,...lr}}},trigger:St,register:Kt,handleSubmit:qt,watch:ir,setValue:xt,getValues:Tt,reset:xr,resetField:Jt,clearErrors:Nt,unregister:nr,setError:tr,setFocus:(lr,fr={})=>{const _r=get$2(j,lr),Sr=_r&&_r._f;if(Sr){const kr=Sr.refs?Sr.refs[0]:Sr.ref;kr.focus&&(kr.focus(),fr.shouldSelect&&kr.select())}},getFieldState:Et}}function useForm(a={}){const _=React$2.useRef(),$=React$2.useRef(),[j,et]=React$2.useState({isDirty:!1,isValidating:!1,isLoading:isFunction$4(a.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:a.errors||{},disabled:a.disabled||!1,defaultValues:isFunction$4(a.defaultValues)?void 0:a.defaultValues});_.current||(_.current={...createFormControl(a),formState:j});const tt=_.current.control;return tt._options=a,useSubscribe({subject:tt._subjects.state,next:rt=>{shouldRenderFormState(rt,tt._proxyFormState,tt._updateFormState)&&et({...tt._formState})}}),React$2.useEffect(()=>tt._disableForm(a.disabled),[tt,a.disabled]),React$2.useEffect(()=>{if(tt._proxyFormState.isDirty){const rt=tt._getDirty();rt!==j.isDirty&&tt._subjects.state.next({isDirty:rt})}},[tt,j.isDirty]),React$2.useEffect(()=>{a.values&&!deepEqual$1(a.values,$.current)?(tt._reset(a.values,tt._options.resetOptions),$.current=a.values,et(rt=>({...rt}))):tt._resetDefaultValues()},[a.values,tt]),React$2.useEffect(()=>{a.errors&&tt._setErrors(a.errors)},[a.errors,tt]),React$2.useEffect(()=>{tt._state.mount||(tt._updateValid(),tt._state.mount=!0),tt._state.watch&&(tt._state.watch=!1,tt._subjects.state.next({...tt._formState})),tt._removeUnmounted()}),React$2.useEffect(()=>{a.shouldUnregister&&tt._subjects.values.next({values:tt._getWatch()})},[a.shouldUnregister,tt]),_.current.formState=getProxyFormState(j,tt),_.current}const colors={orange:"#FB4F57",orangeL:"#FC7884",blue:"#0D99FF",blueL:"#4FA2FF",green:"#00C39A",greenL:"#00E7B6",black:"#000000",white:"#FFFFFF",gray:{900:"#121212",800:"#181818",700:"#282828",600:"#2C2B2B",500:"#414141",450:"#707070",400:"#C2C2C2",300:"#D6D6D6",200:"#EBEBEB",100:"#F0F0F0",50:"#F5F5F5"}},AccountsIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"24px",height:"24px",fill:"none",textAlign:"center",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntimeExports.jsx("path",{d:"M14 5.6C14 5.03995 14 4.75992 14.109 4.54601C14.2049 4.35785 14.3578 4.20487 14.546 4.10899C14.7599 4 15.0399 4 15.6 4H18.4C18.9601 4 19.2401 4 19.454 4.10899C19.6422 4.20487 19.7951 4.35785 19.891 4.54601C20 4.75992 20 5.03995 20 5.6V8.4C20 8.96005 20 9.24008 19.891 9.45399C19.7951 9.64215 19.6422 9.79513 19.454 9.89101C19.2401 10 18.9601 10 18.4 10H15.6C15.0399 10 14.7599 10 14.546 9.89101C14.3578 9.79513 14.2049 9.64215 14.109 9.45399C14 9.24008 14 8.96005 14 8.4V5.6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M4 5.6C4 5.03995 4 4.75992 4.10899 4.54601C4.20487 4.35785 4.35785 4.20487 4.54601 4.10899C4.75992 4 5.03995 4 5.6 4H8.4C8.96005 4 9.24008 4 9.45399 4.10899C9.64215 4.20487 9.79513 4.35785 9.89101 4.54601C10 4.75992 10 5.03995 10 5.6V8.4C10 8.96005 10 9.24008 9.89101 9.45399C9.79513 9.64215 9.64215 9.79513 9.45399 9.89101C9.24008 10 8.96005 10 8.4 10H5.6C5.03995 10 4.75992 10 4.54601 9.89101C4.35785 9.79513 4.20487 9.64215 4.10899 9.45399C4 9.24008 4 8.96005 4 8.4V5.6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M4 15.6C4 15.0399 4 14.7599 4.10899 14.546C4.20487 14.3578 4.35785 14.2049 4.54601 14.109C4.75992 14 5.03995 14 5.6 14H8.4C8.96005 14 9.24008 14 9.45399 14.109C9.64215 14.2049 9.79513 14.3578 9.89101 14.546C10 14.7599 10 15.0399 10 15.6V18.4C10 18.9601 10 19.2401 9.89101 19.454C9.79513 19.6422 9.64215 19.7951 9.45399 19.891C9.24008 20 8.96005 20 8.4 20H5.6C5.03995 20 4.75992 20 4.54601 19.891C4.35785 19.7951 4.20487 19.6422 4.10899 19.454C4 19.2401 4 18.9601 4 18.4V15.6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M14 15.6C14 15.0399 14 14.7599 14.109 14.546C14.2049 14.3578 14.3578 14.2049 14.546 14.109C14.7599 14 15.0399 14 15.6 14H18.4C18.9601 14 19.2401 14 19.454 14.109C19.6422 14.2049 19.7951 14.3578 19.891 14.546C20 14.7599 20 15.0399 20 15.6V18.4C20 18.9601 20 19.2401 19.891 19.454C19.7951 19.6422 19.6422 19.7951 19.454 19.891C19.2401 20 18.9601 20 18.4 20H15.6C15.0399 20 14.7599 20 14.546 19.891C14.3578 19.7951 14.2049 19.6422 14.109 19.454C14 19.2401 14 18.9601 14 18.4V15.6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})]}),AddAccountIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M8.25 13.5H4.65C3.80992 13.5 3.38988 13.5 3.06901 13.3365C2.78677 13.1927 2.5573 12.9632 2.41349 12.681C2.25 12.3601 2.25 11.9401 2.25 11.1V5.4C2.25 4.55992 2.25 4.13988 2.41349 3.81901C2.5573 3.53677 2.78677 3.3073 3.06901 3.16349C3.38988 3 3.80992 3 4.65 3H13.35C14.1901 3 14.6101 3 14.931 3.16349C15.2132 3.3073 15.4427 3.53677 15.5865 3.81901C15.75 4.13988 15.75 4.55992 15.75 5.4V8.25M2.25 6H15.75M13.5 15V10.5M15.75 12.7506L11.25 12.75",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),AddContactIcon=a=>jsxRuntimeExports.jsx(Icon,{fill:"none",viewBox:"0 0 13 17",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M13 12.5L10.75 12.5M10.75 12.5L8.5 12.5M10.75 12.5V10.25M10.75 12.5V14.75M6.25 14.75H1C1 11.8505 3.35051 9.5 6.25 9.5C6.77123 9.5 7.27472 9.57596 7.75 9.71741M9.25 4.25C9.25 5.90685 7.90685 7.25 6.25 7.25C4.59315 7.25 3.25 5.90685 3.25 4.25C3.25 2.59315 4.59315 1.25 6.25 1.25C7.90685 1.25 9.25 2.59315 9.25 4.25Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),AddressBookIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M13.5 15.5C13.2164 14.3589 11.981 13.5 10.5 13.5C9.019 13.5 7.78364 14.3589 7.5 15.5M21 5V7M21 11V13M21 17V19M6.2 21H14.8C15.9201 21 16.4802 21 16.908 20.782C17.2843 20.5903 17.5903 20.2843 17.782 19.908C18 19.4802 18 18.9201 18 17.8V6.2C18 5.0799 18 4.51984 17.782 4.09202C17.5903 3.71569 17.2843 3.40973 16.908 3.21799C16.4802 3 15.9201 3 14.8 3H6.2C5.0799 3 4.51984 3 4.09202 3.21799C3.71569 3.40973 3.40973 3.71569 3.21799 4.09202C3 4.51984 3 5.07989 3 6.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21ZM11.5 9.5C11.5 10.0523 11.0523 10.5 10.5 10.5C9.94772 10.5 9.5 10.0523 9.5 9.5C9.5 8.94772 9.94772 8.5 10.5 8.5C11.0523 8.5 11.5 8.94772 11.5 9.5Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),BakerIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],"data-testid":"baker-icon",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3.74946 5.25V8.25M7.49946 1.5V4.5M13.4995 12V15M2.24946 6.75H5.24946M5.99946 3H8.99946M11.9995 13.5H14.9995M10.4995 5.25L12.6208 7.37132M14.6369 2.80959L15.0612 3.23385C15.3582 3.53086 15.5067 3.67937 15.5624 3.85062C15.6113 4.00125 15.6113 4.16351 15.5624 4.31414C15.5067 4.48539 15.3582 4.6339 15.0612 4.93091L4.89356 15.0985C4.59655 15.3955 4.44804 15.5441 4.2768 15.5997C4.12617 15.6486 3.9639 15.6486 3.81327 15.5997C3.64203 15.5441 3.49352 15.3955 3.19651 15.0985L2.77224 14.6743C2.47523 14.3773 2.32672 14.2288 2.27108 14.0575C2.22214 13.9069 2.22214 13.7446 2.27108 13.594C2.32672 13.4227 2.47523 13.2742 2.77224 12.9772L12.9399 2.80959C13.2369 2.51258 13.3854 2.36407 13.5566 2.30843C13.7073 2.25948 13.8695 2.25948 14.0202 2.30843C14.1914 2.36407 14.3399 2.51258 14.6369 2.80959Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),BatchIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",strokeWidth:"1.2",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M10 4V20M14 4V20M4 8C4 8.92997 4 9.39496 4.10222 9.77646C4.37962 10.8117 5.18827 11.6204 6.22354 11.8978C6.60504 12 7.07003 12 8 12H16C16.93 12 17.395 12 17.7765 11.8978C18.8117 11.6204 19.6204 10.8117 19.8978 9.77646C20 9.39496 20 8.92997 20 8M4 8C4 7.07003 4 6.60504 4.10222 6.22354C4.37962 5.18827 5.18827 4.37962 6.22354 4.10222C6.60504 4 7.07003 4 8 4H16C16.93 4 17.395 4 17.7765 4.10222C18.8117 4.37962 19.6204 5.18827 19.8978 6.22354C20 6.60504 20 7.07003 20 8M4 8V16C4 16.93 4 17.395 4.10222 17.7765C4.37962 18.8117 5.18827 19.6204 6.22354 19.8978C6.60504 20 7.07003 20 8 20H16C16.93 20 17.395 20 17.7765 19.8978C18.8117 19.6204 19.6204 18.8117 19.8978 17.7765C20 17.395 20 16.93 20 16V8M10 16H8C7.07003 16 6.60504 16 6.22354 15.8978C5.18827 15.6204 4.37962 14.8117 4.10222 13.7765C4 13.395 4 12.93 4 12M14 16H16C16.93 16 17.395 16 17.7765 15.8978C18.8117 15.6204 19.6204 14.8117 19.8978 13.7765C20 13.395 20 12.93 20 12M7 8H7.01M17 8H17.01",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round"})}),BurgerMenuIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],textAlign:"center",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4 6H20M4 12H20M4 18H20",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),CheckmarkIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M6 9.25L7.84615 11.25L12 6.75M15.75 9C15.75 12.7279 12.7279 15.75 9 15.75C5.27208 15.75 2.25 12.7279 2.25 9C2.25 5.27208 5.27208 2.25 9 2.25C12.7279 2.25 15.75 5.27208 15.75 9Z",stroke:"#00C39A",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ChevronDownIcon$1=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4.5 6.75L9 11.25L13.5 6.75",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ChevronRightIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M7 14L11.5 9.5L7 5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ChevronUpIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4.5 11.25L9 6.75L13.5 11.25",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),CoinIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12 10V14M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12ZM17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ContactIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none","data-testid":"contact-icon",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3.75 15.75C3.75 12.8505 6.10051 10.5 9 10.5C11.8995 10.5 14.25 12.8505 14.25 15.75M12 5.25C12 6.90685 10.6569 8.25 9 8.25C7.34315 8.25 6 6.90685 6 5.25C6 3.59315 7.34315 2.25 9 2.25C10.6569 2.25 12 3.59315 12 5.25Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ContractIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M7.5 12.75L6 11.25L7.5 9.75M10.5 9.75L12 11.25L10.5 12.75M9.75 2.25H6.15C5.30992 2.25 4.88988 2.25 4.56901 2.41349C4.28677 2.5573 4.0573 2.78677 3.91349 3.06901C3.75 3.38988 3.75 3.80992 3.75 4.65V13.35C3.75 14.1901 3.75 14.6101 3.91349 14.931C4.0573 15.2132 4.28677 15.4427 4.56901 15.5865C4.88988 15.75 5.30992 15.75 6.15 15.75H11.85C12.6901 15.75 13.1101 15.75 13.431 15.5865C13.7132 15.4427 13.9427 15.2132 14.0865 14.931C14.25 14.6101 14.25 14.1901 14.25 13.35V6.75M9.75 2.25L14.25 6.75M9.75 2.25V6C9.75 6.41421 10.0858 6.75 10.5 6.75H14.25",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),CrossedCircleIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M13.773 13.773C14.9945 12.5515 15.75 10.864 15.75 9C15.75 5.27208 12.7279 2.25 9 2.25C7.13604 2.25 5.44854 3.00552 4.22703 4.22703M13.773 13.773C12.5515 14.9945 10.864 15.75 9 15.75C5.27208 15.75 2.25 12.7279 2.25 9C2.25 7.13604 3.00552 5.44854 4.22703 4.22703M13.773 13.773L4.22703 4.22703",stroke:"#FB4F57",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),DiamondIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3.125 9H20.875M12 3L8 9L12 20.6667L16 9L12 3ZM12.64 20.1467L20.64 9.48C20.7691 9.30787 20.8336 9.22181 20.8585 9.12728C20.8805 9.04385 20.8805 8.95615 20.8585 8.87272C20.8336 8.77819 20.7691 8.69213 20.64 8.52L16.74 3.32C16.652 3.20267 16.608 3.144 16.5522 3.10169C16.5028 3.06421 16.4469 3.03625 16.3873 3.01922C16.32 3 16.2467 3 16.1 3H7.9C7.75333 3 7.68 3 7.61269 3.01922C7.55308 3.03625 7.49715 3.06421 7.44776 3.10169C7.392 3.144 7.348 3.20267 7.26 3.32L3.36 8.52C3.2309 8.69213 3.16635 8.77819 3.14147 8.87271C3.11951 8.95615 3.11951 9.04385 3.14147 9.12728C3.16635 9.2218 3.2309 9.30787 3.36 9.48L11.36 20.1467C11.5771 20.4362 11.6857 20.5809 11.8188 20.6327C11.9353 20.678 12.0647 20.678 12.1812 20.6327C12.3143 20.5809 12.4229 20.4362 12.64 20.1467Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),DocumentIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M9 17H13M9 13H13M9 9H10M17 18V21M17 15H17.01M13 3H8.2C7.0799 3 6.51984 3 6.09202 3.21799C5.71569 3.40973 5.40973 3.71569 5.21799 4.09202C5 4.51984 5 5.0799 5 6.2V17.8C5 18.9201 5 19.4802 5.21799 19.908C5.40973 20.2843 5.71569 20.5903 6.09202 20.782C6.51984 21 7.0799 21 8.2 21H13M13 3L19 9M13 3V7.4C13 7.96005 13 8.24008 13.109 8.45399C13.2049 8.64215 13.3578 8.79513 13.546 8.89101C13.7599 9 14.0399 9 14.6 9H19M19 9V11.5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),DoubleCheckmarkIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4 14L9 19L20 8M6 8.88889L9.07692 12L16 5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),DownloadIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"16px",height:"16px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M5 7.25L8 10.25M8 10.25L11 7.25M8 10.25V1.25M14.75 7.25V12.3494C14.75 13.1895 14.75 13.6095 14.5865 13.9304C14.4427 14.2126 14.2132 14.4421 13.931 14.5859C13.6101 14.7494 13.1901 14.7494 12.35 14.7494H3.65C2.80992 14.7494 2.38988 14.7494 2.06901 14.5859C1.78677 14.4421 1.5573 14.2126 1.41349 13.9304C1.25 13.6095 1.25 13.1895 1.25 12.3494V7.25",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),EditAccountIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M8.5 21H4C4 17.134 7.13401 14 11 14C11.1681 14 11.3348 14.0059 11.5 14.0176M15 7C15 9.20914 13.2091 11 11 11C8.79086 11 7 9.20914 7 7C7 4.79086 8.79086 3 11 3C13.2091 3 15 4.79086 15 7ZM12.5898 21L14.6148 20.595C14.7914 20.5597 14.8797 20.542 14.962 20.5097C15.0351 20.4811 15.1045 20.4439 15.1689 20.399C15.2414 20.3484 15.3051 20.2848 15.4324 20.1574L19.5898 16C20.1421 15.4477 20.1421 14.5523 19.5898 14C19.0376 13.4477 18.1421 13.4477 17.5898 14L13.4324 18.1574C13.3051 18.2848 13.2414 18.3484 13.1908 18.421C13.1459 18.4853 13.1088 18.5548 13.0801 18.6279C13.0478 18.7102 13.0302 18.7985 12.9948 18.975L12.5898 21Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ExclamationIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"12px",height:"12px",fill:"none",stroke:colors.orange,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M6 3.66667V6.58333M6 8.33333H6.00583M11.25 6C11.25 8.89949 8.89949 11.25 6 11.25C3.1005 11.25 0.75 8.89949 0.75 6C0.75 3.1005 3.1005 0.75 6 0.75C8.89949 0.75 11.25 3.1005 11.25 6Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ExitArrowIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M15 3V15M3 9H12M12 9L9 6M12 9L9 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ExternalLinkIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M15 3L9 9M15 3V6.375M15 3H11.625M14.25 9.375V12.6C14.25 13.4401 14.25 13.8601 14.0865 14.181C13.9427 14.4632 13.7132 14.6927 13.431 14.8365C13.1101 15 12.6901 15 11.85 15H5.4C4.55992 15 4.13988 15 3.81901 14.8365C3.53677 14.6927 3.3073 14.4632 3.16349 14.181C3 13.8601 3 13.4401 3 12.6V6.15C3 5.30992 3 4.88988 3.16349 4.56901C3.3073 4.28677 3.53677 4.0573 3.81901 3.91349C4.13988 3.75 4.55992 3.75 5.4 3.75H8.625",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),EyeIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"16px",height:"12px",fill:"none",viewBox:"0 0 16 12",xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntimeExports.jsx("path",{d:"M10.2501 6C10.2501 7.24264 9.2427 8.25 8.00006 8.25C6.75742 8.25 5.75006 7.24264 5.75006 6C5.75006 4.75736 6.75742 3.75 8.00006 3.75C9.2427 3.75 10.2501 4.75736 10.2501 6Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M8.00039 0.75C4.64217 0.75 1.79946 2.95716 0.84375 5.99997C1.79944 9.04282 4.64217 11.25 8.00041 11.25C11.3586 11.25 14.2013 9.04284 15.157 6.00003C14.2014 2.95719 11.3586 0.75 8.00039 0.75Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})]}),EyeSlashIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M2.25024 2.25L15.7502 15.75M7.38345 7.43523C6.99147 7.84016 6.75024 8.39191 6.75024 9C6.75024 10.2426 7.7576 11.25 9.00024 11.25C9.6171 11.25 10.176 11.0018 10.5824 10.5997M4.87524 4.98536C3.45076 5.92525 2.36577 7.33796 1.84375 8.99997C2.79944 12.0428 5.64217 14.25 9.00041 14.25C10.4921 14.25 11.882 13.8145 13.0501 13.0638M8.25024 3.78705C8.49697 3.76254 8.74722 3.75 9.00039 3.75C12.3586 3.75 15.2014 5.95719 16.157 9.00003C15.9465 9.67048 15.6443 10.3004 15.2651 10.875",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),FA12Icon=a=>jsxRuntimeExports.jsx(Icon,{width:"30px",height:"15px",fill:colors.gray[450],viewBox:"1 1 30 15",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M1.2429 13V4.27273H7.02131V5.79403H3.08807V7.87358H6.63778V9.39489H3.08807V13H1.2429ZM8.67685 13H6.69957L9.71236 4.27273H12.0902L15.0987 13H13.1214L10.9354 6.26705H10.8672L8.67685 13ZM8.55327 9.5696H13.2237V11.0099H8.55327V9.5696ZM19.4847 4.27273V13H17.6396V6.02415H17.5884L15.5898 7.27699V5.64062L17.7504 4.27273H19.4847ZM22.1683 13.1108C21.8871 13.1108 21.6456 13.0114 21.4439 12.8125C21.245 12.6108 21.1456 12.3693 21.1456 12.0881C21.1456 11.8097 21.245 11.571 21.4439 11.3722C21.6456 11.1733 21.8871 11.0739 22.1683 11.0739C22.4411 11.0739 22.6797 11.1733 22.8842 11.3722C23.0888 11.571 23.1911 11.8097 23.1911 12.0881C23.1911 12.2756 23.1428 12.4474 23.0462 12.6037C22.9524 12.7571 22.8288 12.8807 22.6754 12.9744C22.522 13.0653 22.353 13.1108 22.1683 13.1108ZM24.6644 13V11.6705L27.771 8.79403C28.0352 8.53835 28.2567 8.30824 28.4357 8.10369C28.6175 7.89915 28.7553 7.69886 28.8491 7.50284C28.9428 7.30398 28.9897 7.08949 28.9897 6.85938C28.9897 6.60369 28.9315 6.38352 28.815 6.19886C28.6985 6.01136 28.5394 5.8679 28.3377 5.76847C28.136 5.66619 27.9073 5.61506 27.6516 5.61506C27.3846 5.61506 27.1516 5.66903 26.9528 5.77699C26.7539 5.88494 26.6005 6.03977 26.4925 6.24148C26.3846 6.44318 26.3306 6.68324 26.3306 6.96165H24.5792C24.5792 6.39062 24.7085 5.89489 24.967 5.47443C25.2255 5.05398 25.5877 4.72869 26.0536 4.49858C26.5195 4.26847 27.0565 4.15341 27.6644 4.15341C28.2894 4.15341 28.8335 4.2642 29.2965 4.4858C29.7624 4.70455 30.1246 5.00852 30.3832 5.39773C30.6417 5.78693 30.771 6.23295 30.771 6.7358C30.771 7.06534 30.7056 7.39062 30.5749 7.71165C30.4471 8.03267 30.2184 8.3892 29.8888 8.78125C29.5593 9.17045 29.0948 9.63778 28.4954 10.1832L27.2212 11.4318V11.4915H30.886V13H24.6644Z"})}),FA2Icon=a=>jsxRuntimeExports.jsx(Icon,{width:"23px",height:"18px",fill:colors.gray[450],viewBox:"0 0 23 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M1.0261 13V4.27273H6.80451V5.79403H2.87127V7.87358H6.42099V9.39489H2.87127V13H1.0261ZM8.46005 13H6.48278L9.49556 4.27273H11.8734L14.8819 13H12.9047L10.7186 6.26705H10.6504L8.46005 13ZM8.33647 9.5696H13.0069V11.0099H8.33647V9.5696ZM15.8812 13V11.6705L18.9877 8.79403C19.252 8.53835 19.4735 8.30824 19.6525 8.10369C19.8343 7.89915 19.9721 7.69886 20.0659 7.50284C20.1596 7.30398 20.2065 7.08949 20.2065 6.85938C20.2065 6.60369 20.1483 6.38352 20.0318 6.19886C19.9153 6.01136 19.7562 5.8679 19.5545 5.76847C19.3528 5.66619 19.1241 5.61506 18.8684 5.61506C18.6014 5.61506 18.3684 5.66903 18.1696 5.77699C17.9707 5.88494 17.8173 6.03977 17.7093 6.24148C17.6014 6.44318 17.5474 6.68324 17.5474 6.96165H15.796C15.796 6.39062 15.9252 5.89489 16.1838 5.47443C16.4423 5.05398 16.8045 4.72869 17.2704 4.49858C17.7363 4.26847 18.2733 4.15341 18.8812 4.15341C19.5062 4.15341 20.0502 4.2642 20.5133 4.4858C20.9792 4.70455 21.3414 5.00852 21.6 5.39773C21.8585 5.78693 21.9877 6.23295 21.9877 6.7358C21.9877 7.06534 21.9224 7.39062 21.7917 7.71165C21.6639 8.03267 21.4352 8.3892 21.1056 8.78125C20.7761 9.17045 20.3116 9.63778 19.7122 10.1832L18.438 11.4318V11.4915H22.1028V13H15.8812Z"})}),FetchingIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"19px",height:"19px",fill:"none",stroke:colors.gray[400],viewBox:"0 0 19 19",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M15.7842 10.2916C15.8165 10.0323 15.8332 9.76807 15.8332 9.49996C15.8332 6.00216 12.9976 3.16663 9.49984 3.16663C7.52021 3.16663 5.75273 4.07488 4.59135 5.49742M3.2155 8.70829C3.18316 8.96764 3.1665 9.23185 3.1665 9.49996C3.1665 12.9978 6.00203 15.8333 9.49984 15.8333C11.3914 15.8333 13.0893 15.004 14.2498 13.6892M11.8748 13.4583H14.2498V13.6892M4.59135 3.16663V5.49742M4.59135 5.49742V5.54157L6.96635 5.54163M14.2498 15.8333V13.6892",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),FileArrowDownIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M9 8.25V12.75M9 12.75L7.5 11.25M9 12.75L10.5 11.25M9.75 2.25H6.15C5.30992 2.25 4.88988 2.25 4.56901 2.41349C4.28677 2.5573 4.0573 2.78677 3.91349 3.06901C3.75 3.38988 3.75 3.80992 3.75 4.65V13.35C3.75 14.1901 3.75 14.6101 3.91349 14.931C4.0573 15.2132 4.28677 15.4427 4.56901 15.5865C4.88988 15.75 5.30992 15.75 6.15 15.75H11.85C12.6901 15.75 13.1101 15.75 13.431 15.5865C13.7132 15.4427 13.9427 15.2132 14.0865 14.931C14.25 14.6101 14.25 14.1901 14.25 13.35V6.75M9.75 2.25L14.25 6.75M9.75 2.25V5.55C9.75 5.97004 9.75 6.18006 9.83175 6.34049C9.90365 6.48161 10.0184 6.59635 10.1595 6.66825C10.3199 6.75 10.53 6.75 10.95 6.75H14.25",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),FileCopyIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M11.25 2.25V4.8C11.25 5.22004 11.25 5.43006 11.3317 5.59049C11.4037 5.73161 11.5184 5.84635 11.6595 5.91825C11.8199 6 12.03 6 12.45 6H15M7.5 6H4.5C3.67157 6 3 6.67157 3 7.5V14.25C3 15.0784 3.67157 15.75 4.5 15.75H9C9.82843 15.75 10.5 15.0784 10.5 14.25V12M12 2.25H9.9C9.05992 2.25 8.63988 2.25 8.31901 2.41349C8.03677 2.5573 7.8073 2.78677 7.66349 3.06901C7.5 3.38988 7.5 3.80992 7.5 4.65V9.6C7.5 10.4401 7.5 10.8601 7.66349 11.181C7.8073 11.4632 8.03677 11.6927 8.31901 11.8365C8.63988 12 9.05992 12 9.9 12H12.6C13.4401 12 13.8601 12 14.181 11.8365C14.4632 11.6927 14.6927 11.4632 14.8365 11.181C15 10.8601 15 10.4401 15 9.6V5.25L12 2.25Z",strokeLinejoin:"round",strokeWidth:"1.2"})}),FlipForwardEnergy=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:"black",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M2.95314 5.997C4.05824 3.77605 6.35091 2.25 9 2.25C12.4718 2.25 15.3314 4.87105 15.708 8.24231M2.2912 9.74998C2.66427 13.125 5.52558 15.75 9 15.75C11.6496 15.75 13.9427 14.2234 15.0475 12.0017M2.25 3V6.375H5.625M15.75 15.375V12H12.375M8.625 6.75L7.5 9H10.5L9.375 11.25",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),FolderInfoIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[400],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12 10H12.01M12 13V16M12.0627 6.06274L11.9373 5.93726C11.5914 5.59135 11.4184 5.4184 11.2166 5.29472C11.0376 5.18506 10.8425 5.10425 10.6385 5.05526C10.4083 5 10.1637 5 9.67452 5H6.2C5.0799 5 4.51984 5 4.09202 5.21799C3.71569 5.40973 3.40973 5.71569 3.21799 6.09202C3 6.51984 3 7.07989 3 8.2V15.8C3 16.9201 3 17.4802 3.21799 17.908C3.40973 18.2843 3.71569 18.5903 4.09202 18.782C4.51984 19 5.07989 19 6.2 19H17.8C18.9201 19 19.4802 19 19.908 18.782C20.2843 18.5903 20.5903 18.2843 20.782 17.908C21 17.4802 21 16.9201 21 15.8V10.2C21 9.0799 21 8.51984 20.782 8.09202C20.5903 7.71569 20.2843 7.40973 19.908 7.21799C19.4802 7 18.9201 7 17.8 7H14.3255C13.8363 7 13.5917 7 13.3615 6.94474C13.1575 6.89575 12.9624 6.81494 12.7834 6.70528C12.5816 6.5816 12.4086 6.40865 12.0627 6.06274Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),GearIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntimeExports.jsx("path",{d:"M15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M12.9046 3.06005C12.6988 3 12.4659 3 12 3C11.5341 3 11.3012 3 11.0954 3.06005C10.7942 3.14794 10.5281 3.32808 10.3346 3.57511C10.2024 3.74388 10.1159 3.96016 9.94291 4.39272C9.69419 5.01452 9.00393 5.33471 8.36857 5.123L7.79779 4.93281C7.3929 4.79785 7.19045 4.73036 6.99196 4.7188C6.70039 4.70181 6.4102 4.77032 6.15701 4.9159C5.98465 5.01501 5.83376 5.16591 5.53197 5.4677C5.21122 5.78845 5.05084 5.94882 4.94896 6.13189C4.79927 6.40084 4.73595 6.70934 4.76759 7.01551C4.78912 7.2239 4.87335 7.43449 5.04182 7.85566C5.30565 8.51523 5.05184 9.26878 4.44272 9.63433L4.16521 9.80087C3.74031 10.0558 3.52786 10.1833 3.37354 10.3588C3.23698 10.5141 3.13401 10.696 3.07109 10.893C3 11.1156 3 11.3658 3 11.8663C3 12.4589 3 12.7551 3.09462 13.0088C3.17823 13.2329 3.31422 13.4337 3.49124 13.5946C3.69158 13.7766 3.96395 13.8856 4.50866 14.1035C5.06534 14.3261 5.35196 14.9441 5.16236 15.5129L4.94721 16.1584C4.79819 16.6054 4.72367 16.829 4.7169 17.0486C4.70875 17.3127 4.77049 17.5742 4.89587 17.8067C5.00015 18.0002 5.16678 18.1668 5.5 18.5C5.83323 18.8332 5.99985 18.9998 6.19325 19.1041C6.4258 19.2295 6.68733 19.2913 6.9514 19.2831C7.17102 19.2763 7.39456 19.2018 7.84164 19.0528L8.36862 18.8771C9.00393 18.6654 9.6942 18.9855 9.94291 19.6073C10.1159 20.0398 10.2024 20.2561 10.3346 20.4249C10.5281 20.6719 10.7942 20.8521 11.0954 20.94C11.3012 21 11.5341 21 12 21C12.4659 21 12.6988 21 12.9046 20.94C13.2058 20.8521 13.4719 20.6719 13.6654 20.4249C13.7976 20.2561 13.8841 20.0398 14.0571 19.6073C14.3058 18.9855 14.9961 18.6654 15.6313 18.8773L16.1579 19.0529C16.605 19.2019 16.8286 19.2764 17.0482 19.2832C17.3123 19.2913 17.5738 19.2296 17.8063 19.1042C17.9997 18.9999 18.1664 18.8333 18.4996 18.5001C18.8328 18.1669 18.9994 18.0002 19.1037 17.8068C19.2291 17.5743 19.2908 17.3127 19.2827 17.0487C19.2759 16.8291 19.2014 16.6055 19.0524 16.1584L18.8374 15.5134C18.6477 14.9444 18.9344 14.3262 19.4913 14.1035C20.036 13.8856 20.3084 13.7766 20.5088 13.5946C20.6858 13.4337 20.8218 13.2329 20.9054 13.0088C21 12.7551 21 12.4589 21 11.8663C21 11.3658 21 11.1156 20.9289 10.893C20.866 10.696 20.763 10.5141 20.6265 10.3588C20.4721 10.1833 20.2597 10.0558 19.8348 9.80087L19.5569 9.63416C18.9478 9.26867 18.6939 8.51514 18.9578 7.85558C19.1262 7.43443 19.2105 7.22383 19.232 7.01543C19.2636 6.70926 19.2003 6.40077 19.0506 6.13181C18.9487 5.94875 18.7884 5.78837 18.4676 5.46762C18.1658 5.16584 18.0149 5.01494 17.8426 4.91583C17.5894 4.77024 17.2992 4.70174 17.0076 4.71872C16.8091 4.73029 16.6067 4.79777 16.2018 4.93273L15.6314 5.12287C14.9961 5.33464 14.3058 5.0145 14.0571 4.39272C13.8841 3.96016 13.7976 3.74388 13.6654 3.57511C13.4719 3.32808 13.2058 3.14794 12.9046 3.06005Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})]}),GoogleIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntimeExports.jsx("path",{d:"M23.5198 12.2729C23.5198 11.422 23.4435 10.6038 23.3016 9.81836H12V14.4601H18.4581C18.1799 15.9601 17.3345 17.231 16.0636 18.0819V21.0927H19.9417C22.2107 19.0037 23.5198 15.9274 23.5198 12.2729Z",fill:"#4285F4",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M12.0008 24.0011C15.2408 24.0011 17.9571 22.9266 19.9425 21.0939L16.0644 18.083C14.9899 18.803 13.6153 19.2284 12.0008 19.2284C8.8754 19.2284 6.22999 17.1176 5.28637 14.2812H1.27734V17.3903C3.25186 21.312 7.30997 24.0011 12.0008 24.0011Z",fill:"#34A853",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M5.28537 14.2803C5.04537 13.5603 4.90901 12.7912 4.90901 12.0003C4.90901 11.2094 5.04537 10.4404 5.28537 9.72037V6.61133H1.27634C0.463629 8.2313 0 10.064 0 12.0003C0 13.9367 0.463629 15.7694 1.27634 17.3893L5.28537 14.2803Z",fill:"#FBBC05",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M12.0008 4.77265C13.7626 4.77265 15.3444 5.3781 16.588 6.56717L20.0298 3.1254C17.9516 1.18907 15.2353 0 12.0008 0C7.30997 0 3.25186 2.68905 1.27734 6.6108L5.28637 9.71984C6.22999 6.88353 8.8754 4.77265 12.0008 4.77265Z",fill:"#EA4335",clipRule:"evenodd",fillRule:"evenodd"})]}),HelpIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M18.3795 5.65166L14.1055 9.86303M9.89445 14.137L5.63994 18.3679M5.63408 5.63799L9.89445 9.86303M14.1056 14.137L18.364 18.364M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12ZM15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z",stroke:colors.gray[450],strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),HourglassIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M15 2.25H3M15 15.75H3M3.75 2.25C3.75 4.13267 4.65921 5.89944 6.1912 6.99371L11.8088 11.0063C13.3408 12.1006 14.25 13.8673 14.25 15.75M14.25 2.25C14.25 4.13267 13.3408 5.89944 11.8088 6.99371L6.1912 11.0063C4.65921 12.1006 3.75 13.8673 3.75 15.75",stroke:"#FB4F57",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),OutgoingArrow=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],"data-testid":"outgoing-arrow-icon",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M5.25 12.75L12.75 5.25M12.75 5.25H6M12.75 5.25V12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),IncomingArrow=a=>jsxRuntimeExports.jsx(OutgoingArrow,{css:{rotate:"180deg"},...a}),KeyIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none","data-testid":"key-icon",strokeWidth:"1.2",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M9.24092 8.01389L3 14.25L4.5 15.75M5.25 12L6.75 13.5M15 5.625C15 7.48896 13.489 9 11.625 9C9.76104 9 8.25 7.48896 8.25 5.625C8.25 3.76104 9.76104 2.25 11.625 2.25C13.489 2.25 15 3.76104 15 5.625Z",strokeLinecap:"round",strokeLinejoin:"round"})}),LedgerIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:colors.gray[400],"data-testid":"ledger-icon",strokeWidth:"0",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M11.666 7.29183H12.3952V8.75016H9.47852V4.37516H10.9368L8.74935 1.4585L6.56185 4.37516H8.02018V10.2085H5.10352V8.54818C5.5381 8.29516 5.83268 7.82995 5.83268 7.29183C5.83268 6.90506 5.67904 6.53412 5.40555 6.26063C5.13206 5.98714 4.76112 5.8335 4.37435 5.8335C3.98757 5.8335 3.61664 5.98714 3.34315 6.26063C3.06966 6.53412 2.91602 6.90506 2.91602 7.29183C2.91602 7.82995 3.2106 8.29516 3.64518 8.54818V10.2085C3.64518 11.0128 4.29924 11.6668 5.10352 11.6668H8.02018V13.3271C7.79896 13.454 7.61508 13.6369 7.48707 13.8575C7.35906 14.0781 7.29143 14.3285 7.29102 14.5835C7.29102 14.9703 7.44466 15.3412 7.71815 15.6147C7.99164 15.8882 8.36257 16.0418 8.74935 16.0418C9.13612 16.0418 9.50706 15.8882 9.78055 15.6147C10.054 15.3412 10.2077 14.9703 10.2077 14.5835C10.2077 14.0454 9.9131 13.5802 9.47852 13.3271V10.2085H12.3952C13.1995 10.2085 13.8535 9.55443 13.8535 8.75016V7.29183H14.5827V4.37516H11.666V7.29183Z"})}),LinkIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M9.16586 17.6508C8.9261 17.8747 8.74055 18.0245 8.55093 18.134C7.62273 18.6699 6.47914 18.6699 5.55093 18.134C5.20889 17.9365 4.88009 17.6077 4.22251 16.9501C3.56492 16.2925 3.23612 15.9637 3.03864 15.6217C2.50274 14.6935 2.50274 13.5499 3.03864 12.6217C3.23612 12.2797 3.56492 11.9509 4.2225 11.2933L7.05093 8.46484C7.70852 7.80725 8.03732 7.47846 8.37936 7.28098C9.30756 6.74508 10.4512 6.74508 11.3794 7.28098C11.7214 7.47846 12.0502 7.80725 12.7078 8.46484C13.3654 9.12243 13.6942 9.45123 13.8916 9.79327C14.4275 10.7215 14.4275 11.8651 13.8916 12.7933C13.7822 12.9829 13.6323 13.1684 13.4085 13.4082M10.5929 10.5926C10.369 10.8323 10.2192 11.0179 10.1097 11.2075C9.57381 12.1357 9.57381 13.2793 10.1097 14.2075C10.3072 14.5495 10.636 14.8783 11.2936 15.5359C11.9512 16.1935 12.28 16.5223 12.622 16.7198C13.5502 17.2557 14.6938 17.2557 15.622 16.7198C15.964 16.5223 16.2928 16.1935 16.9504 15.5359L19.7789 12.7075C20.4364 12.0499 20.7652 11.7211 20.9627 11.3791C21.4986 10.4509 21.4986 9.30726 20.9627 8.37906C20.7652 8.03701 20.4364 7.70822 19.7789 7.05063C19.1213 6.39304 18.7925 6.06425 18.4504 5.86677C17.5222 5.33087 16.3786 5.33087 15.4504 5.86677C15.2608 5.97625 15.0753 6.12608 14.8355 6.34992",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),LockIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12 14.5V16.5M7 10.0288C7.47142 10 8.05259 10 8.8 10H15.2C15.9474 10 16.5286 10 17 10.0288M7 10.0288C6.41168 10.0647 5.99429 10.1455 5.63803 10.327C5.07354 10.6146 4.6146 11.0735 4.32698 11.638C4 12.2798 4 13.1198 4 14.8V16.2C4 17.8802 4 18.7202 4.32698 19.362C4.6146 19.9265 5.07354 20.3854 5.63803 20.673C6.27976 21 7.11984 21 8.8 21H15.2C16.8802 21 17.7202 21 18.362 20.673C18.9265 20.3854 19.3854 19.9265 19.673 19.362C20 18.7202 20 17.8802 20 16.2V14.8C20 13.1198 20 12.2798 19.673 11.638C19.3854 11.0735 18.9265 10.6146 18.362 10.327C18.0057 10.1455 17.5883 10.0647 17 10.0288M7 10.0288V8C7 5.23858 9.23858 3 12 3C14.7614 3 17 5.23858 17 8V10.0288",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),MaintenanceIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:"black",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12.182 5.81859C13.9393 7.57595 13.9393 10.4252 12.182 12.1825M5.81802 12.1825C4.06066 10.4252 4.06066 7.57592 5.81802 5.81856M3.6967 14.3039C0.767767 11.3749 0.767767 6.6262 3.6967 3.69727M14.3033 3.6973C17.2322 6.62623 17.2322 11.375 14.3033 14.3039M10.5 9.00057C10.5 9.82899 9.82843 10.5006 9 10.5006C8.17157 10.5006 7.5 9.82899 7.5 9.00057C7.5 8.17214 8.17157 7.50057 9 7.50057C9.82843 7.50057 10.5 8.17214 10.5 9.00057Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),MakiIcon=({fishColor:a,..._})=>jsxRuntimeExports.jsxs(Icon,{width:"38px",height:"38px",fill:"none",viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",..._,children:[jsxRuntimeExports.jsx("path",{d:"M34.9985 26.2751C34.6599 26.8629 34.2436 27.4106 33.7512 27.9032C32.2815 29.3727 30.3277 30.1819 28.2496 30.1819H24.8477V34.9996H26.8032H28.2497C30.0524 34.9996 31.7472 34.2976 33.022 33.0229C34.2967 31.7481 34.9986 30.0533 34.9985 28.2507V26.2751Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M34.9989 20.9441C34.6603 21.5318 34.2439 22.0796 33.7514 22.572C32.2819 24.0416 30.328 24.8509 28.2499 24.8509H18.9983C17.8104 24.8511 16.8477 25.814 16.8477 27.0019C16.8477 28.1898 17.8104 29.1528 18.9983 29.153H28.25C30.0526 29.153 31.7474 28.4511 33.0222 27.1763C34.2965 25.902 34.9986 24.2076 34.9989 22.4054V20.9441ZM18.9988 27.8361C18.5381 27.8361 18.1645 27.4626 18.1645 27.0018C18.1645 26.5412 18.5381 26.1675 18.9988 26.1675C19.4596 26.1675 19.8331 26.5412 19.8331 27.0018C19.8331 27.4626 19.4596 27.8361 18.9988 27.8361Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M35 9.74895C35 6.02751 31.9724 3 28.2509 3H9.74908C6.02761 3 3 6.02751 3 9.74895V28.2511C3 31.9725 6.02761 35 9.74899 35H23.8176V30.1824H18.9995C17.2418 30.1824 15.8171 28.7576 15.8171 27.0001C15.8171 25.2426 17.2418 23.8179 18.9995 23.8179H23.8176V18.9998H9.74899C6.5911 18.9998 4.03113 16.4402 4.03113 13.2824V9.74905C4.03113 6.59127 6.5911 4.03131 9.74899 4.03131H28.2508C31.4087 4.03131 33.9686 6.59127 33.9686 9.74905V13.2824C33.9686 16.4403 31.4089 19.0001 28.251 19.0001L24.8491 18.9998V23.8179H28.2511C30.0539 23.8179 31.7487 23.1159 33.0233 21.8411C34.2977 20.5668 34.9997 18.8725 35 17.0703V9.74895Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M28.251 4.03174C31.4088 4.03174 33.9687 6.59167 33.9687 9.74952V13.2828C33.9687 16.4406 31.4089 19.0005 28.2511 19.0005L9.74908 19.0003C6.59124 19.0003 4.03125 16.4406 4.03125 13.2829V9.74954C4.03125 6.59167 6.5912 4.03174 9.74908 4.03174H28.251Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M28.2511 6.73267C29.611 6.73267 30.7641 7.6364 31.1394 8.87525C31.1926 9.05118 31.0527 9.22558 30.869 9.21814C28.2867 9.11348 25.877 8.32896 23.8154 7.038C23.6751 6.95014 23.739 6.73267 23.9045 6.73267H28.2511Z",fill:a}),jsxRuntimeExports.jsx("path",{d:"M21.9973 7.02488C24.4283 8.9081 27.4326 10.0842 30.7 10.2428C31.0172 10.2581 31.2679 10.5166 31.2679 10.8342V12.8702C31.2674 12.9124 31.2661 13.0446 31.2638 13.1857C31.2603 13.4148 31.069 13.5949 30.8401 13.5876C25.3913 13.4117 20.5215 10.9067 17.1937 7.03888C17.0905 6.91878 17.175 6.73267 17.3334 6.73267H21.1443C21.4533 6.73267 21.753 6.83569 21.9973 7.02488Z",fill:a}),jsxRuntimeExports.jsx("path",{d:"M15.9653 7.17305C19.4649 11.5395 24.7681 14.4013 30.735 14.6156C30.8376 14.6193 30.9004 14.7309 30.8481 14.8191C30.3219 15.7056 29.3544 16.3012 28.2505 16.3012H23.1255C22.9317 16.3012 22.7392 16.2646 22.5603 16.1899C18.0848 14.3242 14.3146 11.0926 11.7745 7.01866C11.6968 6.89417 11.7878 6.73267 11.9345 6.73267H15.0503C15.4065 6.73267 15.7426 6.89513 15.9653 7.17305Z",fill:a}),jsxRuntimeExports.jsx("path",{d:"M9.75058 6.73267H10.1145C10.294 6.73267 10.4589 6.82889 10.5496 6.98379C12.776 10.7844 16.0081 13.9276 19.8791 16.0439C20.0039 16.1122 19.9556 16.3012 19.8134 16.3012H15.1194C14.5651 16.3012 14.0261 16.1087 13.6043 15.7491C11.1433 13.6507 9.05479 11.1267 7.45371 8.29236C7.34983 8.10846 7.3762 7.87733 7.51835 7.72112C8.07107 7.11383 8.86658 6.73267 9.75058 6.73267Z",fill:a}),jsxRuntimeExports.jsx("path",{d:"M12.3071 15.9829C12.4313 16.0951 12.3514 16.3013 12.184 16.3013H9.71437C8.06547 16.2829 6.73047 14.9363 6.73047 13.2836V9.7504L6.73065 9.54576C6.73077 9.42446 6.89048 9.37962 6.95305 9.48354C8.41152 11.9061 10.2194 14.096 12.3071 15.9829Z",fill:a})]}),NoticeIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12 8H12.01M12 11V16M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),OutlineExclamationCircleIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"16px",height:"16px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M8 5V8.75M8 11H8.0075M14.75 8C14.75 11.7279 11.7279 14.75 8 14.75C4.27208 14.75 1.25 11.7279 1.25 8C1.25 4.27208 4.27208 1.25 8 1.25C11.7279 1.25 14.75 4.27208 14.75 8Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),PenIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M11.3348 4.66483L13.2208 6.55082M3 15L3.03164 14.7785C3.1436 13.9948 3.19958 13.6029 3.32692 13.2371C3.43992 12.9124 3.59428 12.6037 3.78619 12.3185C4.00247 11.9971 4.28237 11.7172 4.84218 11.1574L12.609 3.3906C13.1298 2.8698 13.9742 2.8698 14.495 3.3906C15.0158 3.9114 15.0158 4.75578 14.495 5.27658L6.58565 13.1859C6.07779 13.6938 5.82386 13.9477 5.53462 14.1497C5.27789 14.3289 5.001 14.4774 4.70965 14.5921C4.3814 14.7213 4.02937 14.7923 3.32535 14.9344L3 15Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),PlusIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[300],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4 12H20M12 4V20",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),RefreshClockIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18",height:"18",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3 9C3 12.3137 5.68629 15 9 15C12.3137 15 15 12.3137 15 9C15 5.68629 12.3137 3 9 3C7.20796 3 5.59942 3.78563 4.5 5.03126C4.43696 5.10268 4.3756 5.17562 4.31597 5.25M9 6V9L10.875 10.875M4.31543 3.00293V5.25293H6.56543",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),ReloadIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"22px",height:"22px",strokeWidth:"0",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M16.1791 5.82018C15.5007 5.13713 14.6938 4.59511 13.8049 4.22539C12.916 3.85568 11.9627 3.66556 10.9999 3.66602C6.94828 3.66602 3.67578 6.94768 3.67578 10.9993C3.67578 15.051 6.94828 18.3327 10.9999 18.3327C14.4191 18.3327 17.2699 15.9952 18.0858 12.8327H16.1791C15.8015 13.9047 15.1005 14.8332 14.1728 15.4899C13.2452 16.1467 12.1366 16.4994 10.9999 16.4993C7.96578 16.4993 5.49995 14.0335 5.49995 10.9993C5.49995 7.96518 7.96578 5.49935 10.9999 5.49935C12.5216 5.49935 13.8783 6.13185 14.8683 7.13102L11.9166 10.0827H18.3333V3.66602L16.1791 5.82018Z"})}),RotateIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],"data-testid":"rotate-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M12.5 18.5C17.1944 18.5 21 14.6944 21 10C21 5.30558 17.1944 1.5 12.5 1.5C7.80558 1.5 4 5.30558 4 10C4 11.5433 4.41128 12.9905 5.13022 14.238M1.5 13L5.13022 14.238M6.82531 10.3832L5.47107 14.3542L5.13022 14.238",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),SlashIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M16 3L8 21",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),SlidersIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"32px",height:"32px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M16 7.33333C16 9.17428 14.5076 10.6667 12.6667 10.6667C10.8257 10.6667 9.33333 9.17428 9.33333 7.33333M16 7.33333C16 5.49238 14.5076 4 12.6667 4C10.8257 4 9.33333 5.49238 9.33333 7.33333M16 7.33333H28M9.33333 7.33333H4M25.3333 16C25.3333 17.8409 23.8409 19.3333 22 19.3333C20.1591 19.3333 18.6667 17.8409 18.6667 16M25.3333 16C25.3333 14.1591 23.8409 12.6667 22 12.6667C20.1591 12.6667 18.6667 14.1591 18.6667 16M25.3333 16H28M18.6667 16H4M13.3333 24.6667C13.3333 26.5076 11.8409 28 10 28C8.15905 28 6.66667 26.5076 6.66667 24.6667M13.3333 24.6667C13.3333 22.8257 11.8409 21.3333 10 21.3333C8.15905 21.3333 6.66667 22.8257 6.66667 24.6667M13.3333 24.6667H28M6.66667 24.6667H4",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),SocialIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"28px",height:"28px",fill:"none",stroke:"transparent","data-testid":"social-icon",viewBox:"0 0 28 28",...a,children:jsxRuntimeExports.jsx("g",{id:"Group 40429",children:jsxRuntimeExports.jsx("g",{id:"Group 40428",children:jsxRuntimeExports.jsxs("g",{id:"Group 39769",children:[jsxRuntimeExports.jsx("path",{d:"M27.4398 14.3177C27.4398 13.325 27.3507 12.3705 27.1852 11.4541H14V16.8695H21.5344C21.2099 18.6194 20.2235 20.1021 18.7408 21.0949V24.6075H23.2653C25.9125 22.1703 27.4398 18.5813 27.4398 14.3177Z",fill:"#4285F4",clipRule:"evenodd",fillRule:"evenodd",id:"Shape"}),jsxRuntimeExports.jsx("path",{d:"M14.0009 28C17.7809 28 20.9499 26.7464 23.2663 24.6082L18.7418 21.0955C17.4882 21.9355 15.8846 22.4319 14.0009 22.4319C10.3546 22.4319 7.26832 19.9692 6.16743 16.6602H1.49023V20.2874C3.79383 24.8628 8.5283 28 14.0009 28Z",fill:"#34A853",clipRule:"evenodd",fillRule:"evenodd",id:"Shape_2"}),jsxRuntimeExports.jsx("path",{d:"M6.16627 16.66C5.88627 15.82 5.72718 14.9228 5.72718 14.0001C5.72718 13.0774 5.88627 12.1801 6.16627 11.3401V7.71289H1.48907C0.5409 9.60286 0 11.741 0 14.0001C0 16.2591 0.5409 18.3973 1.48907 20.2872L6.16627 16.66Z",fill:"#FBBC05",clipRule:"evenodd",fillRule:"evenodd",id:"Shape_3"}),jsxRuntimeExports.jsx("path",{d:"M14.0009 5.56809C16.0564 5.56809 17.9018 6.27445 19.3527 7.6617L23.3681 3.64631C20.9436 1.38725 17.7745 0 14.0009 0C8.5283 0 3.79383 3.13722 1.49023 7.7126L6.16743 11.3398C7.26832 8.03078 10.3546 5.56809 14.0009 5.56809Z",fill:"#EA4335",clipRule:"evenodd",fillRule:"evenodd",id:"Shape_4"})]})})})}),TezIcon=a=>jsxRuntimeExports.jsxs(Icon,{width:"30px",height:"30px",fill:"none","data-testid":"tez-icon",viewBox:"0 0 30 30",...a,children:[jsxRuntimeExports.jsx("rect",{width:"30",height:"30",fill:"white",rx:"4"}),jsxRuntimeExports.jsx("rect",{width:"30",height:"30",fill:"url(#pattern0)",rx:"4"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsx("pattern",{width:"1",height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",children:jsxRuntimeExports.jsx("use",{transform:"translate(0.1753 0.101557) scale(0.00532296)",xlinkHref:"#image0_2912_38337"})}),jsxRuntimeExports.jsx("image",{width:"122",height:"150",id:"image0_2912_38337",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHoAAACWCAYAAAAR35wdAAAMP2lDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEBooUsJvQkiNYCUEFrovdkISYBQYgwEFXtZVHDtogI2dFVEwQqIBUUUC4ti74sFFWVdLNiVNymg677yvfm+ufPff87858y5M/feAUDtBEckykPVAcgXForjQgLoKalpdNJTQAS6gAyUgTOHWyBixsREAFiG2r+Xd9cBIm2vOEi1/tn/X4sGj1/ABQCJgTiDV8DNh/ggAHgVVyQuBIAo5c2nFIqkGFagJYYBQrxIirPkuEqKM+R4r8wmIY4FcRsASiocjjgLANVLkKcXcbOghmo/xE5CnkAIgBodYt/8/Ek8iNMhtoE2Ioil+oyMH3Sy/qaZMazJ4WQNY/lcZEUpUFAgyuNM+z/T8b9Lfp5kyIcVrCrZ4tA46Zxh3m7mTgqXYhWI+4QZUdEQa0L8QcCT2UOMUrIloYlye9SQW8CCOQM6EDvxOIHhEBtCHCzMi4pQ8BmZgmA2xHCFoFMFhewEiPUgXsQvCIpX2GwWT4pT+EIbMsUspoI/yxHL/Ep93ZfkJjIV+q+z+WyFPqZanJ2QDDEFYosiQVIUxKoQOxbkxocrbMYUZ7OihmzEkjhp/BYQx/GFIQFyfawoUxwcp7AvzS8Ymi+2OVvAjlLg/YXZCaHy/GBtXI4sfjgX7BJfyEwc0uEXpEQMzYXHDwySzx17xhcmxit0PogKA+LkY3GKKC9GYY+b8fNCpLwZxK4FRfGKsXhSIVyQcn08U1QYkyCPEy/O4YTFyOPBl4MIwAKBgA4ksGaASSAHCDr7GvvgnbwnGHCAGGQBPnBQMEMjkmU9QniNB8XgT4j4oGB4XICslw+KIP91mJVfHUCmrLdINiIXPIE4H4SDPHgvkY0SDntLAo8hI/iHdw6sXBhvHqzS/n/PD7HfGSZkIhSMZMgjXW3IkhhEDCSGEoOJtrgB7ot74xHw6g+rM87APYfm8d2e8ITQRXhIuEboJtyaKJgn/inKSNAN9YMVucj4MRe4FdR0wwNwH6gOlXEd3AA44K7QDxP3g57dIMtSxC3NCv0n7b/N4IenobAjO5FRsi7Zn2zz80hVO1W3YRVprn/MjzzWjOF8s4Z7fvbP+iH7PNiG/2yJLcIOYO3YSewcdhRrBHSsBWvCOrBjUjy8uh7LVteQtzhZPLlQR/APf0NPVprJAqdap16nL/K+Qv5U6TsasCaJpokFWdmFdCb8IvDpbCHXcSTd2cnZBQDp90X++noTK/tuIDod37n5fwDg0zI4OHjkOxfWAsA+D7j9D3/nbBjw06EMwNnDXIm4SM7h0gsBviXU4E7TB8bAHNjA+TgDd+AN/EEQCAPRIAGkggkw+my4zsVgCpgB5oISUAaWgzWgAmwCW8FOsAfsB43gKDgJzoAL4BK4Bu7A1dMDXoB+8A58RhCEhFARGqKPmCCWiD3ijDAQXyQIiUDikFQkHclChIgEmYHMR8qQlUgFsgWpQfYhh5GTyDmkC7mFPEB6kdfIJxRDVVAt1Ai1QkehDJSJhqMJ6Hg0C52MFqML0KXoOrQa3Y02oCfRC+g1tBt9gQ5gAFPGdDBTzAFjYCwsGkvDMjExNgsrxcqxaqwOa4bP+QrWjfVhH3EiTsPpuANcwaF4Is7FJ+Oz8CV4Bb4Tb8Db8Cv4A7wf/0agEgwJ9gQvApuQQsgiTCGUEMoJ2wmHCKfhXuohvCMSiTpEa6IH3IupxBzidOIS4gZiPfEEsYv4iDhAIpH0SfYkH1I0iUMqJJWQ1pN2k1pIl0k9pA9KykomSs5KwUppSkKleUrlSruUjitdVnqq9JmsTrYke5GjyTzyNPIy8jZyM/kiuYf8maJBsab4UBIoOZS5lHWUOsppyl3KG2VlZTNlT+VYZYHyHOV1ynuVzyo/UP6ooqlip8JSGaciUVmqskPlhMotlTdUKtWK6k9NoxZSl1JrqKeo96kfVGmqjqpsVZ7qbNVK1QbVy6ov1chqlmpMtQlqxWrlagfULqr1qZPVrdRZ6hz1WeqV6ofVb6gPaNA0RmtEa+RrLNHYpXFO45kmSdNKM0iTp7lAc6vmKc1HNIxmTmPRuLT5tG2007QeLaKWtRZbK0erTGuPVqdWv7amtqt2kvZU7UrtY9rdOpiOlQ5bJ09nmc5+nes6n3SNdJm6fN3FunW6l3Xf643Q89fj65Xq1etd0/ukT9cP0s/VX6HfqH/PADewM4g1mGKw0eC0Qd8IrRHeI7gjSkfsH3HbEDW0M4wznG641bDDcMDI2CjESGS03uiUUZ+xjrG/cY7xauPjxr0mNBNfE4HJapMWk+d0bTqTnkdfR2+j95samoaaSky3mHaafjazNks0m2dWb3bPnGLOMM80X23eat5vYWIRaTHDotbitiXZkmGZbbnWst3yvZW1VbLVQqtGq2fWetZs62LrWuu7NlQbP5vJNtU2V22JtgzbXNsNtpfsUDs3u2y7SruL9qi9u73AfoN910jCSM+RwpHVI284qDgwHYocah0eOOo4RjjOc2x0fDnKYlTaqBWj2kd9c3JzynPa5nRntObosNHzRjePfu1s58x1rnS+6kJ1CXaZ7dLk8srV3pXvutH1phvNLdJtoVur21d3D3exe517r4eFR7pHlccNhhYjhrGEcdaT4BngOdvzqOdHL3evQq/9Xn95O3jneu/yfjbGegx/zLYxj3zMfDg+W3y6fem+6b6bfbv9TP04ftV+D/3N/Xn+2/2fMm2ZOczdzJcBTgHigEMB71lerJmsE4FYYEhgaWBnkGZQYlBF0P1gs+Cs4Nrg/hC3kOkhJ0IJoeGhK0JvsI3YXHYNuz/MI2xmWFu4Snh8eEX4wwi7CHFEcyQaGRa5KvJulGWUMKoxGkSzo1dF34uxjpkccySWGBsTWxn7JG503Iy49nha/MT4XfHvEgISliXcSbRJlCS2JqkljUuqSXqfHJi8Mrk7ZVTKzJQLqQapgtSmNFJaUtr2tIGxQWPXjO0Z5zauZNz18dbjp44/N8FgQt6EYxPVJnImHkgnpCen70r/wonmVHMGMtgZVRn9XBZ3LfcFz5+3mtfL9+Gv5D/N9MlcmfksyydrVVZvtl92eXafgCWoELzKCc3ZlPM+Nzp3R+5gXnJefb5Sfnr+YaGmMFfYNsl40tRJXSJ7UYmoe7LX5DWT+8Xh4u0FSMH4gqZCLfgj3yGxkfwieVDkW1RZ9GFK0pQDUzWmCqd2TLObtnja0+Lg4t+m49O501tnmM6YO+PBTObMLbOQWRmzWmebz14wu2dOyJydcylzc+f+Ps9p3sp5b+cnz29eYLRgzoJHv4T8UluiWiIuubHQe+GmRfgiwaLOxS6L1y/+VsorPV/mVFZe9mUJd8n5X0f/uu7XwaWZSzuXuS/buJy4XLj8+gq/FTtXaqwsXvloVeSqhtX01aWr366ZuOZcuWv5prWUtZK13esi1jWtt1i/fP2XiuyKa5UBlfVVhlWLq95v4G24vNF/Y90mo01lmz5tFmy+uSVkS0O1VXX5VuLWoq1PtiVta/+N8VvNdoPtZdu/7hDu6N4Zt7OtxqOmZpfhrmW1aK2ktnf3uN2X9gTuaapzqNtSr1Nfthfslex9vi993/X94ftbDzAO1B20PFh1iHaotAFpmNbQ35jd2N2U2tR1OOxwa7N386Ejjkd2HDU9WnlM+9iy45TjC44PthS3DJwQneg7mXXyUevE1junUk5dbYtt6zwdfvrsmeAzp9qZ7S1nfc4ePed17vB5xvnGC+4XGjrcOg797vb7oU73zoaLHhebLnleau4a03X8st/lk1cCr5y5yr564VrUta7riddv3hh3o/sm7+azW3m3Xt0uuv35zpy7hLul99Tvld83vF/9h+0f9d3u3cceBD7oeBj/8M4j7qMXjwsef+lZ8IT6pPypydOaZ87PjvYG9156PvZ5zwvRi899JX9q/Fn10ublwb/8/+roT+nveSV+Nfh6yRv9Nzveur5tHYgZuP8u/93n96Uf9D/s/Mj42P4p+dPTz1O+kL6s+2r7tflb+Le7g/mDgyKOmCP7FcBgRTMzAXi9AwBqKgA0eD6jjJWf/2QFkZ9ZZQj8Jyw/I8qKOwB18P89tg/+3dwAYO82ePyC+mrjAIihApDgCVAXl+E6dFaTnSulhQjPAZujvmbkZ4B/U+Rnzh/i/rkFUlVX8HP7L34RfGukfYUwAAAAOGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAACoAIABAAAAAEAAAB6oAMABAAAAAEAAACWAAAAAGjynq0AABD3SURBVHgB7V0JcFXVGf7Pey8QEnCp2ta97rYuHRW0VqkLilapSm1MAgVCwLQ4WrRDq6gVHWt1Ojpt1cEOkhBAshgqFRe6WIvLWHEsMxW07tS1xVYQRba8906/88gN9yU3efcs797zknOHcO899/z/+f//O//Zz3lE7nIWcBZwFnAWcBZwFnAWcBaIzQIstpRDJlzVwHcv66RvZBmdzBiNIk5HtzaxI0OSu2hdFkjZZIm6Ol6+JUknJQigchrFBbgZOowjwJcjP7VJ5lKRJTagq6p4sqySjssmaBQ89WQOYLcRHZskwj9cQNYHbqnY01o5IwO6aho/PJVF0StA3VkEn4j7MA9MgO2uIlqgaEDX1PHRLEnnoU4dCflPxd9uhCJYXDlMFYFF5uA7ubj/ZSxQNKBZgm6FIGeYLn9RdytmERmzDLy4XT428BRzGuVbwAGdb48B+1Y0oNHXPbO1kbHUDhpOWZqEivV1E1Z0dbSaFSOt72qn8Vsg5k1qou6kQobZ1NbI9tDhMRhpi+bRQcaEh89Bm/mPQd9cWHEtECnQQhW0xu8urkqOe5AFIgd66w5aFSRI2DDXvQprqfx4kQO9bBH7GPXs5nwxwr+5xlh4W/ljRg50V+I7/ELIPDuPlrHWrrhxAb1LAvcUiQUc0JGYOf5EHNDxYxCJBA7oSMwcfyIO6PgxiEQCB3QkZo4/EQd0/BhEIoEDOhIzx5+IAzp+DCKRwAEdiZnjT8QBHT8GkUgQeuHBRfV8RCXROizN2ysSyfpLhNNT/X0eiN/EZA42M8xobWavqugXehVoRRYAJy0AWWjJsLp0kF05j0xSLdSeo6J66KI7k3LLbFUMbJIG07tlqvxCA62agKOzwwKhgU6m3Q6J2CHjtFVVhtBAu6Jb1cSG6Dg9uamSfqnKLTTQqgk4OgMWAMifVNIFK+5h21W5OaBVLRcVHadndUEWoobuXnWmaWMyQWIBvvaFLbI/ApM9VRlhL7UROVTTl6JjNARdo9lSNF5kjBdsTul5sscq1z3zXqK610zjbyLhw1TTa20UG3CxTNDyq6GBl32aoeXQ9XxpUeHJ6c9obEcHU26A+dN0RbffGgafxYkOtoAs1HJAGwTXYyVATo6gh2zwZE8mB7RnCUP3bpAZXSTN0nBx7U/fAe23hubzzTfzRM6TLQNZqOWA1gTXIxcgv/outaNHYZUne/I5oD1LaN056wL5e9Jsilhc+2UJ3Y/2E7lnvwU4q62nxZjbkwYZ4wGrMga7UH6pej47j+5pEan3bpAnSpEhsgAZR1+OMdVPLpS+A7qQhfr53uXJyiAvXsw+74e90U+u6FY0J0b3GkFaEiALFZ1HKwAtQMZgSL0sqVdcR+nJnowOaM8SIe+lCLJQzQEdEmARDSDPLTVP9tRzQHuWKHDvAnlGgWi9PsdZXPuFcY0xvzX6eK6t57/Cp5IFWajlPLoPcL3gHMiMrvbew95t8WRPXge0Z4mAuwbIq8VgSByt6wA1ckGu6O7DMgD5dgxrqnjy6uR2OmvxkugGQ/pQIS/YeXSeOXa+1NTzmwHydQGf+g1CcZ0DeckSZt0PvDiP7gEdWtfXogslvb/JZpCFis6jfUB3gXyHLyjUo+0gCyUc0F1QVk/jM+HJAxJkB7QPZOT4X3e9hr6Vgid7ygz6OhoNrx/Ckwc0yALsQV1050BmdJ+X68PeS8mTPZ0GLdCqIGPz8BrRT7axC+WBGnQflEV37VQ+Ff1kaU8WILNtdMaSFvv6yUHg+sMGnUcLkHHwi1gdInd1gdzSwjbKEdoRu0Q9Wm2DHfrJ9TC7WB0ifzG6oVRBFsoOGo/Gb25NAcDynrwrSyxHRlkNPpfsCiqdpxL1aDkDY4LiUlA0y1H1jo2McgJCl4Hfx7g3wU3uap3P1veOaV/IYPHoC42aXhyqx+gn+CnGf4mpzPGT+BeN8i8Cs0EBNBpfxSm5GJWLqczyIbQe3bV54sfQi4CREZaDAmg03ZQPYgtrZWyuuxy56Q0AvsBGDx8UQOMMjKFhAdONB8Drysvojep6/mNdXibpSxRoFMYyF6NhMtG14zLaLcHoLtTfL02Yzk/S5meAQYkCLdePRuzIPDoPE0bHYVz8RXTL5k6cyHfL+xbxS4kCLWcl+P8QOQqzsVH8zMgMpdcw511llnN4boMCaIxRL4RnPYa/D8ObxmxM1N1fhrEfhHevqJnKDzTLvTA3ubquML9QMaCs5jljMJviNX4y32tYkkbCy8Xgx4XoHp2uyEqdjNPHyHQXti1gq9SZyFEqG0wumfzY+kCLoVu5ejpfgl1vtQ18b56mixEyHqCfA4NEUp8DaPGLuzVtTWzZLmmK9xQL0GiNvg6jHqGqVmujukf3l2bu5yQ4jqhI5E66P7e/uMa+ZenG1gXsNmP8+mAUF9AvAejj+pCpYHCxgPYnLAY9hg7BRndOs5Ct9vN/M/0M774fnt1gmq+fXyxAY/ToeRjvFL8gMs9RAO2XByXQVXi/EZmzaGPaAPvRz1NU/cg8tsWftqnnuFrdWjM+OJ0v0gGQ1iZ2D07ZPQRGvx6AGDmEtSeAyPjjhqfpie808Iqe30y8xwI0lHpfR/hERXGL0iDZhKehJLk9lcKpxJwWBcXRDmN0amWG/lBXx8u1efVgEAvQPEuv9ZBD6jWRUq/fpRIKiPzAPPZvePgU6HAaAH8lIIpWEOrS0duS9KgWkwDiWICGR68OkCV0EIrPE0NHLlJE9IGfA+DHQJZbTScBsMegXbDUJN9YgEZ9pwU0DDDGpBF0eKG1fBN+Ye4EzJCt0+HTi5bRpRgyvbJXuGJALK1uISvWXj2G2wWKchOMe2RLM3tDld40HRYdfCHF6WG0zI2OtGWzdFL7AqbrGPEtDkSR16Fj7GxS/kwRnfQK0XY0sg0oykcj3gOF4sp8ZwlaKgZyZGiC4sZSdAtB0Fn8XZBAYcNQFF1TW8ePDhs/qnhomU9CWvNNpQc9D6lk+u2A2IBe3sQ+Q712r45BeFJht4UvQawC+brv1dgjwL4cJdZvjTEkmllVx5VHEoUcsQEtEkfr++firnoht5+JCZInZNdooUV7Kf7eQvrVqmkXokMjbQbiaFVP/jSSmpk6VqDFmmg0Nq7wKyT7DLDHYI3WK7n9VP0Qf7+B74tMMQvDr2vQYFqKv0NBm+2HRPsTPPsyePZz2ozAALKehlZ4jSov0Md/5fqM6E5oS8JJVAdroNSbuL8DfllYaAgmNEfhfk5P/gDhF/C8G3qGm3wXrfGk2LdlYmIEfNDgO15Fvlg92hMY/erJMPo/vHflO6MRMOg3Aepk3H+GvzkAfXYQyCINfEd+KO4lWuPIaKKBpn9hxg8l19kqjKwAWowjb++ksTB7pP1iZC6tMfewBsd885PQ7a6w8fuLh5Uxs/r73tc3K4AWwi1bzD5Kp1G8cr1x8L4UDQrHb20aH1MOSkeEocidheLjzb6+hw1HKfRtlR0h1gAtFO1YxN5NdZJYB22stdqPAeuWzGeReHS3DNjN0f2s8ZAkkt7RaRXQQndxfqZoraJeHYuida2GPQJJ4VXPiOFTpLEwMEIRA9vms5Uosf6mmwTq/HGyPNBWsftCi/x01EtToVw1wK/UkPb3oF0IgMU9tqt6Kr84kSBtGdJJ2qNjHtsUVhHrgfYUEZPx25P4eV6emzQYCc88GPXVV7zvve6cPkGcp5E52rF4fnnHXLa5V5yYAnRXwQqxMR9ehanS0FOZqZh0lU62uRnHxFDOE/K8QSzXTe+gfZMp7Fnuungnvde+kL3lvdt2R+l0HzLgnVpyJXJz8gMP6L6M0jqP/Q/fxF/JXChGl6G00QIaPL4qo7B1jTEZ4Us1bksTextAr9ORH/RHydA7oGWsZTAuPPJFHXbOo3WsFyEtPFJrgaQQtWoyPyisyM6jw1rKdDxOH+iyxMheaPxCR9QVytH3sAAj7R8gZanwmwkc0D3sH9Uriu5O3bSGpin0gIkDWtfaivSYo9Y6hQHDw1u7xhZCSVAyAyaeNlghsh9P0EHZDH2KQ6U+kBkG9HjYcMfSlgq0nNUvJlfHlwTQGO++DEVdFYY8xcL9PTGyRBgvJsrkfhj0XbyvzGL5MNY/RzbtqI5QN+WXup8UHpBJ1smQWQ107XR+PBYDLcNwoVjfFXgh/CB8n4zjnibD21djE9w4sT8qMLJdgbp7rqX2fVlbR+dmrbL0vAA5LD7w+BMzGXoB/cv9w9LEFQ8Z9HCdtFFHr5GhtxLo3EAAo+UATmUf9AHw6kUyRoglLqNjdNJFrfWsDL2VQAOoNiixp4wieXEZnS3q9bwwi14mTucHQBz1OhqnGnU0MamRNeuArp7Ov4vi+lRdXNBeu1aXR7HosZb9FC3ejJ6UpbcOaJalKbJKBMUX9fWECVy9VAhiaigMmXCsDivQPyJLbx/QBvc+Z4dhjbed13gdsZLbsD1X8rKqe5U7hEZvXVie+lhuE3p2J4+wiC+5BfiM9lFNAt78kMpvblnl0cnhtLeqAQLp1FrtgayMBWou+UW3rFlFFqs8OsGpHDnW2AWjrDPGzACjqql8HzQ0lTfKoe/8AfaKSdfPQnSrPDoxhIyu1MSY+KsG8DHGAvPH12gxY3STKj0yvV0XzjYx4tTg8hxy/2m2aDehnh+K9enKK1Ohz1roo7wZ3iqPFqBAIa21VB6wmB260Xu24Y7cO1dHDtD/VIfeOqBRxDyto1COltPsB5vYX7X5GGKAUbqrUDefp8Hu8fYmtkKD3q46WiiC4u1xHYVAext2Lt6hycMYeXUdF5vw71ZlCE/eku7UP4HJOo9ua2R/QfH9XwXDvIzRsJHYW2VNkY2jKI5NJOUHN/J053S12GWaF6bwYh3QQgcAdq+CLk+0zGd/V6ArCgkaleejGhI7J/dVTQAZfikaYPer0vvprAQ6jWOpUGRt8gsa4nlmTR0fHSJe0aMAZNENWgGghysnxukpgGzsV3WsBFqc+4Fdk1fLGoklqR0NH+2ZL9l0vfiiC4WdksKLb/HClO5YVJDYThcp0fZBhExn74WlQQ+jGFdReM7mJN1ZrNPse1pMrGjBHPo1KIWugLwqiyW6WaK4fi+TpZM7mtl/ugMNPFgN9KRJvDJdRi+g1fo1aV05fQ7Dt2HN2cK2ZvaMNH0Igsum8W/hmIkrEdVMEQtPTmdprGmQhSpWAy0EFMt7IeRKSHqEeFe6doIuNsU/Bfq1qK/WtjSyd1R44cSCcViBejGqFvHzSd17slV4+WngyY2ZcrSwi7Rh33qghTHEZECS0Z9RLJo+u/N9sF8PI4ti8kMAtx4AYjnWzgvG2R2lwgG4749vByJULAEye3H6CKN4kzAg8iezjPO5lQTQQmTxI544ouI3ALsuX4XSfUMGezTDaEqu8VlkNUoGaM8OWOt9LrxuId6V+6cer7juKCVexwjg7Pb57KGoZCg5oIVhRCOts4xmQvjrUKSOiMpYuukA4Ocx534fTjxYpMtLlr4kgfaU7Pp5g+vhHT+AIuqDEx7D4tzXA+AW/DW1N7K1xUmiMNeSBtpTT6w1Sw3H6cCM6vF3lhce1x2gbsF+sHbxMwkYltWdpDGixoAA2m+JCdP4wdhwNxaAnwBjn4678mS9n2+hZzSsVsGYTwPclbaA65d5wAHtV048i58ArNyB80UTdCReD0Wr/QiAcggUPwqZoN/6HfG2gmYD/jaCbgM8dSMyj3jfANqP8P4yqo230aj6J8KsvgY80IWsf0kd36M8QRXo5lSk8Ic+bQV60jtM/ARRobTdd2cBZwFnAWcBZwFnAWeB/wO9yrSXP8OnPQAAAABJRU5ErkJggg=="})]})]}),ThreeDotsIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[300],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M13.5 9H13.5075M9 9H9.0075M4.5 9H4.5075M9.75 9C9.75 9.41421 9.41421 9.75 9 9.75C8.58579 9.75 8.25 9.41421 8.25 9C8.25 8.58579 8.58579 8.25 9 8.25C9.41421 8.25 9.75 8.58579 9.75 9ZM14.25 9C14.25 9.41421 13.9142 9.75 13.5 9.75C13.0858 9.75 12.75 9.41421 12.75 9C12.75 8.58579 13.0858 8.25 13.5 8.25C13.9142 8.25 14.25 8.58579 14.25 9ZM5.25 9C5.25 9.41421 4.91421 9.75 4.5 9.75C4.08579 9.75 3.75 9.41421 3.75 9C3.75 8.58579 4.08579 8.25 4.5 8.25C4.91421 8.25 5.25 8.58579 5.25 9Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}),TokenIcon=({contract:a,..._})=>{const $=`https://services.tzkt.io/v1/avatars/${a}`;return jsxRuntimeExports.jsx(Image$1,{fallbackSrc:"./static/media/coin-front.svg",src:$,..._})},TrashIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3 4.5H15M12 4.5L11.797 3.89105C11.6003 3.30094 11.502 3.00588 11.3195 2.78774C11.1584 2.5951 10.9516 2.44599 10.7179 2.35408C10.4532 2.25 10.1422 2.25 9.52018 2.25H8.47982C7.85779 2.25 7.54677 2.25 7.28213 2.35408C7.04844 2.44599 6.84156 2.5951 6.68047 2.78774C6.49804 3.00588 6.39969 3.30094 6.20298 3.89105L6 4.5M13.5 4.5V12.15C13.5 13.4101 13.5 14.0402 13.2548 14.5215C13.039 14.9448 12.6948 15.289 12.2715 15.5048C11.7902 15.75 11.1601 15.75 9.9 15.75H8.1C6.83988 15.75 6.20982 15.75 5.72852 15.5048C5.30516 15.289 4.96095 14.9448 4.74524 14.5215C4.5 14.0402 4.5 13.4101 4.5 12.15V4.5M10.5 7.5V12.75M7.5 7.5V12.75",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),UnknownContactIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none","data-testid":"unknown-contact-icon",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M3.16602 15.5625C3.16602 12.7435 5.45123 10.4583 8.27018 10.4583C8.51775 10.4583 8.7612 10.476 8.99935 10.51M13.3722 13.375C14.1014 12.6458 14.8305 12.3575 14.8305 11.5521C14.8305 10.7467 14.1776 10.0938 13.3722 10.0938C12.6927 10.0938 12.1217 10.5585 11.9598 11.1875M13.3722 15.5625H13.3795M11.1868 5.35417C11.1868 6.965 9.88101 8.27083 8.27018 8.27083C6.65935 8.27083 5.35352 6.965 5.35352 5.35417C5.35352 3.74334 6.65935 2.4375 8.27018 2.4375C9.88101 2.4375 11.1868 3.74334 11.1868 5.35417Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),USBIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M20.5 11L18.7396 7.60473C18.253 6.65855 18.0097 6.18545 17.6514 5.84012C17.3346 5.5347 16.9544 5.30272 16.5379 5.16065C16.067 5 15.535 5 14.471 5H9.52901C8.46503 5 7.93304 5 7.46209 5.16065C7.04558 5.30272 6.66542 5.5347 6.34859 5.84012C5.99034 6.18545 5.74703 6.65855 5.26042 7.60473L3.5 11M20.5 11C20.6981 11.3853 20.7658 11.5446 20.8357 11.747C20.8977 11.9267 20.9426 12.1119 20.9696 12.3002C21 12.5121 21 12.7287 21 13.162V14.2C21 15.8802 21 16.7202 20.673 17.362C20.3854 17.9265 19.9265 18.3854 19.362 18.673C18.7202 19 17.8802 19 16.2 19H7.8C6.11984 19 5.27976 19 4.63803 18.673C4.07354 18.3854 3.6146 17.9265 3.32698 17.362C3 16.7202 3 15.8802 3 14.2V13.162C3 12.7287 3 12.5121 3.03041 12.3002C3.05741 12.1119 3.10225 11.9267 3.16432 11.747C3.23421 11.5446 3.30186 11.3853 3.5 11M20.5 11H3.5M15 15H17",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),VerifiedIcon=()=>jsxRuntimeExports.jsxs(Flex,{position:"relative",alignItems:"center",justifyContent:"center","data-testid":"verified-icon",children:[jsxRuntimeExports.jsx(StarIcon,{}),jsxRuntimeExports.jsx(Flex,{position:"absolute",alignItems:"center",justifyContent:"center",children:jsxRuntimeExports.jsx(CheckIcon$1,{})})]}),StarIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"14px",height:"14px",fill:colors.gray[450],viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M6.51019 0.479749C6.78233 0.213196 7.21767 0.213195 7.48981 0.479749L8.86158 1.82333C8.99061 1.94972 9.16351 2.02134 9.34412 2.02321L11.2642 2.04314C11.6451 2.04709 11.9529 2.35492 11.9569 2.73584L11.9768 4.65588C11.9787 4.83649 12.0503 5.00939 12.1767 5.13842L13.5203 6.51019C13.7868 6.78233 13.7868 7.21767 13.5203 7.48981L12.1767 8.86158C12.0503 8.99061 11.9787 9.16351 11.9768 9.34412L11.9569 11.2642C11.9529 11.6451 11.6451 11.9529 11.2642 11.9569L9.34412 11.9768C9.16351 11.9787 8.99061 12.0503 8.86158 12.1767L7.48981 13.5203C7.21767 13.7868 6.78233 13.7868 6.51019 13.5203L5.13842 12.1767C5.00939 12.0503 4.83649 11.9787 4.65588 11.9768L2.73584 11.9569C2.35492 11.9529 2.04709 11.6451 2.04314 11.2642L2.02321 9.34412C2.02134 9.16351 1.94972 8.99061 1.82333 8.86158L0.479749 7.48981C0.213196 7.21767 0.213195 6.78233 0.479749 6.51019L1.82333 5.13842C1.94972 5.00939 2.02134 4.83649 2.02321 4.65588L2.04314 2.73584C2.04709 2.35492 2.35492 2.04709 2.73584 2.04314L4.65588 2.02321C4.83649 2.02134 5.00939 1.94972 5.13842 1.82333L6.51019 0.479749Z",strokeLinecap:"square",strokeLinejoin:"round"})}),CheckIcon$1=a=>jsxRuntimeExports.jsx(Icon,{width:"7px",height:"5px",fill:"none",stroke:"white",viewBox:"0 0 7 5",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M1.66699 2.19314L3.0281 3.55425L5.75033 0.832031",strokeLinecap:"square",strokeLinejoin:"round"})}),WalletPlusIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"24px",height:"24px",fill:"none",stroke:colors.gray[450],viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M10 16V14.0003M10 14.0003V12M10 14.0003L12 14.0005M10 14.0003L8 14M21 12V11.2C21 10.0799 21 9.51984 20.782 9.09202C20.5903 8.7157 20.2843 8.40973 19.908 8.21799C19.4802 8 18.9201 8 17.8 8H3M21 12V16M21 12H19C17.8954 12 17 12.8954 17 14C17 15.1046 17.8954 16 19 16H21M21 16V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8V8M18 8V7.2C18 6.0799 18 5.51984 17.782 5.09202C17.5903 4.71569 17.2843 4.40973 16.908 4.21799C16.4802 4 15.9201 4 14.8 4H6.2C5.07989 4 4.51984 4 4.09202 4.21799C3.71569 4.40973 3.40973 4.71569 3.21799 5.09202C3 5.51984 3 6.0799 3 7.2V8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})}),WarningIcon=a=>jsxRuntimeExports.jsx(Icon,{width:"36px",height:"32px",fill:"none",stroke:colors.orangeL,viewBox:"0 0 36 32",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M18.0004 24.3332H18.0171M18.0004 12.6665V19.3332M8.68719 30.9999H27.3136C30.2831 30.9999 31.7678 30.9999 32.6386 30.3754C33.3985 29.8305 33.8946 28.9915 34.0058 28.0631C34.1333 26.9991 33.4178 25.6982 31.9868 23.0963L22.6736 6.16318C21.1499 3.39292 20.3881 2.00779 19.3814 1.54954C18.5041 1.15015 17.4968 1.15015 16.6194 1.54954C15.6127 2.00779 14.8509 3.39292 13.3273 6.16317L4.01404 23.0963C2.58301 25.6982 1.8675 26.9991 1.99498 28.0631C2.10622 28.9915 2.6023 29.8305 3.36219 30.3754C4.23304 30.9999 5.71776 30.9999 8.68719 30.9999Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}),XMark=a=>jsxRuntimeExports.jsx(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...a,children:jsxRuntimeExports.jsx("path",{d:"M4.5 4.5L13.5 13.5M13.5 4.5L4.5 13.5","data-testid":"xmark-icon-path",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})});function keys(a){return Object.keys(a)}var ExposedPromiseStatus;(function(a){a.PENDING="pending",a.RESOLVED="resolved",a.REJECTED="rejected"})(ExposedPromiseStatus||(ExposedPromiseStatus={}));const notInitialized$1=()=>{throw new Error("ExposedPromise not initialized yet.")};class ExposedPromise{constructor(){Yr(this,"_promise");Yr(this,"_resolve",notInitialized$1);Yr(this,"_reject",notInitialized$1);Yr(this,"_status",ExposedPromiseStatus.PENDING);Yr(this,"_promiseResult");Yr(this,"_promiseError");this._promise=new Promise((_,$)=>{this._resolve=j=>{this.isSettled()||(this._promiseResult=j,_(j),this._status=ExposedPromiseStatus.RESOLVED)},this._reject=j=>{this.isSettled()||(this._promiseError=j,$(j),this._status=ExposedPromiseStatus.REJECTED)}})}get promise(){return this._promise}get resolve(){return this._resolve}get reject(){return this._reject}get status(){return this._status}get promiseResult(){return this._promiseResult}get promiseError(){return this._promiseError}static resolve(_){const $=new ExposedPromise;return $.resolve(_),$}static reject(_){const $=new ExposedPromise;return $.reject(_),$}isPending(){return this.status===ExposedPromiseStatus.PENDING}isResolved(){return this.status===ExposedPromiseStatus.RESOLVED}isRejected(){return this.status===ExposedPromiseStatus.REJECTED}isSettled(){return this.isResolved()||this.isRejected()}}var buffer$2={},base64Js$1={};base64Js$1.byteLength=byteLength$2;base64Js$1.toByteArray=toByteArray$1;base64Js$1.fromByteArray=fromByteArray$1;var lookup$3=[],revLookup$1=[],Arr$1=typeof Uint8Array<"u"?Uint8Array:Array,code$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$2=0,len$1=code$1.length;i$20)throw new Error("Invalid string. Length must be a multiple of 4");var $=a.indexOf("=");$===-1&&($=_);var j=$===_?0:4-$%4;return[$,j]}function byteLength$2(a){var _=getLens$1(a),$=_[0],j=_[1];return($+j)*3/4-j}function _byteLength$1(a,_,$){return(_+$)*3/4-$}function toByteArray$1(a){var _,$=getLens$1(a),j=$[0],et=$[1],tt=new Arr$1(_byteLength$1(a,j,et)),rt=0,nt=et>0?j-4:j,it;for(it=0;it>16&255,tt[rt++]=_>>8&255,tt[rt++]=_&255;return et===2&&(_=revLookup$1[a.charCodeAt(it)]<<2|revLookup$1[a.charCodeAt(it+1)]>>4,tt[rt++]=_&255),et===1&&(_=revLookup$1[a.charCodeAt(it)]<<10|revLookup$1[a.charCodeAt(it+1)]<<4|revLookup$1[a.charCodeAt(it+2)]>>2,tt[rt++]=_>>8&255,tt[rt++]=_&255),tt}function tripletToBase64$1(a){return lookup$3[a>>18&63]+lookup$3[a>>12&63]+lookup$3[a>>6&63]+lookup$3[a&63]}function encodeChunk$1(a,_,$){for(var j,et=[],tt=_;tt<$;tt+=3)j=(a[tt]<<16&16711680)+(a[tt+1]<<8&65280)+(a[tt+2]&255),et.push(tripletToBase64$1(j));return et.join("")}function fromByteArray$1(a){for(var _,$=a.length,j=$%3,et=[],tt=16383,rt=0,nt=$-j;rtnt?nt:rt+tt));return j===1?(_=a[$-1],et.push(lookup$3[_>>2]+lookup$3[_<<4&63]+"==")):j===2&&(_=(a[$-2]<<8)+a[$-1],et.push(lookup$3[_>>10]+lookup$3[_>>4&63]+lookup$3[_<<2&63]+"=")),et.join("")}var ieee754$1={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754$1.read=function(a,_,$,j,et){var tt,rt,nt=et*8-j-1,it=(1<>1,ot=-7,at=$?et-1:0,ut=$?-1:1,ht=a[_+at];for(at+=ut,tt=ht&(1<<-ot)-1,ht>>=-ot,ot+=nt;ot>0;tt=tt*256+a[_+at],at+=ut,ot-=8);for(rt=tt&(1<<-ot)-1,tt>>=-ot,ot+=j;ot>0;rt=rt*256+a[_+at],at+=ut,ot-=8);if(tt===0)tt=1-st;else{if(tt===it)return rt?NaN:(ht?-1:1)*(1/0);rt=rt+Math.pow(2,j),tt=tt-st}return(ht?-1:1)*rt*Math.pow(2,tt-j)};ieee754$1.write=function(a,_,$,j,et,tt){var rt,nt,it,st=tt*8-et-1,ot=(1<>1,ut=et===23?Math.pow(2,-24)-Math.pow(2,-77):0,ht=j?0:tt-1,yt=j?1:-1,wt=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(nt=isNaN(_)?1:0,rt=ot):(rt=Math.floor(Math.log(_)/Math.LN2),_*(it=Math.pow(2,-rt))<1&&(rt--,it*=2),rt+at>=1?_+=ut/it:_+=ut*Math.pow(2,1-at),_*it>=2&&(rt++,it/=2),rt+at>=ot?(nt=0,rt=ot):rt+at>=1?(nt=(_*it-1)*Math.pow(2,et),rt=rt+at):(nt=_*Math.pow(2,at-1)*Math.pow(2,et),rt=0));et>=8;a[$+ht]=nt&255,ht+=yt,nt/=256,et-=8);for(rt=rt<0;a[$+ht]=rt&255,ht+=yt,rt/=256,st-=8);a[$+ht-yt]|=wt*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */(function(a){const _=base64Js$1,$=ieee754$1,j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=ot,a.SlowBuffer=Dt,a.INSPECT_MAX_BYTES=50;const et=2147483647;a.kMaxLength=et;const{Uint8Array:tt,ArrayBuffer:rt,SharedArrayBuffer:nt}=globalThis;ot.TYPED_ARRAY_SUPPORT=it(),!ot.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function it(){try{const Gt=new tt(1),Vt={foo:function(){return 42}};return Object.setPrototypeOf(Vt,tt.prototype),Object.setPrototypeOf(Gt,Vt),Gt.foo()===42}catch{return!1}}Object.defineProperty(ot.prototype,"parent",{enumerable:!0,get:function(){if(ot.isBuffer(this))return this.buffer}}),Object.defineProperty(ot.prototype,"offset",{enumerable:!0,get:function(){if(ot.isBuffer(this))return this.byteOffset}});function st(Gt){if(Gt>et)throw new RangeError('The value "'+Gt+'" is invalid for option "size"');const Vt=new tt(Gt);return Object.setPrototypeOf(Vt,ot.prototype),Vt}function ot(Gt,Vt,Wt){if(typeof Gt=="number"){if(typeof Vt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return yt(Gt)}return at(Gt,Vt,Wt)}ot.poolSize=8192;function at(Gt,Vt,Wt){if(typeof Gt=="string")return wt(Gt,Vt);if(rt.isView(Gt))return Pt(Gt);if(Gt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Gt);if(Or(Gt,rt)||Gt&&Or(Gt.buffer,rt)||typeof nt<"u"&&(Or(Gt,nt)||Gt&&Or(Gt.buffer,nt)))return $t(Gt,Vt,Wt);if(typeof Gt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ar=Gt.valueOf&&Gt.valueOf();if(ar!=null&&ar!==Gt)return ot.from(ar,Vt,Wt);const yr=Mt(Gt);if(yr)return yr;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Gt[Symbol.toPrimitive]=="function")return ot.from(Gt[Symbol.toPrimitive]("string"),Vt,Wt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Gt)}ot.from=function(Gt,Vt,Wt){return at(Gt,Vt,Wt)},Object.setPrototypeOf(ot.prototype,tt.prototype),Object.setPrototypeOf(ot,tt);function ut(Gt){if(typeof Gt!="number")throw new TypeError('"size" argument must be of type number');if(Gt<0)throw new RangeError('The value "'+Gt+'" is invalid for option "size"')}function ht(Gt,Vt,Wt){return ut(Gt),Gt<=0?st(Gt):Vt!==void 0?typeof Wt=="string"?st(Gt).fill(Vt,Wt):st(Gt).fill(Vt):st(Gt)}ot.alloc=function(Gt,Vt,Wt){return ht(Gt,Vt,Wt)};function yt(Gt){return ut(Gt),st(Gt<0?0:Bt(Gt)|0)}ot.allocUnsafe=function(Gt){return yt(Gt)},ot.allocUnsafeSlow=function(Gt){return yt(Gt)};function wt(Gt,Vt){if((typeof Vt!="string"||Vt==="")&&(Vt="utf8"),!ot.isEncoding(Vt))throw new TypeError("Unknown encoding: "+Vt);const Wt=zt(Gt,Vt)|0;let ar=st(Wt);const yr=ar.write(Gt,Vt);return yr!==Wt&&(ar=ar.slice(0,yr)),ar}function Ct(Gt){const Vt=Gt.length<0?0:Bt(Gt.length)|0,Wt=st(Vt);for(let ar=0;ar=et)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+et.toString(16)+" bytes");return Gt|0}function Dt(Gt){return+Gt!=Gt&&(Gt=0),ot.alloc(+Gt)}ot.isBuffer=function(Vt){return Vt!=null&&Vt._isBuffer===!0&&Vt!==ot.prototype},ot.compare=function(Vt,Wt){if(Or(Vt,tt)&&(Vt=ot.from(Vt,Vt.offset,Vt.byteLength)),Or(Wt,tt)&&(Wt=ot.from(Wt,Wt.offset,Wt.byteLength)),!ot.isBuffer(Vt)||!ot.isBuffer(Wt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Vt===Wt)return 0;let ar=Vt.length,yr=Wt.length;for(let Er=0,Sr=Math.min(ar,yr);Eryr.length?(ot.isBuffer(Sr)||(Sr=ot.from(Sr)),Sr.copy(yr,Er)):tt.prototype.set.call(yr,Sr,Er);else if(ot.isBuffer(Sr))Sr.copy(yr,Er);else throw new TypeError('"list" argument must be an Array of Buffers');Er+=Sr.length}return yr};function zt(Gt,Vt){if(ot.isBuffer(Gt))return Gt.length;if(rt.isView(Gt)||Or(Gt,rt))return Gt.byteLength;if(typeof Gt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Gt);const Wt=Gt.length,ar=arguments.length>2&&arguments[2]===!0;if(!ar&&Wt===0)return 0;let yr=!1;for(;;)switch(Vt){case"ascii":case"latin1":case"binary":return Wt;case"utf8":case"utf-8":return _r(Gt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt*2;case"hex":return Wt>>>1;case"base64":return Ar(Gt).length;default:if(yr)return ar?-1:_r(Gt).length;Vt=(""+Vt).toLowerCase(),yr=!0}}ot.byteLength=zt;function Ot(Gt,Vt,Wt){let ar=!1;if((Vt===void 0||Vt<0)&&(Vt=0),Vt>this.length||((Wt===void 0||Wt>this.length)&&(Wt=this.length),Wt<=0)||(Wt>>>=0,Vt>>>=0,Wt<=Vt))return"";for(Gt||(Gt="utf8");;)switch(Gt){case"hex":return Et(this,Vt,Wt);case"utf8":case"utf-8":return xt(this,Vt,Wt);case"ascii":return St(this,Vt,Wt);case"latin1":case"binary":return Tt(this,Vt,Wt);case"base64":return mt(this,Vt,Wt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,Vt,Wt);default:if(ar)throw new TypeError("Unknown encoding: "+Gt);Gt=(Gt+"").toLowerCase(),ar=!0}}ot.prototype._isBuffer=!0;function It(Gt,Vt,Wt){const ar=Gt[Vt];Gt[Vt]=Gt[Wt],Gt[Wt]=ar}ot.prototype.swap16=function(){const Vt=this.length;if(Vt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Wt=0;WtWt&&(Vt+=" ... "),""},j&&(ot.prototype[j]=ot.prototype.inspect),ot.prototype.compare=function(Vt,Wt,ar,yr,Er){if(Or(Vt,tt)&&(Vt=ot.from(Vt,Vt.offset,Vt.byteLength)),!ot.isBuffer(Vt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Vt);if(Wt===void 0&&(Wt=0),ar===void 0&&(ar=Vt?Vt.length:0),yr===void 0&&(yr=0),Er===void 0&&(Er=this.length),Wt<0||ar>Vt.length||yr<0||Er>this.length)throw new RangeError("out of range index");if(yr>=Er&&Wt>=ar)return 0;if(yr>=Er)return-1;if(Wt>=ar)return 1;if(Wt>>>=0,ar>>>=0,yr>>>=0,Er>>>=0,this===Vt)return 0;let Sr=Er-yr,Wr=ar-Wt;const Hr=Math.min(Sr,Wr),Fr=this.slice(yr,Er),pn=Vt.slice(Wt,ar);for(let Jr=0;Jr2147483647?Wt=2147483647:Wt<-2147483648&&(Wt=-2147483648),Wt=+Wt,Br(Wt)&&(Wt=yr?0:Gt.length-1),Wt<0&&(Wt=Gt.length+Wt),Wt>=Gt.length){if(yr)return-1;Wt=Gt.length-1}else if(Wt<0)if(yr)Wt=0;else return-1;if(typeof Vt=="string"&&(Vt=ot.from(Vt,ar)),ot.isBuffer(Vt))return Vt.length===0?-1:Ft(Gt,Vt,Wt,ar,yr);if(typeof Vt=="number")return Vt=Vt&255,typeof tt.prototype.indexOf=="function"?yr?tt.prototype.indexOf.call(Gt,Vt,Wt):tt.prototype.lastIndexOf.call(Gt,Vt,Wt):Ft(Gt,[Vt],Wt,ar,yr);throw new TypeError("val must be string, number or Buffer")}function Ft(Gt,Vt,Wt,ar,yr){let Er=1,Sr=Gt.length,Wr=Vt.length;if(ar!==void 0&&(ar=String(ar).toLowerCase(),ar==="ucs2"||ar==="ucs-2"||ar==="utf16le"||ar==="utf-16le")){if(Gt.length<2||Vt.length<2)return-1;Er=2,Sr/=2,Wr/=2,Wt/=2}function Hr(pn,Jr){return Er===1?pn[Jr]:pn.readUInt16BE(Jr*Er)}let Fr;if(yr){let pn=-1;for(Fr=Wt;FrSr&&(Wt=Sr-Wr),Fr=Wt;Fr>=0;Fr--){let pn=!0;for(let Jr=0;Jryr&&(ar=yr)):ar=yr;const Er=Vt.length;ar>Er/2&&(ar=Er/2);let Sr;for(Sr=0;Sr>>0,isFinite(ar)?(ar=ar>>>0,yr===void 0&&(yr="utf8")):(yr=ar,ar=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Er=this.length-Wt;if((ar===void 0||ar>Er)&&(ar=Er),Vt.length>0&&(ar<0||Wt<0)||Wt>this.length)throw new RangeError("Attempt to write outside buffer bounds");yr||(yr="utf8");let Sr=!1;for(;;)switch(yr){case"hex":return jt(this,Vt,Wt,ar);case"utf8":case"utf-8":return bt(this,Vt,Wt,ar);case"ascii":case"latin1":case"binary":return vt(this,Vt,Wt,ar);case"base64":return ct(this,Vt,Wt,ar);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dt(this,Vt,Wt,ar);default:if(Sr)throw new TypeError("Unknown encoding: "+yr);yr=(""+yr).toLowerCase(),Sr=!0}},ot.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function mt(Gt,Vt,Wt){return Vt===0&&Wt===Gt.length?_.fromByteArray(Gt):_.fromByteArray(Gt.slice(Vt,Wt))}function xt(Gt,Vt,Wt){Wt=Math.min(Gt.length,Wt);const ar=[];let yr=Vt;for(;yr239?4:Er>223?3:Er>191?2:1;if(yr+Wr<=Wt){let Hr,Fr,pn,Jr;switch(Wr){case 1:Er<128&&(Sr=Er);break;case 2:Hr=Gt[yr+1],(Hr&192)===128&&(Jr=(Er&31)<<6|Hr&63,Jr>127&&(Sr=Jr));break;case 3:Hr=Gt[yr+1],Fr=Gt[yr+2],(Hr&192)===128&&(Fr&192)===128&&(Jr=(Er&15)<<12|(Hr&63)<<6|Fr&63,Jr>2047&&(Jr<55296||Jr>57343)&&(Sr=Jr));break;case 4:Hr=Gt[yr+1],Fr=Gt[yr+2],pn=Gt[yr+3],(Hr&192)===128&&(Fr&192)===128&&(pn&192)===128&&(Jr=(Er&15)<<18|(Hr&63)<<12|(Fr&63)<<6|pn&63,Jr>65535&&Jr<1114112&&(Sr=Jr))}}Sr===null?(Sr=65533,Wr=1):Sr>65535&&(Sr-=65536,ar.push(Sr>>>10&1023|55296),Sr=56320|Sr&1023),ar.push(Sr),yr+=Wr}return Rt(ar)}const At=4096;function Rt(Gt){const Vt=Gt.length;if(Vt<=At)return String.fromCharCode.apply(String,Gt);let Wt="",ar=0;for(;arar)&&(Wt=ar);let yr="";for(let Er=Vt;Erar&&(Vt=ar),Wt<0?(Wt+=ar,Wt<0&&(Wt=0)):Wt>ar&&(Wt=ar),WtWt)throw new RangeError("Trying to access beyond buffer length")}ot.prototype.readUintLE=ot.prototype.readUIntLE=function(Vt,Wt,ar){Vt=Vt>>>0,Wt=Wt>>>0,ar||tr(Vt,Wt,this.length);let yr=this[Vt],Er=1,Sr=0;for(;++Sr>>0,Wt=Wt>>>0,ar||tr(Vt,Wt,this.length);let yr=this[Vt+--Wt],Er=1;for(;Wt>0&&(Er*=256);)yr+=this[Vt+--Wt]*Er;return yr},ot.prototype.readUint8=ot.prototype.readUInt8=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,1,this.length),this[Vt]},ot.prototype.readUint16LE=ot.prototype.readUInt16LE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,2,this.length),this[Vt]|this[Vt+1]<<8},ot.prototype.readUint16BE=ot.prototype.readUInt16BE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,2,this.length),this[Vt]<<8|this[Vt+1]},ot.prototype.readUint32LE=ot.prototype.readUInt32LE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),(this[Vt]|this[Vt+1]<<8|this[Vt+2]<<16)+this[Vt+3]*16777216},ot.prototype.readUint32BE=ot.prototype.readUInt32BE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),this[Vt]*16777216+(this[Vt+1]<<16|this[Vt+2]<<8|this[Vt+3])},ot.prototype.readBigUInt64LE=Yt(function(Vt){Vt=Vt>>>0,Cr(Vt,"offset");const Wt=this[Vt],ar=this[Vt+7];(Wt===void 0||ar===void 0)&&Mr(Vt,this.length-8);const yr=Wt+this[++Vt]*2**8+this[++Vt]*2**16+this[++Vt]*2**24,Er=this[++Vt]+this[++Vt]*2**8+this[++Vt]*2**16+ar*2**24;return BigInt(yr)+(BigInt(Er)<>>0,Cr(Vt,"offset");const Wt=this[Vt],ar=this[Vt+7];(Wt===void 0||ar===void 0)&&Mr(Vt,this.length-8);const yr=Wt*2**24+this[++Vt]*2**16+this[++Vt]*2**8+this[++Vt],Er=this[++Vt]*2**24+this[++Vt]*2**16+this[++Vt]*2**8+ar;return(BigInt(yr)<>>0,Wt=Wt>>>0,ar||tr(Vt,Wt,this.length);let yr=this[Vt],Er=1,Sr=0;for(;++Sr=Er&&(yr-=Math.pow(2,8*Wt)),yr},ot.prototype.readIntBE=function(Vt,Wt,ar){Vt=Vt>>>0,Wt=Wt>>>0,ar||tr(Vt,Wt,this.length);let yr=Wt,Er=1,Sr=this[Vt+--yr];for(;yr>0&&(Er*=256);)Sr+=this[Vt+--yr]*Er;return Er*=128,Sr>=Er&&(Sr-=Math.pow(2,8*Wt)),Sr},ot.prototype.readInt8=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,1,this.length),this[Vt]&128?(255-this[Vt]+1)*-1:this[Vt]},ot.prototype.readInt16LE=function(Vt,Wt){Vt=Vt>>>0,Wt||tr(Vt,2,this.length);const ar=this[Vt]|this[Vt+1]<<8;return ar&32768?ar|4294901760:ar},ot.prototype.readInt16BE=function(Vt,Wt){Vt=Vt>>>0,Wt||tr(Vt,2,this.length);const ar=this[Vt+1]|this[Vt]<<8;return ar&32768?ar|4294901760:ar},ot.prototype.readInt32LE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),this[Vt]|this[Vt+1]<<8|this[Vt+2]<<16|this[Vt+3]<<24},ot.prototype.readInt32BE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),this[Vt]<<24|this[Vt+1]<<16|this[Vt+2]<<8|this[Vt+3]},ot.prototype.readBigInt64LE=Yt(function(Vt){Vt=Vt>>>0,Cr(Vt,"offset");const Wt=this[Vt],ar=this[Vt+7];(Wt===void 0||ar===void 0)&&Mr(Vt,this.length-8);const yr=this[Vt+4]+this[Vt+5]*2**8+this[Vt+6]*2**16+(ar<<24);return(BigInt(yr)<>>0,Cr(Vt,"offset");const Wt=this[Vt],ar=this[Vt+7];(Wt===void 0||ar===void 0)&&Mr(Vt,this.length-8);const yr=(Wt<<24)+this[++Vt]*2**16+this[++Vt]*2**8+this[++Vt];return(BigInt(yr)<>>0,Wt||tr(Vt,4,this.length),$.read(this,Vt,!0,23,4)},ot.prototype.readFloatBE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),$.read(this,Vt,!1,23,4)},ot.prototype.readDoubleLE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,8,this.length),$.read(this,Vt,!0,52,8)},ot.prototype.readDoubleBE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,8,this.length),$.read(this,Vt,!1,52,8)};function ir(Gt,Vt,Wt,ar,yr,Er){if(!ot.isBuffer(Gt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Vt>yr||VtGt.length)throw new RangeError("Index out of range")}ot.prototype.writeUintLE=ot.prototype.writeUIntLE=function(Vt,Wt,ar,yr){if(Vt=+Vt,Wt=Wt>>>0,ar=ar>>>0,!yr){const Wr=Math.pow(2,8*ar)-1;ir(this,Vt,Wt,ar,Wr,0)}let Er=1,Sr=0;for(this[Wt]=Vt&255;++Sr>>0,ar=ar>>>0,!yr){const Wr=Math.pow(2,8*ar)-1;ir(this,Vt,Wt,ar,Wr,0)}let Er=ar-1,Sr=1;for(this[Wt+Er]=Vt&255;--Er>=0&&(Sr*=256);)this[Wt+Er]=Vt/Sr&255;return Wt+ar},ot.prototype.writeUint8=ot.prototype.writeUInt8=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,1,255,0),this[Wt]=Vt&255,Wt+1},ot.prototype.writeUint16LE=ot.prototype.writeUInt16LE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,2,65535,0),this[Wt]=Vt&255,this[Wt+1]=Vt>>>8,Wt+2},ot.prototype.writeUint16BE=ot.prototype.writeUInt16BE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,2,65535,0),this[Wt]=Vt>>>8,this[Wt+1]=Vt&255,Wt+2},ot.prototype.writeUint32LE=ot.prototype.writeUInt32LE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,4,4294967295,0),this[Wt+3]=Vt>>>24,this[Wt+2]=Vt>>>16,this[Wt+1]=Vt>>>8,this[Wt]=Vt&255,Wt+4},ot.prototype.writeUint32BE=ot.prototype.writeUInt32BE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,4,4294967295,0),this[Wt]=Vt>>>24,this[Wt+1]=Vt>>>16,this[Wt+2]=Vt>>>8,this[Wt+3]=Vt&255,Wt+4};function nr(Gt,Vt,Wt,ar,yr){pr(Vt,ar,yr,Gt,Wt,7);let Er=Number(Vt&BigInt(4294967295));Gt[Wt++]=Er,Er=Er>>8,Gt[Wt++]=Er,Er=Er>>8,Gt[Wt++]=Er,Er=Er>>8,Gt[Wt++]=Er;let Sr=Number(Vt>>BigInt(32)&BigInt(4294967295));return Gt[Wt++]=Sr,Sr=Sr>>8,Gt[Wt++]=Sr,Sr=Sr>>8,Gt[Wt++]=Sr,Sr=Sr>>8,Gt[Wt++]=Sr,Wt}function Zt(Gt,Vt,Wt,ar,yr){pr(Vt,ar,yr,Gt,Wt,7);let Er=Number(Vt&BigInt(4294967295));Gt[Wt+7]=Er,Er=Er>>8,Gt[Wt+6]=Er,Er=Er>>8,Gt[Wt+5]=Er,Er=Er>>8,Gt[Wt+4]=Er;let Sr=Number(Vt>>BigInt(32)&BigInt(4294967295));return Gt[Wt+3]=Sr,Sr=Sr>>8,Gt[Wt+2]=Sr,Sr=Sr>>8,Gt[Wt+1]=Sr,Sr=Sr>>8,Gt[Wt]=Sr,Wt+8}ot.prototype.writeBigUInt64LE=Yt(function(Vt,Wt=0){return nr(this,Vt,Wt,BigInt(0),BigInt("0xffffffffffffffff"))}),ot.prototype.writeBigUInt64BE=Yt(function(Vt,Wt=0){return Zt(this,Vt,Wt,BigInt(0),BigInt("0xffffffffffffffff"))}),ot.prototype.writeIntLE=function(Vt,Wt,ar,yr){if(Vt=+Vt,Wt=Wt>>>0,!yr){const Hr=Math.pow(2,8*ar-1);ir(this,Vt,Wt,ar,Hr-1,-Hr)}let Er=0,Sr=1,Wr=0;for(this[Wt]=Vt&255;++Er>0)-Wr&255;return Wt+ar},ot.prototype.writeIntBE=function(Vt,Wt,ar,yr){if(Vt=+Vt,Wt=Wt>>>0,!yr){const Hr=Math.pow(2,8*ar-1);ir(this,Vt,Wt,ar,Hr-1,-Hr)}let Er=ar-1,Sr=1,Wr=0;for(this[Wt+Er]=Vt&255;--Er>=0&&(Sr*=256);)Vt<0&&Wr===0&&this[Wt+Er+1]!==0&&(Wr=1),this[Wt+Er]=(Vt/Sr>>0)-Wr&255;return Wt+ar},ot.prototype.writeInt8=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,1,127,-128),Vt<0&&(Vt=255+Vt+1),this[Wt]=Vt&255,Wt+1},ot.prototype.writeInt16LE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,2,32767,-32768),this[Wt]=Vt&255,this[Wt+1]=Vt>>>8,Wt+2},ot.prototype.writeInt16BE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,2,32767,-32768),this[Wt]=Vt>>>8,this[Wt+1]=Vt&255,Wt+2},ot.prototype.writeInt32LE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,4,2147483647,-2147483648),this[Wt]=Vt&255,this[Wt+1]=Vt>>>8,this[Wt+2]=Vt>>>16,this[Wt+3]=Vt>>>24,Wt+4},ot.prototype.writeInt32BE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,4,2147483647,-2147483648),Vt<0&&(Vt=4294967295+Vt+1),this[Wt]=Vt>>>24,this[Wt+1]=Vt>>>16,this[Wt+2]=Vt>>>8,this[Wt+3]=Vt&255,Wt+4},ot.prototype.writeBigInt64LE=Yt(function(Vt,Wt=0){return nr(this,Vt,Wt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ot.prototype.writeBigInt64BE=Yt(function(Vt,Wt=0){return Zt(this,Vt,Wt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Kt(Gt,Vt,Wt,ar,yr,Er){if(Wt+ar>Gt.length)throw new RangeError("Index out of range");if(Wt<0)throw new RangeError("Index out of range")}function Qt(Gt,Vt,Wt,ar,yr){return Vt=+Vt,Wt=Wt>>>0,yr||Kt(Gt,Vt,Wt,4),$.write(Gt,Vt,Wt,ar,23,4),Wt+4}ot.prototype.writeFloatLE=function(Vt,Wt,ar){return Qt(this,Vt,Wt,!0,ar)},ot.prototype.writeFloatBE=function(Vt,Wt,ar){return Qt(this,Vt,Wt,!1,ar)};function Ht(Gt,Vt,Wt,ar,yr){return Vt=+Vt,Wt=Wt>>>0,yr||Kt(Gt,Vt,Wt,8),$.write(Gt,Vt,Wt,ar,52,8),Wt+8}ot.prototype.writeDoubleLE=function(Vt,Wt,ar){return Ht(this,Vt,Wt,!0,ar)},ot.prototype.writeDoubleBE=function(Vt,Wt,ar){return Ht(this,Vt,Wt,!1,ar)},ot.prototype.copy=function(Vt,Wt,ar,yr){if(!ot.isBuffer(Vt))throw new TypeError("argument should be a Buffer");if(ar||(ar=0),!yr&&yr!==0&&(yr=this.length),Wt>=Vt.length&&(Wt=Vt.length),Wt||(Wt=0),yr>0&&yr=this.length)throw new RangeError("Index out of range");if(yr<0)throw new RangeError("sourceEnd out of bounds");yr>this.length&&(yr=this.length),Vt.length-Wt>>0,ar=ar===void 0?this.length:ar>>>0,Vt||(Vt=0);let Er;if(typeof Vt=="number")for(Er=Wt;Er2**32?yr=ur(String(Wt)):typeof Wt=="bigint"&&(yr=String(Wt),(Wt>BigInt(2)**BigInt(32)||Wt<-(BigInt(2)**BigInt(32)))&&(yr=ur(yr)),yr+="n"),ar+=` It must be ${Vt}. Received ${yr}`,ar},RangeError);function ur(Gt){let Vt="",Wt=Gt.length;const ar=Gt[0]==="-"?1:0;for(;Wt>=ar+4;Wt-=3)Vt=`_${Gt.slice(Wt-3,Wt)}${Vt}`;return`${Gt.slice(0,Wt)}${Vt}`}function xr(Gt,Vt,Wt){Cr(Vt,"offset"),(Gt[Vt]===void 0||Gt[Vt+Wt]===void 0)&&Mr(Vt,Gt.length-(Wt+1))}function pr(Gt,Vt,Wt,ar,yr,Er){if(Gt>Wt||Gt= 0${Sr} and < 2${Sr} ** ${(Er+1)*8}${Sr}`:Wr=`>= -(2${Sr} ** ${(Er+1)*8-1}${Sr}) and < 2 ** ${(Er+1)*8-1}${Sr}`,new qt.ERR_OUT_OF_RANGE("value",Wr,Gt)}xr(ar,yr,Er)}function Cr(Gt,Vt){if(typeof Gt!="number")throw new qt.ERR_INVALID_ARG_TYPE(Vt,"number",Gt)}function Mr(Gt,Vt,Wt){throw Math.floor(Gt)!==Gt?(Cr(Gt,Wt),new qt.ERR_OUT_OF_RANGE("offset","an integer",Gt)):Vt<0?new qt.ERR_BUFFER_OUT_OF_BOUNDS:new qt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Vt}`,Gt)}const lr=/[^+/0-9A-Za-z-_]/g;function fr(Gt){if(Gt=Gt.split("=")[0],Gt=Gt.trim().replace(lr,""),Gt.length<2)return"";for(;Gt.length%4!==0;)Gt=Gt+"=";return Gt}function _r(Gt,Vt){Vt=Vt||1/0;let Wt;const ar=Gt.length;let yr=null;const Er=[];for(let Sr=0;Sr55295&&Wt<57344){if(!yr){if(Wt>56319){(Vt-=3)>-1&&Er.push(239,191,189);continue}else if(Sr+1===ar){(Vt-=3)>-1&&Er.push(239,191,189);continue}yr=Wt;continue}if(Wt<56320){(Vt-=3)>-1&&Er.push(239,191,189),yr=Wt;continue}Wt=(yr-55296<<10|Wt-56320)+65536}else yr&&(Vt-=3)>-1&&Er.push(239,191,189);if(yr=null,Wt<128){if((Vt-=1)<0)break;Er.push(Wt)}else if(Wt<2048){if((Vt-=2)<0)break;Er.push(Wt>>6|192,Wt&63|128)}else if(Wt<65536){if((Vt-=3)<0)break;Er.push(Wt>>12|224,Wt>>6&63|128,Wt&63|128)}else if(Wt<1114112){if((Vt-=4)<0)break;Er.push(Wt>>18|240,Wt>>12&63|128,Wt>>6&63|128,Wt&63|128)}else throw new Error("Invalid code point")}return Er}function Rr(Gt){const Vt=[];for(let Wt=0;Wt>8,yr=Wt%256,Er.push(yr),Er.push(ar);return Er}function Ar(Gt){return _.toByteArray(fr(Gt))}function Pr(Gt,Vt,Wt,ar){let yr;for(yr=0;yr=Vt.length||yr>=Gt.length);++yr)Vt[yr+Wt]=Gt[yr];return yr}function Or(Gt,Vt){return Gt instanceof Vt||Gt!=null&&Gt.constructor!=null&&Gt.constructor.name!=null&&Gt.constructor.name===Vt.name}function Br(Gt){return Gt!==Gt}const or=function(){const Gt="0123456789abcdef",Vt=new Array(256);for(let Wt=0;Wt<16;++Wt){const ar=Wt*16;for(let yr=0;yr<16;++yr)Vt[ar+yr]=Gt[Wt]+Gt[yr]}return Vt}();function Yt(Gt){return typeof BigInt>"u"?er:Gt}function er(){throw new Error("BigInt not supported")}})(buffer$2);const Buffer$g=buffer$2.Buffer;var inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(_,$){$&&(_.super_=$,_.prototype=Object.create($.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(_,$){if($){_.super_=$;var j=function(){};j.prototype=$.prototype,_.prototype=new j,_.prototype.constructor=_}};var inherits_browserExports=inherits_browser.exports,safeBuffer$2={exports:{}},buffer$1={},base64Js={};base64Js.byteLength=byteLength$1;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup$2=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$1=0,len=code.length;i$10)throw new Error("Invalid string. Length must be a multiple of 4");var $=a.indexOf("=");$===-1&&($=_);var j=$===_?0:4-$%4;return[$,j]}function byteLength$1(a){var _=getLens(a),$=_[0],j=_[1];return($+j)*3/4-j}function _byteLength(a,_,$){return(_+$)*3/4-$}function toByteArray(a){var _,$=getLens(a),j=$[0],et=$[1],tt=new Arr(_byteLength(a,j,et)),rt=0,nt=et>0?j-4:j,it;for(it=0;it>16&255,tt[rt++]=_>>8&255,tt[rt++]=_&255;return et===2&&(_=revLookup[a.charCodeAt(it)]<<2|revLookup[a.charCodeAt(it+1)]>>4,tt[rt++]=_&255),et===1&&(_=revLookup[a.charCodeAt(it)]<<10|revLookup[a.charCodeAt(it+1)]<<4|revLookup[a.charCodeAt(it+2)]>>2,tt[rt++]=_>>8&255,tt[rt++]=_&255),tt}function tripletToBase64(a){return lookup$2[a>>18&63]+lookup$2[a>>12&63]+lookup$2[a>>6&63]+lookup$2[a&63]}function encodeChunk(a,_,$){for(var j,et=[],tt=_;tt<$;tt+=3)j=(a[tt]<<16&16711680)+(a[tt+1]<<8&65280)+(a[tt+2]&255),et.push(tripletToBase64(j));return et.join("")}function fromByteArray(a){for(var _,$=a.length,j=$%3,et=[],tt=16383,rt=0,nt=$-j;rtnt?nt:rt+tt));return j===1?(_=a[$-1],et.push(lookup$2[_>>2]+lookup$2[_<<4&63]+"==")):j===2&&(_=(a[$-2]<<8)+a[$-1],et.push(lookup$2[_>>10]+lookup$2[_>>4&63]+lookup$2[_<<2&63]+"=")),et.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754.read=function(a,_,$,j,et){var tt,rt,nt=et*8-j-1,it=(1<>1,ot=-7,at=$?et-1:0,ut=$?-1:1,ht=a[_+at];for(at+=ut,tt=ht&(1<<-ot)-1,ht>>=-ot,ot+=nt;ot>0;tt=tt*256+a[_+at],at+=ut,ot-=8);for(rt=tt&(1<<-ot)-1,tt>>=-ot,ot+=j;ot>0;rt=rt*256+a[_+at],at+=ut,ot-=8);if(tt===0)tt=1-st;else{if(tt===it)return rt?NaN:(ht?-1:1)*(1/0);rt=rt+Math.pow(2,j),tt=tt-st}return(ht?-1:1)*rt*Math.pow(2,tt-j)};ieee754.write=function(a,_,$,j,et,tt){var rt,nt,it,st=tt*8-et-1,ot=(1<>1,ut=et===23?Math.pow(2,-24)-Math.pow(2,-77):0,ht=j?0:tt-1,yt=j?1:-1,wt=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(nt=isNaN(_)?1:0,rt=ot):(rt=Math.floor(Math.log(_)/Math.LN2),_*(it=Math.pow(2,-rt))<1&&(rt--,it*=2),rt+at>=1?_+=ut/it:_+=ut*Math.pow(2,1-at),_*it>=2&&(rt++,it/=2),rt+at>=ot?(nt=0,rt=ot):rt+at>=1?(nt=(_*it-1)*Math.pow(2,et),rt=rt+at):(nt=_*Math.pow(2,at-1)*Math.pow(2,et),rt=0));et>=8;a[$+ht]=nt&255,ht+=yt,nt/=256,et-=8);for(rt=rt<0;a[$+ht]=rt&255,ht+=yt,rt/=256,st-=8);a[$+ht-yt]|=wt*128};/*! + */(function(a){const _=base64Js$1,$=ieee754$1,j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=ot,a.SlowBuffer=Dt,a.INSPECT_MAX_BYTES=50;const et=2147483647;a.kMaxLength=et;const{Uint8Array:tt,ArrayBuffer:rt,SharedArrayBuffer:nt}=globalThis;ot.TYPED_ARRAY_SUPPORT=it(),!ot.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function it(){try{const Gt=new tt(1),Vt={foo:function(){return 42}};return Object.setPrototypeOf(Vt,tt.prototype),Object.setPrototypeOf(Gt,Vt),Gt.foo()===42}catch{return!1}}Object.defineProperty(ot.prototype,"parent",{enumerable:!0,get:function(){if(ot.isBuffer(this))return this.buffer}}),Object.defineProperty(ot.prototype,"offset",{enumerable:!0,get:function(){if(ot.isBuffer(this))return this.byteOffset}});function st(Gt){if(Gt>et)throw new RangeError('The value "'+Gt+'" is invalid for option "size"');const Vt=new tt(Gt);return Object.setPrototypeOf(Vt,ot.prototype),Vt}function ot(Gt,Vt,Wt){if(typeof Gt=="number"){if(typeof Vt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return yt(Gt)}return at(Gt,Vt,Wt)}ot.poolSize=8192;function at(Gt,Vt,Wt){if(typeof Gt=="string")return wt(Gt,Vt);if(rt.isView(Gt))return Pt(Gt);if(Gt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Gt);if(Or(Gt,rt)||Gt&&Or(Gt.buffer,rt)||typeof nt<"u"&&(Or(Gt,nt)||Gt&&Or(Gt.buffer,nt)))return $t(Gt,Vt,Wt);if(typeof Gt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ar=Gt.valueOf&&Gt.valueOf();if(ar!=null&&ar!==Gt)return ot.from(ar,Vt,Wt);const yr=Mt(Gt);if(yr)return yr;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Gt[Symbol.toPrimitive]=="function")return ot.from(Gt[Symbol.toPrimitive]("string"),Vt,Wt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Gt)}ot.from=function(Gt,Vt,Wt){return at(Gt,Vt,Wt)},Object.setPrototypeOf(ot.prototype,tt.prototype),Object.setPrototypeOf(ot,tt);function ut(Gt){if(typeof Gt!="number")throw new TypeError('"size" argument must be of type number');if(Gt<0)throw new RangeError('The value "'+Gt+'" is invalid for option "size"')}function ht(Gt,Vt,Wt){return ut(Gt),Gt<=0?st(Gt):Vt!==void 0?typeof Wt=="string"?st(Gt).fill(Vt,Wt):st(Gt).fill(Vt):st(Gt)}ot.alloc=function(Gt,Vt,Wt){return ht(Gt,Vt,Wt)};function yt(Gt){return ut(Gt),st(Gt<0?0:Bt(Gt)|0)}ot.allocUnsafe=function(Gt){return yt(Gt)},ot.allocUnsafeSlow=function(Gt){return yt(Gt)};function wt(Gt,Vt){if((typeof Vt!="string"||Vt==="")&&(Vt="utf8"),!ot.isEncoding(Vt))throw new TypeError("Unknown encoding: "+Vt);const Wt=zt(Gt,Vt)|0;let ar=st(Wt);const yr=ar.write(Gt,Vt);return yr!==Wt&&(ar=ar.slice(0,yr)),ar}function Ct(Gt){const Vt=Gt.length<0?0:Bt(Gt.length)|0,Wt=st(Vt);for(let ar=0;ar=et)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+et.toString(16)+" bytes");return Gt|0}function Dt(Gt){return+Gt!=Gt&&(Gt=0),ot.alloc(+Gt)}ot.isBuffer=function(Vt){return Vt!=null&&Vt._isBuffer===!0&&Vt!==ot.prototype},ot.compare=function(Vt,Wt){if(Or(Vt,tt)&&(Vt=ot.from(Vt,Vt.offset,Vt.byteLength)),Or(Wt,tt)&&(Wt=ot.from(Wt,Wt.offset,Wt.byteLength)),!ot.isBuffer(Vt)||!ot.isBuffer(Wt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Vt===Wt)return 0;let ar=Vt.length,yr=Wt.length;for(let Er=0,Rr=Math.min(ar,yr);Eryr.length?(ot.isBuffer(Rr)||(Rr=ot.from(Rr)),Rr.copy(yr,Er)):tt.prototype.set.call(yr,Rr,Er);else if(ot.isBuffer(Rr))Rr.copy(yr,Er);else throw new TypeError('"list" argument must be an Array of Buffers');Er+=Rr.length}return yr};function zt(Gt,Vt){if(ot.isBuffer(Gt))return Gt.length;if(rt.isView(Gt)||Or(Gt,rt))return Gt.byteLength;if(typeof Gt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Gt);const Wt=Gt.length,ar=arguments.length>2&&arguments[2]===!0;if(!ar&&Wt===0)return 0;let yr=!1;for(;;)switch(Vt){case"ascii":case"latin1":case"binary":return Wt;case"utf8":case"utf-8":return _r(Gt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt*2;case"hex":return Wt>>>1;case"base64":return Ar(Gt).length;default:if(yr)return ar?-1:_r(Gt).length;Vt=(""+Vt).toLowerCase(),yr=!0}}ot.byteLength=zt;function Ot(Gt,Vt,Wt){let ar=!1;if((Vt===void 0||Vt<0)&&(Vt=0),Vt>this.length||((Wt===void 0||Wt>this.length)&&(Wt=this.length),Wt<=0)||(Wt>>>=0,Vt>>>=0,Wt<=Vt))return"";for(Gt||(Gt="utf8");;)switch(Gt){case"hex":return Et(this,Vt,Wt);case"utf8":case"utf-8":return xt(this,Vt,Wt);case"ascii":return St(this,Vt,Wt);case"latin1":case"binary":return Tt(this,Vt,Wt);case"base64":return mt(this,Vt,Wt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,Vt,Wt);default:if(ar)throw new TypeError("Unknown encoding: "+Gt);Gt=(Gt+"").toLowerCase(),ar=!0}}ot.prototype._isBuffer=!0;function It(Gt,Vt,Wt){const ar=Gt[Vt];Gt[Vt]=Gt[Wt],Gt[Wt]=ar}ot.prototype.swap16=function(){const Vt=this.length;if(Vt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Wt=0;WtWt&&(Vt+=" ... "),""},j&&(ot.prototype[j]=ot.prototype.inspect),ot.prototype.compare=function(Vt,Wt,ar,yr,Er){if(Or(Vt,tt)&&(Vt=ot.from(Vt,Vt.offset,Vt.byteLength)),!ot.isBuffer(Vt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Vt);if(Wt===void 0&&(Wt=0),ar===void 0&&(ar=Vt?Vt.length:0),yr===void 0&&(yr=0),Er===void 0&&(Er=this.length),Wt<0||ar>Vt.length||yr<0||Er>this.length)throw new RangeError("out of range index");if(yr>=Er&&Wt>=ar)return 0;if(yr>=Er)return-1;if(Wt>=ar)return 1;if(Wt>>>=0,ar>>>=0,yr>>>=0,Er>>>=0,this===Vt)return 0;let Rr=Er-yr,Wr=ar-Wt;const Hr=Math.min(Rr,Wr),Fr=this.slice(yr,Er),pn=Vt.slice(Wt,ar);for(let Jr=0;Jr2147483647?Wt=2147483647:Wt<-2147483648&&(Wt=-2147483648),Wt=+Wt,Br(Wt)&&(Wt=yr?0:Gt.length-1),Wt<0&&(Wt=Gt.length+Wt),Wt>=Gt.length){if(yr)return-1;Wt=Gt.length-1}else if(Wt<0)if(yr)Wt=0;else return-1;if(typeof Vt=="string"&&(Vt=ot.from(Vt,ar)),ot.isBuffer(Vt))return Vt.length===0?-1:Ft(Gt,Vt,Wt,ar,yr);if(typeof Vt=="number")return Vt=Vt&255,typeof tt.prototype.indexOf=="function"?yr?tt.prototype.indexOf.call(Gt,Vt,Wt):tt.prototype.lastIndexOf.call(Gt,Vt,Wt):Ft(Gt,[Vt],Wt,ar,yr);throw new TypeError("val must be string, number or Buffer")}function Ft(Gt,Vt,Wt,ar,yr){let Er=1,Rr=Gt.length,Wr=Vt.length;if(ar!==void 0&&(ar=String(ar).toLowerCase(),ar==="ucs2"||ar==="ucs-2"||ar==="utf16le"||ar==="utf-16le")){if(Gt.length<2||Vt.length<2)return-1;Er=2,Rr/=2,Wr/=2,Wt/=2}function Hr(pn,Jr){return Er===1?pn[Jr]:pn.readUInt16BE(Jr*Er)}let Fr;if(yr){let pn=-1;for(Fr=Wt;FrRr&&(Wt=Rr-Wr),Fr=Wt;Fr>=0;Fr--){let pn=!0;for(let Jr=0;Jryr&&(ar=yr)):ar=yr;const Er=Vt.length;ar>Er/2&&(ar=Er/2);let Rr;for(Rr=0;Rr>>0,isFinite(ar)?(ar=ar>>>0,yr===void 0&&(yr="utf8")):(yr=ar,ar=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Er=this.length-Wt;if((ar===void 0||ar>Er)&&(ar=Er),Vt.length>0&&(ar<0||Wt<0)||Wt>this.length)throw new RangeError("Attempt to write outside buffer bounds");yr||(yr="utf8");let Rr=!1;for(;;)switch(yr){case"hex":return jt(this,Vt,Wt,ar);case"utf8":case"utf-8":return bt(this,Vt,Wt,ar);case"ascii":case"latin1":case"binary":return vt(this,Vt,Wt,ar);case"base64":return ct(this,Vt,Wt,ar);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dt(this,Vt,Wt,ar);default:if(Rr)throw new TypeError("Unknown encoding: "+yr);yr=(""+yr).toLowerCase(),Rr=!0}},ot.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function mt(Gt,Vt,Wt){return Vt===0&&Wt===Gt.length?_.fromByteArray(Gt):_.fromByteArray(Gt.slice(Vt,Wt))}function xt(Gt,Vt,Wt){Wt=Math.min(Gt.length,Wt);const ar=[];let yr=Vt;for(;yr239?4:Er>223?3:Er>191?2:1;if(yr+Wr<=Wt){let Hr,Fr,pn,Jr;switch(Wr){case 1:Er<128&&(Rr=Er);break;case 2:Hr=Gt[yr+1],(Hr&192)===128&&(Jr=(Er&31)<<6|Hr&63,Jr>127&&(Rr=Jr));break;case 3:Hr=Gt[yr+1],Fr=Gt[yr+2],(Hr&192)===128&&(Fr&192)===128&&(Jr=(Er&15)<<12|(Hr&63)<<6|Fr&63,Jr>2047&&(Jr<55296||Jr>57343)&&(Rr=Jr));break;case 4:Hr=Gt[yr+1],Fr=Gt[yr+2],pn=Gt[yr+3],(Hr&192)===128&&(Fr&192)===128&&(pn&192)===128&&(Jr=(Er&15)<<18|(Hr&63)<<12|(Fr&63)<<6|pn&63,Jr>65535&&Jr<1114112&&(Rr=Jr))}}Rr===null?(Rr=65533,Wr=1):Rr>65535&&(Rr-=65536,ar.push(Rr>>>10&1023|55296),Rr=56320|Rr&1023),ar.push(Rr),yr+=Wr}return Rt(ar)}const At=4096;function Rt(Gt){const Vt=Gt.length;if(Vt<=At)return String.fromCharCode.apply(String,Gt);let Wt="",ar=0;for(;arar)&&(Wt=ar);let yr="";for(let Er=Vt;Erar&&(Vt=ar),Wt<0?(Wt+=ar,Wt<0&&(Wt=0)):Wt>ar&&(Wt=ar),WtWt)throw new RangeError("Trying to access beyond buffer length")}ot.prototype.readUintLE=ot.prototype.readUIntLE=function(Vt,Wt,ar){Vt=Vt>>>0,Wt=Wt>>>0,ar||tr(Vt,Wt,this.length);let yr=this[Vt],Er=1,Rr=0;for(;++Rr>>0,Wt=Wt>>>0,ar||tr(Vt,Wt,this.length);let yr=this[Vt+--Wt],Er=1;for(;Wt>0&&(Er*=256);)yr+=this[Vt+--Wt]*Er;return yr},ot.prototype.readUint8=ot.prototype.readUInt8=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,1,this.length),this[Vt]},ot.prototype.readUint16LE=ot.prototype.readUInt16LE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,2,this.length),this[Vt]|this[Vt+1]<<8},ot.prototype.readUint16BE=ot.prototype.readUInt16BE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,2,this.length),this[Vt]<<8|this[Vt+1]},ot.prototype.readUint32LE=ot.prototype.readUInt32LE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),(this[Vt]|this[Vt+1]<<8|this[Vt+2]<<16)+this[Vt+3]*16777216},ot.prototype.readUint32BE=ot.prototype.readUInt32BE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),this[Vt]*16777216+(this[Vt+1]<<16|this[Vt+2]<<8|this[Vt+3])},ot.prototype.readBigUInt64LE=Yt(function(Vt){Vt=Vt>>>0,Cr(Vt,"offset");const Wt=this[Vt],ar=this[Vt+7];(Wt===void 0||ar===void 0)&&Mr(Vt,this.length-8);const yr=Wt+this[++Vt]*2**8+this[++Vt]*2**16+this[++Vt]*2**24,Er=this[++Vt]+this[++Vt]*2**8+this[++Vt]*2**16+ar*2**24;return BigInt(yr)+(BigInt(Er)<>>0,Cr(Vt,"offset");const Wt=this[Vt],ar=this[Vt+7];(Wt===void 0||ar===void 0)&&Mr(Vt,this.length-8);const yr=Wt*2**24+this[++Vt]*2**16+this[++Vt]*2**8+this[++Vt],Er=this[++Vt]*2**24+this[++Vt]*2**16+this[++Vt]*2**8+ar;return(BigInt(yr)<>>0,Wt=Wt>>>0,ar||tr(Vt,Wt,this.length);let yr=this[Vt],Er=1,Rr=0;for(;++Rr=Er&&(yr-=Math.pow(2,8*Wt)),yr},ot.prototype.readIntBE=function(Vt,Wt,ar){Vt=Vt>>>0,Wt=Wt>>>0,ar||tr(Vt,Wt,this.length);let yr=Wt,Er=1,Rr=this[Vt+--yr];for(;yr>0&&(Er*=256);)Rr+=this[Vt+--yr]*Er;return Er*=128,Rr>=Er&&(Rr-=Math.pow(2,8*Wt)),Rr},ot.prototype.readInt8=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,1,this.length),this[Vt]&128?(255-this[Vt]+1)*-1:this[Vt]},ot.prototype.readInt16LE=function(Vt,Wt){Vt=Vt>>>0,Wt||tr(Vt,2,this.length);const ar=this[Vt]|this[Vt+1]<<8;return ar&32768?ar|4294901760:ar},ot.prototype.readInt16BE=function(Vt,Wt){Vt=Vt>>>0,Wt||tr(Vt,2,this.length);const ar=this[Vt+1]|this[Vt]<<8;return ar&32768?ar|4294901760:ar},ot.prototype.readInt32LE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),this[Vt]|this[Vt+1]<<8|this[Vt+2]<<16|this[Vt+3]<<24},ot.prototype.readInt32BE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),this[Vt]<<24|this[Vt+1]<<16|this[Vt+2]<<8|this[Vt+3]},ot.prototype.readBigInt64LE=Yt(function(Vt){Vt=Vt>>>0,Cr(Vt,"offset");const Wt=this[Vt],ar=this[Vt+7];(Wt===void 0||ar===void 0)&&Mr(Vt,this.length-8);const yr=this[Vt+4]+this[Vt+5]*2**8+this[Vt+6]*2**16+(ar<<24);return(BigInt(yr)<>>0,Cr(Vt,"offset");const Wt=this[Vt],ar=this[Vt+7];(Wt===void 0||ar===void 0)&&Mr(Vt,this.length-8);const yr=(Wt<<24)+this[++Vt]*2**16+this[++Vt]*2**8+this[++Vt];return(BigInt(yr)<>>0,Wt||tr(Vt,4,this.length),$.read(this,Vt,!0,23,4)},ot.prototype.readFloatBE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,4,this.length),$.read(this,Vt,!1,23,4)},ot.prototype.readDoubleLE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,8,this.length),$.read(this,Vt,!0,52,8)},ot.prototype.readDoubleBE=function(Vt,Wt){return Vt=Vt>>>0,Wt||tr(Vt,8,this.length),$.read(this,Vt,!1,52,8)};function ir(Gt,Vt,Wt,ar,yr,Er){if(!ot.isBuffer(Gt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Vt>yr||VtGt.length)throw new RangeError("Index out of range")}ot.prototype.writeUintLE=ot.prototype.writeUIntLE=function(Vt,Wt,ar,yr){if(Vt=+Vt,Wt=Wt>>>0,ar=ar>>>0,!yr){const Wr=Math.pow(2,8*ar)-1;ir(this,Vt,Wt,ar,Wr,0)}let Er=1,Rr=0;for(this[Wt]=Vt&255;++Rr>>0,ar=ar>>>0,!yr){const Wr=Math.pow(2,8*ar)-1;ir(this,Vt,Wt,ar,Wr,0)}let Er=ar-1,Rr=1;for(this[Wt+Er]=Vt&255;--Er>=0&&(Rr*=256);)this[Wt+Er]=Vt/Rr&255;return Wt+ar},ot.prototype.writeUint8=ot.prototype.writeUInt8=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,1,255,0),this[Wt]=Vt&255,Wt+1},ot.prototype.writeUint16LE=ot.prototype.writeUInt16LE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,2,65535,0),this[Wt]=Vt&255,this[Wt+1]=Vt>>>8,Wt+2},ot.prototype.writeUint16BE=ot.prototype.writeUInt16BE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,2,65535,0),this[Wt]=Vt>>>8,this[Wt+1]=Vt&255,Wt+2},ot.prototype.writeUint32LE=ot.prototype.writeUInt32LE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,4,4294967295,0),this[Wt+3]=Vt>>>24,this[Wt+2]=Vt>>>16,this[Wt+1]=Vt>>>8,this[Wt]=Vt&255,Wt+4},ot.prototype.writeUint32BE=ot.prototype.writeUInt32BE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,4,4294967295,0),this[Wt]=Vt>>>24,this[Wt+1]=Vt>>>16,this[Wt+2]=Vt>>>8,this[Wt+3]=Vt&255,Wt+4};function nr(Gt,Vt,Wt,ar,yr){pr(Vt,ar,yr,Gt,Wt,7);let Er=Number(Vt&BigInt(4294967295));Gt[Wt++]=Er,Er=Er>>8,Gt[Wt++]=Er,Er=Er>>8,Gt[Wt++]=Er,Er=Er>>8,Gt[Wt++]=Er;let Rr=Number(Vt>>BigInt(32)&BigInt(4294967295));return Gt[Wt++]=Rr,Rr=Rr>>8,Gt[Wt++]=Rr,Rr=Rr>>8,Gt[Wt++]=Rr,Rr=Rr>>8,Gt[Wt++]=Rr,Wt}function Zt(Gt,Vt,Wt,ar,yr){pr(Vt,ar,yr,Gt,Wt,7);let Er=Number(Vt&BigInt(4294967295));Gt[Wt+7]=Er,Er=Er>>8,Gt[Wt+6]=Er,Er=Er>>8,Gt[Wt+5]=Er,Er=Er>>8,Gt[Wt+4]=Er;let Rr=Number(Vt>>BigInt(32)&BigInt(4294967295));return Gt[Wt+3]=Rr,Rr=Rr>>8,Gt[Wt+2]=Rr,Rr=Rr>>8,Gt[Wt+1]=Rr,Rr=Rr>>8,Gt[Wt]=Rr,Wt+8}ot.prototype.writeBigUInt64LE=Yt(function(Vt,Wt=0){return nr(this,Vt,Wt,BigInt(0),BigInt("0xffffffffffffffff"))}),ot.prototype.writeBigUInt64BE=Yt(function(Vt,Wt=0){return Zt(this,Vt,Wt,BigInt(0),BigInt("0xffffffffffffffff"))}),ot.prototype.writeIntLE=function(Vt,Wt,ar,yr){if(Vt=+Vt,Wt=Wt>>>0,!yr){const Hr=Math.pow(2,8*ar-1);ir(this,Vt,Wt,ar,Hr-1,-Hr)}let Er=0,Rr=1,Wr=0;for(this[Wt]=Vt&255;++Er>0)-Wr&255;return Wt+ar},ot.prototype.writeIntBE=function(Vt,Wt,ar,yr){if(Vt=+Vt,Wt=Wt>>>0,!yr){const Hr=Math.pow(2,8*ar-1);ir(this,Vt,Wt,ar,Hr-1,-Hr)}let Er=ar-1,Rr=1,Wr=0;for(this[Wt+Er]=Vt&255;--Er>=0&&(Rr*=256);)Vt<0&&Wr===0&&this[Wt+Er+1]!==0&&(Wr=1),this[Wt+Er]=(Vt/Rr>>0)-Wr&255;return Wt+ar},ot.prototype.writeInt8=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,1,127,-128),Vt<0&&(Vt=255+Vt+1),this[Wt]=Vt&255,Wt+1},ot.prototype.writeInt16LE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,2,32767,-32768),this[Wt]=Vt&255,this[Wt+1]=Vt>>>8,Wt+2},ot.prototype.writeInt16BE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,2,32767,-32768),this[Wt]=Vt>>>8,this[Wt+1]=Vt&255,Wt+2},ot.prototype.writeInt32LE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,4,2147483647,-2147483648),this[Wt]=Vt&255,this[Wt+1]=Vt>>>8,this[Wt+2]=Vt>>>16,this[Wt+3]=Vt>>>24,Wt+4},ot.prototype.writeInt32BE=function(Vt,Wt,ar){return Vt=+Vt,Wt=Wt>>>0,ar||ir(this,Vt,Wt,4,2147483647,-2147483648),Vt<0&&(Vt=4294967295+Vt+1),this[Wt]=Vt>>>24,this[Wt+1]=Vt>>>16,this[Wt+2]=Vt>>>8,this[Wt+3]=Vt&255,Wt+4},ot.prototype.writeBigInt64LE=Yt(function(Vt,Wt=0){return nr(this,Vt,Wt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ot.prototype.writeBigInt64BE=Yt(function(Vt,Wt=0){return Zt(this,Vt,Wt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Kt(Gt,Vt,Wt,ar,yr,Er){if(Wt+ar>Gt.length)throw new RangeError("Index out of range");if(Wt<0)throw new RangeError("Index out of range")}function Qt(Gt,Vt,Wt,ar,yr){return Vt=+Vt,Wt=Wt>>>0,yr||Kt(Gt,Vt,Wt,4),$.write(Gt,Vt,Wt,ar,23,4),Wt+4}ot.prototype.writeFloatLE=function(Vt,Wt,ar){return Qt(this,Vt,Wt,!0,ar)},ot.prototype.writeFloatBE=function(Vt,Wt,ar){return Qt(this,Vt,Wt,!1,ar)};function Ht(Gt,Vt,Wt,ar,yr){return Vt=+Vt,Wt=Wt>>>0,yr||Kt(Gt,Vt,Wt,8),$.write(Gt,Vt,Wt,ar,52,8),Wt+8}ot.prototype.writeDoubleLE=function(Vt,Wt,ar){return Ht(this,Vt,Wt,!0,ar)},ot.prototype.writeDoubleBE=function(Vt,Wt,ar){return Ht(this,Vt,Wt,!1,ar)},ot.prototype.copy=function(Vt,Wt,ar,yr){if(!ot.isBuffer(Vt))throw new TypeError("argument should be a Buffer");if(ar||(ar=0),!yr&&yr!==0&&(yr=this.length),Wt>=Vt.length&&(Wt=Vt.length),Wt||(Wt=0),yr>0&&yr=this.length)throw new RangeError("Index out of range");if(yr<0)throw new RangeError("sourceEnd out of bounds");yr>this.length&&(yr=this.length),Vt.length-Wt>>0,ar=ar===void 0?this.length:ar>>>0,Vt||(Vt=0);let Er;if(typeof Vt=="number")for(Er=Wt;Er2**32?yr=ur(String(Wt)):typeof Wt=="bigint"&&(yr=String(Wt),(Wt>BigInt(2)**BigInt(32)||Wt<-(BigInt(2)**BigInt(32)))&&(yr=ur(yr)),yr+="n"),ar+=` It must be ${Vt}. Received ${yr}`,ar},RangeError);function ur(Gt){let Vt="",Wt=Gt.length;const ar=Gt[0]==="-"?1:0;for(;Wt>=ar+4;Wt-=3)Vt=`_${Gt.slice(Wt-3,Wt)}${Vt}`;return`${Gt.slice(0,Wt)}${Vt}`}function xr(Gt,Vt,Wt){Cr(Vt,"offset"),(Gt[Vt]===void 0||Gt[Vt+Wt]===void 0)&&Mr(Vt,Gt.length-(Wt+1))}function pr(Gt,Vt,Wt,ar,yr,Er){if(Gt>Wt||Gt= 0${Rr} and < 2${Rr} ** ${(Er+1)*8}${Rr}`:Wr=`>= -(2${Rr} ** ${(Er+1)*8-1}${Rr}) and < 2 ** ${(Er+1)*8-1}${Rr}`,new qt.ERR_OUT_OF_RANGE("value",Wr,Gt)}xr(ar,yr,Er)}function Cr(Gt,Vt){if(typeof Gt!="number")throw new qt.ERR_INVALID_ARG_TYPE(Vt,"number",Gt)}function Mr(Gt,Vt,Wt){throw Math.floor(Gt)!==Gt?(Cr(Gt,Wt),new qt.ERR_OUT_OF_RANGE("offset","an integer",Gt)):Vt<0?new qt.ERR_BUFFER_OUT_OF_BOUNDS:new qt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Vt}`,Gt)}const lr=/[^+/0-9A-Za-z-_]/g;function fr(Gt){if(Gt=Gt.split("=")[0],Gt=Gt.trim().replace(lr,""),Gt.length<2)return"";for(;Gt.length%4!==0;)Gt=Gt+"=";return Gt}function _r(Gt,Vt){Vt=Vt||1/0;let Wt;const ar=Gt.length;let yr=null;const Er=[];for(let Rr=0;Rr55295&&Wt<57344){if(!yr){if(Wt>56319){(Vt-=3)>-1&&Er.push(239,191,189);continue}else if(Rr+1===ar){(Vt-=3)>-1&&Er.push(239,191,189);continue}yr=Wt;continue}if(Wt<56320){(Vt-=3)>-1&&Er.push(239,191,189),yr=Wt;continue}Wt=(yr-55296<<10|Wt-56320)+65536}else yr&&(Vt-=3)>-1&&Er.push(239,191,189);if(yr=null,Wt<128){if((Vt-=1)<0)break;Er.push(Wt)}else if(Wt<2048){if((Vt-=2)<0)break;Er.push(Wt>>6|192,Wt&63|128)}else if(Wt<65536){if((Vt-=3)<0)break;Er.push(Wt>>12|224,Wt>>6&63|128,Wt&63|128)}else if(Wt<1114112){if((Vt-=4)<0)break;Er.push(Wt>>18|240,Wt>>12&63|128,Wt>>6&63|128,Wt&63|128)}else throw new Error("Invalid code point")}return Er}function Sr(Gt){const Vt=[];for(let Wt=0;Wt>8,yr=Wt%256,Er.push(yr),Er.push(ar);return Er}function Ar(Gt){return _.toByteArray(fr(Gt))}function $r(Gt,Vt,Wt,ar){let yr;for(yr=0;yr=Vt.length||yr>=Gt.length);++yr)Vt[yr+Wt]=Gt[yr];return yr}function Or(Gt,Vt){return Gt instanceof Vt||Gt!=null&&Gt.constructor!=null&&Gt.constructor.name!=null&&Gt.constructor.name===Vt.name}function Br(Gt){return Gt!==Gt}const or=function(){const Gt="0123456789abcdef",Vt=new Array(256);for(let Wt=0;Wt<16;++Wt){const ar=Wt*16;for(let yr=0;yr<16;++yr)Vt[ar+yr]=Gt[Wt]+Gt[yr]}return Vt}();function Yt(Gt){return typeof BigInt>"u"?er:Gt}function er(){throw new Error("BigInt not supported")}})(buffer$2);const Buffer$g=buffer$2.Buffer;var inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(_,$){$&&(_.super_=$,_.prototype=Object.create($.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(_,$){if($){_.super_=$;var j=function(){};j.prototype=$.prototype,_.prototype=new j,_.prototype.constructor=_}};var inherits_browserExports=inherits_browser.exports,safeBuffer$2={exports:{}},buffer$1={},base64Js={};base64Js.byteLength=byteLength$1;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup$2=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$1=0,len=code.length;i$10)throw new Error("Invalid string. Length must be a multiple of 4");var $=a.indexOf("=");$===-1&&($=_);var j=$===_?0:4-$%4;return[$,j]}function byteLength$1(a){var _=getLens(a),$=_[0],j=_[1];return($+j)*3/4-j}function _byteLength(a,_,$){return(_+$)*3/4-$}function toByteArray(a){var _,$=getLens(a),j=$[0],et=$[1],tt=new Arr(_byteLength(a,j,et)),rt=0,nt=et>0?j-4:j,it;for(it=0;it>16&255,tt[rt++]=_>>8&255,tt[rt++]=_&255;return et===2&&(_=revLookup[a.charCodeAt(it)]<<2|revLookup[a.charCodeAt(it+1)]>>4,tt[rt++]=_&255),et===1&&(_=revLookup[a.charCodeAt(it)]<<10|revLookup[a.charCodeAt(it+1)]<<4|revLookup[a.charCodeAt(it+2)]>>2,tt[rt++]=_>>8&255,tt[rt++]=_&255),tt}function tripletToBase64(a){return lookup$2[a>>18&63]+lookup$2[a>>12&63]+lookup$2[a>>6&63]+lookup$2[a&63]}function encodeChunk(a,_,$){for(var j,et=[],tt=_;tt<$;tt+=3)j=(a[tt]<<16&16711680)+(a[tt+1]<<8&65280)+(a[tt+2]&255),et.push(tripletToBase64(j));return et.join("")}function fromByteArray(a){for(var _,$=a.length,j=$%3,et=[],tt=16383,rt=0,nt=$-j;rtnt?nt:rt+tt));return j===1?(_=a[$-1],et.push(lookup$2[_>>2]+lookup$2[_<<4&63]+"==")):j===2&&(_=(a[$-2]<<8)+a[$-1],et.push(lookup$2[_>>10]+lookup$2[_>>4&63]+lookup$2[_<<2&63]+"=")),et.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754.read=function(a,_,$,j,et){var tt,rt,nt=et*8-j-1,it=(1<>1,ot=-7,at=$?et-1:0,ut=$?-1:1,ht=a[_+at];for(at+=ut,tt=ht&(1<<-ot)-1,ht>>=-ot,ot+=nt;ot>0;tt=tt*256+a[_+at],at+=ut,ot-=8);for(rt=tt&(1<<-ot)-1,tt>>=-ot,ot+=j;ot>0;rt=rt*256+a[_+at],at+=ut,ot-=8);if(tt===0)tt=1-st;else{if(tt===it)return rt?NaN:(ht?-1:1)*(1/0);rt=rt+Math.pow(2,j),tt=tt-st}return(ht?-1:1)*rt*Math.pow(2,tt-j)};ieee754.write=function(a,_,$,j,et,tt){var rt,nt,it,st=tt*8-et-1,ot=(1<>1,ut=et===23?Math.pow(2,-24)-Math.pow(2,-77):0,ht=j?0:tt-1,yt=j?1:-1,wt=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(nt=isNaN(_)?1:0,rt=ot):(rt=Math.floor(Math.log(_)/Math.LN2),_*(it=Math.pow(2,-rt))<1&&(rt--,it*=2),rt+at>=1?_+=ut/it:_+=ut*Math.pow(2,1-at),_*it>=2&&(rt++,it/=2),rt+at>=ot?(nt=0,rt=ot):rt+at>=1?(nt=(_*it-1)*Math.pow(2,et),rt=rt+at):(nt=_*Math.pow(2,at-1)*Math.pow(2,et),rt=0));et>=8;a[$+ht]=nt&255,ht+=yt,nt/=256,et-=8);for(rt=rt<0;a[$+ht]=rt&255,ht+=yt,rt/=256,st-=8);a[$+ht-yt]|=wt*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */(function(a){const _=base64Js,$=ieee754,j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=nt,a.SlowBuffer=$t,a.INSPECT_MAX_BYTES=50;const et=2147483647;a.kMaxLength=et,nt.TYPED_ARRAY_SUPPORT=tt(),!nt.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function tt(){try{const or=new Uint8Array(1),Yt={foo:function(){return 42}};return Object.setPrototypeOf(Yt,Uint8Array.prototype),Object.setPrototypeOf(or,Yt),or.foo()===42}catch{return!1}}Object.defineProperty(nt.prototype,"parent",{enumerable:!0,get:function(){if(nt.isBuffer(this))return this.buffer}}),Object.defineProperty(nt.prototype,"offset",{enumerable:!0,get:function(){if(nt.isBuffer(this))return this.byteOffset}});function rt(or){if(or>et)throw new RangeError('The value "'+or+'" is invalid for option "size"');const Yt=new Uint8Array(or);return Object.setPrototypeOf(Yt,nt.prototype),Yt}function nt(or,Yt,er){if(typeof or=="number"){if(typeof Yt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return at(or)}return it(or,Yt,er)}nt.poolSize=8192;function it(or,Yt,er){if(typeof or=="string")return ut(or,Yt);if(ArrayBuffer.isView(or))return yt(or);if(or==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof or);if(kr(or,ArrayBuffer)||or&&kr(or.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(kr(or,SharedArrayBuffer)||or&&kr(or.buffer,SharedArrayBuffer)))return wt(or,Yt,er);if(typeof or=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Gt=or.valueOf&&or.valueOf();if(Gt!=null&&Gt!==or)return nt.from(Gt,Yt,er);const Vt=Ct(or);if(Vt)return Vt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof or[Symbol.toPrimitive]=="function")return nt.from(or[Symbol.toPrimitive]("string"),Yt,er);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof or)}nt.from=function(or,Yt,er){return it(or,Yt,er)},Object.setPrototypeOf(nt.prototype,Uint8Array.prototype),Object.setPrototypeOf(nt,Uint8Array);function st(or){if(typeof or!="number")throw new TypeError('"size" argument must be of type number');if(or<0)throw new RangeError('The value "'+or+'" is invalid for option "size"')}function ot(or,Yt,er){return st(or),or<=0?rt(or):Yt!==void 0?typeof er=="string"?rt(or).fill(Yt,er):rt(or).fill(Yt):rt(or)}nt.alloc=function(or,Yt,er){return ot(or,Yt,er)};function at(or){return st(or),rt(or<0?0:Pt(or)|0)}nt.allocUnsafe=function(or){return at(or)},nt.allocUnsafeSlow=function(or){return at(or)};function ut(or,Yt){if((typeof Yt!="string"||Yt==="")&&(Yt="utf8"),!nt.isEncoding(Yt))throw new TypeError("Unknown encoding: "+Yt);const er=Mt(or,Yt)|0;let Gt=rt(er);const Vt=Gt.write(or,Yt);return Vt!==er&&(Gt=Gt.slice(0,Vt)),Gt}function ht(or){const Yt=or.length<0?0:Pt(or.length)|0,er=rt(Yt);for(let Gt=0;Gt=et)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+et.toString(16)+" bytes");return or|0}function $t(or){return+or!=or&&(or=0),nt.alloc(+or)}nt.isBuffer=function(Yt){return Yt!=null&&Yt._isBuffer===!0&&Yt!==nt.prototype},nt.compare=function(Yt,er){if(kr(Yt,Uint8Array)&&(Yt=nt.from(Yt,Yt.offset,Yt.byteLength)),kr(er,Uint8Array)&&(er=nt.from(er,er.offset,er.byteLength)),!nt.isBuffer(Yt)||!nt.isBuffer(er))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Yt===er)return 0;let Gt=Yt.length,Vt=er.length;for(let Wt=0,ar=Math.min(Gt,Vt);WtVt.length?(nt.isBuffer(ar)||(ar=nt.from(ar)),ar.copy(Vt,Wt)):Uint8Array.prototype.set.call(Vt,ar,Wt);else if(nt.isBuffer(ar))ar.copy(Vt,Wt);else throw new TypeError('"list" argument must be an Array of Buffers');Wt+=ar.length}return Vt};function Mt(or,Yt){if(nt.isBuffer(or))return or.length;if(ArrayBuffer.isView(or)||kr(or,ArrayBuffer))return or.byteLength;if(typeof or!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof or);const er=or.length,Gt=arguments.length>2&&arguments[2]===!0;if(!Gt&&er===0)return 0;let Vt=!1;for(;;)switch(Yt){case"ascii":case"latin1":case"binary":return er;case"utf8":case"utf-8":return Mr(or).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return er*2;case"hex":return er>>>1;case"base64":return _r(or).length;default:if(Vt)return Gt?-1:Mr(or).length;Yt=(""+Yt).toLowerCase(),Vt=!0}}nt.byteLength=Mt;function Bt(or,Yt,er){let Gt=!1;if((Yt===void 0||Yt<0)&&(Yt=0),Yt>this.length||((er===void 0||er>this.length)&&(er=this.length),er<=0)||(er>>>=0,Yt>>>=0,er<=Yt))return"";for(or||(or="utf8");;)switch(or){case"hex":return Rt(this,Yt,er);case"utf8":case"utf-8":return ct(this,Yt,er);case"ascii":return xt(this,Yt,er);case"latin1":case"binary":return At(this,Yt,er);case"base64":return vt(this,Yt,er);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St(this,Yt,er);default:if(Gt)throw new TypeError("Unknown encoding: "+or);or=(or+"").toLowerCase(),Gt=!0}}nt.prototype._isBuffer=!0;function Dt(or,Yt,er){const Gt=or[Yt];or[Yt]=or[er],or[er]=Gt}nt.prototype.swap16=function(){const Yt=this.length;if(Yt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let er=0;erer&&(Yt+=" ... "),""},j&&(nt.prototype[j]=nt.prototype.inspect),nt.prototype.compare=function(Yt,er,Gt,Vt,Wt){if(kr(Yt,Uint8Array)&&(Yt=nt.from(Yt,Yt.offset,Yt.byteLength)),!nt.isBuffer(Yt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Yt);if(er===void 0&&(er=0),Gt===void 0&&(Gt=Yt?Yt.length:0),Vt===void 0&&(Vt=0),Wt===void 0&&(Wt=this.length),er<0||Gt>Yt.length||Vt<0||Wt>this.length)throw new RangeError("out of range index");if(Vt>=Wt&&er>=Gt)return 0;if(Vt>=Wt)return-1;if(er>=Gt)return 1;if(er>>>=0,Gt>>>=0,Vt>>>=0,Wt>>>=0,this===Yt)return 0;let ar=Wt-Vt,yr=Gt-er;const Er=Math.min(ar,yr),Sr=this.slice(Vt,Wt),Wr=Yt.slice(er,Gt);for(let Hr=0;Hr2147483647?er=2147483647:er<-2147483648&&(er=-2147483648),er=+er,Ar(er)&&(er=Vt?0:or.length-1),er<0&&(er=or.length+er),er>=or.length){if(Vt)return-1;er=or.length-1}else if(er<0)if(Vt)er=0;else return-1;if(typeof Yt=="string"&&(Yt=nt.from(Yt,Gt)),nt.isBuffer(Yt))return Yt.length===0?-1:Ot(or,Yt,er,Gt,Vt);if(typeof Yt=="number")return Yt=Yt&255,typeof Uint8Array.prototype.indexOf=="function"?Vt?Uint8Array.prototype.indexOf.call(or,Yt,er):Uint8Array.prototype.lastIndexOf.call(or,Yt,er):Ot(or,[Yt],er,Gt,Vt);throw new TypeError("val must be string, number or Buffer")}function Ot(or,Yt,er,Gt,Vt){let Wt=1,ar=or.length,yr=Yt.length;if(Gt!==void 0&&(Gt=String(Gt).toLowerCase(),Gt==="ucs2"||Gt==="ucs-2"||Gt==="utf16le"||Gt==="utf-16le")){if(or.length<2||Yt.length<2)return-1;Wt=2,ar/=2,yr/=2,er/=2}function Er(Wr,Hr){return Wt===1?Wr[Hr]:Wr.readUInt16BE(Hr*Wt)}let Sr;if(Vt){let Wr=-1;for(Sr=er;Srar&&(er=ar-yr),Sr=er;Sr>=0;Sr--){let Wr=!0;for(let Hr=0;HrVt&&(Gt=Vt)):Gt=Vt;const Wt=Yt.length;Gt>Wt/2&&(Gt=Wt/2);let ar;for(ar=0;ar>>0,isFinite(Gt)?(Gt=Gt>>>0,Vt===void 0&&(Vt="utf8")):(Vt=Gt,Gt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Wt=this.length-er;if((Gt===void 0||Gt>Wt)&&(Gt=Wt),Yt.length>0&&(Gt<0||er<0)||er>this.length)throw new RangeError("Attempt to write outside buffer bounds");Vt||(Vt="utf8");let ar=!1;for(;;)switch(Vt){case"hex":return It(this,Yt,er,Gt);case"utf8":case"utf-8":return Lt(this,Yt,er,Gt);case"ascii":case"latin1":case"binary":return Ft(this,Yt,er,Gt);case"base64":return jt(this,Yt,er,Gt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bt(this,Yt,er,Gt);default:if(ar)throw new TypeError("Unknown encoding: "+Vt);Vt=(""+Vt).toLowerCase(),ar=!0}},nt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function vt(or,Yt,er){return Yt===0&&er===or.length?_.fromByteArray(or):_.fromByteArray(or.slice(Yt,er))}function ct(or,Yt,er){er=Math.min(or.length,er);const Gt=[];let Vt=Yt;for(;Vt239?4:Wt>223?3:Wt>191?2:1;if(Vt+yr<=er){let Er,Sr,Wr,Hr;switch(yr){case 1:Wt<128&&(ar=Wt);break;case 2:Er=or[Vt+1],(Er&192)===128&&(Hr=(Wt&31)<<6|Er&63,Hr>127&&(ar=Hr));break;case 3:Er=or[Vt+1],Sr=or[Vt+2],(Er&192)===128&&(Sr&192)===128&&(Hr=(Wt&15)<<12|(Er&63)<<6|Sr&63,Hr>2047&&(Hr<55296||Hr>57343)&&(ar=Hr));break;case 4:Er=or[Vt+1],Sr=or[Vt+2],Wr=or[Vt+3],(Er&192)===128&&(Sr&192)===128&&(Wr&192)===128&&(Hr=(Wt&15)<<18|(Er&63)<<12|(Sr&63)<<6|Wr&63,Hr>65535&&Hr<1114112&&(ar=Hr))}}ar===null?(ar=65533,yr=1):ar>65535&&(ar-=65536,Gt.push(ar>>>10&1023|55296),ar=56320|ar&1023),Gt.push(ar),Vt+=yr}return mt(Gt)}const dt=4096;function mt(or){const Yt=or.length;if(Yt<=dt)return String.fromCharCode.apply(String,or);let er="",Gt=0;for(;GtGt)&&(er=Gt);let Vt="";for(let Wt=Yt;WtGt&&(Yt=Gt),er<0?(er+=Gt,er<0&&(er=0)):er>Gt&&(er=Gt),erer)throw new RangeError("Trying to access beyond buffer length")}nt.prototype.readUintLE=nt.prototype.readUIntLE=function(Yt,er,Gt){Yt=Yt>>>0,er=er>>>0,Gt||Tt(Yt,er,this.length);let Vt=this[Yt],Wt=1,ar=0;for(;++ar>>0,er=er>>>0,Gt||Tt(Yt,er,this.length);let Vt=this[Yt+--er],Wt=1;for(;er>0&&(Wt*=256);)Vt+=this[Yt+--er]*Wt;return Vt},nt.prototype.readUint8=nt.prototype.readUInt8=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,1,this.length),this[Yt]},nt.prototype.readUint16LE=nt.prototype.readUInt16LE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,2,this.length),this[Yt]|this[Yt+1]<<8},nt.prototype.readUint16BE=nt.prototype.readUInt16BE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,2,this.length),this[Yt]<<8|this[Yt+1]},nt.prototype.readUint32LE=nt.prototype.readUInt32LE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),(this[Yt]|this[Yt+1]<<8|this[Yt+2]<<16)+this[Yt+3]*16777216},nt.prototype.readUint32BE=nt.prototype.readUInt32BE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),this[Yt]*16777216+(this[Yt+1]<<16|this[Yt+2]<<8|this[Yt+3])},nt.prototype.readBigUInt64LE=Or(function(Yt){Yt=Yt>>>0,ur(Yt,"offset");const er=this[Yt],Gt=this[Yt+7];(er===void 0||Gt===void 0)&&xr(Yt,this.length-8);const Vt=er+this[++Yt]*2**8+this[++Yt]*2**16+this[++Yt]*2**24,Wt=this[++Yt]+this[++Yt]*2**8+this[++Yt]*2**16+Gt*2**24;return BigInt(Vt)+(BigInt(Wt)<>>0,ur(Yt,"offset");const er=this[Yt],Gt=this[Yt+7];(er===void 0||Gt===void 0)&&xr(Yt,this.length-8);const Vt=er*2**24+this[++Yt]*2**16+this[++Yt]*2**8+this[++Yt],Wt=this[++Yt]*2**24+this[++Yt]*2**16+this[++Yt]*2**8+Gt;return(BigInt(Vt)<>>0,er=er>>>0,Gt||Tt(Yt,er,this.length);let Vt=this[Yt],Wt=1,ar=0;for(;++ar=Wt&&(Vt-=Math.pow(2,8*er)),Vt},nt.prototype.readIntBE=function(Yt,er,Gt){Yt=Yt>>>0,er=er>>>0,Gt||Tt(Yt,er,this.length);let Vt=er,Wt=1,ar=this[Yt+--Vt];for(;Vt>0&&(Wt*=256);)ar+=this[Yt+--Vt]*Wt;return Wt*=128,ar>=Wt&&(ar-=Math.pow(2,8*er)),ar},nt.prototype.readInt8=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,1,this.length),this[Yt]&128?(255-this[Yt]+1)*-1:this[Yt]},nt.prototype.readInt16LE=function(Yt,er){Yt=Yt>>>0,er||Tt(Yt,2,this.length);const Gt=this[Yt]|this[Yt+1]<<8;return Gt&32768?Gt|4294901760:Gt},nt.prototype.readInt16BE=function(Yt,er){Yt=Yt>>>0,er||Tt(Yt,2,this.length);const Gt=this[Yt+1]|this[Yt]<<8;return Gt&32768?Gt|4294901760:Gt},nt.prototype.readInt32LE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),this[Yt]|this[Yt+1]<<8|this[Yt+2]<<16|this[Yt+3]<<24},nt.prototype.readInt32BE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),this[Yt]<<24|this[Yt+1]<<16|this[Yt+2]<<8|this[Yt+3]},nt.prototype.readBigInt64LE=Or(function(Yt){Yt=Yt>>>0,ur(Yt,"offset");const er=this[Yt],Gt=this[Yt+7];(er===void 0||Gt===void 0)&&xr(Yt,this.length-8);const Vt=this[Yt+4]+this[Yt+5]*2**8+this[Yt+6]*2**16+(Gt<<24);return(BigInt(Vt)<>>0,ur(Yt,"offset");const er=this[Yt],Gt=this[Yt+7];(er===void 0||Gt===void 0)&&xr(Yt,this.length-8);const Vt=(er<<24)+this[++Yt]*2**16+this[++Yt]*2**8+this[++Yt];return(BigInt(Vt)<>>0,er||Tt(Yt,4,this.length),$.read(this,Yt,!0,23,4)},nt.prototype.readFloatBE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),$.read(this,Yt,!1,23,4)},nt.prototype.readDoubleLE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,8,this.length),$.read(this,Yt,!0,52,8)},nt.prototype.readDoubleBE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,8,this.length),$.read(this,Yt,!1,52,8)};function Et(or,Yt,er,Gt,Vt,Wt){if(!nt.isBuffer(or))throw new TypeError('"buffer" argument must be a Buffer instance');if(Yt>Vt||Ytor.length)throw new RangeError("Index out of range")}nt.prototype.writeUintLE=nt.prototype.writeUIntLE=function(Yt,er,Gt,Vt){if(Yt=+Yt,er=er>>>0,Gt=Gt>>>0,!Vt){const yr=Math.pow(2,8*Gt)-1;Et(this,Yt,er,Gt,yr,0)}let Wt=1,ar=0;for(this[er]=Yt&255;++ar>>0,Gt=Gt>>>0,!Vt){const yr=Math.pow(2,8*Gt)-1;Et(this,Yt,er,Gt,yr,0)}let Wt=Gt-1,ar=1;for(this[er+Wt]=Yt&255;--Wt>=0&&(ar*=256);)this[er+Wt]=Yt/ar&255;return er+Gt},nt.prototype.writeUint8=nt.prototype.writeUInt8=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,1,255,0),this[er]=Yt&255,er+1},nt.prototype.writeUint16LE=nt.prototype.writeUInt16LE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,2,65535,0),this[er]=Yt&255,this[er+1]=Yt>>>8,er+2},nt.prototype.writeUint16BE=nt.prototype.writeUInt16BE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,2,65535,0),this[er]=Yt>>>8,this[er+1]=Yt&255,er+2},nt.prototype.writeUint32LE=nt.prototype.writeUInt32LE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,4,4294967295,0),this[er+3]=Yt>>>24,this[er+2]=Yt>>>16,this[er+1]=Yt>>>8,this[er]=Yt&255,er+4},nt.prototype.writeUint32BE=nt.prototype.writeUInt32BE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,4,4294967295,0),this[er]=Yt>>>24,this[er+1]=Yt>>>16,this[er+2]=Yt>>>8,this[er+3]=Yt&255,er+4};function Nt(or,Yt,er,Gt,Vt){Jt(Yt,Gt,Vt,or,er,7);let Wt=Number(Yt&BigInt(4294967295));or[er++]=Wt,Wt=Wt>>8,or[er++]=Wt,Wt=Wt>>8,or[er++]=Wt,Wt=Wt>>8,or[er++]=Wt;let ar=Number(Yt>>BigInt(32)&BigInt(4294967295));return or[er++]=ar,ar=ar>>8,or[er++]=ar,ar=ar>>8,or[er++]=ar,ar=ar>>8,or[er++]=ar,er}function tr(or,Yt,er,Gt,Vt){Jt(Yt,Gt,Vt,or,er,7);let Wt=Number(Yt&BigInt(4294967295));or[er+7]=Wt,Wt=Wt>>8,or[er+6]=Wt,Wt=Wt>>8,or[er+5]=Wt,Wt=Wt>>8,or[er+4]=Wt;let ar=Number(Yt>>BigInt(32)&BigInt(4294967295));return or[er+3]=ar,ar=ar>>8,or[er+2]=ar,ar=ar>>8,or[er+1]=ar,ar=ar>>8,or[er]=ar,er+8}nt.prototype.writeBigUInt64LE=Or(function(Yt,er=0){return Nt(this,Yt,er,BigInt(0),BigInt("0xffffffffffffffff"))}),nt.prototype.writeBigUInt64BE=Or(function(Yt,er=0){return tr(this,Yt,er,BigInt(0),BigInt("0xffffffffffffffff"))}),nt.prototype.writeIntLE=function(Yt,er,Gt,Vt){if(Yt=+Yt,er=er>>>0,!Vt){const Er=Math.pow(2,8*Gt-1);Et(this,Yt,er,Gt,Er-1,-Er)}let Wt=0,ar=1,yr=0;for(this[er]=Yt&255;++Wt>0)-yr&255;return er+Gt},nt.prototype.writeIntBE=function(Yt,er,Gt,Vt){if(Yt=+Yt,er=er>>>0,!Vt){const Er=Math.pow(2,8*Gt-1);Et(this,Yt,er,Gt,Er-1,-Er)}let Wt=Gt-1,ar=1,yr=0;for(this[er+Wt]=Yt&255;--Wt>=0&&(ar*=256);)Yt<0&&yr===0&&this[er+Wt+1]!==0&&(yr=1),this[er+Wt]=(Yt/ar>>0)-yr&255;return er+Gt},nt.prototype.writeInt8=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,1,127,-128),Yt<0&&(Yt=255+Yt+1),this[er]=Yt&255,er+1},nt.prototype.writeInt16LE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,2,32767,-32768),this[er]=Yt&255,this[er+1]=Yt>>>8,er+2},nt.prototype.writeInt16BE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,2,32767,-32768),this[er]=Yt>>>8,this[er+1]=Yt&255,er+2},nt.prototype.writeInt32LE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,4,2147483647,-2147483648),this[er]=Yt&255,this[er+1]=Yt>>>8,this[er+2]=Yt>>>16,this[er+3]=Yt>>>24,er+4},nt.prototype.writeInt32BE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,4,2147483647,-2147483648),Yt<0&&(Yt=4294967295+Yt+1),this[er]=Yt>>>24,this[er+1]=Yt>>>16,this[er+2]=Yt>>>8,this[er+3]=Yt&255,er+4},nt.prototype.writeBigInt64LE=Or(function(Yt,er=0){return Nt(this,Yt,er,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),nt.prototype.writeBigInt64BE=Or(function(Yt,er=0){return tr(this,Yt,er,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ir(or,Yt,er,Gt,Vt,Wt){if(er+Gt>or.length)throw new RangeError("Index out of range");if(er<0)throw new RangeError("Index out of range")}function nr(or,Yt,er,Gt,Vt){return Yt=+Yt,er=er>>>0,Vt||ir(or,Yt,er,4),$.write(or,Yt,er,Gt,23,4),er+4}nt.prototype.writeFloatLE=function(Yt,er,Gt){return nr(this,Yt,er,!0,Gt)},nt.prototype.writeFloatBE=function(Yt,er,Gt){return nr(this,Yt,er,!1,Gt)};function Zt(or,Yt,er,Gt,Vt){return Yt=+Yt,er=er>>>0,Vt||ir(or,Yt,er,8),$.write(or,Yt,er,Gt,52,8),er+8}nt.prototype.writeDoubleLE=function(Yt,er,Gt){return Zt(this,Yt,er,!0,Gt)},nt.prototype.writeDoubleBE=function(Yt,er,Gt){return Zt(this,Yt,er,!1,Gt)},nt.prototype.copy=function(Yt,er,Gt,Vt){if(!nt.isBuffer(Yt))throw new TypeError("argument should be a Buffer");if(Gt||(Gt=0),!Vt&&Vt!==0&&(Vt=this.length),er>=Yt.length&&(er=Yt.length),er||(er=0),Vt>0&&Vt=this.length)throw new RangeError("Index out of range");if(Vt<0)throw new RangeError("sourceEnd out of bounds");Vt>this.length&&(Vt=this.length),Yt.length-er>>0,Gt=Gt===void 0?this.length:Gt>>>0,Yt||(Yt=0);let Wt;if(typeof Yt=="number")for(Wt=er;Wt2**32?Vt=Ht(String(er)):typeof er=="bigint"&&(Vt=String(er),(er>BigInt(2)**BigInt(32)||er<-(BigInt(2)**BigInt(32)))&&(Vt=Ht(Vt)),Vt+="n"),Gt+=` It must be ${Yt}. Received ${Vt}`,Gt},RangeError);function Ht(or){let Yt="",er=or.length;const Gt=or[0]==="-"?1:0;for(;er>=Gt+4;er-=3)Yt=`_${or.slice(er-3,er)}${Yt}`;return`${or.slice(0,er)}${Yt}`}function qt(or,Yt,er){ur(Yt,"offset"),(or[Yt]===void 0||or[Yt+er]===void 0)&&xr(Yt,or.length-(er+1))}function Jt(or,Yt,er,Gt,Vt,Wt){if(or>er||or= 0${ar} and < 2${ar} ** ${(Wt+1)*8}${ar}`:yr=`>= -(2${ar} ** ${(Wt+1)*8-1}${ar}) and < 2 ** ${(Wt+1)*8-1}${ar}`,new Kt.ERR_OUT_OF_RANGE("value",yr,or)}qt(Gt,Vt,Wt)}function ur(or,Yt){if(typeof or!="number")throw new Kt.ERR_INVALID_ARG_TYPE(Yt,"number",or)}function xr(or,Yt,er){throw Math.floor(or)!==or?(ur(or,er),new Kt.ERR_OUT_OF_RANGE("offset","an integer",or)):Yt<0?new Kt.ERR_BUFFER_OUT_OF_BOUNDS:new Kt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Yt}`,or)}const pr=/[^+/0-9A-Za-z-_]/g;function Cr(or){if(or=or.split("=")[0],or=or.trim().replace(pr,""),or.length<2)return"";for(;or.length%4!==0;)or=or+"=";return or}function Mr(or,Yt){Yt=Yt||1/0;let er;const Gt=or.length;let Vt=null;const Wt=[];for(let ar=0;ar55295&&er<57344){if(!Vt){if(er>56319){(Yt-=3)>-1&&Wt.push(239,191,189);continue}else if(ar+1===Gt){(Yt-=3)>-1&&Wt.push(239,191,189);continue}Vt=er;continue}if(er<56320){(Yt-=3)>-1&&Wt.push(239,191,189),Vt=er;continue}er=(Vt-55296<<10|er-56320)+65536}else Vt&&(Yt-=3)>-1&&Wt.push(239,191,189);if(Vt=null,er<128){if((Yt-=1)<0)break;Wt.push(er)}else if(er<2048){if((Yt-=2)<0)break;Wt.push(er>>6|192,er&63|128)}else if(er<65536){if((Yt-=3)<0)break;Wt.push(er>>12|224,er>>6&63|128,er&63|128)}else if(er<1114112){if((Yt-=4)<0)break;Wt.push(er>>18|240,er>>12&63|128,er>>6&63|128,er&63|128)}else throw new Error("Invalid code point")}return Wt}function lr(or){const Yt=[];for(let er=0;er>8,Vt=er%256,Wt.push(Vt),Wt.push(Gt);return Wt}function _r(or){return _.toByteArray(Cr(or))}function Rr(or,Yt,er,Gt){let Vt;for(Vt=0;Vt=Yt.length||Vt>=or.length);++Vt)Yt[Vt+er]=or[Vt];return Vt}function kr(or,Yt){return or instanceof Yt||or!=null&&or.constructor!=null&&or.constructor.name!=null&&or.constructor.name===Yt.name}function Ar(or){return or!==or}const Pr=function(){const or="0123456789abcdef",Yt=new Array(256);for(let er=0;er<16;++er){const Gt=er*16;for(let Vt=0;Vt<16;++Vt)Yt[Gt+Vt]=or[er]+or[Vt]}return Yt}();function Or(or){return typeof BigInt>"u"?Br:or}function Br(){throw new Error("BigInt not supported")}})(buffer$1);/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(a,_){var $=buffer$1,j=$.Buffer;function et(rt,nt){for(var it in rt)nt[it]=rt[it]}j.from&&j.alloc&&j.allocUnsafe&&j.allocUnsafeSlow?a.exports=$:(et($,_),_.Buffer=tt);function tt(rt,nt,it){return j(rt,nt,it)}tt.prototype=Object.create(j.prototype),et(j,tt),tt.from=function(rt,nt,it){if(typeof rt=="number")throw new TypeError("Argument must not be a number");return j(rt,nt,it)},tt.alloc=function(rt,nt,it){if(typeof rt!="number")throw new TypeError("Argument must be a number");var st=j(rt);return nt!==void 0?typeof it=="string"?st.fill(nt,it):st.fill(nt):st.fill(0),st},tt.allocUnsafe=function(rt){if(typeof rt!="number")throw new TypeError("Argument must be a number");return j(rt)},tt.allocUnsafeSlow=function(rt){if(typeof rt!="number")throw new TypeError("Argument must be a number");return $.SlowBuffer(rt)}})(safeBuffer$2,safeBuffer$2.exports);var safeBufferExports=safeBuffer$2.exports,readableBrowser$1={exports:{}};function getDefaultExportFromCjs(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var browser$d={exports:{}},process$1=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(a){if(cachedSetTimeout===setTimeout)return setTimeout(a,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(a,0);try{return cachedSetTimeout(a,0)}catch{try{return cachedSetTimeout.call(null,a,0)}catch{return cachedSetTimeout.call(this,a,0)}}}function runClearTimeout(a){if(cachedClearTimeout===clearTimeout)return clearTimeout(a);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(a);try{return cachedClearTimeout(a)}catch{try{return cachedClearTimeout.call(null,a)}catch{return cachedClearTimeout.call(this,a)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var a=runTimeout(cleanUpNextTick);draining=!0;for(var _=queue.length;_;){for(currentQueue=queue,queue=[];++queueIndex<_;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,_=queue.length}currentQueue=null,draining=!1,runClearTimeout(a)}}process$1.nextTick=function(a){var _=new Array(arguments.length-1);if(arguments.length>1)for(var $=1;$0&&(rt=$[0]),rt instanceof Error)throw rt;var nt=new Error("Unhandled error."+(rt?" ("+rt.message+")":""));throw nt.context=rt,nt}var it=tt[_];if(it===void 0)return!1;if(typeof it=="function")ReflectApply(it,this,$);else for(var st=it.length,ot=arrayClone(it,st),j=0;j0&&rt.length>et&&!rt.warned){rt.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+rt.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=a,nt.type=_,nt.count=rt.length,ProcessEmitWarning(nt)}return a}EventEmitter$1.prototype.addListener=function(_,$){return _addListener(this,_,$,!1)};EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener;EventEmitter$1.prototype.prependListener=function(_,$){return _addListener(this,_,$,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(a,_,$){var j={fired:!1,wrapFn:void 0,target:a,type:_,listener:$},et=onceWrapper.bind(j);return et.listener=$,j.wrapFn=et,et}EventEmitter$1.prototype.once=function(_,$){return checkListener($),this.on(_,_onceWrap(this,_,$)),this};EventEmitter$1.prototype.prependOnceListener=function(_,$){return checkListener($),this.prependListener(_,_onceWrap(this,_,$)),this};EventEmitter$1.prototype.removeListener=function(_,$){var j,et,tt,rt,nt;if(checkListener($),et=this._events,et===void 0)return this;if(j=et[_],j===void 0)return this;if(j===$||j.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete et[_],et.removeListener&&this.emit("removeListener",_,j.listener||$));else if(typeof j!="function"){for(tt=-1,rt=j.length-1;rt>=0;rt--)if(j[rt]===$||j[rt].listener===$){nt=j[rt].listener,tt=rt;break}if(tt<0)return this;tt===0?j.shift():spliceOne(j,tt),j.length===1&&(et[_]=j[0]),et.removeListener!==void 0&&this.emit("removeListener",_,nt||$)}return this};EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener;EventEmitter$1.prototype.removeAllListeners=function(_){var $,j,et;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[_]),this;if(arguments.length===0){var tt=Object.keys(j),rt;for(et=0;et=0;et--)this.removeListener(_,$[et]);return this};function _listeners(a,_,$){var j=a._events;if(j===void 0)return[];var et=j[_];return et===void 0?[]:typeof et=="function"?$?[et.listener||et]:[et]:$?unwrapListeners(et):arrayClone(et,et.length)}EventEmitter$1.prototype.listeners=function(_){return _listeners(this,_,!0)};EventEmitter$1.prototype.rawListeners=function(_){return _listeners(this,_,!1)};EventEmitter$1.listenerCount=function(a,_){return typeof a.listenerCount=="function"?a.listenerCount(_):listenerCount.call(a,_)};EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(a){var _=this._events;if(_!==void 0){var $=_[a];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(a,_){for(var $=new Array(_),j=0;j<_;++j)$[j]=a[j];return $}function spliceOne(a,_){for(;_+1"u"||!getProto$2?undefined$2:getProto$2(Uint8Array),INTRINSICS$1={"%AggregateError%":typeof AggregateError>"u"?undefined$2:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$2:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols$1&&getProto$2?getProto$2([][Symbol.iterator]()):undefined$2,"%AsyncFromSyncIteratorPrototype%":undefined$2,"%AsyncFunction%":needsEval$1,"%AsyncGenerator%":needsEval$1,"%AsyncGeneratorFunction%":needsEval$1,"%AsyncIteratorPrototype%":needsEval$1,"%Atomics%":typeof Atomics>"u"?undefined$2:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$2:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$2:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$2:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$2:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$2:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$2:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$2:FinalizationRegistry,"%Function%":$Function$1,"%GeneratorFunction%":needsEval$1,"%Int8Array%":typeof Int8Array>"u"?undefined$2:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$2:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$2:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols$1&&getProto$2?getProto$2(getProto$2([][Symbol.iterator]())):undefined$2,"%JSON%":typeof JSON=="object"?JSON:undefined$2,"%Map%":typeof Map>"u"?undefined$2:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols$1||!getProto$2?undefined$2:getProto$2(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$2:Promise,"%Proxy%":typeof Proxy>"u"?undefined$2:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$2:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$2:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols$1||!getProto$2?undefined$2:getProto$2(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$2:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols$1&&getProto$2?getProto$2(""[Symbol.iterator]()):undefined$2,"%Symbol%":hasSymbols$1?Symbol:undefined$2,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError$1,"%TypedArray%":TypedArray$1,"%TypeError%":$TypeError$1,"%Uint8Array%":typeof Uint8Array>"u"?undefined$2:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$2:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$2:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$2:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$2:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$2:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$2:WeakSet};if(getProto$2)try{null.error}catch(a){var errorProto$1=getProto$2(getProto$2(a));INTRINSICS$1["%Error.prototype%"]=errorProto$1}var doEval$1=function a(_){var $;if(_==="%AsyncFunction%")$=getEvalledConstructor$1("async function () {}");else if(_==="%GeneratorFunction%")$=getEvalledConstructor$1("function* () {}");else if(_==="%AsyncGeneratorFunction%")$=getEvalledConstructor$1("async function* () {}");else if(_==="%AsyncGenerator%"){var j=a("%AsyncGeneratorFunction%");j&&($=j.prototype)}else if(_==="%AsyncIteratorPrototype%"){var et=a("%AsyncGenerator%");et&&getProto$2&&($=getProto$2(et.prototype))}return INTRINSICS$1[_]=$,$},LEGACY_ALIASES$1={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind$4=functionBind$2,hasOwn$2=src$3,$concat$1=bind$4.call(Function.call,Array.prototype.concat),$spliceApply$1=bind$4.call(Function.apply,Array.prototype.splice),$replace$1=bind$4.call(Function.call,String.prototype.replace),$strSlice$1=bind$4.call(Function.call,String.prototype.slice),$exec$1=bind$4.call(Function.call,RegExp.prototype.exec),rePropName$1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar$1=/\\(\\)?/g,stringToPath$1=function(_){var $=$strSlice$1(_,0,1),j=$strSlice$1(_,-1);if($==="%"&&j!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&$!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var et=[];return $replace$1(_,rePropName$1,function(tt,rt,nt,it){et[et.length]=nt?$replace$1(it,reEscapeChar$1,"$1"):rt||tt}),et},getBaseIntrinsic$1=function(_,$){var j=_,et;if(hasOwn$2(LEGACY_ALIASES$1,j)&&(et=LEGACY_ALIASES$1[j],j="%"+et[0]+"%"),hasOwn$2(INTRINSICS$1,j)){var tt=INTRINSICS$1[j];if(tt===needsEval$1&&(tt=doEval$1(j)),typeof tt>"u"&&!$)throw new $TypeError$1("intrinsic "+_+" exists, but is not available. Please file an issue!");return{alias:et,name:j,value:tt}}throw new $SyntaxError$1("intrinsic "+_+" does not exist!")},getIntrinsic$1=function(_,$){if(typeof _!="string"||_.length===0)throw new $TypeError$1("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof $!="boolean")throw new $TypeError$1('"allowMissing" argument must be a boolean');if($exec$1(/^%?[^%]*%?$/,_)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var j=stringToPath$1(_),et=j.length>0?j[0]:"",tt=getBaseIntrinsic$1("%"+et+"%",$),rt=tt.name,nt=tt.value,it=!1,st=tt.alias;st&&(et=st[0],$spliceApply$1(j,$concat$1([0,1],st)));for(var ot=1,at=!0;ot=j.length){var wt=$gOPD$2(nt,ut);at=!!wt,at&&"get"in wt&&!("originalValue"in wt.get)?nt=wt.get:nt=nt[ut]}else at=hasOwn$2(nt,ut),nt=nt[ut];at&&!it&&(INTRINSICS$1[rt]=nt)}}return nt},callBind$1={exports:{}};(function(a){var _=functionBind$2,$=getIntrinsic$1,j=$("%Function.prototype.apply%"),et=$("%Function.prototype.call%"),tt=$("%Reflect.apply%",!0)||_.call(et,j),rt=$("%Object.getOwnPropertyDescriptor%",!0),nt=$("%Object.defineProperty%",!0),it=$("%Math.max%");if(nt)try{nt({},"a",{value:1})}catch{nt=null}a.exports=function(at){var ut=tt(_,et,arguments);if(rt&&nt){var ht=rt(ut,"length");ht.configurable&&nt(ut,"length",{value:1+it(0,at.length-(arguments.length-1))})}return ut};var st=function(){return tt(_,j,arguments)};nt?nt(a.exports,"apply",{value:st}):a.exports.apply=st})(callBind$1);var callBindExports=callBind$1.exports,GetIntrinsic$1=getIntrinsic$1,callBind=callBindExports,$indexOf$1=callBind(GetIntrinsic$1("String.prototype.indexOf")),callBound$3=function(_,$){var j=GetIntrinsic$1(_,!!$);return typeof j=="function"&&$indexOf$1(_,".prototype.")>-1?callBind(j):j},hasToStringTag$4=shams(),callBound$2=callBound$3,$toString$2=callBound$2("Object.prototype.toString"),isStandardArguments=function(_){return hasToStringTag$4&&_&&typeof _=="object"&&Symbol.toStringTag in _?!1:$toString$2(_)==="[object Arguments]"},isLegacyArguments=function(_){return isStandardArguments(_)?!0:_!==null&&typeof _=="object"&&typeof _.length=="number"&&_.length>=0&&$toString$2(_)!=="[object Array]"&&$toString$2(_.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments=supportsStandardArguments?isStandardArguments:isLegacyArguments,toStr$3=Object.prototype.toString,fnToStr$1=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag$3=shams(),getProto$1=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag$3)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(_){if(typeof _!="function")return!1;if(isFnRegex.test(fnToStr$1.call(_)))return!0;if(!hasToStringTag$3){var $=toStr$3.call(_);return $==="[object GeneratorFunction]"}if(!getProto$1)return!1;if(typeof GeneratorFunction>"u"){var j=getGeneratorFunc();GeneratorFunction=j?getProto$1(j):!1}return getProto$1(_)===GeneratorFunction},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(a){a!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(_){try{var $=fnToStr.call(_);return constructorRegex.test($)}catch{return!1}},tryFunctionObject=function(_){try{return isES6ClassFn(_)?!1:(fnToStr.call(_),!0)}catch{return!1}},toStr$2=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$2=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all=document.all;toStr$2.call(all)===toStr$2.call(document.all)&&(isDDA=function(_){if((isIE68||!_)&&(typeof _>"u"||typeof _=="object"))try{var $=toStr$2.call(_);return($===ddaClass||$===ddaClass2||$===ddaClass3||$===objectClass)&&_("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(_){if(isDDA(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;try{reflectApply(_,null,badArrayLike)}catch($){if($!==isCallableMarker)return!1}return!isES6ClassFn(_)&&tryFunctionObject(_)}:function(_){if(isDDA(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;if(hasToStringTag$2)return tryFunctionObject(_);if(isES6ClassFn(_))return!1;var $=toStr$2.call(_);return $!==fnClass&&$!==genClass&&!/^\[object HTML/.test($)?!1:tryFunctionObject(_)},isCallable=isCallable$1,toStr$1=Object.prototype.toString,hasOwnProperty$2=Object.prototype.hasOwnProperty,forEachArray=function(_,$,j){for(var et=0,tt=_.length;et=3&&(et=j),toStr$1.call(_)==="[object Array]"?forEachArray(_,$,et):typeof _=="string"?forEachString(_,$,et):forEachObject(_,$,et)},forEach_1=forEach$4,possibleNames=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],g$3=typeof globalThis>"u"?commonjsGlobal:globalThis,availableTypedArrays$2=function(){for(var _=[],$=0;$"u"||!getProto?undefined$1:getProto(Uint8Array),INTRINSICS={"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto)try{null.error}catch(a){var errorProto=getProto(getProto(a));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function a(_){var $;if(_==="%AsyncFunction%")$=getEvalledConstructor("async function () {}");else if(_==="%GeneratorFunction%")$=getEvalledConstructor("function* () {}");else if(_==="%AsyncGeneratorFunction%")$=getEvalledConstructor("async function* () {}");else if(_==="%AsyncGenerator%"){var j=a("%AsyncGeneratorFunction%");j&&($=j.prototype)}else if(_==="%AsyncIteratorPrototype%"){var et=a("%AsyncGenerator%");et&&getProto&&($=getProto(et.prototype))}return INTRINSICS[_]=$,$},LEGACY_ALIASES={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind$3=functionBind,hasOwn$1=src$3,$concat=bind$3.call(Function.call,Array.prototype.concat),$spliceApply=bind$3.call(Function.apply,Array.prototype.splice),$replace=bind$3.call(Function.call,String.prototype.replace),$strSlice=bind$3.call(Function.call,String.prototype.slice),$exec=bind$3.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(_){var $=$strSlice(_,0,1),j=$strSlice(_,-1);if($==="%"&&j!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&$!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var et=[];return $replace(_,rePropName,function(tt,rt,nt,it){et[et.length]=nt?$replace(it,reEscapeChar,"$1"):rt||tt}),et},getBaseIntrinsic=function(_,$){var j=_,et;if(hasOwn$1(LEGACY_ALIASES,j)&&(et=LEGACY_ALIASES[j],j="%"+et[0]+"%"),hasOwn$1(INTRINSICS,j)){var tt=INTRINSICS[j];if(tt===needsEval&&(tt=doEval(j)),typeof tt>"u"&&!$)throw new $TypeError("intrinsic "+_+" exists, but is not available. Please file an issue!");return{alias:et,name:j,value:tt}}throw new $SyntaxError("intrinsic "+_+" does not exist!")},getIntrinsic=function(_,$){if(typeof _!="string"||_.length===0)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof $!="boolean")throw new $TypeError('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,_)===null)throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var j=stringToPath(_),et=j.length>0?j[0]:"",tt=getBaseIntrinsic("%"+et+"%",$),rt=tt.name,nt=tt.value,it=!1,st=tt.alias;st&&(et=st[0],$spliceApply(j,$concat([0,1],st)));for(var ot=1,at=!0;ot=j.length){var wt=$gOPD$1(nt,ut);at=!!wt,at&&"get"in wt&&!("originalValue"in wt.get)?nt=wt.get:nt=nt[ut]}else at=hasOwn$1(nt,ut),nt=nt[ut];at&&!it&&(INTRINSICS[rt]=nt)}}return nt},GetIntrinsic=getIntrinsic,$gOPD=GetIntrinsic("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd=$gOPD,forEach$3=forEach_1,availableTypedArrays$1=availableTypedArrays$2,callBound$1=callBound$3,$toString$1=callBound$1("Object.prototype.toString"),hasToStringTag$1=shams(),gOPD$1=gopd,g$2=typeof globalThis>"u"?commonjsGlobal:globalThis,typedArrays$1=availableTypedArrays$1(),$indexOf=callBound$1("Array.prototype.indexOf",!0)||function(_,$){for(var j=0;j<_.length;j+=1)if(_[j]===$)return j;return-1},$slice$1=callBound$1("String.prototype.slice"),toStrTags$1={},getPrototypeOf$6=Object.getPrototypeOf;hasToStringTag$1&&gOPD$1&&getPrototypeOf$6&&forEach$3(typedArrays$1,function(a){var _=new g$2[a];if(Symbol.toStringTag in _){var $=getPrototypeOf$6(_),j=gOPD$1($,Symbol.toStringTag);if(!j){var et=getPrototypeOf$6($);j=gOPD$1(et,Symbol.toStringTag)}toStrTags$1[a]=j.get}});var tryTypedArrays$1=function(_){var $=!1;return forEach$3(toStrTags$1,function(j,et){if(!$)try{$=j.call(_)===et}catch{}}),$},isTypedArray$3=function(_){if(!_||typeof _!="object")return!1;if(!hasToStringTag$1||!(Symbol.toStringTag in _)){var $=$slice$1($toString$1(_),8,-1);return $indexOf(typedArrays$1,$)>-1}return gOPD$1?tryTypedArrays$1(_):!1},forEach$2=forEach_1,availableTypedArrays=availableTypedArrays$2,callBound=callBound$3,gOPD=gopd,$toString=callBound("Object.prototype.toString"),hasToStringTag=shams(),g$1=typeof globalThis>"u"?commonjsGlobal:globalThis,typedArrays=availableTypedArrays(),$slice=callBound("String.prototype.slice"),toStrTags={},getPrototypeOf$5=Object.getPrototypeOf;hasToStringTag&&gOPD&&getPrototypeOf$5&&forEach$2(typedArrays,function(a){if(typeof g$1[a]=="function"){var _=new g$1[a];if(Symbol.toStringTag in _){var $=getPrototypeOf$5(_),j=gOPD($,Symbol.toStringTag);if(!j){var et=getPrototypeOf$5($);j=gOPD(et,Symbol.toStringTag)}toStrTags[a]=j.get}}});var tryTypedArrays=function(_){var $=!1;return forEach$2(toStrTags,function(j,et){if(!$)try{var tt=j.call(_);tt===et&&($=tt)}catch{}}),$},isTypedArray$2=isTypedArray$3,whichTypedArray=function(_){return isTypedArray$2(_)?!hasToStringTag||!(Symbol.toStringTag in _)?$slice($toString(_),8,-1):tryTypedArrays(_):!1};(function(a){var _=isArguments,$=isGeneratorFunction,j=whichTypedArray,et=isTypedArray$3;function tt(fr){return fr.call.bind(fr)}var rt=typeof BigInt<"u",nt=typeof Symbol<"u",it=tt(Object.prototype.toString),st=tt(Number.prototype.valueOf),ot=tt(String.prototype.valueOf),at=tt(Boolean.prototype.valueOf);if(rt)var ut=tt(BigInt.prototype.valueOf);if(nt)var ht=tt(Symbol.prototype.valueOf);function yt(fr,_r){if(typeof fr!="object")return!1;try{return _r(fr),!0}catch{return!1}}a.isArgumentsObject=_,a.isGeneratorFunction=$,a.isTypedArray=et;function wt(fr){return typeof Promise<"u"&&fr instanceof Promise||fr!==null&&typeof fr=="object"&&typeof fr.then=="function"&&typeof fr.catch=="function"}a.isPromise=wt;function Ct(fr){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(fr):et(fr)||Nt(fr)}a.isArrayBufferView=Ct;function Pt(fr){return j(fr)==="Uint8Array"}a.isUint8Array=Pt;function $t(fr){return j(fr)==="Uint8ClampedArray"}a.isUint8ClampedArray=$t;function Mt(fr){return j(fr)==="Uint16Array"}a.isUint16Array=Mt;function Bt(fr){return j(fr)==="Uint32Array"}a.isUint32Array=Bt;function Dt(fr){return j(fr)==="Int8Array"}a.isInt8Array=Dt;function zt(fr){return j(fr)==="Int16Array"}a.isInt16Array=zt;function Ot(fr){return j(fr)==="Int32Array"}a.isInt32Array=Ot;function It(fr){return j(fr)==="Float32Array"}a.isFloat32Array=It;function Lt(fr){return j(fr)==="Float64Array"}a.isFloat64Array=Lt;function Ft(fr){return j(fr)==="BigInt64Array"}a.isBigInt64Array=Ft;function jt(fr){return j(fr)==="BigUint64Array"}a.isBigUint64Array=jt;function bt(fr){return it(fr)==="[object Map]"}bt.working=typeof Map<"u"&&bt(new Map);function vt(fr){return typeof Map>"u"?!1:bt.working?bt(fr):fr instanceof Map}a.isMap=vt;function ct(fr){return it(fr)==="[object Set]"}ct.working=typeof Set<"u"&&ct(new Set);function dt(fr){return typeof Set>"u"?!1:ct.working?ct(fr):fr instanceof Set}a.isSet=dt;function mt(fr){return it(fr)==="[object WeakMap]"}mt.working=typeof WeakMap<"u"&&mt(new WeakMap);function xt(fr){return typeof WeakMap>"u"?!1:mt.working?mt(fr):fr instanceof WeakMap}a.isWeakMap=xt;function At(fr){return it(fr)==="[object WeakSet]"}At.working=typeof WeakSet<"u"&&At(new WeakSet);function Rt(fr){return At(fr)}a.isWeakSet=Rt;function St(fr){return it(fr)==="[object ArrayBuffer]"}St.working=typeof ArrayBuffer<"u"&&St(new ArrayBuffer);function Tt(fr){return typeof ArrayBuffer>"u"?!1:St.working?St(fr):fr instanceof ArrayBuffer}a.isArrayBuffer=Tt;function Et(fr){return it(fr)==="[object DataView]"}Et.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Et(new DataView(new ArrayBuffer(1),0,1));function Nt(fr){return typeof DataView>"u"?!1:Et.working?Et(fr):fr instanceof DataView}a.isDataView=Nt;var tr=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ir(fr){return it(fr)==="[object SharedArrayBuffer]"}function nr(fr){return typeof tr>"u"?!1:(typeof ir.working>"u"&&(ir.working=ir(new tr)),ir.working?ir(fr):fr instanceof tr)}a.isSharedArrayBuffer=nr;function Zt(fr){return it(fr)==="[object AsyncFunction]"}a.isAsyncFunction=Zt;function Kt(fr){return it(fr)==="[object Map Iterator]"}a.isMapIterator=Kt;function Qt(fr){return it(fr)==="[object Set Iterator]"}a.isSetIterator=Qt;function Ht(fr){return it(fr)==="[object Generator]"}a.isGeneratorObject=Ht;function qt(fr){return it(fr)==="[object WebAssembly.Module]"}a.isWebAssemblyCompiledModule=qt;function Jt(fr){return yt(fr,st)}a.isNumberObject=Jt;function ur(fr){return yt(fr,ot)}a.isStringObject=ur;function xr(fr){return yt(fr,at)}a.isBooleanObject=xr;function pr(fr){return rt&&yt(fr,ut)}a.isBigIntObject=pr;function Cr(fr){return nt&&yt(fr,ht)}a.isSymbolObject=Cr;function Mr(fr){return Jt(fr)||ur(fr)||xr(fr)||pr(fr)||Cr(fr)}a.isBoxedPrimitive=Mr;function lr(fr){return typeof Uint8Array<"u"&&(Tt(fr)||nr(fr))}a.isAnyArrayBuffer=lr,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(fr){Object.defineProperty(a,fr,{enumerable:!1,value:function(){throw new Error(fr+" is not supported in userland")}})})})(types$1);var isBufferBrowser=function(_){return _&&typeof _=="object"&&typeof _.copy=="function"&&typeof _.fill=="function"&&typeof _.readUInt8=="function"};(function(a){var _={},$=Object.getOwnPropertyDescriptors||function(tr){for(var ir=Object.keys(tr),nr={},Zt=0;Zt=Zt)return Ht;switch(Ht){case"%s":return String(nr[ir++]);case"%d":return Number(nr[ir++]);case"%j":try{return JSON.stringify(nr[ir++])}catch{return"[Circular]"}default:return Ht}}),Qt=nr[ir];ir"u")return function(){return a.deprecate(Nt,tr).apply(this,arguments)};var ir=!1;function nr(){if(!ir){if(process$1$1.throwDeprecation)throw new Error(tr);process$1$1.traceDeprecation?console.trace(tr):console.error(tr),ir=!0}return Nt.apply(this,arguments)}return nr};var et={},tt=/^$/;if(_.NODE_DEBUG){var rt=_.NODE_DEBUG;rt=rt.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),tt=new RegExp("^"+rt+"$","i")}a.debuglog=function(Nt){if(Nt=Nt.toUpperCase(),!et[Nt])if(tt.test(Nt)){var tr=process$1$1.pid;et[Nt]=function(){var ir=a.format.apply(a,arguments);console.error("%s %d: %s",Nt,tr,ir)}}else et[Nt]=function(){};return et[Nt]};function nt(Nt,tr){var ir={seen:[],stylize:st};return arguments.length>=3&&(ir.depth=arguments[2]),arguments.length>=4&&(ir.colors=arguments[3]),$t(tr)?ir.showHidden=tr:tr&&a._extend(ir,tr),It(ir.showHidden)&&(ir.showHidden=!1),It(ir.depth)&&(ir.depth=2),It(ir.colors)&&(ir.colors=!1),It(ir.customInspect)&&(ir.customInspect=!0),ir.colors&&(ir.stylize=it),at(ir,Nt,ir.depth)}a.inspect=nt,nt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},nt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function it(Nt,tr){var ir=nt.styles[tr];return ir?"\x1B["+nt.colors[ir][0]+"m"+Nt+"\x1B["+nt.colors[ir][1]+"m":Nt}function st(Nt,tr){return Nt}function ot(Nt){var tr={};return Nt.forEach(function(ir,nr){tr[ir]=!0}),tr}function at(Nt,tr,ir){if(Nt.customInspect&&tr&&vt(tr.inspect)&&tr.inspect!==a.inspect&&!(tr.constructor&&tr.constructor.prototype===tr)){var nr=tr.inspect(ir,Nt);return zt(nr)||(nr=at(Nt,nr,ir)),nr}var Zt=ut(Nt,tr);if(Zt)return Zt;var Kt=Object.keys(tr),Qt=ot(Kt);if(Nt.showHidden&&(Kt=Object.getOwnPropertyNames(tr)),bt(tr)&&(Kt.indexOf("message")>=0||Kt.indexOf("description")>=0))return ht(tr);if(Kt.length===0){if(vt(tr)){var Ht=tr.name?": "+tr.name:"";return Nt.stylize("[Function"+Ht+"]","special")}if(Lt(tr))return Nt.stylize(RegExp.prototype.toString.call(tr),"regexp");if(jt(tr))return Nt.stylize(Date.prototype.toString.call(tr),"date");if(bt(tr))return ht(tr)}var qt="",Jt=!1,ur=["{","}"];if(Pt(tr)&&(Jt=!0,ur=["[","]"]),vt(tr)){var xr=tr.name?": "+tr.name:"";qt=" [Function"+xr+"]"}if(Lt(tr)&&(qt=" "+RegExp.prototype.toString.call(tr)),jt(tr)&&(qt=" "+Date.prototype.toUTCString.call(tr)),bt(tr)&&(qt=" "+ht(tr)),Kt.length===0&&(!Jt||tr.length==0))return ur[0]+qt+ur[1];if(ir<0)return Lt(tr)?Nt.stylize(RegExp.prototype.toString.call(tr),"regexp"):Nt.stylize("[Object]","special");Nt.seen.push(tr);var pr;return Jt?pr=yt(Nt,tr,ir,Qt,Kt):pr=Kt.map(function(Cr){return wt(Nt,tr,ir,Qt,Cr,Jt)}),Nt.seen.pop(),Ct(pr,qt,ur)}function ut(Nt,tr){if(It(tr))return Nt.stylize("undefined","undefined");if(zt(tr)){var ir="'"+JSON.stringify(tr).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Nt.stylize(ir,"string")}if(Dt(tr))return Nt.stylize(""+tr,"number");if($t(tr))return Nt.stylize(""+tr,"boolean");if(Mt(tr))return Nt.stylize("null","null")}function ht(Nt){return"["+Error.prototype.toString.call(Nt)+"]"}function yt(Nt,tr,ir,nr,Zt){for(var Kt=[],Qt=0,Ht=tr.length;Qtet)throw new RangeError('The value "'+or+'" is invalid for option "size"');const Yt=new Uint8Array(or);return Object.setPrototypeOf(Yt,nt.prototype),Yt}function nt(or,Yt,er){if(typeof or=="number"){if(typeof Yt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return at(or)}return it(or,Yt,er)}nt.poolSize=8192;function it(or,Yt,er){if(typeof or=="string")return ut(or,Yt);if(ArrayBuffer.isView(or))return yt(or);if(or==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof or);if(kr(or,ArrayBuffer)||or&&kr(or.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(kr(or,SharedArrayBuffer)||or&&kr(or.buffer,SharedArrayBuffer)))return wt(or,Yt,er);if(typeof or=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Gt=or.valueOf&&or.valueOf();if(Gt!=null&&Gt!==or)return nt.from(Gt,Yt,er);const Vt=Ct(or);if(Vt)return Vt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof or[Symbol.toPrimitive]=="function")return nt.from(or[Symbol.toPrimitive]("string"),Yt,er);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof or)}nt.from=function(or,Yt,er){return it(or,Yt,er)},Object.setPrototypeOf(nt.prototype,Uint8Array.prototype),Object.setPrototypeOf(nt,Uint8Array);function st(or){if(typeof or!="number")throw new TypeError('"size" argument must be of type number');if(or<0)throw new RangeError('The value "'+or+'" is invalid for option "size"')}function ot(or,Yt,er){return st(or),or<=0?rt(or):Yt!==void 0?typeof er=="string"?rt(or).fill(Yt,er):rt(or).fill(Yt):rt(or)}nt.alloc=function(or,Yt,er){return ot(or,Yt,er)};function at(or){return st(or),rt(or<0?0:Pt(or)|0)}nt.allocUnsafe=function(or){return at(or)},nt.allocUnsafeSlow=function(or){return at(or)};function ut(or,Yt){if((typeof Yt!="string"||Yt==="")&&(Yt="utf8"),!nt.isEncoding(Yt))throw new TypeError("Unknown encoding: "+Yt);const er=Mt(or,Yt)|0;let Gt=rt(er);const Vt=Gt.write(or,Yt);return Vt!==er&&(Gt=Gt.slice(0,Vt)),Gt}function ht(or){const Yt=or.length<0?0:Pt(or.length)|0,er=rt(Yt);for(let Gt=0;Gt=et)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+et.toString(16)+" bytes");return or|0}function $t(or){return+or!=or&&(or=0),nt.alloc(+or)}nt.isBuffer=function(Yt){return Yt!=null&&Yt._isBuffer===!0&&Yt!==nt.prototype},nt.compare=function(Yt,er){if(kr(Yt,Uint8Array)&&(Yt=nt.from(Yt,Yt.offset,Yt.byteLength)),kr(er,Uint8Array)&&(er=nt.from(er,er.offset,er.byteLength)),!nt.isBuffer(Yt)||!nt.isBuffer(er))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Yt===er)return 0;let Gt=Yt.length,Vt=er.length;for(let Wt=0,ar=Math.min(Gt,Vt);WtVt.length?(nt.isBuffer(ar)||(ar=nt.from(ar)),ar.copy(Vt,Wt)):Uint8Array.prototype.set.call(Vt,ar,Wt);else if(nt.isBuffer(ar))ar.copy(Vt,Wt);else throw new TypeError('"list" argument must be an Array of Buffers');Wt+=ar.length}return Vt};function Mt(or,Yt){if(nt.isBuffer(or))return or.length;if(ArrayBuffer.isView(or)||kr(or,ArrayBuffer))return or.byteLength;if(typeof or!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof or);const er=or.length,Gt=arguments.length>2&&arguments[2]===!0;if(!Gt&&er===0)return 0;let Vt=!1;for(;;)switch(Yt){case"ascii":case"latin1":case"binary":return er;case"utf8":case"utf-8":return Mr(or).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return er*2;case"hex":return er>>>1;case"base64":return _r(or).length;default:if(Vt)return Gt?-1:Mr(or).length;Yt=(""+Yt).toLowerCase(),Vt=!0}}nt.byteLength=Mt;function Bt(or,Yt,er){let Gt=!1;if((Yt===void 0||Yt<0)&&(Yt=0),Yt>this.length||((er===void 0||er>this.length)&&(er=this.length),er<=0)||(er>>>=0,Yt>>>=0,er<=Yt))return"";for(or||(or="utf8");;)switch(or){case"hex":return Rt(this,Yt,er);case"utf8":case"utf-8":return ct(this,Yt,er);case"ascii":return xt(this,Yt,er);case"latin1":case"binary":return At(this,Yt,er);case"base64":return vt(this,Yt,er);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St(this,Yt,er);default:if(Gt)throw new TypeError("Unknown encoding: "+or);or=(or+"").toLowerCase(),Gt=!0}}nt.prototype._isBuffer=!0;function Dt(or,Yt,er){const Gt=or[Yt];or[Yt]=or[er],or[er]=Gt}nt.prototype.swap16=function(){const Yt=this.length;if(Yt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let er=0;erer&&(Yt+=" ... "),""},j&&(nt.prototype[j]=nt.prototype.inspect),nt.prototype.compare=function(Yt,er,Gt,Vt,Wt){if(kr(Yt,Uint8Array)&&(Yt=nt.from(Yt,Yt.offset,Yt.byteLength)),!nt.isBuffer(Yt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Yt);if(er===void 0&&(er=0),Gt===void 0&&(Gt=Yt?Yt.length:0),Vt===void 0&&(Vt=0),Wt===void 0&&(Wt=this.length),er<0||Gt>Yt.length||Vt<0||Wt>this.length)throw new RangeError("out of range index");if(Vt>=Wt&&er>=Gt)return 0;if(Vt>=Wt)return-1;if(er>=Gt)return 1;if(er>>>=0,Gt>>>=0,Vt>>>=0,Wt>>>=0,this===Yt)return 0;let ar=Wt-Vt,yr=Gt-er;const Er=Math.min(ar,yr),Rr=this.slice(Vt,Wt),Wr=Yt.slice(er,Gt);for(let Hr=0;Hr2147483647?er=2147483647:er<-2147483648&&(er=-2147483648),er=+er,Ar(er)&&(er=Vt?0:or.length-1),er<0&&(er=or.length+er),er>=or.length){if(Vt)return-1;er=or.length-1}else if(er<0)if(Vt)er=0;else return-1;if(typeof Yt=="string"&&(Yt=nt.from(Yt,Gt)),nt.isBuffer(Yt))return Yt.length===0?-1:Ot(or,Yt,er,Gt,Vt);if(typeof Yt=="number")return Yt=Yt&255,typeof Uint8Array.prototype.indexOf=="function"?Vt?Uint8Array.prototype.indexOf.call(or,Yt,er):Uint8Array.prototype.lastIndexOf.call(or,Yt,er):Ot(or,[Yt],er,Gt,Vt);throw new TypeError("val must be string, number or Buffer")}function Ot(or,Yt,er,Gt,Vt){let Wt=1,ar=or.length,yr=Yt.length;if(Gt!==void 0&&(Gt=String(Gt).toLowerCase(),Gt==="ucs2"||Gt==="ucs-2"||Gt==="utf16le"||Gt==="utf-16le")){if(or.length<2||Yt.length<2)return-1;Wt=2,ar/=2,yr/=2,er/=2}function Er(Wr,Hr){return Wt===1?Wr[Hr]:Wr.readUInt16BE(Hr*Wt)}let Rr;if(Vt){let Wr=-1;for(Rr=er;Rrar&&(er=ar-yr),Rr=er;Rr>=0;Rr--){let Wr=!0;for(let Hr=0;HrVt&&(Gt=Vt)):Gt=Vt;const Wt=Yt.length;Gt>Wt/2&&(Gt=Wt/2);let ar;for(ar=0;ar>>0,isFinite(Gt)?(Gt=Gt>>>0,Vt===void 0&&(Vt="utf8")):(Vt=Gt,Gt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Wt=this.length-er;if((Gt===void 0||Gt>Wt)&&(Gt=Wt),Yt.length>0&&(Gt<0||er<0)||er>this.length)throw new RangeError("Attempt to write outside buffer bounds");Vt||(Vt="utf8");let ar=!1;for(;;)switch(Vt){case"hex":return It(this,Yt,er,Gt);case"utf8":case"utf-8":return Lt(this,Yt,er,Gt);case"ascii":case"latin1":case"binary":return Ft(this,Yt,er,Gt);case"base64":return jt(this,Yt,er,Gt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bt(this,Yt,er,Gt);default:if(ar)throw new TypeError("Unknown encoding: "+Vt);Vt=(""+Vt).toLowerCase(),ar=!0}},nt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function vt(or,Yt,er){return Yt===0&&er===or.length?_.fromByteArray(or):_.fromByteArray(or.slice(Yt,er))}function ct(or,Yt,er){er=Math.min(or.length,er);const Gt=[];let Vt=Yt;for(;Vt239?4:Wt>223?3:Wt>191?2:1;if(Vt+yr<=er){let Er,Rr,Wr,Hr;switch(yr){case 1:Wt<128&&(ar=Wt);break;case 2:Er=or[Vt+1],(Er&192)===128&&(Hr=(Wt&31)<<6|Er&63,Hr>127&&(ar=Hr));break;case 3:Er=or[Vt+1],Rr=or[Vt+2],(Er&192)===128&&(Rr&192)===128&&(Hr=(Wt&15)<<12|(Er&63)<<6|Rr&63,Hr>2047&&(Hr<55296||Hr>57343)&&(ar=Hr));break;case 4:Er=or[Vt+1],Rr=or[Vt+2],Wr=or[Vt+3],(Er&192)===128&&(Rr&192)===128&&(Wr&192)===128&&(Hr=(Wt&15)<<18|(Er&63)<<12|(Rr&63)<<6|Wr&63,Hr>65535&&Hr<1114112&&(ar=Hr))}}ar===null?(ar=65533,yr=1):ar>65535&&(ar-=65536,Gt.push(ar>>>10&1023|55296),ar=56320|ar&1023),Gt.push(ar),Vt+=yr}return mt(Gt)}const dt=4096;function mt(or){const Yt=or.length;if(Yt<=dt)return String.fromCharCode.apply(String,or);let er="",Gt=0;for(;GtGt)&&(er=Gt);let Vt="";for(let Wt=Yt;WtGt&&(Yt=Gt),er<0?(er+=Gt,er<0&&(er=0)):er>Gt&&(er=Gt),erer)throw new RangeError("Trying to access beyond buffer length")}nt.prototype.readUintLE=nt.prototype.readUIntLE=function(Yt,er,Gt){Yt=Yt>>>0,er=er>>>0,Gt||Tt(Yt,er,this.length);let Vt=this[Yt],Wt=1,ar=0;for(;++ar>>0,er=er>>>0,Gt||Tt(Yt,er,this.length);let Vt=this[Yt+--er],Wt=1;for(;er>0&&(Wt*=256);)Vt+=this[Yt+--er]*Wt;return Vt},nt.prototype.readUint8=nt.prototype.readUInt8=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,1,this.length),this[Yt]},nt.prototype.readUint16LE=nt.prototype.readUInt16LE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,2,this.length),this[Yt]|this[Yt+1]<<8},nt.prototype.readUint16BE=nt.prototype.readUInt16BE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,2,this.length),this[Yt]<<8|this[Yt+1]},nt.prototype.readUint32LE=nt.prototype.readUInt32LE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),(this[Yt]|this[Yt+1]<<8|this[Yt+2]<<16)+this[Yt+3]*16777216},nt.prototype.readUint32BE=nt.prototype.readUInt32BE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),this[Yt]*16777216+(this[Yt+1]<<16|this[Yt+2]<<8|this[Yt+3])},nt.prototype.readBigUInt64LE=Or(function(Yt){Yt=Yt>>>0,ur(Yt,"offset");const er=this[Yt],Gt=this[Yt+7];(er===void 0||Gt===void 0)&&xr(Yt,this.length-8);const Vt=er+this[++Yt]*2**8+this[++Yt]*2**16+this[++Yt]*2**24,Wt=this[++Yt]+this[++Yt]*2**8+this[++Yt]*2**16+Gt*2**24;return BigInt(Vt)+(BigInt(Wt)<>>0,ur(Yt,"offset");const er=this[Yt],Gt=this[Yt+7];(er===void 0||Gt===void 0)&&xr(Yt,this.length-8);const Vt=er*2**24+this[++Yt]*2**16+this[++Yt]*2**8+this[++Yt],Wt=this[++Yt]*2**24+this[++Yt]*2**16+this[++Yt]*2**8+Gt;return(BigInt(Vt)<>>0,er=er>>>0,Gt||Tt(Yt,er,this.length);let Vt=this[Yt],Wt=1,ar=0;for(;++ar=Wt&&(Vt-=Math.pow(2,8*er)),Vt},nt.prototype.readIntBE=function(Yt,er,Gt){Yt=Yt>>>0,er=er>>>0,Gt||Tt(Yt,er,this.length);let Vt=er,Wt=1,ar=this[Yt+--Vt];for(;Vt>0&&(Wt*=256);)ar+=this[Yt+--Vt]*Wt;return Wt*=128,ar>=Wt&&(ar-=Math.pow(2,8*er)),ar},nt.prototype.readInt8=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,1,this.length),this[Yt]&128?(255-this[Yt]+1)*-1:this[Yt]},nt.prototype.readInt16LE=function(Yt,er){Yt=Yt>>>0,er||Tt(Yt,2,this.length);const Gt=this[Yt]|this[Yt+1]<<8;return Gt&32768?Gt|4294901760:Gt},nt.prototype.readInt16BE=function(Yt,er){Yt=Yt>>>0,er||Tt(Yt,2,this.length);const Gt=this[Yt+1]|this[Yt]<<8;return Gt&32768?Gt|4294901760:Gt},nt.prototype.readInt32LE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),this[Yt]|this[Yt+1]<<8|this[Yt+2]<<16|this[Yt+3]<<24},nt.prototype.readInt32BE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),this[Yt]<<24|this[Yt+1]<<16|this[Yt+2]<<8|this[Yt+3]},nt.prototype.readBigInt64LE=Or(function(Yt){Yt=Yt>>>0,ur(Yt,"offset");const er=this[Yt],Gt=this[Yt+7];(er===void 0||Gt===void 0)&&xr(Yt,this.length-8);const Vt=this[Yt+4]+this[Yt+5]*2**8+this[Yt+6]*2**16+(Gt<<24);return(BigInt(Vt)<>>0,ur(Yt,"offset");const er=this[Yt],Gt=this[Yt+7];(er===void 0||Gt===void 0)&&xr(Yt,this.length-8);const Vt=(er<<24)+this[++Yt]*2**16+this[++Yt]*2**8+this[++Yt];return(BigInt(Vt)<>>0,er||Tt(Yt,4,this.length),$.read(this,Yt,!0,23,4)},nt.prototype.readFloatBE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,4,this.length),$.read(this,Yt,!1,23,4)},nt.prototype.readDoubleLE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,8,this.length),$.read(this,Yt,!0,52,8)},nt.prototype.readDoubleBE=function(Yt,er){return Yt=Yt>>>0,er||Tt(Yt,8,this.length),$.read(this,Yt,!1,52,8)};function Et(or,Yt,er,Gt,Vt,Wt){if(!nt.isBuffer(or))throw new TypeError('"buffer" argument must be a Buffer instance');if(Yt>Vt||Ytor.length)throw new RangeError("Index out of range")}nt.prototype.writeUintLE=nt.prototype.writeUIntLE=function(Yt,er,Gt,Vt){if(Yt=+Yt,er=er>>>0,Gt=Gt>>>0,!Vt){const yr=Math.pow(2,8*Gt)-1;Et(this,Yt,er,Gt,yr,0)}let Wt=1,ar=0;for(this[er]=Yt&255;++ar>>0,Gt=Gt>>>0,!Vt){const yr=Math.pow(2,8*Gt)-1;Et(this,Yt,er,Gt,yr,0)}let Wt=Gt-1,ar=1;for(this[er+Wt]=Yt&255;--Wt>=0&&(ar*=256);)this[er+Wt]=Yt/ar&255;return er+Gt},nt.prototype.writeUint8=nt.prototype.writeUInt8=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,1,255,0),this[er]=Yt&255,er+1},nt.prototype.writeUint16LE=nt.prototype.writeUInt16LE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,2,65535,0),this[er]=Yt&255,this[er+1]=Yt>>>8,er+2},nt.prototype.writeUint16BE=nt.prototype.writeUInt16BE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,2,65535,0),this[er]=Yt>>>8,this[er+1]=Yt&255,er+2},nt.prototype.writeUint32LE=nt.prototype.writeUInt32LE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,4,4294967295,0),this[er+3]=Yt>>>24,this[er+2]=Yt>>>16,this[er+1]=Yt>>>8,this[er]=Yt&255,er+4},nt.prototype.writeUint32BE=nt.prototype.writeUInt32BE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,4,4294967295,0),this[er]=Yt>>>24,this[er+1]=Yt>>>16,this[er+2]=Yt>>>8,this[er+3]=Yt&255,er+4};function Nt(or,Yt,er,Gt,Vt){Jt(Yt,Gt,Vt,or,er,7);let Wt=Number(Yt&BigInt(4294967295));or[er++]=Wt,Wt=Wt>>8,or[er++]=Wt,Wt=Wt>>8,or[er++]=Wt,Wt=Wt>>8,or[er++]=Wt;let ar=Number(Yt>>BigInt(32)&BigInt(4294967295));return or[er++]=ar,ar=ar>>8,or[er++]=ar,ar=ar>>8,or[er++]=ar,ar=ar>>8,or[er++]=ar,er}function tr(or,Yt,er,Gt,Vt){Jt(Yt,Gt,Vt,or,er,7);let Wt=Number(Yt&BigInt(4294967295));or[er+7]=Wt,Wt=Wt>>8,or[er+6]=Wt,Wt=Wt>>8,or[er+5]=Wt,Wt=Wt>>8,or[er+4]=Wt;let ar=Number(Yt>>BigInt(32)&BigInt(4294967295));return or[er+3]=ar,ar=ar>>8,or[er+2]=ar,ar=ar>>8,or[er+1]=ar,ar=ar>>8,or[er]=ar,er+8}nt.prototype.writeBigUInt64LE=Or(function(Yt,er=0){return Nt(this,Yt,er,BigInt(0),BigInt("0xffffffffffffffff"))}),nt.prototype.writeBigUInt64BE=Or(function(Yt,er=0){return tr(this,Yt,er,BigInt(0),BigInt("0xffffffffffffffff"))}),nt.prototype.writeIntLE=function(Yt,er,Gt,Vt){if(Yt=+Yt,er=er>>>0,!Vt){const Er=Math.pow(2,8*Gt-1);Et(this,Yt,er,Gt,Er-1,-Er)}let Wt=0,ar=1,yr=0;for(this[er]=Yt&255;++Wt>0)-yr&255;return er+Gt},nt.prototype.writeIntBE=function(Yt,er,Gt,Vt){if(Yt=+Yt,er=er>>>0,!Vt){const Er=Math.pow(2,8*Gt-1);Et(this,Yt,er,Gt,Er-1,-Er)}let Wt=Gt-1,ar=1,yr=0;for(this[er+Wt]=Yt&255;--Wt>=0&&(ar*=256);)Yt<0&&yr===0&&this[er+Wt+1]!==0&&(yr=1),this[er+Wt]=(Yt/ar>>0)-yr&255;return er+Gt},nt.prototype.writeInt8=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,1,127,-128),Yt<0&&(Yt=255+Yt+1),this[er]=Yt&255,er+1},nt.prototype.writeInt16LE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,2,32767,-32768),this[er]=Yt&255,this[er+1]=Yt>>>8,er+2},nt.prototype.writeInt16BE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,2,32767,-32768),this[er]=Yt>>>8,this[er+1]=Yt&255,er+2},nt.prototype.writeInt32LE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,4,2147483647,-2147483648),this[er]=Yt&255,this[er+1]=Yt>>>8,this[er+2]=Yt>>>16,this[er+3]=Yt>>>24,er+4},nt.prototype.writeInt32BE=function(Yt,er,Gt){return Yt=+Yt,er=er>>>0,Gt||Et(this,Yt,er,4,2147483647,-2147483648),Yt<0&&(Yt=4294967295+Yt+1),this[er]=Yt>>>24,this[er+1]=Yt>>>16,this[er+2]=Yt>>>8,this[er+3]=Yt&255,er+4},nt.prototype.writeBigInt64LE=Or(function(Yt,er=0){return Nt(this,Yt,er,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),nt.prototype.writeBigInt64BE=Or(function(Yt,er=0){return tr(this,Yt,er,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ir(or,Yt,er,Gt,Vt,Wt){if(er+Gt>or.length)throw new RangeError("Index out of range");if(er<0)throw new RangeError("Index out of range")}function nr(or,Yt,er,Gt,Vt){return Yt=+Yt,er=er>>>0,Vt||ir(or,Yt,er,4),$.write(or,Yt,er,Gt,23,4),er+4}nt.prototype.writeFloatLE=function(Yt,er,Gt){return nr(this,Yt,er,!0,Gt)},nt.prototype.writeFloatBE=function(Yt,er,Gt){return nr(this,Yt,er,!1,Gt)};function Zt(or,Yt,er,Gt,Vt){return Yt=+Yt,er=er>>>0,Vt||ir(or,Yt,er,8),$.write(or,Yt,er,Gt,52,8),er+8}nt.prototype.writeDoubleLE=function(Yt,er,Gt){return Zt(this,Yt,er,!0,Gt)},nt.prototype.writeDoubleBE=function(Yt,er,Gt){return Zt(this,Yt,er,!1,Gt)},nt.prototype.copy=function(Yt,er,Gt,Vt){if(!nt.isBuffer(Yt))throw new TypeError("argument should be a Buffer");if(Gt||(Gt=0),!Vt&&Vt!==0&&(Vt=this.length),er>=Yt.length&&(er=Yt.length),er||(er=0),Vt>0&&Vt=this.length)throw new RangeError("Index out of range");if(Vt<0)throw new RangeError("sourceEnd out of bounds");Vt>this.length&&(Vt=this.length),Yt.length-er>>0,Gt=Gt===void 0?this.length:Gt>>>0,Yt||(Yt=0);let Wt;if(typeof Yt=="number")for(Wt=er;Wt2**32?Vt=Ht(String(er)):typeof er=="bigint"&&(Vt=String(er),(er>BigInt(2)**BigInt(32)||er<-(BigInt(2)**BigInt(32)))&&(Vt=Ht(Vt)),Vt+="n"),Gt+=` It must be ${Yt}. Received ${Vt}`,Gt},RangeError);function Ht(or){let Yt="",er=or.length;const Gt=or[0]==="-"?1:0;for(;er>=Gt+4;er-=3)Yt=`_${or.slice(er-3,er)}${Yt}`;return`${or.slice(0,er)}${Yt}`}function qt(or,Yt,er){ur(Yt,"offset"),(or[Yt]===void 0||or[Yt+er]===void 0)&&xr(Yt,or.length-(er+1))}function Jt(or,Yt,er,Gt,Vt,Wt){if(or>er||or= 0${ar} and < 2${ar} ** ${(Wt+1)*8}${ar}`:yr=`>= -(2${ar} ** ${(Wt+1)*8-1}${ar}) and < 2 ** ${(Wt+1)*8-1}${ar}`,new Kt.ERR_OUT_OF_RANGE("value",yr,or)}qt(Gt,Vt,Wt)}function ur(or,Yt){if(typeof or!="number")throw new Kt.ERR_INVALID_ARG_TYPE(Yt,"number",or)}function xr(or,Yt,er){throw Math.floor(or)!==or?(ur(or,er),new Kt.ERR_OUT_OF_RANGE("offset","an integer",or)):Yt<0?new Kt.ERR_BUFFER_OUT_OF_BOUNDS:new Kt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Yt}`,or)}const pr=/[^+/0-9A-Za-z-_]/g;function Cr(or){if(or=or.split("=")[0],or=or.trim().replace(pr,""),or.length<2)return"";for(;or.length%4!==0;)or=or+"=";return or}function Mr(or,Yt){Yt=Yt||1/0;let er;const Gt=or.length;let Vt=null;const Wt=[];for(let ar=0;ar55295&&er<57344){if(!Vt){if(er>56319){(Yt-=3)>-1&&Wt.push(239,191,189);continue}else if(ar+1===Gt){(Yt-=3)>-1&&Wt.push(239,191,189);continue}Vt=er;continue}if(er<56320){(Yt-=3)>-1&&Wt.push(239,191,189),Vt=er;continue}er=(Vt-55296<<10|er-56320)+65536}else Vt&&(Yt-=3)>-1&&Wt.push(239,191,189);if(Vt=null,er<128){if((Yt-=1)<0)break;Wt.push(er)}else if(er<2048){if((Yt-=2)<0)break;Wt.push(er>>6|192,er&63|128)}else if(er<65536){if((Yt-=3)<0)break;Wt.push(er>>12|224,er>>6&63|128,er&63|128)}else if(er<1114112){if((Yt-=4)<0)break;Wt.push(er>>18|240,er>>12&63|128,er>>6&63|128,er&63|128)}else throw new Error("Invalid code point")}return Wt}function lr(or){const Yt=[];for(let er=0;er>8,Vt=er%256,Wt.push(Vt),Wt.push(Gt);return Wt}function _r(or){return _.toByteArray(Cr(or))}function Sr(or,Yt,er,Gt){let Vt;for(Vt=0;Vt=Yt.length||Vt>=or.length);++Vt)Yt[Vt+er]=or[Vt];return Vt}function kr(or,Yt){return or instanceof Yt||or!=null&&or.constructor!=null&&or.constructor.name!=null&&or.constructor.name===Yt.name}function Ar(or){return or!==or}const $r=function(){const or="0123456789abcdef",Yt=new Array(256);for(let er=0;er<16;++er){const Gt=er*16;for(let Vt=0;Vt<16;++Vt)Yt[Gt+Vt]=or[er]+or[Vt]}return Yt}();function Or(or){return typeof BigInt>"u"?Br:or}function Br(){throw new Error("BigInt not supported")}})(buffer$1);/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(a,_){var $=buffer$1,j=$.Buffer;function et(rt,nt){for(var it in rt)nt[it]=rt[it]}j.from&&j.alloc&&j.allocUnsafe&&j.allocUnsafeSlow?a.exports=$:(et($,_),_.Buffer=tt);function tt(rt,nt,it){return j(rt,nt,it)}tt.prototype=Object.create(j.prototype),et(j,tt),tt.from=function(rt,nt,it){if(typeof rt=="number")throw new TypeError("Argument must not be a number");return j(rt,nt,it)},tt.alloc=function(rt,nt,it){if(typeof rt!="number")throw new TypeError("Argument must be a number");var st=j(rt);return nt!==void 0?typeof it=="string"?st.fill(nt,it):st.fill(nt):st.fill(0),st},tt.allocUnsafe=function(rt){if(typeof rt!="number")throw new TypeError("Argument must be a number");return j(rt)},tt.allocUnsafeSlow=function(rt){if(typeof rt!="number")throw new TypeError("Argument must be a number");return $.SlowBuffer(rt)}})(safeBuffer$2,safeBuffer$2.exports);var safeBufferExports=safeBuffer$2.exports,readableBrowser$1={exports:{}};function getDefaultExportFromCjs(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var browser$d={exports:{}},process$1=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(a){if(cachedSetTimeout===setTimeout)return setTimeout(a,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(a,0);try{return cachedSetTimeout(a,0)}catch{try{return cachedSetTimeout.call(null,a,0)}catch{return cachedSetTimeout.call(this,a,0)}}}function runClearTimeout(a){if(cachedClearTimeout===clearTimeout)return clearTimeout(a);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(a);try{return cachedClearTimeout(a)}catch{try{return cachedClearTimeout.call(null,a)}catch{return cachedClearTimeout.call(this,a)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var a=runTimeout(cleanUpNextTick);draining=!0;for(var _=queue.length;_;){for(currentQueue=queue,queue=[];++queueIndex<_;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,_=queue.length}currentQueue=null,draining=!1,runClearTimeout(a)}}process$1.nextTick=function(a){var _=new Array(arguments.length-1);if(arguments.length>1)for(var $=1;$0&&(rt=$[0]),rt instanceof Error)throw rt;var nt=new Error("Unhandled error."+(rt?" ("+rt.message+")":""));throw nt.context=rt,nt}var it=tt[_];if(it===void 0)return!1;if(typeof it=="function")ReflectApply(it,this,$);else for(var st=it.length,ot=arrayClone(it,st),j=0;j0&&rt.length>et&&!rt.warned){rt.warned=!0;var nt=new Error("Possible EventEmitter memory leak detected. "+rt.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");nt.name="MaxListenersExceededWarning",nt.emitter=a,nt.type=_,nt.count=rt.length,ProcessEmitWarning(nt)}return a}EventEmitter$1.prototype.addListener=function(_,$){return _addListener(this,_,$,!1)};EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener;EventEmitter$1.prototype.prependListener=function(_,$){return _addListener(this,_,$,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(a,_,$){var j={fired:!1,wrapFn:void 0,target:a,type:_,listener:$},et=onceWrapper.bind(j);return et.listener=$,j.wrapFn=et,et}EventEmitter$1.prototype.once=function(_,$){return checkListener($),this.on(_,_onceWrap(this,_,$)),this};EventEmitter$1.prototype.prependOnceListener=function(_,$){return checkListener($),this.prependListener(_,_onceWrap(this,_,$)),this};EventEmitter$1.prototype.removeListener=function(_,$){var j,et,tt,rt,nt;if(checkListener($),et=this._events,et===void 0)return this;if(j=et[_],j===void 0)return this;if(j===$||j.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete et[_],et.removeListener&&this.emit("removeListener",_,j.listener||$));else if(typeof j!="function"){for(tt=-1,rt=j.length-1;rt>=0;rt--)if(j[rt]===$||j[rt].listener===$){nt=j[rt].listener,tt=rt;break}if(tt<0)return this;tt===0?j.shift():spliceOne(j,tt),j.length===1&&(et[_]=j[0]),et.removeListener!==void 0&&this.emit("removeListener",_,nt||$)}return this};EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener;EventEmitter$1.prototype.removeAllListeners=function(_){var $,j,et;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[_]),this;if(arguments.length===0){var tt=Object.keys(j),rt;for(et=0;et=0;et--)this.removeListener(_,$[et]);return this};function _listeners(a,_,$){var j=a._events;if(j===void 0)return[];var et=j[_];return et===void 0?[]:typeof et=="function"?$?[et.listener||et]:[et]:$?unwrapListeners(et):arrayClone(et,et.length)}EventEmitter$1.prototype.listeners=function(_){return _listeners(this,_,!0)};EventEmitter$1.prototype.rawListeners=function(_){return _listeners(this,_,!1)};EventEmitter$1.listenerCount=function(a,_){return typeof a.listenerCount=="function"?a.listenerCount(_):listenerCount.call(a,_)};EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(a){var _=this._events;if(_!==void 0){var $=_[a];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(a,_){for(var $=new Array(_),j=0;j<_;++j)$[j]=a[j];return $}function spliceOne(a,_){for(;_+1"u"||!getProto$2?undefined$2:getProto$2(Uint8Array),INTRINSICS$1={"%AggregateError%":typeof AggregateError>"u"?undefined$2:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$2:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols$1&&getProto$2?getProto$2([][Symbol.iterator]()):undefined$2,"%AsyncFromSyncIteratorPrototype%":undefined$2,"%AsyncFunction%":needsEval$1,"%AsyncGenerator%":needsEval$1,"%AsyncGeneratorFunction%":needsEval$1,"%AsyncIteratorPrototype%":needsEval$1,"%Atomics%":typeof Atomics>"u"?undefined$2:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$2:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$2:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$2:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$2:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$2:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$2:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$2:FinalizationRegistry,"%Function%":$Function$1,"%GeneratorFunction%":needsEval$1,"%Int8Array%":typeof Int8Array>"u"?undefined$2:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$2:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$2:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols$1&&getProto$2?getProto$2(getProto$2([][Symbol.iterator]())):undefined$2,"%JSON%":typeof JSON=="object"?JSON:undefined$2,"%Map%":typeof Map>"u"?undefined$2:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols$1||!getProto$2?undefined$2:getProto$2(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$2:Promise,"%Proxy%":typeof Proxy>"u"?undefined$2:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$2:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$2:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols$1||!getProto$2?undefined$2:getProto$2(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$2:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols$1&&getProto$2?getProto$2(""[Symbol.iterator]()):undefined$2,"%Symbol%":hasSymbols$1?Symbol:undefined$2,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError$1,"%TypedArray%":TypedArray$1,"%TypeError%":$TypeError$1,"%Uint8Array%":typeof Uint8Array>"u"?undefined$2:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$2:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$2:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$2:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$2:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$2:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$2:WeakSet};if(getProto$2)try{null.error}catch(a){var errorProto$1=getProto$2(getProto$2(a));INTRINSICS$1["%Error.prototype%"]=errorProto$1}var doEval$1=function a(_){var $;if(_==="%AsyncFunction%")$=getEvalledConstructor$1("async function () {}");else if(_==="%GeneratorFunction%")$=getEvalledConstructor$1("function* () {}");else if(_==="%AsyncGeneratorFunction%")$=getEvalledConstructor$1("async function* () {}");else if(_==="%AsyncGenerator%"){var j=a("%AsyncGeneratorFunction%");j&&($=j.prototype)}else if(_==="%AsyncIteratorPrototype%"){var et=a("%AsyncGenerator%");et&&getProto$2&&($=getProto$2(et.prototype))}return INTRINSICS$1[_]=$,$},LEGACY_ALIASES$1={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind$4=functionBind$2,hasOwn$2=src$3,$concat$1=bind$4.call(Function.call,Array.prototype.concat),$spliceApply$1=bind$4.call(Function.apply,Array.prototype.splice),$replace$1=bind$4.call(Function.call,String.prototype.replace),$strSlice$1=bind$4.call(Function.call,String.prototype.slice),$exec$1=bind$4.call(Function.call,RegExp.prototype.exec),rePropName$1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar$1=/\\(\\)?/g,stringToPath$1=function(_){var $=$strSlice$1(_,0,1),j=$strSlice$1(_,-1);if($==="%"&&j!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&$!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var et=[];return $replace$1(_,rePropName$1,function(tt,rt,nt,it){et[et.length]=nt?$replace$1(it,reEscapeChar$1,"$1"):rt||tt}),et},getBaseIntrinsic$1=function(_,$){var j=_,et;if(hasOwn$2(LEGACY_ALIASES$1,j)&&(et=LEGACY_ALIASES$1[j],j="%"+et[0]+"%"),hasOwn$2(INTRINSICS$1,j)){var tt=INTRINSICS$1[j];if(tt===needsEval$1&&(tt=doEval$1(j)),typeof tt>"u"&&!$)throw new $TypeError$1("intrinsic "+_+" exists, but is not available. Please file an issue!");return{alias:et,name:j,value:tt}}throw new $SyntaxError$1("intrinsic "+_+" does not exist!")},getIntrinsic$1=function(_,$){if(typeof _!="string"||_.length===0)throw new $TypeError$1("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof $!="boolean")throw new $TypeError$1('"allowMissing" argument must be a boolean');if($exec$1(/^%?[^%]*%?$/,_)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var j=stringToPath$1(_),et=j.length>0?j[0]:"",tt=getBaseIntrinsic$1("%"+et+"%",$),rt=tt.name,nt=tt.value,it=!1,st=tt.alias;st&&(et=st[0],$spliceApply$1(j,$concat$1([0,1],st)));for(var ot=1,at=!0;ot=j.length){var wt=$gOPD$2(nt,ut);at=!!wt,at&&"get"in wt&&!("originalValue"in wt.get)?nt=wt.get:nt=nt[ut]}else at=hasOwn$2(nt,ut),nt=nt[ut];at&&!it&&(INTRINSICS$1[rt]=nt)}}return nt},callBind$1={exports:{}};(function(a){var _=functionBind$2,$=getIntrinsic$1,j=$("%Function.prototype.apply%"),et=$("%Function.prototype.call%"),tt=$("%Reflect.apply%",!0)||_.call(et,j),rt=$("%Object.getOwnPropertyDescriptor%",!0),nt=$("%Object.defineProperty%",!0),it=$("%Math.max%");if(nt)try{nt({},"a",{value:1})}catch{nt=null}a.exports=function(at){var ut=tt(_,et,arguments);if(rt&&nt){var ht=rt(ut,"length");ht.configurable&&nt(ut,"length",{value:1+it(0,at.length-(arguments.length-1))})}return ut};var st=function(){return tt(_,j,arguments)};nt?nt(a.exports,"apply",{value:st}):a.exports.apply=st})(callBind$1);var callBindExports=callBind$1.exports,GetIntrinsic$1=getIntrinsic$1,callBind=callBindExports,$indexOf$1=callBind(GetIntrinsic$1("String.prototype.indexOf")),callBound$3=function(_,$){var j=GetIntrinsic$1(_,!!$);return typeof j=="function"&&$indexOf$1(_,".prototype.")>-1?callBind(j):j},hasToStringTag$4=shams(),callBound$2=callBound$3,$toString$2=callBound$2("Object.prototype.toString"),isStandardArguments=function(_){return hasToStringTag$4&&_&&typeof _=="object"&&Symbol.toStringTag in _?!1:$toString$2(_)==="[object Arguments]"},isLegacyArguments=function(_){return isStandardArguments(_)?!0:_!==null&&typeof _=="object"&&typeof _.length=="number"&&_.length>=0&&$toString$2(_)!=="[object Array]"&&$toString$2(_.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments=supportsStandardArguments?isStandardArguments:isLegacyArguments,toStr$3=Object.prototype.toString,fnToStr$1=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag$3=shams(),getProto$1=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag$3)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(_){if(typeof _!="function")return!1;if(isFnRegex.test(fnToStr$1.call(_)))return!0;if(!hasToStringTag$3){var $=toStr$3.call(_);return $==="[object GeneratorFunction]"}if(!getProto$1)return!1;if(typeof GeneratorFunction>"u"){var j=getGeneratorFunc();GeneratorFunction=j?getProto$1(j):!1}return getProto$1(_)===GeneratorFunction},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(a){a!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(_){try{var $=fnToStr.call(_);return constructorRegex.test($)}catch{return!1}},tryFunctionObject=function(_){try{return isES6ClassFn(_)?!1:(fnToStr.call(_),!0)}catch{return!1}},toStr$2=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$2=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all=document.all;toStr$2.call(all)===toStr$2.call(document.all)&&(isDDA=function(_){if((isIE68||!_)&&(typeof _>"u"||typeof _=="object"))try{var $=toStr$2.call(_);return($===ddaClass||$===ddaClass2||$===ddaClass3||$===objectClass)&&_("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(_){if(isDDA(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;try{reflectApply(_,null,badArrayLike)}catch($){if($!==isCallableMarker)return!1}return!isES6ClassFn(_)&&tryFunctionObject(_)}:function(_){if(isDDA(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;if(hasToStringTag$2)return tryFunctionObject(_);if(isES6ClassFn(_))return!1;var $=toStr$2.call(_);return $!==fnClass&&$!==genClass&&!/^\[object HTML/.test($)?!1:tryFunctionObject(_)},isCallable=isCallable$1,toStr$1=Object.prototype.toString,hasOwnProperty$2=Object.prototype.hasOwnProperty,forEachArray=function(_,$,j){for(var et=0,tt=_.length;et=3&&(et=j),toStr$1.call(_)==="[object Array]"?forEachArray(_,$,et):typeof _=="string"?forEachString(_,$,et):forEachObject(_,$,et)},forEach_1=forEach$4,possibleNames=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],g$3=typeof globalThis>"u"?commonjsGlobal:globalThis,availableTypedArrays$2=function(){for(var _=[],$=0;$"u"||!getProto?undefined$1:getProto(Uint8Array),INTRINSICS={"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto)try{null.error}catch(a){var errorProto=getProto(getProto(a));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function a(_){var $;if(_==="%AsyncFunction%")$=getEvalledConstructor("async function () {}");else if(_==="%GeneratorFunction%")$=getEvalledConstructor("function* () {}");else if(_==="%AsyncGeneratorFunction%")$=getEvalledConstructor("async function* () {}");else if(_==="%AsyncGenerator%"){var j=a("%AsyncGeneratorFunction%");j&&($=j.prototype)}else if(_==="%AsyncIteratorPrototype%"){var et=a("%AsyncGenerator%");et&&getProto&&($=getProto(et.prototype))}return INTRINSICS[_]=$,$},LEGACY_ALIASES={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind$3=functionBind,hasOwn$1=src$3,$concat=bind$3.call(Function.call,Array.prototype.concat),$spliceApply=bind$3.call(Function.apply,Array.prototype.splice),$replace=bind$3.call(Function.call,String.prototype.replace),$strSlice=bind$3.call(Function.call,String.prototype.slice),$exec=bind$3.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(_){var $=$strSlice(_,0,1),j=$strSlice(_,-1);if($==="%"&&j!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&$!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var et=[];return $replace(_,rePropName,function(tt,rt,nt,it){et[et.length]=nt?$replace(it,reEscapeChar,"$1"):rt||tt}),et},getBaseIntrinsic=function(_,$){var j=_,et;if(hasOwn$1(LEGACY_ALIASES,j)&&(et=LEGACY_ALIASES[j],j="%"+et[0]+"%"),hasOwn$1(INTRINSICS,j)){var tt=INTRINSICS[j];if(tt===needsEval&&(tt=doEval(j)),typeof tt>"u"&&!$)throw new $TypeError("intrinsic "+_+" exists, but is not available. Please file an issue!");return{alias:et,name:j,value:tt}}throw new $SyntaxError("intrinsic "+_+" does not exist!")},getIntrinsic=function(_,$){if(typeof _!="string"||_.length===0)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof $!="boolean")throw new $TypeError('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,_)===null)throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var j=stringToPath(_),et=j.length>0?j[0]:"",tt=getBaseIntrinsic("%"+et+"%",$),rt=tt.name,nt=tt.value,it=!1,st=tt.alias;st&&(et=st[0],$spliceApply(j,$concat([0,1],st)));for(var ot=1,at=!0;ot=j.length){var wt=$gOPD$1(nt,ut);at=!!wt,at&&"get"in wt&&!("originalValue"in wt.get)?nt=wt.get:nt=nt[ut]}else at=hasOwn$1(nt,ut),nt=nt[ut];at&&!it&&(INTRINSICS[rt]=nt)}}return nt},GetIntrinsic=getIntrinsic,$gOPD=GetIntrinsic("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd=$gOPD,forEach$3=forEach_1,availableTypedArrays$1=availableTypedArrays$2,callBound$1=callBound$3,$toString$1=callBound$1("Object.prototype.toString"),hasToStringTag$1=shams(),gOPD$1=gopd,g$2=typeof globalThis>"u"?commonjsGlobal:globalThis,typedArrays$1=availableTypedArrays$1(),$indexOf=callBound$1("Array.prototype.indexOf",!0)||function(_,$){for(var j=0;j<_.length;j+=1)if(_[j]===$)return j;return-1},$slice$1=callBound$1("String.prototype.slice"),toStrTags$1={},getPrototypeOf$6=Object.getPrototypeOf;hasToStringTag$1&&gOPD$1&&getPrototypeOf$6&&forEach$3(typedArrays$1,function(a){var _=new g$2[a];if(Symbol.toStringTag in _){var $=getPrototypeOf$6(_),j=gOPD$1($,Symbol.toStringTag);if(!j){var et=getPrototypeOf$6($);j=gOPD$1(et,Symbol.toStringTag)}toStrTags$1[a]=j.get}});var tryTypedArrays$1=function(_){var $=!1;return forEach$3(toStrTags$1,function(j,et){if(!$)try{$=j.call(_)===et}catch{}}),$},isTypedArray$3=function(_){if(!_||typeof _!="object")return!1;if(!hasToStringTag$1||!(Symbol.toStringTag in _)){var $=$slice$1($toString$1(_),8,-1);return $indexOf(typedArrays$1,$)>-1}return gOPD$1?tryTypedArrays$1(_):!1},forEach$2=forEach_1,availableTypedArrays=availableTypedArrays$2,callBound=callBound$3,gOPD=gopd,$toString=callBound("Object.prototype.toString"),hasToStringTag=shams(),g$1=typeof globalThis>"u"?commonjsGlobal:globalThis,typedArrays=availableTypedArrays(),$slice=callBound("String.prototype.slice"),toStrTags={},getPrototypeOf$5=Object.getPrototypeOf;hasToStringTag&&gOPD&&getPrototypeOf$5&&forEach$2(typedArrays,function(a){if(typeof g$1[a]=="function"){var _=new g$1[a];if(Symbol.toStringTag in _){var $=getPrototypeOf$5(_),j=gOPD($,Symbol.toStringTag);if(!j){var et=getPrototypeOf$5($);j=gOPD(et,Symbol.toStringTag)}toStrTags[a]=j.get}}});var tryTypedArrays=function(_){var $=!1;return forEach$2(toStrTags,function(j,et){if(!$)try{var tt=j.call(_);tt===et&&($=tt)}catch{}}),$},isTypedArray$2=isTypedArray$3,whichTypedArray=function(_){return isTypedArray$2(_)?!hasToStringTag||!(Symbol.toStringTag in _)?$slice($toString(_),8,-1):tryTypedArrays(_):!1};(function(a){var _=isArguments,$=isGeneratorFunction,j=whichTypedArray,et=isTypedArray$3;function tt(fr){return fr.call.bind(fr)}var rt=typeof BigInt<"u",nt=typeof Symbol<"u",it=tt(Object.prototype.toString),st=tt(Number.prototype.valueOf),ot=tt(String.prototype.valueOf),at=tt(Boolean.prototype.valueOf);if(rt)var ut=tt(BigInt.prototype.valueOf);if(nt)var ht=tt(Symbol.prototype.valueOf);function yt(fr,_r){if(typeof fr!="object")return!1;try{return _r(fr),!0}catch{return!1}}a.isArgumentsObject=_,a.isGeneratorFunction=$,a.isTypedArray=et;function wt(fr){return typeof Promise<"u"&&fr instanceof Promise||fr!==null&&typeof fr=="object"&&typeof fr.then=="function"&&typeof fr.catch=="function"}a.isPromise=wt;function Ct(fr){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(fr):et(fr)||Nt(fr)}a.isArrayBufferView=Ct;function Pt(fr){return j(fr)==="Uint8Array"}a.isUint8Array=Pt;function $t(fr){return j(fr)==="Uint8ClampedArray"}a.isUint8ClampedArray=$t;function Mt(fr){return j(fr)==="Uint16Array"}a.isUint16Array=Mt;function Bt(fr){return j(fr)==="Uint32Array"}a.isUint32Array=Bt;function Dt(fr){return j(fr)==="Int8Array"}a.isInt8Array=Dt;function zt(fr){return j(fr)==="Int16Array"}a.isInt16Array=zt;function Ot(fr){return j(fr)==="Int32Array"}a.isInt32Array=Ot;function It(fr){return j(fr)==="Float32Array"}a.isFloat32Array=It;function Lt(fr){return j(fr)==="Float64Array"}a.isFloat64Array=Lt;function Ft(fr){return j(fr)==="BigInt64Array"}a.isBigInt64Array=Ft;function jt(fr){return j(fr)==="BigUint64Array"}a.isBigUint64Array=jt;function bt(fr){return it(fr)==="[object Map]"}bt.working=typeof Map<"u"&&bt(new Map);function vt(fr){return typeof Map>"u"?!1:bt.working?bt(fr):fr instanceof Map}a.isMap=vt;function ct(fr){return it(fr)==="[object Set]"}ct.working=typeof Set<"u"&&ct(new Set);function dt(fr){return typeof Set>"u"?!1:ct.working?ct(fr):fr instanceof Set}a.isSet=dt;function mt(fr){return it(fr)==="[object WeakMap]"}mt.working=typeof WeakMap<"u"&&mt(new WeakMap);function xt(fr){return typeof WeakMap>"u"?!1:mt.working?mt(fr):fr instanceof WeakMap}a.isWeakMap=xt;function At(fr){return it(fr)==="[object WeakSet]"}At.working=typeof WeakSet<"u"&&At(new WeakSet);function Rt(fr){return At(fr)}a.isWeakSet=Rt;function St(fr){return it(fr)==="[object ArrayBuffer]"}St.working=typeof ArrayBuffer<"u"&&St(new ArrayBuffer);function Tt(fr){return typeof ArrayBuffer>"u"?!1:St.working?St(fr):fr instanceof ArrayBuffer}a.isArrayBuffer=Tt;function Et(fr){return it(fr)==="[object DataView]"}Et.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Et(new DataView(new ArrayBuffer(1),0,1));function Nt(fr){return typeof DataView>"u"?!1:Et.working?Et(fr):fr instanceof DataView}a.isDataView=Nt;var tr=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ir(fr){return it(fr)==="[object SharedArrayBuffer]"}function nr(fr){return typeof tr>"u"?!1:(typeof ir.working>"u"&&(ir.working=ir(new tr)),ir.working?ir(fr):fr instanceof tr)}a.isSharedArrayBuffer=nr;function Zt(fr){return it(fr)==="[object AsyncFunction]"}a.isAsyncFunction=Zt;function Kt(fr){return it(fr)==="[object Map Iterator]"}a.isMapIterator=Kt;function Qt(fr){return it(fr)==="[object Set Iterator]"}a.isSetIterator=Qt;function Ht(fr){return it(fr)==="[object Generator]"}a.isGeneratorObject=Ht;function qt(fr){return it(fr)==="[object WebAssembly.Module]"}a.isWebAssemblyCompiledModule=qt;function Jt(fr){return yt(fr,st)}a.isNumberObject=Jt;function ur(fr){return yt(fr,ot)}a.isStringObject=ur;function xr(fr){return yt(fr,at)}a.isBooleanObject=xr;function pr(fr){return rt&&yt(fr,ut)}a.isBigIntObject=pr;function Cr(fr){return nt&&yt(fr,ht)}a.isSymbolObject=Cr;function Mr(fr){return Jt(fr)||ur(fr)||xr(fr)||pr(fr)||Cr(fr)}a.isBoxedPrimitive=Mr;function lr(fr){return typeof Uint8Array<"u"&&(Tt(fr)||nr(fr))}a.isAnyArrayBuffer=lr,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(fr){Object.defineProperty(a,fr,{enumerable:!1,value:function(){throw new Error(fr+" is not supported in userland")}})})})(types$1);var isBufferBrowser=function(_){return _&&typeof _=="object"&&typeof _.copy=="function"&&typeof _.fill=="function"&&typeof _.readUInt8=="function"};(function(a){var _={},$=Object.getOwnPropertyDescriptors||function(tr){for(var ir=Object.keys(tr),nr={},Zt=0;Zt=Zt)return Ht;switch(Ht){case"%s":return String(nr[ir++]);case"%d":return Number(nr[ir++]);case"%j":try{return JSON.stringify(nr[ir++])}catch{return"[Circular]"}default:return Ht}}),Qt=nr[ir];ir"u")return function(){return a.deprecate(Nt,tr).apply(this,arguments)};var ir=!1;function nr(){if(!ir){if(process$1$1.throwDeprecation)throw new Error(tr);process$1$1.traceDeprecation?console.trace(tr):console.error(tr),ir=!0}return Nt.apply(this,arguments)}return nr};var et={},tt=/^$/;if(_.NODE_DEBUG){var rt=_.NODE_DEBUG;rt=rt.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),tt=new RegExp("^"+rt+"$","i")}a.debuglog=function(Nt){if(Nt=Nt.toUpperCase(),!et[Nt])if(tt.test(Nt)){var tr=process$1$1.pid;et[Nt]=function(){var ir=a.format.apply(a,arguments);console.error("%s %d: %s",Nt,tr,ir)}}else et[Nt]=function(){};return et[Nt]};function nt(Nt,tr){var ir={seen:[],stylize:st};return arguments.length>=3&&(ir.depth=arguments[2]),arguments.length>=4&&(ir.colors=arguments[3]),$t(tr)?ir.showHidden=tr:tr&&a._extend(ir,tr),It(ir.showHidden)&&(ir.showHidden=!1),It(ir.depth)&&(ir.depth=2),It(ir.colors)&&(ir.colors=!1),It(ir.customInspect)&&(ir.customInspect=!0),ir.colors&&(ir.stylize=it),at(ir,Nt,ir.depth)}a.inspect=nt,nt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},nt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function it(Nt,tr){var ir=nt.styles[tr];return ir?"\x1B["+nt.colors[ir][0]+"m"+Nt+"\x1B["+nt.colors[ir][1]+"m":Nt}function st(Nt,tr){return Nt}function ot(Nt){var tr={};return Nt.forEach(function(ir,nr){tr[ir]=!0}),tr}function at(Nt,tr,ir){if(Nt.customInspect&&tr&&vt(tr.inspect)&&tr.inspect!==a.inspect&&!(tr.constructor&&tr.constructor.prototype===tr)){var nr=tr.inspect(ir,Nt);return zt(nr)||(nr=at(Nt,nr,ir)),nr}var Zt=ut(Nt,tr);if(Zt)return Zt;var Kt=Object.keys(tr),Qt=ot(Kt);if(Nt.showHidden&&(Kt=Object.getOwnPropertyNames(tr)),bt(tr)&&(Kt.indexOf("message")>=0||Kt.indexOf("description")>=0))return ht(tr);if(Kt.length===0){if(vt(tr)){var Ht=tr.name?": "+tr.name:"";return Nt.stylize("[Function"+Ht+"]","special")}if(Lt(tr))return Nt.stylize(RegExp.prototype.toString.call(tr),"regexp");if(jt(tr))return Nt.stylize(Date.prototype.toString.call(tr),"date");if(bt(tr))return ht(tr)}var qt="",Jt=!1,ur=["{","}"];if(Pt(tr)&&(Jt=!0,ur=["[","]"]),vt(tr)){var xr=tr.name?": "+tr.name:"";qt=" [Function"+xr+"]"}if(Lt(tr)&&(qt=" "+RegExp.prototype.toString.call(tr)),jt(tr)&&(qt=" "+Date.prototype.toUTCString.call(tr)),bt(tr)&&(qt=" "+ht(tr)),Kt.length===0&&(!Jt||tr.length==0))return ur[0]+qt+ur[1];if(ir<0)return Lt(tr)?Nt.stylize(RegExp.prototype.toString.call(tr),"regexp"):Nt.stylize("[Object]","special");Nt.seen.push(tr);var pr;return Jt?pr=yt(Nt,tr,ir,Qt,Kt):pr=Kt.map(function(Cr){return wt(Nt,tr,ir,Qt,Cr,Jt)}),Nt.seen.pop(),Ct(pr,qt,ur)}function ut(Nt,tr){if(It(tr))return Nt.stylize("undefined","undefined");if(zt(tr)){var ir="'"+JSON.stringify(tr).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Nt.stylize(ir,"string")}if(Dt(tr))return Nt.stylize(""+tr,"number");if($t(tr))return Nt.stylize(""+tr,"boolean");if(Mt(tr))return Nt.stylize("null","null")}function ht(Nt){return"["+Error.prototype.toString.call(Nt)+"]"}function yt(Nt,tr,ir,nr,Zt){for(var Kt=[],Qt=0,Ht=tr.length;Qt-1&&(Kt?Ht=Ht.split(` `).map(function(Jt){return" "+Jt}).join(` `).slice(2):Ht=` @@ -433,13 +433,13 @@ function print() { __p += __j.call(arguments, '') } `))):Ht=Nt.stylize("[Circular]","special")),It(Qt)){if(Kt&&Zt.match(/^\d+$/))return Ht;Qt=JSON.stringify(""+Zt),Qt.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Qt=Qt.slice(1,-1),Qt=Nt.stylize(Qt,"name")):(Qt=Qt.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Qt=Nt.stylize(Qt,"string"))}return Qt+": "+Ht}function Ct(Nt,tr,ir){var nr=Nt.reduce(function(Zt,Kt){return Kt.indexOf(` `)>=0,Zt+Kt.replace(/\u001b\[\d\d?m/g,"").length+1},0);return nr>60?ir[0]+(tr===""?"":tr+` `)+" "+Nt.join(`, - `)+" "+ir[1]:ir[0]+tr+" "+Nt.join(", ")+" "+ir[1]}a.types=types$1;function Pt(Nt){return Array.isArray(Nt)}a.isArray=Pt;function $t(Nt){return typeof Nt=="boolean"}a.isBoolean=$t;function Mt(Nt){return Nt===null}a.isNull=Mt;function Bt(Nt){return Nt==null}a.isNullOrUndefined=Bt;function Dt(Nt){return typeof Nt=="number"}a.isNumber=Dt;function zt(Nt){return typeof Nt=="string"}a.isString=zt;function Ot(Nt){return typeof Nt=="symbol"}a.isSymbol=Ot;function It(Nt){return Nt===void 0}a.isUndefined=It;function Lt(Nt){return Ft(Nt)&&dt(Nt)==="[object RegExp]"}a.isRegExp=Lt,a.types.isRegExp=Lt;function Ft(Nt){return typeof Nt=="object"&&Nt!==null}a.isObject=Ft;function jt(Nt){return Ft(Nt)&&dt(Nt)==="[object Date]"}a.isDate=jt,a.types.isDate=jt;function bt(Nt){return Ft(Nt)&&(dt(Nt)==="[object Error]"||Nt instanceof Error)}a.isError=bt,a.types.isNativeError=bt;function vt(Nt){return typeof Nt=="function"}a.isFunction=vt;function ct(Nt){return Nt===null||typeof Nt=="boolean"||typeof Nt=="number"||typeof Nt=="string"||typeof Nt=="symbol"||typeof Nt>"u"}a.isPrimitive=ct,a.isBuffer=isBufferBrowser;function dt(Nt){return Object.prototype.toString.call(Nt)}function mt(Nt){return Nt<10?"0"+Nt.toString(10):Nt.toString(10)}var xt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function At(){var Nt=new Date,tr=[mt(Nt.getHours()),mt(Nt.getMinutes()),mt(Nt.getSeconds())].join(":");return[Nt.getDate(),xt[Nt.getMonth()],tr].join(" ")}a.log=function(){console.log("%s - %s",At(),a.format.apply(a,arguments))},a.inherits=inherits_browserExports,a._extend=function(Nt,tr){if(!tr||!Ft(tr))return Nt;for(var ir=Object.keys(tr),nr=ir.length;nr--;)Nt[ir[nr]]=tr[ir[nr]];return Nt};function Rt(Nt,tr){return Object.prototype.hasOwnProperty.call(Nt,tr)}var St=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;a.promisify=function(tr){if(typeof tr!="function")throw new TypeError('The "original" argument must be of type Function');if(St&&tr[St]){var ir=tr[St];if(typeof ir!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ir,St,{value:ir,enumerable:!1,writable:!1,configurable:!0}),ir}function ir(){for(var nr,Zt,Kt=new Promise(function(qt,Jt){nr=qt,Zt=Jt}),Qt=[],Ht=0;Ht0?this.tail.next=Pt:this.head=Pt,this.tail=Pt,++this.length}},{key:"unshift",value:function(Ct){var Pt={data:Ct,next:this.head};this.length===0&&(this.tail=Pt),this.head=Pt,++this.length}},{key:"shift",value:function(){if(this.length!==0){var Ct=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,Ct}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(Ct){if(this.length===0)return"";for(var Pt=this.head,$t=""+Pt.data;Pt=Pt.next;)$t+=Ct+Pt.data;return $t}},{key:"concat",value:function(Ct){if(this.length===0)return st.alloc(0);for(var Pt=st.allocUnsafe(Ct>>>0),$t=this.head,Mt=0;$t;)ht($t.data,Pt,Mt),Mt+=$t.data.length,$t=$t.next;return Pt}},{key:"consume",value:function(Ct,Pt){var $t;return CtBt.length?Bt.length:Ct;if(Dt===Bt.length?Mt+=Bt:Mt+=Bt.slice(0,Ct),Ct-=Dt,Ct===0){Dt===Bt.length?(++$t,Pt.next?this.head=Pt.next:this.head=this.tail=null):(this.head=Pt,Pt.data=Bt.slice(Dt));break}++$t}return this.length-=$t,Mt}},{key:"_getBuffer",value:function(Ct){var Pt=st.allocUnsafe(Ct),$t=this.head,Mt=1;for($t.data.copy(Pt),Ct-=$t.data.length;$t=$t.next;){var Bt=$t.data,Dt=Ct>Bt.length?Bt.length:Ct;if(Bt.copy(Pt,Pt.length-Ct,0,Dt),Ct-=Dt,Ct===0){Dt===Bt.length?(++Mt,$t.next?this.head=$t.next:this.head=this.tail=null):(this.head=$t,$t.data=Bt.slice(Dt));break}++Mt}return this.length-=Mt,Pt}},{key:ut,value:function(Ct,Pt){return at(this,_(_({},Pt),{},{depth:0,customInspect:!1}))}}]),yt}(),buffer_list}function destroy(a,_){var $=this,j=this._readableState&&this._readableState.destroyed,et=this._writableState&&this._writableState.destroyed;return j||et?(_?_(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1$1.nextTick(emitErrorNT,this,a)):process$1$1.nextTick(emitErrorNT,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(tt){!_&&tt?$._writableState?$._writableState.errorEmitted?process$1$1.nextTick(emitCloseNT,$):($._writableState.errorEmitted=!0,process$1$1.nextTick(emitErrorAndCloseNT,$,tt)):process$1$1.nextTick(emitErrorAndCloseNT,$,tt):_?(process$1$1.nextTick(emitCloseNT,$),_(tt)):process$1$1.nextTick(emitCloseNT,$)}),this)}function emitErrorAndCloseNT(a,_){emitErrorNT(a,_),emitCloseNT(a)}function emitCloseNT(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(a,_){a.emit("error",_)}function errorOrDestroy(a,_){var $=a._readableState,j=a._writableState;$&&$.autoDestroy||j&&j.autoDestroy?a.destroy(_):a.emit("error",_)}var destroy_1$1={destroy,undestroy,errorOrDestroy},errorsBrowser={};function _inheritsLoose(a,_){a.prototype=Object.create(_.prototype),a.prototype.constructor=a,a.__proto__=_}var codes={};function createErrorType(a,_,$){$||($=Error);function j(tt,rt,nt){return typeof _=="string"?_:_(tt,rt,nt)}var et=function(tt){_inheritsLoose(rt,tt);function rt(nt,it,st){return tt.call(this,j(nt,it,st))||this}return rt}($);et.prototype.name=$.name,et.prototype.code=a,codes[a]=et}function oneOf(a,_){if(Array.isArray(a)){var $=a.length;return a=a.map(function(j){return String(j)}),$>2?"one of ".concat(_," ").concat(a.slice(0,$-1).join(", "),", or ")+a[$-1]:$===2?"one of ".concat(_," ").concat(a[0]," or ").concat(a[1]):"of ".concat(_," ").concat(a[0])}else return"of ".concat(_," ").concat(String(a))}function startsWith(a,_,$){return a.substr(0,_.length)===_}function endsWith$2(a,_,$){return($===void 0||$>a.length)&&($=a.length),a.substring($-_.length,$)===_}function includes(a,_,$){return typeof $!="number"&&($=0),$+_.length>a.length?!1:a.indexOf(_,$)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(a,_){return'The value "'+_+'" is invalid for option "'+a+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(a,_,$){var j;typeof _=="string"&&startsWith(_,"not ")?(j="must not be",_=_.replace(/^not /,"")):j="must be";var et;if(endsWith$2(a," argument"))et="The ".concat(a," ").concat(j," ").concat(oneOf(_,"type"));else{var tt=includes(a,".")?"property":"argument";et='The "'.concat(a,'" ').concat(tt," ").concat(j," ").concat(oneOf(_,"type"))}return et+=". Received type ".concat(typeof $),et},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");errorsBrowser.codes=codes;var ERR_INVALID_OPT_VALUE=errorsBrowser.codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(a,_,$){return a.highWaterMark!=null?a.highWaterMark:_?a[$]:null}function getHighWaterMark(a,_,$,j){var et=highWaterMarkFrom(_,j,$);if(et!=null){if(!(isFinite(et)&&Math.floor(et)===et)||et<0){var tt=j?$:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(tt,et)}return Math.floor(et)}return a.objectMode?16:16*1024}var state={getHighWaterMark},browser$c=deprecate;function deprecate(a,_){if(config$3("noDeprecation"))return a;var $=!1;function j(){if(!$){if(config$3("throwDeprecation"))throw new Error(_);config$3("traceDeprecation")?console.trace(_):console.warn(_),$=!0}return a.apply(this,arguments)}return j}function config$3(a){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var _=commonjsGlobal.localStorage[a];return _==null?!1:String(_).toLowerCase()==="true"}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=It;function a(nr){var Zt=this;this.next=null,this.entry=null,this.finish=function(){ir(Zt,nr)}}var _;It.WritableState=zt;var $={deprecate:browser$c},j=streamBrowser$1,et=buffer$1.Buffer,tt=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function rt(nr){return et.from(nr)}function nt(nr){return et.isBuffer(nr)||nr instanceof tt}var it=destroy_1$1,st=state,ot=st.getHighWaterMark,at=errorsBrowser.codes,ut=at.ERR_INVALID_ARG_TYPE,ht=at.ERR_METHOD_NOT_IMPLEMENTED,yt=at.ERR_MULTIPLE_CALLBACK,wt=at.ERR_STREAM_CANNOT_PIPE,Ct=at.ERR_STREAM_DESTROYED,Pt=at.ERR_STREAM_NULL_VALUES,$t=at.ERR_STREAM_WRITE_AFTER_END,Mt=at.ERR_UNKNOWN_ENCODING,Bt=it.errorOrDestroy;inherits_browserExports(It,j);function Dt(){}function zt(nr,Zt,Kt){_=_||require_stream_duplex$1(),nr=nr||{},typeof Kt!="boolean"&&(Kt=Zt instanceof _),this.objectMode=!!nr.objectMode,Kt&&(this.objectMode=this.objectMode||!!nr.writableObjectMode),this.highWaterMark=ot(this,nr,"writableHighWaterMark",Kt),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Qt=nr.decodeStrings===!1;this.decodeStrings=!Qt,this.defaultEncoding=nr.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Ht){mt(Zt,Ht)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=nr.emitClose!==!1,this.autoDestroy=!!nr.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}zt.prototype.getBuffer=function(){for(var Zt=this.bufferedRequest,Kt=[];Zt;)Kt.push(Zt),Zt=Zt.next;return Kt},function(){try{Object.defineProperty(zt.prototype,"buffer",{get:$.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Ot;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ot=Function.prototype[Symbol.hasInstance],Object.defineProperty(It,Symbol.hasInstance,{value:function(Zt){return Ot.call(this,Zt)?!0:this!==It?!1:Zt&&Zt._writableState instanceof zt}})):Ot=function(Zt){return Zt instanceof this};function It(nr){_=_||require_stream_duplex$1();var Zt=this instanceof _;if(!Zt&&!Ot.call(It,this))return new It(nr);this._writableState=new zt(nr,this,Zt),this.writable=!0,nr&&(typeof nr.write=="function"&&(this._write=nr.write),typeof nr.writev=="function"&&(this._writev=nr.writev),typeof nr.destroy=="function"&&(this._destroy=nr.destroy),typeof nr.final=="function"&&(this._final=nr.final)),j.call(this)}It.prototype.pipe=function(){Bt(this,new wt)};function Lt(nr,Zt){var Kt=new $t;Bt(nr,Kt),process$1$1.nextTick(Zt,Kt)}function Ft(nr,Zt,Kt,Qt){var Ht;return Kt===null?Ht=new Pt:typeof Kt!="string"&&!Zt.objectMode&&(Ht=new ut("chunk",["string","Buffer"],Kt)),Ht?(Bt(nr,Ht),process$1$1.nextTick(Qt,Ht),!1):!0}It.prototype.write=function(nr,Zt,Kt){var Qt=this._writableState,Ht=!1,qt=!Qt.objectMode&&nt(nr);return qt&&!et.isBuffer(nr)&&(nr=rt(nr)),typeof Zt=="function"&&(Kt=Zt,Zt=null),qt?Zt="buffer":Zt||(Zt=Qt.defaultEncoding),typeof Kt!="function"&&(Kt=Dt),Qt.ending?Lt(this,Kt):(qt||Ft(this,Qt,nr,Kt))&&(Qt.pendingcb++,Ht=bt(this,Qt,qt,nr,Zt,Kt)),Ht},It.prototype.cork=function(){this._writableState.corked++},It.prototype.uncork=function(){var nr=this._writableState;nr.corked&&(nr.corked--,!nr.writing&&!nr.corked&&!nr.bufferProcessing&&nr.bufferedRequest&&Rt(this,nr))},It.prototype.setDefaultEncoding=function(Zt){if(typeof Zt=="string"&&(Zt=Zt.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Zt+"").toLowerCase())>-1))throw new Mt(Zt);return this._writableState.defaultEncoding=Zt,this},Object.defineProperty(It.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function jt(nr,Zt,Kt){return!nr.objectMode&&nr.decodeStrings!==!1&&typeof Zt=="string"&&(Zt=et.from(Zt,Kt)),Zt}Object.defineProperty(It.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function bt(nr,Zt,Kt,Qt,Ht,qt){if(!Kt){var Jt=jt(Zt,Qt,Ht);Qt!==Jt&&(Kt=!0,Ht="buffer",Qt=Jt)}var ur=Zt.objectMode?1:Qt.length;Zt.length+=ur;var xr=Zt.length>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function utf8CheckIncomplete(a,_,$){var j=_.length-1;if(j<$)return 0;var et=utf8CheckByte(_[j]);return et>=0?(et>0&&(a.lastNeed=et-1),et):--j<$||et===-2?0:(et=utf8CheckByte(_[j]),et>=0?(et>0&&(a.lastNeed=et-2),et):--j<$||et===-2?0:(et=utf8CheckByte(_[j]),et>=0?(et>0&&(et===2?et=0:a.lastNeed=et-3),et):0))}function utf8CheckExtraBytes(a,_,$){if((_[0]&192)!==128)return a.lastNeed=0,"�";if(a.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return a.lastNeed=1,"�";if(a.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return a.lastNeed=2,"�"}}function utf8FillLast(a){var _=this.lastTotal-this.lastNeed,$=utf8CheckExtraBytes(this,a);if($!==void 0)return $;if(this.lastNeed<=a.length)return a.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,_,0,a.length),this.lastNeed-=a.length}function utf8Text(a,_){var $=utf8CheckIncomplete(this,a,_);if(!this.lastNeed)return a.toString("utf8",_);this.lastTotal=$;var j=a.length-($-this.lastNeed);return a.copy(this.lastChar,0,j),a.toString("utf8",_,j)}function utf8End(a){var _=a&&a.length?this.write(a):"";return this.lastNeed?_+"�":_}function utf16Text(a,_){if((a.length-_)%2===0){var $=a.toString("utf16le",_);if($){var j=$.charCodeAt($.length-1);if(j>=55296&&j<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],$.slice(0,-1)}return $}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",_,a.length-1)}function utf16End(a){var _=a&&a.length?this.write(a):"";if(this.lastNeed){var $=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,$)}return _}function base64Text(a,_){var $=(a.length-_)%3;return $===0?a.toString("base64",_):(this.lastNeed=3-$,this.lastTotal=3,$===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",_,a.length-$))}function base64End(a){var _=a&&a.length?this.write(a):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function simpleWrite(a){return a.toString(this.encoding)}function simpleEnd(a){return a&&a.length?this.write(a):""}var ERR_STREAM_PREMATURE_CLOSE=errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;function once$1(a){var _=!1;return function(){if(!_){_=!0;for(var $=arguments.length,j=new Array($),et=0;et<$;et++)j[et]=arguments[et];a.apply(this,j)}}}function noop$9(){}function isRequest$2(a){return a.setHeader&&typeof a.abort=="function"}function eos$1(a,_,$){if(typeof _=="function")return eos$1(a,null,_);_||(_={}),$=once$1($||noop$9);var j=_.readable||_.readable!==!1&&a.readable,et=_.writable||_.writable!==!1&&a.writable,tt=function(){a.writable||nt()},rt=a._writableState&&a._writableState.finished,nt=function(){et=!1,rt=!0,j||$.call(a)},it=a._readableState&&a._readableState.endEmitted,st=function(){j=!1,it=!0,et||$.call(a)},ot=function(yt){$.call(a,yt)},at=function(){var yt;if(j&&!it)return(!a._readableState||!a._readableState.ended)&&(yt=new ERR_STREAM_PREMATURE_CLOSE),$.call(a,yt);if(et&&!rt)return(!a._writableState||!a._writableState.ended)&&(yt=new ERR_STREAM_PREMATURE_CLOSE),$.call(a,yt)},ut=function(){a.req.on("finish",nt)};return isRequest$2(a)?(a.on("complete",nt),a.on("abort",at),a.req?ut():a.on("request",ut)):et&&!a._writableState&&(a.on("end",tt),a.on("close",tt)),a.on("end",st),a.on("finish",nt),_.error!==!1&&a.on("error",ot),a.on("close",at),function(){a.removeListener("complete",nt),a.removeListener("abort",at),a.removeListener("request",ut),a.req&&a.req.removeListener("finish",nt),a.removeListener("end",tt),a.removeListener("close",tt),a.removeListener("finish",nt),a.removeListener("end",st),a.removeListener("error",ot),a.removeListener("close",at)}}var endOfStream=eos$1,async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var a;function _(Mt,Bt,Dt){return Bt=$(Bt),Bt in Mt?Object.defineProperty(Mt,Bt,{value:Dt,enumerable:!0,configurable:!0,writable:!0}):Mt[Bt]=Dt,Mt}function $(Mt){var Bt=j(Mt,"string");return typeof Bt=="symbol"?Bt:String(Bt)}function j(Mt,Bt){if(typeof Mt!="object"||Mt===null)return Mt;var Dt=Mt[Symbol.toPrimitive];if(Dt!==void 0){var zt=Dt.call(Mt,Bt||"default");if(typeof zt!="object")return zt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Bt==="string"?String:Number)(Mt)}var et=endOfStream,tt=Symbol("lastResolve"),rt=Symbol("lastReject"),nt=Symbol("error"),it=Symbol("ended"),st=Symbol("lastPromise"),ot=Symbol("handlePromise"),at=Symbol("stream");function ut(Mt,Bt){return{value:Mt,done:Bt}}function ht(Mt){var Bt=Mt[tt];if(Bt!==null){var Dt=Mt[at].read();Dt!==null&&(Mt[st]=null,Mt[tt]=null,Mt[rt]=null,Bt(ut(Dt,!1)))}}function yt(Mt){process$1$1.nextTick(ht,Mt)}function wt(Mt,Bt){return function(Dt,zt){Mt.then(function(){if(Bt[it]){Dt(ut(void 0,!0));return}Bt[ot](Dt,zt)},zt)}}var Ct=Object.getPrototypeOf(function(){}),Pt=Object.setPrototypeOf((a={get stream(){return this[at]},next:function(){var Bt=this,Dt=this[nt];if(Dt!==null)return Promise.reject(Dt);if(this[it])return Promise.resolve(ut(void 0,!0));if(this[at].destroyed)return new Promise(function(Lt,Ft){process$1$1.nextTick(function(){Bt[nt]?Ft(Bt[nt]):Lt(ut(void 0,!0))})});var zt=this[st],Ot;if(zt)Ot=new Promise(wt(zt,this));else{var It=this[at].read();if(It!==null)return Promise.resolve(ut(It,!1));Ot=new Promise(this[ot])}return this[st]=Ot,Ot}},_(a,Symbol.asyncIterator,function(){return this}),_(a,"return",function(){var Bt=this;return new Promise(function(Dt,zt){Bt[at].destroy(null,function(Ot){if(Ot){zt(Ot);return}Dt(ut(void 0,!0))})})}),a),Ct),$t=function(Bt){var Dt,zt=Object.create(Pt,(Dt={},_(Dt,at,{value:Bt,writable:!0}),_(Dt,tt,{value:null,writable:!0}),_(Dt,rt,{value:null,writable:!0}),_(Dt,nt,{value:null,writable:!0}),_(Dt,it,{value:Bt._readableState.endEmitted,writable:!0}),_(Dt,ot,{value:function(It,Lt){var Ft=zt[at].read();Ft?(zt[st]=null,zt[tt]=null,zt[rt]=null,It(ut(Ft,!1))):(zt[tt]=It,zt[rt]=Lt)},writable:!0}),Dt));return zt[st]=null,et(Bt,function(Ot){if(Ot&&Ot.code!=="ERR_STREAM_PREMATURE_CLOSE"){var It=zt[rt];It!==null&&(zt[st]=null,zt[tt]=null,zt[rt]=null,It(Ot)),zt[nt]=Ot;return}var Lt=zt[tt];Lt!==null&&(zt[st]=null,zt[tt]=null,zt[rt]=null,Lt(ut(void 0,!0))),zt[it]=!0}),Bt.on("readable",yt.bind(null,zt)),zt};return async_iterator=$t,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=Lt;var a;Lt.ReadableState=It,eventsExports.EventEmitter;var _=function(Jt,ur){return Jt.listeners(ur).length},$=streamBrowser$1,j=buffer$1.Buffer,et=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tt(qt){return j.from(qt)}function rt(qt){return j.isBuffer(qt)||qt instanceof et}var nt=util$5,it;nt&&nt.debuglog?it=nt.debuglog("stream"):it=function(){};var st=requireBuffer_list(),ot=destroy_1$1,at=state,ut=at.getHighWaterMark,ht=errorsBrowser.codes,yt=ht.ERR_INVALID_ARG_TYPE,wt=ht.ERR_STREAM_PUSH_AFTER_EOF,Ct=ht.ERR_METHOD_NOT_IMPLEMENTED,Pt=ht.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,$t,Mt,Bt;inherits_browserExports(Lt,$);var Dt=ot.errorOrDestroy,zt=["error","close","destroy","pause","resume"];function Ot(qt,Jt,ur){if(typeof qt.prependListener=="function")return qt.prependListener(Jt,ur);!qt._events||!qt._events[Jt]?qt.on(Jt,ur):Array.isArray(qt._events[Jt])?qt._events[Jt].unshift(ur):qt._events[Jt]=[ur,qt._events[Jt]]}function It(qt,Jt,ur){a=a||require_stream_duplex$1(),qt=qt||{},typeof ur!="boolean"&&(ur=Jt instanceof a),this.objectMode=!!qt.objectMode,ur&&(this.objectMode=this.objectMode||!!qt.readableObjectMode),this.highWaterMark=ut(this,qt,"readableHighWaterMark",ur),this.buffer=new st,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=qt.emitClose!==!1,this.autoDestroy=!!qt.autoDestroy,this.destroyed=!1,this.defaultEncoding=qt.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,qt.encoding&&($t||($t=string_decoder$1.StringDecoder),this.decoder=new $t(qt.encoding),this.encoding=qt.encoding)}function Lt(qt){if(a=a||require_stream_duplex$1(),!(this instanceof Lt))return new Lt(qt);var Jt=this instanceof a;this._readableState=new It(qt,this,Jt),this.readable=!0,qt&&(typeof qt.read=="function"&&(this._read=qt.read),typeof qt.destroy=="function"&&(this._destroy=qt.destroy)),$.call(this)}Object.defineProperty(Lt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Jt){this._readableState&&(this._readableState.destroyed=Jt)}}),Lt.prototype.destroy=ot.destroy,Lt.prototype._undestroy=ot.undestroy,Lt.prototype._destroy=function(qt,Jt){Jt(qt)},Lt.prototype.push=function(qt,Jt){var ur=this._readableState,xr;return ur.objectMode?xr=!0:typeof qt=="string"&&(Jt=Jt||ur.defaultEncoding,Jt!==ur.encoding&&(qt=j.from(qt,Jt),Jt=""),xr=!0),Ft(this,qt,Jt,!1,xr)},Lt.prototype.unshift=function(qt){return Ft(this,qt,null,!0,!1)};function Ft(qt,Jt,ur,xr,pr){it("readableAddChunk",Jt);var Cr=qt._readableState;if(Jt===null)Cr.reading=!1,mt(qt,Cr);else{var Mr;if(pr||(Mr=bt(Cr,Jt)),Mr)Dt(qt,Mr);else if(Cr.objectMode||Jt&&Jt.length>0)if(typeof Jt!="string"&&!Cr.objectMode&&Object.getPrototypeOf(Jt)!==j.prototype&&(Jt=tt(Jt)),xr)Cr.endEmitted?Dt(qt,new Pt):jt(qt,Cr,Jt,!0);else if(Cr.ended)Dt(qt,new wt);else{if(Cr.destroyed)return!1;Cr.reading=!1,Cr.decoder&&!ur?(Jt=Cr.decoder.write(Jt),Cr.objectMode||Jt.length!==0?jt(qt,Cr,Jt,!1):Rt(qt,Cr)):jt(qt,Cr,Jt,!1)}else xr||(Cr.reading=!1,Rt(qt,Cr))}return!Cr.ended&&(Cr.length=vt?qt=vt:(qt--,qt|=qt>>>1,qt|=qt>>>2,qt|=qt>>>4,qt|=qt>>>8,qt|=qt>>>16,qt++),qt}function dt(qt,Jt){return qt<=0||Jt.length===0&&Jt.ended?0:Jt.objectMode?1:qt!==qt?Jt.flowing&&Jt.length?Jt.buffer.head.data.length:Jt.length:(qt>Jt.highWaterMark&&(Jt.highWaterMark=ct(qt)),qt<=Jt.length?qt:Jt.ended?Jt.length:(Jt.needReadable=!0,0))}Lt.prototype.read=function(qt){it("read",qt),qt=parseInt(qt,10);var Jt=this._readableState,ur=qt;if(qt!==0&&(Jt.emittedReadable=!1),qt===0&&Jt.needReadable&&((Jt.highWaterMark!==0?Jt.length>=Jt.highWaterMark:Jt.length>0)||Jt.ended))return it("read: emitReadable",Jt.length,Jt.ended),Jt.length===0&&Jt.ended?Kt(this):xt(this),null;if(qt=dt(qt,Jt),qt===0&&Jt.ended)return Jt.length===0&&Kt(this),null;var xr=Jt.needReadable;it("need readable",xr),(Jt.length===0||Jt.length-qt0?pr=Zt(qt,Jt):pr=null,pr===null?(Jt.needReadable=Jt.length<=Jt.highWaterMark,qt=0):(Jt.length-=qt,Jt.awaitDrain=0),Jt.length===0&&(Jt.ended||(Jt.needReadable=!0),ur!==qt&&Jt.ended&&Kt(this)),pr!==null&&this.emit("data",pr),pr};function mt(qt,Jt){if(it("onEofChunk"),!Jt.ended){if(Jt.decoder){var ur=Jt.decoder.end();ur&&ur.length&&(Jt.buffer.push(ur),Jt.length+=Jt.objectMode?1:ur.length)}Jt.ended=!0,Jt.sync?xt(qt):(Jt.needReadable=!1,Jt.emittedReadable||(Jt.emittedReadable=!0,At(qt)))}}function xt(qt){var Jt=qt._readableState;it("emitReadable",Jt.needReadable,Jt.emittedReadable),Jt.needReadable=!1,Jt.emittedReadable||(it("emitReadable",Jt.flowing),Jt.emittedReadable=!0,process$1$1.nextTick(At,qt))}function At(qt){var Jt=qt._readableState;it("emitReadable_",Jt.destroyed,Jt.length,Jt.ended),!Jt.destroyed&&(Jt.length||Jt.ended)&&(qt.emit("readable"),Jt.emittedReadable=!1),Jt.needReadable=!Jt.flowing&&!Jt.ended&&Jt.length<=Jt.highWaterMark,nr(qt)}function Rt(qt,Jt){Jt.readingMore||(Jt.readingMore=!0,process$1$1.nextTick(St,qt,Jt))}function St(qt,Jt){for(;!Jt.reading&&!Jt.ended&&(Jt.length1&&Ht(xr.pipes,qt)!==-1)&&!_r&&(it("false write response, pause",xr.awaitDrain),xr.awaitDrain++),ur.pause())}function Ar(or){it("onerror",or),Br(),qt.removeListener("error",Ar),_(qt,"error")===0&&Dt(qt,or)}Ot(qt,"error",Ar);function Pr(){qt.removeListener("finish",Or),Br()}qt.once("close",Pr);function Or(){it("onfinish"),qt.removeListener("close",Pr),Br()}qt.once("finish",Or);function Br(){it("unpipe"),ur.unpipe(qt)}return qt.emit("pipe",ur),xr.flowing||(it("pipe resume"),ur.resume()),qt};function Tt(qt){return function(){var ur=qt._readableState;it("pipeOnDrain",ur.awaitDrain),ur.awaitDrain&&ur.awaitDrain--,ur.awaitDrain===0&&_(qt,"data")&&(ur.flowing=!0,nr(qt))}}Lt.prototype.unpipe=function(qt){var Jt=this._readableState,ur={hasUnpiped:!1};if(Jt.pipesCount===0)return this;if(Jt.pipesCount===1)return qt&&qt!==Jt.pipes?this:(qt||(qt=Jt.pipes),Jt.pipes=null,Jt.pipesCount=0,Jt.flowing=!1,qt&&qt.emit("unpipe",this,ur),this);if(!qt){var xr=Jt.pipes,pr=Jt.pipesCount;Jt.pipes=null,Jt.pipesCount=0,Jt.flowing=!1;for(var Cr=0;Cr0,xr.flowing!==!1&&this.resume()):qt==="readable"&&!xr.endEmitted&&!xr.readableListening&&(xr.readableListening=xr.needReadable=!0,xr.flowing=!1,xr.emittedReadable=!1,it("on readable",xr.length,xr.reading),xr.length?xt(this):xr.reading||process$1$1.nextTick(Nt,this)),ur},Lt.prototype.addListener=Lt.prototype.on,Lt.prototype.removeListener=function(qt,Jt){var ur=$.prototype.removeListener.call(this,qt,Jt);return qt==="readable"&&process$1$1.nextTick(Et,this),ur},Lt.prototype.removeAllListeners=function(qt){var Jt=$.prototype.removeAllListeners.apply(this,arguments);return(qt==="readable"||qt===void 0)&&process$1$1.nextTick(Et,this),Jt};function Et(qt){var Jt=qt._readableState;Jt.readableListening=qt.listenerCount("readable")>0,Jt.resumeScheduled&&!Jt.paused?Jt.flowing=!0:qt.listenerCount("data")>0&&qt.resume()}function Nt(qt){it("readable nexttick read 0"),qt.read(0)}Lt.prototype.resume=function(){var qt=this._readableState;return qt.flowing||(it("resume"),qt.flowing=!qt.readableListening,tr(this,qt)),qt.paused=!1,this};function tr(qt,Jt){Jt.resumeScheduled||(Jt.resumeScheduled=!0,process$1$1.nextTick(ir,qt,Jt))}function ir(qt,Jt){it("resume",Jt.reading),Jt.reading||qt.read(0),Jt.resumeScheduled=!1,qt.emit("resume"),nr(qt),Jt.flowing&&!Jt.reading&&qt.read(0)}Lt.prototype.pause=function(){return it("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(it("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function nr(qt){var Jt=qt._readableState;for(it("flow",Jt.flowing);Jt.flowing&&qt.read()!==null;);}Lt.prototype.wrap=function(qt){var Jt=this,ur=this._readableState,xr=!1;qt.on("end",function(){if(it("wrapped end"),ur.decoder&&!ur.ended){var Mr=ur.decoder.end();Mr&&Mr.length&&Jt.push(Mr)}Jt.push(null)}),qt.on("data",function(Mr){if(it("wrapped data"),ur.decoder&&(Mr=ur.decoder.write(Mr)),!(ur.objectMode&&Mr==null)&&!(!ur.objectMode&&(!Mr||!Mr.length))){var lr=Jt.push(Mr);lr||(xr=!0,qt.pause())}});for(var pr in qt)this[pr]===void 0&&typeof qt[pr]=="function"&&(this[pr]=function(lr){return function(){return qt[lr].apply(qt,arguments)}}(pr));for(var Cr=0;Cr=Jt.length?(Jt.decoder?ur=Jt.buffer.join(""):Jt.buffer.length===1?ur=Jt.buffer.first():ur=Jt.buffer.concat(Jt.length),Jt.buffer.clear()):ur=Jt.buffer.consume(qt,Jt.decoder),ur}function Kt(qt){var Jt=qt._readableState;it("endReadable",Jt.endEmitted),Jt.endEmitted||(Jt.ended=!0,process$1$1.nextTick(Qt,Jt,qt))}function Qt(qt,Jt){if(it("endReadableNT",qt.endEmitted,qt.length),!qt.endEmitted&&qt.length===0&&(qt.endEmitted=!0,Jt.readable=!1,Jt.emit("end"),qt.autoDestroy)){var ur=Jt._writableState;(!ur||ur.autoDestroy&&ur.finished)&&Jt.destroy()}}typeof Symbol=="function"&&(Lt.from=function(qt,Jt){return Bt===void 0&&(Bt=requireFromBrowser()),Bt(Lt,qt,Jt)});function Ht(qt,Jt){for(var ur=0,xr=qt.length;ur0;return destroyer(rt,it,st,function(ot){et||(et=ot),ot&&tt.forEach(call),!it&&(tt.forEach(call),j(et))})});return _.reduce(pipe)}var pipeline_1=pipeline;(function(a,_){_=a.exports=require_stream_readable$1(),_.Stream=_,_.Readable=_,_.Writable=require_stream_writable$1(),_.Duplex=require_stream_duplex$1(),_.Transform=_stream_transform$1,_.PassThrough=_stream_passthrough$1,_.finished=endOfStream,_.pipeline=pipeline_1})(readableBrowser$1,readableBrowser$1.exports);var readableBrowserExports=readableBrowser$1.exports,Buffer$e=safeBufferExports.Buffer,Transform$1=readableBrowserExports.Transform,inherits$h=inherits_browserExports;function throwIfNotStringOrBuffer(a,_){if(!Buffer$e.isBuffer(a)&&typeof a!="string")throw new TypeError(_+" must be a string or a buffer")}function HashBase$2(a){Transform$1.call(this),this._block=Buffer$e.allocUnsafe(a),this._blockSize=a,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits$h(HashBase$2,Transform$1);HashBase$2.prototype._transform=function(a,_,$){var j=null;try{this.update(a,_)}catch(et){j=et}$(j)};HashBase$2.prototype._flush=function(a){var _=null;try{this.push(this.digest())}catch($){_=$}a(_)};HashBase$2.prototype.update=function(a,_){if(throwIfNotStringOrBuffer(a,"Data"),this._finalized)throw new Error("Digest already called");Buffer$e.isBuffer(a)||(a=Buffer$e.from(a,_));for(var $=this._block,j=0;this._blockOffset+a.length-j>=this._blockSize;){for(var et=this._blockOffset;et0;++tt)this._length[tt]+=rt,rt=this._length[tt]/4294967296|0,rt>0&&(this._length[tt]-=4294967296*rt);return this};HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")};HashBase$2.prototype.digest=function(a){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var _=this._digest();a!==void 0&&(_=_.toString(a)),this._block.fill(0),this._blockOffset=0;for(var $=0;$<4;++$)this._length[$]=0;return _};HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase$2,inherits$g=inherits_browserExports,HashBase$1=hashBase,Buffer$d=safeBufferExports.Buffer,ARRAY16$1=new Array(16);function MD5$2(){HashBase$1.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}inherits$g(MD5$2,HashBase$1);MD5$2.prototype._update=function(){for(var a=ARRAY16$1,_=0;_<16;++_)a[_]=this._block.readInt32LE(_*4);var $=this._a,j=this._b,et=this._c,tt=this._d;$=fnF($,j,et,tt,a[0],3614090360,7),tt=fnF(tt,$,j,et,a[1],3905402710,12),et=fnF(et,tt,$,j,a[2],606105819,17),j=fnF(j,et,tt,$,a[3],3250441966,22),$=fnF($,j,et,tt,a[4],4118548399,7),tt=fnF(tt,$,j,et,a[5],1200080426,12),et=fnF(et,tt,$,j,a[6],2821735955,17),j=fnF(j,et,tt,$,a[7],4249261313,22),$=fnF($,j,et,tt,a[8],1770035416,7),tt=fnF(tt,$,j,et,a[9],2336552879,12),et=fnF(et,tt,$,j,a[10],4294925233,17),j=fnF(j,et,tt,$,a[11],2304563134,22),$=fnF($,j,et,tt,a[12],1804603682,7),tt=fnF(tt,$,j,et,a[13],4254626195,12),et=fnF(et,tt,$,j,a[14],2792965006,17),j=fnF(j,et,tt,$,a[15],1236535329,22),$=fnG($,j,et,tt,a[1],4129170786,5),tt=fnG(tt,$,j,et,a[6],3225465664,9),et=fnG(et,tt,$,j,a[11],643717713,14),j=fnG(j,et,tt,$,a[0],3921069994,20),$=fnG($,j,et,tt,a[5],3593408605,5),tt=fnG(tt,$,j,et,a[10],38016083,9),et=fnG(et,tt,$,j,a[15],3634488961,14),j=fnG(j,et,tt,$,a[4],3889429448,20),$=fnG($,j,et,tt,a[9],568446438,5),tt=fnG(tt,$,j,et,a[14],3275163606,9),et=fnG(et,tt,$,j,a[3],4107603335,14),j=fnG(j,et,tt,$,a[8],1163531501,20),$=fnG($,j,et,tt,a[13],2850285829,5),tt=fnG(tt,$,j,et,a[2],4243563512,9),et=fnG(et,tt,$,j,a[7],1735328473,14),j=fnG(j,et,tt,$,a[12],2368359562,20),$=fnH($,j,et,tt,a[5],4294588738,4),tt=fnH(tt,$,j,et,a[8],2272392833,11),et=fnH(et,tt,$,j,a[11],1839030562,16),j=fnH(j,et,tt,$,a[14],4259657740,23),$=fnH($,j,et,tt,a[1],2763975236,4),tt=fnH(tt,$,j,et,a[4],1272893353,11),et=fnH(et,tt,$,j,a[7],4139469664,16),j=fnH(j,et,tt,$,a[10],3200236656,23),$=fnH($,j,et,tt,a[13],681279174,4),tt=fnH(tt,$,j,et,a[0],3936430074,11),et=fnH(et,tt,$,j,a[3],3572445317,16),j=fnH(j,et,tt,$,a[6],76029189,23),$=fnH($,j,et,tt,a[9],3654602809,4),tt=fnH(tt,$,j,et,a[12],3873151461,11),et=fnH(et,tt,$,j,a[15],530742520,16),j=fnH(j,et,tt,$,a[2],3299628645,23),$=fnI($,j,et,tt,a[0],4096336452,6),tt=fnI(tt,$,j,et,a[7],1126891415,10),et=fnI(et,tt,$,j,a[14],2878612391,15),j=fnI(j,et,tt,$,a[5],4237533241,21),$=fnI($,j,et,tt,a[12],1700485571,6),tt=fnI(tt,$,j,et,a[3],2399980690,10),et=fnI(et,tt,$,j,a[10],4293915773,15),j=fnI(j,et,tt,$,a[1],2240044497,21),$=fnI($,j,et,tt,a[8],1873313359,6),tt=fnI(tt,$,j,et,a[15],4264355552,10),et=fnI(et,tt,$,j,a[6],2734768916,15),j=fnI(j,et,tt,$,a[13],1309151649,21),$=fnI($,j,et,tt,a[4],4149444226,6),tt=fnI(tt,$,j,et,a[11],3174756917,10),et=fnI(et,tt,$,j,a[2],718787259,15),j=fnI(j,et,tt,$,a[9],3951481745,21),this._a=this._a+$|0,this._b=this._b+j|0,this._c=this._c+et|0,this._d=this._d+tt|0};MD5$2.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var a=Buffer$d.allocUnsafe(16);return a.writeInt32LE(this._a,0),a.writeInt32LE(this._b,4),a.writeInt32LE(this._c,8),a.writeInt32LE(this._d,12),a};function rotl$1(a,_){return a<<_|a>>>32-_}function fnF(a,_,$,j,et,tt,rt){return rotl$1(a+(_&$|~_&j)+et+tt|0,rt)+_|0}function fnG(a,_,$,j,et,tt,rt){return rotl$1(a+(_&j|$&~j)+et+tt|0,rt)+_|0}function fnH(a,_,$,j,et,tt,rt){return rotl$1(a+(_^$^j)+et+tt|0,rt)+_|0}function fnI(a,_,$,j,et,tt,rt){return rotl$1(a+($^(_|~j))+et+tt|0,rt)+_|0}var md5_js=MD5$2,Buffer$c=buffer$1.Buffer,inherits$f=inherits_browserExports,HashBase=hashBase,ARRAY16=new Array(16),zl=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],zr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],sl=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$3(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}inherits$f(RIPEMD160$3,HashBase);RIPEMD160$3.prototype._update=function(){for(var a=ARRAY16,_=0;_<16;++_)a[_]=this._block.readInt32LE(_*4);for(var $=this._a|0,j=this._b|0,et=this._c|0,tt=this._d|0,rt=this._e|0,nt=this._a|0,it=this._b|0,st=this._c|0,ot=this._d|0,at=this._e|0,ut=0;ut<80;ut+=1){var ht,yt;ut<16?(ht=fn1($,j,et,tt,rt,a[zl[ut]],hl[0],sl[ut]),yt=fn5(nt,it,st,ot,at,a[zr[ut]],hr[0],sr[ut])):ut<32?(ht=fn2($,j,et,tt,rt,a[zl[ut]],hl[1],sl[ut]),yt=fn4(nt,it,st,ot,at,a[zr[ut]],hr[1],sr[ut])):ut<48?(ht=fn3($,j,et,tt,rt,a[zl[ut]],hl[2],sl[ut]),yt=fn3(nt,it,st,ot,at,a[zr[ut]],hr[2],sr[ut])):ut<64?(ht=fn4($,j,et,tt,rt,a[zl[ut]],hl[3],sl[ut]),yt=fn2(nt,it,st,ot,at,a[zr[ut]],hr[3],sr[ut])):(ht=fn5($,j,et,tt,rt,a[zl[ut]],hl[4],sl[ut]),yt=fn1(nt,it,st,ot,at,a[zr[ut]],hr[4],sr[ut])),$=rt,rt=tt,tt=rotl(et,10),et=j,j=ht,nt=at,at=ot,ot=rotl(st,10),st=it,it=yt}var wt=this._b+et+ot|0;this._b=this._c+tt+at|0,this._c=this._d+rt+nt|0,this._d=this._e+$+it|0,this._e=this._a+j+st|0,this._a=wt};RIPEMD160$3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var a=Buffer$c.alloc?Buffer$c.alloc(20):new Buffer$c(20);return a.writeInt32LE(this._a,0),a.writeInt32LE(this._b,4),a.writeInt32LE(this._c,8),a.writeInt32LE(this._d,12),a.writeInt32LE(this._e,16),a};function rotl(a,_){return a<<_|a>>>32-_}function fn1(a,_,$,j,et,tt,rt,nt){return rotl(a+(_^$^j)+tt+rt|0,nt)+et|0}function fn2(a,_,$,j,et,tt,rt,nt){return rotl(a+(_&$|~_&j)+tt+rt|0,nt)+et|0}function fn3(a,_,$,j,et,tt,rt,nt){return rotl(a+((_|~$)^j)+tt+rt|0,nt)+et|0}function fn4(a,_,$,j,et,tt,rt,nt){return rotl(a+(_&j|$&~j)+tt+rt|0,nt)+et|0}function fn5(a,_,$,j,et,tt,rt,nt){return rotl(a+(_^($|~j))+tt+rt|0,nt)+et|0}var ripemd160=RIPEMD160$3,sha_js={exports:{}},Buffer$b=safeBufferExports.Buffer;function Hash$7(a,_){this._block=Buffer$b.alloc(a),this._finalSize=_,this._blockSize=a,this._len=0}Hash$7.prototype.update=function(a,_){typeof a=="string"&&(_=_||"utf8",a=Buffer$b.from(a,_));for(var $=this._block,j=this._blockSize,et=a.length,tt=this._len,rt=0;rt=this._finalSize&&(this._update(this._block),this._block.fill(0));var $=this._len*8;if($<=4294967295)this._block.writeUInt32BE($,this._blockSize-4);else{var j=($&4294967295)>>>0,et=($-j)/4294967296;this._block.writeUInt32BE(et,this._blockSize-8),this._block.writeUInt32BE(j,this._blockSize-4)}this._update(this._block);var tt=this._hash();return a?tt.toString(a):tt};Hash$7.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash$5=Hash$7,inherits$e=inherits_browserExports,Hash$6=hash$5,Buffer$a=safeBufferExports.Buffer,K$5=[1518500249,1859775393,-1894007588,-899497514],W$5=new Array(80);function Sha(){this.init(),this._w=W$5,Hash$6.call(this,64,56)}inherits$e(Sha,Hash$6);Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl5$1(a){return a<<5|a>>>27}function rotl30$1(a){return a<<30|a>>>2}function ft$1(a,_,$,j){return a===0?_&$|~_&j:a===2?_&$|_&j|$&j:_^$^j}Sha.prototype._update=function(a){for(var _=this._w,$=this._a|0,j=this._b|0,et=this._c|0,tt=this._d|0,rt=this._e|0,nt=0;nt<16;++nt)_[nt]=a.readInt32BE(nt*4);for(;nt<80;++nt)_[nt]=_[nt-3]^_[nt-8]^_[nt-14]^_[nt-16];for(var it=0;it<80;++it){var st=~~(it/20),ot=rotl5$1($)+ft$1(st,j,et,tt)+rt+_[it]+K$5[st]|0;rt=tt,tt=et,et=rotl30$1(j),j=$,$=ot}this._a=$+this._a|0,this._b=j+this._b|0,this._c=et+this._c|0,this._d=tt+this._d|0,this._e=rt+this._e|0};Sha.prototype._hash=function(){var a=Buffer$a.allocUnsafe(20);return a.writeInt32BE(this._a|0,0),a.writeInt32BE(this._b|0,4),a.writeInt32BE(this._c|0,8),a.writeInt32BE(this._d|0,12),a.writeInt32BE(this._e|0,16),a};var sha$3=Sha,inherits$d=inherits_browserExports,Hash$5=hash$5,Buffer$9=safeBufferExports.Buffer,K$4=[1518500249,1859775393,-1894007588,-899497514],W$4=new Array(80);function Sha1(){this.init(),this._w=W$4,Hash$5.call(this,64,56)}inherits$d(Sha1,Hash$5);Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl1(a){return a<<1|a>>>31}function rotl5(a){return a<<5|a>>>27}function rotl30(a){return a<<30|a>>>2}function ft(a,_,$,j){return a===0?_&$|~_&j:a===2?_&$|_&j|$&j:_^$^j}Sha1.prototype._update=function(a){for(var _=this._w,$=this._a|0,j=this._b|0,et=this._c|0,tt=this._d|0,rt=this._e|0,nt=0;nt<16;++nt)_[nt]=a.readInt32BE(nt*4);for(;nt<80;++nt)_[nt]=rotl1(_[nt-3]^_[nt-8]^_[nt-14]^_[nt-16]);for(var it=0;it<80;++it){var st=~~(it/20),ot=rotl5($)+ft(st,j,et,tt)+rt+_[it]+K$4[st]|0;rt=tt,tt=et,et=rotl30(j),j=$,$=ot}this._a=$+this._a|0,this._b=j+this._b|0,this._c=et+this._c|0,this._d=tt+this._d|0,this._e=rt+this._e|0};Sha1.prototype._hash=function(){var a=Buffer$9.allocUnsafe(20);return a.writeInt32BE(this._a|0,0),a.writeInt32BE(this._b|0,4),a.writeInt32BE(this._c|0,8),a.writeInt32BE(this._d|0,12),a.writeInt32BE(this._e|0,16),a};var sha1=Sha1,inherits$c=inherits_browserExports,Hash$4=hash$5,Buffer$8=safeBufferExports.Buffer,K$3=[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],W$3=new Array(64);function Sha256$1(){this.init(),this._w=W$3,Hash$4.call(this,64,56)}inherits$c(Sha256$1,Hash$4);Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ch(a,_,$){return $^a&(_^$)}function maj$1(a,_,$){return a&_|$&(a|_)}function sigma0$1(a){return(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10)}function sigma1$1(a){return(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7)}function gamma0(a){return(a>>>7|a<<25)^(a>>>18|a<<14)^a>>>3}function gamma1(a){return(a>>>17|a<<15)^(a>>>19|a<<13)^a>>>10}Sha256$1.prototype._update=function(a){for(var _=this._w,$=this._a|0,j=this._b|0,et=this._c|0,tt=this._d|0,rt=this._e|0,nt=this._f|0,it=this._g|0,st=this._h|0,ot=0;ot<16;++ot)_[ot]=a.readInt32BE(ot*4);for(;ot<64;++ot)_[ot]=gamma1(_[ot-2])+_[ot-7]+gamma0(_[ot-15])+_[ot-16]|0;for(var at=0;at<64;++at){var ut=st+sigma1$1(rt)+ch(rt,nt,it)+K$3[at]+_[at]|0,ht=sigma0$1($)+maj$1($,j,et)|0;st=it,it=nt,nt=rt,rt=tt+ut|0,tt=et,et=j,j=$,$=ut+ht|0}this._a=$+this._a|0,this._b=j+this._b|0,this._c=et+this._c|0,this._d=tt+this._d|0,this._e=rt+this._e|0,this._f=nt+this._f|0,this._g=it+this._g|0,this._h=st+this._h|0};Sha256$1.prototype._hash=function(){var a=Buffer$8.allocUnsafe(32);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a.writeInt32BE(this._h,28),a};var sha256$4=Sha256$1,inherits$b=inherits_browserExports,Sha256=sha256$4,Hash$3=hash$5,Buffer$7=safeBufferExports.Buffer,W$2=new Array(64);function Sha224(){this.init(),this._w=W$2,Hash$3.call(this,64,56)}inherits$b(Sha224,Sha256);Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Sha224.prototype._hash=function(){var a=Buffer$7.allocUnsafe(28);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a};var sha224$1=Sha224,inherits$a=inherits_browserExports,Hash$2=hash$5,Buffer$6=safeBufferExports.Buffer,K$2=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W$1=new Array(160);function Sha512(){this.init(),this._w=W$1,Hash$2.call(this,128,112)}inherits$a(Sha512,Hash$2);Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ch(a,_,$){return $^a&(_^$)}function maj(a,_,$){return a&_|$&(a|_)}function sigma0(a,_){return(a>>>28|_<<4)^(_>>>2|a<<30)^(_>>>7|a<<25)}function sigma1(a,_){return(a>>>14|_<<18)^(a>>>18|_<<14)^(_>>>9|a<<23)}function Gamma0(a,_){return(a>>>1|_<<31)^(a>>>8|_<<24)^a>>>7}function Gamma0l(a,_){return(a>>>1|_<<31)^(a>>>8|_<<24)^(a>>>7|_<<25)}function Gamma1(a,_){return(a>>>19|_<<13)^(_>>>29|a<<3)^a>>>6}function Gamma1l(a,_){return(a>>>19|_<<13)^(_>>>29|a<<3)^(a>>>6|_<<26)}function getCarry(a,_){return a>>>0<_>>>0?1:0}Sha512.prototype._update=function(a){for(var _=this._w,$=this._ah|0,j=this._bh|0,et=this._ch|0,tt=this._dh|0,rt=this._eh|0,nt=this._fh|0,it=this._gh|0,st=this._hh|0,ot=this._al|0,at=this._bl|0,ut=this._cl|0,ht=this._dl|0,yt=this._el|0,wt=this._fl|0,Ct=this._gl|0,Pt=this._hl|0,$t=0;$t<32;$t+=2)_[$t]=a.readInt32BE($t*4),_[$t+1]=a.readInt32BE($t*4+4);for(;$t<160;$t+=2){var Mt=_[$t-30],Bt=_[$t-15*2+1],Dt=Gamma0(Mt,Bt),zt=Gamma0l(Bt,Mt);Mt=_[$t-2*2],Bt=_[$t-2*2+1];var Ot=Gamma1(Mt,Bt),It=Gamma1l(Bt,Mt),Lt=_[$t-7*2],Ft=_[$t-7*2+1],jt=_[$t-16*2],bt=_[$t-16*2+1],vt=zt+Ft|0,ct=Dt+Lt+getCarry(vt,zt)|0;vt=vt+It|0,ct=ct+Ot+getCarry(vt,It)|0,vt=vt+bt|0,ct=ct+jt+getCarry(vt,bt)|0,_[$t]=ct,_[$t+1]=vt}for(var dt=0;dt<160;dt+=2){ct=_[dt],vt=_[dt+1];var mt=maj($,j,et),xt=maj(ot,at,ut),At=sigma0($,ot),Rt=sigma0(ot,$),St=sigma1(rt,yt),Tt=sigma1(yt,rt),Et=K$2[dt],Nt=K$2[dt+1],tr=Ch(rt,nt,it),ir=Ch(yt,wt,Ct),nr=Pt+Tt|0,Zt=st+St+getCarry(nr,Pt)|0;nr=nr+ir|0,Zt=Zt+tr+getCarry(nr,ir)|0,nr=nr+Nt|0,Zt=Zt+Et+getCarry(nr,Nt)|0,nr=nr+vt|0,Zt=Zt+ct+getCarry(nr,vt)|0;var Kt=Rt+xt|0,Qt=At+mt+getCarry(Kt,Rt)|0;st=it,Pt=Ct,it=nt,Ct=wt,nt=rt,wt=yt,yt=ht+nr|0,rt=tt+Zt+getCarry(yt,ht)|0,tt=et,ht=ut,et=j,ut=at,j=$,at=ot,ot=nr+Kt|0,$=Zt+Qt+getCarry(ot,nr)|0}this._al=this._al+ot|0,this._bl=this._bl+at|0,this._cl=this._cl+ut|0,this._dl=this._dl+ht|0,this._el=this._el+yt|0,this._fl=this._fl+wt|0,this._gl=this._gl+Ct|0,this._hl=this._hl+Pt|0,this._ah=this._ah+$+getCarry(this._al,ot)|0,this._bh=this._bh+j+getCarry(this._bl,at)|0,this._ch=this._ch+et+getCarry(this._cl,ut)|0,this._dh=this._dh+tt+getCarry(this._dl,ht)|0,this._eh=this._eh+rt+getCarry(this._el,yt)|0,this._fh=this._fh+nt+getCarry(this._fl,wt)|0,this._gh=this._gh+it+getCarry(this._gl,Ct)|0,this._hh=this._hh+st+getCarry(this._hl,Pt)|0};Sha512.prototype._hash=function(){var a=Buffer$6.allocUnsafe(64);function _($,j,et){a.writeInt32BE($,et),a.writeInt32BE(j,et+4)}return _(this._ah,this._al,0),_(this._bh,this._bl,8),_(this._ch,this._cl,16),_(this._dh,this._dl,24),_(this._eh,this._el,32),_(this._fh,this._fl,40),_(this._gh,this._gl,48),_(this._hh,this._hl,56),a};var sha512$4=Sha512,inherits$9=inherits_browserExports,SHA512$3=sha512$4,Hash$1=hash$5,Buffer$5=safeBufferExports.Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash$1.call(this,128,112)}inherits$9(Sha384,SHA512$3);Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Sha384.prototype._hash=function(){var a=Buffer$5.allocUnsafe(48);function _($,j,et){a.writeInt32BE($,et),a.writeInt32BE(j,et+4)}return _(this._ah,this._al,0),_(this._bh,this._bl,8),_(this._ch,this._cl,16),_(this._dh,this._dl,24),_(this._eh,this._el,32),_(this._fh,this._fl,40),a};var sha384$1=Sha384,exports=sha_js.exports=function(_){_=_.toLowerCase();var $=exports[_];if(!$)throw new Error(_+" is not supported (we accept pull requests)");return new $};exports.sha=sha$3;exports.sha1=sha1;exports.sha224=sha224$1;exports.sha256=sha256$4;exports.sha384=sha384$1;exports.sha512=sha512$4;var sha_jsExports=sha_js.exports,streamBrowserify=Stream,EE=eventsExports.EventEmitter,inherits$8=inherits_browserExports;inherits$8(Stream,EE);Stream.Readable=require_stream_readable$1();Stream.Writable=require_stream_writable$1();Stream.Duplex=require_stream_duplex$1();Stream.Transform=_stream_transform$1;Stream.PassThrough=_stream_passthrough$1;Stream.finished=endOfStream;Stream.pipeline=pipeline_1;Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(a,_){var $=this;function j(ot){a.writable&&a.write(ot)===!1&&$.pause&&$.pause()}$.on("data",j);function et(){$.readable&&$.resume&&$.resume()}a.on("drain",et),!a._isStdio&&(!_||_.end!==!1)&&($.on("end",rt),$.on("close",nt));var tt=!1;function rt(){tt||(tt=!0,a.end())}function nt(){tt||(tt=!0,typeof a.destroy=="function"&&a.destroy())}function it(ot){if(st(),EE.listenerCount(this,"error")===0)throw ot}$.on("error",it),a.on("error",it);function st(){$.removeListener("data",j),a.removeListener("drain",et),$.removeListener("end",rt),$.removeListener("close",nt),$.removeListener("error",it),a.removeListener("error",it),$.removeListener("end",st),$.removeListener("close",st),a.removeListener("close",st)}return $.on("end",st),$.on("close",st),a.on("close",st),a.emit("pipe",$),a};var Buffer$4=safeBufferExports.Buffer,Transform=streamBrowserify.Transform,StringDecoder=string_decoder$1.StringDecoder,inherits$7=inherits_browserExports;function CipherBase(a){Transform.call(this),this.hashMode=typeof a=="string",this.hashMode?this[a]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits$7(CipherBase,Transform);CipherBase.prototype.update=function(a,_,$){typeof a=="string"&&(a=Buffer$4.from(a,_));var j=this._update(a);return this.hashMode?this:($&&(j=this._toString(j,$)),j)};CipherBase.prototype.setAutoPadding=function(){};CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};CipherBase.prototype._transform=function(a,_,$){var j;try{this.hashMode?this._update(a):this.push(this._update(a))}catch(et){j=et}finally{$(j)}};CipherBase.prototype._flush=function(a){var _;try{this.push(this.__final())}catch($){_=$}a(_)};CipherBase.prototype._finalOrDigest=function(a){var _=this.__final()||Buffer$4.alloc(0);return a&&(_=this._toString(_,a,!0)),_};CipherBase.prototype._toString=function(a,_,$){if(this._decoder||(this._decoder=new StringDecoder(_),this._encoding=_),this._encoding!==_)throw new Error("can't switch encodings");var j=this._decoder.write(a);return $&&(j+=this._decoder.end()),j};var cipherBase=CipherBase,inherits$6=inherits_browserExports,MD5$1=md5_js,RIPEMD160$2=ripemd160,sha$2=sha_jsExports,Base$3=cipherBase;function Hash(a){Base$3.call(this,"digest"),this._hash=a}inherits$6(Hash,Base$3);Hash.prototype._update=function(a){this._hash.update(a)};Hash.prototype._final=function(){return this._hash.digest()};var browser$b=function(_){return _=_.toLowerCase(),_==="md5"?new MD5$1:_==="rmd160"||_==="ripemd160"?new RIPEMD160$2:new Hash(sha$2(_))},_Buffer=safeBufferExports.Buffer;function base$7(a){if(a.length>=255)throw new TypeError("Alphabet too long");for(var _=new Uint8Array(256),$=0;$<_.length;$++)_[$]=255;for(var j=0;j>>0,Mt=new Uint8Array($t);Ct!==Pt;){for(var Bt=ht[Ct],Dt=0,zt=$t-1;(Bt!==0||Dt>>0,Mt[zt]=Bt%rt>>>0,Bt=Bt/rt>>>0;if(Bt!==0)throw new Error("Non-zero carry");wt=Dt,Ct++}for(var Ot=$t-wt;Ot!==$t&&Mt[Ot]===0;)Ot++;for(var It=nt.repeat(yt);Ot<$t;++Ot)It+=a.charAt(Mt[Ot]);return It}function at(ht){if(typeof ht!="string")throw new TypeError("Expected String");if(ht.length===0)return _Buffer.alloc(0);for(var yt=0,wt=0,Ct=0;ht[yt]===nt;)wt++,yt++;for(var Pt=(ht.length-yt)*it+1>>>0,$t=new Uint8Array(Pt);ht[yt];){var Mt=_[ht.charCodeAt(yt)];if(Mt===255)return;for(var Bt=0,Dt=Pt-1;(Mt!==0||Bt>>0,$t[Dt]=Mt%256>>>0,Mt=Mt/256>>>0;if(Mt!==0)throw new Error("Non-zero carry");Ct=Bt,yt++}for(var zt=Pt-Ct;zt!==Pt&&$t[zt]===0;)zt++;var Ot=_Buffer.allocUnsafe(wt+(Pt-zt));Ot.fill(0,0,wt);for(var It=wt;zt!==Pt;)Ot[It++]=$t[zt++];return Ot}function ut(ht){var yt=at(ht);if(yt)return yt;throw new Error("Non-base"+rt+" character")}return{encode:ot,decodeUnsafe:at,decode:ut}}var src$2=base$7,basex$1=src$2,ALPHABET$3="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",bs58$1=basex$1(ALPHABET$3),base58$1=bs58$1,Buffer$3=safeBufferExports.Buffer,base$6=function(a){function _(tt){var rt=a(tt);return base58$1.encode(Buffer$3.concat([tt,rt],tt.length+4))}function $(tt){var rt=tt.slice(0,-4),nt=tt.slice(-4),it=a(rt);if(!(nt[0]^it[0]|nt[1]^it[1]|nt[2]^it[2]|nt[3]^it[3]))return rt}function j(tt){var rt=base58$1.decodeUnsafe(tt);if(rt)return $(rt)}function et(tt){var rt=base58$1.decode(tt),nt=$(rt);if(!nt)throw new Error("Invalid checksum");return nt}return{encode:_,decode:et,decodeUnsafe:j}},createHash=browser$b,bs58checkBase$1=base$6;function sha256x2$1(a){var _=createHash("sha256").update(a).digest();return createHash("sha256").update(_).digest()}var bs58check$2=bs58checkBase$1(sha256x2$1),nacl={},box={},x25519={},random={},system={},browser$a={};Object.defineProperty(browser$a,"__esModule",{value:!0});browser$a.BrowserRandomSource=void 0;const QUOTA=65536;class BrowserRandomSource{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const _=typeof self<"u"?self.crypto||self.msCrypto:null;_&&_.getRandomValues!==void 0&&(this._crypto=_,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(_){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const $=new Uint8Array(_);for(let j=0;j<$.length;j+=QUOTA)this._crypto.getRandomValues($.subarray(j,j+Math.min($.length-j,QUOTA)));return $}}browser$a.BrowserRandomSource=BrowserRandomSource;function commonjsRequire(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var node$2={},wipe$1={};Object.defineProperty(wipe$1,"__esModule",{value:!0});function wipe(a){for(var _=0;__)throw new RangeError("requested too many random bytes");var it=j.allocUnsafe(rt);if(rt>0)if(rt>a)for(var st=0;stet?nt=rt(nt):nt.lengthat){var ut=st==="rmd160"?new tt:rt(st);ot=ut.update(ot).digest()}else ot.lengthMAX_ALLOC||_!==_)throw new TypeError("Bad key length")},defaultEncoding$2;if(commonjsGlobal.process&&commonjsGlobal.process.browser)defaultEncoding$2="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var pVersionMajor=parseInt(process$1$1.version.split(".")[0].slice(1),10);defaultEncoding$2=pVersionMajor>=6?"utf-8":"binary"}else defaultEncoding$2="utf-8";var defaultEncoding_1=defaultEncoding$2,Buffer$2=safeBufferExports.Buffer,toBuffer$3=function(a,_,$){if(Buffer$2.isBuffer(a))return a;if(typeof a=="string")return Buffer$2.from(a,_);if(ArrayBuffer.isView(a))return Buffer$2.from(a.buffer);throw new TypeError($+" must be a string, a Buffer, a typed array or a DataView")},md5$2=md5$3,RIPEMD160$1=ripemd160,sha$1=sha_jsExports,Buffer$1=safeBufferExports.Buffer,checkParameters$1=precondition,defaultEncoding$1=defaultEncoding_1,toBuffer$2=toBuffer$3,ZEROS=Buffer$1.alloc(128),sizes$1={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac$1(a,_,$){var j=getDigest(a),et=a==="sha512"||a==="sha384"?128:64;_.length>et?_=j(_):_.length>>0},utils$x.writeUInt32BE=function(et,tt,rt){et[0+rt]=tt>>>24,et[1+rt]=tt>>>16&255,et[2+rt]=tt>>>8&255,et[3+rt]=tt&255},utils$x.ip=function(et,tt,rt,nt){for(var it=0,st=0,ot=6;ot>=0;ot-=2){for(var at=0;at<=24;at+=8)it<<=1,it|=tt>>>at+ot&1;for(var at=0;at<=24;at+=8)it<<=1,it|=et>>>at+ot&1}for(var ot=6;ot>=0;ot-=2){for(var at=1;at<=25;at+=8)st<<=1,st|=tt>>>at+ot&1;for(var at=1;at<=25;at+=8)st<<=1,st|=et>>>at+ot&1}rt[nt+0]=it>>>0,rt[nt+1]=st>>>0},utils$x.rip=function(et,tt,rt,nt){for(var it=0,st=0,ot=0;ot<4;ot++)for(var at=24;at>=0;at-=8)it<<=1,it|=tt>>>at+ot&1,it<<=1,it|=et>>>at+ot&1;for(var ot=4;ot<8;ot++)for(var at=24;at>=0;at-=8)st<<=1,st|=tt>>>at+ot&1,st<<=1,st|=et>>>at+ot&1;rt[nt+0]=it>>>0,rt[nt+1]=st>>>0},utils$x.pc1=function(et,tt,rt,nt){for(var it=0,st=0,ot=7;ot>=5;ot--){for(var at=0;at<=24;at+=8)it<<=1,it|=tt>>at+ot&1;for(var at=0;at<=24;at+=8)it<<=1,it|=et>>at+ot&1}for(var at=0;at<=24;at+=8)it<<=1,it|=tt>>at+ot&1;for(var ot=1;ot<=3;ot++){for(var at=0;at<=24;at+=8)st<<=1,st|=tt>>at+ot&1;for(var at=0;at<=24;at+=8)st<<=1,st|=et>>at+ot&1}for(var at=0;at<=24;at+=8)st<<=1,st|=et>>at+ot&1;rt[nt+0]=it>>>0,rt[nt+1]=st>>>0},utils$x.r28shl=function(et,tt){return et<>>28-tt};var a=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$x.pc2=function(et,tt,rt,nt){for(var it=0,st=0,ot=a.length>>>1,at=0;at>>a[at]&1;for(var at=ot;at>>a[at]&1;rt[nt+0]=it>>>0,rt[nt+1]=st>>>0},utils$x.expand=function(et,tt,rt){var nt=0,it=0;nt=(et&1)<<5|et>>>27;for(var st=23;st>=15;st-=4)nt<<=6,nt|=et>>>st&63;for(var st=11;st>=3;st-=4)it|=et>>>st&63,it<<=6;it|=(et&31)<<1|et>>>31,tt[rt+0]=nt>>>0,tt[rt+1]=it>>>0};var _=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$x.substitute=function(et,tt){for(var rt=0,nt=0;nt<4;nt++){var it=et>>>18-nt*6&63,st=_[nt*64+it];rt<<=4,rt|=st}for(var nt=0;nt<4;nt++){var it=tt>>>18-nt*6&63,st=_[4*64+nt*64+it];rt<<=4,rt|=st}return rt>>>0};var $=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return utils$x.permute=function(et){for(var tt=0,rt=0;rt<$.length;rt++)tt<<=1,tt|=et>>>$[rt]&1;return tt>>>0},utils$x.padSplit=function(et,tt,rt){for(var nt=et.toString(2);nt.length0;rt--)et+=this._buffer(j,et),tt+=this._flushBuffer(nt,tt);return et+=this._buffer(j,et),nt},_.prototype.final=function(j){var et;j&&(et=this.update(j));var tt;return this.type==="encrypt"?tt=this._finalEncrypt():tt=this._finalDecrypt(),et?et.concat(tt):tt},_.prototype._pad=function(j,et){if(et===0)return!1;for(;et>>1];ot=$.r28shl(ot,ht),at=$.r28shl(at,ht),$.pc2(ot,at,it.keys,ut)}},tt.prototype._update=function(it,st,ot,at){var ut=this._desState,ht=$.readUInt32BE(it,st),yt=$.readUInt32BE(it,st+4);$.ip(ht,yt,ut.tmp,0),ht=ut.tmp[0],yt=ut.tmp[1],this.type==="encrypt"?this._encrypt(ut,ht,yt,ut.tmp,0):this._decrypt(ut,ht,yt,ut.tmp,0),ht=ut.tmp[0],yt=ut.tmp[1],$.writeUInt32BE(ot,ht,at),$.writeUInt32BE(ot,yt,at+4)},tt.prototype._pad=function(it,st){if(this.padding===!1)return!1;for(var ot=it.length-st,at=st;at>>0,ht=Bt}$.rip(yt,ht,at,ut)},tt.prototype._decrypt=function(it,st,ot,at,ut){for(var ht=ot,yt=st,wt=it.keys.length-2;wt>=0;wt-=2){var Ct=it.keys[wt],Pt=it.keys[wt+1];$.expand(ht,it.tmp,0),Ct^=it.tmp[0],Pt^=it.tmp[1];var $t=$.substitute(Ct,Pt),Mt=$.permute($t),Bt=ht;ht=(yt^Mt)>>>0,yt=Bt}$.rip(ht,yt,at,ut)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var a=minimalisticAssert,_=inherits_browserExports,$={};function j(tt){a.equal(tt.length,8,"Invalid IV length"),this.iv=new Array(8);for(var rt=0;rt>nt%8,j._prev=$(j._prev,tt?ot:at);return st}function $(j,et){var tt=j.length,rt=-1,nt=a.allocUnsafe(j.length);for(j=a.concat([j,a.from([et])]);++rt>7;return nt}return cfb1.encrypt=function(j,et,tt){for(var rt=et.length,nt=a.allocUnsafe(rt),it=-1;++it>>24]^ht[Pt>>>16&255]^yt[$t>>>8&255]^wt[Mt&255]^it[It++],Dt=ut[Pt>>>24]^ht[$t>>>16&255]^yt[Mt>>>8&255]^wt[Ct&255]^it[It++],zt=ut[$t>>>24]^ht[Mt>>>16&255]^yt[Ct>>>8&255]^wt[Pt&255]^it[It++],Ot=ut[Mt>>>24]^ht[Ct>>>16&255]^yt[Pt>>>8&255]^wt[$t&255]^it[It++],Ct=Bt,Pt=Dt,$t=zt,Mt=Ot;return Bt=(ot[Ct>>>24]<<24|ot[Pt>>>16&255]<<16|ot[$t>>>8&255]<<8|ot[Mt&255])^it[It++],Dt=(ot[Pt>>>24]<<24|ot[$t>>>16&255]<<16|ot[Mt>>>8&255]<<8|ot[Ct&255])^it[It++],zt=(ot[$t>>>24]<<24|ot[Mt>>>16&255]<<16|ot[Ct>>>8&255]<<8|ot[Pt&255])^it[It++],Ot=(ot[Mt>>>24]<<24|ot[Ct>>>16&255]<<16|ot[Pt>>>8&255]<<8|ot[$t&255])^it[It++],Bt=Bt>>>0,Dt=Dt>>>0,zt=zt>>>0,Ot=Ot>>>0,[Bt,Dt,zt,Ot]}var et=[0,1,2,4,8,16,32,64,128,27,54],tt=function(){for(var nt=new Array(256),it=0;it<256;it++)it<128?nt[it]=it<<1:nt[it]=it<<1^283;for(var st=[],ot=[],at=[[],[],[],[]],ut=[[],[],[],[]],ht=0,yt=0,wt=0;wt<256;++wt){var Ct=yt^yt<<1^yt<<2^yt<<3^yt<<4;Ct=Ct>>>8^Ct&255^99,st[ht]=Ct,ot[Ct]=ht;var Pt=nt[ht],$t=nt[Pt],Mt=nt[$t],Bt=nt[Ct]*257^Ct*16843008;at[0][ht]=Bt<<24|Bt>>>8,at[1][ht]=Bt<<16|Bt>>>16,at[2][ht]=Bt<<8|Bt>>>24,at[3][ht]=Bt,Bt=Mt*16843009^$t*65537^Pt*257^ht*16843008,ut[0][Ct]=Bt<<24|Bt>>>8,ut[1][Ct]=Bt<<16|Bt>>>16,ut[2][Ct]=Bt<<8|Bt>>>24,ut[3][Ct]=Bt,ht===0?ht=yt=1:(ht=Pt^nt[nt[nt[Mt^Pt]]],yt^=nt[nt[yt]])}return{SBOX:st,INV_SBOX:ot,SUB_MIX:at,INV_SUB_MIX:ut}}();function rt(nt){this._key=_(nt),this._reset()}return rt.blockSize=4*4,rt.keySize=256/8,rt.prototype.blockSize=rt.blockSize,rt.prototype.keySize=rt.keySize,rt.prototype._reset=function(){for(var nt=this._key,it=nt.length,st=it+6,ot=(st+1)*4,at=[],ut=0;ut>>24,ht=tt.SBOX[ht>>>24]<<24|tt.SBOX[ht>>>16&255]<<16|tt.SBOX[ht>>>8&255]<<8|tt.SBOX[ht&255],ht^=et[ut/it|0]<<24):it>6&&ut%it===4&&(ht=tt.SBOX[ht>>>24]<<24|tt.SBOX[ht>>>16&255]<<16|tt.SBOX[ht>>>8&255]<<8|tt.SBOX[ht&255]),at[ut]=at[ut-it]^ht}for(var yt=[],wt=0;wt>>24]]^tt.INV_SUB_MIX[1][tt.SBOX[Pt>>>16&255]]^tt.INV_SUB_MIX[2][tt.SBOX[Pt>>>8&255]]^tt.INV_SUB_MIX[3][tt.SBOX[Pt&255]]}this._nRounds=st,this._keySchedule=at,this._invKeySchedule=yt},rt.prototype.encryptBlockRaw=function(nt){return nt=_(nt),j(nt,this._keySchedule,tt.SUB_MIX,tt.SBOX,this._nRounds)},rt.prototype.encryptBlock=function(nt){var it=this.encryptBlockRaw(nt),st=a.allocUnsafe(16);return st.writeUInt32BE(it[0],0),st.writeUInt32BE(it[1],4),st.writeUInt32BE(it[2],8),st.writeUInt32BE(it[3],12),st},rt.prototype.decryptBlock=function(nt){nt=_(nt);var it=nt[1];nt[1]=nt[3],nt[3]=it;var st=j(nt,this._invKeySchedule,tt.INV_SUB_MIX,tt.INV_SBOX,this._nRounds),ot=a.allocUnsafe(16);return ot.writeUInt32BE(st[0],0),ot.writeUInt32BE(st[3],4),ot.writeUInt32BE(st[2],8),ot.writeUInt32BE(st[1],12),ot},rt.prototype.scrub=function(){$(this._keySchedule),$(this._invKeySchedule),$(this._key)},aes.AES=rt,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var a=safeBufferExports.Buffer,_=a.alloc(16,0);function $(tt){return[tt.readUInt32BE(0),tt.readUInt32BE(4),tt.readUInt32BE(8),tt.readUInt32BE(12)]}function j(tt){var rt=a.allocUnsafe(16);return rt.writeUInt32BE(tt[0]>>>0,0),rt.writeUInt32BE(tt[1]>>>0,4),rt.writeUInt32BE(tt[2]>>>0,8),rt.writeUInt32BE(tt[3]>>>0,12),rt}function et(tt){this.h=tt,this.state=a.alloc(16,0),this.cache=a.allocUnsafe(0)}return et.prototype.ghash=function(tt){for(var rt=-1;++rt0;nt--)tt[nt]=tt[nt]>>>1|(tt[nt-1]&1)<<31;tt[0]=tt[0]>>>1,st&&(tt[0]=tt[0]^225<<24)}this.state=j(rt)},et.prototype.update=function(tt){this.cache=a.concat([this.cache,tt]);for(var rt;this.cache.length>=16;)rt=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(rt)},et.prototype.final=function(tt,rt){return this.cache.length&&this.ghash(a.concat([this.cache,_],16)),this.ghash(j([0,tt,0,rt])),this.state},ghash=et,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var a=requireAes(),_=safeBufferExports.Buffer,$=cipherBase,j=inherits_browserExports,et=requireGhash(),tt=requireBufferXor(),rt=requireIncr32();function nt(ot,at){var ut=0;ot.length!==at.length&&ut++;for(var ht=Math.min(ot.length,at.length),yt=0;yt0||rt>0;){var at=new _;at.update(ot),at.update(j),et&&at.update(et),ot=at.digest();var ut=0;if(nt>0){var ht=it.length-nt;ut=Math.min(nt,ot.length),ot.copy(it,ht,0,ut),nt-=ut}if(ut0){var yt=st.length-rt,wt=Math.min(rt,ot.length-ut);ot.copy(st,yt,ut,ut+wt),rt-=wt}}return ot.fill(0),{key:it,iv:st}}return evp_bytestokey=$,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var a=requireModes$1(),_=requireAuthCipher(),$=safeBufferExports.Buffer,j=requireStreamCipher(),et=cipherBase,tt=requireAes(),rt=requireEvp_bytestokey(),nt=inherits_browserExports;function it(ht,yt,wt){et.call(this),this._cache=new ot,this._cipher=new tt.AES(yt),this._prev=$.from(wt),this._mode=ht,this._autopadding=!0}nt(it,et),it.prototype._update=function(ht){this._cache.add(ht);for(var yt,wt,Ct=[];yt=this._cache.get();)wt=this._mode.encrypt(this,yt),Ct.push(wt);return $.concat(Ct)};var st=$.alloc(16,16);it.prototype._final=function(){var ht=this._cache.flush();if(this._autopadding)return ht=this._mode.encrypt(this,ht),this._cipher.scrub(),ht;if(!ht.equals(st))throw this._cipher.scrub(),new Error("data not multiple of block length")},it.prototype.setAutoPadding=function(ht){return this._autopadding=!!ht,this};function ot(){this.cache=$.allocUnsafe(0)}ot.prototype.add=function(ht){this.cache=$.concat([this.cache,ht])},ot.prototype.get=function(){if(this.cache.length>15){var ht=this.cache.slice(0,16);return this.cache=this.cache.slice(16),ht}return null},ot.prototype.flush=function(){for(var ht=16-this.cache.length,yt=$.allocUnsafe(ht),wt=-1;++wt16)return yt=this.cache.slice(0,16),this.cache=this.cache.slice(16),yt}else if(this.cache.length>=16)return yt=this.cache.slice(0,16),this.cache=this.cache.slice(16),yt;return null},st.prototype.flush=function(){if(this.cache.length)return this.cache};function ot(ht){var yt=ht[15];if(yt<1||yt>16)throw new Error("unable to decrypt data");for(var wt=-1;++wt0?bt:vt},tt.min=function(bt,vt){return bt.cmp(vt)<0?bt:vt},tt.prototype._init=function(bt,vt,ct){if(typeof bt=="number")return this._initNumber(bt,vt,ct);if(typeof bt=="object")return this._initArray(bt,vt,ct);vt==="hex"&&(vt=16),j(vt===(vt|0)&&vt>=2&&vt<=36),bt=bt.toString().replace(/\s+/g,"");var dt=0;bt[0]==="-"&&(dt++,this.negative=1),dt=0;dt-=3)xt=bt[dt]|bt[dt-1]<<8|bt[dt-2]<<16,this.words[mt]|=xt<>>26-At&67108863,At+=24,At>=26&&(At-=26,mt++);else if(ct==="le")for(dt=0,mt=0;dt>>26-At&67108863,At+=24,At>=26&&(At-=26,mt++);return this.strip()};function nt(jt,bt){var vt=jt.charCodeAt(bt);return vt>=65&&vt<=70?vt-55:vt>=97&&vt<=102?vt-87:vt-48&15}function it(jt,bt,vt){var ct=nt(jt,vt);return vt-1>=bt&&(ct|=nt(jt,vt-1)<<4),ct}tt.prototype._parseHex=function(bt,vt,ct){this.length=Math.ceil((bt.length-vt)/6),this.words=new Array(this.length);for(var dt=0;dt=vt;dt-=2)At=it(bt,vt,dt)<=18?(mt-=18,xt+=1,this.words[xt]|=At>>>26):mt+=8;else{var Rt=bt.length-vt;for(dt=Rt%2===0?vt+1:vt;dt=18?(mt-=18,xt+=1,this.words[xt]|=At>>>26):mt+=8}this.strip()};function st(jt,bt,vt,ct){for(var dt=0,mt=Math.min(jt.length,vt),xt=bt;xt=49?dt+=At-49+10:At>=17?dt+=At-17+10:dt+=At}return dt}tt.prototype._parseBase=function(bt,vt,ct){this.words=[0],this.length=1;for(var dt=0,mt=1;mt<=67108863;mt*=vt)dt++;dt--,mt=mt/vt|0;for(var xt=bt.length-ct,At=xt%dt,Rt=Math.min(xt,xt-At)+ct,St=0,Tt=ct;Tt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},tt.prototype.inspect=function(){return(this.red?""};var ot=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],at=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],ut=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(bt,vt){bt=bt||10,vt=vt|0||1;var ct;if(bt===16||bt==="hex"){ct="";for(var dt=0,mt=0,xt=0;xt>>24-dt&16777215,mt!==0||xt!==this.length-1?ct=ot[6-Rt.length]+Rt+ct:ct=Rt+ct,dt+=2,dt>=26&&(dt-=26,xt--)}for(mt!==0&&(ct=mt.toString(16)+ct);ct.length%vt!==0;)ct="0"+ct;return this.negative!==0&&(ct="-"+ct),ct}if(bt===(bt|0)&&bt>=2&&bt<=36){var St=at[bt],Tt=ut[bt];ct="";var Et=this.clone();for(Et.negative=0;!Et.isZero();){var Nt=Et.modn(Tt).toString(bt);Et=Et.idivn(Tt),Et.isZero()?ct=Nt+ct:ct=ot[St-Nt.length]+Nt+ct}for(this.isZero()&&(ct="0"+ct);ct.length%vt!==0;)ct="0"+ct;return this.negative!==0&&(ct="-"+ct),ct}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var bt=this.words[0];return this.length===2?bt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?bt+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-bt:bt},tt.prototype.toJSON=function(){return this.toString(16)},tt.prototype.toBuffer=function(bt,vt){return j(typeof rt<"u"),this.toArrayLike(rt,bt,vt)},tt.prototype.toArray=function(bt,vt){return this.toArrayLike(Array,bt,vt)},tt.prototype.toArrayLike=function(bt,vt,ct){var dt=this.byteLength(),mt=ct||Math.max(1,dt);j(dt<=mt,"byte array longer than desired length"),j(mt>0,"Requested array length <= 0"),this.strip();var xt=vt==="le",At=new bt(mt),Rt,St,Tt=this.clone();if(xt){for(St=0;!Tt.isZero();St++)Rt=Tt.andln(255),Tt.iushrn(8),At[St]=Rt;for(;St=4096&&(ct+=13,vt>>>=13),vt>=64&&(ct+=7,vt>>>=7),vt>=8&&(ct+=4,vt>>>=4),vt>=2&&(ct+=2,vt>>>=2),ct+vt},tt.prototype._zeroBits=function(bt){if(bt===0)return 26;var vt=bt,ct=0;return vt&8191||(ct+=13,vt>>>=13),vt&127||(ct+=7,vt>>>=7),vt&15||(ct+=4,vt>>>=4),vt&3||(ct+=2,vt>>>=2),vt&1||ct++,ct},tt.prototype.bitLength=function(){var bt=this.words[this.length-1],vt=this._countBits(bt);return(this.length-1)*26+vt};function ht(jt){for(var bt=new Array(jt.bitLength()),vt=0;vt>>dt}return bt}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var bt=0,vt=0;vtbt.length?this.clone().ior(bt):bt.clone().ior(this)},tt.prototype.uor=function(bt){return this.length>bt.length?this.clone().iuor(bt):bt.clone().iuor(this)},tt.prototype.iuand=function(bt){var vt;this.length>bt.length?vt=bt:vt=this;for(var ct=0;ctbt.length?this.clone().iand(bt):bt.clone().iand(this)},tt.prototype.uand=function(bt){return this.length>bt.length?this.clone().iuand(bt):bt.clone().iuand(this)},tt.prototype.iuxor=function(bt){var vt,ct;this.length>bt.length?(vt=this,ct=bt):(vt=bt,ct=this);for(var dt=0;dtbt.length?this.clone().ixor(bt):bt.clone().ixor(this)},tt.prototype.uxor=function(bt){return this.length>bt.length?this.clone().iuxor(bt):bt.clone().iuxor(this)},tt.prototype.inotn=function(bt){j(typeof bt=="number"&&bt>=0);var vt=Math.ceil(bt/26)|0,ct=bt%26;this._expand(vt),ct>0&&vt--;for(var dt=0;dt0&&(this.words[dt]=~this.words[dt]&67108863>>26-ct),this.strip()},tt.prototype.notn=function(bt){return this.clone().inotn(bt)},tt.prototype.setn=function(bt,vt){j(typeof bt=="number"&&bt>=0);var ct=bt/26|0,dt=bt%26;return this._expand(ct+1),vt?this.words[ct]=this.words[ct]|1<bt.length?(ct=this,dt=bt):(ct=bt,dt=this);for(var mt=0,xt=0;xt>>26;for(;mt!==0&&xt>>26;if(this.length=ct.length,mt!==0)this.words[this.length]=mt,this.length++;else if(ct!==this)for(;xtbt.length?this.clone().iadd(bt):bt.clone().iadd(this)},tt.prototype.isub=function(bt){if(bt.negative!==0){bt.negative=0;var vt=this.iadd(bt);return bt.negative=1,vt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(bt),this.negative=1,this._normSign();var ct=this.cmp(bt);if(ct===0)return this.negative=0,this.length=1,this.words[0]=0,this;var dt,mt;ct>0?(dt=this,mt=bt):(dt=bt,mt=this);for(var xt=0,At=0;At>26,this.words[At]=vt&67108863;for(;xt!==0&&At>26,this.words[At]=vt&67108863;if(xt===0&&At>>26,Et=Rt&67108863,Nt=Math.min(St,bt.length-1),tr=Math.max(0,St-jt.length+1);tr<=Nt;tr++){var ir=St-tr|0;dt=jt.words[ir]|0,mt=bt.words[tr]|0,xt=dt*mt+Et,Tt+=xt/67108864|0,Et=xt&67108863}vt.words[St]=Et|0,Rt=Tt|0}return Rt!==0?vt.words[St]=Rt|0:vt.length--,vt.strip()}var wt=function(bt,vt,ct){var dt=bt.words,mt=vt.words,xt=ct.words,At=0,Rt,St,Tt,Et=dt[0]|0,Nt=Et&8191,tr=Et>>>13,ir=dt[1]|0,nr=ir&8191,Zt=ir>>>13,Kt=dt[2]|0,Qt=Kt&8191,Ht=Kt>>>13,qt=dt[3]|0,Jt=qt&8191,ur=qt>>>13,xr=dt[4]|0,pr=xr&8191,Cr=xr>>>13,Mr=dt[5]|0,lr=Mr&8191,fr=Mr>>>13,_r=dt[6]|0,Rr=_r&8191,kr=_r>>>13,Ar=dt[7]|0,Pr=Ar&8191,Or=Ar>>>13,Br=dt[8]|0,or=Br&8191,Yt=Br>>>13,er=dt[9]|0,Gt=er&8191,Vt=er>>>13,Wt=mt[0]|0,ar=Wt&8191,yr=Wt>>>13,Er=mt[1]|0,Sr=Er&8191,Wr=Er>>>13,Hr=mt[2]|0,Fr=Hr&8191,pn=Hr>>>13,Jr=mt[3]|0,Qr=Jr&8191,mn=Jr>>>13,ln=mt[4]|0,qr=ln&8191,En=ln>>>13,un=mt[5]|0,Vr=un&8191,hn=un>>>13,fn=mt[6]|0,Kr=fn&8191,Rn=fn>>>13,dn=mt[7]|0,Gr=dn&8191,gn=dn>>>13,an=mt[8]|0,Zr=an&8191,An=an>>>13,Sn=mt[9]|0,nn=Sn&8191,Pn=Sn>>>13;ct.negative=bt.negative^vt.negative,ct.length=19,Rt=Math.imul(Nt,ar),St=Math.imul(Nt,yr),St=St+Math.imul(tr,ar)|0,Tt=Math.imul(tr,yr);var yn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(yn>>>26)|0,yn&=67108863,Rt=Math.imul(nr,ar),St=Math.imul(nr,yr),St=St+Math.imul(Zt,ar)|0,Tt=Math.imul(Zt,yr),Rt=Rt+Math.imul(Nt,Sr)|0,St=St+Math.imul(Nt,Wr)|0,St=St+Math.imul(tr,Sr)|0,Tt=Tt+Math.imul(tr,Wr)|0;var _n=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(_n>>>26)|0,_n&=67108863,Rt=Math.imul(Qt,ar),St=Math.imul(Qt,yr),St=St+Math.imul(Ht,ar)|0,Tt=Math.imul(Ht,yr),Rt=Rt+Math.imul(nr,Sr)|0,St=St+Math.imul(nr,Wr)|0,St=St+Math.imul(Zt,Sr)|0,Tt=Tt+Math.imul(Zt,Wr)|0,Rt=Rt+Math.imul(Nt,Fr)|0,St=St+Math.imul(Nt,pn)|0,St=St+Math.imul(tr,Fr)|0,Tt=Tt+Math.imul(tr,pn)|0;var ds=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ds>>>26)|0,ds&=67108863,Rt=Math.imul(Jt,ar),St=Math.imul(Jt,yr),St=St+Math.imul(ur,ar)|0,Tt=Math.imul(ur,yr),Rt=Rt+Math.imul(Qt,Sr)|0,St=St+Math.imul(Qt,Wr)|0,St=St+Math.imul(Ht,Sr)|0,Tt=Tt+Math.imul(Ht,Wr)|0,Rt=Rt+Math.imul(nr,Fr)|0,St=St+Math.imul(nr,pn)|0,St=St+Math.imul(Zt,Fr)|0,Tt=Tt+Math.imul(Zt,pn)|0,Rt=Rt+Math.imul(Nt,Qr)|0,St=St+Math.imul(Nt,mn)|0,St=St+Math.imul(tr,Qr)|0,Tt=Tt+Math.imul(tr,mn)|0;var fs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(fs>>>26)|0,fs&=67108863,Rt=Math.imul(pr,ar),St=Math.imul(pr,yr),St=St+Math.imul(Cr,ar)|0,Tt=Math.imul(Cr,yr),Rt=Rt+Math.imul(Jt,Sr)|0,St=St+Math.imul(Jt,Wr)|0,St=St+Math.imul(ur,Sr)|0,Tt=Tt+Math.imul(ur,Wr)|0,Rt=Rt+Math.imul(Qt,Fr)|0,St=St+Math.imul(Qt,pn)|0,St=St+Math.imul(Ht,Fr)|0,Tt=Tt+Math.imul(Ht,pn)|0,Rt=Rt+Math.imul(nr,Qr)|0,St=St+Math.imul(nr,mn)|0,St=St+Math.imul(Zt,Qr)|0,Tt=Tt+Math.imul(Zt,mn)|0,Rt=Rt+Math.imul(Nt,qr)|0,St=St+Math.imul(Nt,En)|0,St=St+Math.imul(tr,qr)|0,Tt=Tt+Math.imul(tr,En)|0;var hs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(hs>>>26)|0,hs&=67108863,Rt=Math.imul(lr,ar),St=Math.imul(lr,yr),St=St+Math.imul(fr,ar)|0,Tt=Math.imul(fr,yr),Rt=Rt+Math.imul(pr,Sr)|0,St=St+Math.imul(pr,Wr)|0,St=St+Math.imul(Cr,Sr)|0,Tt=Tt+Math.imul(Cr,Wr)|0,Rt=Rt+Math.imul(Jt,Fr)|0,St=St+Math.imul(Jt,pn)|0,St=St+Math.imul(ur,Fr)|0,Tt=Tt+Math.imul(ur,pn)|0,Rt=Rt+Math.imul(Qt,Qr)|0,St=St+Math.imul(Qt,mn)|0,St=St+Math.imul(Ht,Qr)|0,Tt=Tt+Math.imul(Ht,mn)|0,Rt=Rt+Math.imul(nr,qr)|0,St=St+Math.imul(nr,En)|0,St=St+Math.imul(Zt,qr)|0,Tt=Tt+Math.imul(Zt,En)|0,Rt=Rt+Math.imul(Nt,Vr)|0,St=St+Math.imul(Nt,hn)|0,St=St+Math.imul(tr,Vr)|0,Tt=Tt+Math.imul(tr,hn)|0;var ps=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ps>>>26)|0,ps&=67108863,Rt=Math.imul(Rr,ar),St=Math.imul(Rr,yr),St=St+Math.imul(kr,ar)|0,Tt=Math.imul(kr,yr),Rt=Rt+Math.imul(lr,Sr)|0,St=St+Math.imul(lr,Wr)|0,St=St+Math.imul(fr,Sr)|0,Tt=Tt+Math.imul(fr,Wr)|0,Rt=Rt+Math.imul(pr,Fr)|0,St=St+Math.imul(pr,pn)|0,St=St+Math.imul(Cr,Fr)|0,Tt=Tt+Math.imul(Cr,pn)|0,Rt=Rt+Math.imul(Jt,Qr)|0,St=St+Math.imul(Jt,mn)|0,St=St+Math.imul(ur,Qr)|0,Tt=Tt+Math.imul(ur,mn)|0,Rt=Rt+Math.imul(Qt,qr)|0,St=St+Math.imul(Qt,En)|0,St=St+Math.imul(Ht,qr)|0,Tt=Tt+Math.imul(Ht,En)|0,Rt=Rt+Math.imul(nr,Vr)|0,St=St+Math.imul(nr,hn)|0,St=St+Math.imul(Zt,Vr)|0,Tt=Tt+Math.imul(Zt,hn)|0,Rt=Rt+Math.imul(Nt,Kr)|0,St=St+Math.imul(Nt,Rn)|0,St=St+Math.imul(tr,Kr)|0,Tt=Tt+Math.imul(tr,Rn)|0;var Vn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Rt=Math.imul(Pr,ar),St=Math.imul(Pr,yr),St=St+Math.imul(Or,ar)|0,Tt=Math.imul(Or,yr),Rt=Rt+Math.imul(Rr,Sr)|0,St=St+Math.imul(Rr,Wr)|0,St=St+Math.imul(kr,Sr)|0,Tt=Tt+Math.imul(kr,Wr)|0,Rt=Rt+Math.imul(lr,Fr)|0,St=St+Math.imul(lr,pn)|0,St=St+Math.imul(fr,Fr)|0,Tt=Tt+Math.imul(fr,pn)|0,Rt=Rt+Math.imul(pr,Qr)|0,St=St+Math.imul(pr,mn)|0,St=St+Math.imul(Cr,Qr)|0,Tt=Tt+Math.imul(Cr,mn)|0,Rt=Rt+Math.imul(Jt,qr)|0,St=St+Math.imul(Jt,En)|0,St=St+Math.imul(ur,qr)|0,Tt=Tt+Math.imul(ur,En)|0,Rt=Rt+Math.imul(Qt,Vr)|0,St=St+Math.imul(Qt,hn)|0,St=St+Math.imul(Ht,Vr)|0,Tt=Tt+Math.imul(Ht,hn)|0,Rt=Rt+Math.imul(nr,Kr)|0,St=St+Math.imul(nr,Rn)|0,St=St+Math.imul(Zt,Kr)|0,Tt=Tt+Math.imul(Zt,Rn)|0,Rt=Rt+Math.imul(Nt,Gr)|0,St=St+Math.imul(Nt,gn)|0,St=St+Math.imul(tr,Gr)|0,Tt=Tt+Math.imul(tr,gn)|0;var ss=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ss>>>26)|0,ss&=67108863,Rt=Math.imul(or,ar),St=Math.imul(or,yr),St=St+Math.imul(Yt,ar)|0,Tt=Math.imul(Yt,yr),Rt=Rt+Math.imul(Pr,Sr)|0,St=St+Math.imul(Pr,Wr)|0,St=St+Math.imul(Or,Sr)|0,Tt=Tt+Math.imul(Or,Wr)|0,Rt=Rt+Math.imul(Rr,Fr)|0,St=St+Math.imul(Rr,pn)|0,St=St+Math.imul(kr,Fr)|0,Tt=Tt+Math.imul(kr,pn)|0,Rt=Rt+Math.imul(lr,Qr)|0,St=St+Math.imul(lr,mn)|0,St=St+Math.imul(fr,Qr)|0,Tt=Tt+Math.imul(fr,mn)|0,Rt=Rt+Math.imul(pr,qr)|0,St=St+Math.imul(pr,En)|0,St=St+Math.imul(Cr,qr)|0,Tt=Tt+Math.imul(Cr,En)|0,Rt=Rt+Math.imul(Jt,Vr)|0,St=St+Math.imul(Jt,hn)|0,St=St+Math.imul(ur,Vr)|0,Tt=Tt+Math.imul(ur,hn)|0,Rt=Rt+Math.imul(Qt,Kr)|0,St=St+Math.imul(Qt,Rn)|0,St=St+Math.imul(Ht,Kr)|0,Tt=Tt+Math.imul(Ht,Rn)|0,Rt=Rt+Math.imul(nr,Gr)|0,St=St+Math.imul(nr,gn)|0,St=St+Math.imul(Zt,Gr)|0,Tt=Tt+Math.imul(Zt,gn)|0,Rt=Rt+Math.imul(Nt,Zr)|0,St=St+Math.imul(Nt,An)|0,St=St+Math.imul(tr,Zr)|0,Tt=Tt+Math.imul(tr,An)|0;var Jn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Rt=Math.imul(Gt,ar),St=Math.imul(Gt,yr),St=St+Math.imul(Vt,ar)|0,Tt=Math.imul(Vt,yr),Rt=Rt+Math.imul(or,Sr)|0,St=St+Math.imul(or,Wr)|0,St=St+Math.imul(Yt,Sr)|0,Tt=Tt+Math.imul(Yt,Wr)|0,Rt=Rt+Math.imul(Pr,Fr)|0,St=St+Math.imul(Pr,pn)|0,St=St+Math.imul(Or,Fr)|0,Tt=Tt+Math.imul(Or,pn)|0,Rt=Rt+Math.imul(Rr,Qr)|0,St=St+Math.imul(Rr,mn)|0,St=St+Math.imul(kr,Qr)|0,Tt=Tt+Math.imul(kr,mn)|0,Rt=Rt+Math.imul(lr,qr)|0,St=St+Math.imul(lr,En)|0,St=St+Math.imul(fr,qr)|0,Tt=Tt+Math.imul(fr,En)|0,Rt=Rt+Math.imul(pr,Vr)|0,St=St+Math.imul(pr,hn)|0,St=St+Math.imul(Cr,Vr)|0,Tt=Tt+Math.imul(Cr,hn)|0,Rt=Rt+Math.imul(Jt,Kr)|0,St=St+Math.imul(Jt,Rn)|0,St=St+Math.imul(ur,Kr)|0,Tt=Tt+Math.imul(ur,Rn)|0,Rt=Rt+Math.imul(Qt,Gr)|0,St=St+Math.imul(Qt,gn)|0,St=St+Math.imul(Ht,Gr)|0,Tt=Tt+Math.imul(Ht,gn)|0,Rt=Rt+Math.imul(nr,Zr)|0,St=St+Math.imul(nr,An)|0,St=St+Math.imul(Zt,Zr)|0,Tt=Tt+Math.imul(Zt,An)|0,Rt=Rt+Math.imul(Nt,nn)|0,St=St+Math.imul(Nt,Pn)|0,St=St+Math.imul(tr,nn)|0,Tt=Tt+Math.imul(tr,Pn)|0;var Yn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Rt=Math.imul(Gt,Sr),St=Math.imul(Gt,Wr),St=St+Math.imul(Vt,Sr)|0,Tt=Math.imul(Vt,Wr),Rt=Rt+Math.imul(or,Fr)|0,St=St+Math.imul(or,pn)|0,St=St+Math.imul(Yt,Fr)|0,Tt=Tt+Math.imul(Yt,pn)|0,Rt=Rt+Math.imul(Pr,Qr)|0,St=St+Math.imul(Pr,mn)|0,St=St+Math.imul(Or,Qr)|0,Tt=Tt+Math.imul(Or,mn)|0,Rt=Rt+Math.imul(Rr,qr)|0,St=St+Math.imul(Rr,En)|0,St=St+Math.imul(kr,qr)|0,Tt=Tt+Math.imul(kr,En)|0,Rt=Rt+Math.imul(lr,Vr)|0,St=St+Math.imul(lr,hn)|0,St=St+Math.imul(fr,Vr)|0,Tt=Tt+Math.imul(fr,hn)|0,Rt=Rt+Math.imul(pr,Kr)|0,St=St+Math.imul(pr,Rn)|0,St=St+Math.imul(Cr,Kr)|0,Tt=Tt+Math.imul(Cr,Rn)|0,Rt=Rt+Math.imul(Jt,Gr)|0,St=St+Math.imul(Jt,gn)|0,St=St+Math.imul(ur,Gr)|0,Tt=Tt+Math.imul(ur,gn)|0,Rt=Rt+Math.imul(Qt,Zr)|0,St=St+Math.imul(Qt,An)|0,St=St+Math.imul(Ht,Zr)|0,Tt=Tt+Math.imul(Ht,An)|0,Rt=Rt+Math.imul(nr,nn)|0,St=St+Math.imul(nr,Pn)|0,St=St+Math.imul(Zt,nn)|0,Tt=Tt+Math.imul(Zt,Pn)|0;var ms=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ms>>>26)|0,ms&=67108863,Rt=Math.imul(Gt,Fr),St=Math.imul(Gt,pn),St=St+Math.imul(Vt,Fr)|0,Tt=Math.imul(Vt,pn),Rt=Rt+Math.imul(or,Qr)|0,St=St+Math.imul(or,mn)|0,St=St+Math.imul(Yt,Qr)|0,Tt=Tt+Math.imul(Yt,mn)|0,Rt=Rt+Math.imul(Pr,qr)|0,St=St+Math.imul(Pr,En)|0,St=St+Math.imul(Or,qr)|0,Tt=Tt+Math.imul(Or,En)|0,Rt=Rt+Math.imul(Rr,Vr)|0,St=St+Math.imul(Rr,hn)|0,St=St+Math.imul(kr,Vr)|0,Tt=Tt+Math.imul(kr,hn)|0,Rt=Rt+Math.imul(lr,Kr)|0,St=St+Math.imul(lr,Rn)|0,St=St+Math.imul(fr,Kr)|0,Tt=Tt+Math.imul(fr,Rn)|0,Rt=Rt+Math.imul(pr,Gr)|0,St=St+Math.imul(pr,gn)|0,St=St+Math.imul(Cr,Gr)|0,Tt=Tt+Math.imul(Cr,gn)|0,Rt=Rt+Math.imul(Jt,Zr)|0,St=St+Math.imul(Jt,An)|0,St=St+Math.imul(ur,Zr)|0,Tt=Tt+Math.imul(ur,An)|0,Rt=Rt+Math.imul(Qt,nn)|0,St=St+Math.imul(Qt,Pn)|0,St=St+Math.imul(Ht,nn)|0,Tt=Tt+Math.imul(Ht,Pn)|0;var Qn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Rt=Math.imul(Gt,Qr),St=Math.imul(Gt,mn),St=St+Math.imul(Vt,Qr)|0,Tt=Math.imul(Vt,mn),Rt=Rt+Math.imul(or,qr)|0,St=St+Math.imul(or,En)|0,St=St+Math.imul(Yt,qr)|0,Tt=Tt+Math.imul(Yt,En)|0,Rt=Rt+Math.imul(Pr,Vr)|0,St=St+Math.imul(Pr,hn)|0,St=St+Math.imul(Or,Vr)|0,Tt=Tt+Math.imul(Or,hn)|0,Rt=Rt+Math.imul(Rr,Kr)|0,St=St+Math.imul(Rr,Rn)|0,St=St+Math.imul(kr,Kr)|0,Tt=Tt+Math.imul(kr,Rn)|0,Rt=Rt+Math.imul(lr,Gr)|0,St=St+Math.imul(lr,gn)|0,St=St+Math.imul(fr,Gr)|0,Tt=Tt+Math.imul(fr,gn)|0,Rt=Rt+Math.imul(pr,Zr)|0,St=St+Math.imul(pr,An)|0,St=St+Math.imul(Cr,Zr)|0,Tt=Tt+Math.imul(Cr,An)|0,Rt=Rt+Math.imul(Jt,nn)|0,St=St+Math.imul(Jt,Pn)|0,St=St+Math.imul(ur,nn)|0,Tt=Tt+Math.imul(ur,Pn)|0;var es=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(es>>>26)|0,es&=67108863,Rt=Math.imul(Gt,qr),St=Math.imul(Gt,En),St=St+Math.imul(Vt,qr)|0,Tt=Math.imul(Vt,En),Rt=Rt+Math.imul(or,Vr)|0,St=St+Math.imul(or,hn)|0,St=St+Math.imul(Yt,Vr)|0,Tt=Tt+Math.imul(Yt,hn)|0,Rt=Rt+Math.imul(Pr,Kr)|0,St=St+Math.imul(Pr,Rn)|0,St=St+Math.imul(Or,Kr)|0,Tt=Tt+Math.imul(Or,Rn)|0,Rt=Rt+Math.imul(Rr,Gr)|0,St=St+Math.imul(Rr,gn)|0,St=St+Math.imul(kr,Gr)|0,Tt=Tt+Math.imul(kr,gn)|0,Rt=Rt+Math.imul(lr,Zr)|0,St=St+Math.imul(lr,An)|0,St=St+Math.imul(fr,Zr)|0,Tt=Tt+Math.imul(fr,An)|0,Rt=Rt+Math.imul(pr,nn)|0,St=St+Math.imul(pr,Pn)|0,St=St+Math.imul(Cr,nn)|0,Tt=Tt+Math.imul(Cr,Pn)|0;var ls=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ls>>>26)|0,ls&=67108863,Rt=Math.imul(Gt,Vr),St=Math.imul(Gt,hn),St=St+Math.imul(Vt,Vr)|0,Tt=Math.imul(Vt,hn),Rt=Rt+Math.imul(or,Kr)|0,St=St+Math.imul(or,Rn)|0,St=St+Math.imul(Yt,Kr)|0,Tt=Tt+Math.imul(Yt,Rn)|0,Rt=Rt+Math.imul(Pr,Gr)|0,St=St+Math.imul(Pr,gn)|0,St=St+Math.imul(Or,Gr)|0,Tt=Tt+Math.imul(Or,gn)|0,Rt=Rt+Math.imul(Rr,Zr)|0,St=St+Math.imul(Rr,An)|0,St=St+Math.imul(kr,Zr)|0,Tt=Tt+Math.imul(kr,An)|0,Rt=Rt+Math.imul(lr,nn)|0,St=St+Math.imul(lr,Pn)|0,St=St+Math.imul(fr,nn)|0,Tt=Tt+Math.imul(fr,Pn)|0;var us=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(us>>>26)|0,us&=67108863,Rt=Math.imul(Gt,Kr),St=Math.imul(Gt,Rn),St=St+Math.imul(Vt,Kr)|0,Tt=Math.imul(Vt,Rn),Rt=Rt+Math.imul(or,Gr)|0,St=St+Math.imul(or,gn)|0,St=St+Math.imul(Yt,Gr)|0,Tt=Tt+Math.imul(Yt,gn)|0,Rt=Rt+Math.imul(Pr,Zr)|0,St=St+Math.imul(Pr,An)|0,St=St+Math.imul(Or,Zr)|0,Tt=Tt+Math.imul(Or,An)|0,Rt=Rt+Math.imul(Rr,nn)|0,St=St+Math.imul(Rr,Pn)|0,St=St+Math.imul(kr,nn)|0,Tt=Tt+Math.imul(kr,Pn)|0;var Wn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Rt=Math.imul(Gt,Gr),St=Math.imul(Gt,gn),St=St+Math.imul(Vt,Gr)|0,Tt=Math.imul(Vt,gn),Rt=Rt+Math.imul(or,Zr)|0,St=St+Math.imul(or,An)|0,St=St+Math.imul(Yt,Zr)|0,Tt=Tt+Math.imul(Yt,An)|0,Rt=Rt+Math.imul(Pr,nn)|0,St=St+Math.imul(Pr,Pn)|0,St=St+Math.imul(Or,nn)|0,Tt=Tt+Math.imul(Or,Pn)|0;var as=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(as>>>26)|0,as&=67108863,Rt=Math.imul(Gt,Zr),St=Math.imul(Gt,An),St=St+Math.imul(Vt,Zr)|0,Tt=Math.imul(Vt,An),Rt=Rt+Math.imul(or,nn)|0,St=St+Math.imul(or,Pn)|0,St=St+Math.imul(Yt,nn)|0,Tt=Tt+Math.imul(Yt,Pn)|0;var gs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(gs>>>26)|0,gs&=67108863,Rt=Math.imul(Gt,nn),St=Math.imul(Gt,Pn),St=St+Math.imul(Vt,nn)|0,Tt=Math.imul(Vt,Pn);var vs=(At+Rt|0)+((St&8191)<<13)|0;return At=(Tt+(St>>>13)|0)+(vs>>>26)|0,vs&=67108863,xt[0]=yn,xt[1]=_n,xt[2]=ds,xt[3]=fs,xt[4]=hs,xt[5]=ps,xt[6]=Vn,xt[7]=ss,xt[8]=Jn,xt[9]=Yn,xt[10]=ms,xt[11]=Qn,xt[12]=es,xt[13]=ls,xt[14]=us,xt[15]=Wn,xt[16]=as,xt[17]=gs,xt[18]=vs,At!==0&&(xt[19]=At,ct.length++),ct};Math.imul||(wt=yt);function Ct(jt,bt,vt){vt.negative=bt.negative^jt.negative,vt.length=jt.length+bt.length;for(var ct=0,dt=0,mt=0;mt>>26)|0,dt+=xt>>>26,xt&=67108863}vt.words[mt]=At,ct=xt,xt=dt}return ct!==0?vt.words[mt]=ct:vt.length--,vt.strip()}function Pt(jt,bt,vt){var ct=new $t;return ct.mulp(jt,bt,vt)}tt.prototype.mulTo=function(bt,vt){var ct,dt=this.length+bt.length;return this.length===10&&bt.length===10?ct=wt(this,bt,vt):dt<63?ct=yt(this,bt,vt):dt<1024?ct=Ct(this,bt,vt):ct=Pt(this,bt,vt),ct};function $t(jt,bt){this.x=jt,this.y=bt}$t.prototype.makeRBT=function(bt){for(var vt=new Array(bt),ct=tt.prototype._countBits(bt)-1,dt=0;dt>=1;return dt},$t.prototype.permute=function(bt,vt,ct,dt,mt,xt){for(var At=0;At>>1)mt++;return 1<>>13,ct[2*xt+1]=mt&8191,mt=mt>>>13;for(xt=2*vt;xt>=26,vt+=dt/67108864|0,vt+=mt>>>26,this.words[ct]=mt&67108863}return vt!==0&&(this.words[ct]=vt,this.length++),this},tt.prototype.muln=function(bt){return this.clone().imuln(bt)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(bt){var vt=ht(bt);if(vt.length===0)return new tt(1);for(var ct=this,dt=0;dt=0);var vt=bt%26,ct=(bt-vt)/26,dt=67108863>>>26-vt<<26-vt,mt;if(vt!==0){var xt=0;for(mt=0;mt>>26-vt}xt&&(this.words[mt]=xt,this.length++)}if(ct!==0){for(mt=this.length-1;mt>=0;mt--)this.words[mt+ct]=this.words[mt];for(mt=0;mt=0);var dt;vt?dt=(vt-vt%26)/26:dt=0;var mt=bt%26,xt=Math.min((bt-mt)/26,this.length),At=67108863^67108863>>>mt<xt)for(this.length-=xt,St=0;St=0&&(Tt!==0||St>=dt);St--){var Et=this.words[St]|0;this.words[St]=Tt<<26-mt|Et>>>mt,Tt=Et&At}return Rt&&Tt!==0&&(Rt.words[Rt.length++]=Tt),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},tt.prototype.ishrn=function(bt,vt,ct){return j(this.negative===0),this.iushrn(bt,vt,ct)},tt.prototype.shln=function(bt){return this.clone().ishln(bt)},tt.prototype.ushln=function(bt){return this.clone().iushln(bt)},tt.prototype.shrn=function(bt){return this.clone().ishrn(bt)},tt.prototype.ushrn=function(bt){return this.clone().iushrn(bt)},tt.prototype.testn=function(bt){j(typeof bt=="number"&&bt>=0);var vt=bt%26,ct=(bt-vt)/26,dt=1<=0);var vt=bt%26,ct=(bt-vt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=ct)return this;if(vt!==0&&ct++,this.length=Math.min(ct,this.length),vt!==0){var dt=67108863^67108863>>>vt<=67108864;vt++)this.words[vt]-=67108864,vt===this.length-1?this.words[vt+1]=1:this.words[vt+1]++;return this.length=Math.max(this.length,vt+1),this},tt.prototype.isubn=function(bt){if(j(typeof bt=="number"),j(bt<67108864),bt<0)return this.iaddn(-bt);if(this.negative!==0)return this.negative=0,this.iaddn(bt),this.negative=1,this;if(this.words[0]-=bt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var vt=0;vt>26)-(Rt/67108864|0),this.words[mt+ct]=xt&67108863}for(;mt>26,this.words[mt+ct]=xt&67108863;if(At===0)return this.strip();for(j(At===-1),At=0,mt=0;mt>26,this.words[mt]=xt&67108863;return this.negative=1,this.strip()},tt.prototype._wordDiv=function(bt,vt){var ct=this.length-bt.length,dt=this.clone(),mt=bt,xt=mt.words[mt.length-1]|0,At=this._countBits(xt);ct=26-At,ct!==0&&(mt=mt.ushln(ct),dt.iushln(ct),xt=mt.words[mt.length-1]|0);var Rt=dt.length-mt.length,St;if(vt!=="mod"){St=new tt(null),St.length=Rt+1,St.words=new Array(St.length);for(var Tt=0;Tt=0;Nt--){var tr=(dt.words[mt.length+Nt]|0)*67108864+(dt.words[mt.length+Nt-1]|0);for(tr=Math.min(tr/xt|0,67108863),dt._ishlnsubmul(mt,tr,Nt);dt.negative!==0;)tr--,dt.negative=0,dt._ishlnsubmul(mt,1,Nt),dt.isZero()||(dt.negative^=1);St&&(St.words[Nt]=tr)}return St&&St.strip(),dt.strip(),vt!=="div"&&ct!==0&&dt.iushrn(ct),{div:St||null,mod:dt}},tt.prototype.divmod=function(bt,vt,ct){if(j(!bt.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var dt,mt,xt;return this.negative!==0&&bt.negative===0?(xt=this.neg().divmod(bt,vt),vt!=="mod"&&(dt=xt.div.neg()),vt!=="div"&&(mt=xt.mod.neg(),ct&&mt.negative!==0&&mt.iadd(bt)),{div:dt,mod:mt}):this.negative===0&&bt.negative!==0?(xt=this.divmod(bt.neg(),vt),vt!=="mod"&&(dt=xt.div.neg()),{div:dt,mod:xt.mod}):this.negative&bt.negative?(xt=this.neg().divmod(bt.neg(),vt),vt!=="div"&&(mt=xt.mod.neg(),ct&&mt.negative!==0&&mt.isub(bt)),{div:xt.div,mod:mt}):bt.length>this.length||this.cmp(bt)<0?{div:new tt(0),mod:this}:bt.length===1?vt==="div"?{div:this.divn(bt.words[0]),mod:null}:vt==="mod"?{div:null,mod:new tt(this.modn(bt.words[0]))}:{div:this.divn(bt.words[0]),mod:new tt(this.modn(bt.words[0]))}:this._wordDiv(bt,vt)},tt.prototype.div=function(bt){return this.divmod(bt,"div",!1).div},tt.prototype.mod=function(bt){return this.divmod(bt,"mod",!1).mod},tt.prototype.umod=function(bt){return this.divmod(bt,"mod",!0).mod},tt.prototype.divRound=function(bt){var vt=this.divmod(bt);if(vt.mod.isZero())return vt.div;var ct=vt.div.negative!==0?vt.mod.isub(bt):vt.mod,dt=bt.ushrn(1),mt=bt.andln(1),xt=ct.cmp(dt);return xt<0||mt===1&&xt===0?vt.div:vt.div.negative!==0?vt.div.isubn(1):vt.div.iaddn(1)},tt.prototype.modn=function(bt){j(bt<=67108863);for(var vt=(1<<26)%bt,ct=0,dt=this.length-1;dt>=0;dt--)ct=(vt*ct+(this.words[dt]|0))%bt;return ct},tt.prototype.idivn=function(bt){j(bt<=67108863);for(var vt=0,ct=this.length-1;ct>=0;ct--){var dt=(this.words[ct]|0)+vt*67108864;this.words[ct]=dt/bt|0,vt=dt%bt}return this.strip()},tt.prototype.divn=function(bt){return this.clone().idivn(bt)},tt.prototype.egcd=function(bt){j(bt.negative===0),j(!bt.isZero());var vt=this,ct=bt.clone();vt.negative!==0?vt=vt.umod(bt):vt=vt.clone();for(var dt=new tt(1),mt=new tt(0),xt=new tt(0),At=new tt(1),Rt=0;vt.isEven()&&ct.isEven();)vt.iushrn(1),ct.iushrn(1),++Rt;for(var St=ct.clone(),Tt=vt.clone();!vt.isZero();){for(var Et=0,Nt=1;!(vt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(vt.iushrn(Et);Et-- >0;)(dt.isOdd()||mt.isOdd())&&(dt.iadd(St),mt.isub(Tt)),dt.iushrn(1),mt.iushrn(1);for(var tr=0,ir=1;!(ct.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(ct.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(St),At.isub(Tt)),xt.iushrn(1),At.iushrn(1);vt.cmp(ct)>=0?(vt.isub(ct),dt.isub(xt),mt.isub(At)):(ct.isub(vt),xt.isub(dt),At.isub(mt))}return{a:xt,b:At,gcd:ct.iushln(Rt)}},tt.prototype._invmp=function(bt){j(bt.negative===0),j(!bt.isZero());var vt=this,ct=bt.clone();vt.negative!==0?vt=vt.umod(bt):vt=vt.clone();for(var dt=new tt(1),mt=new tt(0),xt=ct.clone();vt.cmpn(1)>0&&ct.cmpn(1)>0;){for(var At=0,Rt=1;!(vt.words[0]&Rt)&&At<26;++At,Rt<<=1);if(At>0)for(vt.iushrn(At);At-- >0;)dt.isOdd()&&dt.iadd(xt),dt.iushrn(1);for(var St=0,Tt=1;!(ct.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(ct.iushrn(St);St-- >0;)mt.isOdd()&&mt.iadd(xt),mt.iushrn(1);vt.cmp(ct)>=0?(vt.isub(ct),dt.isub(mt)):(ct.isub(vt),mt.isub(dt))}var Et;return vt.cmpn(1)===0?Et=dt:Et=mt,Et.cmpn(0)<0&&Et.iadd(bt),Et},tt.prototype.gcd=function(bt){if(this.isZero())return bt.abs();if(bt.isZero())return this.abs();var vt=this.clone(),ct=bt.clone();vt.negative=0,ct.negative=0;for(var dt=0;vt.isEven()&&ct.isEven();dt++)vt.iushrn(1),ct.iushrn(1);do{for(;vt.isEven();)vt.iushrn(1);for(;ct.isEven();)ct.iushrn(1);var mt=vt.cmp(ct);if(mt<0){var xt=vt;vt=ct,ct=xt}else if(mt===0||ct.cmpn(1)===0)break;vt.isub(ct)}while(!0);return ct.iushln(dt)},tt.prototype.invm=function(bt){return this.egcd(bt).a.umod(bt)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(bt){return this.words[0]&bt},tt.prototype.bincn=function(bt){j(typeof bt=="number");var vt=bt%26,ct=(bt-vt)/26,dt=1<>>26,At&=67108863,this.words[xt]=At}return mt!==0&&(this.words[xt]=mt,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(bt){var vt=bt<0;if(this.negative!==0&&!vt)return-1;if(this.negative===0&&vt)return 1;this.strip();var ct;if(this.length>1)ct=1;else{vt&&(bt=-bt),j(bt<=67108863,"Number is too big");var dt=this.words[0]|0;ct=dt===bt?0:dtbt.length)return 1;if(this.length=0;ct--){var dt=this.words[ct]|0,mt=bt.words[ct]|0;if(dt!==mt){dtmt&&(vt=1);break}}return vt},tt.prototype.gtn=function(bt){return this.cmpn(bt)===1},tt.prototype.gt=function(bt){return this.cmp(bt)===1},tt.prototype.gten=function(bt){return this.cmpn(bt)>=0},tt.prototype.gte=function(bt){return this.cmp(bt)>=0},tt.prototype.ltn=function(bt){return this.cmpn(bt)===-1},tt.prototype.lt=function(bt){return this.cmp(bt)===-1},tt.prototype.lten=function(bt){return this.cmpn(bt)<=0},tt.prototype.lte=function(bt){return this.cmp(bt)<=0},tt.prototype.eqn=function(bt){return this.cmpn(bt)===0},tt.prototype.eq=function(bt){return this.cmp(bt)===0},tt.red=function(bt){return new Lt(bt)},tt.prototype.toRed=function(bt){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),bt.convertTo(this)._forceRed(bt)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(bt){return this.red=bt,this},tt.prototype.forceRed=function(bt){return j(!this.red,"Already a number in reduction context"),this._forceRed(bt)},tt.prototype.redAdd=function(bt){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,bt)},tt.prototype.redIAdd=function(bt){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,bt)},tt.prototype.redSub=function(bt){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,bt)},tt.prototype.redISub=function(bt){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,bt)},tt.prototype.redShl=function(bt){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,bt)},tt.prototype.redMul=function(bt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,bt),this.red.mul(this,bt)},tt.prototype.redIMul=function(bt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,bt),this.red.imul(this,bt)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(bt){return j(this.red&&!bt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,bt)};var Mt={k256:null,p224:null,p192:null,p25519:null};function Bt(jt,bt){this.name=jt,this.p=new tt(bt,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var bt=new tt(null);return bt.words=new Array(Math.ceil(this.n/13)),bt},Bt.prototype.ireduce=function(bt){var vt=bt,ct;do this.split(vt,this.tmp),vt=this.imulK(vt),vt=vt.iadd(this.tmp),ct=vt.bitLength();while(ct>this.n);var dt=ct0?vt.isub(this.p):vt.strip!==void 0?vt.strip():vt._strip(),vt},Bt.prototype.split=function(bt,vt){bt.iushrn(this.n,0,vt)},Bt.prototype.imulK=function(bt){return bt.imul(this.k)};function Dt(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Dt,Bt),Dt.prototype.split=function(bt,vt){for(var ct=4194303,dt=Math.min(bt.length,9),mt=0;mt>>22,xt=At}xt>>>=22,bt.words[mt-10]=xt,xt===0&&bt.length>10?bt.length-=10:bt.length-=9},Dt.prototype.imulK=function(bt){bt.words[bt.length]=0,bt.words[bt.length+1]=0,bt.length+=2;for(var vt=0,ct=0;ct>>=26,bt.words[ct]=mt,vt=dt}return vt!==0&&(bt.words[bt.length++]=vt),bt},tt._prime=function(bt){if(Mt[bt])return Mt[bt];var vt;if(bt==="k256")vt=new Dt;else if(bt==="p224")vt=new zt;else if(bt==="p192")vt=new Ot;else if(bt==="p25519")vt=new It;else throw new Error("Unknown prime "+bt);return Mt[bt]=vt,vt};function Lt(jt){if(typeof jt=="string"){var bt=tt._prime(jt);this.m=bt.p,this.prime=bt}else j(jt.gtn(1),"modulus must be greater than 1"),this.m=jt,this.prime=null}Lt.prototype._verify1=function(bt){j(bt.negative===0,"red works only with positives"),j(bt.red,"red works only with red numbers")},Lt.prototype._verify2=function(bt,vt){j((bt.negative|vt.negative)===0,"red works only with positives"),j(bt.red&&bt.red===vt.red,"red works only with red numbers")},Lt.prototype.imod=function(bt){return this.prime?this.prime.ireduce(bt)._forceRed(this):bt.umod(this.m)._forceRed(this)},Lt.prototype.neg=function(bt){return bt.isZero()?bt.clone():this.m.sub(bt)._forceRed(this)},Lt.prototype.add=function(bt,vt){this._verify2(bt,vt);var ct=bt.add(vt);return ct.cmp(this.m)>=0&&ct.isub(this.m),ct._forceRed(this)},Lt.prototype.iadd=function(bt,vt){this._verify2(bt,vt);var ct=bt.iadd(vt);return ct.cmp(this.m)>=0&&ct.isub(this.m),ct},Lt.prototype.sub=function(bt,vt){this._verify2(bt,vt);var ct=bt.sub(vt);return ct.cmpn(0)<0&&ct.iadd(this.m),ct._forceRed(this)},Lt.prototype.isub=function(bt,vt){this._verify2(bt,vt);var ct=bt.isub(vt);return ct.cmpn(0)<0&&ct.iadd(this.m),ct},Lt.prototype.shl=function(bt,vt){return this._verify1(bt),this.imod(bt.ushln(vt))},Lt.prototype.imul=function(bt,vt){return this._verify2(bt,vt),this.imod(bt.imul(vt))},Lt.prototype.mul=function(bt,vt){return this._verify2(bt,vt),this.imod(bt.mul(vt))},Lt.prototype.isqr=function(bt){return this.imul(bt,bt.clone())},Lt.prototype.sqr=function(bt){return this.mul(bt,bt)},Lt.prototype.sqrt=function(bt){if(bt.isZero())return bt.clone();var vt=this.m.andln(3);if(j(vt%2===1),vt===3){var ct=this.m.add(new tt(1)).iushrn(2);return this.pow(bt,ct)}for(var dt=this.m.subn(1),mt=0;!dt.isZero()&&dt.andln(1)===0;)mt++,dt.iushrn(1);j(!dt.isZero());var xt=new tt(1).toRed(this),At=xt.redNeg(),Rt=this.m.subn(1).iushrn(1),St=this.m.bitLength();for(St=new tt(2*St*St).toRed(this);this.pow(St,Rt).cmp(At)!==0;)St.redIAdd(At);for(var Tt=this.pow(St,dt),Et=this.pow(bt,dt.addn(1).iushrn(1)),Nt=this.pow(bt,dt),tr=mt;Nt.cmp(xt)!==0;){for(var ir=Nt,nr=0;ir.cmp(xt)!==0;nr++)ir=ir.redSqr();j(nr=0;mt--){for(var Tt=vt.words[mt],Et=St-1;Et>=0;Et--){var Nt=Tt>>Et&1;if(xt!==dt[0]&&(xt=this.sqr(xt)),Nt===0&&At===0){Rt=0;continue}At<<=1,At|=Nt,Rt++,!(Rt!==ct&&(mt!==0||Et!==0))&&(xt=this.mul(xt,dt[At]),Rt=0,At=0)}St=26}return xt},Lt.prototype.convertTo=function(bt){var vt=bt.umod(this.m);return vt===bt?vt.clone():vt},Lt.prototype.convertFrom=function(bt){var vt=bt.clone();return vt.red=null,vt},tt.mont=function(bt){return new Ft(bt)};function Ft(jt){Lt.call(this,jt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(Ft,Lt),Ft.prototype.convertTo=function(bt){return this.imod(bt.ushln(this.shift))},Ft.prototype.convertFrom=function(bt){var vt=this.imod(bt.mul(this.rinv));return vt.red=null,vt},Ft.prototype.imul=function(bt,vt){if(bt.isZero()||vt.isZero())return bt.words[0]=0,bt.length=1,bt;var ct=bt.imul(vt),dt=ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mt=ct.isub(dt).iushrn(this.shift),xt=mt;return mt.cmp(this.m)>=0?xt=mt.isub(this.m):mt.cmpn(0)<0&&(xt=mt.iadd(this.m)),xt._forceRed(this)},Ft.prototype.mul=function(bt,vt){if(bt.isZero()||vt.isZero())return new tt(0)._forceRed(this);var ct=bt.mul(vt),dt=ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mt=ct.isub(dt).iushrn(this.shift),xt=mt;return mt.cmp(this.m)>=0?xt=mt.isub(this.m):mt.cmpn(0)<0&&(xt=mt.iadd(this.m)),xt._forceRed(this)},Ft.prototype.invm=function(bt){var vt=this.imod(bt._invmp(this.m).mul(this.r2));return vt._forceRed(this)}})(a,commonjsGlobal)})(bn$4);var bnExports$1=bn$4.exports;const BN$9=getDefaultExportFromCjs$1(bnExports$1);var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var a;brorand.exports=function(et){return a||(a=new _(null)),a.generate(et)};function _(j){this.rand=j}if(brorand.exports.Rand=_,_.prototype.generate=function(et){return this._rand(et)},_.prototype._rand=function(et){if(this.rand.getBytes)return this.rand.getBytes(et);for(var tt=new Uint8Array(et),rt=0;rt=0);return nt},$.prototype._randrange=function(et,tt){var rt=tt.sub(et);return et.add(this._randbelow(rt))},$.prototype.test=function(et,tt,rt){var nt=et.bitLength(),it=a.mont(et),st=new a(1).toRed(it);tt||(tt=Math.max(1,nt/48|0));for(var ot=et.subn(1),at=0;!ot.testn(at);at++);for(var ut=et.shrn(at),ht=ot.toRed(it),yt=!0;tt>0;tt--){var wt=this._randrange(new a(2),ot);rt&&rt(wt);var Ct=wt.toRed(it).redPow(ut);if(!(Ct.cmp(st)===0||Ct.cmp(ht)===0)){for(var Pt=1;Pt0;tt--){var ht=this._randrange(new a(2),st),yt=et.gcd(ht);if(yt.cmpn(1)!==0)return yt;var wt=ht.toRed(nt).redPow(at);if(!(wt.cmp(it)===0||wt.cmp(ut)===0)){for(var Ct=1;CtPt;)Mt.ishrn(1);if(Mt.isEven()&&Mt.iadd(tt),Mt.testn(1)||Mt.iadd(rt),$t.cmp(rt)){if(!$t.cmp(nt))for(;Mt.mod(it).cmp(st);)Mt.iadd(at)}else for(;Mt.mod($).cmp(ot);)Mt.iadd(at);if(Bt=Mt.shrn(1),yt(Bt)&&yt(Mt)&&wt(Bt)&&wt(Mt)&&et.test(Bt)&&et.test(Mt))return Mt}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$2={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var a=bnExports$1,_=requireMr(),$=new _,j=new a(24),et=new a(11),tt=new a(10),rt=new a(3),nt=new a(7),it=requireGeneratePrime(),st=requireBrowser$8();dh=yt;function ot(Ct,Pt){return Pt=Pt||"utf8",Buffer$g.isBuffer(Ct)||(Ct=new Buffer$g(Ct,Pt)),this._pub=new a(Ct),this}function at(Ct,Pt){return Pt=Pt||"utf8",Buffer$g.isBuffer(Ct)||(Ct=new Buffer$g(Ct,Pt)),this._priv=new a(Ct),this}var ut={};function ht(Ct,Pt){var $t=Pt.toString("hex"),Mt=[$t,Ct.toString(16)].join("_");if(Mt in ut)return ut[Mt];var Bt=0;if(Ct.isEven()||!it.simpleSieve||!it.fermatTest(Ct)||!$.test(Ct))return Bt+=1,$t==="02"||$t==="05"?Bt+=8:Bt+=4,ut[Mt]=Bt,Bt;$.test(Ct.shrn(1))||(Bt+=2);var Dt;switch($t){case"02":Ct.mod(j).cmp(et)&&(Bt+=8);break;case"05":Dt=Ct.mod(tt),Dt.cmp(rt)&&Dt.cmp(nt)&&(Bt+=8);break;default:Bt+=4}return ut[Mt]=Bt,Bt}function yt(Ct,Pt,$t){this.setGenerator(Pt),this.__prime=new a(Ct),this._prime=a.mont(this.__prime),this._primeLen=Ct.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,$t?(this.setPublicKey=ot,this.setPrivateKey=at):this._primeCode=8}Object.defineProperty(yt.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=ht(this.__prime,this.__gen)),this._primeCode}}),yt.prototype.generateKeys=function(){return this._priv||(this._priv=new a(st(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},yt.prototype.computeSecret=function(Ct){Ct=new a(Ct),Ct=Ct.toRed(this._prime);var Pt=Ct.redPow(this._priv).fromRed(),$t=new Buffer$g(Pt.toArray()),Mt=this.getPrime();if($t.length"u"||!process$1$1.version||process$1$1.version.indexOf("v0.")===0||process$1$1.version.indexOf("v1.")===0&&process$1$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:a}:processNextickArgs.exports=process$1$1;function a(_,$,j,et){if(typeof _!="function")throw new TypeError('"callback" argument must be a function');var tt=arguments.length,rt,nt;switch(tt){case 0:case 1:return process$1$1.nextTick(_);case 2:return process$1$1.nextTick(function(){_.call(null,$)});case 3:return process$1$1.nextTick(function(){_.call(null,$,j)});case 4:return process$1$1.nextTick(function(){_.call(null,$,j,et)});default:for(rt=new Array(tt-1),nt=0;nt"u"}util$4.isPrimitive=ht,util$4.isBuffer=buffer$1.Buffer.isBuffer;function yt(wt){return Object.prototype.toString.call(wt)}return util$4}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,function(a){function _(tt,rt){if(!(tt instanceof rt))throw new TypeError("Cannot call a class as a function")}var $=requireSafeBuffer$1().Buffer,j=util$5;function et(tt,rt,nt){tt.copy(rt,nt)}a.exports=function(){function tt(){_(this,tt),this.head=null,this.tail=null,this.length=0}return tt.prototype.push=function(nt){var it={data:nt,next:null};this.length>0?this.tail.next=it:this.head=it,this.tail=it,++this.length},tt.prototype.unshift=function(nt){var it={data:nt,next:this.head};this.length===0&&(this.tail=it),this.head=it,++this.length},tt.prototype.shift=function(){if(this.length!==0){var nt=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,nt}},tt.prototype.clear=function(){this.head=this.tail=null,this.length=0},tt.prototype.join=function(nt){if(this.length===0)return"";for(var it=this.head,st=""+it.data;it=it.next;)st+=nt+it.data;return st},tt.prototype.concat=function(nt){if(this.length===0)return $.alloc(0);for(var it=$.allocUnsafe(nt>>>0),st=this.head,ot=0;st;)et(st.data,it,ot),ot+=st.data.length,st=st.next;return it},tt}(),j&&j.inspect&&j.inspect.custom&&(a.exports.prototype[j.inspect.custom]=function(){var tt=j.inspect({length:this.length});return this.constructor.name+" "+tt})}(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var a=requireProcessNextickArgs();function _(et,tt){var rt=this,nt=this._readableState&&this._readableState.destroyed,it=this._writableState&&this._writableState.destroyed;return nt||it?(tt?tt(et):et&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,a.nextTick(j,this,et)):a.nextTick(j,this,et)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(et||null,function(st){!tt&&st?rt._writableState?rt._writableState.errorEmitted||(rt._writableState.errorEmitted=!0,a.nextTick(j,rt,st)):a.nextTick(j,rt,st):tt&&tt(st)}),this)}function $(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function j(et,tt){et.emit("error",tt)}return destroy_1={destroy:_,undestroy:$},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var a=requireProcessNextickArgs();_stream_writable=wt;function _(xt){var At=this;this.next=null,this.entry=null,this.finish=function(){mt(At,xt)}}var $=!process$1$1.browser&&["v0.10","v0.9."].indexOf(process$1$1.version.slice(0,5))>-1?setImmediate:a.nextTick,j;wt.WritableState=ht;var et=Object.create(requireUtil());et.inherits=inherits_browserExports;var tt={deprecate:browser$c},rt=requireStreamBrowser(),nt=requireSafeBuffer$1().Buffer,it=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function st(xt){return nt.from(xt)}function ot(xt){return nt.isBuffer(xt)||xt instanceof it}var at=requireDestroy();et.inherits(wt,rt);function ut(){}function ht(xt,At){j=j||require_stream_duplex(),xt=xt||{};var Rt=At instanceof j;this.objectMode=!!xt.objectMode,Rt&&(this.objectMode=this.objectMode||!!xt.writableObjectMode);var St=xt.highWaterMark,Tt=xt.writableHighWaterMark,Et=this.objectMode?16:16*1024;St||St===0?this.highWaterMark=St:Rt&&(Tt||Tt===0)?this.highWaterMark=Tt:this.highWaterMark=Et,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Nt=xt.decodeStrings===!1;this.decodeStrings=!Nt,this.defaultEncoding=xt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(tr){Ot(At,tr)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new _(this)}ht.prototype.getBuffer=function(){for(var At=this.bufferedRequest,Rt=[];At;)Rt.push(At),At=At.next;return Rt},function(){try{Object.defineProperty(ht.prototype,"buffer",{get:tt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var yt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(yt=Function.prototype[Symbol.hasInstance],Object.defineProperty(wt,Symbol.hasInstance,{value:function(xt){return yt.call(this,xt)?!0:this!==wt?!1:xt&&xt._writableState instanceof ht}})):yt=function(xt){return xt instanceof this};function wt(xt){if(j=j||require_stream_duplex(),!yt.call(wt,this)&&!(this instanceof j))return new wt(xt);this._writableState=new ht(xt,this),this.writable=!0,xt&&(typeof xt.write=="function"&&(this._write=xt.write),typeof xt.writev=="function"&&(this._writev=xt.writev),typeof xt.destroy=="function"&&(this._destroy=xt.destroy),typeof xt.final=="function"&&(this._final=xt.final)),rt.call(this)}wt.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Ct(xt,At){var Rt=new Error("write after end");xt.emit("error",Rt),a.nextTick(At,Rt)}function Pt(xt,At,Rt,St){var Tt=!0,Et=!1;return Rt===null?Et=new TypeError("May not write null values to stream"):typeof Rt!="string"&&Rt!==void 0&&!At.objectMode&&(Et=new TypeError("Invalid non-string/buffer chunk")),Et&&(xt.emit("error",Et),a.nextTick(St,Et),Tt=!1),Tt}wt.prototype.write=function(xt,At,Rt){var St=this._writableState,Tt=!1,Et=!St.objectMode&&ot(xt);return Et&&!nt.isBuffer(xt)&&(xt=st(xt)),typeof At=="function"&&(Rt=At,At=null),Et?At="buffer":At||(At=St.defaultEncoding),typeof Rt!="function"&&(Rt=ut),St.ended?Ct(this,Rt):(Et||Pt(this,St,xt,Rt))&&(St.pendingcb++,Tt=Mt(this,St,Et,xt,At,Rt)),Tt},wt.prototype.cork=function(){var xt=this._writableState;xt.corked++},wt.prototype.uncork=function(){var xt=this._writableState;xt.corked&&(xt.corked--,!xt.writing&&!xt.corked&&!xt.bufferProcessing&&xt.bufferedRequest&&Ft(this,xt))},wt.prototype.setDefaultEncoding=function(At){if(typeof At=="string"&&(At=At.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((At+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+At);return this._writableState.defaultEncoding=At,this};function $t(xt,At,Rt){return!xt.objectMode&&xt.decodeStrings!==!1&&typeof At=="string"&&(At=nt.from(At,Rt)),At}Object.defineProperty(wt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Mt(xt,At,Rt,St,Tt,Et){if(!Rt){var Nt=$t(At,St,Tt);St!==Nt&&(Rt=!0,Tt="buffer",St=Nt)}var tr=At.objectMode?1:St.length;At.length+=tr;var ir=At.length>5===6?2:Pt>>4===14?3:Pt>>3===30?4:Pt>>6===2?-1:-2}function rt(Pt,$t,Mt){var Bt=$t.length-1;if(Bt=0?(Dt>0&&(Pt.lastNeed=Dt-1),Dt):--Bt=0?(Dt>0&&(Pt.lastNeed=Dt-2),Dt):--Bt=0?(Dt>0&&(Dt===2?Dt=0:Pt.lastNeed=Dt-3),Dt):0))}function nt(Pt,$t,Mt){if(($t[0]&192)!==128)return Pt.lastNeed=0,"�";if(Pt.lastNeed>1&&$t.length>1){if(($t[1]&192)!==128)return Pt.lastNeed=1,"�";if(Pt.lastNeed>2&&$t.length>2&&($t[2]&192)!==128)return Pt.lastNeed=2,"�"}}function it(Pt){var $t=this.lastTotal-this.lastNeed,Mt=nt(this,Pt);if(Mt!==void 0)return Mt;if(this.lastNeed<=Pt.length)return Pt.copy(this.lastChar,$t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Pt.copy(this.lastChar,$t,0,Pt.length),this.lastNeed-=Pt.length}function st(Pt,$t){var Mt=rt(this,Pt,$t);if(!this.lastNeed)return Pt.toString("utf8",$t);this.lastTotal=Mt;var Bt=Pt.length-(Mt-this.lastNeed);return Pt.copy(this.lastChar,0,Bt),Pt.toString("utf8",$t,Bt)}function ot(Pt){var $t=Pt&&Pt.length?this.write(Pt):"";return this.lastNeed?$t+"�":$t}function at(Pt,$t){if((Pt.length-$t)%2===0){var Mt=Pt.toString("utf16le",$t);if(Mt){var Bt=Mt.charCodeAt(Mt.length-1);if(Bt>=55296&&Bt<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=Pt[Pt.length-2],this.lastChar[1]=Pt[Pt.length-1],Mt.slice(0,-1)}return Mt}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=Pt[Pt.length-1],Pt.toString("utf16le",$t,Pt.length-1)}function ut(Pt){var $t=Pt&&Pt.length?this.write(Pt):"";if(this.lastNeed){var Mt=this.lastTotal-this.lastNeed;return $t+this.lastChar.toString("utf16le",0,Mt)}return $t}function ht(Pt,$t){var Mt=(Pt.length-$t)%3;return Mt===0?Pt.toString("base64",$t):(this.lastNeed=3-Mt,this.lastTotal=3,Mt===1?this.lastChar[0]=Pt[Pt.length-1]:(this.lastChar[0]=Pt[Pt.length-2],this.lastChar[1]=Pt[Pt.length-1]),Pt.toString("base64",$t,Pt.length-Mt))}function yt(Pt){var $t=Pt&&Pt.length?this.write(Pt):"";return this.lastNeed?$t+this.lastChar.toString("base64",0,3-this.lastNeed):$t}function wt(Pt){return Pt.toString(this.encoding)}function Ct(Pt){return Pt&&Pt.length?this.write(Pt):""}return string_decoder}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var a=requireProcessNextickArgs();_stream_readable=$t;var _=requireIsarray(),$;$t.ReadableState=Pt,eventsExports.EventEmitter;var j=function(Zt,Kt){return Zt.listeners(Kt).length},et=requireStreamBrowser(),tt=requireSafeBuffer$1().Buffer,rt=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function nt(Zt){return tt.from(Zt)}function it(Zt){return tt.isBuffer(Zt)||Zt instanceof rt}var st=Object.create(requireUtil());st.inherits=inherits_browserExports;var ot=util$5,at=void 0;ot&&ot.debuglog?at=ot.debuglog("stream"):at=function(){};var ut=requireBufferList(),ht=requireDestroy(),yt;st.inherits($t,et);var wt=["error","close","destroy","pause","resume"];function Ct(Zt,Kt,Qt){if(typeof Zt.prependListener=="function")return Zt.prependListener(Kt,Qt);!Zt._events||!Zt._events[Kt]?Zt.on(Kt,Qt):_(Zt._events[Kt])?Zt._events[Kt].unshift(Qt):Zt._events[Kt]=[Qt,Zt._events[Kt]]}function Pt(Zt,Kt){$=$||require_stream_duplex(),Zt=Zt||{};var Qt=Kt instanceof $;this.objectMode=!!Zt.objectMode,Qt&&(this.objectMode=this.objectMode||!!Zt.readableObjectMode);var Ht=Zt.highWaterMark,qt=Zt.readableHighWaterMark,Jt=this.objectMode?16:16*1024;Ht||Ht===0?this.highWaterMark=Ht:Qt&&(qt||qt===0)?this.highWaterMark=qt:this.highWaterMark=Jt,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new ut,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=Zt.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Zt.encoding&&(yt||(yt=requireString_decoder().StringDecoder),this.decoder=new yt(Zt.encoding),this.encoding=Zt.encoding)}function $t(Zt){if($=$||require_stream_duplex(),!(this instanceof $t))return new $t(Zt);this._readableState=new Pt(Zt,this),this.readable=!0,Zt&&(typeof Zt.read=="function"&&(this._read=Zt.read),typeof Zt.destroy=="function"&&(this._destroy=Zt.destroy)),et.call(this)}Object.defineProperty($t.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Zt){this._readableState&&(this._readableState.destroyed=Zt)}}),$t.prototype.destroy=ht.destroy,$t.prototype._undestroy=ht.undestroy,$t.prototype._destroy=function(Zt,Kt){this.push(null),Kt(Zt)},$t.prototype.push=function(Zt,Kt){var Qt=this._readableState,Ht;return Qt.objectMode?Ht=!0:typeof Zt=="string"&&(Kt=Kt||Qt.defaultEncoding,Kt!==Qt.encoding&&(Zt=tt.from(Zt,Kt),Kt=""),Ht=!0),Mt(this,Zt,Kt,!1,Ht)},$t.prototype.unshift=function(Zt){return Mt(this,Zt,null,!0,!1)};function Mt(Zt,Kt,Qt,Ht,qt){var Jt=Zt._readableState;if(Kt===null)Jt.reading=!1,Ft(Zt,Jt);else{var ur;qt||(ur=Dt(Jt,Kt)),ur?Zt.emit("error",ur):Jt.objectMode||Kt&&Kt.length>0?(typeof Kt!="string"&&!Jt.objectMode&&Object.getPrototypeOf(Kt)!==tt.prototype&&(Kt=nt(Kt)),Ht?Jt.endEmitted?Zt.emit("error",new Error("stream.unshift() after end event")):Bt(Zt,Jt,Kt,!0):Jt.ended?Zt.emit("error",new Error("stream.push() after EOF")):(Jt.reading=!1,Jt.decoder&&!Qt?(Kt=Jt.decoder.write(Kt),Jt.objectMode||Kt.length!==0?Bt(Zt,Jt,Kt,!1):vt(Zt,Jt)):Bt(Zt,Jt,Kt,!1))):Ht||(Jt.reading=!1)}return zt(Jt)}function Bt(Zt,Kt,Qt,Ht){Kt.flowing&&Kt.length===0&&!Kt.sync?(Zt.emit("data",Qt),Zt.read(0)):(Kt.length+=Kt.objectMode?1:Qt.length,Ht?Kt.buffer.unshift(Qt):Kt.buffer.push(Qt),Kt.needReadable&&jt(Zt)),vt(Zt,Kt)}function Dt(Zt,Kt){var Qt;return!it(Kt)&&typeof Kt!="string"&&Kt!==void 0&&!Zt.objectMode&&(Qt=new TypeError("Invalid non-string/buffer chunk")),Qt}function zt(Zt){return!Zt.ended&&(Zt.needReadable||Zt.length=Ot?Zt=Ot:(Zt--,Zt|=Zt>>>1,Zt|=Zt>>>2,Zt|=Zt>>>4,Zt|=Zt>>>8,Zt|=Zt>>>16,Zt++),Zt}function Lt(Zt,Kt){return Zt<=0||Kt.length===0&&Kt.ended?0:Kt.objectMode?1:Zt!==Zt?Kt.flowing&&Kt.length?Kt.buffer.head.data.length:Kt.length:(Zt>Kt.highWaterMark&&(Kt.highWaterMark=It(Zt)),Zt<=Kt.length?Zt:Kt.ended?Kt.length:(Kt.needReadable=!0,0))}$t.prototype.read=function(Zt){at("read",Zt),Zt=parseInt(Zt,10);var Kt=this._readableState,Qt=Zt;if(Zt!==0&&(Kt.emittedReadable=!1),Zt===0&&Kt.needReadable&&(Kt.length>=Kt.highWaterMark||Kt.ended))return at("read: emitReadable",Kt.length,Kt.ended),Kt.length===0&&Kt.ended?tr(this):jt(this),null;if(Zt=Lt(Zt,Kt),Zt===0&&Kt.ended)return Kt.length===0&&tr(this),null;var Ht=Kt.needReadable;at("need readable",Ht),(Kt.length===0||Kt.length-Zt0?qt=St(Zt,Kt):qt=null,qt===null?(Kt.needReadable=!0,Zt=0):Kt.length-=Zt,Kt.length===0&&(Kt.ended||(Kt.needReadable=!0),Qt!==Zt&&Kt.ended&&tr(this)),qt!==null&&this.emit("data",qt),qt};function Ft(Zt,Kt){if(!Kt.ended){if(Kt.decoder){var Qt=Kt.decoder.end();Qt&&Qt.length&&(Kt.buffer.push(Qt),Kt.length+=Kt.objectMode?1:Qt.length)}Kt.ended=!0,jt(Zt)}}function jt(Zt){var Kt=Zt._readableState;Kt.needReadable=!1,Kt.emittedReadable||(at("emitReadable",Kt.flowing),Kt.emittedReadable=!0,Kt.sync?a.nextTick(bt,Zt):bt(Zt))}function bt(Zt){at("emit readable"),Zt.emit("readable"),Rt(Zt)}function vt(Zt,Kt){Kt.readingMore||(Kt.readingMore=!0,a.nextTick(ct,Zt,Kt))}function ct(Zt,Kt){for(var Qt=Kt.length;!Kt.reading&&!Kt.flowing&&!Kt.ended&&Kt.length1&&nr(Ht.pipes,Zt)!==-1)&&!Cr&&(at("false write response, pause",Ht.awaitDrain),Ht.awaitDrain++,lr=!0),Qt.pause())}function _r(Pr){at("onerror",Pr),Ar(),Zt.removeListener("error",_r),j(Zt,"error")===0&&Zt.emit("error",Pr)}Ct(Zt,"error",_r);function Rr(){Zt.removeListener("finish",kr),Ar()}Zt.once("close",Rr);function kr(){at("onfinish"),Zt.removeListener("close",Rr),Ar()}Zt.once("finish",kr);function Ar(){at("unpipe"),Qt.unpipe(Zt)}return Zt.emit("pipe",Qt),Ht.flowing||(at("pipe resume"),Qt.resume()),Zt};function dt(Zt){return function(){var Kt=Zt._readableState;at("pipeOnDrain",Kt.awaitDrain),Kt.awaitDrain&&Kt.awaitDrain--,Kt.awaitDrain===0&&j(Zt,"data")&&(Kt.flowing=!0,Rt(Zt))}}$t.prototype.unpipe=function(Zt){var Kt=this._readableState,Qt={hasUnpiped:!1};if(Kt.pipesCount===0)return this;if(Kt.pipesCount===1)return Zt&&Zt!==Kt.pipes?this:(Zt||(Zt=Kt.pipes),Kt.pipes=null,Kt.pipesCount=0,Kt.flowing=!1,Zt&&Zt.emit("unpipe",this,Qt),this);if(!Zt){var Ht=Kt.pipes,qt=Kt.pipesCount;Kt.pipes=null,Kt.pipesCount=0,Kt.flowing=!1;for(var Jt=0;Jt=Kt.length?(Kt.decoder?Qt=Kt.buffer.join(""):Kt.buffer.length===1?Qt=Kt.buffer.head.data:Qt=Kt.buffer.concat(Kt.length),Kt.buffer.clear()):Qt=Tt(Zt,Kt.buffer,Kt.decoder),Qt}function Tt(Zt,Kt,Qt){var Ht;return ZtJt.length?Jt.length:Zt;if(ur===Jt.length?qt+=Jt:qt+=Jt.slice(0,Zt),Zt-=ur,Zt===0){ur===Jt.length?(++Ht,Qt.next?Kt.head=Qt.next:Kt.head=Kt.tail=null):(Kt.head=Qt,Qt.data=Jt.slice(ur));break}++Ht}return Kt.length-=Ht,qt}function Nt(Zt,Kt){var Qt=tt.allocUnsafe(Zt),Ht=Kt.head,qt=1;for(Ht.data.copy(Qt),Zt-=Ht.data.length;Ht=Ht.next;){var Jt=Ht.data,ur=Zt>Jt.length?Jt.length:Zt;if(Jt.copy(Qt,Qt.length-Zt,0,ur),Zt-=ur,Zt===0){ur===Jt.length?(++qt,Ht.next?Kt.head=Ht.next:Kt.head=Kt.tail=null):(Kt.head=Ht,Ht.data=Jt.slice(ur));break}++qt}return Kt.length-=qt,Qt}function tr(Zt){var Kt=Zt._readableState;if(Kt.length>0)throw new Error('"endReadable()" called on non-empty stream');Kt.endEmitted||(Kt.ended=!0,a.nextTick(ir,Kt,Zt))}function ir(Zt,Kt){!Zt.endEmitted&&Zt.length===0&&(Zt.endEmitted=!0,Kt.readable=!1,Kt.emit("end"))}function nr(Zt,Kt){for(var Qt=0,Ht=Zt.length;Qt0?ct:dt},tt.min=function(ct,dt){return ct.cmp(dt)<0?ct:dt},tt.prototype._init=function(ct,dt,mt){if(typeof ct=="number")return this._initNumber(ct,dt,mt);if(typeof ct=="object")return this._initArray(ct,dt,mt);dt==="hex"&&(dt=16),j(dt===(dt|0)&&dt>=2&&dt<=36),ct=ct.toString().replace(/\s+/g,"");var xt=0;ct[0]==="-"&&(xt++,this.negative=1),xt=0;xt-=3)Rt=ct[xt]|ct[xt-1]<<8|ct[xt-2]<<16,this.words[At]|=Rt<>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);else if(mt==="le")for(xt=0,At=0;xt>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);return this._strip()};function nt(vt,ct){var dt=vt.charCodeAt(ct);if(dt>=48&&dt<=57)return dt-48;if(dt>=65&&dt<=70)return dt-55;if(dt>=97&&dt<=102)return dt-87;j(!1,"Invalid character in "+vt)}function it(vt,ct,dt){var mt=nt(vt,dt);return dt-1>=ct&&(mt|=nt(vt,dt-1)<<4),mt}tt.prototype._parseHex=function(ct,dt,mt){this.length=Math.ceil((ct.length-dt)/6),this.words=new Array(this.length);for(var xt=0;xt=dt;xt-=2)St=it(ct,dt,xt)<=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8;else{var Tt=ct.length-dt;for(xt=Tt%2===0?dt+1:dt;xt=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8}this._strip()};function st(vt,ct,dt,mt){for(var xt=0,At=0,Rt=Math.min(vt.length,dt),St=ct;St=49?At=Tt-49+10:Tt>=17?At=Tt-17+10:At=Tt,j(Tt>=0&&At1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=at}catch{tt.prototype.inspect=at}else tt.prototype.inspect=at;function at(){return(this.red?""}var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],yt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(ct,dt){ct=ct||10,dt=dt|0||1;var mt;if(ct===16||ct==="hex"){mt="";for(var xt=0,At=0,Rt=0;Rt>>24-xt&16777215,xt+=2,xt>=26&&(xt-=26,Rt--),At!==0||Rt!==this.length-1?mt=ut[6-Tt.length]+Tt+mt:mt=Tt+mt}for(At!==0&&(mt=At.toString(16)+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}if(ct===(ct|0)&&ct>=2&&ct<=36){var Et=ht[ct],Nt=yt[ct];mt="";var tr=this.clone();for(tr.negative=0;!tr.isZero();){var ir=tr.modrn(Nt).toString(ct);tr=tr.idivn(Nt),tr.isZero()?mt=ir+mt:mt=ut[Et-ir.length]+ir+mt}for(this.isZero()&&(mt="0"+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var ct=this.words[0];return this.length===2?ct+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ct+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ct:ct},tt.prototype.toJSON=function(){return this.toString(16,2)},rt&&(tt.prototype.toBuffer=function(ct,dt){return this.toArrayLike(rt,ct,dt)}),tt.prototype.toArray=function(ct,dt){return this.toArrayLike(Array,ct,dt)};var wt=function(ct,dt){return ct.allocUnsafe?ct.allocUnsafe(dt):new ct(dt)};tt.prototype.toArrayLike=function(ct,dt,mt){this._strip();var xt=this.byteLength(),At=mt||Math.max(1,xt);j(xt<=At,"byte array longer than desired length"),j(At>0,"Requested array length <= 0");var Rt=wt(ct,At),St=dt==="le"?"LE":"BE";return this["_toArrayLike"+St](Rt,xt),Rt},tt.prototype._toArrayLikeLE=function(ct,dt){for(var mt=0,xt=0,At=0,Rt=0;At>8&255),mt>16&255),Rt===6?(mt>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt=0&&(ct[mt--]=St>>8&255),mt>=0&&(ct[mt--]=St>>16&255),Rt===6?(mt>=0&&(ct[mt--]=St>>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt>=0)for(ct[mt--]=xt;mt>=0;)ct[mt--]=0},Math.clz32?tt.prototype._countBits=function(ct){return 32-Math.clz32(ct)}:tt.prototype._countBits=function(ct){var dt=ct,mt=0;return dt>=4096&&(mt+=13,dt>>>=13),dt>=64&&(mt+=7,dt>>>=7),dt>=8&&(mt+=4,dt>>>=4),dt>=2&&(mt+=2,dt>>>=2),mt+dt},tt.prototype._zeroBits=function(ct){if(ct===0)return 26;var dt=ct,mt=0;return dt&8191||(mt+=13,dt>>>=13),dt&127||(mt+=7,dt>>>=7),dt&15||(mt+=4,dt>>>=4),dt&3||(mt+=2,dt>>>=2),dt&1||mt++,mt},tt.prototype.bitLength=function(){var ct=this.words[this.length-1],dt=this._countBits(ct);return(this.length-1)*26+dt};function Ct(vt){for(var ct=new Array(vt.bitLength()),dt=0;dt>>xt&1}return ct}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ct=0,dt=0;dtct.length?this.clone().ior(ct):ct.clone().ior(this)},tt.prototype.uor=function(ct){return this.length>ct.length?this.clone().iuor(ct):ct.clone().iuor(this)},tt.prototype.iuand=function(ct){var dt;this.length>ct.length?dt=ct:dt=this;for(var mt=0;mtct.length?this.clone().iand(ct):ct.clone().iand(this)},tt.prototype.uand=function(ct){return this.length>ct.length?this.clone().iuand(ct):ct.clone().iuand(this)},tt.prototype.iuxor=function(ct){var dt,mt;this.length>ct.length?(dt=this,mt=ct):(dt=ct,mt=this);for(var xt=0;xtct.length?this.clone().ixor(ct):ct.clone().ixor(this)},tt.prototype.uxor=function(ct){return this.length>ct.length?this.clone().iuxor(ct):ct.clone().iuxor(this)},tt.prototype.inotn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=Math.ceil(ct/26)|0,mt=ct%26;this._expand(dt),mt>0&&dt--;for(var xt=0;xt0&&(this.words[xt]=~this.words[xt]&67108863>>26-mt),this._strip()},tt.prototype.notn=function(ct){return this.clone().inotn(ct)},tt.prototype.setn=function(ct,dt){j(typeof ct=="number"&&ct>=0);var mt=ct/26|0,xt=ct%26;return this._expand(mt+1),dt?this.words[mt]=this.words[mt]|1<ct.length?(mt=this,xt=ct):(mt=ct,xt=this);for(var At=0,Rt=0;Rt>>26;for(;At!==0&&Rt>>26;if(this.length=mt.length,At!==0)this.words[this.length]=At,this.length++;else if(mt!==this)for(;Rtct.length?this.clone().iadd(ct):ct.clone().iadd(this)},tt.prototype.isub=function(ct){if(ct.negative!==0){ct.negative=0;var dt=this.iadd(ct);return ct.negative=1,dt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ct),this.negative=1,this._normSign();var mt=this.cmp(ct);if(mt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var xt,At;mt>0?(xt=this,At=ct):(xt=ct,At=this);for(var Rt=0,St=0;St>26,this.words[St]=dt&67108863;for(;Rt!==0&&St>26,this.words[St]=dt&67108863;if(Rt===0&&St>>26,tr=Tt&67108863,ir=Math.min(Et,ct.length-1),nr=Math.max(0,Et-vt.length+1);nr<=ir;nr++){var Zt=Et-nr|0;xt=vt.words[Zt]|0,At=ct.words[nr]|0,Rt=xt*At+tr,Nt+=Rt/67108864|0,tr=Rt&67108863}dt.words[Et]=tr|0,Tt=Nt|0}return Tt!==0?dt.words[Et]=Tt|0:dt.length--,dt._strip()}var $t=function(ct,dt,mt){var xt=ct.words,At=dt.words,Rt=mt.words,St=0,Tt,Et,Nt,tr=xt[0]|0,ir=tr&8191,nr=tr>>>13,Zt=xt[1]|0,Kt=Zt&8191,Qt=Zt>>>13,Ht=xt[2]|0,qt=Ht&8191,Jt=Ht>>>13,ur=xt[3]|0,xr=ur&8191,pr=ur>>>13,Cr=xt[4]|0,Mr=Cr&8191,lr=Cr>>>13,fr=xt[5]|0,_r=fr&8191,Rr=fr>>>13,kr=xt[6]|0,Ar=kr&8191,Pr=kr>>>13,Or=xt[7]|0,Br=Or&8191,or=Or>>>13,Yt=xt[8]|0,er=Yt&8191,Gt=Yt>>>13,Vt=xt[9]|0,Wt=Vt&8191,ar=Vt>>>13,yr=At[0]|0,Er=yr&8191,Sr=yr>>>13,Wr=At[1]|0,Hr=Wr&8191,Fr=Wr>>>13,pn=At[2]|0,Jr=pn&8191,Qr=pn>>>13,mn=At[3]|0,ln=mn&8191,qr=mn>>>13,En=At[4]|0,un=En&8191,Vr=En>>>13,hn=At[5]|0,fn=hn&8191,Kr=hn>>>13,Rn=At[6]|0,dn=Rn&8191,Gr=Rn>>>13,gn=At[7]|0,an=gn&8191,Zr=gn>>>13,An=At[8]|0,Sn=An&8191,nn=An>>>13,Pn=At[9]|0,yn=Pn&8191,_n=Pn>>>13;mt.negative=ct.negative^dt.negative,mt.length=19,Tt=Math.imul(ir,Er),Et=Math.imul(ir,Sr),Et=Et+Math.imul(nr,Er)|0,Nt=Math.imul(nr,Sr);var ds=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ds>>>26)|0,ds&=67108863,Tt=Math.imul(Kt,Er),Et=Math.imul(Kt,Sr),Et=Et+Math.imul(Qt,Er)|0,Nt=Math.imul(Qt,Sr),Tt=Tt+Math.imul(ir,Hr)|0,Et=Et+Math.imul(ir,Fr)|0,Et=Et+Math.imul(nr,Hr)|0,Nt=Nt+Math.imul(nr,Fr)|0;var fs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(fs>>>26)|0,fs&=67108863,Tt=Math.imul(qt,Er),Et=Math.imul(qt,Sr),Et=Et+Math.imul(Jt,Er)|0,Nt=Math.imul(Jt,Sr),Tt=Tt+Math.imul(Kt,Hr)|0,Et=Et+Math.imul(Kt,Fr)|0,Et=Et+Math.imul(Qt,Hr)|0,Nt=Nt+Math.imul(Qt,Fr)|0,Tt=Tt+Math.imul(ir,Jr)|0,Et=Et+Math.imul(ir,Qr)|0,Et=Et+Math.imul(nr,Jr)|0,Nt=Nt+Math.imul(nr,Qr)|0;var hs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(hs>>>26)|0,hs&=67108863,Tt=Math.imul(xr,Er),Et=Math.imul(xr,Sr),Et=Et+Math.imul(pr,Er)|0,Nt=Math.imul(pr,Sr),Tt=Tt+Math.imul(qt,Hr)|0,Et=Et+Math.imul(qt,Fr)|0,Et=Et+Math.imul(Jt,Hr)|0,Nt=Nt+Math.imul(Jt,Fr)|0,Tt=Tt+Math.imul(Kt,Jr)|0,Et=Et+Math.imul(Kt,Qr)|0,Et=Et+Math.imul(Qt,Jr)|0,Nt=Nt+Math.imul(Qt,Qr)|0,Tt=Tt+Math.imul(ir,ln)|0,Et=Et+Math.imul(ir,qr)|0,Et=Et+Math.imul(nr,ln)|0,Nt=Nt+Math.imul(nr,qr)|0;var ps=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ps>>>26)|0,ps&=67108863,Tt=Math.imul(Mr,Er),Et=Math.imul(Mr,Sr),Et=Et+Math.imul(lr,Er)|0,Nt=Math.imul(lr,Sr),Tt=Tt+Math.imul(xr,Hr)|0,Et=Et+Math.imul(xr,Fr)|0,Et=Et+Math.imul(pr,Hr)|0,Nt=Nt+Math.imul(pr,Fr)|0,Tt=Tt+Math.imul(qt,Jr)|0,Et=Et+Math.imul(qt,Qr)|0,Et=Et+Math.imul(Jt,Jr)|0,Nt=Nt+Math.imul(Jt,Qr)|0,Tt=Tt+Math.imul(Kt,ln)|0,Et=Et+Math.imul(Kt,qr)|0,Et=Et+Math.imul(Qt,ln)|0,Nt=Nt+Math.imul(Qt,qr)|0,Tt=Tt+Math.imul(ir,un)|0,Et=Et+Math.imul(ir,Vr)|0,Et=Et+Math.imul(nr,un)|0,Nt=Nt+Math.imul(nr,Vr)|0;var Vn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Tt=Math.imul(_r,Er),Et=Math.imul(_r,Sr),Et=Et+Math.imul(Rr,Er)|0,Nt=Math.imul(Rr,Sr),Tt=Tt+Math.imul(Mr,Hr)|0,Et=Et+Math.imul(Mr,Fr)|0,Et=Et+Math.imul(lr,Hr)|0,Nt=Nt+Math.imul(lr,Fr)|0,Tt=Tt+Math.imul(xr,Jr)|0,Et=Et+Math.imul(xr,Qr)|0,Et=Et+Math.imul(pr,Jr)|0,Nt=Nt+Math.imul(pr,Qr)|0,Tt=Tt+Math.imul(qt,ln)|0,Et=Et+Math.imul(qt,qr)|0,Et=Et+Math.imul(Jt,ln)|0,Nt=Nt+Math.imul(Jt,qr)|0,Tt=Tt+Math.imul(Kt,un)|0,Et=Et+Math.imul(Kt,Vr)|0,Et=Et+Math.imul(Qt,un)|0,Nt=Nt+Math.imul(Qt,Vr)|0,Tt=Tt+Math.imul(ir,fn)|0,Et=Et+Math.imul(ir,Kr)|0,Et=Et+Math.imul(nr,fn)|0,Nt=Nt+Math.imul(nr,Kr)|0;var ss=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ss>>>26)|0,ss&=67108863,Tt=Math.imul(Ar,Er),Et=Math.imul(Ar,Sr),Et=Et+Math.imul(Pr,Er)|0,Nt=Math.imul(Pr,Sr),Tt=Tt+Math.imul(_r,Hr)|0,Et=Et+Math.imul(_r,Fr)|0,Et=Et+Math.imul(Rr,Hr)|0,Nt=Nt+Math.imul(Rr,Fr)|0,Tt=Tt+Math.imul(Mr,Jr)|0,Et=Et+Math.imul(Mr,Qr)|0,Et=Et+Math.imul(lr,Jr)|0,Nt=Nt+Math.imul(lr,Qr)|0,Tt=Tt+Math.imul(xr,ln)|0,Et=Et+Math.imul(xr,qr)|0,Et=Et+Math.imul(pr,ln)|0,Nt=Nt+Math.imul(pr,qr)|0,Tt=Tt+Math.imul(qt,un)|0,Et=Et+Math.imul(qt,Vr)|0,Et=Et+Math.imul(Jt,un)|0,Nt=Nt+Math.imul(Jt,Vr)|0,Tt=Tt+Math.imul(Kt,fn)|0,Et=Et+Math.imul(Kt,Kr)|0,Et=Et+Math.imul(Qt,fn)|0,Nt=Nt+Math.imul(Qt,Kr)|0,Tt=Tt+Math.imul(ir,dn)|0,Et=Et+Math.imul(ir,Gr)|0,Et=Et+Math.imul(nr,dn)|0,Nt=Nt+Math.imul(nr,Gr)|0;var Jn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Tt=Math.imul(Br,Er),Et=Math.imul(Br,Sr),Et=Et+Math.imul(or,Er)|0,Nt=Math.imul(or,Sr),Tt=Tt+Math.imul(Ar,Hr)|0,Et=Et+Math.imul(Ar,Fr)|0,Et=Et+Math.imul(Pr,Hr)|0,Nt=Nt+Math.imul(Pr,Fr)|0,Tt=Tt+Math.imul(_r,Jr)|0,Et=Et+Math.imul(_r,Qr)|0,Et=Et+Math.imul(Rr,Jr)|0,Nt=Nt+Math.imul(Rr,Qr)|0,Tt=Tt+Math.imul(Mr,ln)|0,Et=Et+Math.imul(Mr,qr)|0,Et=Et+Math.imul(lr,ln)|0,Nt=Nt+Math.imul(lr,qr)|0,Tt=Tt+Math.imul(xr,un)|0,Et=Et+Math.imul(xr,Vr)|0,Et=Et+Math.imul(pr,un)|0,Nt=Nt+Math.imul(pr,Vr)|0,Tt=Tt+Math.imul(qt,fn)|0,Et=Et+Math.imul(qt,Kr)|0,Et=Et+Math.imul(Jt,fn)|0,Nt=Nt+Math.imul(Jt,Kr)|0,Tt=Tt+Math.imul(Kt,dn)|0,Et=Et+Math.imul(Kt,Gr)|0,Et=Et+Math.imul(Qt,dn)|0,Nt=Nt+Math.imul(Qt,Gr)|0,Tt=Tt+Math.imul(ir,an)|0,Et=Et+Math.imul(ir,Zr)|0,Et=Et+Math.imul(nr,an)|0,Nt=Nt+Math.imul(nr,Zr)|0;var Yn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Tt=Math.imul(er,Er),Et=Math.imul(er,Sr),Et=Et+Math.imul(Gt,Er)|0,Nt=Math.imul(Gt,Sr),Tt=Tt+Math.imul(Br,Hr)|0,Et=Et+Math.imul(Br,Fr)|0,Et=Et+Math.imul(or,Hr)|0,Nt=Nt+Math.imul(or,Fr)|0,Tt=Tt+Math.imul(Ar,Jr)|0,Et=Et+Math.imul(Ar,Qr)|0,Et=Et+Math.imul(Pr,Jr)|0,Nt=Nt+Math.imul(Pr,Qr)|0,Tt=Tt+Math.imul(_r,ln)|0,Et=Et+Math.imul(_r,qr)|0,Et=Et+Math.imul(Rr,ln)|0,Nt=Nt+Math.imul(Rr,qr)|0,Tt=Tt+Math.imul(Mr,un)|0,Et=Et+Math.imul(Mr,Vr)|0,Et=Et+Math.imul(lr,un)|0,Nt=Nt+Math.imul(lr,Vr)|0,Tt=Tt+Math.imul(xr,fn)|0,Et=Et+Math.imul(xr,Kr)|0,Et=Et+Math.imul(pr,fn)|0,Nt=Nt+Math.imul(pr,Kr)|0,Tt=Tt+Math.imul(qt,dn)|0,Et=Et+Math.imul(qt,Gr)|0,Et=Et+Math.imul(Jt,dn)|0,Nt=Nt+Math.imul(Jt,Gr)|0,Tt=Tt+Math.imul(Kt,an)|0,Et=Et+Math.imul(Kt,Zr)|0,Et=Et+Math.imul(Qt,an)|0,Nt=Nt+Math.imul(Qt,Zr)|0,Tt=Tt+Math.imul(ir,Sn)|0,Et=Et+Math.imul(ir,nn)|0,Et=Et+Math.imul(nr,Sn)|0,Nt=Nt+Math.imul(nr,nn)|0;var ms=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ms>>>26)|0,ms&=67108863,Tt=Math.imul(Wt,Er),Et=Math.imul(Wt,Sr),Et=Et+Math.imul(ar,Er)|0,Nt=Math.imul(ar,Sr),Tt=Tt+Math.imul(er,Hr)|0,Et=Et+Math.imul(er,Fr)|0,Et=Et+Math.imul(Gt,Hr)|0,Nt=Nt+Math.imul(Gt,Fr)|0,Tt=Tt+Math.imul(Br,Jr)|0,Et=Et+Math.imul(Br,Qr)|0,Et=Et+Math.imul(or,Jr)|0,Nt=Nt+Math.imul(or,Qr)|0,Tt=Tt+Math.imul(Ar,ln)|0,Et=Et+Math.imul(Ar,qr)|0,Et=Et+Math.imul(Pr,ln)|0,Nt=Nt+Math.imul(Pr,qr)|0,Tt=Tt+Math.imul(_r,un)|0,Et=Et+Math.imul(_r,Vr)|0,Et=Et+Math.imul(Rr,un)|0,Nt=Nt+Math.imul(Rr,Vr)|0,Tt=Tt+Math.imul(Mr,fn)|0,Et=Et+Math.imul(Mr,Kr)|0,Et=Et+Math.imul(lr,fn)|0,Nt=Nt+Math.imul(lr,Kr)|0,Tt=Tt+Math.imul(xr,dn)|0,Et=Et+Math.imul(xr,Gr)|0,Et=Et+Math.imul(pr,dn)|0,Nt=Nt+Math.imul(pr,Gr)|0,Tt=Tt+Math.imul(qt,an)|0,Et=Et+Math.imul(qt,Zr)|0,Et=Et+Math.imul(Jt,an)|0,Nt=Nt+Math.imul(Jt,Zr)|0,Tt=Tt+Math.imul(Kt,Sn)|0,Et=Et+Math.imul(Kt,nn)|0,Et=Et+Math.imul(Qt,Sn)|0,Nt=Nt+Math.imul(Qt,nn)|0,Tt=Tt+Math.imul(ir,yn)|0,Et=Et+Math.imul(ir,_n)|0,Et=Et+Math.imul(nr,yn)|0,Nt=Nt+Math.imul(nr,_n)|0;var Qn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Tt=Math.imul(Wt,Hr),Et=Math.imul(Wt,Fr),Et=Et+Math.imul(ar,Hr)|0,Nt=Math.imul(ar,Fr),Tt=Tt+Math.imul(er,Jr)|0,Et=Et+Math.imul(er,Qr)|0,Et=Et+Math.imul(Gt,Jr)|0,Nt=Nt+Math.imul(Gt,Qr)|0,Tt=Tt+Math.imul(Br,ln)|0,Et=Et+Math.imul(Br,qr)|0,Et=Et+Math.imul(or,ln)|0,Nt=Nt+Math.imul(or,qr)|0,Tt=Tt+Math.imul(Ar,un)|0,Et=Et+Math.imul(Ar,Vr)|0,Et=Et+Math.imul(Pr,un)|0,Nt=Nt+Math.imul(Pr,Vr)|0,Tt=Tt+Math.imul(_r,fn)|0,Et=Et+Math.imul(_r,Kr)|0,Et=Et+Math.imul(Rr,fn)|0,Nt=Nt+Math.imul(Rr,Kr)|0,Tt=Tt+Math.imul(Mr,dn)|0,Et=Et+Math.imul(Mr,Gr)|0,Et=Et+Math.imul(lr,dn)|0,Nt=Nt+Math.imul(lr,Gr)|0,Tt=Tt+Math.imul(xr,an)|0,Et=Et+Math.imul(xr,Zr)|0,Et=Et+Math.imul(pr,an)|0,Nt=Nt+Math.imul(pr,Zr)|0,Tt=Tt+Math.imul(qt,Sn)|0,Et=Et+Math.imul(qt,nn)|0,Et=Et+Math.imul(Jt,Sn)|0,Nt=Nt+Math.imul(Jt,nn)|0,Tt=Tt+Math.imul(Kt,yn)|0,Et=Et+Math.imul(Kt,_n)|0,Et=Et+Math.imul(Qt,yn)|0,Nt=Nt+Math.imul(Qt,_n)|0;var es=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(es>>>26)|0,es&=67108863,Tt=Math.imul(Wt,Jr),Et=Math.imul(Wt,Qr),Et=Et+Math.imul(ar,Jr)|0,Nt=Math.imul(ar,Qr),Tt=Tt+Math.imul(er,ln)|0,Et=Et+Math.imul(er,qr)|0,Et=Et+Math.imul(Gt,ln)|0,Nt=Nt+Math.imul(Gt,qr)|0,Tt=Tt+Math.imul(Br,un)|0,Et=Et+Math.imul(Br,Vr)|0,Et=Et+Math.imul(or,un)|0,Nt=Nt+Math.imul(or,Vr)|0,Tt=Tt+Math.imul(Ar,fn)|0,Et=Et+Math.imul(Ar,Kr)|0,Et=Et+Math.imul(Pr,fn)|0,Nt=Nt+Math.imul(Pr,Kr)|0,Tt=Tt+Math.imul(_r,dn)|0,Et=Et+Math.imul(_r,Gr)|0,Et=Et+Math.imul(Rr,dn)|0,Nt=Nt+Math.imul(Rr,Gr)|0,Tt=Tt+Math.imul(Mr,an)|0,Et=Et+Math.imul(Mr,Zr)|0,Et=Et+Math.imul(lr,an)|0,Nt=Nt+Math.imul(lr,Zr)|0,Tt=Tt+Math.imul(xr,Sn)|0,Et=Et+Math.imul(xr,nn)|0,Et=Et+Math.imul(pr,Sn)|0,Nt=Nt+Math.imul(pr,nn)|0,Tt=Tt+Math.imul(qt,yn)|0,Et=Et+Math.imul(qt,_n)|0,Et=Et+Math.imul(Jt,yn)|0,Nt=Nt+Math.imul(Jt,_n)|0;var ls=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ls>>>26)|0,ls&=67108863,Tt=Math.imul(Wt,ln),Et=Math.imul(Wt,qr),Et=Et+Math.imul(ar,ln)|0,Nt=Math.imul(ar,qr),Tt=Tt+Math.imul(er,un)|0,Et=Et+Math.imul(er,Vr)|0,Et=Et+Math.imul(Gt,un)|0,Nt=Nt+Math.imul(Gt,Vr)|0,Tt=Tt+Math.imul(Br,fn)|0,Et=Et+Math.imul(Br,Kr)|0,Et=Et+Math.imul(or,fn)|0,Nt=Nt+Math.imul(or,Kr)|0,Tt=Tt+Math.imul(Ar,dn)|0,Et=Et+Math.imul(Ar,Gr)|0,Et=Et+Math.imul(Pr,dn)|0,Nt=Nt+Math.imul(Pr,Gr)|0,Tt=Tt+Math.imul(_r,an)|0,Et=Et+Math.imul(_r,Zr)|0,Et=Et+Math.imul(Rr,an)|0,Nt=Nt+Math.imul(Rr,Zr)|0,Tt=Tt+Math.imul(Mr,Sn)|0,Et=Et+Math.imul(Mr,nn)|0,Et=Et+Math.imul(lr,Sn)|0,Nt=Nt+Math.imul(lr,nn)|0,Tt=Tt+Math.imul(xr,yn)|0,Et=Et+Math.imul(xr,_n)|0,Et=Et+Math.imul(pr,yn)|0,Nt=Nt+Math.imul(pr,_n)|0;var us=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(us>>>26)|0,us&=67108863,Tt=Math.imul(Wt,un),Et=Math.imul(Wt,Vr),Et=Et+Math.imul(ar,un)|0,Nt=Math.imul(ar,Vr),Tt=Tt+Math.imul(er,fn)|0,Et=Et+Math.imul(er,Kr)|0,Et=Et+Math.imul(Gt,fn)|0,Nt=Nt+Math.imul(Gt,Kr)|0,Tt=Tt+Math.imul(Br,dn)|0,Et=Et+Math.imul(Br,Gr)|0,Et=Et+Math.imul(or,dn)|0,Nt=Nt+Math.imul(or,Gr)|0,Tt=Tt+Math.imul(Ar,an)|0,Et=Et+Math.imul(Ar,Zr)|0,Et=Et+Math.imul(Pr,an)|0,Nt=Nt+Math.imul(Pr,Zr)|0,Tt=Tt+Math.imul(_r,Sn)|0,Et=Et+Math.imul(_r,nn)|0,Et=Et+Math.imul(Rr,Sn)|0,Nt=Nt+Math.imul(Rr,nn)|0,Tt=Tt+Math.imul(Mr,yn)|0,Et=Et+Math.imul(Mr,_n)|0,Et=Et+Math.imul(lr,yn)|0,Nt=Nt+Math.imul(lr,_n)|0;var Wn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Tt=Math.imul(Wt,fn),Et=Math.imul(Wt,Kr),Et=Et+Math.imul(ar,fn)|0,Nt=Math.imul(ar,Kr),Tt=Tt+Math.imul(er,dn)|0,Et=Et+Math.imul(er,Gr)|0,Et=Et+Math.imul(Gt,dn)|0,Nt=Nt+Math.imul(Gt,Gr)|0,Tt=Tt+Math.imul(Br,an)|0,Et=Et+Math.imul(Br,Zr)|0,Et=Et+Math.imul(or,an)|0,Nt=Nt+Math.imul(or,Zr)|0,Tt=Tt+Math.imul(Ar,Sn)|0,Et=Et+Math.imul(Ar,nn)|0,Et=Et+Math.imul(Pr,Sn)|0,Nt=Nt+Math.imul(Pr,nn)|0,Tt=Tt+Math.imul(_r,yn)|0,Et=Et+Math.imul(_r,_n)|0,Et=Et+Math.imul(Rr,yn)|0,Nt=Nt+Math.imul(Rr,_n)|0;var as=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(as>>>26)|0,as&=67108863,Tt=Math.imul(Wt,dn),Et=Math.imul(Wt,Gr),Et=Et+Math.imul(ar,dn)|0,Nt=Math.imul(ar,Gr),Tt=Tt+Math.imul(er,an)|0,Et=Et+Math.imul(er,Zr)|0,Et=Et+Math.imul(Gt,an)|0,Nt=Nt+Math.imul(Gt,Zr)|0,Tt=Tt+Math.imul(Br,Sn)|0,Et=Et+Math.imul(Br,nn)|0,Et=Et+Math.imul(or,Sn)|0,Nt=Nt+Math.imul(or,nn)|0,Tt=Tt+Math.imul(Ar,yn)|0,Et=Et+Math.imul(Ar,_n)|0,Et=Et+Math.imul(Pr,yn)|0,Nt=Nt+Math.imul(Pr,_n)|0;var gs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(gs>>>26)|0,gs&=67108863,Tt=Math.imul(Wt,an),Et=Math.imul(Wt,Zr),Et=Et+Math.imul(ar,an)|0,Nt=Math.imul(ar,Zr),Tt=Tt+Math.imul(er,Sn)|0,Et=Et+Math.imul(er,nn)|0,Et=Et+Math.imul(Gt,Sn)|0,Nt=Nt+Math.imul(Gt,nn)|0,Tt=Tt+Math.imul(Br,yn)|0,Et=Et+Math.imul(Br,_n)|0,Et=Et+Math.imul(or,yn)|0,Nt=Nt+Math.imul(or,_n)|0;var vs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(vs>>>26)|0,vs&=67108863,Tt=Math.imul(Wt,Sn),Et=Math.imul(Wt,nn),Et=Et+Math.imul(ar,Sn)|0,Nt=Math.imul(ar,nn),Tt=Tt+Math.imul(er,yn)|0,Et=Et+Math.imul(er,_n)|0,Et=Et+Math.imul(Gt,yn)|0,Nt=Nt+Math.imul(Gt,_n)|0;var Ts=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Tt=Math.imul(Wt,yn),Et=Math.imul(Wt,_n),Et=Et+Math.imul(ar,yn)|0,Nt=Math.imul(ar,_n);var $s=(St+Tt|0)+((Et&8191)<<13)|0;return St=(Nt+(Et>>>13)|0)+($s>>>26)|0,$s&=67108863,Rt[0]=ds,Rt[1]=fs,Rt[2]=hs,Rt[3]=ps,Rt[4]=Vn,Rt[5]=ss,Rt[6]=Jn,Rt[7]=Yn,Rt[8]=ms,Rt[9]=Qn,Rt[10]=es,Rt[11]=ls,Rt[12]=us,Rt[13]=Wn,Rt[14]=as,Rt[15]=gs,Rt[16]=vs,Rt[17]=Ts,Rt[18]=$s,St!==0&&(Rt[19]=St,mt.length++),mt};Math.imul||($t=Pt);function Mt(vt,ct,dt){dt.negative=ct.negative^vt.negative,dt.length=vt.length+ct.length;for(var mt=0,xt=0,At=0;At>>26)|0,xt+=Rt>>>26,Rt&=67108863}dt.words[At]=St,mt=Rt,Rt=xt}return mt!==0?dt.words[At]=mt:dt.length--,dt._strip()}function Bt(vt,ct,dt){return Mt(vt,ct,dt)}tt.prototype.mulTo=function(ct,dt){var mt,xt=this.length+ct.length;return this.length===10&&ct.length===10?mt=$t(this,ct,dt):xt<63?mt=Pt(this,ct,dt):xt<1024?mt=Mt(this,ct,dt):mt=Bt(this,ct,dt),mt},tt.prototype.mul=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),this.mulTo(ct,dt)},tt.prototype.mulf=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),Bt(this,ct,dt)},tt.prototype.imul=function(ct){return this.clone().mulTo(ct,this)},tt.prototype.imuln=function(ct){var dt=ct<0;dt&&(ct=-ct),j(typeof ct=="number"),j(ct<67108864);for(var mt=0,xt=0;xt>=26,mt+=At/67108864|0,mt+=Rt>>>26,this.words[xt]=Rt&67108863}return mt!==0&&(this.words[xt]=mt,this.length++),dt?this.ineg():this},tt.prototype.muln=function(ct){return this.clone().imuln(ct)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(ct){var dt=Ct(ct);if(dt.length===0)return new tt(1);for(var mt=this,xt=0;xt=0);var dt=ct%26,mt=(ct-dt)/26,xt=67108863>>>26-dt<<26-dt,At;if(dt!==0){var Rt=0;for(At=0;At>>26-dt}Rt&&(this.words[At]=Rt,this.length++)}if(mt!==0){for(At=this.length-1;At>=0;At--)this.words[At+mt]=this.words[At];for(At=0;At=0);var xt;dt?xt=(dt-dt%26)/26:xt=0;var At=ct%26,Rt=Math.min((ct-At)/26,this.length),St=67108863^67108863>>>At<Rt)for(this.length-=Rt,Et=0;Et=0&&(Nt!==0||Et>=xt);Et--){var tr=this.words[Et]|0;this.words[Et]=Nt<<26-At|tr>>>At,Nt=tr&St}return Tt&&Nt!==0&&(Tt.words[Tt.length++]=Nt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},tt.prototype.ishrn=function(ct,dt,mt){return j(this.negative===0),this.iushrn(ct,dt,mt)},tt.prototype.shln=function(ct){return this.clone().ishln(ct)},tt.prototype.ushln=function(ct){return this.clone().iushln(ct)},tt.prototype.shrn=function(ct){return this.clone().ishrn(ct)},tt.prototype.ushrn=function(ct){return this.clone().iushrn(ct)},tt.prototype.testn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=ct%26,mt=(ct-dt)/26,xt=1<=0);var dt=ct%26,mt=(ct-dt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=mt)return this;if(dt!==0&&mt++,this.length=Math.min(mt,this.length),dt!==0){var xt=67108863^67108863>>>dt<=67108864;dt++)this.words[dt]-=67108864,dt===this.length-1?this.words[dt+1]=1:this.words[dt+1]++;return this.length=Math.max(this.length,dt+1),this},tt.prototype.isubn=function(ct){if(j(typeof ct=="number"),j(ct<67108864),ct<0)return this.iaddn(-ct);if(this.negative!==0)return this.negative=0,this.iaddn(ct),this.negative=1,this;if(this.words[0]-=ct,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var dt=0;dt>26)-(Tt/67108864|0),this.words[At+mt]=Rt&67108863}for(;At>26,this.words[At+mt]=Rt&67108863;if(St===0)return this._strip();for(j(St===-1),St=0,At=0;At>26,this.words[At]=Rt&67108863;return this.negative=1,this._strip()},tt.prototype._wordDiv=function(ct,dt){var mt=this.length-ct.length,xt=this.clone(),At=ct,Rt=At.words[At.length-1]|0,St=this._countBits(Rt);mt=26-St,mt!==0&&(At=At.ushln(mt),xt.iushln(mt),Rt=At.words[At.length-1]|0);var Tt=xt.length-At.length,Et;if(dt!=="mod"){Et=new tt(null),Et.length=Tt+1,Et.words=new Array(Et.length);for(var Nt=0;Nt=0;ir--){var nr=(xt.words[At.length+ir]|0)*67108864+(xt.words[At.length+ir-1]|0);for(nr=Math.min(nr/Rt|0,67108863),xt._ishlnsubmul(At,nr,ir);xt.negative!==0;)nr--,xt.negative=0,xt._ishlnsubmul(At,1,ir),xt.isZero()||(xt.negative^=1);Et&&(Et.words[ir]=nr)}return Et&&Et._strip(),xt._strip(),dt!=="div"&&mt!==0&&xt.iushrn(mt),{div:Et||null,mod:xt}},tt.prototype.divmod=function(ct,dt,mt){if(j(!ct.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var xt,At,Rt;return this.negative!==0&&ct.negative===0?(Rt=this.neg().divmod(ct,dt),dt!=="mod"&&(xt=Rt.div.neg()),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.iadd(ct)),{div:xt,mod:At}):this.negative===0&&ct.negative!==0?(Rt=this.divmod(ct.neg(),dt),dt!=="mod"&&(xt=Rt.div.neg()),{div:xt,mod:Rt.mod}):this.negative&ct.negative?(Rt=this.neg().divmod(ct.neg(),dt),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.isub(ct)),{div:Rt.div,mod:At}):ct.length>this.length||this.cmp(ct)<0?{div:new tt(0),mod:this}:ct.length===1?dt==="div"?{div:this.divn(ct.words[0]),mod:null}:dt==="mod"?{div:null,mod:new tt(this.modrn(ct.words[0]))}:{div:this.divn(ct.words[0]),mod:new tt(this.modrn(ct.words[0]))}:this._wordDiv(ct,dt)},tt.prototype.div=function(ct){return this.divmod(ct,"div",!1).div},tt.prototype.mod=function(ct){return this.divmod(ct,"mod",!1).mod},tt.prototype.umod=function(ct){return this.divmod(ct,"mod",!0).mod},tt.prototype.divRound=function(ct){var dt=this.divmod(ct);if(dt.mod.isZero())return dt.div;var mt=dt.div.negative!==0?dt.mod.isub(ct):dt.mod,xt=ct.ushrn(1),At=ct.andln(1),Rt=mt.cmp(xt);return Rt<0||At===1&&Rt===0?dt.div:dt.div.negative!==0?dt.div.isubn(1):dt.div.iaddn(1)},tt.prototype.modrn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=(1<<26)%ct,xt=0,At=this.length-1;At>=0;At--)xt=(mt*xt+(this.words[At]|0))%ct;return dt?-xt:xt},tt.prototype.modn=function(ct){return this.modrn(ct)},tt.prototype.idivn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=0,xt=this.length-1;xt>=0;xt--){var At=(this.words[xt]|0)+mt*67108864;this.words[xt]=At/ct|0,mt=At%ct}return this._strip(),dt?this.ineg():this},tt.prototype.divn=function(ct){return this.clone().idivn(ct)},tt.prototype.egcd=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=new tt(0),St=new tt(1),Tt=0;dt.isEven()&&mt.isEven();)dt.iushrn(1),mt.iushrn(1),++Tt;for(var Et=mt.clone(),Nt=dt.clone();!dt.isZero();){for(var tr=0,ir=1;!(dt.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(dt.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(Et),At.isub(Nt)),xt.iushrn(1),At.iushrn(1);for(var nr=0,Zt=1;!(mt.words[0]&Zt)&&nr<26;++nr,Zt<<=1);if(nr>0)for(mt.iushrn(nr);nr-- >0;)(Rt.isOdd()||St.isOdd())&&(Rt.iadd(Et),St.isub(Nt)),Rt.iushrn(1),St.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(Rt),At.isub(St)):(mt.isub(dt),Rt.isub(xt),St.isub(At))}return{a:Rt,b:St,gcd:mt.iushln(Tt)}},tt.prototype._invmp=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=mt.clone();dt.cmpn(1)>0&&mt.cmpn(1)>0;){for(var St=0,Tt=1;!(dt.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(dt.iushrn(St);St-- >0;)xt.isOdd()&&xt.iadd(Rt),xt.iushrn(1);for(var Et=0,Nt=1;!(mt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(mt.iushrn(Et);Et-- >0;)At.isOdd()&&At.iadd(Rt),At.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(At)):(mt.isub(dt),At.isub(xt))}var tr;return dt.cmpn(1)===0?tr=xt:tr=At,tr.cmpn(0)<0&&tr.iadd(ct),tr},tt.prototype.gcd=function(ct){if(this.isZero())return ct.abs();if(ct.isZero())return this.abs();var dt=this.clone(),mt=ct.clone();dt.negative=0,mt.negative=0;for(var xt=0;dt.isEven()&&mt.isEven();xt++)dt.iushrn(1),mt.iushrn(1);do{for(;dt.isEven();)dt.iushrn(1);for(;mt.isEven();)mt.iushrn(1);var At=dt.cmp(mt);if(At<0){var Rt=dt;dt=mt,mt=Rt}else if(At===0||mt.cmpn(1)===0)break;dt.isub(mt)}while(!0);return mt.iushln(xt)},tt.prototype.invm=function(ct){return this.egcd(ct).a.umod(ct)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(ct){return this.words[0]&ct},tt.prototype.bincn=function(ct){j(typeof ct=="number");var dt=ct%26,mt=(ct-dt)/26,xt=1<>>26,St&=67108863,this.words[Rt]=St}return At!==0&&(this.words[Rt]=At,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(ct){var dt=ct<0;if(this.negative!==0&&!dt)return-1;if(this.negative===0&&dt)return 1;this._strip();var mt;if(this.length>1)mt=1;else{dt&&(ct=-ct),j(ct<=67108863,"Number is too big");var xt=this.words[0]|0;mt=xt===ct?0:xtct.length)return 1;if(this.length=0;mt--){var xt=this.words[mt]|0,At=ct.words[mt]|0;if(xt!==At){xtAt&&(dt=1);break}}return dt},tt.prototype.gtn=function(ct){return this.cmpn(ct)===1},tt.prototype.gt=function(ct){return this.cmp(ct)===1},tt.prototype.gten=function(ct){return this.cmpn(ct)>=0},tt.prototype.gte=function(ct){return this.cmp(ct)>=0},tt.prototype.ltn=function(ct){return this.cmpn(ct)===-1},tt.prototype.lt=function(ct){return this.cmp(ct)===-1},tt.prototype.lten=function(ct){return this.cmpn(ct)<=0},tt.prototype.lte=function(ct){return this.cmp(ct)<=0},tt.prototype.eqn=function(ct){return this.cmpn(ct)===0},tt.prototype.eq=function(ct){return this.cmp(ct)===0},tt.red=function(ct){return new jt(ct)},tt.prototype.toRed=function(ct){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),ct.convertTo(this)._forceRed(ct)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(ct){return this.red=ct,this},tt.prototype.forceRed=function(ct){return j(!this.red,"Already a number in reduction context"),this._forceRed(ct)},tt.prototype.redAdd=function(ct){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,ct)},tt.prototype.redIAdd=function(ct){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ct)},tt.prototype.redSub=function(ct){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,ct)},tt.prototype.redISub=function(ct){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,ct)},tt.prototype.redShl=function(ct){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,ct)},tt.prototype.redMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.mul(this,ct)},tt.prototype.redIMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.imul(this,ct)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(ct){return j(this.red&&!ct.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ct)};var Dt={k256:null,p224:null,p192:null,p25519:null};function zt(vt,ct){this.name=vt,this.p=new tt(ct,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}zt.prototype._tmp=function(){var ct=new tt(null);return ct.words=new Array(Math.ceil(this.n/13)),ct},zt.prototype.ireduce=function(ct){var dt=ct,mt;do this.split(dt,this.tmp),dt=this.imulK(dt),dt=dt.iadd(this.tmp),mt=dt.bitLength();while(mt>this.n);var xt=mt0?dt.isub(this.p):dt.strip!==void 0?dt.strip():dt._strip(),dt},zt.prototype.split=function(ct,dt){ct.iushrn(this.n,0,dt)},zt.prototype.imulK=function(ct){return ct.imul(this.k)};function Ot(){zt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Ot,zt),Ot.prototype.split=function(ct,dt){for(var mt=4194303,xt=Math.min(ct.length,9),At=0;At>>22,Rt=St}Rt>>>=22,ct.words[At-10]=Rt,Rt===0&&ct.length>10?ct.length-=10:ct.length-=9},Ot.prototype.imulK=function(ct){ct.words[ct.length]=0,ct.words[ct.length+1]=0,ct.length+=2;for(var dt=0,mt=0;mt>>=26,ct.words[mt]=At,dt=xt}return dt!==0&&(ct.words[ct.length++]=dt),ct},tt._prime=function(ct){if(Dt[ct])return Dt[ct];var dt;if(ct==="k256")dt=new Ot;else if(ct==="p224")dt=new It;else if(ct==="p192")dt=new Lt;else if(ct==="p25519")dt=new Ft;else throw new Error("Unknown prime "+ct);return Dt[ct]=dt,dt};function jt(vt){if(typeof vt=="string"){var ct=tt._prime(vt);this.m=ct.p,this.prime=ct}else j(vt.gtn(1),"modulus must be greater than 1"),this.m=vt,this.prime=null}jt.prototype._verify1=function(ct){j(ct.negative===0,"red works only with positives"),j(ct.red,"red works only with red numbers")},jt.prototype._verify2=function(ct,dt){j((ct.negative|dt.negative)===0,"red works only with positives"),j(ct.red&&ct.red===dt.red,"red works only with red numbers")},jt.prototype.imod=function(ct){return this.prime?this.prime.ireduce(ct)._forceRed(this):(ot(ct,ct.umod(this.m)._forceRed(this)),ct)},jt.prototype.neg=function(ct){return ct.isZero()?ct.clone():this.m.sub(ct)._forceRed(this)},jt.prototype.add=function(ct,dt){this._verify2(ct,dt);var mt=ct.add(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt._forceRed(this)},jt.prototype.iadd=function(ct,dt){this._verify2(ct,dt);var mt=ct.iadd(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt},jt.prototype.sub=function(ct,dt){this._verify2(ct,dt);var mt=ct.sub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt._forceRed(this)},jt.prototype.isub=function(ct,dt){this._verify2(ct,dt);var mt=ct.isub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt},jt.prototype.shl=function(ct,dt){return this._verify1(ct),this.imod(ct.ushln(dt))},jt.prototype.imul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.imul(dt))},jt.prototype.mul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.mul(dt))},jt.prototype.isqr=function(ct){return this.imul(ct,ct.clone())},jt.prototype.sqr=function(ct){return this.mul(ct,ct)},jt.prototype.sqrt=function(ct){if(ct.isZero())return ct.clone();var dt=this.m.andln(3);if(j(dt%2===1),dt===3){var mt=this.m.add(new tt(1)).iushrn(2);return this.pow(ct,mt)}for(var xt=this.m.subn(1),At=0;!xt.isZero()&&xt.andln(1)===0;)At++,xt.iushrn(1);j(!xt.isZero());var Rt=new tt(1).toRed(this),St=Rt.redNeg(),Tt=this.m.subn(1).iushrn(1),Et=this.m.bitLength();for(Et=new tt(2*Et*Et).toRed(this);this.pow(Et,Tt).cmp(St)!==0;)Et.redIAdd(St);for(var Nt=this.pow(Et,xt),tr=this.pow(ct,xt.addn(1).iushrn(1)),ir=this.pow(ct,xt),nr=At;ir.cmp(Rt)!==0;){for(var Zt=ir,Kt=0;Zt.cmp(Rt)!==0;Kt++)Zt=Zt.redSqr();j(Kt=0;At--){for(var Nt=dt.words[At],tr=Et-1;tr>=0;tr--){var ir=Nt>>tr&1;if(Rt!==xt[0]&&(Rt=this.sqr(Rt)),ir===0&&St===0){Tt=0;continue}St<<=1,St|=ir,Tt++,!(Tt!==mt&&(At!==0||tr!==0))&&(Rt=this.mul(Rt,xt[St]),Tt=0,St=0)}Et=26}return Rt},jt.prototype.convertTo=function(ct){var dt=ct.umod(this.m);return dt===ct?dt.clone():dt},jt.prototype.convertFrom=function(ct){var dt=ct.clone();return dt.red=null,dt},tt.mont=function(ct){return new bt(ct)};function bt(vt){jt.call(this,vt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(bt,jt),bt.prototype.convertTo=function(ct){return this.imod(ct.ushln(this.shift))},bt.prototype.convertFrom=function(ct){var dt=this.imod(ct.mul(this.rinv));return dt.red=null,dt},bt.prototype.imul=function(ct,dt){if(ct.isZero()||dt.isZero())return ct.words[0]=0,ct.length=1,ct;var mt=ct.imul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.mul=function(ct,dt){if(ct.isZero()||dt.isZero())return new tt(0)._forceRed(this);var mt=ct.mul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.invm=function(ct){var dt=this.imod(ct._invmp(this.m).mul(this.r2));return dt._forceRed(this)}})(a,commonjsGlobal)}(bn$3)),bn$3.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var a=requireBn$2(),_=requireBrowser$8();function $(tt){var rt=j(tt),nt=rt.toRed(a.mont(tt.modulus)).redPow(new a(tt.publicExponent)).fromRed();return{blinder:nt,unblinder:rt.invm(tt.modulus)}}function j(tt){var rt=tt.modulus.byteLength(),nt;do nt=new a(_(rt));while(nt.cmp(tt.modulus)>=0||!nt.umod(tt.prime1)||!nt.umod(tt.prime2));return nt}function et(tt,rt){var nt=$(rt),it=rt.modulus.byteLength(),st=new a(tt).mul(nt.blinder).umod(rt.modulus),ot=st.toRed(a.mont(rt.prime1)),at=st.toRed(a.mont(rt.prime2)),ut=rt.coefficient,ht=rt.prime1,yt=rt.prime2,wt=ot.redPow(rt.exponent1).fromRed(),Ct=at.redPow(rt.exponent2).fromRed(),Pt=wt.isub(Ct).imul(ut).umod(ht).imul(yt);return Ct.iadd(Pt).imul(nt.unblinder).umod(rt.modulus).toArrayLike(Buffer$g,"be",it)}return et.getr=j,browserifyRsa=et,browserifyRsa}var elliptic$3={};const name$3="elliptic",version$3="6.5.5",description$3="EC cryptography",main$3="lib/elliptic.js",files$2=["lib"],scripts$3={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository$3={type:"git",url:"git@github.com:indutny/elliptic"},keywords$2=["EC","Elliptic","curve","Cryptography"],author$3="Fedor Indutny ",license$3="MIT",bugs$2={url:"https://github.com/indutny/elliptic/issues"},homepage$3="https://github.com/indutny/elliptic",devDependencies$3={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies$3={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0$3={name:name$3,version:version$3,description:description$3,main:main$3,files:files$2,scripts:scripts$3,repository:repository$3,keywords:keywords$2,author:author$3,license:license$3,bugs:bugs$2,homepage:homepage$3,devDependencies:devDependencies$3,dependencies:dependencies$3};var utils$w={},bn$2={exports:{}};bn$2.exports;var hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,function(a){(function(_,$){function j(jt,bt){if(!jt)throw new Error(bt||"Assertion failed")}function et(jt,bt){jt.super_=bt;var vt=function(){};vt.prototype=bt.prototype,jt.prototype=new vt,jt.prototype.constructor=jt}function tt(jt,bt,vt){if(tt.isBN(jt))return jt;this.negative=0,this.words=null,this.length=0,this.red=null,jt!==null&&((bt==="le"||bt==="be")&&(vt=bt,bt=10),this._init(jt||0,bt||10,vt||"be"))}typeof _=="object"?_.exports=tt:$.BN=tt,tt.BN=tt,tt.wordSize=26;var rt;try{typeof window<"u"&&typeof window.Buffer<"u"?rt=window.Buffer:rt=require$$0$4.Buffer}catch{}tt.isBN=function(bt){return bt instanceof tt?!0:bt!==null&&typeof bt=="object"&&bt.constructor.wordSize===tt.wordSize&&Array.isArray(bt.words)},tt.max=function(bt,vt){return bt.cmp(vt)>0?bt:vt},tt.min=function(bt,vt){return bt.cmp(vt)<0?bt:vt},tt.prototype._init=function(bt,vt,ct){if(typeof bt=="number")return this._initNumber(bt,vt,ct);if(typeof bt=="object")return this._initArray(bt,vt,ct);vt==="hex"&&(vt=16),j(vt===(vt|0)&&vt>=2&&vt<=36),bt=bt.toString().replace(/\s+/g,"");var dt=0;bt[0]==="-"&&(dt++,this.negative=1),dt=0;dt-=3)xt=bt[dt]|bt[dt-1]<<8|bt[dt-2]<<16,this.words[mt]|=xt<>>26-At&67108863,At+=24,At>=26&&(At-=26,mt++);else if(ct==="le")for(dt=0,mt=0;dt>>26-At&67108863,At+=24,At>=26&&(At-=26,mt++);return this.strip()};function nt(jt,bt){var vt=jt.charCodeAt(bt);return vt>=65&&vt<=70?vt-55:vt>=97&&vt<=102?vt-87:vt-48&15}function it(jt,bt,vt){var ct=nt(jt,vt);return vt-1>=bt&&(ct|=nt(jt,vt-1)<<4),ct}tt.prototype._parseHex=function(bt,vt,ct){this.length=Math.ceil((bt.length-vt)/6),this.words=new Array(this.length);for(var dt=0;dt=vt;dt-=2)At=it(bt,vt,dt)<=18?(mt-=18,xt+=1,this.words[xt]|=At>>>26):mt+=8;else{var Rt=bt.length-vt;for(dt=Rt%2===0?vt+1:vt;dt=18?(mt-=18,xt+=1,this.words[xt]|=At>>>26):mt+=8}this.strip()};function st(jt,bt,vt,ct){for(var dt=0,mt=Math.min(jt.length,vt),xt=bt;xt=49?dt+=At-49+10:At>=17?dt+=At-17+10:dt+=At}return dt}tt.prototype._parseBase=function(bt,vt,ct){this.words=[0],this.length=1;for(var dt=0,mt=1;mt<=67108863;mt*=vt)dt++;dt--,mt=mt/vt|0;for(var xt=bt.length-ct,At=xt%dt,Rt=Math.min(xt,xt-At)+ct,St=0,Tt=ct;Tt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},tt.prototype.inspect=function(){return(this.red?""};var ot=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],at=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],ut=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(bt,vt){bt=bt||10,vt=vt|0||1;var ct;if(bt===16||bt==="hex"){ct="";for(var dt=0,mt=0,xt=0;xt>>24-dt&16777215,mt!==0||xt!==this.length-1?ct=ot[6-Rt.length]+Rt+ct:ct=Rt+ct,dt+=2,dt>=26&&(dt-=26,xt--)}for(mt!==0&&(ct=mt.toString(16)+ct);ct.length%vt!==0;)ct="0"+ct;return this.negative!==0&&(ct="-"+ct),ct}if(bt===(bt|0)&&bt>=2&&bt<=36){var St=at[bt],Tt=ut[bt];ct="";var Et=this.clone();for(Et.negative=0;!Et.isZero();){var Nt=Et.modn(Tt).toString(bt);Et=Et.idivn(Tt),Et.isZero()?ct=Nt+ct:ct=ot[St-Nt.length]+Nt+ct}for(this.isZero()&&(ct="0"+ct);ct.length%vt!==0;)ct="0"+ct;return this.negative!==0&&(ct="-"+ct),ct}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var bt=this.words[0];return this.length===2?bt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?bt+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-bt:bt},tt.prototype.toJSON=function(){return this.toString(16)},tt.prototype.toBuffer=function(bt,vt){return j(typeof rt<"u"),this.toArrayLike(rt,bt,vt)},tt.prototype.toArray=function(bt,vt){return this.toArrayLike(Array,bt,vt)},tt.prototype.toArrayLike=function(bt,vt,ct){var dt=this.byteLength(),mt=ct||Math.max(1,dt);j(dt<=mt,"byte array longer than desired length"),j(mt>0,"Requested array length <= 0"),this.strip();var xt=vt==="le",At=new bt(mt),Rt,St,Tt=this.clone();if(xt){for(St=0;!Tt.isZero();St++)Rt=Tt.andln(255),Tt.iushrn(8),At[St]=Rt;for(;St=4096&&(ct+=13,vt>>>=13),vt>=64&&(ct+=7,vt>>>=7),vt>=8&&(ct+=4,vt>>>=4),vt>=2&&(ct+=2,vt>>>=2),ct+vt},tt.prototype._zeroBits=function(bt){if(bt===0)return 26;var vt=bt,ct=0;return vt&8191||(ct+=13,vt>>>=13),vt&127||(ct+=7,vt>>>=7),vt&15||(ct+=4,vt>>>=4),vt&3||(ct+=2,vt>>>=2),vt&1||ct++,ct},tt.prototype.bitLength=function(){var bt=this.words[this.length-1],vt=this._countBits(bt);return(this.length-1)*26+vt};function ht(jt){for(var bt=new Array(jt.bitLength()),vt=0;vt>>dt}return bt}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var bt=0,vt=0;vtbt.length?this.clone().ior(bt):bt.clone().ior(this)},tt.prototype.uor=function(bt){return this.length>bt.length?this.clone().iuor(bt):bt.clone().iuor(this)},tt.prototype.iuand=function(bt){var vt;this.length>bt.length?vt=bt:vt=this;for(var ct=0;ctbt.length?this.clone().iand(bt):bt.clone().iand(this)},tt.prototype.uand=function(bt){return this.length>bt.length?this.clone().iuand(bt):bt.clone().iuand(this)},tt.prototype.iuxor=function(bt){var vt,ct;this.length>bt.length?(vt=this,ct=bt):(vt=bt,ct=this);for(var dt=0;dtbt.length?this.clone().ixor(bt):bt.clone().ixor(this)},tt.prototype.uxor=function(bt){return this.length>bt.length?this.clone().iuxor(bt):bt.clone().iuxor(this)},tt.prototype.inotn=function(bt){j(typeof bt=="number"&&bt>=0);var vt=Math.ceil(bt/26)|0,ct=bt%26;this._expand(vt),ct>0&&vt--;for(var dt=0;dt0&&(this.words[dt]=~this.words[dt]&67108863>>26-ct),this.strip()},tt.prototype.notn=function(bt){return this.clone().inotn(bt)},tt.prototype.setn=function(bt,vt){j(typeof bt=="number"&&bt>=0);var ct=bt/26|0,dt=bt%26;return this._expand(ct+1),vt?this.words[ct]=this.words[ct]|1<bt.length?(ct=this,dt=bt):(ct=bt,dt=this);for(var mt=0,xt=0;xt>>26;for(;mt!==0&&xt>>26;if(this.length=ct.length,mt!==0)this.words[this.length]=mt,this.length++;else if(ct!==this)for(;xtbt.length?this.clone().iadd(bt):bt.clone().iadd(this)},tt.prototype.isub=function(bt){if(bt.negative!==0){bt.negative=0;var vt=this.iadd(bt);return bt.negative=1,vt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(bt),this.negative=1,this._normSign();var ct=this.cmp(bt);if(ct===0)return this.negative=0,this.length=1,this.words[0]=0,this;var dt,mt;ct>0?(dt=this,mt=bt):(dt=bt,mt=this);for(var xt=0,At=0;At>26,this.words[At]=vt&67108863;for(;xt!==0&&At>26,this.words[At]=vt&67108863;if(xt===0&&At>>26,Et=Rt&67108863,Nt=Math.min(St,bt.length-1),tr=Math.max(0,St-jt.length+1);tr<=Nt;tr++){var ir=St-tr|0;dt=jt.words[ir]|0,mt=bt.words[tr]|0,xt=dt*mt+Et,Tt+=xt/67108864|0,Et=xt&67108863}vt.words[St]=Et|0,Rt=Tt|0}return Rt!==0?vt.words[St]=Rt|0:vt.length--,vt.strip()}var wt=function(bt,vt,ct){var dt=bt.words,mt=vt.words,xt=ct.words,At=0,Rt,St,Tt,Et=dt[0]|0,Nt=Et&8191,tr=Et>>>13,ir=dt[1]|0,nr=ir&8191,Zt=ir>>>13,Kt=dt[2]|0,Qt=Kt&8191,Ht=Kt>>>13,qt=dt[3]|0,Jt=qt&8191,ur=qt>>>13,xr=dt[4]|0,pr=xr&8191,Cr=xr>>>13,Mr=dt[5]|0,lr=Mr&8191,fr=Mr>>>13,_r=dt[6]|0,Rr=_r&8191,kr=_r>>>13,Ar=dt[7]|0,Pr=Ar&8191,Or=Ar>>>13,Br=dt[8]|0,or=Br&8191,Yt=Br>>>13,er=dt[9]|0,Gt=er&8191,Vt=er>>>13,Wt=mt[0]|0,ar=Wt&8191,yr=Wt>>>13,Er=mt[1]|0,Sr=Er&8191,Wr=Er>>>13,Hr=mt[2]|0,Fr=Hr&8191,pn=Hr>>>13,Jr=mt[3]|0,Qr=Jr&8191,mn=Jr>>>13,ln=mt[4]|0,qr=ln&8191,En=ln>>>13,un=mt[5]|0,Vr=un&8191,hn=un>>>13,fn=mt[6]|0,Kr=fn&8191,Rn=fn>>>13,dn=mt[7]|0,Gr=dn&8191,gn=dn>>>13,an=mt[8]|0,Zr=an&8191,An=an>>>13,Sn=mt[9]|0,nn=Sn&8191,Pn=Sn>>>13;ct.negative=bt.negative^vt.negative,ct.length=19,Rt=Math.imul(Nt,ar),St=Math.imul(Nt,yr),St=St+Math.imul(tr,ar)|0,Tt=Math.imul(tr,yr);var yn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(yn>>>26)|0,yn&=67108863,Rt=Math.imul(nr,ar),St=Math.imul(nr,yr),St=St+Math.imul(Zt,ar)|0,Tt=Math.imul(Zt,yr),Rt=Rt+Math.imul(Nt,Sr)|0,St=St+Math.imul(Nt,Wr)|0,St=St+Math.imul(tr,Sr)|0,Tt=Tt+Math.imul(tr,Wr)|0;var _n=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(_n>>>26)|0,_n&=67108863,Rt=Math.imul(Qt,ar),St=Math.imul(Qt,yr),St=St+Math.imul(Ht,ar)|0,Tt=Math.imul(Ht,yr),Rt=Rt+Math.imul(nr,Sr)|0,St=St+Math.imul(nr,Wr)|0,St=St+Math.imul(Zt,Sr)|0,Tt=Tt+Math.imul(Zt,Wr)|0,Rt=Rt+Math.imul(Nt,Fr)|0,St=St+Math.imul(Nt,pn)|0,St=St+Math.imul(tr,Fr)|0,Tt=Tt+Math.imul(tr,pn)|0;var ds=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ds>>>26)|0,ds&=67108863,Rt=Math.imul(Jt,ar),St=Math.imul(Jt,yr),St=St+Math.imul(ur,ar)|0,Tt=Math.imul(ur,yr),Rt=Rt+Math.imul(Qt,Sr)|0,St=St+Math.imul(Qt,Wr)|0,St=St+Math.imul(Ht,Sr)|0,Tt=Tt+Math.imul(Ht,Wr)|0,Rt=Rt+Math.imul(nr,Fr)|0,St=St+Math.imul(nr,pn)|0,St=St+Math.imul(Zt,Fr)|0,Tt=Tt+Math.imul(Zt,pn)|0,Rt=Rt+Math.imul(Nt,Qr)|0,St=St+Math.imul(Nt,mn)|0,St=St+Math.imul(tr,Qr)|0,Tt=Tt+Math.imul(tr,mn)|0;var fs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(fs>>>26)|0,fs&=67108863,Rt=Math.imul(pr,ar),St=Math.imul(pr,yr),St=St+Math.imul(Cr,ar)|0,Tt=Math.imul(Cr,yr),Rt=Rt+Math.imul(Jt,Sr)|0,St=St+Math.imul(Jt,Wr)|0,St=St+Math.imul(ur,Sr)|0,Tt=Tt+Math.imul(ur,Wr)|0,Rt=Rt+Math.imul(Qt,Fr)|0,St=St+Math.imul(Qt,pn)|0,St=St+Math.imul(Ht,Fr)|0,Tt=Tt+Math.imul(Ht,pn)|0,Rt=Rt+Math.imul(nr,Qr)|0,St=St+Math.imul(nr,mn)|0,St=St+Math.imul(Zt,Qr)|0,Tt=Tt+Math.imul(Zt,mn)|0,Rt=Rt+Math.imul(Nt,qr)|0,St=St+Math.imul(Nt,En)|0,St=St+Math.imul(tr,qr)|0,Tt=Tt+Math.imul(tr,En)|0;var hs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(hs>>>26)|0,hs&=67108863,Rt=Math.imul(lr,ar),St=Math.imul(lr,yr),St=St+Math.imul(fr,ar)|0,Tt=Math.imul(fr,yr),Rt=Rt+Math.imul(pr,Sr)|0,St=St+Math.imul(pr,Wr)|0,St=St+Math.imul(Cr,Sr)|0,Tt=Tt+Math.imul(Cr,Wr)|0,Rt=Rt+Math.imul(Jt,Fr)|0,St=St+Math.imul(Jt,pn)|0,St=St+Math.imul(ur,Fr)|0,Tt=Tt+Math.imul(ur,pn)|0,Rt=Rt+Math.imul(Qt,Qr)|0,St=St+Math.imul(Qt,mn)|0,St=St+Math.imul(Ht,Qr)|0,Tt=Tt+Math.imul(Ht,mn)|0,Rt=Rt+Math.imul(nr,qr)|0,St=St+Math.imul(nr,En)|0,St=St+Math.imul(Zt,qr)|0,Tt=Tt+Math.imul(Zt,En)|0,Rt=Rt+Math.imul(Nt,Vr)|0,St=St+Math.imul(Nt,hn)|0,St=St+Math.imul(tr,Vr)|0,Tt=Tt+Math.imul(tr,hn)|0;var ps=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ps>>>26)|0,ps&=67108863,Rt=Math.imul(Rr,ar),St=Math.imul(Rr,yr),St=St+Math.imul(kr,ar)|0,Tt=Math.imul(kr,yr),Rt=Rt+Math.imul(lr,Sr)|0,St=St+Math.imul(lr,Wr)|0,St=St+Math.imul(fr,Sr)|0,Tt=Tt+Math.imul(fr,Wr)|0,Rt=Rt+Math.imul(pr,Fr)|0,St=St+Math.imul(pr,pn)|0,St=St+Math.imul(Cr,Fr)|0,Tt=Tt+Math.imul(Cr,pn)|0,Rt=Rt+Math.imul(Jt,Qr)|0,St=St+Math.imul(Jt,mn)|0,St=St+Math.imul(ur,Qr)|0,Tt=Tt+Math.imul(ur,mn)|0,Rt=Rt+Math.imul(Qt,qr)|0,St=St+Math.imul(Qt,En)|0,St=St+Math.imul(Ht,qr)|0,Tt=Tt+Math.imul(Ht,En)|0,Rt=Rt+Math.imul(nr,Vr)|0,St=St+Math.imul(nr,hn)|0,St=St+Math.imul(Zt,Vr)|0,Tt=Tt+Math.imul(Zt,hn)|0,Rt=Rt+Math.imul(Nt,Kr)|0,St=St+Math.imul(Nt,Rn)|0,St=St+Math.imul(tr,Kr)|0,Tt=Tt+Math.imul(tr,Rn)|0;var Vn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Rt=Math.imul(Pr,ar),St=Math.imul(Pr,yr),St=St+Math.imul(Or,ar)|0,Tt=Math.imul(Or,yr),Rt=Rt+Math.imul(Rr,Sr)|0,St=St+Math.imul(Rr,Wr)|0,St=St+Math.imul(kr,Sr)|0,Tt=Tt+Math.imul(kr,Wr)|0,Rt=Rt+Math.imul(lr,Fr)|0,St=St+Math.imul(lr,pn)|0,St=St+Math.imul(fr,Fr)|0,Tt=Tt+Math.imul(fr,pn)|0,Rt=Rt+Math.imul(pr,Qr)|0,St=St+Math.imul(pr,mn)|0,St=St+Math.imul(Cr,Qr)|0,Tt=Tt+Math.imul(Cr,mn)|0,Rt=Rt+Math.imul(Jt,qr)|0,St=St+Math.imul(Jt,En)|0,St=St+Math.imul(ur,qr)|0,Tt=Tt+Math.imul(ur,En)|0,Rt=Rt+Math.imul(Qt,Vr)|0,St=St+Math.imul(Qt,hn)|0,St=St+Math.imul(Ht,Vr)|0,Tt=Tt+Math.imul(Ht,hn)|0,Rt=Rt+Math.imul(nr,Kr)|0,St=St+Math.imul(nr,Rn)|0,St=St+Math.imul(Zt,Kr)|0,Tt=Tt+Math.imul(Zt,Rn)|0,Rt=Rt+Math.imul(Nt,Gr)|0,St=St+Math.imul(Nt,gn)|0,St=St+Math.imul(tr,Gr)|0,Tt=Tt+Math.imul(tr,gn)|0;var ss=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ss>>>26)|0,ss&=67108863,Rt=Math.imul(or,ar),St=Math.imul(or,yr),St=St+Math.imul(Yt,ar)|0,Tt=Math.imul(Yt,yr),Rt=Rt+Math.imul(Pr,Sr)|0,St=St+Math.imul(Pr,Wr)|0,St=St+Math.imul(Or,Sr)|0,Tt=Tt+Math.imul(Or,Wr)|0,Rt=Rt+Math.imul(Rr,Fr)|0,St=St+Math.imul(Rr,pn)|0,St=St+Math.imul(kr,Fr)|0,Tt=Tt+Math.imul(kr,pn)|0,Rt=Rt+Math.imul(lr,Qr)|0,St=St+Math.imul(lr,mn)|0,St=St+Math.imul(fr,Qr)|0,Tt=Tt+Math.imul(fr,mn)|0,Rt=Rt+Math.imul(pr,qr)|0,St=St+Math.imul(pr,En)|0,St=St+Math.imul(Cr,qr)|0,Tt=Tt+Math.imul(Cr,En)|0,Rt=Rt+Math.imul(Jt,Vr)|0,St=St+Math.imul(Jt,hn)|0,St=St+Math.imul(ur,Vr)|0,Tt=Tt+Math.imul(ur,hn)|0,Rt=Rt+Math.imul(Qt,Kr)|0,St=St+Math.imul(Qt,Rn)|0,St=St+Math.imul(Ht,Kr)|0,Tt=Tt+Math.imul(Ht,Rn)|0,Rt=Rt+Math.imul(nr,Gr)|0,St=St+Math.imul(nr,gn)|0,St=St+Math.imul(Zt,Gr)|0,Tt=Tt+Math.imul(Zt,gn)|0,Rt=Rt+Math.imul(Nt,Zr)|0,St=St+Math.imul(Nt,An)|0,St=St+Math.imul(tr,Zr)|0,Tt=Tt+Math.imul(tr,An)|0;var Jn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Rt=Math.imul(Gt,ar),St=Math.imul(Gt,yr),St=St+Math.imul(Vt,ar)|0,Tt=Math.imul(Vt,yr),Rt=Rt+Math.imul(or,Sr)|0,St=St+Math.imul(or,Wr)|0,St=St+Math.imul(Yt,Sr)|0,Tt=Tt+Math.imul(Yt,Wr)|0,Rt=Rt+Math.imul(Pr,Fr)|0,St=St+Math.imul(Pr,pn)|0,St=St+Math.imul(Or,Fr)|0,Tt=Tt+Math.imul(Or,pn)|0,Rt=Rt+Math.imul(Rr,Qr)|0,St=St+Math.imul(Rr,mn)|0,St=St+Math.imul(kr,Qr)|0,Tt=Tt+Math.imul(kr,mn)|0,Rt=Rt+Math.imul(lr,qr)|0,St=St+Math.imul(lr,En)|0,St=St+Math.imul(fr,qr)|0,Tt=Tt+Math.imul(fr,En)|0,Rt=Rt+Math.imul(pr,Vr)|0,St=St+Math.imul(pr,hn)|0,St=St+Math.imul(Cr,Vr)|0,Tt=Tt+Math.imul(Cr,hn)|0,Rt=Rt+Math.imul(Jt,Kr)|0,St=St+Math.imul(Jt,Rn)|0,St=St+Math.imul(ur,Kr)|0,Tt=Tt+Math.imul(ur,Rn)|0,Rt=Rt+Math.imul(Qt,Gr)|0,St=St+Math.imul(Qt,gn)|0,St=St+Math.imul(Ht,Gr)|0,Tt=Tt+Math.imul(Ht,gn)|0,Rt=Rt+Math.imul(nr,Zr)|0,St=St+Math.imul(nr,An)|0,St=St+Math.imul(Zt,Zr)|0,Tt=Tt+Math.imul(Zt,An)|0,Rt=Rt+Math.imul(Nt,nn)|0,St=St+Math.imul(Nt,Pn)|0,St=St+Math.imul(tr,nn)|0,Tt=Tt+Math.imul(tr,Pn)|0;var Yn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Rt=Math.imul(Gt,Sr),St=Math.imul(Gt,Wr),St=St+Math.imul(Vt,Sr)|0,Tt=Math.imul(Vt,Wr),Rt=Rt+Math.imul(or,Fr)|0,St=St+Math.imul(or,pn)|0,St=St+Math.imul(Yt,Fr)|0,Tt=Tt+Math.imul(Yt,pn)|0,Rt=Rt+Math.imul(Pr,Qr)|0,St=St+Math.imul(Pr,mn)|0,St=St+Math.imul(Or,Qr)|0,Tt=Tt+Math.imul(Or,mn)|0,Rt=Rt+Math.imul(Rr,qr)|0,St=St+Math.imul(Rr,En)|0,St=St+Math.imul(kr,qr)|0,Tt=Tt+Math.imul(kr,En)|0,Rt=Rt+Math.imul(lr,Vr)|0,St=St+Math.imul(lr,hn)|0,St=St+Math.imul(fr,Vr)|0,Tt=Tt+Math.imul(fr,hn)|0,Rt=Rt+Math.imul(pr,Kr)|0,St=St+Math.imul(pr,Rn)|0,St=St+Math.imul(Cr,Kr)|0,Tt=Tt+Math.imul(Cr,Rn)|0,Rt=Rt+Math.imul(Jt,Gr)|0,St=St+Math.imul(Jt,gn)|0,St=St+Math.imul(ur,Gr)|0,Tt=Tt+Math.imul(ur,gn)|0,Rt=Rt+Math.imul(Qt,Zr)|0,St=St+Math.imul(Qt,An)|0,St=St+Math.imul(Ht,Zr)|0,Tt=Tt+Math.imul(Ht,An)|0,Rt=Rt+Math.imul(nr,nn)|0,St=St+Math.imul(nr,Pn)|0,St=St+Math.imul(Zt,nn)|0,Tt=Tt+Math.imul(Zt,Pn)|0;var ms=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ms>>>26)|0,ms&=67108863,Rt=Math.imul(Gt,Fr),St=Math.imul(Gt,pn),St=St+Math.imul(Vt,Fr)|0,Tt=Math.imul(Vt,pn),Rt=Rt+Math.imul(or,Qr)|0,St=St+Math.imul(or,mn)|0,St=St+Math.imul(Yt,Qr)|0,Tt=Tt+Math.imul(Yt,mn)|0,Rt=Rt+Math.imul(Pr,qr)|0,St=St+Math.imul(Pr,En)|0,St=St+Math.imul(Or,qr)|0,Tt=Tt+Math.imul(Or,En)|0,Rt=Rt+Math.imul(Rr,Vr)|0,St=St+Math.imul(Rr,hn)|0,St=St+Math.imul(kr,Vr)|0,Tt=Tt+Math.imul(kr,hn)|0,Rt=Rt+Math.imul(lr,Kr)|0,St=St+Math.imul(lr,Rn)|0,St=St+Math.imul(fr,Kr)|0,Tt=Tt+Math.imul(fr,Rn)|0,Rt=Rt+Math.imul(pr,Gr)|0,St=St+Math.imul(pr,gn)|0,St=St+Math.imul(Cr,Gr)|0,Tt=Tt+Math.imul(Cr,gn)|0,Rt=Rt+Math.imul(Jt,Zr)|0,St=St+Math.imul(Jt,An)|0,St=St+Math.imul(ur,Zr)|0,Tt=Tt+Math.imul(ur,An)|0,Rt=Rt+Math.imul(Qt,nn)|0,St=St+Math.imul(Qt,Pn)|0,St=St+Math.imul(Ht,nn)|0,Tt=Tt+Math.imul(Ht,Pn)|0;var Qn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Rt=Math.imul(Gt,Qr),St=Math.imul(Gt,mn),St=St+Math.imul(Vt,Qr)|0,Tt=Math.imul(Vt,mn),Rt=Rt+Math.imul(or,qr)|0,St=St+Math.imul(or,En)|0,St=St+Math.imul(Yt,qr)|0,Tt=Tt+Math.imul(Yt,En)|0,Rt=Rt+Math.imul(Pr,Vr)|0,St=St+Math.imul(Pr,hn)|0,St=St+Math.imul(Or,Vr)|0,Tt=Tt+Math.imul(Or,hn)|0,Rt=Rt+Math.imul(Rr,Kr)|0,St=St+Math.imul(Rr,Rn)|0,St=St+Math.imul(kr,Kr)|0,Tt=Tt+Math.imul(kr,Rn)|0,Rt=Rt+Math.imul(lr,Gr)|0,St=St+Math.imul(lr,gn)|0,St=St+Math.imul(fr,Gr)|0,Tt=Tt+Math.imul(fr,gn)|0,Rt=Rt+Math.imul(pr,Zr)|0,St=St+Math.imul(pr,An)|0,St=St+Math.imul(Cr,Zr)|0,Tt=Tt+Math.imul(Cr,An)|0,Rt=Rt+Math.imul(Jt,nn)|0,St=St+Math.imul(Jt,Pn)|0,St=St+Math.imul(ur,nn)|0,Tt=Tt+Math.imul(ur,Pn)|0;var es=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(es>>>26)|0,es&=67108863,Rt=Math.imul(Gt,qr),St=Math.imul(Gt,En),St=St+Math.imul(Vt,qr)|0,Tt=Math.imul(Vt,En),Rt=Rt+Math.imul(or,Vr)|0,St=St+Math.imul(or,hn)|0,St=St+Math.imul(Yt,Vr)|0,Tt=Tt+Math.imul(Yt,hn)|0,Rt=Rt+Math.imul(Pr,Kr)|0,St=St+Math.imul(Pr,Rn)|0,St=St+Math.imul(Or,Kr)|0,Tt=Tt+Math.imul(Or,Rn)|0,Rt=Rt+Math.imul(Rr,Gr)|0,St=St+Math.imul(Rr,gn)|0,St=St+Math.imul(kr,Gr)|0,Tt=Tt+Math.imul(kr,gn)|0,Rt=Rt+Math.imul(lr,Zr)|0,St=St+Math.imul(lr,An)|0,St=St+Math.imul(fr,Zr)|0,Tt=Tt+Math.imul(fr,An)|0,Rt=Rt+Math.imul(pr,nn)|0,St=St+Math.imul(pr,Pn)|0,St=St+Math.imul(Cr,nn)|0,Tt=Tt+Math.imul(Cr,Pn)|0;var ls=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ls>>>26)|0,ls&=67108863,Rt=Math.imul(Gt,Vr),St=Math.imul(Gt,hn),St=St+Math.imul(Vt,Vr)|0,Tt=Math.imul(Vt,hn),Rt=Rt+Math.imul(or,Kr)|0,St=St+Math.imul(or,Rn)|0,St=St+Math.imul(Yt,Kr)|0,Tt=Tt+Math.imul(Yt,Rn)|0,Rt=Rt+Math.imul(Pr,Gr)|0,St=St+Math.imul(Pr,gn)|0,St=St+Math.imul(Or,Gr)|0,Tt=Tt+Math.imul(Or,gn)|0,Rt=Rt+Math.imul(Rr,Zr)|0,St=St+Math.imul(Rr,An)|0,St=St+Math.imul(kr,Zr)|0,Tt=Tt+Math.imul(kr,An)|0,Rt=Rt+Math.imul(lr,nn)|0,St=St+Math.imul(lr,Pn)|0,St=St+Math.imul(fr,nn)|0,Tt=Tt+Math.imul(fr,Pn)|0;var us=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(us>>>26)|0,us&=67108863,Rt=Math.imul(Gt,Kr),St=Math.imul(Gt,Rn),St=St+Math.imul(Vt,Kr)|0,Tt=Math.imul(Vt,Rn),Rt=Rt+Math.imul(or,Gr)|0,St=St+Math.imul(or,gn)|0,St=St+Math.imul(Yt,Gr)|0,Tt=Tt+Math.imul(Yt,gn)|0,Rt=Rt+Math.imul(Pr,Zr)|0,St=St+Math.imul(Pr,An)|0,St=St+Math.imul(Or,Zr)|0,Tt=Tt+Math.imul(Or,An)|0,Rt=Rt+Math.imul(Rr,nn)|0,St=St+Math.imul(Rr,Pn)|0,St=St+Math.imul(kr,nn)|0,Tt=Tt+Math.imul(kr,Pn)|0;var Wn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Rt=Math.imul(Gt,Gr),St=Math.imul(Gt,gn),St=St+Math.imul(Vt,Gr)|0,Tt=Math.imul(Vt,gn),Rt=Rt+Math.imul(or,Zr)|0,St=St+Math.imul(or,An)|0,St=St+Math.imul(Yt,Zr)|0,Tt=Tt+Math.imul(Yt,An)|0,Rt=Rt+Math.imul(Pr,nn)|0,St=St+Math.imul(Pr,Pn)|0,St=St+Math.imul(Or,nn)|0,Tt=Tt+Math.imul(Or,Pn)|0;var as=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(as>>>26)|0,as&=67108863,Rt=Math.imul(Gt,Zr),St=Math.imul(Gt,An),St=St+Math.imul(Vt,Zr)|0,Tt=Math.imul(Vt,An),Rt=Rt+Math.imul(or,nn)|0,St=St+Math.imul(or,Pn)|0,St=St+Math.imul(Yt,nn)|0,Tt=Tt+Math.imul(Yt,Pn)|0;var gs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(gs>>>26)|0,gs&=67108863,Rt=Math.imul(Gt,nn),St=Math.imul(Gt,Pn),St=St+Math.imul(Vt,nn)|0,Tt=Math.imul(Vt,Pn);var vs=(At+Rt|0)+((St&8191)<<13)|0;return At=(Tt+(St>>>13)|0)+(vs>>>26)|0,vs&=67108863,xt[0]=yn,xt[1]=_n,xt[2]=ds,xt[3]=fs,xt[4]=hs,xt[5]=ps,xt[6]=Vn,xt[7]=ss,xt[8]=Jn,xt[9]=Yn,xt[10]=ms,xt[11]=Qn,xt[12]=es,xt[13]=ls,xt[14]=us,xt[15]=Wn,xt[16]=as,xt[17]=gs,xt[18]=vs,At!==0&&(xt[19]=At,ct.length++),ct};Math.imul||(wt=yt);function Ct(jt,bt,vt){vt.negative=bt.negative^jt.negative,vt.length=jt.length+bt.length;for(var ct=0,dt=0,mt=0;mt>>26)|0,dt+=xt>>>26,xt&=67108863}vt.words[mt]=At,ct=xt,xt=dt}return ct!==0?vt.words[mt]=ct:vt.length--,vt.strip()}function Pt(jt,bt,vt){var ct=new $t;return ct.mulp(jt,bt,vt)}tt.prototype.mulTo=function(bt,vt){var ct,dt=this.length+bt.length;return this.length===10&&bt.length===10?ct=wt(this,bt,vt):dt<63?ct=yt(this,bt,vt):dt<1024?ct=Ct(this,bt,vt):ct=Pt(this,bt,vt),ct};function $t(jt,bt){this.x=jt,this.y=bt}$t.prototype.makeRBT=function(bt){for(var vt=new Array(bt),ct=tt.prototype._countBits(bt)-1,dt=0;dt>=1;return dt},$t.prototype.permute=function(bt,vt,ct,dt,mt,xt){for(var At=0;At>>1)mt++;return 1<>>13,ct[2*xt+1]=mt&8191,mt=mt>>>13;for(xt=2*vt;xt>=26,vt+=dt/67108864|0,vt+=mt>>>26,this.words[ct]=mt&67108863}return vt!==0&&(this.words[ct]=vt,this.length++),this},tt.prototype.muln=function(bt){return this.clone().imuln(bt)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(bt){var vt=ht(bt);if(vt.length===0)return new tt(1);for(var ct=this,dt=0;dt=0);var vt=bt%26,ct=(bt-vt)/26,dt=67108863>>>26-vt<<26-vt,mt;if(vt!==0){var xt=0;for(mt=0;mt>>26-vt}xt&&(this.words[mt]=xt,this.length++)}if(ct!==0){for(mt=this.length-1;mt>=0;mt--)this.words[mt+ct]=this.words[mt];for(mt=0;mt=0);var dt;vt?dt=(vt-vt%26)/26:dt=0;var mt=bt%26,xt=Math.min((bt-mt)/26,this.length),At=67108863^67108863>>>mt<xt)for(this.length-=xt,St=0;St=0&&(Tt!==0||St>=dt);St--){var Et=this.words[St]|0;this.words[St]=Tt<<26-mt|Et>>>mt,Tt=Et&At}return Rt&&Tt!==0&&(Rt.words[Rt.length++]=Tt),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},tt.prototype.ishrn=function(bt,vt,ct){return j(this.negative===0),this.iushrn(bt,vt,ct)},tt.prototype.shln=function(bt){return this.clone().ishln(bt)},tt.prototype.ushln=function(bt){return this.clone().iushln(bt)},tt.prototype.shrn=function(bt){return this.clone().ishrn(bt)},tt.prototype.ushrn=function(bt){return this.clone().iushrn(bt)},tt.prototype.testn=function(bt){j(typeof bt=="number"&&bt>=0);var vt=bt%26,ct=(bt-vt)/26,dt=1<=0);var vt=bt%26,ct=(bt-vt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=ct)return this;if(vt!==0&&ct++,this.length=Math.min(ct,this.length),vt!==0){var dt=67108863^67108863>>>vt<=67108864;vt++)this.words[vt]-=67108864,vt===this.length-1?this.words[vt+1]=1:this.words[vt+1]++;return this.length=Math.max(this.length,vt+1),this},tt.prototype.isubn=function(bt){if(j(typeof bt=="number"),j(bt<67108864),bt<0)return this.iaddn(-bt);if(this.negative!==0)return this.negative=0,this.iaddn(bt),this.negative=1,this;if(this.words[0]-=bt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var vt=0;vt>26)-(Rt/67108864|0),this.words[mt+ct]=xt&67108863}for(;mt>26,this.words[mt+ct]=xt&67108863;if(At===0)return this.strip();for(j(At===-1),At=0,mt=0;mt>26,this.words[mt]=xt&67108863;return this.negative=1,this.strip()},tt.prototype._wordDiv=function(bt,vt){var ct=this.length-bt.length,dt=this.clone(),mt=bt,xt=mt.words[mt.length-1]|0,At=this._countBits(xt);ct=26-At,ct!==0&&(mt=mt.ushln(ct),dt.iushln(ct),xt=mt.words[mt.length-1]|0);var Rt=dt.length-mt.length,St;if(vt!=="mod"){St=new tt(null),St.length=Rt+1,St.words=new Array(St.length);for(var Tt=0;Tt=0;Nt--){var tr=(dt.words[mt.length+Nt]|0)*67108864+(dt.words[mt.length+Nt-1]|0);for(tr=Math.min(tr/xt|0,67108863),dt._ishlnsubmul(mt,tr,Nt);dt.negative!==0;)tr--,dt.negative=0,dt._ishlnsubmul(mt,1,Nt),dt.isZero()||(dt.negative^=1);St&&(St.words[Nt]=tr)}return St&&St.strip(),dt.strip(),vt!=="div"&&ct!==0&&dt.iushrn(ct),{div:St||null,mod:dt}},tt.prototype.divmod=function(bt,vt,ct){if(j(!bt.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var dt,mt,xt;return this.negative!==0&&bt.negative===0?(xt=this.neg().divmod(bt,vt),vt!=="mod"&&(dt=xt.div.neg()),vt!=="div"&&(mt=xt.mod.neg(),ct&&mt.negative!==0&&mt.iadd(bt)),{div:dt,mod:mt}):this.negative===0&&bt.negative!==0?(xt=this.divmod(bt.neg(),vt),vt!=="mod"&&(dt=xt.div.neg()),{div:dt,mod:xt.mod}):this.negative&bt.negative?(xt=this.neg().divmod(bt.neg(),vt),vt!=="div"&&(mt=xt.mod.neg(),ct&&mt.negative!==0&&mt.isub(bt)),{div:xt.div,mod:mt}):bt.length>this.length||this.cmp(bt)<0?{div:new tt(0),mod:this}:bt.length===1?vt==="div"?{div:this.divn(bt.words[0]),mod:null}:vt==="mod"?{div:null,mod:new tt(this.modn(bt.words[0]))}:{div:this.divn(bt.words[0]),mod:new tt(this.modn(bt.words[0]))}:this._wordDiv(bt,vt)},tt.prototype.div=function(bt){return this.divmod(bt,"div",!1).div},tt.prototype.mod=function(bt){return this.divmod(bt,"mod",!1).mod},tt.prototype.umod=function(bt){return this.divmod(bt,"mod",!0).mod},tt.prototype.divRound=function(bt){var vt=this.divmod(bt);if(vt.mod.isZero())return vt.div;var ct=vt.div.negative!==0?vt.mod.isub(bt):vt.mod,dt=bt.ushrn(1),mt=bt.andln(1),xt=ct.cmp(dt);return xt<0||mt===1&&xt===0?vt.div:vt.div.negative!==0?vt.div.isubn(1):vt.div.iaddn(1)},tt.prototype.modn=function(bt){j(bt<=67108863);for(var vt=(1<<26)%bt,ct=0,dt=this.length-1;dt>=0;dt--)ct=(vt*ct+(this.words[dt]|0))%bt;return ct},tt.prototype.idivn=function(bt){j(bt<=67108863);for(var vt=0,ct=this.length-1;ct>=0;ct--){var dt=(this.words[ct]|0)+vt*67108864;this.words[ct]=dt/bt|0,vt=dt%bt}return this.strip()},tt.prototype.divn=function(bt){return this.clone().idivn(bt)},tt.prototype.egcd=function(bt){j(bt.negative===0),j(!bt.isZero());var vt=this,ct=bt.clone();vt.negative!==0?vt=vt.umod(bt):vt=vt.clone();for(var dt=new tt(1),mt=new tt(0),xt=new tt(0),At=new tt(1),Rt=0;vt.isEven()&&ct.isEven();)vt.iushrn(1),ct.iushrn(1),++Rt;for(var St=ct.clone(),Tt=vt.clone();!vt.isZero();){for(var Et=0,Nt=1;!(vt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(vt.iushrn(Et);Et-- >0;)(dt.isOdd()||mt.isOdd())&&(dt.iadd(St),mt.isub(Tt)),dt.iushrn(1),mt.iushrn(1);for(var tr=0,ir=1;!(ct.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(ct.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(St),At.isub(Tt)),xt.iushrn(1),At.iushrn(1);vt.cmp(ct)>=0?(vt.isub(ct),dt.isub(xt),mt.isub(At)):(ct.isub(vt),xt.isub(dt),At.isub(mt))}return{a:xt,b:At,gcd:ct.iushln(Rt)}},tt.prototype._invmp=function(bt){j(bt.negative===0),j(!bt.isZero());var vt=this,ct=bt.clone();vt.negative!==0?vt=vt.umod(bt):vt=vt.clone();for(var dt=new tt(1),mt=new tt(0),xt=ct.clone();vt.cmpn(1)>0&&ct.cmpn(1)>0;){for(var At=0,Rt=1;!(vt.words[0]&Rt)&&At<26;++At,Rt<<=1);if(At>0)for(vt.iushrn(At);At-- >0;)dt.isOdd()&&dt.iadd(xt),dt.iushrn(1);for(var St=0,Tt=1;!(ct.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(ct.iushrn(St);St-- >0;)mt.isOdd()&&mt.iadd(xt),mt.iushrn(1);vt.cmp(ct)>=0?(vt.isub(ct),dt.isub(mt)):(ct.isub(vt),mt.isub(dt))}var Et;return vt.cmpn(1)===0?Et=dt:Et=mt,Et.cmpn(0)<0&&Et.iadd(bt),Et},tt.prototype.gcd=function(bt){if(this.isZero())return bt.abs();if(bt.isZero())return this.abs();var vt=this.clone(),ct=bt.clone();vt.negative=0,ct.negative=0;for(var dt=0;vt.isEven()&&ct.isEven();dt++)vt.iushrn(1),ct.iushrn(1);do{for(;vt.isEven();)vt.iushrn(1);for(;ct.isEven();)ct.iushrn(1);var mt=vt.cmp(ct);if(mt<0){var xt=vt;vt=ct,ct=xt}else if(mt===0||ct.cmpn(1)===0)break;vt.isub(ct)}while(!0);return ct.iushln(dt)},tt.prototype.invm=function(bt){return this.egcd(bt).a.umod(bt)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(bt){return this.words[0]&bt},tt.prototype.bincn=function(bt){j(typeof bt=="number");var vt=bt%26,ct=(bt-vt)/26,dt=1<>>26,At&=67108863,this.words[xt]=At}return mt!==0&&(this.words[xt]=mt,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(bt){var vt=bt<0;if(this.negative!==0&&!vt)return-1;if(this.negative===0&&vt)return 1;this.strip();var ct;if(this.length>1)ct=1;else{vt&&(bt=-bt),j(bt<=67108863,"Number is too big");var dt=this.words[0]|0;ct=dt===bt?0:dtbt.length)return 1;if(this.length=0;ct--){var dt=this.words[ct]|0,mt=bt.words[ct]|0;if(dt!==mt){dtmt&&(vt=1);break}}return vt},tt.prototype.gtn=function(bt){return this.cmpn(bt)===1},tt.prototype.gt=function(bt){return this.cmp(bt)===1},tt.prototype.gten=function(bt){return this.cmpn(bt)>=0},tt.prototype.gte=function(bt){return this.cmp(bt)>=0},tt.prototype.ltn=function(bt){return this.cmpn(bt)===-1},tt.prototype.lt=function(bt){return this.cmp(bt)===-1},tt.prototype.lten=function(bt){return this.cmpn(bt)<=0},tt.prototype.lte=function(bt){return this.cmp(bt)<=0},tt.prototype.eqn=function(bt){return this.cmpn(bt)===0},tt.prototype.eq=function(bt){return this.cmp(bt)===0},tt.red=function(bt){return new Lt(bt)},tt.prototype.toRed=function(bt){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),bt.convertTo(this)._forceRed(bt)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(bt){return this.red=bt,this},tt.prototype.forceRed=function(bt){return j(!this.red,"Already a number in reduction context"),this._forceRed(bt)},tt.prototype.redAdd=function(bt){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,bt)},tt.prototype.redIAdd=function(bt){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,bt)},tt.prototype.redSub=function(bt){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,bt)},tt.prototype.redISub=function(bt){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,bt)},tt.prototype.redShl=function(bt){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,bt)},tt.prototype.redMul=function(bt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,bt),this.red.mul(this,bt)},tt.prototype.redIMul=function(bt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,bt),this.red.imul(this,bt)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(bt){return j(this.red&&!bt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,bt)};var Mt={k256:null,p224:null,p192:null,p25519:null};function Bt(jt,bt){this.name=jt,this.p=new tt(bt,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var bt=new tt(null);return bt.words=new Array(Math.ceil(this.n/13)),bt},Bt.prototype.ireduce=function(bt){var vt=bt,ct;do this.split(vt,this.tmp),vt=this.imulK(vt),vt=vt.iadd(this.tmp),ct=vt.bitLength();while(ct>this.n);var dt=ct0?vt.isub(this.p):vt.strip!==void 0?vt.strip():vt._strip(),vt},Bt.prototype.split=function(bt,vt){bt.iushrn(this.n,0,vt)},Bt.prototype.imulK=function(bt){return bt.imul(this.k)};function Dt(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Dt,Bt),Dt.prototype.split=function(bt,vt){for(var ct=4194303,dt=Math.min(bt.length,9),mt=0;mt>>22,xt=At}xt>>>=22,bt.words[mt-10]=xt,xt===0&&bt.length>10?bt.length-=10:bt.length-=9},Dt.prototype.imulK=function(bt){bt.words[bt.length]=0,bt.words[bt.length+1]=0,bt.length+=2;for(var vt=0,ct=0;ct>>=26,bt.words[ct]=mt,vt=dt}return vt!==0&&(bt.words[bt.length++]=vt),bt},tt._prime=function(bt){if(Mt[bt])return Mt[bt];var vt;if(bt==="k256")vt=new Dt;else if(bt==="p224")vt=new zt;else if(bt==="p192")vt=new Ot;else if(bt==="p25519")vt=new It;else throw new Error("Unknown prime "+bt);return Mt[bt]=vt,vt};function Lt(jt){if(typeof jt=="string"){var bt=tt._prime(jt);this.m=bt.p,this.prime=bt}else j(jt.gtn(1),"modulus must be greater than 1"),this.m=jt,this.prime=null}Lt.prototype._verify1=function(bt){j(bt.negative===0,"red works only with positives"),j(bt.red,"red works only with red numbers")},Lt.prototype._verify2=function(bt,vt){j((bt.negative|vt.negative)===0,"red works only with positives"),j(bt.red&&bt.red===vt.red,"red works only with red numbers")},Lt.prototype.imod=function(bt){return this.prime?this.prime.ireduce(bt)._forceRed(this):bt.umod(this.m)._forceRed(this)},Lt.prototype.neg=function(bt){return bt.isZero()?bt.clone():this.m.sub(bt)._forceRed(this)},Lt.prototype.add=function(bt,vt){this._verify2(bt,vt);var ct=bt.add(vt);return ct.cmp(this.m)>=0&&ct.isub(this.m),ct._forceRed(this)},Lt.prototype.iadd=function(bt,vt){this._verify2(bt,vt);var ct=bt.iadd(vt);return ct.cmp(this.m)>=0&&ct.isub(this.m),ct},Lt.prototype.sub=function(bt,vt){this._verify2(bt,vt);var ct=bt.sub(vt);return ct.cmpn(0)<0&&ct.iadd(this.m),ct._forceRed(this)},Lt.prototype.isub=function(bt,vt){this._verify2(bt,vt);var ct=bt.isub(vt);return ct.cmpn(0)<0&&ct.iadd(this.m),ct},Lt.prototype.shl=function(bt,vt){return this._verify1(bt),this.imod(bt.ushln(vt))},Lt.prototype.imul=function(bt,vt){return this._verify2(bt,vt),this.imod(bt.imul(vt))},Lt.prototype.mul=function(bt,vt){return this._verify2(bt,vt),this.imod(bt.mul(vt))},Lt.prototype.isqr=function(bt){return this.imul(bt,bt.clone())},Lt.prototype.sqr=function(bt){return this.mul(bt,bt)},Lt.prototype.sqrt=function(bt){if(bt.isZero())return bt.clone();var vt=this.m.andln(3);if(j(vt%2===1),vt===3){var ct=this.m.add(new tt(1)).iushrn(2);return this.pow(bt,ct)}for(var dt=this.m.subn(1),mt=0;!dt.isZero()&&dt.andln(1)===0;)mt++,dt.iushrn(1);j(!dt.isZero());var xt=new tt(1).toRed(this),At=xt.redNeg(),Rt=this.m.subn(1).iushrn(1),St=this.m.bitLength();for(St=new tt(2*St*St).toRed(this);this.pow(St,Rt).cmp(At)!==0;)St.redIAdd(At);for(var Tt=this.pow(St,dt),Et=this.pow(bt,dt.addn(1).iushrn(1)),Nt=this.pow(bt,dt),tr=mt;Nt.cmp(xt)!==0;){for(var ir=Nt,nr=0;ir.cmp(xt)!==0;nr++)ir=ir.redSqr();j(nr=0;mt--){for(var Tt=vt.words[mt],Et=St-1;Et>=0;Et--){var Nt=Tt>>Et&1;if(xt!==dt[0]&&(xt=this.sqr(xt)),Nt===0&&At===0){Rt=0;continue}At<<=1,At|=Nt,Rt++,!(Rt!==ct&&(mt!==0||Et!==0))&&(xt=this.mul(xt,dt[At]),Rt=0,At=0)}St=26}return xt},Lt.prototype.convertTo=function(bt){var vt=bt.umod(this.m);return vt===bt?vt.clone():vt},Lt.prototype.convertFrom=function(bt){var vt=bt.clone();return vt.red=null,vt},tt.mont=function(bt){return new Ft(bt)};function Ft(jt){Lt.call(this,jt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(Ft,Lt),Ft.prototype.convertTo=function(bt){return this.imod(bt.ushln(this.shift))},Ft.prototype.convertFrom=function(bt){var vt=this.imod(bt.mul(this.rinv));return vt.red=null,vt},Ft.prototype.imul=function(bt,vt){if(bt.isZero()||vt.isZero())return bt.words[0]=0,bt.length=1,bt;var ct=bt.imul(vt),dt=ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mt=ct.isub(dt).iushrn(this.shift),xt=mt;return mt.cmp(this.m)>=0?xt=mt.isub(this.m):mt.cmpn(0)<0&&(xt=mt.iadd(this.m)),xt._forceRed(this)},Ft.prototype.mul=function(bt,vt){if(bt.isZero()||vt.isZero())return new tt(0)._forceRed(this);var ct=bt.mul(vt),dt=ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mt=ct.isub(dt).iushrn(this.shift),xt=mt;return mt.cmp(this.m)>=0?xt=mt.isub(this.m):mt.cmpn(0)<0&&(xt=mt.iadd(this.m)),xt._forceRed(this)},Ft.prototype.invm=function(bt){var vt=this.imod(bt._invmp(this.m).mul(this.r2));return vt._forceRed(this)}})(a,commonjsGlobal)}(bn$2)),bn$2.exports}var utils$v={};(function(a){var _=a;function $(tt,rt){if(Array.isArray(tt))return tt.slice();if(!tt)return[];var nt=[];if(typeof tt!="string"){for(var it=0;it>8,at=st&255;ot?nt.push(ot,at):nt.push(at)}return nt}_.toArray=$;function j(tt){return tt.length===1?"0"+tt:tt}_.zero2=j;function et(tt){for(var rt="",nt=0;nt(wt>>1)-1?Pt=(wt>>1)-$t:Pt=$t,Ct.isubn(Pt)):Pt=0,ht[yt]=Pt,Ct.iushrn(1)}return ht}_.getNAF=tt;function rt(ot,at){var ut=[[],[]];ot=ot.clone(),at=at.clone();for(var ht=0,yt=0,wt;ot.cmpn(-ht)>0||at.cmpn(-yt)>0;){var Ct=ot.andln(3)+ht&3,Pt=at.andln(3)+yt&3;Ct===3&&(Ct=-1),Pt===3&&(Pt=-1);var $t;Ct&1?(wt=ot.andln(7)+ht&7,(wt===3||wt===5)&&Pt===2?$t=-Ct:$t=Ct):$t=0,ut[0].push($t);var Mt;Pt&1?(wt=at.andln(7)+yt&7,(wt===3||wt===5)&&Ct===2?Mt=-Pt:Mt=Pt):Mt=0,ut[1].push(Mt),2*ht===$t+1&&(ht=1-ht),2*yt===Mt+1&&(yt=1-yt),ot.iushrn(1),at.iushrn(1)}return ut}_.getJSF=rt;function nt(ot,at,ut){var ht="_"+at;ot.prototype[at]=function(){return this[ht]!==void 0?this[ht]:this[ht]=ut.call(this)}}_.cachedProperty=nt;function it(ot){return typeof ot=="string"?_.toArray(ot,"hex"):ot}_.parseBytes=it;function st(ot){return new $(ot,"hex","le")}_.intFromLE=st}(utils$w)),utils$w}var curve$2={},base$5,hasRequiredBase$2;function requireBase$2(){if(hasRequiredBase$2)return base$5;hasRequiredBase$2=1;var a=requireBn$1(),_=requireUtils$1(),$=_.getNAF,j=_.getJSF,et=_.assert;function tt(nt,it){this.type=nt,this.p=new a(it.p,16),this.red=it.prime?a.red(it.prime):a.mont(this.p),this.zero=new a(0).toRed(this.red),this.one=new a(1).toRed(this.red),this.two=new a(2).toRed(this.red),this.n=it.n&&new a(it.n,16),this.g=it.g&&this.pointFromJSON(it.g,it.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var st=this.n&&this.p.div(this.n);!st||st.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$5=tt,tt.prototype.point=function(){throw new Error("Not implemented")},tt.prototype.validate=function(){throw new Error("Not implemented")},tt.prototype._fixedNafMul=function(it,st){et(it.precomputed);var ot=it._getDoubles(),at=$(st,1,this._bitLength),ut=(1<=yt;Ct--)wt=(wt<<1)+at[Ct];ht.push(wt)}for(var Pt=this.jpoint(null,null,null),$t=this.jpoint(null,null,null),Mt=ut;Mt>0;Mt--){for(yt=0;yt=0;wt--){for(var Ct=0;wt>=0&&ht[wt]===0;wt--)Ct++;if(wt>=0&&Ct++,yt=yt.dblp(Ct),wt<0)break;var Pt=ht[wt];et(Pt!==0),it.type==="affine"?Pt>0?yt=yt.mixedAdd(ut[Pt-1>>1]):yt=yt.mixedAdd(ut[-Pt-1>>1].neg()):Pt>0?yt=yt.add(ut[Pt-1>>1]):yt=yt.add(ut[-Pt-1>>1].neg())}return it.type==="affine"?yt.toP():yt},tt.prototype._wnafMulAdd=function(it,st,ot,at,ut){var ht=this._wnafT1,yt=this._wnafT2,wt=this._wnafT3,Ct=0,Pt,$t,Mt;for(Pt=0;Pt=1;Pt-=2){var Dt=Pt-1,zt=Pt;if(ht[Dt]!==1||ht[zt]!==1){wt[Dt]=$(ot[Dt],ht[Dt],this._bitLength),wt[zt]=$(ot[zt],ht[zt],this._bitLength),Ct=Math.max(wt[Dt].length,Ct),Ct=Math.max(wt[zt].length,Ct);continue}var Ot=[st[Dt],null,null,st[zt]];st[Dt].y.cmp(st[zt].y)===0?(Ot[1]=st[Dt].add(st[zt]),Ot[2]=st[Dt].toJ().mixedAdd(st[zt].neg())):st[Dt].y.cmp(st[zt].y.redNeg())===0?(Ot[1]=st[Dt].toJ().mixedAdd(st[zt]),Ot[2]=st[Dt].add(st[zt].neg())):(Ot[1]=st[Dt].toJ().mixedAdd(st[zt]),Ot[2]=st[Dt].toJ().mixedAdd(st[zt].neg()));var It=[-3,-1,-5,-7,0,7,5,1,3],Lt=j(ot[Dt],ot[zt]);for(Ct=Math.max(Lt[0].length,Ct),wt[Dt]=new Array(Ct),wt[zt]=new Array(Ct),$t=0;$t=0;Pt--){for(var ct=0;Pt>=0;){var dt=!0;for($t=0;$t=0&&ct++,bt=bt.dblp(ct),Pt<0)break;for($t=0;$t0?Mt=yt[$t][mt-1>>1]:mt<0&&(Mt=yt[$t][-mt-1>>1].neg()),Mt.type==="affine"?bt=bt.mixedAdd(Mt):bt=bt.add(Mt))}}for(Pt=0;Pt=Math.ceil((it.bitLength()+1)/st.step):!1},rt.prototype._getDoubles=function(it,st){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var ot=[this],at=this,ut=0;ut=0&&(Dt=Pt,zt=$t),Mt.negative&&(Mt=Mt.neg(),Bt=Bt.neg()),Dt.negative&&(Dt=Dt.neg(),zt=zt.neg()),[{a:Mt,b:Bt},{a:Dt,b:zt}]},tt.prototype._endoSplit=function(st){var ot=this.endo.basis,at=ot[0],ut=ot[1],ht=ut.b.mul(st).divRound(this.n),yt=at.b.neg().mul(st).divRound(this.n),wt=ht.mul(at.a),Ct=yt.mul(ut.a),Pt=ht.mul(at.b),$t=yt.mul(ut.b),Mt=st.sub(wt).sub(Ct),Bt=Pt.add($t).neg();return{k1:Mt,k2:Bt}},tt.prototype.pointFromX=function(st,ot){st=new _(st,16),st.red||(st=st.toRed(this.red));var at=st.redSqr().redMul(st).redIAdd(st.redMul(this.a)).redIAdd(this.b),ut=at.redSqrt();if(ut.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");var ht=ut.fromRed().isOdd();return(ot&&!ht||!ot&&ht)&&(ut=ut.redNeg()),this.point(st,ut)},tt.prototype.validate=function(st){if(st.inf)return!0;var ot=st.x,at=st.y,ut=this.a.redMul(ot),ht=ot.redSqr().redMul(ot).redIAdd(ut).redIAdd(this.b);return at.redSqr().redISub(ht).cmpn(0)===0},tt.prototype._endoWnafMulAdd=function(st,ot,at){for(var ut=this._endoWnafT1,ht=this._endoWnafT2,yt=0;yt":""},rt.prototype.isInfinity=function(){return this.inf},rt.prototype.add=function(st){if(this.inf)return st;if(st.inf)return this;if(this.eq(st))return this.dbl();if(this.neg().eq(st))return this.curve.point(null,null);if(this.x.cmp(st.x)===0)return this.curve.point(null,null);var ot=this.y.redSub(st.y);ot.cmpn(0)!==0&&(ot=ot.redMul(this.x.redSub(st.x).redInvm()));var at=ot.redSqr().redISub(this.x).redISub(st.x),ut=ot.redMul(this.x.redSub(at)).redISub(this.y);return this.curve.point(at,ut)},rt.prototype.dbl=function(){if(this.inf)return this;var st=this.y.redAdd(this.y);if(st.cmpn(0)===0)return this.curve.point(null,null);var ot=this.curve.a,at=this.x.redSqr(),ut=st.redInvm(),ht=at.redAdd(at).redIAdd(at).redIAdd(ot).redMul(ut),yt=ht.redSqr().redISub(this.x.redAdd(this.x)),wt=ht.redMul(this.x.redSub(yt)).redISub(this.y);return this.curve.point(yt,wt)},rt.prototype.getX=function(){return this.x.fromRed()},rt.prototype.getY=function(){return this.y.fromRed()},rt.prototype.mul=function(st){return st=new _(st,16),this.isInfinity()?this:this._hasDoubles(st)?this.curve._fixedNafMul(this,st):this.curve.endo?this.curve._endoWnafMulAdd([this],[st]):this.curve._wnafMul(this,st)},rt.prototype.mulAdd=function(st,ot,at){var ut=[this,ot],ht=[st,at];return this.curve.endo?this.curve._endoWnafMulAdd(ut,ht):this.curve._wnafMulAdd(1,ut,ht,2)},rt.prototype.jmulAdd=function(st,ot,at){var ut=[this,ot],ht=[st,at];return this.curve.endo?this.curve._endoWnafMulAdd(ut,ht,!0):this.curve._wnafMulAdd(1,ut,ht,2,!0)},rt.prototype.eq=function(st){return this===st||this.inf===st.inf&&(this.inf||this.x.cmp(st.x)===0&&this.y.cmp(st.y)===0)},rt.prototype.neg=function(st){if(this.inf)return this;var ot=this.curve.point(this.x,this.y.redNeg());if(st&&this.precomputed){var at=this.precomputed,ut=function(ht){return ht.neg()};ot.precomputed={naf:at.naf&&{wnd:at.naf.wnd,points:at.naf.points.map(ut)},doubles:at.doubles&&{step:at.doubles.step,points:at.doubles.points.map(ut)}}}return ot},rt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var st=this.curve.jpoint(this.x,this.y,this.curve.one);return st};function nt(it,st,ot,at){j.BasePoint.call(this,it,"jacobian"),st===null&&ot===null&&at===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new _(0)):(this.x=new _(st,16),this.y=new _(ot,16),this.z=new _(at,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return $(nt,j.BasePoint),tt.prototype.jpoint=function(st,ot,at){return new nt(this,st,ot,at)},nt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var st=this.z.redInvm(),ot=st.redSqr(),at=this.x.redMul(ot),ut=this.y.redMul(ot).redMul(st);return this.curve.point(at,ut)},nt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},nt.prototype.add=function(st){if(this.isInfinity())return st;if(st.isInfinity())return this;var ot=st.z.redSqr(),at=this.z.redSqr(),ut=this.x.redMul(ot),ht=st.x.redMul(at),yt=this.y.redMul(ot.redMul(st.z)),wt=st.y.redMul(at.redMul(this.z)),Ct=ut.redSub(ht),Pt=yt.redSub(wt);if(Ct.cmpn(0)===0)return Pt.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var $t=Ct.redSqr(),Mt=$t.redMul(Ct),Bt=ut.redMul($t),Dt=Pt.redSqr().redIAdd(Mt).redISub(Bt).redISub(Bt),zt=Pt.redMul(Bt.redISub(Dt)).redISub(yt.redMul(Mt)),Ot=this.z.redMul(st.z).redMul(Ct);return this.curve.jpoint(Dt,zt,Ot)},nt.prototype.mixedAdd=function(st){if(this.isInfinity())return st.toJ();if(st.isInfinity())return this;var ot=this.z.redSqr(),at=this.x,ut=st.x.redMul(ot),ht=this.y,yt=st.y.redMul(ot).redMul(this.z),wt=at.redSub(ut),Ct=ht.redSub(yt);if(wt.cmpn(0)===0)return Ct.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var Pt=wt.redSqr(),$t=Pt.redMul(wt),Mt=at.redMul(Pt),Bt=Ct.redSqr().redIAdd($t).redISub(Mt).redISub(Mt),Dt=Ct.redMul(Mt.redISub(Bt)).redISub(ht.redMul($t)),zt=this.z.redMul(wt);return this.curve.jpoint(Bt,Dt,zt)},nt.prototype.dblp=function(st){if(st===0)return this;if(this.isInfinity())return this;if(!st)return this.dbl();var ot;if(this.curve.zeroA||this.curve.threeA){var at=this;for(ot=0;ot=0)return!1;if(at.redIAdd(ht),this.x.cmp(at)===0)return!0}},nt.prototype.inspect=function(){return this.isInfinity()?"":""},nt.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short$2}var mont$2,hasRequiredMont$1;function requireMont$1(){if(hasRequiredMont$1)return mont$2;hasRequiredMont$1=1;var a=requireBn$1(),_=inherits_browserExports,$=requireBase$2(),j=requireUtils$1();function et(rt){$.call(this,"mont",rt),this.a=new a(rt.a,16).toRed(this.red),this.b=new a(rt.b,16).toRed(this.red),this.i4=new a(4).toRed(this.red).redInvm(),this.two=new a(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}_(et,$),mont$2=et,et.prototype.validate=function(nt){var it=nt.normalize().x,st=it.redSqr(),ot=st.redMul(it).redAdd(st.redMul(this.a)).redAdd(it),at=ot.redSqrt();return at.redSqr().cmp(ot)===0};function tt(rt,nt,it){$.BasePoint.call(this,rt,"projective"),nt===null&&it===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new a(nt,16),this.z=new a(it,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return _(tt,$.BasePoint),et.prototype.decodePoint=function(nt,it){return this.point(j.toArray(nt,it),1)},et.prototype.point=function(nt,it){return new tt(this,nt,it)},et.prototype.pointFromJSON=function(nt){return tt.fromJSON(this,nt)},tt.prototype.precompute=function(){},tt.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},tt.fromJSON=function(nt,it){return new tt(nt,it[0],it[1]||nt.one)},tt.prototype.inspect=function(){return this.isInfinity()?"":""},tt.prototype.isInfinity=function(){return this.z.cmpn(0)===0},tt.prototype.dbl=function(){var nt=this.x.redAdd(this.z),it=nt.redSqr(),st=this.x.redSub(this.z),ot=st.redSqr(),at=it.redSub(ot),ut=it.redMul(ot),ht=at.redMul(ot.redAdd(this.curve.a24.redMul(at)));return this.curve.point(ut,ht)},tt.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.diffAdd=function(nt,it){var st=this.x.redAdd(this.z),ot=this.x.redSub(this.z),at=nt.x.redAdd(nt.z),ut=nt.x.redSub(nt.z),ht=ut.redMul(st),yt=at.redMul(ot),wt=it.z.redMul(ht.redAdd(yt).redSqr()),Ct=it.x.redMul(ht.redISub(yt).redSqr());return this.curve.point(wt,Ct)},tt.prototype.mul=function(nt){for(var it=nt.clone(),st=this,ot=this.curve.point(null,null),at=this,ut=[];it.cmpn(0)!==0;it.iushrn(1))ut.push(it.andln(1));for(var ht=ut.length-1;ht>=0;ht--)ut[ht]===0?(st=st.diffAdd(ot,at),ot=ot.dbl()):(ot=st.diffAdd(ot,at),st=st.dbl());return ot},tt.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.eq=function(nt){return this.getX().cmp(nt.getX())===0},tt.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},tt.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont$2}var edwards$2,hasRequiredEdwards$1;function requireEdwards$1(){if(hasRequiredEdwards$1)return edwards$2;hasRequiredEdwards$1=1;var a=requireUtils$1(),_=requireBn$1(),$=inherits_browserExports,j=requireBase$2(),et=a.assert;function tt(nt){this.twisted=(nt.a|0)!==1,this.mOneA=this.twisted&&(nt.a|0)===-1,this.extended=this.mOneA,j.call(this,"edwards",nt),this.a=new _(nt.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _(nt.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _(nt.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),et(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(nt.c|0)===1}$(tt,j),edwards$2=tt,tt.prototype._mulA=function(it){return this.mOneA?it.redNeg():this.a.redMul(it)},tt.prototype._mulC=function(it){return this.oneC?it:this.c.redMul(it)},tt.prototype.jpoint=function(it,st,ot,at){return this.point(it,st,ot,at)},tt.prototype.pointFromX=function(it,st){it=new _(it,16),it.red||(it=it.toRed(this.red));var ot=it.redSqr(),at=this.c2.redSub(this.a.redMul(ot)),ut=this.one.redSub(this.c2.redMul(this.d).redMul(ot)),ht=at.redMul(ut.redInvm()),yt=ht.redSqrt();if(yt.redSqr().redSub(ht).cmp(this.zero)!==0)throw new Error("invalid point");var wt=yt.fromRed().isOdd();return(st&&!wt||!st&&wt)&&(yt=yt.redNeg()),this.point(it,yt)},tt.prototype.pointFromY=function(it,st){it=new _(it,16),it.red||(it=it.toRed(this.red));var ot=it.redSqr(),at=ot.redSub(this.c2),ut=ot.redMul(this.d).redMul(this.c2).redSub(this.a),ht=at.redMul(ut.redInvm());if(ht.cmp(this.zero)===0){if(st)throw new Error("invalid point");return this.point(this.zero,it)}var yt=ht.redSqrt();if(yt.redSqr().redSub(ht).cmp(this.zero)!==0)throw new Error("invalid point");return yt.fromRed().isOdd()!==st&&(yt=yt.redNeg()),this.point(yt,it)},tt.prototype.validate=function(it){if(it.isInfinity())return!0;it.normalize();var st=it.x.redSqr(),ot=it.y.redSqr(),at=st.redMul(this.a).redAdd(ot),ut=this.c2.redMul(this.one.redAdd(this.d.redMul(st).redMul(ot)));return at.cmp(ut)===0};function rt(nt,it,st,ot,at){j.BasePoint.call(this,nt,"projective"),it===null&&st===null&&ot===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new _(it,16),this.y=new _(st,16),this.z=ot?new _(ot,16):this.curve.one,this.t=at&&new _(at,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return $(rt,j.BasePoint),tt.prototype.pointFromJSON=function(it){return rt.fromJSON(this,it)},tt.prototype.point=function(it,st,ot,at){return new rt(this,it,st,ot,at)},rt.fromJSON=function(it,st){return new rt(it,st[0],st[1],st[2])},rt.prototype.inspect=function(){return this.isInfinity()?"":""},rt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},rt.prototype._extDbl=function(){var it=this.x.redSqr(),st=this.y.redSqr(),ot=this.z.redSqr();ot=ot.redIAdd(ot);var at=this.curve._mulA(it),ut=this.x.redAdd(this.y).redSqr().redISub(it).redISub(st),ht=at.redAdd(st),yt=ht.redSub(ot),wt=at.redSub(st),Ct=ut.redMul(yt),Pt=ht.redMul(wt),$t=ut.redMul(wt),Mt=yt.redMul(ht);return this.curve.point(Ct,Pt,Mt,$t)},rt.prototype._projDbl=function(){var it=this.x.redAdd(this.y).redSqr(),st=this.x.redSqr(),ot=this.y.redSqr(),at,ut,ht,yt,wt,Ct;if(this.curve.twisted){yt=this.curve._mulA(st);var Pt=yt.redAdd(ot);this.zOne?(at=it.redSub(st).redSub(ot).redMul(Pt.redSub(this.curve.two)),ut=Pt.redMul(yt.redSub(ot)),ht=Pt.redSqr().redSub(Pt).redSub(Pt)):(wt=this.z.redSqr(),Ct=Pt.redSub(wt).redISub(wt),at=it.redSub(st).redISub(ot).redMul(Ct),ut=Pt.redMul(yt.redSub(ot)),ht=Pt.redMul(Ct))}else yt=st.redAdd(ot),wt=this.curve._mulC(this.z).redSqr(),Ct=yt.redSub(wt).redSub(wt),at=this.curve._mulC(it.redISub(yt)).redMul(Ct),ut=this.curve._mulC(yt).redMul(st.redISub(ot)),ht=yt.redMul(Ct);return this.curve.point(at,ut,ht)},rt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},rt.prototype._extAdd=function(it){var st=this.y.redSub(this.x).redMul(it.y.redSub(it.x)),ot=this.y.redAdd(this.x).redMul(it.y.redAdd(it.x)),at=this.t.redMul(this.curve.dd).redMul(it.t),ut=this.z.redMul(it.z.redAdd(it.z)),ht=ot.redSub(st),yt=ut.redSub(at),wt=ut.redAdd(at),Ct=ot.redAdd(st),Pt=ht.redMul(yt),$t=wt.redMul(Ct),Mt=ht.redMul(Ct),Bt=yt.redMul(wt);return this.curve.point(Pt,$t,Bt,Mt)},rt.prototype._projAdd=function(it){var st=this.z.redMul(it.z),ot=st.redSqr(),at=this.x.redMul(it.x),ut=this.y.redMul(it.y),ht=this.curve.d.redMul(at).redMul(ut),yt=ot.redSub(ht),wt=ot.redAdd(ht),Ct=this.x.redAdd(this.y).redMul(it.x.redAdd(it.y)).redISub(at).redISub(ut),Pt=st.redMul(yt).redMul(Ct),$t,Mt;return this.curve.twisted?($t=st.redMul(wt).redMul(ut.redSub(this.curve._mulA(at))),Mt=yt.redMul(wt)):($t=st.redMul(wt).redMul(ut.redSub(at)),Mt=this.curve._mulC(yt).redMul(wt)),this.curve.point(Pt,$t,Mt)},rt.prototype.add=function(it){return this.isInfinity()?it:it.isInfinity()?this:this.curve.extended?this._extAdd(it):this._projAdd(it)},rt.prototype.mul=function(it){return this._hasDoubles(it)?this.curve._fixedNafMul(this,it):this.curve._wnafMul(this,it)},rt.prototype.mulAdd=function(it,st,ot){return this.curve._wnafMulAdd(1,[this,st],[it,ot],2,!1)},rt.prototype.jmulAdd=function(it,st,ot){return this.curve._wnafMulAdd(1,[this,st],[it,ot],2,!0)},rt.prototype.normalize=function(){if(this.zOne)return this;var it=this.z.redInvm();return this.x=this.x.redMul(it),this.y=this.y.redMul(it),this.t&&(this.t=this.t.redMul(it)),this.z=this.curve.one,this.zOne=!0,this},rt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},rt.prototype.getX=function(){return this.normalize(),this.x.fromRed()},rt.prototype.getY=function(){return this.normalize(),this.y.fromRed()},rt.prototype.eq=function(it){return this===it||this.getX().cmp(it.getX())===0&&this.getY().cmp(it.getY())===0},rt.prototype.eqXToP=function(it){var st=it.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(st)===0)return!0;for(var ot=it.clone(),at=this.curve.redN.redMul(this.z);;){if(ot.iadd(this.curve.n),ot.cmp(this.curve.p)>=0)return!1;if(st.redIAdd(at),this.x.cmp(st)===0)return!0}},rt.prototype.toP=rt.prototype.normalize,rt.prototype.mixedAdd=rt.prototype.add,edwards$2}var hasRequiredCurve$1;function requireCurve$1(){return hasRequiredCurve$1||(hasRequiredCurve$1=1,function(a){var _=a;_.base=requireBase$2(),_.short=requireShort$1(),_.mont=requireMont$1(),_.edwards=requireEdwards$1()}(curve$2)),curve$2}var curves$4={},hash$4={},utils$u={},assert$g=minimalisticAssert,inherits$5=inherits_browserExports;utils$u.inherits=inherits$5;function isSurrogatePair(a,_){return(a.charCodeAt(_)&64512)!==55296||_<0||_+1>=a.length?!1:(a.charCodeAt(_+1)&64512)===56320}function toArray$3(a,_){if(Array.isArray(a))return a.slice();if(!a)return[];var $=[];if(typeof a=="string")if(_){if(_==="hex")for(a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a),et=0;et>6|192,$[j++]=tt&63|128):isSurrogatePair(a,et)?(tt=65536+((tt&1023)<<10)+(a.charCodeAt(++et)&1023),$[j++]=tt>>18|240,$[j++]=tt>>12&63|128,$[j++]=tt>>6&63|128,$[j++]=tt&63|128):($[j++]=tt>>12|224,$[j++]=tt>>6&63|128,$[j++]=tt&63|128)}else for(et=0;et>>24|a>>>8&65280|a<<8&16711680|(a&255)<<24;return _>>>0}utils$u.htonl=htonl;function toHex32(a,_){for(var $="",j=0;j>>0}return tt}utils$u.join32=join32;function split32(a,_){for(var $=new Array(a.length*4),j=0,et=0;j>>24,$[et+1]=tt>>>16&255,$[et+2]=tt>>>8&255,$[et+3]=tt&255):($[et+3]=tt>>>24,$[et+2]=tt>>>16&255,$[et+1]=tt>>>8&255,$[et]=tt&255)}return $}utils$u.split32=split32;function rotr32$1(a,_){return a>>>_|a<<32-_}utils$u.rotr32=rotr32$1;function rotl32$2(a,_){return a<<_|a>>>32-_}utils$u.rotl32=rotl32$2;function sum32$3(a,_){return a+_>>>0}utils$u.sum32=sum32$3;function sum32_3$1(a,_,$){return a+_+$>>>0}utils$u.sum32_3=sum32_3$1;function sum32_4$2(a,_,$,j){return a+_+$+j>>>0}utils$u.sum32_4=sum32_4$2;function sum32_5$2(a,_,$,j,et){return a+_+$+j+et>>>0}utils$u.sum32_5=sum32_5$2;function sum64$1(a,_,$,j){var et=a[_],tt=a[_+1],rt=j+tt>>>0,nt=(rt>>0,a[_+1]=rt}utils$u.sum64=sum64$1;function sum64_hi$1(a,_,$,j){var et=_+j>>>0,tt=(et<_?1:0)+a+$;return tt>>>0}utils$u.sum64_hi=sum64_hi$1;function sum64_lo$1(a,_,$,j){var et=_+j;return et>>>0}utils$u.sum64_lo=sum64_lo$1;function sum64_4_hi$1(a,_,$,j,et,tt,rt,nt){var it=0,st=_;st=st+j>>>0,it+=st<_?1:0,st=st+tt>>>0,it+=st>>0,it+=st>>0}utils$u.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(a,_,$,j,et,tt,rt,nt){var it=_+j+tt+nt;return it>>>0}utils$u.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(a,_,$,j,et,tt,rt,nt,it,st){var ot=0,at=_;at=at+j>>>0,ot+=at<_?1:0,at=at+tt>>>0,ot+=at>>0,ot+=at>>0,ot+=at>>0}utils$u.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(a,_,$,j,et,tt,rt,nt,it,st){var ot=_+j+tt+nt+st;return ot>>>0}utils$u.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(a,_,$){var j=_<<32-$|a>>>$;return j>>>0}utils$u.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(a,_,$){var j=a<<32-$|_>>>$;return j>>>0}utils$u.rotr64_lo=rotr64_lo$1;function shr64_hi$1(a,_,$){return a>>>$}utils$u.shr64_hi=shr64_hi$1;function shr64_lo$1(a,_,$){var j=a<<32-$|_>>>$;return j>>>0}utils$u.shr64_lo=shr64_lo$1;var common$6={},utils$t=utils$u,assert$f=minimalisticAssert;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$6.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(_,$){if(_=utils$t.toArray(_,$),this.pending?this.pending=this.pending.concat(_):this.pending=_,this.pendingTotal+=_.length,this.pending.length>=this._delta8){_=this.pending;var j=_.length%this._delta8;this.pending=_.slice(_.length-j,_.length),this.pending.length===0&&(this.pending=null),_=utils$t.join32(_,0,_.length-j,this.endian);for(var et=0;et<_.length;et+=this._delta32)this._update(_,et,et+this._delta32)}return this};BlockHash$4.prototype.digest=function(_){return this.update(this._pad()),assert$f(this.pending===null),this._digest(_)};BlockHash$4.prototype._pad=function(){var _=this.pendingTotal,$=this._delta8,j=$-(_+this.padLength)%$,et=new Array(j+this.padLength);et[0]=128;for(var tt=1;tt>>24&255,et[tt++]=_>>>16&255,et[tt++]=_>>>8&255,et[tt++]=_&255}else for(et[tt++]=_&255,et[tt++]=_>>>8&255,et[tt++]=_>>>16&255,et[tt++]=_>>>24&255,et[tt++]=0,et[tt++]=0,et[tt++]=0,et[tt++]=0,rt=8;rt>>3}common$5.g0_256=g0_256$1;function g1_256$1(a){return rotr32(a,17)^rotr32(a,19)^a>>>10}common$5.g1_256=g1_256$1;var utils$r=utils$u,common$4=common$6,shaCommon$1=common$5,rotl32$1=utils$r.rotl32,sum32$2=utils$r.sum32,sum32_5$1=utils$r.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$4.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$r.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512;SHA1.outSize=160;SHA1.hmacStrength=80;SHA1.padLength=64;SHA1.prototype._update=function(_,$){for(var j=this.W,et=0;et<16;et++)j[et]=_[$+et];for(;etthis.blockSize&&(_=new this.Hash().update(_).digest()),assert$c(_.length<=this.blockSize);for(var $=_.length;$=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(_,$,j)}var hmacDrbg=HmacDRBG$1;HmacDRBG$1.prototype._init=function(_,$,j){var et=_.concat($).concat(j);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var tt=0;tt=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(_.concat(j||[])),this._reseed=1};HmacDRBG$1.prototype.generate=function(_,$,j,et){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof $!="string"&&(et=j,j=$,$=null),j&&(j=utils$k.toArray(j,et||"hex"),this._update(j));for(var tt=[];tt.length<_;)this.V=this._hmac().update(this.V).digest(),tt=tt.concat(this.V);var rt=tt.slice(0,_);return this._update(j),this._reseed++,utils$k.encode(rt,$)};var key$5,hasRequiredKey$3;function requireKey$3(){if(hasRequiredKey$3)return key$5;hasRequiredKey$3=1;var a=requireBn$1(),_=requireUtils$1(),$=_.assert;function j(et,tt){this.ec=et,this.priv=null,this.pub=null,tt.priv&&this._importPrivate(tt.priv,tt.privEnc),tt.pub&&this._importPublic(tt.pub,tt.pubEnc)}return key$5=j,j.fromPublic=function(tt,rt,nt){return rt instanceof j?rt:new j(tt,{pub:rt,pubEnc:nt})},j.fromPrivate=function(tt,rt,nt){return rt instanceof j?rt:new j(tt,{priv:rt,privEnc:nt})},j.prototype.validate=function(){var tt=this.getPublic();return tt.isInfinity()?{result:!1,reason:"Invalid public key"}:tt.validate()?tt.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},j.prototype.getPublic=function(tt,rt){return typeof tt=="string"&&(rt=tt,tt=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),rt?this.pub.encode(rt,tt):this.pub},j.prototype.getPrivate=function(tt){return tt==="hex"?this.priv.toString(16,2):this.priv},j.prototype._importPrivate=function(tt,rt){this.priv=new a(tt,rt||16),this.priv=this.priv.umod(this.ec.curve.n)},j.prototype._importPublic=function(tt,rt){if(tt.x||tt.y){this.ec.curve.type==="mont"?$(tt.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&$(tt.x&&tt.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(tt.x,tt.y);return}this.pub=this.ec.curve.decodePoint(tt,rt)},j.prototype.derive=function(tt){return tt.validate()||$(tt.validate(),"public point not validated"),tt.mul(this.priv).getX()},j.prototype.sign=function(tt,rt,nt){return this.ec.sign(tt,this,rt,nt)},j.prototype.verify=function(tt,rt){return this.ec.verify(tt,rt,this)},j.prototype.inspect=function(){return""},key$5}var signature$5,hasRequiredSignature$3;function requireSignature$3(){if(hasRequiredSignature$3)return signature$5;hasRequiredSignature$3=1;var a=requireBn$1(),_=requireUtils$1(),$=_.assert;function j(it,st){if(it instanceof j)return it;this._importDER(it,st)||($(it.r&&it.s,"Signature without r or s"),this.r=new a(it.r,16),this.s=new a(it.s,16),it.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=it.recoveryParam)}signature$5=j;function et(){this.place=0}function tt(it,st){var ot=it[st.place++];if(!(ot&128))return ot;var at=ot&15;if(at===0||at>4)return!1;for(var ut=0,ht=0,yt=st.place;ht>>=0;return ut<=127?!1:(st.place=yt,ut)}function rt(it){for(var st=0,ot=it.length-1;!it[st]&&!(it[st+1]&128)&&st>>3);for(it.push(ot|128);--ot;)it.push(st>>>(ot<<3)&255);it.push(st)}return j.prototype.toDER=function(st){var ot=this.r.toArray(),at=this.s.toArray();for(ot[0]&128&&(ot=[0].concat(ot)),at[0]&128&&(at=[0].concat(at)),ot=rt(ot),at=rt(at);!at[0]&&!(at[1]&128);)at=at.slice(1);var ut=[2];nt(ut,ot.length),ut=ut.concat(ot),ut.push(2),nt(ut,at.length);var ht=ut.concat(at),yt=[48];return nt(yt,ht.length),yt=yt.concat(ht),_.encode(yt,st)},signature$5}var ec$5,hasRequiredEc$1;function requireEc$1(){if(hasRequiredEc$1)return ec$5;hasRequiredEc$1=1;var a=requireBn$1(),_=hmacDrbg,$=requireUtils$1(),j=requireCurves$1(),et=requireBrorand(),tt=$.assert,rt=requireKey$3(),nt=requireSignature$3();function it(st){if(!(this instanceof it))return new it(st);typeof st=="string"&&(tt(Object.prototype.hasOwnProperty.call(j,st),"Unknown curve "+st),st=j[st]),st instanceof j.PresetCurve&&(st={curve:st}),this.curve=st.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=st.curve.g,this.g.precompute(st.curve.n.bitLength()+1),this.hash=st.hash||st.curve.hash}return ec$5=it,it.prototype.keyPair=function(ot){return new rt(this,ot)},it.prototype.keyFromPrivate=function(ot,at){return rt.fromPrivate(this,ot,at)},it.prototype.keyFromPublic=function(ot,at){return rt.fromPublic(this,ot,at)},it.prototype.genKeyPair=function(ot){ot||(ot={});for(var at=new _({hash:this.hash,pers:ot.pers,persEnc:ot.persEnc||"utf8",entropy:ot.entropy||et(this.hash.hmacStrength),entropyEnc:ot.entropy&&ot.entropyEnc||"utf8",nonce:this.n.toArray()}),ut=this.n.byteLength(),ht=this.n.sub(new a(2));;){var yt=new a(at.generate(ut));if(!(yt.cmp(ht)>0))return yt.iaddn(1),this.keyFromPrivate(yt)}},it.prototype._truncateToN=function(ot,at){var ut=ot.byteLength()*8-this.n.bitLength();return ut>0&&(ot=ot.ushrn(ut)),!at&&ot.cmp(this.n)>=0?ot.sub(this.n):ot},it.prototype.sign=function(ot,at,ut,ht){typeof ut=="object"&&(ht=ut,ut=null),ht||(ht={}),at=this.keyFromPrivate(at,ut),ot=this._truncateToN(new a(ot,16));for(var yt=this.n.byteLength(),wt=at.getPrivate().toArray("be",yt),Ct=ot.toArray("be",yt),Pt=new _({hash:this.hash,entropy:wt,nonce:Ct,pers:ht.pers,persEnc:ht.persEnc||"utf8"}),$t=this.n.sub(new a(1)),Mt=0;;Mt++){var Bt=ht.k?ht.k(Mt):new a(Pt.generate(this.n.byteLength()));if(Bt=this._truncateToN(Bt,!0),!(Bt.cmpn(1)<=0||Bt.cmp($t)>=0)){var Dt=this.g.mul(Bt);if(!Dt.isInfinity()){var zt=Dt.getX(),Ot=zt.umod(this.n);if(Ot.cmpn(0)!==0){var It=Bt.invm(this.n).mul(Ot.mul(at.getPrivate()).iadd(ot));if(It=It.umod(this.n),It.cmpn(0)!==0){var Lt=(Dt.getY().isOdd()?1:0)|(zt.cmp(Ot)!==0?2:0);return ht.canonical&&It.cmp(this.nh)>0&&(It=this.n.sub(It),Lt^=1),new nt({r:Ot,s:It,recoveryParam:Lt})}}}}}},it.prototype.verify=function(ot,at,ut,ht){ot=this._truncateToN(new a(ot,16)),ut=this.keyFromPublic(ut,ht),at=new nt(at,"hex");var yt=at.r,wt=at.s;if(yt.cmpn(1)<0||yt.cmp(this.n)>=0||wt.cmpn(1)<0||wt.cmp(this.n)>=0)return!1;var Ct=wt.invm(this.n),Pt=Ct.mul(ot).umod(this.n),$t=Ct.mul(yt).umod(this.n),Mt;return this.curve._maxwellTrick?(Mt=this.g.jmulAdd(Pt,ut.getPublic(),$t),Mt.isInfinity()?!1:Mt.eqXToP(yt)):(Mt=this.g.mulAdd(Pt,ut.getPublic(),$t),Mt.isInfinity()?!1:Mt.getX().umod(this.n).cmp(yt)===0)},it.prototype.recoverPubKey=function(st,ot,at,ut){tt((3&at)===at,"The recovery param is more than two bits"),ot=new nt(ot,ut);var ht=this.n,yt=new a(st),wt=ot.r,Ct=ot.s,Pt=at&1,$t=at>>1;if(wt.cmp(this.curve.p.umod(this.curve.n))>=0&&$t)throw new Error("Unable to find sencond key candinate");$t?wt=this.curve.pointFromX(wt.add(this.curve.n),Pt):wt=this.curve.pointFromX(wt,Pt);var Mt=ot.r.invm(ht),Bt=ht.sub(yt).mul(Mt).umod(ht),Dt=Ct.mul(Mt).umod(ht);return this.g.mulAdd(Bt,wt,Dt)},it.prototype.getKeyRecoveryParam=function(st,ot,at,ut){if(ot=new nt(ot,ut),ot.recoveryParam!==null)return ot.recoveryParam;for(var ht=0;ht<4;ht++){var yt;try{yt=this.recoverPubKey(st,ot,ht)}catch{continue}if(yt.eq(at))return ht}throw new Error("Unable to find valid recovery factor")},ec$5}var key$4,hasRequiredKey$2;function requireKey$2(){if(hasRequiredKey$2)return key$4;hasRequiredKey$2=1;var a=requireUtils$1(),_=a.assert,$=a.parseBytes,j=a.cachedProperty;function et(tt,rt){this.eddsa=tt,this._secret=$(rt.secret),tt.isPoint(rt.pub)?this._pub=rt.pub:this._pubBytes=$(rt.pub)}return et.fromPublic=function(rt,nt){return nt instanceof et?nt:new et(rt,{pub:nt})},et.fromSecret=function(rt,nt){return nt instanceof et?nt:new et(rt,{secret:nt})},et.prototype.secret=function(){return this._secret},j(et,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),j(et,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),j(et,"privBytes",function(){var rt=this.eddsa,nt=this.hash(),it=rt.encodingLength-1,st=nt.slice(0,rt.encodingLength);return st[0]&=248,st[it]&=127,st[it]|=64,st}),j(et,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),j(et,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),j(et,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),et.prototype.sign=function(rt){return _(this._secret,"KeyPair can only verify"),this.eddsa.sign(rt,this)},et.prototype.verify=function(rt,nt){return this.eddsa.verify(rt,nt,this)},et.prototype.getSecret=function(rt){return _(this._secret,"KeyPair is public only"),a.encode(this.secret(),rt)},et.prototype.getPublic=function(rt){return a.encode(this.pubBytes(),rt)},key$4=et,key$4}var signature$4,hasRequiredSignature$2;function requireSignature$2(){if(hasRequiredSignature$2)return signature$4;hasRequiredSignature$2=1;var a=requireBn$1(),_=requireUtils$1(),$=_.assert,j=_.cachedProperty,et=_.parseBytes;function tt(rt,nt){this.eddsa=rt,typeof nt!="object"&&(nt=et(nt)),Array.isArray(nt)&&(nt={R:nt.slice(0,rt.encodingLength),S:nt.slice(rt.encodingLength)}),$(nt.R&&nt.S,"Signature without R or S"),rt.isPoint(nt.R)&&(this._R=nt.R),nt.S instanceof a&&(this._S=nt.S),this._Rencoded=Array.isArray(nt.R)?nt.R:nt.Rencoded,this._Sencoded=Array.isArray(nt.S)?nt.S:nt.Sencoded}return j(tt,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),j(tt,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),j(tt,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),j(tt,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),tt.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},tt.prototype.toHex=function(){return _.encode(this.toBytes(),"hex").toUpperCase()},signature$4=tt,signature$4}var eddsa$2,hasRequiredEddsa$1;function requireEddsa$1(){if(hasRequiredEddsa$1)return eddsa$2;hasRequiredEddsa$1=1;var a=hash$4,_=requireCurves$1(),$=requireUtils$1(),j=$.assert,et=$.parseBytes,tt=requireKey$2(),rt=requireSignature$2();function nt(it){if(j(it==="ed25519","only tested with ed25519 so far"),!(this instanceof nt))return new nt(it);it=_[it].curve,this.curve=it,this.g=it.g,this.g.precompute(it.n.bitLength()+1),this.pointClass=it.point().constructor,this.encodingLength=Math.ceil(it.n.bitLength()/8),this.hash=a.sha512}return eddsa$2=nt,nt.prototype.sign=function(st,ot){st=et(st);var at=this.keyFromSecret(ot),ut=this.hashInt(at.messagePrefix(),st),ht=this.g.mul(ut),yt=this.encodePoint(ht),wt=this.hashInt(yt,at.pubBytes(),st).mul(at.priv()),Ct=ut.add(wt).umod(this.curve.n);return this.makeSignature({R:ht,S:Ct,Rencoded:yt})},nt.prototype.verify=function(st,ot,at){st=et(st),ot=this.makeSignature(ot);var ut=this.keyFromPublic(at),ht=this.hashInt(ot.Rencoded(),ut.pubBytes(),st),yt=this.g.mul(ot.S()),wt=ot.R().add(ut.pub().mul(ht));return wt.eq(yt)},nt.prototype.hashInt=function(){for(var st=this.hash(),ot=0;ot0?ct:dt},tt.min=function(ct,dt){return ct.cmp(dt)<0?ct:dt},tt.prototype._init=function(ct,dt,mt){if(typeof ct=="number")return this._initNumber(ct,dt,mt);if(typeof ct=="object")return this._initArray(ct,dt,mt);dt==="hex"&&(dt=16),j(dt===(dt|0)&&dt>=2&&dt<=36),ct=ct.toString().replace(/\s+/g,"");var xt=0;ct[0]==="-"&&(xt++,this.negative=1),xt=0;xt-=3)Rt=ct[xt]|ct[xt-1]<<8|ct[xt-2]<<16,this.words[At]|=Rt<>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);else if(mt==="le")for(xt=0,At=0;xt>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);return this._strip()};function nt(vt,ct){var dt=vt.charCodeAt(ct);if(dt>=48&&dt<=57)return dt-48;if(dt>=65&&dt<=70)return dt-55;if(dt>=97&&dt<=102)return dt-87;j(!1,"Invalid character in "+vt)}function it(vt,ct,dt){var mt=nt(vt,dt);return dt-1>=ct&&(mt|=nt(vt,dt-1)<<4),mt}tt.prototype._parseHex=function(ct,dt,mt){this.length=Math.ceil((ct.length-dt)/6),this.words=new Array(this.length);for(var xt=0;xt=dt;xt-=2)St=it(ct,dt,xt)<=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8;else{var Tt=ct.length-dt;for(xt=Tt%2===0?dt+1:dt;xt=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8}this._strip()};function st(vt,ct,dt,mt){for(var xt=0,At=0,Rt=Math.min(vt.length,dt),St=ct;St=49?At=Tt-49+10:Tt>=17?At=Tt-17+10:At=Tt,j(Tt>=0&&At1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=at}catch{tt.prototype.inspect=at}else tt.prototype.inspect=at;function at(){return(this.red?""}var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],yt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(ct,dt){ct=ct||10,dt=dt|0||1;var mt;if(ct===16||ct==="hex"){mt="";for(var xt=0,At=0,Rt=0;Rt>>24-xt&16777215,xt+=2,xt>=26&&(xt-=26,Rt--),At!==0||Rt!==this.length-1?mt=ut[6-Tt.length]+Tt+mt:mt=Tt+mt}for(At!==0&&(mt=At.toString(16)+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}if(ct===(ct|0)&&ct>=2&&ct<=36){var Et=ht[ct],Nt=yt[ct];mt="";var tr=this.clone();for(tr.negative=0;!tr.isZero();){var ir=tr.modrn(Nt).toString(ct);tr=tr.idivn(Nt),tr.isZero()?mt=ir+mt:mt=ut[Et-ir.length]+ir+mt}for(this.isZero()&&(mt="0"+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var ct=this.words[0];return this.length===2?ct+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ct+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ct:ct},tt.prototype.toJSON=function(){return this.toString(16,2)},rt&&(tt.prototype.toBuffer=function(ct,dt){return this.toArrayLike(rt,ct,dt)}),tt.prototype.toArray=function(ct,dt){return this.toArrayLike(Array,ct,dt)};var wt=function(ct,dt){return ct.allocUnsafe?ct.allocUnsafe(dt):new ct(dt)};tt.prototype.toArrayLike=function(ct,dt,mt){this._strip();var xt=this.byteLength(),At=mt||Math.max(1,xt);j(xt<=At,"byte array longer than desired length"),j(At>0,"Requested array length <= 0");var Rt=wt(ct,At),St=dt==="le"?"LE":"BE";return this["_toArrayLike"+St](Rt,xt),Rt},tt.prototype._toArrayLikeLE=function(ct,dt){for(var mt=0,xt=0,At=0,Rt=0;At>8&255),mt>16&255),Rt===6?(mt>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt=0&&(ct[mt--]=St>>8&255),mt>=0&&(ct[mt--]=St>>16&255),Rt===6?(mt>=0&&(ct[mt--]=St>>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt>=0)for(ct[mt--]=xt;mt>=0;)ct[mt--]=0},Math.clz32?tt.prototype._countBits=function(ct){return 32-Math.clz32(ct)}:tt.prototype._countBits=function(ct){var dt=ct,mt=0;return dt>=4096&&(mt+=13,dt>>>=13),dt>=64&&(mt+=7,dt>>>=7),dt>=8&&(mt+=4,dt>>>=4),dt>=2&&(mt+=2,dt>>>=2),mt+dt},tt.prototype._zeroBits=function(ct){if(ct===0)return 26;var dt=ct,mt=0;return dt&8191||(mt+=13,dt>>>=13),dt&127||(mt+=7,dt>>>=7),dt&15||(mt+=4,dt>>>=4),dt&3||(mt+=2,dt>>>=2),dt&1||mt++,mt},tt.prototype.bitLength=function(){var ct=this.words[this.length-1],dt=this._countBits(ct);return(this.length-1)*26+dt};function Ct(vt){for(var ct=new Array(vt.bitLength()),dt=0;dt>>xt&1}return ct}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ct=0,dt=0;dtct.length?this.clone().ior(ct):ct.clone().ior(this)},tt.prototype.uor=function(ct){return this.length>ct.length?this.clone().iuor(ct):ct.clone().iuor(this)},tt.prototype.iuand=function(ct){var dt;this.length>ct.length?dt=ct:dt=this;for(var mt=0;mtct.length?this.clone().iand(ct):ct.clone().iand(this)},tt.prototype.uand=function(ct){return this.length>ct.length?this.clone().iuand(ct):ct.clone().iuand(this)},tt.prototype.iuxor=function(ct){var dt,mt;this.length>ct.length?(dt=this,mt=ct):(dt=ct,mt=this);for(var xt=0;xtct.length?this.clone().ixor(ct):ct.clone().ixor(this)},tt.prototype.uxor=function(ct){return this.length>ct.length?this.clone().iuxor(ct):ct.clone().iuxor(this)},tt.prototype.inotn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=Math.ceil(ct/26)|0,mt=ct%26;this._expand(dt),mt>0&&dt--;for(var xt=0;xt0&&(this.words[xt]=~this.words[xt]&67108863>>26-mt),this._strip()},tt.prototype.notn=function(ct){return this.clone().inotn(ct)},tt.prototype.setn=function(ct,dt){j(typeof ct=="number"&&ct>=0);var mt=ct/26|0,xt=ct%26;return this._expand(mt+1),dt?this.words[mt]=this.words[mt]|1<ct.length?(mt=this,xt=ct):(mt=ct,xt=this);for(var At=0,Rt=0;Rt>>26;for(;At!==0&&Rt>>26;if(this.length=mt.length,At!==0)this.words[this.length]=At,this.length++;else if(mt!==this)for(;Rtct.length?this.clone().iadd(ct):ct.clone().iadd(this)},tt.prototype.isub=function(ct){if(ct.negative!==0){ct.negative=0;var dt=this.iadd(ct);return ct.negative=1,dt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ct),this.negative=1,this._normSign();var mt=this.cmp(ct);if(mt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var xt,At;mt>0?(xt=this,At=ct):(xt=ct,At=this);for(var Rt=0,St=0;St>26,this.words[St]=dt&67108863;for(;Rt!==0&&St>26,this.words[St]=dt&67108863;if(Rt===0&&St>>26,tr=Tt&67108863,ir=Math.min(Et,ct.length-1),nr=Math.max(0,Et-vt.length+1);nr<=ir;nr++){var Zt=Et-nr|0;xt=vt.words[Zt]|0,At=ct.words[nr]|0,Rt=xt*At+tr,Nt+=Rt/67108864|0,tr=Rt&67108863}dt.words[Et]=tr|0,Tt=Nt|0}return Tt!==0?dt.words[Et]=Tt|0:dt.length--,dt._strip()}var $t=function(ct,dt,mt){var xt=ct.words,At=dt.words,Rt=mt.words,St=0,Tt,Et,Nt,tr=xt[0]|0,ir=tr&8191,nr=tr>>>13,Zt=xt[1]|0,Kt=Zt&8191,Qt=Zt>>>13,Ht=xt[2]|0,qt=Ht&8191,Jt=Ht>>>13,ur=xt[3]|0,xr=ur&8191,pr=ur>>>13,Cr=xt[4]|0,Mr=Cr&8191,lr=Cr>>>13,fr=xt[5]|0,_r=fr&8191,Rr=fr>>>13,kr=xt[6]|0,Ar=kr&8191,Pr=kr>>>13,Or=xt[7]|0,Br=Or&8191,or=Or>>>13,Yt=xt[8]|0,er=Yt&8191,Gt=Yt>>>13,Vt=xt[9]|0,Wt=Vt&8191,ar=Vt>>>13,yr=At[0]|0,Er=yr&8191,Sr=yr>>>13,Wr=At[1]|0,Hr=Wr&8191,Fr=Wr>>>13,pn=At[2]|0,Jr=pn&8191,Qr=pn>>>13,mn=At[3]|0,ln=mn&8191,qr=mn>>>13,En=At[4]|0,un=En&8191,Vr=En>>>13,hn=At[5]|0,fn=hn&8191,Kr=hn>>>13,Rn=At[6]|0,dn=Rn&8191,Gr=Rn>>>13,gn=At[7]|0,an=gn&8191,Zr=gn>>>13,An=At[8]|0,Sn=An&8191,nn=An>>>13,Pn=At[9]|0,yn=Pn&8191,_n=Pn>>>13;mt.negative=ct.negative^dt.negative,mt.length=19,Tt=Math.imul(ir,Er),Et=Math.imul(ir,Sr),Et=Et+Math.imul(nr,Er)|0,Nt=Math.imul(nr,Sr);var ds=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ds>>>26)|0,ds&=67108863,Tt=Math.imul(Kt,Er),Et=Math.imul(Kt,Sr),Et=Et+Math.imul(Qt,Er)|0,Nt=Math.imul(Qt,Sr),Tt=Tt+Math.imul(ir,Hr)|0,Et=Et+Math.imul(ir,Fr)|0,Et=Et+Math.imul(nr,Hr)|0,Nt=Nt+Math.imul(nr,Fr)|0;var fs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(fs>>>26)|0,fs&=67108863,Tt=Math.imul(qt,Er),Et=Math.imul(qt,Sr),Et=Et+Math.imul(Jt,Er)|0,Nt=Math.imul(Jt,Sr),Tt=Tt+Math.imul(Kt,Hr)|0,Et=Et+Math.imul(Kt,Fr)|0,Et=Et+Math.imul(Qt,Hr)|0,Nt=Nt+Math.imul(Qt,Fr)|0,Tt=Tt+Math.imul(ir,Jr)|0,Et=Et+Math.imul(ir,Qr)|0,Et=Et+Math.imul(nr,Jr)|0,Nt=Nt+Math.imul(nr,Qr)|0;var hs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(hs>>>26)|0,hs&=67108863,Tt=Math.imul(xr,Er),Et=Math.imul(xr,Sr),Et=Et+Math.imul(pr,Er)|0,Nt=Math.imul(pr,Sr),Tt=Tt+Math.imul(qt,Hr)|0,Et=Et+Math.imul(qt,Fr)|0,Et=Et+Math.imul(Jt,Hr)|0,Nt=Nt+Math.imul(Jt,Fr)|0,Tt=Tt+Math.imul(Kt,Jr)|0,Et=Et+Math.imul(Kt,Qr)|0,Et=Et+Math.imul(Qt,Jr)|0,Nt=Nt+Math.imul(Qt,Qr)|0,Tt=Tt+Math.imul(ir,ln)|0,Et=Et+Math.imul(ir,qr)|0,Et=Et+Math.imul(nr,ln)|0,Nt=Nt+Math.imul(nr,qr)|0;var ps=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ps>>>26)|0,ps&=67108863,Tt=Math.imul(Mr,Er),Et=Math.imul(Mr,Sr),Et=Et+Math.imul(lr,Er)|0,Nt=Math.imul(lr,Sr),Tt=Tt+Math.imul(xr,Hr)|0,Et=Et+Math.imul(xr,Fr)|0,Et=Et+Math.imul(pr,Hr)|0,Nt=Nt+Math.imul(pr,Fr)|0,Tt=Tt+Math.imul(qt,Jr)|0,Et=Et+Math.imul(qt,Qr)|0,Et=Et+Math.imul(Jt,Jr)|0,Nt=Nt+Math.imul(Jt,Qr)|0,Tt=Tt+Math.imul(Kt,ln)|0,Et=Et+Math.imul(Kt,qr)|0,Et=Et+Math.imul(Qt,ln)|0,Nt=Nt+Math.imul(Qt,qr)|0,Tt=Tt+Math.imul(ir,un)|0,Et=Et+Math.imul(ir,Vr)|0,Et=Et+Math.imul(nr,un)|0,Nt=Nt+Math.imul(nr,Vr)|0;var Vn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Tt=Math.imul(_r,Er),Et=Math.imul(_r,Sr),Et=Et+Math.imul(Rr,Er)|0,Nt=Math.imul(Rr,Sr),Tt=Tt+Math.imul(Mr,Hr)|0,Et=Et+Math.imul(Mr,Fr)|0,Et=Et+Math.imul(lr,Hr)|0,Nt=Nt+Math.imul(lr,Fr)|0,Tt=Tt+Math.imul(xr,Jr)|0,Et=Et+Math.imul(xr,Qr)|0,Et=Et+Math.imul(pr,Jr)|0,Nt=Nt+Math.imul(pr,Qr)|0,Tt=Tt+Math.imul(qt,ln)|0,Et=Et+Math.imul(qt,qr)|0,Et=Et+Math.imul(Jt,ln)|0,Nt=Nt+Math.imul(Jt,qr)|0,Tt=Tt+Math.imul(Kt,un)|0,Et=Et+Math.imul(Kt,Vr)|0,Et=Et+Math.imul(Qt,un)|0,Nt=Nt+Math.imul(Qt,Vr)|0,Tt=Tt+Math.imul(ir,fn)|0,Et=Et+Math.imul(ir,Kr)|0,Et=Et+Math.imul(nr,fn)|0,Nt=Nt+Math.imul(nr,Kr)|0;var ss=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ss>>>26)|0,ss&=67108863,Tt=Math.imul(Ar,Er),Et=Math.imul(Ar,Sr),Et=Et+Math.imul(Pr,Er)|0,Nt=Math.imul(Pr,Sr),Tt=Tt+Math.imul(_r,Hr)|0,Et=Et+Math.imul(_r,Fr)|0,Et=Et+Math.imul(Rr,Hr)|0,Nt=Nt+Math.imul(Rr,Fr)|0,Tt=Tt+Math.imul(Mr,Jr)|0,Et=Et+Math.imul(Mr,Qr)|0,Et=Et+Math.imul(lr,Jr)|0,Nt=Nt+Math.imul(lr,Qr)|0,Tt=Tt+Math.imul(xr,ln)|0,Et=Et+Math.imul(xr,qr)|0,Et=Et+Math.imul(pr,ln)|0,Nt=Nt+Math.imul(pr,qr)|0,Tt=Tt+Math.imul(qt,un)|0,Et=Et+Math.imul(qt,Vr)|0,Et=Et+Math.imul(Jt,un)|0,Nt=Nt+Math.imul(Jt,Vr)|0,Tt=Tt+Math.imul(Kt,fn)|0,Et=Et+Math.imul(Kt,Kr)|0,Et=Et+Math.imul(Qt,fn)|0,Nt=Nt+Math.imul(Qt,Kr)|0,Tt=Tt+Math.imul(ir,dn)|0,Et=Et+Math.imul(ir,Gr)|0,Et=Et+Math.imul(nr,dn)|0,Nt=Nt+Math.imul(nr,Gr)|0;var Jn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Tt=Math.imul(Br,Er),Et=Math.imul(Br,Sr),Et=Et+Math.imul(or,Er)|0,Nt=Math.imul(or,Sr),Tt=Tt+Math.imul(Ar,Hr)|0,Et=Et+Math.imul(Ar,Fr)|0,Et=Et+Math.imul(Pr,Hr)|0,Nt=Nt+Math.imul(Pr,Fr)|0,Tt=Tt+Math.imul(_r,Jr)|0,Et=Et+Math.imul(_r,Qr)|0,Et=Et+Math.imul(Rr,Jr)|0,Nt=Nt+Math.imul(Rr,Qr)|0,Tt=Tt+Math.imul(Mr,ln)|0,Et=Et+Math.imul(Mr,qr)|0,Et=Et+Math.imul(lr,ln)|0,Nt=Nt+Math.imul(lr,qr)|0,Tt=Tt+Math.imul(xr,un)|0,Et=Et+Math.imul(xr,Vr)|0,Et=Et+Math.imul(pr,un)|0,Nt=Nt+Math.imul(pr,Vr)|0,Tt=Tt+Math.imul(qt,fn)|0,Et=Et+Math.imul(qt,Kr)|0,Et=Et+Math.imul(Jt,fn)|0,Nt=Nt+Math.imul(Jt,Kr)|0,Tt=Tt+Math.imul(Kt,dn)|0,Et=Et+Math.imul(Kt,Gr)|0,Et=Et+Math.imul(Qt,dn)|0,Nt=Nt+Math.imul(Qt,Gr)|0,Tt=Tt+Math.imul(ir,an)|0,Et=Et+Math.imul(ir,Zr)|0,Et=Et+Math.imul(nr,an)|0,Nt=Nt+Math.imul(nr,Zr)|0;var Yn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Tt=Math.imul(er,Er),Et=Math.imul(er,Sr),Et=Et+Math.imul(Gt,Er)|0,Nt=Math.imul(Gt,Sr),Tt=Tt+Math.imul(Br,Hr)|0,Et=Et+Math.imul(Br,Fr)|0,Et=Et+Math.imul(or,Hr)|0,Nt=Nt+Math.imul(or,Fr)|0,Tt=Tt+Math.imul(Ar,Jr)|0,Et=Et+Math.imul(Ar,Qr)|0,Et=Et+Math.imul(Pr,Jr)|0,Nt=Nt+Math.imul(Pr,Qr)|0,Tt=Tt+Math.imul(_r,ln)|0,Et=Et+Math.imul(_r,qr)|0,Et=Et+Math.imul(Rr,ln)|0,Nt=Nt+Math.imul(Rr,qr)|0,Tt=Tt+Math.imul(Mr,un)|0,Et=Et+Math.imul(Mr,Vr)|0,Et=Et+Math.imul(lr,un)|0,Nt=Nt+Math.imul(lr,Vr)|0,Tt=Tt+Math.imul(xr,fn)|0,Et=Et+Math.imul(xr,Kr)|0,Et=Et+Math.imul(pr,fn)|0,Nt=Nt+Math.imul(pr,Kr)|0,Tt=Tt+Math.imul(qt,dn)|0,Et=Et+Math.imul(qt,Gr)|0,Et=Et+Math.imul(Jt,dn)|0,Nt=Nt+Math.imul(Jt,Gr)|0,Tt=Tt+Math.imul(Kt,an)|0,Et=Et+Math.imul(Kt,Zr)|0,Et=Et+Math.imul(Qt,an)|0,Nt=Nt+Math.imul(Qt,Zr)|0,Tt=Tt+Math.imul(ir,Sn)|0,Et=Et+Math.imul(ir,nn)|0,Et=Et+Math.imul(nr,Sn)|0,Nt=Nt+Math.imul(nr,nn)|0;var ms=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ms>>>26)|0,ms&=67108863,Tt=Math.imul(Wt,Er),Et=Math.imul(Wt,Sr),Et=Et+Math.imul(ar,Er)|0,Nt=Math.imul(ar,Sr),Tt=Tt+Math.imul(er,Hr)|0,Et=Et+Math.imul(er,Fr)|0,Et=Et+Math.imul(Gt,Hr)|0,Nt=Nt+Math.imul(Gt,Fr)|0,Tt=Tt+Math.imul(Br,Jr)|0,Et=Et+Math.imul(Br,Qr)|0,Et=Et+Math.imul(or,Jr)|0,Nt=Nt+Math.imul(or,Qr)|0,Tt=Tt+Math.imul(Ar,ln)|0,Et=Et+Math.imul(Ar,qr)|0,Et=Et+Math.imul(Pr,ln)|0,Nt=Nt+Math.imul(Pr,qr)|0,Tt=Tt+Math.imul(_r,un)|0,Et=Et+Math.imul(_r,Vr)|0,Et=Et+Math.imul(Rr,un)|0,Nt=Nt+Math.imul(Rr,Vr)|0,Tt=Tt+Math.imul(Mr,fn)|0,Et=Et+Math.imul(Mr,Kr)|0,Et=Et+Math.imul(lr,fn)|0,Nt=Nt+Math.imul(lr,Kr)|0,Tt=Tt+Math.imul(xr,dn)|0,Et=Et+Math.imul(xr,Gr)|0,Et=Et+Math.imul(pr,dn)|0,Nt=Nt+Math.imul(pr,Gr)|0,Tt=Tt+Math.imul(qt,an)|0,Et=Et+Math.imul(qt,Zr)|0,Et=Et+Math.imul(Jt,an)|0,Nt=Nt+Math.imul(Jt,Zr)|0,Tt=Tt+Math.imul(Kt,Sn)|0,Et=Et+Math.imul(Kt,nn)|0,Et=Et+Math.imul(Qt,Sn)|0,Nt=Nt+Math.imul(Qt,nn)|0,Tt=Tt+Math.imul(ir,yn)|0,Et=Et+Math.imul(ir,_n)|0,Et=Et+Math.imul(nr,yn)|0,Nt=Nt+Math.imul(nr,_n)|0;var Qn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Tt=Math.imul(Wt,Hr),Et=Math.imul(Wt,Fr),Et=Et+Math.imul(ar,Hr)|0,Nt=Math.imul(ar,Fr),Tt=Tt+Math.imul(er,Jr)|0,Et=Et+Math.imul(er,Qr)|0,Et=Et+Math.imul(Gt,Jr)|0,Nt=Nt+Math.imul(Gt,Qr)|0,Tt=Tt+Math.imul(Br,ln)|0,Et=Et+Math.imul(Br,qr)|0,Et=Et+Math.imul(or,ln)|0,Nt=Nt+Math.imul(or,qr)|0,Tt=Tt+Math.imul(Ar,un)|0,Et=Et+Math.imul(Ar,Vr)|0,Et=Et+Math.imul(Pr,un)|0,Nt=Nt+Math.imul(Pr,Vr)|0,Tt=Tt+Math.imul(_r,fn)|0,Et=Et+Math.imul(_r,Kr)|0,Et=Et+Math.imul(Rr,fn)|0,Nt=Nt+Math.imul(Rr,Kr)|0,Tt=Tt+Math.imul(Mr,dn)|0,Et=Et+Math.imul(Mr,Gr)|0,Et=Et+Math.imul(lr,dn)|0,Nt=Nt+Math.imul(lr,Gr)|0,Tt=Tt+Math.imul(xr,an)|0,Et=Et+Math.imul(xr,Zr)|0,Et=Et+Math.imul(pr,an)|0,Nt=Nt+Math.imul(pr,Zr)|0,Tt=Tt+Math.imul(qt,Sn)|0,Et=Et+Math.imul(qt,nn)|0,Et=Et+Math.imul(Jt,Sn)|0,Nt=Nt+Math.imul(Jt,nn)|0,Tt=Tt+Math.imul(Kt,yn)|0,Et=Et+Math.imul(Kt,_n)|0,Et=Et+Math.imul(Qt,yn)|0,Nt=Nt+Math.imul(Qt,_n)|0;var es=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(es>>>26)|0,es&=67108863,Tt=Math.imul(Wt,Jr),Et=Math.imul(Wt,Qr),Et=Et+Math.imul(ar,Jr)|0,Nt=Math.imul(ar,Qr),Tt=Tt+Math.imul(er,ln)|0,Et=Et+Math.imul(er,qr)|0,Et=Et+Math.imul(Gt,ln)|0,Nt=Nt+Math.imul(Gt,qr)|0,Tt=Tt+Math.imul(Br,un)|0,Et=Et+Math.imul(Br,Vr)|0,Et=Et+Math.imul(or,un)|0,Nt=Nt+Math.imul(or,Vr)|0,Tt=Tt+Math.imul(Ar,fn)|0,Et=Et+Math.imul(Ar,Kr)|0,Et=Et+Math.imul(Pr,fn)|0,Nt=Nt+Math.imul(Pr,Kr)|0,Tt=Tt+Math.imul(_r,dn)|0,Et=Et+Math.imul(_r,Gr)|0,Et=Et+Math.imul(Rr,dn)|0,Nt=Nt+Math.imul(Rr,Gr)|0,Tt=Tt+Math.imul(Mr,an)|0,Et=Et+Math.imul(Mr,Zr)|0,Et=Et+Math.imul(lr,an)|0,Nt=Nt+Math.imul(lr,Zr)|0,Tt=Tt+Math.imul(xr,Sn)|0,Et=Et+Math.imul(xr,nn)|0,Et=Et+Math.imul(pr,Sn)|0,Nt=Nt+Math.imul(pr,nn)|0,Tt=Tt+Math.imul(qt,yn)|0,Et=Et+Math.imul(qt,_n)|0,Et=Et+Math.imul(Jt,yn)|0,Nt=Nt+Math.imul(Jt,_n)|0;var ls=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ls>>>26)|0,ls&=67108863,Tt=Math.imul(Wt,ln),Et=Math.imul(Wt,qr),Et=Et+Math.imul(ar,ln)|0,Nt=Math.imul(ar,qr),Tt=Tt+Math.imul(er,un)|0,Et=Et+Math.imul(er,Vr)|0,Et=Et+Math.imul(Gt,un)|0,Nt=Nt+Math.imul(Gt,Vr)|0,Tt=Tt+Math.imul(Br,fn)|0,Et=Et+Math.imul(Br,Kr)|0,Et=Et+Math.imul(or,fn)|0,Nt=Nt+Math.imul(or,Kr)|0,Tt=Tt+Math.imul(Ar,dn)|0,Et=Et+Math.imul(Ar,Gr)|0,Et=Et+Math.imul(Pr,dn)|0,Nt=Nt+Math.imul(Pr,Gr)|0,Tt=Tt+Math.imul(_r,an)|0,Et=Et+Math.imul(_r,Zr)|0,Et=Et+Math.imul(Rr,an)|0,Nt=Nt+Math.imul(Rr,Zr)|0,Tt=Tt+Math.imul(Mr,Sn)|0,Et=Et+Math.imul(Mr,nn)|0,Et=Et+Math.imul(lr,Sn)|0,Nt=Nt+Math.imul(lr,nn)|0,Tt=Tt+Math.imul(xr,yn)|0,Et=Et+Math.imul(xr,_n)|0,Et=Et+Math.imul(pr,yn)|0,Nt=Nt+Math.imul(pr,_n)|0;var us=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(us>>>26)|0,us&=67108863,Tt=Math.imul(Wt,un),Et=Math.imul(Wt,Vr),Et=Et+Math.imul(ar,un)|0,Nt=Math.imul(ar,Vr),Tt=Tt+Math.imul(er,fn)|0,Et=Et+Math.imul(er,Kr)|0,Et=Et+Math.imul(Gt,fn)|0,Nt=Nt+Math.imul(Gt,Kr)|0,Tt=Tt+Math.imul(Br,dn)|0,Et=Et+Math.imul(Br,Gr)|0,Et=Et+Math.imul(or,dn)|0,Nt=Nt+Math.imul(or,Gr)|0,Tt=Tt+Math.imul(Ar,an)|0,Et=Et+Math.imul(Ar,Zr)|0,Et=Et+Math.imul(Pr,an)|0,Nt=Nt+Math.imul(Pr,Zr)|0,Tt=Tt+Math.imul(_r,Sn)|0,Et=Et+Math.imul(_r,nn)|0,Et=Et+Math.imul(Rr,Sn)|0,Nt=Nt+Math.imul(Rr,nn)|0,Tt=Tt+Math.imul(Mr,yn)|0,Et=Et+Math.imul(Mr,_n)|0,Et=Et+Math.imul(lr,yn)|0,Nt=Nt+Math.imul(lr,_n)|0;var Wn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Tt=Math.imul(Wt,fn),Et=Math.imul(Wt,Kr),Et=Et+Math.imul(ar,fn)|0,Nt=Math.imul(ar,Kr),Tt=Tt+Math.imul(er,dn)|0,Et=Et+Math.imul(er,Gr)|0,Et=Et+Math.imul(Gt,dn)|0,Nt=Nt+Math.imul(Gt,Gr)|0,Tt=Tt+Math.imul(Br,an)|0,Et=Et+Math.imul(Br,Zr)|0,Et=Et+Math.imul(or,an)|0,Nt=Nt+Math.imul(or,Zr)|0,Tt=Tt+Math.imul(Ar,Sn)|0,Et=Et+Math.imul(Ar,nn)|0,Et=Et+Math.imul(Pr,Sn)|0,Nt=Nt+Math.imul(Pr,nn)|0,Tt=Tt+Math.imul(_r,yn)|0,Et=Et+Math.imul(_r,_n)|0,Et=Et+Math.imul(Rr,yn)|0,Nt=Nt+Math.imul(Rr,_n)|0;var as=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(as>>>26)|0,as&=67108863,Tt=Math.imul(Wt,dn),Et=Math.imul(Wt,Gr),Et=Et+Math.imul(ar,dn)|0,Nt=Math.imul(ar,Gr),Tt=Tt+Math.imul(er,an)|0,Et=Et+Math.imul(er,Zr)|0,Et=Et+Math.imul(Gt,an)|0,Nt=Nt+Math.imul(Gt,Zr)|0,Tt=Tt+Math.imul(Br,Sn)|0,Et=Et+Math.imul(Br,nn)|0,Et=Et+Math.imul(or,Sn)|0,Nt=Nt+Math.imul(or,nn)|0,Tt=Tt+Math.imul(Ar,yn)|0,Et=Et+Math.imul(Ar,_n)|0,Et=Et+Math.imul(Pr,yn)|0,Nt=Nt+Math.imul(Pr,_n)|0;var gs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(gs>>>26)|0,gs&=67108863,Tt=Math.imul(Wt,an),Et=Math.imul(Wt,Zr),Et=Et+Math.imul(ar,an)|0,Nt=Math.imul(ar,Zr),Tt=Tt+Math.imul(er,Sn)|0,Et=Et+Math.imul(er,nn)|0,Et=Et+Math.imul(Gt,Sn)|0,Nt=Nt+Math.imul(Gt,nn)|0,Tt=Tt+Math.imul(Br,yn)|0,Et=Et+Math.imul(Br,_n)|0,Et=Et+Math.imul(or,yn)|0,Nt=Nt+Math.imul(or,_n)|0;var vs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(vs>>>26)|0,vs&=67108863,Tt=Math.imul(Wt,Sn),Et=Math.imul(Wt,nn),Et=Et+Math.imul(ar,Sn)|0,Nt=Math.imul(ar,nn),Tt=Tt+Math.imul(er,yn)|0,Et=Et+Math.imul(er,_n)|0,Et=Et+Math.imul(Gt,yn)|0,Nt=Nt+Math.imul(Gt,_n)|0;var Ts=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Tt=Math.imul(Wt,yn),Et=Math.imul(Wt,_n),Et=Et+Math.imul(ar,yn)|0,Nt=Math.imul(ar,_n);var $s=(St+Tt|0)+((Et&8191)<<13)|0;return St=(Nt+(Et>>>13)|0)+($s>>>26)|0,$s&=67108863,Rt[0]=ds,Rt[1]=fs,Rt[2]=hs,Rt[3]=ps,Rt[4]=Vn,Rt[5]=ss,Rt[6]=Jn,Rt[7]=Yn,Rt[8]=ms,Rt[9]=Qn,Rt[10]=es,Rt[11]=ls,Rt[12]=us,Rt[13]=Wn,Rt[14]=as,Rt[15]=gs,Rt[16]=vs,Rt[17]=Ts,Rt[18]=$s,St!==0&&(Rt[19]=St,mt.length++),mt};Math.imul||($t=Pt);function Mt(vt,ct,dt){dt.negative=ct.negative^vt.negative,dt.length=vt.length+ct.length;for(var mt=0,xt=0,At=0;At>>26)|0,xt+=Rt>>>26,Rt&=67108863}dt.words[At]=St,mt=Rt,Rt=xt}return mt!==0?dt.words[At]=mt:dt.length--,dt._strip()}function Bt(vt,ct,dt){return Mt(vt,ct,dt)}tt.prototype.mulTo=function(ct,dt){var mt,xt=this.length+ct.length;return this.length===10&&ct.length===10?mt=$t(this,ct,dt):xt<63?mt=Pt(this,ct,dt):xt<1024?mt=Mt(this,ct,dt):mt=Bt(this,ct,dt),mt},tt.prototype.mul=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),this.mulTo(ct,dt)},tt.prototype.mulf=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),Bt(this,ct,dt)},tt.prototype.imul=function(ct){return this.clone().mulTo(ct,this)},tt.prototype.imuln=function(ct){var dt=ct<0;dt&&(ct=-ct),j(typeof ct=="number"),j(ct<67108864);for(var mt=0,xt=0;xt>=26,mt+=At/67108864|0,mt+=Rt>>>26,this.words[xt]=Rt&67108863}return mt!==0&&(this.words[xt]=mt,this.length++),dt?this.ineg():this},tt.prototype.muln=function(ct){return this.clone().imuln(ct)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(ct){var dt=Ct(ct);if(dt.length===0)return new tt(1);for(var mt=this,xt=0;xt=0);var dt=ct%26,mt=(ct-dt)/26,xt=67108863>>>26-dt<<26-dt,At;if(dt!==0){var Rt=0;for(At=0;At>>26-dt}Rt&&(this.words[At]=Rt,this.length++)}if(mt!==0){for(At=this.length-1;At>=0;At--)this.words[At+mt]=this.words[At];for(At=0;At=0);var xt;dt?xt=(dt-dt%26)/26:xt=0;var At=ct%26,Rt=Math.min((ct-At)/26,this.length),St=67108863^67108863>>>At<Rt)for(this.length-=Rt,Et=0;Et=0&&(Nt!==0||Et>=xt);Et--){var tr=this.words[Et]|0;this.words[Et]=Nt<<26-At|tr>>>At,Nt=tr&St}return Tt&&Nt!==0&&(Tt.words[Tt.length++]=Nt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},tt.prototype.ishrn=function(ct,dt,mt){return j(this.negative===0),this.iushrn(ct,dt,mt)},tt.prototype.shln=function(ct){return this.clone().ishln(ct)},tt.prototype.ushln=function(ct){return this.clone().iushln(ct)},tt.prototype.shrn=function(ct){return this.clone().ishrn(ct)},tt.prototype.ushrn=function(ct){return this.clone().iushrn(ct)},tt.prototype.testn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=ct%26,mt=(ct-dt)/26,xt=1<=0);var dt=ct%26,mt=(ct-dt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=mt)return this;if(dt!==0&&mt++,this.length=Math.min(mt,this.length),dt!==0){var xt=67108863^67108863>>>dt<=67108864;dt++)this.words[dt]-=67108864,dt===this.length-1?this.words[dt+1]=1:this.words[dt+1]++;return this.length=Math.max(this.length,dt+1),this},tt.prototype.isubn=function(ct){if(j(typeof ct=="number"),j(ct<67108864),ct<0)return this.iaddn(-ct);if(this.negative!==0)return this.negative=0,this.iaddn(ct),this.negative=1,this;if(this.words[0]-=ct,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var dt=0;dt>26)-(Tt/67108864|0),this.words[At+mt]=Rt&67108863}for(;At>26,this.words[At+mt]=Rt&67108863;if(St===0)return this._strip();for(j(St===-1),St=0,At=0;At>26,this.words[At]=Rt&67108863;return this.negative=1,this._strip()},tt.prototype._wordDiv=function(ct,dt){var mt=this.length-ct.length,xt=this.clone(),At=ct,Rt=At.words[At.length-1]|0,St=this._countBits(Rt);mt=26-St,mt!==0&&(At=At.ushln(mt),xt.iushln(mt),Rt=At.words[At.length-1]|0);var Tt=xt.length-At.length,Et;if(dt!=="mod"){Et=new tt(null),Et.length=Tt+1,Et.words=new Array(Et.length);for(var Nt=0;Nt=0;ir--){var nr=(xt.words[At.length+ir]|0)*67108864+(xt.words[At.length+ir-1]|0);for(nr=Math.min(nr/Rt|0,67108863),xt._ishlnsubmul(At,nr,ir);xt.negative!==0;)nr--,xt.negative=0,xt._ishlnsubmul(At,1,ir),xt.isZero()||(xt.negative^=1);Et&&(Et.words[ir]=nr)}return Et&&Et._strip(),xt._strip(),dt!=="div"&&mt!==0&&xt.iushrn(mt),{div:Et||null,mod:xt}},tt.prototype.divmod=function(ct,dt,mt){if(j(!ct.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var xt,At,Rt;return this.negative!==0&&ct.negative===0?(Rt=this.neg().divmod(ct,dt),dt!=="mod"&&(xt=Rt.div.neg()),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.iadd(ct)),{div:xt,mod:At}):this.negative===0&&ct.negative!==0?(Rt=this.divmod(ct.neg(),dt),dt!=="mod"&&(xt=Rt.div.neg()),{div:xt,mod:Rt.mod}):this.negative&ct.negative?(Rt=this.neg().divmod(ct.neg(),dt),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.isub(ct)),{div:Rt.div,mod:At}):ct.length>this.length||this.cmp(ct)<0?{div:new tt(0),mod:this}:ct.length===1?dt==="div"?{div:this.divn(ct.words[0]),mod:null}:dt==="mod"?{div:null,mod:new tt(this.modrn(ct.words[0]))}:{div:this.divn(ct.words[0]),mod:new tt(this.modrn(ct.words[0]))}:this._wordDiv(ct,dt)},tt.prototype.div=function(ct){return this.divmod(ct,"div",!1).div},tt.prototype.mod=function(ct){return this.divmod(ct,"mod",!1).mod},tt.prototype.umod=function(ct){return this.divmod(ct,"mod",!0).mod},tt.prototype.divRound=function(ct){var dt=this.divmod(ct);if(dt.mod.isZero())return dt.div;var mt=dt.div.negative!==0?dt.mod.isub(ct):dt.mod,xt=ct.ushrn(1),At=ct.andln(1),Rt=mt.cmp(xt);return Rt<0||At===1&&Rt===0?dt.div:dt.div.negative!==0?dt.div.isubn(1):dt.div.iaddn(1)},tt.prototype.modrn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=(1<<26)%ct,xt=0,At=this.length-1;At>=0;At--)xt=(mt*xt+(this.words[At]|0))%ct;return dt?-xt:xt},tt.prototype.modn=function(ct){return this.modrn(ct)},tt.prototype.idivn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=0,xt=this.length-1;xt>=0;xt--){var At=(this.words[xt]|0)+mt*67108864;this.words[xt]=At/ct|0,mt=At%ct}return this._strip(),dt?this.ineg():this},tt.prototype.divn=function(ct){return this.clone().idivn(ct)},tt.prototype.egcd=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=new tt(0),St=new tt(1),Tt=0;dt.isEven()&&mt.isEven();)dt.iushrn(1),mt.iushrn(1),++Tt;for(var Et=mt.clone(),Nt=dt.clone();!dt.isZero();){for(var tr=0,ir=1;!(dt.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(dt.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(Et),At.isub(Nt)),xt.iushrn(1),At.iushrn(1);for(var nr=0,Zt=1;!(mt.words[0]&Zt)&&nr<26;++nr,Zt<<=1);if(nr>0)for(mt.iushrn(nr);nr-- >0;)(Rt.isOdd()||St.isOdd())&&(Rt.iadd(Et),St.isub(Nt)),Rt.iushrn(1),St.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(Rt),At.isub(St)):(mt.isub(dt),Rt.isub(xt),St.isub(At))}return{a:Rt,b:St,gcd:mt.iushln(Tt)}},tt.prototype._invmp=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=mt.clone();dt.cmpn(1)>0&&mt.cmpn(1)>0;){for(var St=0,Tt=1;!(dt.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(dt.iushrn(St);St-- >0;)xt.isOdd()&&xt.iadd(Rt),xt.iushrn(1);for(var Et=0,Nt=1;!(mt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(mt.iushrn(Et);Et-- >0;)At.isOdd()&&At.iadd(Rt),At.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(At)):(mt.isub(dt),At.isub(xt))}var tr;return dt.cmpn(1)===0?tr=xt:tr=At,tr.cmpn(0)<0&&tr.iadd(ct),tr},tt.prototype.gcd=function(ct){if(this.isZero())return ct.abs();if(ct.isZero())return this.abs();var dt=this.clone(),mt=ct.clone();dt.negative=0,mt.negative=0;for(var xt=0;dt.isEven()&&mt.isEven();xt++)dt.iushrn(1),mt.iushrn(1);do{for(;dt.isEven();)dt.iushrn(1);for(;mt.isEven();)mt.iushrn(1);var At=dt.cmp(mt);if(At<0){var Rt=dt;dt=mt,mt=Rt}else if(At===0||mt.cmpn(1)===0)break;dt.isub(mt)}while(!0);return mt.iushln(xt)},tt.prototype.invm=function(ct){return this.egcd(ct).a.umod(ct)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(ct){return this.words[0]&ct},tt.prototype.bincn=function(ct){j(typeof ct=="number");var dt=ct%26,mt=(ct-dt)/26,xt=1<>>26,St&=67108863,this.words[Rt]=St}return At!==0&&(this.words[Rt]=At,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(ct){var dt=ct<0;if(this.negative!==0&&!dt)return-1;if(this.negative===0&&dt)return 1;this._strip();var mt;if(this.length>1)mt=1;else{dt&&(ct=-ct),j(ct<=67108863,"Number is too big");var xt=this.words[0]|0;mt=xt===ct?0:xtct.length)return 1;if(this.length=0;mt--){var xt=this.words[mt]|0,At=ct.words[mt]|0;if(xt!==At){xtAt&&(dt=1);break}}return dt},tt.prototype.gtn=function(ct){return this.cmpn(ct)===1},tt.prototype.gt=function(ct){return this.cmp(ct)===1},tt.prototype.gten=function(ct){return this.cmpn(ct)>=0},tt.prototype.gte=function(ct){return this.cmp(ct)>=0},tt.prototype.ltn=function(ct){return this.cmpn(ct)===-1},tt.prototype.lt=function(ct){return this.cmp(ct)===-1},tt.prototype.lten=function(ct){return this.cmpn(ct)<=0},tt.prototype.lte=function(ct){return this.cmp(ct)<=0},tt.prototype.eqn=function(ct){return this.cmpn(ct)===0},tt.prototype.eq=function(ct){return this.cmp(ct)===0},tt.red=function(ct){return new jt(ct)},tt.prototype.toRed=function(ct){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),ct.convertTo(this)._forceRed(ct)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(ct){return this.red=ct,this},tt.prototype.forceRed=function(ct){return j(!this.red,"Already a number in reduction context"),this._forceRed(ct)},tt.prototype.redAdd=function(ct){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,ct)},tt.prototype.redIAdd=function(ct){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ct)},tt.prototype.redSub=function(ct){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,ct)},tt.prototype.redISub=function(ct){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,ct)},tt.prototype.redShl=function(ct){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,ct)},tt.prototype.redMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.mul(this,ct)},tt.prototype.redIMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.imul(this,ct)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(ct){return j(this.red&&!ct.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ct)};var Dt={k256:null,p224:null,p192:null,p25519:null};function zt(vt,ct){this.name=vt,this.p=new tt(ct,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}zt.prototype._tmp=function(){var ct=new tt(null);return ct.words=new Array(Math.ceil(this.n/13)),ct},zt.prototype.ireduce=function(ct){var dt=ct,mt;do this.split(dt,this.tmp),dt=this.imulK(dt),dt=dt.iadd(this.tmp),mt=dt.bitLength();while(mt>this.n);var xt=mt0?dt.isub(this.p):dt.strip!==void 0?dt.strip():dt._strip(),dt},zt.prototype.split=function(ct,dt){ct.iushrn(this.n,0,dt)},zt.prototype.imulK=function(ct){return ct.imul(this.k)};function Ot(){zt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Ot,zt),Ot.prototype.split=function(ct,dt){for(var mt=4194303,xt=Math.min(ct.length,9),At=0;At>>22,Rt=St}Rt>>>=22,ct.words[At-10]=Rt,Rt===0&&ct.length>10?ct.length-=10:ct.length-=9},Ot.prototype.imulK=function(ct){ct.words[ct.length]=0,ct.words[ct.length+1]=0,ct.length+=2;for(var dt=0,mt=0;mt>>=26,ct.words[mt]=At,dt=xt}return dt!==0&&(ct.words[ct.length++]=dt),ct},tt._prime=function(ct){if(Dt[ct])return Dt[ct];var dt;if(ct==="k256")dt=new Ot;else if(ct==="p224")dt=new It;else if(ct==="p192")dt=new Lt;else if(ct==="p25519")dt=new Ft;else throw new Error("Unknown prime "+ct);return Dt[ct]=dt,dt};function jt(vt){if(typeof vt=="string"){var ct=tt._prime(vt);this.m=ct.p,this.prime=ct}else j(vt.gtn(1),"modulus must be greater than 1"),this.m=vt,this.prime=null}jt.prototype._verify1=function(ct){j(ct.negative===0,"red works only with positives"),j(ct.red,"red works only with red numbers")},jt.prototype._verify2=function(ct,dt){j((ct.negative|dt.negative)===0,"red works only with positives"),j(ct.red&&ct.red===dt.red,"red works only with red numbers")},jt.prototype.imod=function(ct){return this.prime?this.prime.ireduce(ct)._forceRed(this):(ot(ct,ct.umod(this.m)._forceRed(this)),ct)},jt.prototype.neg=function(ct){return ct.isZero()?ct.clone():this.m.sub(ct)._forceRed(this)},jt.prototype.add=function(ct,dt){this._verify2(ct,dt);var mt=ct.add(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt._forceRed(this)},jt.prototype.iadd=function(ct,dt){this._verify2(ct,dt);var mt=ct.iadd(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt},jt.prototype.sub=function(ct,dt){this._verify2(ct,dt);var mt=ct.sub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt._forceRed(this)},jt.prototype.isub=function(ct,dt){this._verify2(ct,dt);var mt=ct.isub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt},jt.prototype.shl=function(ct,dt){return this._verify1(ct),this.imod(ct.ushln(dt))},jt.prototype.imul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.imul(dt))},jt.prototype.mul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.mul(dt))},jt.prototype.isqr=function(ct){return this.imul(ct,ct.clone())},jt.prototype.sqr=function(ct){return this.mul(ct,ct)},jt.prototype.sqrt=function(ct){if(ct.isZero())return ct.clone();var dt=this.m.andln(3);if(j(dt%2===1),dt===3){var mt=this.m.add(new tt(1)).iushrn(2);return this.pow(ct,mt)}for(var xt=this.m.subn(1),At=0;!xt.isZero()&&xt.andln(1)===0;)At++,xt.iushrn(1);j(!xt.isZero());var Rt=new tt(1).toRed(this),St=Rt.redNeg(),Tt=this.m.subn(1).iushrn(1),Et=this.m.bitLength();for(Et=new tt(2*Et*Et).toRed(this);this.pow(Et,Tt).cmp(St)!==0;)Et.redIAdd(St);for(var Nt=this.pow(Et,xt),tr=this.pow(ct,xt.addn(1).iushrn(1)),ir=this.pow(ct,xt),nr=At;ir.cmp(Rt)!==0;){for(var Zt=ir,Kt=0;Zt.cmp(Rt)!==0;Kt++)Zt=Zt.redSqr();j(Kt=0;At--){for(var Nt=dt.words[At],tr=Et-1;tr>=0;tr--){var ir=Nt>>tr&1;if(Rt!==xt[0]&&(Rt=this.sqr(Rt)),ir===0&&St===0){Tt=0;continue}St<<=1,St|=ir,Tt++,!(Tt!==mt&&(At!==0||tr!==0))&&(Rt=this.mul(Rt,xt[St]),Tt=0,St=0)}Et=26}return Rt},jt.prototype.convertTo=function(ct){var dt=ct.umod(this.m);return dt===ct?dt.clone():dt},jt.prototype.convertFrom=function(ct){var dt=ct.clone();return dt.red=null,dt},tt.mont=function(ct){return new bt(ct)};function bt(vt){jt.call(this,vt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(bt,jt),bt.prototype.convertTo=function(ct){return this.imod(ct.ushln(this.shift))},bt.prototype.convertFrom=function(ct){var dt=this.imod(ct.mul(this.rinv));return dt.red=null,dt},bt.prototype.imul=function(ct,dt){if(ct.isZero()||dt.isZero())return ct.words[0]=0,ct.length=1,ct;var mt=ct.imul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.mul=function(ct,dt){if(ct.isZero()||dt.isZero())return new tt(0)._forceRed(this);var mt=ct.mul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.invm=function(ct){var dt=this.imod(ct._invmp(this.m).mul(this.r2));return dt._forceRed(this)}})(a,commonjsGlobal)}(bn$1)),bn$1.exports}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports){var indexOf=function(a,_){if(a.indexOf)return a.indexOf(_);for(var $=0;$"u"}a.isPrimitive=ct,a.isBuffer=isBufferBrowser;function dt(Nt){return Object.prototype.toString.call(Nt)}function mt(Nt){return Nt<10?"0"+Nt.toString(10):Nt.toString(10)}var xt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function At(){var Nt=new Date,tr=[mt(Nt.getHours()),mt(Nt.getMinutes()),mt(Nt.getSeconds())].join(":");return[Nt.getDate(),xt[Nt.getMonth()],tr].join(" ")}a.log=function(){console.log("%s - %s",At(),a.format.apply(a,arguments))},a.inherits=inherits_browserExports,a._extend=function(Nt,tr){if(!tr||!Ft(tr))return Nt;for(var ir=Object.keys(tr),nr=ir.length;nr--;)Nt[ir[nr]]=tr[ir[nr]];return Nt};function Rt(Nt,tr){return Object.prototype.hasOwnProperty.call(Nt,tr)}var St=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;a.promisify=function(tr){if(typeof tr!="function")throw new TypeError('The "original" argument must be of type Function');if(St&&tr[St]){var ir=tr[St];if(typeof ir!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ir,St,{value:ir,enumerable:!1,writable:!1,configurable:!0}),ir}function ir(){for(var nr,Zt,Kt=new Promise(function(qt,Jt){nr=qt,Zt=Jt}),Qt=[],Ht=0;Ht0?this.tail.next=Pt:this.head=Pt,this.tail=Pt,++this.length}},{key:"unshift",value:function(Ct){var Pt={data:Ct,next:this.head};this.length===0&&(this.tail=Pt),this.head=Pt,++this.length}},{key:"shift",value:function(){if(this.length!==0){var Ct=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,Ct}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(Ct){if(this.length===0)return"";for(var Pt=this.head,$t=""+Pt.data;Pt=Pt.next;)$t+=Ct+Pt.data;return $t}},{key:"concat",value:function(Ct){if(this.length===0)return st.alloc(0);for(var Pt=st.allocUnsafe(Ct>>>0),$t=this.head,Mt=0;$t;)ht($t.data,Pt,Mt),Mt+=$t.data.length,$t=$t.next;return Pt}},{key:"consume",value:function(Ct,Pt){var $t;return CtBt.length?Bt.length:Ct;if(Dt===Bt.length?Mt+=Bt:Mt+=Bt.slice(0,Ct),Ct-=Dt,Ct===0){Dt===Bt.length?(++$t,Pt.next?this.head=Pt.next:this.head=this.tail=null):(this.head=Pt,Pt.data=Bt.slice(Dt));break}++$t}return this.length-=$t,Mt}},{key:"_getBuffer",value:function(Ct){var Pt=st.allocUnsafe(Ct),$t=this.head,Mt=1;for($t.data.copy(Pt),Ct-=$t.data.length;$t=$t.next;){var Bt=$t.data,Dt=Ct>Bt.length?Bt.length:Ct;if(Bt.copy(Pt,Pt.length-Ct,0,Dt),Ct-=Dt,Ct===0){Dt===Bt.length?(++Mt,$t.next?this.head=$t.next:this.head=this.tail=null):(this.head=$t,$t.data=Bt.slice(Dt));break}++Mt}return this.length-=Mt,Pt}},{key:ut,value:function(Ct,Pt){return at(this,_(_({},Pt),{},{depth:0,customInspect:!1}))}}]),yt}(),buffer_list}function destroy(a,_){var $=this,j=this._readableState&&this._readableState.destroyed,et=this._writableState&&this._writableState.destroyed;return j||et?(_?_(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1$1.nextTick(emitErrorNT,this,a)):process$1$1.nextTick(emitErrorNT,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(tt){!_&&tt?$._writableState?$._writableState.errorEmitted?process$1$1.nextTick(emitCloseNT,$):($._writableState.errorEmitted=!0,process$1$1.nextTick(emitErrorAndCloseNT,$,tt)):process$1$1.nextTick(emitErrorAndCloseNT,$,tt):_?(process$1$1.nextTick(emitCloseNT,$),_(tt)):process$1$1.nextTick(emitCloseNT,$)}),this)}function emitErrorAndCloseNT(a,_){emitErrorNT(a,_),emitCloseNT(a)}function emitCloseNT(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(a,_){a.emit("error",_)}function errorOrDestroy(a,_){var $=a._readableState,j=a._writableState;$&&$.autoDestroy||j&&j.autoDestroy?a.destroy(_):a.emit("error",_)}var destroy_1$1={destroy,undestroy,errorOrDestroy},errorsBrowser={};function _inheritsLoose(a,_){a.prototype=Object.create(_.prototype),a.prototype.constructor=a,a.__proto__=_}var codes={};function createErrorType(a,_,$){$||($=Error);function j(tt,rt,nt){return typeof _=="string"?_:_(tt,rt,nt)}var et=function(tt){_inheritsLoose(rt,tt);function rt(nt,it,st){return tt.call(this,j(nt,it,st))||this}return rt}($);et.prototype.name=$.name,et.prototype.code=a,codes[a]=et}function oneOf(a,_){if(Array.isArray(a)){var $=a.length;return a=a.map(function(j){return String(j)}),$>2?"one of ".concat(_," ").concat(a.slice(0,$-1).join(", "),", or ")+a[$-1]:$===2?"one of ".concat(_," ").concat(a[0]," or ").concat(a[1]):"of ".concat(_," ").concat(a[0])}else return"of ".concat(_," ").concat(String(a))}function startsWith(a,_,$){return a.substr(0,_.length)===_}function endsWith$2(a,_,$){return($===void 0||$>a.length)&&($=a.length),a.substring($-_.length,$)===_}function includes(a,_,$){return typeof $!="number"&&($=0),$+_.length>a.length?!1:a.indexOf(_,$)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(a,_){return'The value "'+_+'" is invalid for option "'+a+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(a,_,$){var j;typeof _=="string"&&startsWith(_,"not ")?(j="must not be",_=_.replace(/^not /,"")):j="must be";var et;if(endsWith$2(a," argument"))et="The ".concat(a," ").concat(j," ").concat(oneOf(_,"type"));else{var tt=includes(a,".")?"property":"argument";et='The "'.concat(a,'" ').concat(tt," ").concat(j," ").concat(oneOf(_,"type"))}return et+=". Received type ".concat(typeof $),et},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");errorsBrowser.codes=codes;var ERR_INVALID_OPT_VALUE=errorsBrowser.codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(a,_,$){return a.highWaterMark!=null?a.highWaterMark:_?a[$]:null}function getHighWaterMark(a,_,$,j){var et=highWaterMarkFrom(_,j,$);if(et!=null){if(!(isFinite(et)&&Math.floor(et)===et)||et<0){var tt=j?$:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(tt,et)}return Math.floor(et)}return a.objectMode?16:16*1024}var state={getHighWaterMark},browser$c=deprecate;function deprecate(a,_){if(config$3("noDeprecation"))return a;var $=!1;function j(){if(!$){if(config$3("throwDeprecation"))throw new Error(_);config$3("traceDeprecation")?console.trace(_):console.warn(_),$=!0}return a.apply(this,arguments)}return j}function config$3(a){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var _=commonjsGlobal.localStorage[a];return _==null?!1:String(_).toLowerCase()==="true"}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=It;function a(nr){var Zt=this;this.next=null,this.entry=null,this.finish=function(){ir(Zt,nr)}}var _;It.WritableState=zt;var $={deprecate:browser$c},j=streamBrowser$1,et=buffer$1.Buffer,tt=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function rt(nr){return et.from(nr)}function nt(nr){return et.isBuffer(nr)||nr instanceof tt}var it=destroy_1$1,st=state,ot=st.getHighWaterMark,at=errorsBrowser.codes,ut=at.ERR_INVALID_ARG_TYPE,ht=at.ERR_METHOD_NOT_IMPLEMENTED,yt=at.ERR_MULTIPLE_CALLBACK,wt=at.ERR_STREAM_CANNOT_PIPE,Ct=at.ERR_STREAM_DESTROYED,Pt=at.ERR_STREAM_NULL_VALUES,$t=at.ERR_STREAM_WRITE_AFTER_END,Mt=at.ERR_UNKNOWN_ENCODING,Bt=it.errorOrDestroy;inherits_browserExports(It,j);function Dt(){}function zt(nr,Zt,Kt){_=_||require_stream_duplex$1(),nr=nr||{},typeof Kt!="boolean"&&(Kt=Zt instanceof _),this.objectMode=!!nr.objectMode,Kt&&(this.objectMode=this.objectMode||!!nr.writableObjectMode),this.highWaterMark=ot(this,nr,"writableHighWaterMark",Kt),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Qt=nr.decodeStrings===!1;this.decodeStrings=!Qt,this.defaultEncoding=nr.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Ht){mt(Zt,Ht)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=nr.emitClose!==!1,this.autoDestroy=!!nr.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}zt.prototype.getBuffer=function(){for(var Zt=this.bufferedRequest,Kt=[];Zt;)Kt.push(Zt),Zt=Zt.next;return Kt},function(){try{Object.defineProperty(zt.prototype,"buffer",{get:$.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Ot;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ot=Function.prototype[Symbol.hasInstance],Object.defineProperty(It,Symbol.hasInstance,{value:function(Zt){return Ot.call(this,Zt)?!0:this!==It?!1:Zt&&Zt._writableState instanceof zt}})):Ot=function(Zt){return Zt instanceof this};function It(nr){_=_||require_stream_duplex$1();var Zt=this instanceof _;if(!Zt&&!Ot.call(It,this))return new It(nr);this._writableState=new zt(nr,this,Zt),this.writable=!0,nr&&(typeof nr.write=="function"&&(this._write=nr.write),typeof nr.writev=="function"&&(this._writev=nr.writev),typeof nr.destroy=="function"&&(this._destroy=nr.destroy),typeof nr.final=="function"&&(this._final=nr.final)),j.call(this)}It.prototype.pipe=function(){Bt(this,new wt)};function Lt(nr,Zt){var Kt=new $t;Bt(nr,Kt),process$1$1.nextTick(Zt,Kt)}function Ft(nr,Zt,Kt,Qt){var Ht;return Kt===null?Ht=new Pt:typeof Kt!="string"&&!Zt.objectMode&&(Ht=new ut("chunk",["string","Buffer"],Kt)),Ht?(Bt(nr,Ht),process$1$1.nextTick(Qt,Ht),!1):!0}It.prototype.write=function(nr,Zt,Kt){var Qt=this._writableState,Ht=!1,qt=!Qt.objectMode&&nt(nr);return qt&&!et.isBuffer(nr)&&(nr=rt(nr)),typeof Zt=="function"&&(Kt=Zt,Zt=null),qt?Zt="buffer":Zt||(Zt=Qt.defaultEncoding),typeof Kt!="function"&&(Kt=Dt),Qt.ending?Lt(this,Kt):(qt||Ft(this,Qt,nr,Kt))&&(Qt.pendingcb++,Ht=bt(this,Qt,qt,nr,Zt,Kt)),Ht},It.prototype.cork=function(){this._writableState.corked++},It.prototype.uncork=function(){var nr=this._writableState;nr.corked&&(nr.corked--,!nr.writing&&!nr.corked&&!nr.bufferProcessing&&nr.bufferedRequest&&Rt(this,nr))},It.prototype.setDefaultEncoding=function(Zt){if(typeof Zt=="string"&&(Zt=Zt.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Zt+"").toLowerCase())>-1))throw new Mt(Zt);return this._writableState.defaultEncoding=Zt,this},Object.defineProperty(It.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function jt(nr,Zt,Kt){return!nr.objectMode&&nr.decodeStrings!==!1&&typeof Zt=="string"&&(Zt=et.from(Zt,Kt)),Zt}Object.defineProperty(It.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function bt(nr,Zt,Kt,Qt,Ht,qt){if(!Kt){var Jt=jt(Zt,Qt,Ht);Qt!==Jt&&(Kt=!0,Ht="buffer",Qt=Jt)}var ur=Zt.objectMode?1:Qt.length;Zt.length+=ur;var xr=Zt.length>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function utf8CheckIncomplete(a,_,$){var j=_.length-1;if(j<$)return 0;var et=utf8CheckByte(_[j]);return et>=0?(et>0&&(a.lastNeed=et-1),et):--j<$||et===-2?0:(et=utf8CheckByte(_[j]),et>=0?(et>0&&(a.lastNeed=et-2),et):--j<$||et===-2?0:(et=utf8CheckByte(_[j]),et>=0?(et>0&&(et===2?et=0:a.lastNeed=et-3),et):0))}function utf8CheckExtraBytes(a,_,$){if((_[0]&192)!==128)return a.lastNeed=0,"�";if(a.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return a.lastNeed=1,"�";if(a.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return a.lastNeed=2,"�"}}function utf8FillLast(a){var _=this.lastTotal-this.lastNeed,$=utf8CheckExtraBytes(this,a);if($!==void 0)return $;if(this.lastNeed<=a.length)return a.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,_,0,a.length),this.lastNeed-=a.length}function utf8Text(a,_){var $=utf8CheckIncomplete(this,a,_);if(!this.lastNeed)return a.toString("utf8",_);this.lastTotal=$;var j=a.length-($-this.lastNeed);return a.copy(this.lastChar,0,j),a.toString("utf8",_,j)}function utf8End(a){var _=a&&a.length?this.write(a):"";return this.lastNeed?_+"�":_}function utf16Text(a,_){if((a.length-_)%2===0){var $=a.toString("utf16le",_);if($){var j=$.charCodeAt($.length-1);if(j>=55296&&j<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],$.slice(0,-1)}return $}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",_,a.length-1)}function utf16End(a){var _=a&&a.length?this.write(a):"";if(this.lastNeed){var $=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,$)}return _}function base64Text(a,_){var $=(a.length-_)%3;return $===0?a.toString("base64",_):(this.lastNeed=3-$,this.lastTotal=3,$===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",_,a.length-$))}function base64End(a){var _=a&&a.length?this.write(a):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function simpleWrite(a){return a.toString(this.encoding)}function simpleEnd(a){return a&&a.length?this.write(a):""}var ERR_STREAM_PREMATURE_CLOSE=errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;function once$1(a){var _=!1;return function(){if(!_){_=!0;for(var $=arguments.length,j=new Array($),et=0;et<$;et++)j[et]=arguments[et];a.apply(this,j)}}}function noop$9(){}function isRequest$2(a){return a.setHeader&&typeof a.abort=="function"}function eos$1(a,_,$){if(typeof _=="function")return eos$1(a,null,_);_||(_={}),$=once$1($||noop$9);var j=_.readable||_.readable!==!1&&a.readable,et=_.writable||_.writable!==!1&&a.writable,tt=function(){a.writable||nt()},rt=a._writableState&&a._writableState.finished,nt=function(){et=!1,rt=!0,j||$.call(a)},it=a._readableState&&a._readableState.endEmitted,st=function(){j=!1,it=!0,et||$.call(a)},ot=function(yt){$.call(a,yt)},at=function(){var yt;if(j&&!it)return(!a._readableState||!a._readableState.ended)&&(yt=new ERR_STREAM_PREMATURE_CLOSE),$.call(a,yt);if(et&&!rt)return(!a._writableState||!a._writableState.ended)&&(yt=new ERR_STREAM_PREMATURE_CLOSE),$.call(a,yt)},ut=function(){a.req.on("finish",nt)};return isRequest$2(a)?(a.on("complete",nt),a.on("abort",at),a.req?ut():a.on("request",ut)):et&&!a._writableState&&(a.on("end",tt),a.on("close",tt)),a.on("end",st),a.on("finish",nt),_.error!==!1&&a.on("error",ot),a.on("close",at),function(){a.removeListener("complete",nt),a.removeListener("abort",at),a.removeListener("request",ut),a.req&&a.req.removeListener("finish",nt),a.removeListener("end",tt),a.removeListener("close",tt),a.removeListener("finish",nt),a.removeListener("end",st),a.removeListener("error",ot),a.removeListener("close",at)}}var endOfStream=eos$1,async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var a;function _(Mt,Bt,Dt){return Bt=$(Bt),Bt in Mt?Object.defineProperty(Mt,Bt,{value:Dt,enumerable:!0,configurable:!0,writable:!0}):Mt[Bt]=Dt,Mt}function $(Mt){var Bt=j(Mt,"string");return typeof Bt=="symbol"?Bt:String(Bt)}function j(Mt,Bt){if(typeof Mt!="object"||Mt===null)return Mt;var Dt=Mt[Symbol.toPrimitive];if(Dt!==void 0){var zt=Dt.call(Mt,Bt||"default");if(typeof zt!="object")return zt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Bt==="string"?String:Number)(Mt)}var et=endOfStream,tt=Symbol("lastResolve"),rt=Symbol("lastReject"),nt=Symbol("error"),it=Symbol("ended"),st=Symbol("lastPromise"),ot=Symbol("handlePromise"),at=Symbol("stream");function ut(Mt,Bt){return{value:Mt,done:Bt}}function ht(Mt){var Bt=Mt[tt];if(Bt!==null){var Dt=Mt[at].read();Dt!==null&&(Mt[st]=null,Mt[tt]=null,Mt[rt]=null,Bt(ut(Dt,!1)))}}function yt(Mt){process$1$1.nextTick(ht,Mt)}function wt(Mt,Bt){return function(Dt,zt){Mt.then(function(){if(Bt[it]){Dt(ut(void 0,!0));return}Bt[ot](Dt,zt)},zt)}}var Ct=Object.getPrototypeOf(function(){}),Pt=Object.setPrototypeOf((a={get stream(){return this[at]},next:function(){var Bt=this,Dt=this[nt];if(Dt!==null)return Promise.reject(Dt);if(this[it])return Promise.resolve(ut(void 0,!0));if(this[at].destroyed)return new Promise(function(Lt,Ft){process$1$1.nextTick(function(){Bt[nt]?Ft(Bt[nt]):Lt(ut(void 0,!0))})});var zt=this[st],Ot;if(zt)Ot=new Promise(wt(zt,this));else{var It=this[at].read();if(It!==null)return Promise.resolve(ut(It,!1));Ot=new Promise(this[ot])}return this[st]=Ot,Ot}},_(a,Symbol.asyncIterator,function(){return this}),_(a,"return",function(){var Bt=this;return new Promise(function(Dt,zt){Bt[at].destroy(null,function(Ot){if(Ot){zt(Ot);return}Dt(ut(void 0,!0))})})}),a),Ct),$t=function(Bt){var Dt,zt=Object.create(Pt,(Dt={},_(Dt,at,{value:Bt,writable:!0}),_(Dt,tt,{value:null,writable:!0}),_(Dt,rt,{value:null,writable:!0}),_(Dt,nt,{value:null,writable:!0}),_(Dt,it,{value:Bt._readableState.endEmitted,writable:!0}),_(Dt,ot,{value:function(It,Lt){var Ft=zt[at].read();Ft?(zt[st]=null,zt[tt]=null,zt[rt]=null,It(ut(Ft,!1))):(zt[tt]=It,zt[rt]=Lt)},writable:!0}),Dt));return zt[st]=null,et(Bt,function(Ot){if(Ot&&Ot.code!=="ERR_STREAM_PREMATURE_CLOSE"){var It=zt[rt];It!==null&&(zt[st]=null,zt[tt]=null,zt[rt]=null,It(Ot)),zt[nt]=Ot;return}var Lt=zt[tt];Lt!==null&&(zt[st]=null,zt[tt]=null,zt[rt]=null,Lt(ut(void 0,!0))),zt[it]=!0}),Bt.on("readable",yt.bind(null,zt)),zt};return async_iterator=$t,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=Lt;var a;Lt.ReadableState=It,eventsExports.EventEmitter;var _=function(Jt,ur){return Jt.listeners(ur).length},$=streamBrowser$1,j=buffer$1.Buffer,et=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tt(qt){return j.from(qt)}function rt(qt){return j.isBuffer(qt)||qt instanceof et}var nt=util$5,it;nt&&nt.debuglog?it=nt.debuglog("stream"):it=function(){};var st=requireBuffer_list(),ot=destroy_1$1,at=state,ut=at.getHighWaterMark,ht=errorsBrowser.codes,yt=ht.ERR_INVALID_ARG_TYPE,wt=ht.ERR_STREAM_PUSH_AFTER_EOF,Ct=ht.ERR_METHOD_NOT_IMPLEMENTED,Pt=ht.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,$t,Mt,Bt;inherits_browserExports(Lt,$);var Dt=ot.errorOrDestroy,zt=["error","close","destroy","pause","resume"];function Ot(qt,Jt,ur){if(typeof qt.prependListener=="function")return qt.prependListener(Jt,ur);!qt._events||!qt._events[Jt]?qt.on(Jt,ur):Array.isArray(qt._events[Jt])?qt._events[Jt].unshift(ur):qt._events[Jt]=[ur,qt._events[Jt]]}function It(qt,Jt,ur){a=a||require_stream_duplex$1(),qt=qt||{},typeof ur!="boolean"&&(ur=Jt instanceof a),this.objectMode=!!qt.objectMode,ur&&(this.objectMode=this.objectMode||!!qt.readableObjectMode),this.highWaterMark=ut(this,qt,"readableHighWaterMark",ur),this.buffer=new st,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=qt.emitClose!==!1,this.autoDestroy=!!qt.autoDestroy,this.destroyed=!1,this.defaultEncoding=qt.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,qt.encoding&&($t||($t=string_decoder$1.StringDecoder),this.decoder=new $t(qt.encoding),this.encoding=qt.encoding)}function Lt(qt){if(a=a||require_stream_duplex$1(),!(this instanceof Lt))return new Lt(qt);var Jt=this instanceof a;this._readableState=new It(qt,this,Jt),this.readable=!0,qt&&(typeof qt.read=="function"&&(this._read=qt.read),typeof qt.destroy=="function"&&(this._destroy=qt.destroy)),$.call(this)}Object.defineProperty(Lt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Jt){this._readableState&&(this._readableState.destroyed=Jt)}}),Lt.prototype.destroy=ot.destroy,Lt.prototype._undestroy=ot.undestroy,Lt.prototype._destroy=function(qt,Jt){Jt(qt)},Lt.prototype.push=function(qt,Jt){var ur=this._readableState,xr;return ur.objectMode?xr=!0:typeof qt=="string"&&(Jt=Jt||ur.defaultEncoding,Jt!==ur.encoding&&(qt=j.from(qt,Jt),Jt=""),xr=!0),Ft(this,qt,Jt,!1,xr)},Lt.prototype.unshift=function(qt){return Ft(this,qt,null,!0,!1)};function Ft(qt,Jt,ur,xr,pr){it("readableAddChunk",Jt);var Cr=qt._readableState;if(Jt===null)Cr.reading=!1,mt(qt,Cr);else{var Mr;if(pr||(Mr=bt(Cr,Jt)),Mr)Dt(qt,Mr);else if(Cr.objectMode||Jt&&Jt.length>0)if(typeof Jt!="string"&&!Cr.objectMode&&Object.getPrototypeOf(Jt)!==j.prototype&&(Jt=tt(Jt)),xr)Cr.endEmitted?Dt(qt,new Pt):jt(qt,Cr,Jt,!0);else if(Cr.ended)Dt(qt,new wt);else{if(Cr.destroyed)return!1;Cr.reading=!1,Cr.decoder&&!ur?(Jt=Cr.decoder.write(Jt),Cr.objectMode||Jt.length!==0?jt(qt,Cr,Jt,!1):Rt(qt,Cr)):jt(qt,Cr,Jt,!1)}else xr||(Cr.reading=!1,Rt(qt,Cr))}return!Cr.ended&&(Cr.length=vt?qt=vt:(qt--,qt|=qt>>>1,qt|=qt>>>2,qt|=qt>>>4,qt|=qt>>>8,qt|=qt>>>16,qt++),qt}function dt(qt,Jt){return qt<=0||Jt.length===0&&Jt.ended?0:Jt.objectMode?1:qt!==qt?Jt.flowing&&Jt.length?Jt.buffer.head.data.length:Jt.length:(qt>Jt.highWaterMark&&(Jt.highWaterMark=ct(qt)),qt<=Jt.length?qt:Jt.ended?Jt.length:(Jt.needReadable=!0,0))}Lt.prototype.read=function(qt){it("read",qt),qt=parseInt(qt,10);var Jt=this._readableState,ur=qt;if(qt!==0&&(Jt.emittedReadable=!1),qt===0&&Jt.needReadable&&((Jt.highWaterMark!==0?Jt.length>=Jt.highWaterMark:Jt.length>0)||Jt.ended))return it("read: emitReadable",Jt.length,Jt.ended),Jt.length===0&&Jt.ended?Kt(this):xt(this),null;if(qt=dt(qt,Jt),qt===0&&Jt.ended)return Jt.length===0&&Kt(this),null;var xr=Jt.needReadable;it("need readable",xr),(Jt.length===0||Jt.length-qt0?pr=Zt(qt,Jt):pr=null,pr===null?(Jt.needReadable=Jt.length<=Jt.highWaterMark,qt=0):(Jt.length-=qt,Jt.awaitDrain=0),Jt.length===0&&(Jt.ended||(Jt.needReadable=!0),ur!==qt&&Jt.ended&&Kt(this)),pr!==null&&this.emit("data",pr),pr};function mt(qt,Jt){if(it("onEofChunk"),!Jt.ended){if(Jt.decoder){var ur=Jt.decoder.end();ur&&ur.length&&(Jt.buffer.push(ur),Jt.length+=Jt.objectMode?1:ur.length)}Jt.ended=!0,Jt.sync?xt(qt):(Jt.needReadable=!1,Jt.emittedReadable||(Jt.emittedReadable=!0,At(qt)))}}function xt(qt){var Jt=qt._readableState;it("emitReadable",Jt.needReadable,Jt.emittedReadable),Jt.needReadable=!1,Jt.emittedReadable||(it("emitReadable",Jt.flowing),Jt.emittedReadable=!0,process$1$1.nextTick(At,qt))}function At(qt){var Jt=qt._readableState;it("emitReadable_",Jt.destroyed,Jt.length,Jt.ended),!Jt.destroyed&&(Jt.length||Jt.ended)&&(qt.emit("readable"),Jt.emittedReadable=!1),Jt.needReadable=!Jt.flowing&&!Jt.ended&&Jt.length<=Jt.highWaterMark,nr(qt)}function Rt(qt,Jt){Jt.readingMore||(Jt.readingMore=!0,process$1$1.nextTick(St,qt,Jt))}function St(qt,Jt){for(;!Jt.reading&&!Jt.ended&&(Jt.length1&&Ht(xr.pipes,qt)!==-1)&&!_r&&(it("false write response, pause",xr.awaitDrain),xr.awaitDrain++),ur.pause())}function Ar(or){it("onerror",or),Br(),qt.removeListener("error",Ar),_(qt,"error")===0&&Dt(qt,or)}Ot(qt,"error",Ar);function $r(){qt.removeListener("finish",Or),Br()}qt.once("close",$r);function Or(){it("onfinish"),qt.removeListener("close",$r),Br()}qt.once("finish",Or);function Br(){it("unpipe"),ur.unpipe(qt)}return qt.emit("pipe",ur),xr.flowing||(it("pipe resume"),ur.resume()),qt};function Tt(qt){return function(){var ur=qt._readableState;it("pipeOnDrain",ur.awaitDrain),ur.awaitDrain&&ur.awaitDrain--,ur.awaitDrain===0&&_(qt,"data")&&(ur.flowing=!0,nr(qt))}}Lt.prototype.unpipe=function(qt){var Jt=this._readableState,ur={hasUnpiped:!1};if(Jt.pipesCount===0)return this;if(Jt.pipesCount===1)return qt&&qt!==Jt.pipes?this:(qt||(qt=Jt.pipes),Jt.pipes=null,Jt.pipesCount=0,Jt.flowing=!1,qt&&qt.emit("unpipe",this,ur),this);if(!qt){var xr=Jt.pipes,pr=Jt.pipesCount;Jt.pipes=null,Jt.pipesCount=0,Jt.flowing=!1;for(var Cr=0;Cr0,xr.flowing!==!1&&this.resume()):qt==="readable"&&!xr.endEmitted&&!xr.readableListening&&(xr.readableListening=xr.needReadable=!0,xr.flowing=!1,xr.emittedReadable=!1,it("on readable",xr.length,xr.reading),xr.length?xt(this):xr.reading||process$1$1.nextTick(Nt,this)),ur},Lt.prototype.addListener=Lt.prototype.on,Lt.prototype.removeListener=function(qt,Jt){var ur=$.prototype.removeListener.call(this,qt,Jt);return qt==="readable"&&process$1$1.nextTick(Et,this),ur},Lt.prototype.removeAllListeners=function(qt){var Jt=$.prototype.removeAllListeners.apply(this,arguments);return(qt==="readable"||qt===void 0)&&process$1$1.nextTick(Et,this),Jt};function Et(qt){var Jt=qt._readableState;Jt.readableListening=qt.listenerCount("readable")>0,Jt.resumeScheduled&&!Jt.paused?Jt.flowing=!0:qt.listenerCount("data")>0&&qt.resume()}function Nt(qt){it("readable nexttick read 0"),qt.read(0)}Lt.prototype.resume=function(){var qt=this._readableState;return qt.flowing||(it("resume"),qt.flowing=!qt.readableListening,tr(this,qt)),qt.paused=!1,this};function tr(qt,Jt){Jt.resumeScheduled||(Jt.resumeScheduled=!0,process$1$1.nextTick(ir,qt,Jt))}function ir(qt,Jt){it("resume",Jt.reading),Jt.reading||qt.read(0),Jt.resumeScheduled=!1,qt.emit("resume"),nr(qt),Jt.flowing&&!Jt.reading&&qt.read(0)}Lt.prototype.pause=function(){return it("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(it("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function nr(qt){var Jt=qt._readableState;for(it("flow",Jt.flowing);Jt.flowing&&qt.read()!==null;);}Lt.prototype.wrap=function(qt){var Jt=this,ur=this._readableState,xr=!1;qt.on("end",function(){if(it("wrapped end"),ur.decoder&&!ur.ended){var Mr=ur.decoder.end();Mr&&Mr.length&&Jt.push(Mr)}Jt.push(null)}),qt.on("data",function(Mr){if(it("wrapped data"),ur.decoder&&(Mr=ur.decoder.write(Mr)),!(ur.objectMode&&Mr==null)&&!(!ur.objectMode&&(!Mr||!Mr.length))){var lr=Jt.push(Mr);lr||(xr=!0,qt.pause())}});for(var pr in qt)this[pr]===void 0&&typeof qt[pr]=="function"&&(this[pr]=function(lr){return function(){return qt[lr].apply(qt,arguments)}}(pr));for(var Cr=0;Cr=Jt.length?(Jt.decoder?ur=Jt.buffer.join(""):Jt.buffer.length===1?ur=Jt.buffer.first():ur=Jt.buffer.concat(Jt.length),Jt.buffer.clear()):ur=Jt.buffer.consume(qt,Jt.decoder),ur}function Kt(qt){var Jt=qt._readableState;it("endReadable",Jt.endEmitted),Jt.endEmitted||(Jt.ended=!0,process$1$1.nextTick(Qt,Jt,qt))}function Qt(qt,Jt){if(it("endReadableNT",qt.endEmitted,qt.length),!qt.endEmitted&&qt.length===0&&(qt.endEmitted=!0,Jt.readable=!1,Jt.emit("end"),qt.autoDestroy)){var ur=Jt._writableState;(!ur||ur.autoDestroy&&ur.finished)&&Jt.destroy()}}typeof Symbol=="function"&&(Lt.from=function(qt,Jt){return Bt===void 0&&(Bt=requireFromBrowser()),Bt(Lt,qt,Jt)});function Ht(qt,Jt){for(var ur=0,xr=qt.length;ur0;return destroyer(rt,it,st,function(ot){et||(et=ot),ot&&tt.forEach(call),!it&&(tt.forEach(call),j(et))})});return _.reduce(pipe)}var pipeline_1=pipeline;(function(a,_){_=a.exports=require_stream_readable$1(),_.Stream=_,_.Readable=_,_.Writable=require_stream_writable$1(),_.Duplex=require_stream_duplex$1(),_.Transform=_stream_transform$1,_.PassThrough=_stream_passthrough$1,_.finished=endOfStream,_.pipeline=pipeline_1})(readableBrowser$1,readableBrowser$1.exports);var readableBrowserExports=readableBrowser$1.exports,Buffer$e=safeBufferExports.Buffer,Transform$1=readableBrowserExports.Transform,inherits$h=inherits_browserExports;function throwIfNotStringOrBuffer(a,_){if(!Buffer$e.isBuffer(a)&&typeof a!="string")throw new TypeError(_+" must be a string or a buffer")}function HashBase$2(a){Transform$1.call(this),this._block=Buffer$e.allocUnsafe(a),this._blockSize=a,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits$h(HashBase$2,Transform$1);HashBase$2.prototype._transform=function(a,_,$){var j=null;try{this.update(a,_)}catch(et){j=et}$(j)};HashBase$2.prototype._flush=function(a){var _=null;try{this.push(this.digest())}catch($){_=$}a(_)};HashBase$2.prototype.update=function(a,_){if(throwIfNotStringOrBuffer(a,"Data"),this._finalized)throw new Error("Digest already called");Buffer$e.isBuffer(a)||(a=Buffer$e.from(a,_));for(var $=this._block,j=0;this._blockOffset+a.length-j>=this._blockSize;){for(var et=this._blockOffset;et0;++tt)this._length[tt]+=rt,rt=this._length[tt]/4294967296|0,rt>0&&(this._length[tt]-=4294967296*rt);return this};HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")};HashBase$2.prototype.digest=function(a){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var _=this._digest();a!==void 0&&(_=_.toString(a)),this._block.fill(0),this._blockOffset=0;for(var $=0;$<4;++$)this._length[$]=0;return _};HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase$2,inherits$g=inherits_browserExports,HashBase$1=hashBase,Buffer$d=safeBufferExports.Buffer,ARRAY16$1=new Array(16);function MD5$2(){HashBase$1.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}inherits$g(MD5$2,HashBase$1);MD5$2.prototype._update=function(){for(var a=ARRAY16$1,_=0;_<16;++_)a[_]=this._block.readInt32LE(_*4);var $=this._a,j=this._b,et=this._c,tt=this._d;$=fnF($,j,et,tt,a[0],3614090360,7),tt=fnF(tt,$,j,et,a[1],3905402710,12),et=fnF(et,tt,$,j,a[2],606105819,17),j=fnF(j,et,tt,$,a[3],3250441966,22),$=fnF($,j,et,tt,a[4],4118548399,7),tt=fnF(tt,$,j,et,a[5],1200080426,12),et=fnF(et,tt,$,j,a[6],2821735955,17),j=fnF(j,et,tt,$,a[7],4249261313,22),$=fnF($,j,et,tt,a[8],1770035416,7),tt=fnF(tt,$,j,et,a[9],2336552879,12),et=fnF(et,tt,$,j,a[10],4294925233,17),j=fnF(j,et,tt,$,a[11],2304563134,22),$=fnF($,j,et,tt,a[12],1804603682,7),tt=fnF(tt,$,j,et,a[13],4254626195,12),et=fnF(et,tt,$,j,a[14],2792965006,17),j=fnF(j,et,tt,$,a[15],1236535329,22),$=fnG($,j,et,tt,a[1],4129170786,5),tt=fnG(tt,$,j,et,a[6],3225465664,9),et=fnG(et,tt,$,j,a[11],643717713,14),j=fnG(j,et,tt,$,a[0],3921069994,20),$=fnG($,j,et,tt,a[5],3593408605,5),tt=fnG(tt,$,j,et,a[10],38016083,9),et=fnG(et,tt,$,j,a[15],3634488961,14),j=fnG(j,et,tt,$,a[4],3889429448,20),$=fnG($,j,et,tt,a[9],568446438,5),tt=fnG(tt,$,j,et,a[14],3275163606,9),et=fnG(et,tt,$,j,a[3],4107603335,14),j=fnG(j,et,tt,$,a[8],1163531501,20),$=fnG($,j,et,tt,a[13],2850285829,5),tt=fnG(tt,$,j,et,a[2],4243563512,9),et=fnG(et,tt,$,j,a[7],1735328473,14),j=fnG(j,et,tt,$,a[12],2368359562,20),$=fnH($,j,et,tt,a[5],4294588738,4),tt=fnH(tt,$,j,et,a[8],2272392833,11),et=fnH(et,tt,$,j,a[11],1839030562,16),j=fnH(j,et,tt,$,a[14],4259657740,23),$=fnH($,j,et,tt,a[1],2763975236,4),tt=fnH(tt,$,j,et,a[4],1272893353,11),et=fnH(et,tt,$,j,a[7],4139469664,16),j=fnH(j,et,tt,$,a[10],3200236656,23),$=fnH($,j,et,tt,a[13],681279174,4),tt=fnH(tt,$,j,et,a[0],3936430074,11),et=fnH(et,tt,$,j,a[3],3572445317,16),j=fnH(j,et,tt,$,a[6],76029189,23),$=fnH($,j,et,tt,a[9],3654602809,4),tt=fnH(tt,$,j,et,a[12],3873151461,11),et=fnH(et,tt,$,j,a[15],530742520,16),j=fnH(j,et,tt,$,a[2],3299628645,23),$=fnI($,j,et,tt,a[0],4096336452,6),tt=fnI(tt,$,j,et,a[7],1126891415,10),et=fnI(et,tt,$,j,a[14],2878612391,15),j=fnI(j,et,tt,$,a[5],4237533241,21),$=fnI($,j,et,tt,a[12],1700485571,6),tt=fnI(tt,$,j,et,a[3],2399980690,10),et=fnI(et,tt,$,j,a[10],4293915773,15),j=fnI(j,et,tt,$,a[1],2240044497,21),$=fnI($,j,et,tt,a[8],1873313359,6),tt=fnI(tt,$,j,et,a[15],4264355552,10),et=fnI(et,tt,$,j,a[6],2734768916,15),j=fnI(j,et,tt,$,a[13],1309151649,21),$=fnI($,j,et,tt,a[4],4149444226,6),tt=fnI(tt,$,j,et,a[11],3174756917,10),et=fnI(et,tt,$,j,a[2],718787259,15),j=fnI(j,et,tt,$,a[9],3951481745,21),this._a=this._a+$|0,this._b=this._b+j|0,this._c=this._c+et|0,this._d=this._d+tt|0};MD5$2.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var a=Buffer$d.allocUnsafe(16);return a.writeInt32LE(this._a,0),a.writeInt32LE(this._b,4),a.writeInt32LE(this._c,8),a.writeInt32LE(this._d,12),a};function rotl$1(a,_){return a<<_|a>>>32-_}function fnF(a,_,$,j,et,tt,rt){return rotl$1(a+(_&$|~_&j)+et+tt|0,rt)+_|0}function fnG(a,_,$,j,et,tt,rt){return rotl$1(a+(_&j|$&~j)+et+tt|0,rt)+_|0}function fnH(a,_,$,j,et,tt,rt){return rotl$1(a+(_^$^j)+et+tt|0,rt)+_|0}function fnI(a,_,$,j,et,tt,rt){return rotl$1(a+($^(_|~j))+et+tt|0,rt)+_|0}var md5_js=MD5$2,Buffer$c=buffer$1.Buffer,inherits$f=inherits_browserExports,HashBase=hashBase,ARRAY16=new Array(16),zl=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],zr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],sl=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$3(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}inherits$f(RIPEMD160$3,HashBase);RIPEMD160$3.prototype._update=function(){for(var a=ARRAY16,_=0;_<16;++_)a[_]=this._block.readInt32LE(_*4);for(var $=this._a|0,j=this._b|0,et=this._c|0,tt=this._d|0,rt=this._e|0,nt=this._a|0,it=this._b|0,st=this._c|0,ot=this._d|0,at=this._e|0,ut=0;ut<80;ut+=1){var ht,yt;ut<16?(ht=fn1($,j,et,tt,rt,a[zl[ut]],hl[0],sl[ut]),yt=fn5(nt,it,st,ot,at,a[zr[ut]],hr[0],sr[ut])):ut<32?(ht=fn2($,j,et,tt,rt,a[zl[ut]],hl[1],sl[ut]),yt=fn4(nt,it,st,ot,at,a[zr[ut]],hr[1],sr[ut])):ut<48?(ht=fn3($,j,et,tt,rt,a[zl[ut]],hl[2],sl[ut]),yt=fn3(nt,it,st,ot,at,a[zr[ut]],hr[2],sr[ut])):ut<64?(ht=fn4($,j,et,tt,rt,a[zl[ut]],hl[3],sl[ut]),yt=fn2(nt,it,st,ot,at,a[zr[ut]],hr[3],sr[ut])):(ht=fn5($,j,et,tt,rt,a[zl[ut]],hl[4],sl[ut]),yt=fn1(nt,it,st,ot,at,a[zr[ut]],hr[4],sr[ut])),$=rt,rt=tt,tt=rotl(et,10),et=j,j=ht,nt=at,at=ot,ot=rotl(st,10),st=it,it=yt}var wt=this._b+et+ot|0;this._b=this._c+tt+at|0,this._c=this._d+rt+nt|0,this._d=this._e+$+it|0,this._e=this._a+j+st|0,this._a=wt};RIPEMD160$3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var a=Buffer$c.alloc?Buffer$c.alloc(20):new Buffer$c(20);return a.writeInt32LE(this._a,0),a.writeInt32LE(this._b,4),a.writeInt32LE(this._c,8),a.writeInt32LE(this._d,12),a.writeInt32LE(this._e,16),a};function rotl(a,_){return a<<_|a>>>32-_}function fn1(a,_,$,j,et,tt,rt,nt){return rotl(a+(_^$^j)+tt+rt|0,nt)+et|0}function fn2(a,_,$,j,et,tt,rt,nt){return rotl(a+(_&$|~_&j)+tt+rt|0,nt)+et|0}function fn3(a,_,$,j,et,tt,rt,nt){return rotl(a+((_|~$)^j)+tt+rt|0,nt)+et|0}function fn4(a,_,$,j,et,tt,rt,nt){return rotl(a+(_&j|$&~j)+tt+rt|0,nt)+et|0}function fn5(a,_,$,j,et,tt,rt,nt){return rotl(a+(_^($|~j))+tt+rt|0,nt)+et|0}var ripemd160=RIPEMD160$3,sha_js={exports:{}},Buffer$b=safeBufferExports.Buffer;function Hash$7(a,_){this._block=Buffer$b.alloc(a),this._finalSize=_,this._blockSize=a,this._len=0}Hash$7.prototype.update=function(a,_){typeof a=="string"&&(_=_||"utf8",a=Buffer$b.from(a,_));for(var $=this._block,j=this._blockSize,et=a.length,tt=this._len,rt=0;rt=this._finalSize&&(this._update(this._block),this._block.fill(0));var $=this._len*8;if($<=4294967295)this._block.writeUInt32BE($,this._blockSize-4);else{var j=($&4294967295)>>>0,et=($-j)/4294967296;this._block.writeUInt32BE(et,this._blockSize-8),this._block.writeUInt32BE(j,this._blockSize-4)}this._update(this._block);var tt=this._hash();return a?tt.toString(a):tt};Hash$7.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash$5=Hash$7,inherits$e=inherits_browserExports,Hash$6=hash$5,Buffer$a=safeBufferExports.Buffer,K$5=[1518500249,1859775393,-1894007588,-899497514],W$5=new Array(80);function Sha(){this.init(),this._w=W$5,Hash$6.call(this,64,56)}inherits$e(Sha,Hash$6);Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl5$1(a){return a<<5|a>>>27}function rotl30$1(a){return a<<30|a>>>2}function ft$1(a,_,$,j){return a===0?_&$|~_&j:a===2?_&$|_&j|$&j:_^$^j}Sha.prototype._update=function(a){for(var _=this._w,$=this._a|0,j=this._b|0,et=this._c|0,tt=this._d|0,rt=this._e|0,nt=0;nt<16;++nt)_[nt]=a.readInt32BE(nt*4);for(;nt<80;++nt)_[nt]=_[nt-3]^_[nt-8]^_[nt-14]^_[nt-16];for(var it=0;it<80;++it){var st=~~(it/20),ot=rotl5$1($)+ft$1(st,j,et,tt)+rt+_[it]+K$5[st]|0;rt=tt,tt=et,et=rotl30$1(j),j=$,$=ot}this._a=$+this._a|0,this._b=j+this._b|0,this._c=et+this._c|0,this._d=tt+this._d|0,this._e=rt+this._e|0};Sha.prototype._hash=function(){var a=Buffer$a.allocUnsafe(20);return a.writeInt32BE(this._a|0,0),a.writeInt32BE(this._b|0,4),a.writeInt32BE(this._c|0,8),a.writeInt32BE(this._d|0,12),a.writeInt32BE(this._e|0,16),a};var sha$3=Sha,inherits$d=inherits_browserExports,Hash$5=hash$5,Buffer$9=safeBufferExports.Buffer,K$4=[1518500249,1859775393,-1894007588,-899497514],W$4=new Array(80);function Sha1(){this.init(),this._w=W$4,Hash$5.call(this,64,56)}inherits$d(Sha1,Hash$5);Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl1(a){return a<<1|a>>>31}function rotl5(a){return a<<5|a>>>27}function rotl30(a){return a<<30|a>>>2}function ft(a,_,$,j){return a===0?_&$|~_&j:a===2?_&$|_&j|$&j:_^$^j}Sha1.prototype._update=function(a){for(var _=this._w,$=this._a|0,j=this._b|0,et=this._c|0,tt=this._d|0,rt=this._e|0,nt=0;nt<16;++nt)_[nt]=a.readInt32BE(nt*4);for(;nt<80;++nt)_[nt]=rotl1(_[nt-3]^_[nt-8]^_[nt-14]^_[nt-16]);for(var it=0;it<80;++it){var st=~~(it/20),ot=rotl5($)+ft(st,j,et,tt)+rt+_[it]+K$4[st]|0;rt=tt,tt=et,et=rotl30(j),j=$,$=ot}this._a=$+this._a|0,this._b=j+this._b|0,this._c=et+this._c|0,this._d=tt+this._d|0,this._e=rt+this._e|0};Sha1.prototype._hash=function(){var a=Buffer$9.allocUnsafe(20);return a.writeInt32BE(this._a|0,0),a.writeInt32BE(this._b|0,4),a.writeInt32BE(this._c|0,8),a.writeInt32BE(this._d|0,12),a.writeInt32BE(this._e|0,16),a};var sha1=Sha1,inherits$c=inherits_browserExports,Hash$4=hash$5,Buffer$8=safeBufferExports.Buffer,K$3=[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],W$3=new Array(64);function Sha256$1(){this.init(),this._w=W$3,Hash$4.call(this,64,56)}inherits$c(Sha256$1,Hash$4);Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ch(a,_,$){return $^a&(_^$)}function maj$1(a,_,$){return a&_|$&(a|_)}function sigma0$1(a){return(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10)}function sigma1$1(a){return(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7)}function gamma0(a){return(a>>>7|a<<25)^(a>>>18|a<<14)^a>>>3}function gamma1(a){return(a>>>17|a<<15)^(a>>>19|a<<13)^a>>>10}Sha256$1.prototype._update=function(a){for(var _=this._w,$=this._a|0,j=this._b|0,et=this._c|0,tt=this._d|0,rt=this._e|0,nt=this._f|0,it=this._g|0,st=this._h|0,ot=0;ot<16;++ot)_[ot]=a.readInt32BE(ot*4);for(;ot<64;++ot)_[ot]=gamma1(_[ot-2])+_[ot-7]+gamma0(_[ot-15])+_[ot-16]|0;for(var at=0;at<64;++at){var ut=st+sigma1$1(rt)+ch(rt,nt,it)+K$3[at]+_[at]|0,ht=sigma0$1($)+maj$1($,j,et)|0;st=it,it=nt,nt=rt,rt=tt+ut|0,tt=et,et=j,j=$,$=ut+ht|0}this._a=$+this._a|0,this._b=j+this._b|0,this._c=et+this._c|0,this._d=tt+this._d|0,this._e=rt+this._e|0,this._f=nt+this._f|0,this._g=it+this._g|0,this._h=st+this._h|0};Sha256$1.prototype._hash=function(){var a=Buffer$8.allocUnsafe(32);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a.writeInt32BE(this._h,28),a};var sha256$4=Sha256$1,inherits$b=inherits_browserExports,Sha256=sha256$4,Hash$3=hash$5,Buffer$7=safeBufferExports.Buffer,W$2=new Array(64);function Sha224(){this.init(),this._w=W$2,Hash$3.call(this,64,56)}inherits$b(Sha224,Sha256);Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Sha224.prototype._hash=function(){var a=Buffer$7.allocUnsafe(28);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a};var sha224$1=Sha224,inherits$a=inherits_browserExports,Hash$2=hash$5,Buffer$6=safeBufferExports.Buffer,K$2=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W$1=new Array(160);function Sha512(){this.init(),this._w=W$1,Hash$2.call(this,128,112)}inherits$a(Sha512,Hash$2);Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ch(a,_,$){return $^a&(_^$)}function maj(a,_,$){return a&_|$&(a|_)}function sigma0(a,_){return(a>>>28|_<<4)^(_>>>2|a<<30)^(_>>>7|a<<25)}function sigma1(a,_){return(a>>>14|_<<18)^(a>>>18|_<<14)^(_>>>9|a<<23)}function Gamma0(a,_){return(a>>>1|_<<31)^(a>>>8|_<<24)^a>>>7}function Gamma0l(a,_){return(a>>>1|_<<31)^(a>>>8|_<<24)^(a>>>7|_<<25)}function Gamma1(a,_){return(a>>>19|_<<13)^(_>>>29|a<<3)^a>>>6}function Gamma1l(a,_){return(a>>>19|_<<13)^(_>>>29|a<<3)^(a>>>6|_<<26)}function getCarry(a,_){return a>>>0<_>>>0?1:0}Sha512.prototype._update=function(a){for(var _=this._w,$=this._ah|0,j=this._bh|0,et=this._ch|0,tt=this._dh|0,rt=this._eh|0,nt=this._fh|0,it=this._gh|0,st=this._hh|0,ot=this._al|0,at=this._bl|0,ut=this._cl|0,ht=this._dl|0,yt=this._el|0,wt=this._fl|0,Ct=this._gl|0,Pt=this._hl|0,$t=0;$t<32;$t+=2)_[$t]=a.readInt32BE($t*4),_[$t+1]=a.readInt32BE($t*4+4);for(;$t<160;$t+=2){var Mt=_[$t-30],Bt=_[$t-15*2+1],Dt=Gamma0(Mt,Bt),zt=Gamma0l(Bt,Mt);Mt=_[$t-2*2],Bt=_[$t-2*2+1];var Ot=Gamma1(Mt,Bt),It=Gamma1l(Bt,Mt),Lt=_[$t-7*2],Ft=_[$t-7*2+1],jt=_[$t-16*2],bt=_[$t-16*2+1],vt=zt+Ft|0,ct=Dt+Lt+getCarry(vt,zt)|0;vt=vt+It|0,ct=ct+Ot+getCarry(vt,It)|0,vt=vt+bt|0,ct=ct+jt+getCarry(vt,bt)|0,_[$t]=ct,_[$t+1]=vt}for(var dt=0;dt<160;dt+=2){ct=_[dt],vt=_[dt+1];var mt=maj($,j,et),xt=maj(ot,at,ut),At=sigma0($,ot),Rt=sigma0(ot,$),St=sigma1(rt,yt),Tt=sigma1(yt,rt),Et=K$2[dt],Nt=K$2[dt+1],tr=Ch(rt,nt,it),ir=Ch(yt,wt,Ct),nr=Pt+Tt|0,Zt=st+St+getCarry(nr,Pt)|0;nr=nr+ir|0,Zt=Zt+tr+getCarry(nr,ir)|0,nr=nr+Nt|0,Zt=Zt+Et+getCarry(nr,Nt)|0,nr=nr+vt|0,Zt=Zt+ct+getCarry(nr,vt)|0;var Kt=Rt+xt|0,Qt=At+mt+getCarry(Kt,Rt)|0;st=it,Pt=Ct,it=nt,Ct=wt,nt=rt,wt=yt,yt=ht+nr|0,rt=tt+Zt+getCarry(yt,ht)|0,tt=et,ht=ut,et=j,ut=at,j=$,at=ot,ot=nr+Kt|0,$=Zt+Qt+getCarry(ot,nr)|0}this._al=this._al+ot|0,this._bl=this._bl+at|0,this._cl=this._cl+ut|0,this._dl=this._dl+ht|0,this._el=this._el+yt|0,this._fl=this._fl+wt|0,this._gl=this._gl+Ct|0,this._hl=this._hl+Pt|0,this._ah=this._ah+$+getCarry(this._al,ot)|0,this._bh=this._bh+j+getCarry(this._bl,at)|0,this._ch=this._ch+et+getCarry(this._cl,ut)|0,this._dh=this._dh+tt+getCarry(this._dl,ht)|0,this._eh=this._eh+rt+getCarry(this._el,yt)|0,this._fh=this._fh+nt+getCarry(this._fl,wt)|0,this._gh=this._gh+it+getCarry(this._gl,Ct)|0,this._hh=this._hh+st+getCarry(this._hl,Pt)|0};Sha512.prototype._hash=function(){var a=Buffer$6.allocUnsafe(64);function _($,j,et){a.writeInt32BE($,et),a.writeInt32BE(j,et+4)}return _(this._ah,this._al,0),_(this._bh,this._bl,8),_(this._ch,this._cl,16),_(this._dh,this._dl,24),_(this._eh,this._el,32),_(this._fh,this._fl,40),_(this._gh,this._gl,48),_(this._hh,this._hl,56),a};var sha512$4=Sha512,inherits$9=inherits_browserExports,SHA512$3=sha512$4,Hash$1=hash$5,Buffer$5=safeBufferExports.Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash$1.call(this,128,112)}inherits$9(Sha384,SHA512$3);Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Sha384.prototype._hash=function(){var a=Buffer$5.allocUnsafe(48);function _($,j,et){a.writeInt32BE($,et),a.writeInt32BE(j,et+4)}return _(this._ah,this._al,0),_(this._bh,this._bl,8),_(this._ch,this._cl,16),_(this._dh,this._dl,24),_(this._eh,this._el,32),_(this._fh,this._fl,40),a};var sha384$1=Sha384,exports=sha_js.exports=function(_){_=_.toLowerCase();var $=exports[_];if(!$)throw new Error(_+" is not supported (we accept pull requests)");return new $};exports.sha=sha$3;exports.sha1=sha1;exports.sha224=sha224$1;exports.sha256=sha256$4;exports.sha384=sha384$1;exports.sha512=sha512$4;var sha_jsExports=sha_js.exports,streamBrowserify=Stream,EE=eventsExports.EventEmitter,inherits$8=inherits_browserExports;inherits$8(Stream,EE);Stream.Readable=require_stream_readable$1();Stream.Writable=require_stream_writable$1();Stream.Duplex=require_stream_duplex$1();Stream.Transform=_stream_transform$1;Stream.PassThrough=_stream_passthrough$1;Stream.finished=endOfStream;Stream.pipeline=pipeline_1;Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(a,_){var $=this;function j(ot){a.writable&&a.write(ot)===!1&&$.pause&&$.pause()}$.on("data",j);function et(){$.readable&&$.resume&&$.resume()}a.on("drain",et),!a._isStdio&&(!_||_.end!==!1)&&($.on("end",rt),$.on("close",nt));var tt=!1;function rt(){tt||(tt=!0,a.end())}function nt(){tt||(tt=!0,typeof a.destroy=="function"&&a.destroy())}function it(ot){if(st(),EE.listenerCount(this,"error")===0)throw ot}$.on("error",it),a.on("error",it);function st(){$.removeListener("data",j),a.removeListener("drain",et),$.removeListener("end",rt),$.removeListener("close",nt),$.removeListener("error",it),a.removeListener("error",it),$.removeListener("end",st),$.removeListener("close",st),a.removeListener("close",st)}return $.on("end",st),$.on("close",st),a.on("close",st),a.emit("pipe",$),a};var Buffer$4=safeBufferExports.Buffer,Transform=streamBrowserify.Transform,StringDecoder=string_decoder$1.StringDecoder,inherits$7=inherits_browserExports;function CipherBase(a){Transform.call(this),this.hashMode=typeof a=="string",this.hashMode?this[a]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits$7(CipherBase,Transform);CipherBase.prototype.update=function(a,_,$){typeof a=="string"&&(a=Buffer$4.from(a,_));var j=this._update(a);return this.hashMode?this:($&&(j=this._toString(j,$)),j)};CipherBase.prototype.setAutoPadding=function(){};CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};CipherBase.prototype._transform=function(a,_,$){var j;try{this.hashMode?this._update(a):this.push(this._update(a))}catch(et){j=et}finally{$(j)}};CipherBase.prototype._flush=function(a){var _;try{this.push(this.__final())}catch($){_=$}a(_)};CipherBase.prototype._finalOrDigest=function(a){var _=this.__final()||Buffer$4.alloc(0);return a&&(_=this._toString(_,a,!0)),_};CipherBase.prototype._toString=function(a,_,$){if(this._decoder||(this._decoder=new StringDecoder(_),this._encoding=_),this._encoding!==_)throw new Error("can't switch encodings");var j=this._decoder.write(a);return $&&(j+=this._decoder.end()),j};var cipherBase=CipherBase,inherits$6=inherits_browserExports,MD5$1=md5_js,RIPEMD160$2=ripemd160,sha$2=sha_jsExports,Base$3=cipherBase;function Hash(a){Base$3.call(this,"digest"),this._hash=a}inherits$6(Hash,Base$3);Hash.prototype._update=function(a){this._hash.update(a)};Hash.prototype._final=function(){return this._hash.digest()};var browser$b=function(_){return _=_.toLowerCase(),_==="md5"?new MD5$1:_==="rmd160"||_==="ripemd160"?new RIPEMD160$2:new Hash(sha$2(_))},_Buffer=safeBufferExports.Buffer;function base$7(a){if(a.length>=255)throw new TypeError("Alphabet too long");for(var _=new Uint8Array(256),$=0;$<_.length;$++)_[$]=255;for(var j=0;j>>0,Mt=new Uint8Array($t);Ct!==Pt;){for(var Bt=ht[Ct],Dt=0,zt=$t-1;(Bt!==0||Dt>>0,Mt[zt]=Bt%rt>>>0,Bt=Bt/rt>>>0;if(Bt!==0)throw new Error("Non-zero carry");wt=Dt,Ct++}for(var Ot=$t-wt;Ot!==$t&&Mt[Ot]===0;)Ot++;for(var It=nt.repeat(yt);Ot<$t;++Ot)It+=a.charAt(Mt[Ot]);return It}function at(ht){if(typeof ht!="string")throw new TypeError("Expected String");if(ht.length===0)return _Buffer.alloc(0);for(var yt=0,wt=0,Ct=0;ht[yt]===nt;)wt++,yt++;for(var Pt=(ht.length-yt)*it+1>>>0,$t=new Uint8Array(Pt);ht[yt];){var Mt=_[ht.charCodeAt(yt)];if(Mt===255)return;for(var Bt=0,Dt=Pt-1;(Mt!==0||Bt>>0,$t[Dt]=Mt%256>>>0,Mt=Mt/256>>>0;if(Mt!==0)throw new Error("Non-zero carry");Ct=Bt,yt++}for(var zt=Pt-Ct;zt!==Pt&&$t[zt]===0;)zt++;var Ot=_Buffer.allocUnsafe(wt+(Pt-zt));Ot.fill(0,0,wt);for(var It=wt;zt!==Pt;)Ot[It++]=$t[zt++];return Ot}function ut(ht){var yt=at(ht);if(yt)return yt;throw new Error("Non-base"+rt+" character")}return{encode:ot,decodeUnsafe:at,decode:ut}}var src$2=base$7,basex$1=src$2,ALPHABET$3="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",bs58$1=basex$1(ALPHABET$3),base58$1=bs58$1,Buffer$3=safeBufferExports.Buffer,base$6=function(a){function _(tt){var rt=a(tt);return base58$1.encode(Buffer$3.concat([tt,rt],tt.length+4))}function $(tt){var rt=tt.slice(0,-4),nt=tt.slice(-4),it=a(rt);if(!(nt[0]^it[0]|nt[1]^it[1]|nt[2]^it[2]|nt[3]^it[3]))return rt}function j(tt){var rt=base58$1.decodeUnsafe(tt);if(rt)return $(rt)}function et(tt){var rt=base58$1.decode(tt),nt=$(rt);if(!nt)throw new Error("Invalid checksum");return nt}return{encode:_,decode:et,decodeUnsafe:j}},createHash=browser$b,bs58checkBase$1=base$6;function sha256x2$1(a){var _=createHash("sha256").update(a).digest();return createHash("sha256").update(_).digest()}var bs58check$2=bs58checkBase$1(sha256x2$1),nacl={},box={},x25519={},random={},system={},browser$a={};Object.defineProperty(browser$a,"__esModule",{value:!0});browser$a.BrowserRandomSource=void 0;const QUOTA=65536;class BrowserRandomSource{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const _=typeof self<"u"?self.crypto||self.msCrypto:null;_&&_.getRandomValues!==void 0&&(this._crypto=_,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(_){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const $=new Uint8Array(_);for(let j=0;j<$.length;j+=QUOTA)this._crypto.getRandomValues($.subarray(j,j+Math.min($.length-j,QUOTA)));return $}}browser$a.BrowserRandomSource=BrowserRandomSource;function commonjsRequire(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var node$2={},wipe$1={};Object.defineProperty(wipe$1,"__esModule",{value:!0});function wipe(a){for(var _=0;__)throw new RangeError("requested too many random bytes");var it=j.allocUnsafe(rt);if(rt>0)if(rt>a)for(var st=0;stet?nt=rt(nt):nt.lengthat){var ut=st==="rmd160"?new tt:rt(st);ot=ut.update(ot).digest()}else ot.lengthMAX_ALLOC||_!==_)throw new TypeError("Bad key length")},defaultEncoding$2;if(commonjsGlobal.process&&commonjsGlobal.process.browser)defaultEncoding$2="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var pVersionMajor=parseInt(process$1$1.version.split(".")[0].slice(1),10);defaultEncoding$2=pVersionMajor>=6?"utf-8":"binary"}else defaultEncoding$2="utf-8";var defaultEncoding_1=defaultEncoding$2,Buffer$2=safeBufferExports.Buffer,toBuffer$3=function(a,_,$){if(Buffer$2.isBuffer(a))return a;if(typeof a=="string")return Buffer$2.from(a,_);if(ArrayBuffer.isView(a))return Buffer$2.from(a.buffer);throw new TypeError($+" must be a string, a Buffer, a typed array or a DataView")},md5$2=md5$3,RIPEMD160$1=ripemd160,sha$1=sha_jsExports,Buffer$1=safeBufferExports.Buffer,checkParameters$1=precondition,defaultEncoding$1=defaultEncoding_1,toBuffer$2=toBuffer$3,ZEROS=Buffer$1.alloc(128),sizes$1={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac$1(a,_,$){var j=getDigest(a),et=a==="sha512"||a==="sha384"?128:64;_.length>et?_=j(_):_.length>>0},utils$x.writeUInt32BE=function(et,tt,rt){et[0+rt]=tt>>>24,et[1+rt]=tt>>>16&255,et[2+rt]=tt>>>8&255,et[3+rt]=tt&255},utils$x.ip=function(et,tt,rt,nt){for(var it=0,st=0,ot=6;ot>=0;ot-=2){for(var at=0;at<=24;at+=8)it<<=1,it|=tt>>>at+ot&1;for(var at=0;at<=24;at+=8)it<<=1,it|=et>>>at+ot&1}for(var ot=6;ot>=0;ot-=2){for(var at=1;at<=25;at+=8)st<<=1,st|=tt>>>at+ot&1;for(var at=1;at<=25;at+=8)st<<=1,st|=et>>>at+ot&1}rt[nt+0]=it>>>0,rt[nt+1]=st>>>0},utils$x.rip=function(et,tt,rt,nt){for(var it=0,st=0,ot=0;ot<4;ot++)for(var at=24;at>=0;at-=8)it<<=1,it|=tt>>>at+ot&1,it<<=1,it|=et>>>at+ot&1;for(var ot=4;ot<8;ot++)for(var at=24;at>=0;at-=8)st<<=1,st|=tt>>>at+ot&1,st<<=1,st|=et>>>at+ot&1;rt[nt+0]=it>>>0,rt[nt+1]=st>>>0},utils$x.pc1=function(et,tt,rt,nt){for(var it=0,st=0,ot=7;ot>=5;ot--){for(var at=0;at<=24;at+=8)it<<=1,it|=tt>>at+ot&1;for(var at=0;at<=24;at+=8)it<<=1,it|=et>>at+ot&1}for(var at=0;at<=24;at+=8)it<<=1,it|=tt>>at+ot&1;for(var ot=1;ot<=3;ot++){for(var at=0;at<=24;at+=8)st<<=1,st|=tt>>at+ot&1;for(var at=0;at<=24;at+=8)st<<=1,st|=et>>at+ot&1}for(var at=0;at<=24;at+=8)st<<=1,st|=et>>at+ot&1;rt[nt+0]=it>>>0,rt[nt+1]=st>>>0},utils$x.r28shl=function(et,tt){return et<>>28-tt};var a=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$x.pc2=function(et,tt,rt,nt){for(var it=0,st=0,ot=a.length>>>1,at=0;at>>a[at]&1;for(var at=ot;at>>a[at]&1;rt[nt+0]=it>>>0,rt[nt+1]=st>>>0},utils$x.expand=function(et,tt,rt){var nt=0,it=0;nt=(et&1)<<5|et>>>27;for(var st=23;st>=15;st-=4)nt<<=6,nt|=et>>>st&63;for(var st=11;st>=3;st-=4)it|=et>>>st&63,it<<=6;it|=(et&31)<<1|et>>>31,tt[rt+0]=nt>>>0,tt[rt+1]=it>>>0};var _=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$x.substitute=function(et,tt){for(var rt=0,nt=0;nt<4;nt++){var it=et>>>18-nt*6&63,st=_[nt*64+it];rt<<=4,rt|=st}for(var nt=0;nt<4;nt++){var it=tt>>>18-nt*6&63,st=_[4*64+nt*64+it];rt<<=4,rt|=st}return rt>>>0};var $=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return utils$x.permute=function(et){for(var tt=0,rt=0;rt<$.length;rt++)tt<<=1,tt|=et>>>$[rt]&1;return tt>>>0},utils$x.padSplit=function(et,tt,rt){for(var nt=et.toString(2);nt.length0;rt--)et+=this._buffer(j,et),tt+=this._flushBuffer(nt,tt);return et+=this._buffer(j,et),nt},_.prototype.final=function(j){var et;j&&(et=this.update(j));var tt;return this.type==="encrypt"?tt=this._finalEncrypt():tt=this._finalDecrypt(),et?et.concat(tt):tt},_.prototype._pad=function(j,et){if(et===0)return!1;for(;et>>1];ot=$.r28shl(ot,ht),at=$.r28shl(at,ht),$.pc2(ot,at,it.keys,ut)}},tt.prototype._update=function(it,st,ot,at){var ut=this._desState,ht=$.readUInt32BE(it,st),yt=$.readUInt32BE(it,st+4);$.ip(ht,yt,ut.tmp,0),ht=ut.tmp[0],yt=ut.tmp[1],this.type==="encrypt"?this._encrypt(ut,ht,yt,ut.tmp,0):this._decrypt(ut,ht,yt,ut.tmp,0),ht=ut.tmp[0],yt=ut.tmp[1],$.writeUInt32BE(ot,ht,at),$.writeUInt32BE(ot,yt,at+4)},tt.prototype._pad=function(it,st){if(this.padding===!1)return!1;for(var ot=it.length-st,at=st;at>>0,ht=Bt}$.rip(yt,ht,at,ut)},tt.prototype._decrypt=function(it,st,ot,at,ut){for(var ht=ot,yt=st,wt=it.keys.length-2;wt>=0;wt-=2){var Ct=it.keys[wt],Pt=it.keys[wt+1];$.expand(ht,it.tmp,0),Ct^=it.tmp[0],Pt^=it.tmp[1];var $t=$.substitute(Ct,Pt),Mt=$.permute($t),Bt=ht;ht=(yt^Mt)>>>0,yt=Bt}$.rip(ht,yt,at,ut)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var a=minimalisticAssert,_=inherits_browserExports,$={};function j(tt){a.equal(tt.length,8,"Invalid IV length"),this.iv=new Array(8);for(var rt=0;rt>nt%8,j._prev=$(j._prev,tt?ot:at);return st}function $(j,et){var tt=j.length,rt=-1,nt=a.allocUnsafe(j.length);for(j=a.concat([j,a.from([et])]);++rt>7;return nt}return cfb1.encrypt=function(j,et,tt){for(var rt=et.length,nt=a.allocUnsafe(rt),it=-1;++it>>24]^ht[Pt>>>16&255]^yt[$t>>>8&255]^wt[Mt&255]^it[It++],Dt=ut[Pt>>>24]^ht[$t>>>16&255]^yt[Mt>>>8&255]^wt[Ct&255]^it[It++],zt=ut[$t>>>24]^ht[Mt>>>16&255]^yt[Ct>>>8&255]^wt[Pt&255]^it[It++],Ot=ut[Mt>>>24]^ht[Ct>>>16&255]^yt[Pt>>>8&255]^wt[$t&255]^it[It++],Ct=Bt,Pt=Dt,$t=zt,Mt=Ot;return Bt=(ot[Ct>>>24]<<24|ot[Pt>>>16&255]<<16|ot[$t>>>8&255]<<8|ot[Mt&255])^it[It++],Dt=(ot[Pt>>>24]<<24|ot[$t>>>16&255]<<16|ot[Mt>>>8&255]<<8|ot[Ct&255])^it[It++],zt=(ot[$t>>>24]<<24|ot[Mt>>>16&255]<<16|ot[Ct>>>8&255]<<8|ot[Pt&255])^it[It++],Ot=(ot[Mt>>>24]<<24|ot[Ct>>>16&255]<<16|ot[Pt>>>8&255]<<8|ot[$t&255])^it[It++],Bt=Bt>>>0,Dt=Dt>>>0,zt=zt>>>0,Ot=Ot>>>0,[Bt,Dt,zt,Ot]}var et=[0,1,2,4,8,16,32,64,128,27,54],tt=function(){for(var nt=new Array(256),it=0;it<256;it++)it<128?nt[it]=it<<1:nt[it]=it<<1^283;for(var st=[],ot=[],at=[[],[],[],[]],ut=[[],[],[],[]],ht=0,yt=0,wt=0;wt<256;++wt){var Ct=yt^yt<<1^yt<<2^yt<<3^yt<<4;Ct=Ct>>>8^Ct&255^99,st[ht]=Ct,ot[Ct]=ht;var Pt=nt[ht],$t=nt[Pt],Mt=nt[$t],Bt=nt[Ct]*257^Ct*16843008;at[0][ht]=Bt<<24|Bt>>>8,at[1][ht]=Bt<<16|Bt>>>16,at[2][ht]=Bt<<8|Bt>>>24,at[3][ht]=Bt,Bt=Mt*16843009^$t*65537^Pt*257^ht*16843008,ut[0][Ct]=Bt<<24|Bt>>>8,ut[1][Ct]=Bt<<16|Bt>>>16,ut[2][Ct]=Bt<<8|Bt>>>24,ut[3][Ct]=Bt,ht===0?ht=yt=1:(ht=Pt^nt[nt[nt[Mt^Pt]]],yt^=nt[nt[yt]])}return{SBOX:st,INV_SBOX:ot,SUB_MIX:at,INV_SUB_MIX:ut}}();function rt(nt){this._key=_(nt),this._reset()}return rt.blockSize=4*4,rt.keySize=256/8,rt.prototype.blockSize=rt.blockSize,rt.prototype.keySize=rt.keySize,rt.prototype._reset=function(){for(var nt=this._key,it=nt.length,st=it+6,ot=(st+1)*4,at=[],ut=0;ut>>24,ht=tt.SBOX[ht>>>24]<<24|tt.SBOX[ht>>>16&255]<<16|tt.SBOX[ht>>>8&255]<<8|tt.SBOX[ht&255],ht^=et[ut/it|0]<<24):it>6&&ut%it===4&&(ht=tt.SBOX[ht>>>24]<<24|tt.SBOX[ht>>>16&255]<<16|tt.SBOX[ht>>>8&255]<<8|tt.SBOX[ht&255]),at[ut]=at[ut-it]^ht}for(var yt=[],wt=0;wt>>24]]^tt.INV_SUB_MIX[1][tt.SBOX[Pt>>>16&255]]^tt.INV_SUB_MIX[2][tt.SBOX[Pt>>>8&255]]^tt.INV_SUB_MIX[3][tt.SBOX[Pt&255]]}this._nRounds=st,this._keySchedule=at,this._invKeySchedule=yt},rt.prototype.encryptBlockRaw=function(nt){return nt=_(nt),j(nt,this._keySchedule,tt.SUB_MIX,tt.SBOX,this._nRounds)},rt.prototype.encryptBlock=function(nt){var it=this.encryptBlockRaw(nt),st=a.allocUnsafe(16);return st.writeUInt32BE(it[0],0),st.writeUInt32BE(it[1],4),st.writeUInt32BE(it[2],8),st.writeUInt32BE(it[3],12),st},rt.prototype.decryptBlock=function(nt){nt=_(nt);var it=nt[1];nt[1]=nt[3],nt[3]=it;var st=j(nt,this._invKeySchedule,tt.INV_SUB_MIX,tt.INV_SBOX,this._nRounds),ot=a.allocUnsafe(16);return ot.writeUInt32BE(st[0],0),ot.writeUInt32BE(st[3],4),ot.writeUInt32BE(st[2],8),ot.writeUInt32BE(st[1],12),ot},rt.prototype.scrub=function(){$(this._keySchedule),$(this._invKeySchedule),$(this._key)},aes.AES=rt,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var a=safeBufferExports.Buffer,_=a.alloc(16,0);function $(tt){return[tt.readUInt32BE(0),tt.readUInt32BE(4),tt.readUInt32BE(8),tt.readUInt32BE(12)]}function j(tt){var rt=a.allocUnsafe(16);return rt.writeUInt32BE(tt[0]>>>0,0),rt.writeUInt32BE(tt[1]>>>0,4),rt.writeUInt32BE(tt[2]>>>0,8),rt.writeUInt32BE(tt[3]>>>0,12),rt}function et(tt){this.h=tt,this.state=a.alloc(16,0),this.cache=a.allocUnsafe(0)}return et.prototype.ghash=function(tt){for(var rt=-1;++rt0;nt--)tt[nt]=tt[nt]>>>1|(tt[nt-1]&1)<<31;tt[0]=tt[0]>>>1,st&&(tt[0]=tt[0]^225<<24)}this.state=j(rt)},et.prototype.update=function(tt){this.cache=a.concat([this.cache,tt]);for(var rt;this.cache.length>=16;)rt=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(rt)},et.prototype.final=function(tt,rt){return this.cache.length&&this.ghash(a.concat([this.cache,_],16)),this.ghash(j([0,tt,0,rt])),this.state},ghash=et,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var a=requireAes(),_=safeBufferExports.Buffer,$=cipherBase,j=inherits_browserExports,et=requireGhash(),tt=requireBufferXor(),rt=requireIncr32();function nt(ot,at){var ut=0;ot.length!==at.length&&ut++;for(var ht=Math.min(ot.length,at.length),yt=0;yt0||rt>0;){var at=new _;at.update(ot),at.update(j),et&&at.update(et),ot=at.digest();var ut=0;if(nt>0){var ht=it.length-nt;ut=Math.min(nt,ot.length),ot.copy(it,ht,0,ut),nt-=ut}if(ut0){var yt=st.length-rt,wt=Math.min(rt,ot.length-ut);ot.copy(st,yt,ut,ut+wt),rt-=wt}}return ot.fill(0),{key:it,iv:st}}return evp_bytestokey=$,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var a=requireModes$1(),_=requireAuthCipher(),$=safeBufferExports.Buffer,j=requireStreamCipher(),et=cipherBase,tt=requireAes(),rt=requireEvp_bytestokey(),nt=inherits_browserExports;function it(ht,yt,wt){et.call(this),this._cache=new ot,this._cipher=new tt.AES(yt),this._prev=$.from(wt),this._mode=ht,this._autopadding=!0}nt(it,et),it.prototype._update=function(ht){this._cache.add(ht);for(var yt,wt,Ct=[];yt=this._cache.get();)wt=this._mode.encrypt(this,yt),Ct.push(wt);return $.concat(Ct)};var st=$.alloc(16,16);it.prototype._final=function(){var ht=this._cache.flush();if(this._autopadding)return ht=this._mode.encrypt(this,ht),this._cipher.scrub(),ht;if(!ht.equals(st))throw this._cipher.scrub(),new Error("data not multiple of block length")},it.prototype.setAutoPadding=function(ht){return this._autopadding=!!ht,this};function ot(){this.cache=$.allocUnsafe(0)}ot.prototype.add=function(ht){this.cache=$.concat([this.cache,ht])},ot.prototype.get=function(){if(this.cache.length>15){var ht=this.cache.slice(0,16);return this.cache=this.cache.slice(16),ht}return null},ot.prototype.flush=function(){for(var ht=16-this.cache.length,yt=$.allocUnsafe(ht),wt=-1;++wt16)return yt=this.cache.slice(0,16),this.cache=this.cache.slice(16),yt}else if(this.cache.length>=16)return yt=this.cache.slice(0,16),this.cache=this.cache.slice(16),yt;return null},st.prototype.flush=function(){if(this.cache.length)return this.cache};function ot(ht){var yt=ht[15];if(yt<1||yt>16)throw new Error("unable to decrypt data");for(var wt=-1;++wt0?bt:vt},tt.min=function(bt,vt){return bt.cmp(vt)<0?bt:vt},tt.prototype._init=function(bt,vt,ct){if(typeof bt=="number")return this._initNumber(bt,vt,ct);if(typeof bt=="object")return this._initArray(bt,vt,ct);vt==="hex"&&(vt=16),j(vt===(vt|0)&&vt>=2&&vt<=36),bt=bt.toString().replace(/\s+/g,"");var dt=0;bt[0]==="-"&&(dt++,this.negative=1),dt=0;dt-=3)xt=bt[dt]|bt[dt-1]<<8|bt[dt-2]<<16,this.words[mt]|=xt<>>26-At&67108863,At+=24,At>=26&&(At-=26,mt++);else if(ct==="le")for(dt=0,mt=0;dt>>26-At&67108863,At+=24,At>=26&&(At-=26,mt++);return this.strip()};function nt(jt,bt){var vt=jt.charCodeAt(bt);return vt>=65&&vt<=70?vt-55:vt>=97&&vt<=102?vt-87:vt-48&15}function it(jt,bt,vt){var ct=nt(jt,vt);return vt-1>=bt&&(ct|=nt(jt,vt-1)<<4),ct}tt.prototype._parseHex=function(bt,vt,ct){this.length=Math.ceil((bt.length-vt)/6),this.words=new Array(this.length);for(var dt=0;dt=vt;dt-=2)At=it(bt,vt,dt)<=18?(mt-=18,xt+=1,this.words[xt]|=At>>>26):mt+=8;else{var Rt=bt.length-vt;for(dt=Rt%2===0?vt+1:vt;dt=18?(mt-=18,xt+=1,this.words[xt]|=At>>>26):mt+=8}this.strip()};function st(jt,bt,vt,ct){for(var dt=0,mt=Math.min(jt.length,vt),xt=bt;xt=49?dt+=At-49+10:At>=17?dt+=At-17+10:dt+=At}return dt}tt.prototype._parseBase=function(bt,vt,ct){this.words=[0],this.length=1;for(var dt=0,mt=1;mt<=67108863;mt*=vt)dt++;dt--,mt=mt/vt|0;for(var xt=bt.length-ct,At=xt%dt,Rt=Math.min(xt,xt-At)+ct,St=0,Tt=ct;Tt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},tt.prototype.inspect=function(){return(this.red?""};var ot=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],at=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],ut=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(bt,vt){bt=bt||10,vt=vt|0||1;var ct;if(bt===16||bt==="hex"){ct="";for(var dt=0,mt=0,xt=0;xt>>24-dt&16777215,mt!==0||xt!==this.length-1?ct=ot[6-Rt.length]+Rt+ct:ct=Rt+ct,dt+=2,dt>=26&&(dt-=26,xt--)}for(mt!==0&&(ct=mt.toString(16)+ct);ct.length%vt!==0;)ct="0"+ct;return this.negative!==0&&(ct="-"+ct),ct}if(bt===(bt|0)&&bt>=2&&bt<=36){var St=at[bt],Tt=ut[bt];ct="";var Et=this.clone();for(Et.negative=0;!Et.isZero();){var Nt=Et.modn(Tt).toString(bt);Et=Et.idivn(Tt),Et.isZero()?ct=Nt+ct:ct=ot[St-Nt.length]+Nt+ct}for(this.isZero()&&(ct="0"+ct);ct.length%vt!==0;)ct="0"+ct;return this.negative!==0&&(ct="-"+ct),ct}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var bt=this.words[0];return this.length===2?bt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?bt+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-bt:bt},tt.prototype.toJSON=function(){return this.toString(16)},tt.prototype.toBuffer=function(bt,vt){return j(typeof rt<"u"),this.toArrayLike(rt,bt,vt)},tt.prototype.toArray=function(bt,vt){return this.toArrayLike(Array,bt,vt)},tt.prototype.toArrayLike=function(bt,vt,ct){var dt=this.byteLength(),mt=ct||Math.max(1,dt);j(dt<=mt,"byte array longer than desired length"),j(mt>0,"Requested array length <= 0"),this.strip();var xt=vt==="le",At=new bt(mt),Rt,St,Tt=this.clone();if(xt){for(St=0;!Tt.isZero();St++)Rt=Tt.andln(255),Tt.iushrn(8),At[St]=Rt;for(;St=4096&&(ct+=13,vt>>>=13),vt>=64&&(ct+=7,vt>>>=7),vt>=8&&(ct+=4,vt>>>=4),vt>=2&&(ct+=2,vt>>>=2),ct+vt},tt.prototype._zeroBits=function(bt){if(bt===0)return 26;var vt=bt,ct=0;return vt&8191||(ct+=13,vt>>>=13),vt&127||(ct+=7,vt>>>=7),vt&15||(ct+=4,vt>>>=4),vt&3||(ct+=2,vt>>>=2),vt&1||ct++,ct},tt.prototype.bitLength=function(){var bt=this.words[this.length-1],vt=this._countBits(bt);return(this.length-1)*26+vt};function ht(jt){for(var bt=new Array(jt.bitLength()),vt=0;vt>>dt}return bt}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var bt=0,vt=0;vtbt.length?this.clone().ior(bt):bt.clone().ior(this)},tt.prototype.uor=function(bt){return this.length>bt.length?this.clone().iuor(bt):bt.clone().iuor(this)},tt.prototype.iuand=function(bt){var vt;this.length>bt.length?vt=bt:vt=this;for(var ct=0;ctbt.length?this.clone().iand(bt):bt.clone().iand(this)},tt.prototype.uand=function(bt){return this.length>bt.length?this.clone().iuand(bt):bt.clone().iuand(this)},tt.prototype.iuxor=function(bt){var vt,ct;this.length>bt.length?(vt=this,ct=bt):(vt=bt,ct=this);for(var dt=0;dtbt.length?this.clone().ixor(bt):bt.clone().ixor(this)},tt.prototype.uxor=function(bt){return this.length>bt.length?this.clone().iuxor(bt):bt.clone().iuxor(this)},tt.prototype.inotn=function(bt){j(typeof bt=="number"&&bt>=0);var vt=Math.ceil(bt/26)|0,ct=bt%26;this._expand(vt),ct>0&&vt--;for(var dt=0;dt0&&(this.words[dt]=~this.words[dt]&67108863>>26-ct),this.strip()},tt.prototype.notn=function(bt){return this.clone().inotn(bt)},tt.prototype.setn=function(bt,vt){j(typeof bt=="number"&&bt>=0);var ct=bt/26|0,dt=bt%26;return this._expand(ct+1),vt?this.words[ct]=this.words[ct]|1<bt.length?(ct=this,dt=bt):(ct=bt,dt=this);for(var mt=0,xt=0;xt>>26;for(;mt!==0&&xt>>26;if(this.length=ct.length,mt!==0)this.words[this.length]=mt,this.length++;else if(ct!==this)for(;xtbt.length?this.clone().iadd(bt):bt.clone().iadd(this)},tt.prototype.isub=function(bt){if(bt.negative!==0){bt.negative=0;var vt=this.iadd(bt);return bt.negative=1,vt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(bt),this.negative=1,this._normSign();var ct=this.cmp(bt);if(ct===0)return this.negative=0,this.length=1,this.words[0]=0,this;var dt,mt;ct>0?(dt=this,mt=bt):(dt=bt,mt=this);for(var xt=0,At=0;At>26,this.words[At]=vt&67108863;for(;xt!==0&&At>26,this.words[At]=vt&67108863;if(xt===0&&At>>26,Et=Rt&67108863,Nt=Math.min(St,bt.length-1),tr=Math.max(0,St-jt.length+1);tr<=Nt;tr++){var ir=St-tr|0;dt=jt.words[ir]|0,mt=bt.words[tr]|0,xt=dt*mt+Et,Tt+=xt/67108864|0,Et=xt&67108863}vt.words[St]=Et|0,Rt=Tt|0}return Rt!==0?vt.words[St]=Rt|0:vt.length--,vt.strip()}var wt=function(bt,vt,ct){var dt=bt.words,mt=vt.words,xt=ct.words,At=0,Rt,St,Tt,Et=dt[0]|0,Nt=Et&8191,tr=Et>>>13,ir=dt[1]|0,nr=ir&8191,Zt=ir>>>13,Kt=dt[2]|0,Qt=Kt&8191,Ht=Kt>>>13,qt=dt[3]|0,Jt=qt&8191,ur=qt>>>13,xr=dt[4]|0,pr=xr&8191,Cr=xr>>>13,Mr=dt[5]|0,lr=Mr&8191,fr=Mr>>>13,_r=dt[6]|0,Sr=_r&8191,kr=_r>>>13,Ar=dt[7]|0,$r=Ar&8191,Or=Ar>>>13,Br=dt[8]|0,or=Br&8191,Yt=Br>>>13,er=dt[9]|0,Gt=er&8191,Vt=er>>>13,Wt=mt[0]|0,ar=Wt&8191,yr=Wt>>>13,Er=mt[1]|0,Rr=Er&8191,Wr=Er>>>13,Hr=mt[2]|0,Fr=Hr&8191,pn=Hr>>>13,Jr=mt[3]|0,Qr=Jr&8191,mn=Jr>>>13,ln=mt[4]|0,qr=ln&8191,En=ln>>>13,un=mt[5]|0,Vr=un&8191,hn=un>>>13,fn=mt[6]|0,Kr=fn&8191,Rn=fn>>>13,dn=mt[7]|0,Gr=dn&8191,gn=dn>>>13,an=mt[8]|0,Zr=an&8191,An=an>>>13,Sn=mt[9]|0,nn=Sn&8191,Pn=Sn>>>13;ct.negative=bt.negative^vt.negative,ct.length=19,Rt=Math.imul(Nt,ar),St=Math.imul(Nt,yr),St=St+Math.imul(tr,ar)|0,Tt=Math.imul(tr,yr);var yn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(yn>>>26)|0,yn&=67108863,Rt=Math.imul(nr,ar),St=Math.imul(nr,yr),St=St+Math.imul(Zt,ar)|0,Tt=Math.imul(Zt,yr),Rt=Rt+Math.imul(Nt,Rr)|0,St=St+Math.imul(Nt,Wr)|0,St=St+Math.imul(tr,Rr)|0,Tt=Tt+Math.imul(tr,Wr)|0;var _n=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(_n>>>26)|0,_n&=67108863,Rt=Math.imul(Qt,ar),St=Math.imul(Qt,yr),St=St+Math.imul(Ht,ar)|0,Tt=Math.imul(Ht,yr),Rt=Rt+Math.imul(nr,Rr)|0,St=St+Math.imul(nr,Wr)|0,St=St+Math.imul(Zt,Rr)|0,Tt=Tt+Math.imul(Zt,Wr)|0,Rt=Rt+Math.imul(Nt,Fr)|0,St=St+Math.imul(Nt,pn)|0,St=St+Math.imul(tr,Fr)|0,Tt=Tt+Math.imul(tr,pn)|0;var ds=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ds>>>26)|0,ds&=67108863,Rt=Math.imul(Jt,ar),St=Math.imul(Jt,yr),St=St+Math.imul(ur,ar)|0,Tt=Math.imul(ur,yr),Rt=Rt+Math.imul(Qt,Rr)|0,St=St+Math.imul(Qt,Wr)|0,St=St+Math.imul(Ht,Rr)|0,Tt=Tt+Math.imul(Ht,Wr)|0,Rt=Rt+Math.imul(nr,Fr)|0,St=St+Math.imul(nr,pn)|0,St=St+Math.imul(Zt,Fr)|0,Tt=Tt+Math.imul(Zt,pn)|0,Rt=Rt+Math.imul(Nt,Qr)|0,St=St+Math.imul(Nt,mn)|0,St=St+Math.imul(tr,Qr)|0,Tt=Tt+Math.imul(tr,mn)|0;var fs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(fs>>>26)|0,fs&=67108863,Rt=Math.imul(pr,ar),St=Math.imul(pr,yr),St=St+Math.imul(Cr,ar)|0,Tt=Math.imul(Cr,yr),Rt=Rt+Math.imul(Jt,Rr)|0,St=St+Math.imul(Jt,Wr)|0,St=St+Math.imul(ur,Rr)|0,Tt=Tt+Math.imul(ur,Wr)|0,Rt=Rt+Math.imul(Qt,Fr)|0,St=St+Math.imul(Qt,pn)|0,St=St+Math.imul(Ht,Fr)|0,Tt=Tt+Math.imul(Ht,pn)|0,Rt=Rt+Math.imul(nr,Qr)|0,St=St+Math.imul(nr,mn)|0,St=St+Math.imul(Zt,Qr)|0,Tt=Tt+Math.imul(Zt,mn)|0,Rt=Rt+Math.imul(Nt,qr)|0,St=St+Math.imul(Nt,En)|0,St=St+Math.imul(tr,qr)|0,Tt=Tt+Math.imul(tr,En)|0;var hs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(hs>>>26)|0,hs&=67108863,Rt=Math.imul(lr,ar),St=Math.imul(lr,yr),St=St+Math.imul(fr,ar)|0,Tt=Math.imul(fr,yr),Rt=Rt+Math.imul(pr,Rr)|0,St=St+Math.imul(pr,Wr)|0,St=St+Math.imul(Cr,Rr)|0,Tt=Tt+Math.imul(Cr,Wr)|0,Rt=Rt+Math.imul(Jt,Fr)|0,St=St+Math.imul(Jt,pn)|0,St=St+Math.imul(ur,Fr)|0,Tt=Tt+Math.imul(ur,pn)|0,Rt=Rt+Math.imul(Qt,Qr)|0,St=St+Math.imul(Qt,mn)|0,St=St+Math.imul(Ht,Qr)|0,Tt=Tt+Math.imul(Ht,mn)|0,Rt=Rt+Math.imul(nr,qr)|0,St=St+Math.imul(nr,En)|0,St=St+Math.imul(Zt,qr)|0,Tt=Tt+Math.imul(Zt,En)|0,Rt=Rt+Math.imul(Nt,Vr)|0,St=St+Math.imul(Nt,hn)|0,St=St+Math.imul(tr,Vr)|0,Tt=Tt+Math.imul(tr,hn)|0;var ps=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ps>>>26)|0,ps&=67108863,Rt=Math.imul(Sr,ar),St=Math.imul(Sr,yr),St=St+Math.imul(kr,ar)|0,Tt=Math.imul(kr,yr),Rt=Rt+Math.imul(lr,Rr)|0,St=St+Math.imul(lr,Wr)|0,St=St+Math.imul(fr,Rr)|0,Tt=Tt+Math.imul(fr,Wr)|0,Rt=Rt+Math.imul(pr,Fr)|0,St=St+Math.imul(pr,pn)|0,St=St+Math.imul(Cr,Fr)|0,Tt=Tt+Math.imul(Cr,pn)|0,Rt=Rt+Math.imul(Jt,Qr)|0,St=St+Math.imul(Jt,mn)|0,St=St+Math.imul(ur,Qr)|0,Tt=Tt+Math.imul(ur,mn)|0,Rt=Rt+Math.imul(Qt,qr)|0,St=St+Math.imul(Qt,En)|0,St=St+Math.imul(Ht,qr)|0,Tt=Tt+Math.imul(Ht,En)|0,Rt=Rt+Math.imul(nr,Vr)|0,St=St+Math.imul(nr,hn)|0,St=St+Math.imul(Zt,Vr)|0,Tt=Tt+Math.imul(Zt,hn)|0,Rt=Rt+Math.imul(Nt,Kr)|0,St=St+Math.imul(Nt,Rn)|0,St=St+Math.imul(tr,Kr)|0,Tt=Tt+Math.imul(tr,Rn)|0;var Vn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Rt=Math.imul($r,ar),St=Math.imul($r,yr),St=St+Math.imul(Or,ar)|0,Tt=Math.imul(Or,yr),Rt=Rt+Math.imul(Sr,Rr)|0,St=St+Math.imul(Sr,Wr)|0,St=St+Math.imul(kr,Rr)|0,Tt=Tt+Math.imul(kr,Wr)|0,Rt=Rt+Math.imul(lr,Fr)|0,St=St+Math.imul(lr,pn)|0,St=St+Math.imul(fr,Fr)|0,Tt=Tt+Math.imul(fr,pn)|0,Rt=Rt+Math.imul(pr,Qr)|0,St=St+Math.imul(pr,mn)|0,St=St+Math.imul(Cr,Qr)|0,Tt=Tt+Math.imul(Cr,mn)|0,Rt=Rt+Math.imul(Jt,qr)|0,St=St+Math.imul(Jt,En)|0,St=St+Math.imul(ur,qr)|0,Tt=Tt+Math.imul(ur,En)|0,Rt=Rt+Math.imul(Qt,Vr)|0,St=St+Math.imul(Qt,hn)|0,St=St+Math.imul(Ht,Vr)|0,Tt=Tt+Math.imul(Ht,hn)|0,Rt=Rt+Math.imul(nr,Kr)|0,St=St+Math.imul(nr,Rn)|0,St=St+Math.imul(Zt,Kr)|0,Tt=Tt+Math.imul(Zt,Rn)|0,Rt=Rt+Math.imul(Nt,Gr)|0,St=St+Math.imul(Nt,gn)|0,St=St+Math.imul(tr,Gr)|0,Tt=Tt+Math.imul(tr,gn)|0;var ss=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ss>>>26)|0,ss&=67108863,Rt=Math.imul(or,ar),St=Math.imul(or,yr),St=St+Math.imul(Yt,ar)|0,Tt=Math.imul(Yt,yr),Rt=Rt+Math.imul($r,Rr)|0,St=St+Math.imul($r,Wr)|0,St=St+Math.imul(Or,Rr)|0,Tt=Tt+Math.imul(Or,Wr)|0,Rt=Rt+Math.imul(Sr,Fr)|0,St=St+Math.imul(Sr,pn)|0,St=St+Math.imul(kr,Fr)|0,Tt=Tt+Math.imul(kr,pn)|0,Rt=Rt+Math.imul(lr,Qr)|0,St=St+Math.imul(lr,mn)|0,St=St+Math.imul(fr,Qr)|0,Tt=Tt+Math.imul(fr,mn)|0,Rt=Rt+Math.imul(pr,qr)|0,St=St+Math.imul(pr,En)|0,St=St+Math.imul(Cr,qr)|0,Tt=Tt+Math.imul(Cr,En)|0,Rt=Rt+Math.imul(Jt,Vr)|0,St=St+Math.imul(Jt,hn)|0,St=St+Math.imul(ur,Vr)|0,Tt=Tt+Math.imul(ur,hn)|0,Rt=Rt+Math.imul(Qt,Kr)|0,St=St+Math.imul(Qt,Rn)|0,St=St+Math.imul(Ht,Kr)|0,Tt=Tt+Math.imul(Ht,Rn)|0,Rt=Rt+Math.imul(nr,Gr)|0,St=St+Math.imul(nr,gn)|0,St=St+Math.imul(Zt,Gr)|0,Tt=Tt+Math.imul(Zt,gn)|0,Rt=Rt+Math.imul(Nt,Zr)|0,St=St+Math.imul(Nt,An)|0,St=St+Math.imul(tr,Zr)|0,Tt=Tt+Math.imul(tr,An)|0;var Jn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Rt=Math.imul(Gt,ar),St=Math.imul(Gt,yr),St=St+Math.imul(Vt,ar)|0,Tt=Math.imul(Vt,yr),Rt=Rt+Math.imul(or,Rr)|0,St=St+Math.imul(or,Wr)|0,St=St+Math.imul(Yt,Rr)|0,Tt=Tt+Math.imul(Yt,Wr)|0,Rt=Rt+Math.imul($r,Fr)|0,St=St+Math.imul($r,pn)|0,St=St+Math.imul(Or,Fr)|0,Tt=Tt+Math.imul(Or,pn)|0,Rt=Rt+Math.imul(Sr,Qr)|0,St=St+Math.imul(Sr,mn)|0,St=St+Math.imul(kr,Qr)|0,Tt=Tt+Math.imul(kr,mn)|0,Rt=Rt+Math.imul(lr,qr)|0,St=St+Math.imul(lr,En)|0,St=St+Math.imul(fr,qr)|0,Tt=Tt+Math.imul(fr,En)|0,Rt=Rt+Math.imul(pr,Vr)|0,St=St+Math.imul(pr,hn)|0,St=St+Math.imul(Cr,Vr)|0,Tt=Tt+Math.imul(Cr,hn)|0,Rt=Rt+Math.imul(Jt,Kr)|0,St=St+Math.imul(Jt,Rn)|0,St=St+Math.imul(ur,Kr)|0,Tt=Tt+Math.imul(ur,Rn)|0,Rt=Rt+Math.imul(Qt,Gr)|0,St=St+Math.imul(Qt,gn)|0,St=St+Math.imul(Ht,Gr)|0,Tt=Tt+Math.imul(Ht,gn)|0,Rt=Rt+Math.imul(nr,Zr)|0,St=St+Math.imul(nr,An)|0,St=St+Math.imul(Zt,Zr)|0,Tt=Tt+Math.imul(Zt,An)|0,Rt=Rt+Math.imul(Nt,nn)|0,St=St+Math.imul(Nt,Pn)|0,St=St+Math.imul(tr,nn)|0,Tt=Tt+Math.imul(tr,Pn)|0;var Yn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Rt=Math.imul(Gt,Rr),St=Math.imul(Gt,Wr),St=St+Math.imul(Vt,Rr)|0,Tt=Math.imul(Vt,Wr),Rt=Rt+Math.imul(or,Fr)|0,St=St+Math.imul(or,pn)|0,St=St+Math.imul(Yt,Fr)|0,Tt=Tt+Math.imul(Yt,pn)|0,Rt=Rt+Math.imul($r,Qr)|0,St=St+Math.imul($r,mn)|0,St=St+Math.imul(Or,Qr)|0,Tt=Tt+Math.imul(Or,mn)|0,Rt=Rt+Math.imul(Sr,qr)|0,St=St+Math.imul(Sr,En)|0,St=St+Math.imul(kr,qr)|0,Tt=Tt+Math.imul(kr,En)|0,Rt=Rt+Math.imul(lr,Vr)|0,St=St+Math.imul(lr,hn)|0,St=St+Math.imul(fr,Vr)|0,Tt=Tt+Math.imul(fr,hn)|0,Rt=Rt+Math.imul(pr,Kr)|0,St=St+Math.imul(pr,Rn)|0,St=St+Math.imul(Cr,Kr)|0,Tt=Tt+Math.imul(Cr,Rn)|0,Rt=Rt+Math.imul(Jt,Gr)|0,St=St+Math.imul(Jt,gn)|0,St=St+Math.imul(ur,Gr)|0,Tt=Tt+Math.imul(ur,gn)|0,Rt=Rt+Math.imul(Qt,Zr)|0,St=St+Math.imul(Qt,An)|0,St=St+Math.imul(Ht,Zr)|0,Tt=Tt+Math.imul(Ht,An)|0,Rt=Rt+Math.imul(nr,nn)|0,St=St+Math.imul(nr,Pn)|0,St=St+Math.imul(Zt,nn)|0,Tt=Tt+Math.imul(Zt,Pn)|0;var ms=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ms>>>26)|0,ms&=67108863,Rt=Math.imul(Gt,Fr),St=Math.imul(Gt,pn),St=St+Math.imul(Vt,Fr)|0,Tt=Math.imul(Vt,pn),Rt=Rt+Math.imul(or,Qr)|0,St=St+Math.imul(or,mn)|0,St=St+Math.imul(Yt,Qr)|0,Tt=Tt+Math.imul(Yt,mn)|0,Rt=Rt+Math.imul($r,qr)|0,St=St+Math.imul($r,En)|0,St=St+Math.imul(Or,qr)|0,Tt=Tt+Math.imul(Or,En)|0,Rt=Rt+Math.imul(Sr,Vr)|0,St=St+Math.imul(Sr,hn)|0,St=St+Math.imul(kr,Vr)|0,Tt=Tt+Math.imul(kr,hn)|0,Rt=Rt+Math.imul(lr,Kr)|0,St=St+Math.imul(lr,Rn)|0,St=St+Math.imul(fr,Kr)|0,Tt=Tt+Math.imul(fr,Rn)|0,Rt=Rt+Math.imul(pr,Gr)|0,St=St+Math.imul(pr,gn)|0,St=St+Math.imul(Cr,Gr)|0,Tt=Tt+Math.imul(Cr,gn)|0,Rt=Rt+Math.imul(Jt,Zr)|0,St=St+Math.imul(Jt,An)|0,St=St+Math.imul(ur,Zr)|0,Tt=Tt+Math.imul(ur,An)|0,Rt=Rt+Math.imul(Qt,nn)|0,St=St+Math.imul(Qt,Pn)|0,St=St+Math.imul(Ht,nn)|0,Tt=Tt+Math.imul(Ht,Pn)|0;var Qn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Rt=Math.imul(Gt,Qr),St=Math.imul(Gt,mn),St=St+Math.imul(Vt,Qr)|0,Tt=Math.imul(Vt,mn),Rt=Rt+Math.imul(or,qr)|0,St=St+Math.imul(or,En)|0,St=St+Math.imul(Yt,qr)|0,Tt=Tt+Math.imul(Yt,En)|0,Rt=Rt+Math.imul($r,Vr)|0,St=St+Math.imul($r,hn)|0,St=St+Math.imul(Or,Vr)|0,Tt=Tt+Math.imul(Or,hn)|0,Rt=Rt+Math.imul(Sr,Kr)|0,St=St+Math.imul(Sr,Rn)|0,St=St+Math.imul(kr,Kr)|0,Tt=Tt+Math.imul(kr,Rn)|0,Rt=Rt+Math.imul(lr,Gr)|0,St=St+Math.imul(lr,gn)|0,St=St+Math.imul(fr,Gr)|0,Tt=Tt+Math.imul(fr,gn)|0,Rt=Rt+Math.imul(pr,Zr)|0,St=St+Math.imul(pr,An)|0,St=St+Math.imul(Cr,Zr)|0,Tt=Tt+Math.imul(Cr,An)|0,Rt=Rt+Math.imul(Jt,nn)|0,St=St+Math.imul(Jt,Pn)|0,St=St+Math.imul(ur,nn)|0,Tt=Tt+Math.imul(ur,Pn)|0;var es=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(es>>>26)|0,es&=67108863,Rt=Math.imul(Gt,qr),St=Math.imul(Gt,En),St=St+Math.imul(Vt,qr)|0,Tt=Math.imul(Vt,En),Rt=Rt+Math.imul(or,Vr)|0,St=St+Math.imul(or,hn)|0,St=St+Math.imul(Yt,Vr)|0,Tt=Tt+Math.imul(Yt,hn)|0,Rt=Rt+Math.imul($r,Kr)|0,St=St+Math.imul($r,Rn)|0,St=St+Math.imul(Or,Kr)|0,Tt=Tt+Math.imul(Or,Rn)|0,Rt=Rt+Math.imul(Sr,Gr)|0,St=St+Math.imul(Sr,gn)|0,St=St+Math.imul(kr,Gr)|0,Tt=Tt+Math.imul(kr,gn)|0,Rt=Rt+Math.imul(lr,Zr)|0,St=St+Math.imul(lr,An)|0,St=St+Math.imul(fr,Zr)|0,Tt=Tt+Math.imul(fr,An)|0,Rt=Rt+Math.imul(pr,nn)|0,St=St+Math.imul(pr,Pn)|0,St=St+Math.imul(Cr,nn)|0,Tt=Tt+Math.imul(Cr,Pn)|0;var ls=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ls>>>26)|0,ls&=67108863,Rt=Math.imul(Gt,Vr),St=Math.imul(Gt,hn),St=St+Math.imul(Vt,Vr)|0,Tt=Math.imul(Vt,hn),Rt=Rt+Math.imul(or,Kr)|0,St=St+Math.imul(or,Rn)|0,St=St+Math.imul(Yt,Kr)|0,Tt=Tt+Math.imul(Yt,Rn)|0,Rt=Rt+Math.imul($r,Gr)|0,St=St+Math.imul($r,gn)|0,St=St+Math.imul(Or,Gr)|0,Tt=Tt+Math.imul(Or,gn)|0,Rt=Rt+Math.imul(Sr,Zr)|0,St=St+Math.imul(Sr,An)|0,St=St+Math.imul(kr,Zr)|0,Tt=Tt+Math.imul(kr,An)|0,Rt=Rt+Math.imul(lr,nn)|0,St=St+Math.imul(lr,Pn)|0,St=St+Math.imul(fr,nn)|0,Tt=Tt+Math.imul(fr,Pn)|0;var us=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(us>>>26)|0,us&=67108863,Rt=Math.imul(Gt,Kr),St=Math.imul(Gt,Rn),St=St+Math.imul(Vt,Kr)|0,Tt=Math.imul(Vt,Rn),Rt=Rt+Math.imul(or,Gr)|0,St=St+Math.imul(or,gn)|0,St=St+Math.imul(Yt,Gr)|0,Tt=Tt+Math.imul(Yt,gn)|0,Rt=Rt+Math.imul($r,Zr)|0,St=St+Math.imul($r,An)|0,St=St+Math.imul(Or,Zr)|0,Tt=Tt+Math.imul(Or,An)|0,Rt=Rt+Math.imul(Sr,nn)|0,St=St+Math.imul(Sr,Pn)|0,St=St+Math.imul(kr,nn)|0,Tt=Tt+Math.imul(kr,Pn)|0;var Wn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Rt=Math.imul(Gt,Gr),St=Math.imul(Gt,gn),St=St+Math.imul(Vt,Gr)|0,Tt=Math.imul(Vt,gn),Rt=Rt+Math.imul(or,Zr)|0,St=St+Math.imul(or,An)|0,St=St+Math.imul(Yt,Zr)|0,Tt=Tt+Math.imul(Yt,An)|0,Rt=Rt+Math.imul($r,nn)|0,St=St+Math.imul($r,Pn)|0,St=St+Math.imul(Or,nn)|0,Tt=Tt+Math.imul(Or,Pn)|0;var as=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(as>>>26)|0,as&=67108863,Rt=Math.imul(Gt,Zr),St=Math.imul(Gt,An),St=St+Math.imul(Vt,Zr)|0,Tt=Math.imul(Vt,An),Rt=Rt+Math.imul(or,nn)|0,St=St+Math.imul(or,Pn)|0,St=St+Math.imul(Yt,nn)|0,Tt=Tt+Math.imul(Yt,Pn)|0;var gs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(gs>>>26)|0,gs&=67108863,Rt=Math.imul(Gt,nn),St=Math.imul(Gt,Pn),St=St+Math.imul(Vt,nn)|0,Tt=Math.imul(Vt,Pn);var vs=(At+Rt|0)+((St&8191)<<13)|0;return At=(Tt+(St>>>13)|0)+(vs>>>26)|0,vs&=67108863,xt[0]=yn,xt[1]=_n,xt[2]=ds,xt[3]=fs,xt[4]=hs,xt[5]=ps,xt[6]=Vn,xt[7]=ss,xt[8]=Jn,xt[9]=Yn,xt[10]=ms,xt[11]=Qn,xt[12]=es,xt[13]=ls,xt[14]=us,xt[15]=Wn,xt[16]=as,xt[17]=gs,xt[18]=vs,At!==0&&(xt[19]=At,ct.length++),ct};Math.imul||(wt=yt);function Ct(jt,bt,vt){vt.negative=bt.negative^jt.negative,vt.length=jt.length+bt.length;for(var ct=0,dt=0,mt=0;mt>>26)|0,dt+=xt>>>26,xt&=67108863}vt.words[mt]=At,ct=xt,xt=dt}return ct!==0?vt.words[mt]=ct:vt.length--,vt.strip()}function Pt(jt,bt,vt){var ct=new $t;return ct.mulp(jt,bt,vt)}tt.prototype.mulTo=function(bt,vt){var ct,dt=this.length+bt.length;return this.length===10&&bt.length===10?ct=wt(this,bt,vt):dt<63?ct=yt(this,bt,vt):dt<1024?ct=Ct(this,bt,vt):ct=Pt(this,bt,vt),ct};function $t(jt,bt){this.x=jt,this.y=bt}$t.prototype.makeRBT=function(bt){for(var vt=new Array(bt),ct=tt.prototype._countBits(bt)-1,dt=0;dt>=1;return dt},$t.prototype.permute=function(bt,vt,ct,dt,mt,xt){for(var At=0;At>>1)mt++;return 1<>>13,ct[2*xt+1]=mt&8191,mt=mt>>>13;for(xt=2*vt;xt>=26,vt+=dt/67108864|0,vt+=mt>>>26,this.words[ct]=mt&67108863}return vt!==0&&(this.words[ct]=vt,this.length++),this},tt.prototype.muln=function(bt){return this.clone().imuln(bt)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(bt){var vt=ht(bt);if(vt.length===0)return new tt(1);for(var ct=this,dt=0;dt=0);var vt=bt%26,ct=(bt-vt)/26,dt=67108863>>>26-vt<<26-vt,mt;if(vt!==0){var xt=0;for(mt=0;mt>>26-vt}xt&&(this.words[mt]=xt,this.length++)}if(ct!==0){for(mt=this.length-1;mt>=0;mt--)this.words[mt+ct]=this.words[mt];for(mt=0;mt=0);var dt;vt?dt=(vt-vt%26)/26:dt=0;var mt=bt%26,xt=Math.min((bt-mt)/26,this.length),At=67108863^67108863>>>mt<xt)for(this.length-=xt,St=0;St=0&&(Tt!==0||St>=dt);St--){var Et=this.words[St]|0;this.words[St]=Tt<<26-mt|Et>>>mt,Tt=Et&At}return Rt&&Tt!==0&&(Rt.words[Rt.length++]=Tt),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},tt.prototype.ishrn=function(bt,vt,ct){return j(this.negative===0),this.iushrn(bt,vt,ct)},tt.prototype.shln=function(bt){return this.clone().ishln(bt)},tt.prototype.ushln=function(bt){return this.clone().iushln(bt)},tt.prototype.shrn=function(bt){return this.clone().ishrn(bt)},tt.prototype.ushrn=function(bt){return this.clone().iushrn(bt)},tt.prototype.testn=function(bt){j(typeof bt=="number"&&bt>=0);var vt=bt%26,ct=(bt-vt)/26,dt=1<=0);var vt=bt%26,ct=(bt-vt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=ct)return this;if(vt!==0&&ct++,this.length=Math.min(ct,this.length),vt!==0){var dt=67108863^67108863>>>vt<=67108864;vt++)this.words[vt]-=67108864,vt===this.length-1?this.words[vt+1]=1:this.words[vt+1]++;return this.length=Math.max(this.length,vt+1),this},tt.prototype.isubn=function(bt){if(j(typeof bt=="number"),j(bt<67108864),bt<0)return this.iaddn(-bt);if(this.negative!==0)return this.negative=0,this.iaddn(bt),this.negative=1,this;if(this.words[0]-=bt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var vt=0;vt>26)-(Rt/67108864|0),this.words[mt+ct]=xt&67108863}for(;mt>26,this.words[mt+ct]=xt&67108863;if(At===0)return this.strip();for(j(At===-1),At=0,mt=0;mt>26,this.words[mt]=xt&67108863;return this.negative=1,this.strip()},tt.prototype._wordDiv=function(bt,vt){var ct=this.length-bt.length,dt=this.clone(),mt=bt,xt=mt.words[mt.length-1]|0,At=this._countBits(xt);ct=26-At,ct!==0&&(mt=mt.ushln(ct),dt.iushln(ct),xt=mt.words[mt.length-1]|0);var Rt=dt.length-mt.length,St;if(vt!=="mod"){St=new tt(null),St.length=Rt+1,St.words=new Array(St.length);for(var Tt=0;Tt=0;Nt--){var tr=(dt.words[mt.length+Nt]|0)*67108864+(dt.words[mt.length+Nt-1]|0);for(tr=Math.min(tr/xt|0,67108863),dt._ishlnsubmul(mt,tr,Nt);dt.negative!==0;)tr--,dt.negative=0,dt._ishlnsubmul(mt,1,Nt),dt.isZero()||(dt.negative^=1);St&&(St.words[Nt]=tr)}return St&&St.strip(),dt.strip(),vt!=="div"&&ct!==0&&dt.iushrn(ct),{div:St||null,mod:dt}},tt.prototype.divmod=function(bt,vt,ct){if(j(!bt.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var dt,mt,xt;return this.negative!==0&&bt.negative===0?(xt=this.neg().divmod(bt,vt),vt!=="mod"&&(dt=xt.div.neg()),vt!=="div"&&(mt=xt.mod.neg(),ct&&mt.negative!==0&&mt.iadd(bt)),{div:dt,mod:mt}):this.negative===0&&bt.negative!==0?(xt=this.divmod(bt.neg(),vt),vt!=="mod"&&(dt=xt.div.neg()),{div:dt,mod:xt.mod}):this.negative&bt.negative?(xt=this.neg().divmod(bt.neg(),vt),vt!=="div"&&(mt=xt.mod.neg(),ct&&mt.negative!==0&&mt.isub(bt)),{div:xt.div,mod:mt}):bt.length>this.length||this.cmp(bt)<0?{div:new tt(0),mod:this}:bt.length===1?vt==="div"?{div:this.divn(bt.words[0]),mod:null}:vt==="mod"?{div:null,mod:new tt(this.modn(bt.words[0]))}:{div:this.divn(bt.words[0]),mod:new tt(this.modn(bt.words[0]))}:this._wordDiv(bt,vt)},tt.prototype.div=function(bt){return this.divmod(bt,"div",!1).div},tt.prototype.mod=function(bt){return this.divmod(bt,"mod",!1).mod},tt.prototype.umod=function(bt){return this.divmod(bt,"mod",!0).mod},tt.prototype.divRound=function(bt){var vt=this.divmod(bt);if(vt.mod.isZero())return vt.div;var ct=vt.div.negative!==0?vt.mod.isub(bt):vt.mod,dt=bt.ushrn(1),mt=bt.andln(1),xt=ct.cmp(dt);return xt<0||mt===1&&xt===0?vt.div:vt.div.negative!==0?vt.div.isubn(1):vt.div.iaddn(1)},tt.prototype.modn=function(bt){j(bt<=67108863);for(var vt=(1<<26)%bt,ct=0,dt=this.length-1;dt>=0;dt--)ct=(vt*ct+(this.words[dt]|0))%bt;return ct},tt.prototype.idivn=function(bt){j(bt<=67108863);for(var vt=0,ct=this.length-1;ct>=0;ct--){var dt=(this.words[ct]|0)+vt*67108864;this.words[ct]=dt/bt|0,vt=dt%bt}return this.strip()},tt.prototype.divn=function(bt){return this.clone().idivn(bt)},tt.prototype.egcd=function(bt){j(bt.negative===0),j(!bt.isZero());var vt=this,ct=bt.clone();vt.negative!==0?vt=vt.umod(bt):vt=vt.clone();for(var dt=new tt(1),mt=new tt(0),xt=new tt(0),At=new tt(1),Rt=0;vt.isEven()&&ct.isEven();)vt.iushrn(1),ct.iushrn(1),++Rt;for(var St=ct.clone(),Tt=vt.clone();!vt.isZero();){for(var Et=0,Nt=1;!(vt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(vt.iushrn(Et);Et-- >0;)(dt.isOdd()||mt.isOdd())&&(dt.iadd(St),mt.isub(Tt)),dt.iushrn(1),mt.iushrn(1);for(var tr=0,ir=1;!(ct.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(ct.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(St),At.isub(Tt)),xt.iushrn(1),At.iushrn(1);vt.cmp(ct)>=0?(vt.isub(ct),dt.isub(xt),mt.isub(At)):(ct.isub(vt),xt.isub(dt),At.isub(mt))}return{a:xt,b:At,gcd:ct.iushln(Rt)}},tt.prototype._invmp=function(bt){j(bt.negative===0),j(!bt.isZero());var vt=this,ct=bt.clone();vt.negative!==0?vt=vt.umod(bt):vt=vt.clone();for(var dt=new tt(1),mt=new tt(0),xt=ct.clone();vt.cmpn(1)>0&&ct.cmpn(1)>0;){for(var At=0,Rt=1;!(vt.words[0]&Rt)&&At<26;++At,Rt<<=1);if(At>0)for(vt.iushrn(At);At-- >0;)dt.isOdd()&&dt.iadd(xt),dt.iushrn(1);for(var St=0,Tt=1;!(ct.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(ct.iushrn(St);St-- >0;)mt.isOdd()&&mt.iadd(xt),mt.iushrn(1);vt.cmp(ct)>=0?(vt.isub(ct),dt.isub(mt)):(ct.isub(vt),mt.isub(dt))}var Et;return vt.cmpn(1)===0?Et=dt:Et=mt,Et.cmpn(0)<0&&Et.iadd(bt),Et},tt.prototype.gcd=function(bt){if(this.isZero())return bt.abs();if(bt.isZero())return this.abs();var vt=this.clone(),ct=bt.clone();vt.negative=0,ct.negative=0;for(var dt=0;vt.isEven()&&ct.isEven();dt++)vt.iushrn(1),ct.iushrn(1);do{for(;vt.isEven();)vt.iushrn(1);for(;ct.isEven();)ct.iushrn(1);var mt=vt.cmp(ct);if(mt<0){var xt=vt;vt=ct,ct=xt}else if(mt===0||ct.cmpn(1)===0)break;vt.isub(ct)}while(!0);return ct.iushln(dt)},tt.prototype.invm=function(bt){return this.egcd(bt).a.umod(bt)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(bt){return this.words[0]&bt},tt.prototype.bincn=function(bt){j(typeof bt=="number");var vt=bt%26,ct=(bt-vt)/26,dt=1<>>26,At&=67108863,this.words[xt]=At}return mt!==0&&(this.words[xt]=mt,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(bt){var vt=bt<0;if(this.negative!==0&&!vt)return-1;if(this.negative===0&&vt)return 1;this.strip();var ct;if(this.length>1)ct=1;else{vt&&(bt=-bt),j(bt<=67108863,"Number is too big");var dt=this.words[0]|0;ct=dt===bt?0:dtbt.length)return 1;if(this.length=0;ct--){var dt=this.words[ct]|0,mt=bt.words[ct]|0;if(dt!==mt){dtmt&&(vt=1);break}}return vt},tt.prototype.gtn=function(bt){return this.cmpn(bt)===1},tt.prototype.gt=function(bt){return this.cmp(bt)===1},tt.prototype.gten=function(bt){return this.cmpn(bt)>=0},tt.prototype.gte=function(bt){return this.cmp(bt)>=0},tt.prototype.ltn=function(bt){return this.cmpn(bt)===-1},tt.prototype.lt=function(bt){return this.cmp(bt)===-1},tt.prototype.lten=function(bt){return this.cmpn(bt)<=0},tt.prototype.lte=function(bt){return this.cmp(bt)<=0},tt.prototype.eqn=function(bt){return this.cmpn(bt)===0},tt.prototype.eq=function(bt){return this.cmp(bt)===0},tt.red=function(bt){return new Lt(bt)},tt.prototype.toRed=function(bt){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),bt.convertTo(this)._forceRed(bt)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(bt){return this.red=bt,this},tt.prototype.forceRed=function(bt){return j(!this.red,"Already a number in reduction context"),this._forceRed(bt)},tt.prototype.redAdd=function(bt){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,bt)},tt.prototype.redIAdd=function(bt){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,bt)},tt.prototype.redSub=function(bt){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,bt)},tt.prototype.redISub=function(bt){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,bt)},tt.prototype.redShl=function(bt){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,bt)},tt.prototype.redMul=function(bt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,bt),this.red.mul(this,bt)},tt.prototype.redIMul=function(bt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,bt),this.red.imul(this,bt)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(bt){return j(this.red&&!bt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,bt)};var Mt={k256:null,p224:null,p192:null,p25519:null};function Bt(jt,bt){this.name=jt,this.p=new tt(bt,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var bt=new tt(null);return bt.words=new Array(Math.ceil(this.n/13)),bt},Bt.prototype.ireduce=function(bt){var vt=bt,ct;do this.split(vt,this.tmp),vt=this.imulK(vt),vt=vt.iadd(this.tmp),ct=vt.bitLength();while(ct>this.n);var dt=ct0?vt.isub(this.p):vt.strip!==void 0?vt.strip():vt._strip(),vt},Bt.prototype.split=function(bt,vt){bt.iushrn(this.n,0,vt)},Bt.prototype.imulK=function(bt){return bt.imul(this.k)};function Dt(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Dt,Bt),Dt.prototype.split=function(bt,vt){for(var ct=4194303,dt=Math.min(bt.length,9),mt=0;mt>>22,xt=At}xt>>>=22,bt.words[mt-10]=xt,xt===0&&bt.length>10?bt.length-=10:bt.length-=9},Dt.prototype.imulK=function(bt){bt.words[bt.length]=0,bt.words[bt.length+1]=0,bt.length+=2;for(var vt=0,ct=0;ct>>=26,bt.words[ct]=mt,vt=dt}return vt!==0&&(bt.words[bt.length++]=vt),bt},tt._prime=function(bt){if(Mt[bt])return Mt[bt];var vt;if(bt==="k256")vt=new Dt;else if(bt==="p224")vt=new zt;else if(bt==="p192")vt=new Ot;else if(bt==="p25519")vt=new It;else throw new Error("Unknown prime "+bt);return Mt[bt]=vt,vt};function Lt(jt){if(typeof jt=="string"){var bt=tt._prime(jt);this.m=bt.p,this.prime=bt}else j(jt.gtn(1),"modulus must be greater than 1"),this.m=jt,this.prime=null}Lt.prototype._verify1=function(bt){j(bt.negative===0,"red works only with positives"),j(bt.red,"red works only with red numbers")},Lt.prototype._verify2=function(bt,vt){j((bt.negative|vt.negative)===0,"red works only with positives"),j(bt.red&&bt.red===vt.red,"red works only with red numbers")},Lt.prototype.imod=function(bt){return this.prime?this.prime.ireduce(bt)._forceRed(this):bt.umod(this.m)._forceRed(this)},Lt.prototype.neg=function(bt){return bt.isZero()?bt.clone():this.m.sub(bt)._forceRed(this)},Lt.prototype.add=function(bt,vt){this._verify2(bt,vt);var ct=bt.add(vt);return ct.cmp(this.m)>=0&&ct.isub(this.m),ct._forceRed(this)},Lt.prototype.iadd=function(bt,vt){this._verify2(bt,vt);var ct=bt.iadd(vt);return ct.cmp(this.m)>=0&&ct.isub(this.m),ct},Lt.prototype.sub=function(bt,vt){this._verify2(bt,vt);var ct=bt.sub(vt);return ct.cmpn(0)<0&&ct.iadd(this.m),ct._forceRed(this)},Lt.prototype.isub=function(bt,vt){this._verify2(bt,vt);var ct=bt.isub(vt);return ct.cmpn(0)<0&&ct.iadd(this.m),ct},Lt.prototype.shl=function(bt,vt){return this._verify1(bt),this.imod(bt.ushln(vt))},Lt.prototype.imul=function(bt,vt){return this._verify2(bt,vt),this.imod(bt.imul(vt))},Lt.prototype.mul=function(bt,vt){return this._verify2(bt,vt),this.imod(bt.mul(vt))},Lt.prototype.isqr=function(bt){return this.imul(bt,bt.clone())},Lt.prototype.sqr=function(bt){return this.mul(bt,bt)},Lt.prototype.sqrt=function(bt){if(bt.isZero())return bt.clone();var vt=this.m.andln(3);if(j(vt%2===1),vt===3){var ct=this.m.add(new tt(1)).iushrn(2);return this.pow(bt,ct)}for(var dt=this.m.subn(1),mt=0;!dt.isZero()&&dt.andln(1)===0;)mt++,dt.iushrn(1);j(!dt.isZero());var xt=new tt(1).toRed(this),At=xt.redNeg(),Rt=this.m.subn(1).iushrn(1),St=this.m.bitLength();for(St=new tt(2*St*St).toRed(this);this.pow(St,Rt).cmp(At)!==0;)St.redIAdd(At);for(var Tt=this.pow(St,dt),Et=this.pow(bt,dt.addn(1).iushrn(1)),Nt=this.pow(bt,dt),tr=mt;Nt.cmp(xt)!==0;){for(var ir=Nt,nr=0;ir.cmp(xt)!==0;nr++)ir=ir.redSqr();j(nr=0;mt--){for(var Tt=vt.words[mt],Et=St-1;Et>=0;Et--){var Nt=Tt>>Et&1;if(xt!==dt[0]&&(xt=this.sqr(xt)),Nt===0&&At===0){Rt=0;continue}At<<=1,At|=Nt,Rt++,!(Rt!==ct&&(mt!==0||Et!==0))&&(xt=this.mul(xt,dt[At]),Rt=0,At=0)}St=26}return xt},Lt.prototype.convertTo=function(bt){var vt=bt.umod(this.m);return vt===bt?vt.clone():vt},Lt.prototype.convertFrom=function(bt){var vt=bt.clone();return vt.red=null,vt},tt.mont=function(bt){return new Ft(bt)};function Ft(jt){Lt.call(this,jt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(Ft,Lt),Ft.prototype.convertTo=function(bt){return this.imod(bt.ushln(this.shift))},Ft.prototype.convertFrom=function(bt){var vt=this.imod(bt.mul(this.rinv));return vt.red=null,vt},Ft.prototype.imul=function(bt,vt){if(bt.isZero()||vt.isZero())return bt.words[0]=0,bt.length=1,bt;var ct=bt.imul(vt),dt=ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mt=ct.isub(dt).iushrn(this.shift),xt=mt;return mt.cmp(this.m)>=0?xt=mt.isub(this.m):mt.cmpn(0)<0&&(xt=mt.iadd(this.m)),xt._forceRed(this)},Ft.prototype.mul=function(bt,vt){if(bt.isZero()||vt.isZero())return new tt(0)._forceRed(this);var ct=bt.mul(vt),dt=ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mt=ct.isub(dt).iushrn(this.shift),xt=mt;return mt.cmp(this.m)>=0?xt=mt.isub(this.m):mt.cmpn(0)<0&&(xt=mt.iadd(this.m)),xt._forceRed(this)},Ft.prototype.invm=function(bt){var vt=this.imod(bt._invmp(this.m).mul(this.r2));return vt._forceRed(this)}})(a,commonjsGlobal)})(bn$4);var bnExports$1=bn$4.exports;const BN$9=getDefaultExportFromCjs$1(bnExports$1);var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var a;brorand.exports=function(et){return a||(a=new _(null)),a.generate(et)};function _(j){this.rand=j}if(brorand.exports.Rand=_,_.prototype.generate=function(et){return this._rand(et)},_.prototype._rand=function(et){if(this.rand.getBytes)return this.rand.getBytes(et);for(var tt=new Uint8Array(et),rt=0;rt=0);return nt},$.prototype._randrange=function(et,tt){var rt=tt.sub(et);return et.add(this._randbelow(rt))},$.prototype.test=function(et,tt,rt){var nt=et.bitLength(),it=a.mont(et),st=new a(1).toRed(it);tt||(tt=Math.max(1,nt/48|0));for(var ot=et.subn(1),at=0;!ot.testn(at);at++);for(var ut=et.shrn(at),ht=ot.toRed(it),yt=!0;tt>0;tt--){var wt=this._randrange(new a(2),ot);rt&&rt(wt);var Ct=wt.toRed(it).redPow(ut);if(!(Ct.cmp(st)===0||Ct.cmp(ht)===0)){for(var Pt=1;Pt0;tt--){var ht=this._randrange(new a(2),st),yt=et.gcd(ht);if(yt.cmpn(1)!==0)return yt;var wt=ht.toRed(nt).redPow(at);if(!(wt.cmp(it)===0||wt.cmp(ut)===0)){for(var Ct=1;CtPt;)Mt.ishrn(1);if(Mt.isEven()&&Mt.iadd(tt),Mt.testn(1)||Mt.iadd(rt),$t.cmp(rt)){if(!$t.cmp(nt))for(;Mt.mod(it).cmp(st);)Mt.iadd(at)}else for(;Mt.mod($).cmp(ot);)Mt.iadd(at);if(Bt=Mt.shrn(1),yt(Bt)&&yt(Mt)&&wt(Bt)&&wt(Mt)&&et.test(Bt)&&et.test(Mt))return Mt}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$2={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var a=bnExports$1,_=requireMr(),$=new _,j=new a(24),et=new a(11),tt=new a(10),rt=new a(3),nt=new a(7),it=requireGeneratePrime(),st=requireBrowser$8();dh=yt;function ot(Ct,Pt){return Pt=Pt||"utf8",Buffer$g.isBuffer(Ct)||(Ct=new Buffer$g(Ct,Pt)),this._pub=new a(Ct),this}function at(Ct,Pt){return Pt=Pt||"utf8",Buffer$g.isBuffer(Ct)||(Ct=new Buffer$g(Ct,Pt)),this._priv=new a(Ct),this}var ut={};function ht(Ct,Pt){var $t=Pt.toString("hex"),Mt=[$t,Ct.toString(16)].join("_");if(Mt in ut)return ut[Mt];var Bt=0;if(Ct.isEven()||!it.simpleSieve||!it.fermatTest(Ct)||!$.test(Ct))return Bt+=1,$t==="02"||$t==="05"?Bt+=8:Bt+=4,ut[Mt]=Bt,Bt;$.test(Ct.shrn(1))||(Bt+=2);var Dt;switch($t){case"02":Ct.mod(j).cmp(et)&&(Bt+=8);break;case"05":Dt=Ct.mod(tt),Dt.cmp(rt)&&Dt.cmp(nt)&&(Bt+=8);break;default:Bt+=4}return ut[Mt]=Bt,Bt}function yt(Ct,Pt,$t){this.setGenerator(Pt),this.__prime=new a(Ct),this._prime=a.mont(this.__prime),this._primeLen=Ct.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,$t?(this.setPublicKey=ot,this.setPrivateKey=at):this._primeCode=8}Object.defineProperty(yt.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=ht(this.__prime,this.__gen)),this._primeCode}}),yt.prototype.generateKeys=function(){return this._priv||(this._priv=new a(st(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},yt.prototype.computeSecret=function(Ct){Ct=new a(Ct),Ct=Ct.toRed(this._prime);var Pt=Ct.redPow(this._priv).fromRed(),$t=new Buffer$g(Pt.toArray()),Mt=this.getPrime();if($t.length"u"||!process$1$1.version||process$1$1.version.indexOf("v0.")===0||process$1$1.version.indexOf("v1.")===0&&process$1$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:a}:processNextickArgs.exports=process$1$1;function a(_,$,j,et){if(typeof _!="function")throw new TypeError('"callback" argument must be a function');var tt=arguments.length,rt,nt;switch(tt){case 0:case 1:return process$1$1.nextTick(_);case 2:return process$1$1.nextTick(function(){_.call(null,$)});case 3:return process$1$1.nextTick(function(){_.call(null,$,j)});case 4:return process$1$1.nextTick(function(){_.call(null,$,j,et)});default:for(rt=new Array(tt-1),nt=0;nt"u"}util$4.isPrimitive=ht,util$4.isBuffer=buffer$1.Buffer.isBuffer;function yt(wt){return Object.prototype.toString.call(wt)}return util$4}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,function(a){function _(tt,rt){if(!(tt instanceof rt))throw new TypeError("Cannot call a class as a function")}var $=requireSafeBuffer$1().Buffer,j=util$5;function et(tt,rt,nt){tt.copy(rt,nt)}a.exports=function(){function tt(){_(this,tt),this.head=null,this.tail=null,this.length=0}return tt.prototype.push=function(nt){var it={data:nt,next:null};this.length>0?this.tail.next=it:this.head=it,this.tail=it,++this.length},tt.prototype.unshift=function(nt){var it={data:nt,next:this.head};this.length===0&&(this.tail=it),this.head=it,++this.length},tt.prototype.shift=function(){if(this.length!==0){var nt=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,nt}},tt.prototype.clear=function(){this.head=this.tail=null,this.length=0},tt.prototype.join=function(nt){if(this.length===0)return"";for(var it=this.head,st=""+it.data;it=it.next;)st+=nt+it.data;return st},tt.prototype.concat=function(nt){if(this.length===0)return $.alloc(0);for(var it=$.allocUnsafe(nt>>>0),st=this.head,ot=0;st;)et(st.data,it,ot),ot+=st.data.length,st=st.next;return it},tt}(),j&&j.inspect&&j.inspect.custom&&(a.exports.prototype[j.inspect.custom]=function(){var tt=j.inspect({length:this.length});return this.constructor.name+" "+tt})}(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var a=requireProcessNextickArgs();function _(et,tt){var rt=this,nt=this._readableState&&this._readableState.destroyed,it=this._writableState&&this._writableState.destroyed;return nt||it?(tt?tt(et):et&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,a.nextTick(j,this,et)):a.nextTick(j,this,et)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(et||null,function(st){!tt&&st?rt._writableState?rt._writableState.errorEmitted||(rt._writableState.errorEmitted=!0,a.nextTick(j,rt,st)):a.nextTick(j,rt,st):tt&&tt(st)}),this)}function $(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function j(et,tt){et.emit("error",tt)}return destroy_1={destroy:_,undestroy:$},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var a=requireProcessNextickArgs();_stream_writable=wt;function _(xt){var At=this;this.next=null,this.entry=null,this.finish=function(){mt(At,xt)}}var $=!process$1$1.browser&&["v0.10","v0.9."].indexOf(process$1$1.version.slice(0,5))>-1?setImmediate:a.nextTick,j;wt.WritableState=ht;var et=Object.create(requireUtil());et.inherits=inherits_browserExports;var tt={deprecate:browser$c},rt=requireStreamBrowser(),nt=requireSafeBuffer$1().Buffer,it=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function st(xt){return nt.from(xt)}function ot(xt){return nt.isBuffer(xt)||xt instanceof it}var at=requireDestroy();et.inherits(wt,rt);function ut(){}function ht(xt,At){j=j||require_stream_duplex(),xt=xt||{};var Rt=At instanceof j;this.objectMode=!!xt.objectMode,Rt&&(this.objectMode=this.objectMode||!!xt.writableObjectMode);var St=xt.highWaterMark,Tt=xt.writableHighWaterMark,Et=this.objectMode?16:16*1024;St||St===0?this.highWaterMark=St:Rt&&(Tt||Tt===0)?this.highWaterMark=Tt:this.highWaterMark=Et,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Nt=xt.decodeStrings===!1;this.decodeStrings=!Nt,this.defaultEncoding=xt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(tr){Ot(At,tr)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new _(this)}ht.prototype.getBuffer=function(){for(var At=this.bufferedRequest,Rt=[];At;)Rt.push(At),At=At.next;return Rt},function(){try{Object.defineProperty(ht.prototype,"buffer",{get:tt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var yt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(yt=Function.prototype[Symbol.hasInstance],Object.defineProperty(wt,Symbol.hasInstance,{value:function(xt){return yt.call(this,xt)?!0:this!==wt?!1:xt&&xt._writableState instanceof ht}})):yt=function(xt){return xt instanceof this};function wt(xt){if(j=j||require_stream_duplex(),!yt.call(wt,this)&&!(this instanceof j))return new wt(xt);this._writableState=new ht(xt,this),this.writable=!0,xt&&(typeof xt.write=="function"&&(this._write=xt.write),typeof xt.writev=="function"&&(this._writev=xt.writev),typeof xt.destroy=="function"&&(this._destroy=xt.destroy),typeof xt.final=="function"&&(this._final=xt.final)),rt.call(this)}wt.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Ct(xt,At){var Rt=new Error("write after end");xt.emit("error",Rt),a.nextTick(At,Rt)}function Pt(xt,At,Rt,St){var Tt=!0,Et=!1;return Rt===null?Et=new TypeError("May not write null values to stream"):typeof Rt!="string"&&Rt!==void 0&&!At.objectMode&&(Et=new TypeError("Invalid non-string/buffer chunk")),Et&&(xt.emit("error",Et),a.nextTick(St,Et),Tt=!1),Tt}wt.prototype.write=function(xt,At,Rt){var St=this._writableState,Tt=!1,Et=!St.objectMode&&ot(xt);return Et&&!nt.isBuffer(xt)&&(xt=st(xt)),typeof At=="function"&&(Rt=At,At=null),Et?At="buffer":At||(At=St.defaultEncoding),typeof Rt!="function"&&(Rt=ut),St.ended?Ct(this,Rt):(Et||Pt(this,St,xt,Rt))&&(St.pendingcb++,Tt=Mt(this,St,Et,xt,At,Rt)),Tt},wt.prototype.cork=function(){var xt=this._writableState;xt.corked++},wt.prototype.uncork=function(){var xt=this._writableState;xt.corked&&(xt.corked--,!xt.writing&&!xt.corked&&!xt.bufferProcessing&&xt.bufferedRequest&&Ft(this,xt))},wt.prototype.setDefaultEncoding=function(At){if(typeof At=="string"&&(At=At.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((At+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+At);return this._writableState.defaultEncoding=At,this};function $t(xt,At,Rt){return!xt.objectMode&&xt.decodeStrings!==!1&&typeof At=="string"&&(At=nt.from(At,Rt)),At}Object.defineProperty(wt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Mt(xt,At,Rt,St,Tt,Et){if(!Rt){var Nt=$t(At,St,Tt);St!==Nt&&(Rt=!0,Tt="buffer",St=Nt)}var tr=At.objectMode?1:St.length;At.length+=tr;var ir=At.length>5===6?2:Pt>>4===14?3:Pt>>3===30?4:Pt>>6===2?-1:-2}function rt(Pt,$t,Mt){var Bt=$t.length-1;if(Bt=0?(Dt>0&&(Pt.lastNeed=Dt-1),Dt):--Bt=0?(Dt>0&&(Pt.lastNeed=Dt-2),Dt):--Bt=0?(Dt>0&&(Dt===2?Dt=0:Pt.lastNeed=Dt-3),Dt):0))}function nt(Pt,$t,Mt){if(($t[0]&192)!==128)return Pt.lastNeed=0,"�";if(Pt.lastNeed>1&&$t.length>1){if(($t[1]&192)!==128)return Pt.lastNeed=1,"�";if(Pt.lastNeed>2&&$t.length>2&&($t[2]&192)!==128)return Pt.lastNeed=2,"�"}}function it(Pt){var $t=this.lastTotal-this.lastNeed,Mt=nt(this,Pt);if(Mt!==void 0)return Mt;if(this.lastNeed<=Pt.length)return Pt.copy(this.lastChar,$t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Pt.copy(this.lastChar,$t,0,Pt.length),this.lastNeed-=Pt.length}function st(Pt,$t){var Mt=rt(this,Pt,$t);if(!this.lastNeed)return Pt.toString("utf8",$t);this.lastTotal=Mt;var Bt=Pt.length-(Mt-this.lastNeed);return Pt.copy(this.lastChar,0,Bt),Pt.toString("utf8",$t,Bt)}function ot(Pt){var $t=Pt&&Pt.length?this.write(Pt):"";return this.lastNeed?$t+"�":$t}function at(Pt,$t){if((Pt.length-$t)%2===0){var Mt=Pt.toString("utf16le",$t);if(Mt){var Bt=Mt.charCodeAt(Mt.length-1);if(Bt>=55296&&Bt<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=Pt[Pt.length-2],this.lastChar[1]=Pt[Pt.length-1],Mt.slice(0,-1)}return Mt}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=Pt[Pt.length-1],Pt.toString("utf16le",$t,Pt.length-1)}function ut(Pt){var $t=Pt&&Pt.length?this.write(Pt):"";if(this.lastNeed){var Mt=this.lastTotal-this.lastNeed;return $t+this.lastChar.toString("utf16le",0,Mt)}return $t}function ht(Pt,$t){var Mt=(Pt.length-$t)%3;return Mt===0?Pt.toString("base64",$t):(this.lastNeed=3-Mt,this.lastTotal=3,Mt===1?this.lastChar[0]=Pt[Pt.length-1]:(this.lastChar[0]=Pt[Pt.length-2],this.lastChar[1]=Pt[Pt.length-1]),Pt.toString("base64",$t,Pt.length-Mt))}function yt(Pt){var $t=Pt&&Pt.length?this.write(Pt):"";return this.lastNeed?$t+this.lastChar.toString("base64",0,3-this.lastNeed):$t}function wt(Pt){return Pt.toString(this.encoding)}function Ct(Pt){return Pt&&Pt.length?this.write(Pt):""}return string_decoder}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var a=requireProcessNextickArgs();_stream_readable=$t;var _=requireIsarray(),$;$t.ReadableState=Pt,eventsExports.EventEmitter;var j=function(Zt,Kt){return Zt.listeners(Kt).length},et=requireStreamBrowser(),tt=requireSafeBuffer$1().Buffer,rt=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function nt(Zt){return tt.from(Zt)}function it(Zt){return tt.isBuffer(Zt)||Zt instanceof rt}var st=Object.create(requireUtil());st.inherits=inherits_browserExports;var ot=util$5,at=void 0;ot&&ot.debuglog?at=ot.debuglog("stream"):at=function(){};var ut=requireBufferList(),ht=requireDestroy(),yt;st.inherits($t,et);var wt=["error","close","destroy","pause","resume"];function Ct(Zt,Kt,Qt){if(typeof Zt.prependListener=="function")return Zt.prependListener(Kt,Qt);!Zt._events||!Zt._events[Kt]?Zt.on(Kt,Qt):_(Zt._events[Kt])?Zt._events[Kt].unshift(Qt):Zt._events[Kt]=[Qt,Zt._events[Kt]]}function Pt(Zt,Kt){$=$||require_stream_duplex(),Zt=Zt||{};var Qt=Kt instanceof $;this.objectMode=!!Zt.objectMode,Qt&&(this.objectMode=this.objectMode||!!Zt.readableObjectMode);var Ht=Zt.highWaterMark,qt=Zt.readableHighWaterMark,Jt=this.objectMode?16:16*1024;Ht||Ht===0?this.highWaterMark=Ht:Qt&&(qt||qt===0)?this.highWaterMark=qt:this.highWaterMark=Jt,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new ut,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=Zt.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Zt.encoding&&(yt||(yt=requireString_decoder().StringDecoder),this.decoder=new yt(Zt.encoding),this.encoding=Zt.encoding)}function $t(Zt){if($=$||require_stream_duplex(),!(this instanceof $t))return new $t(Zt);this._readableState=new Pt(Zt,this),this.readable=!0,Zt&&(typeof Zt.read=="function"&&(this._read=Zt.read),typeof Zt.destroy=="function"&&(this._destroy=Zt.destroy)),et.call(this)}Object.defineProperty($t.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Zt){this._readableState&&(this._readableState.destroyed=Zt)}}),$t.prototype.destroy=ht.destroy,$t.prototype._undestroy=ht.undestroy,$t.prototype._destroy=function(Zt,Kt){this.push(null),Kt(Zt)},$t.prototype.push=function(Zt,Kt){var Qt=this._readableState,Ht;return Qt.objectMode?Ht=!0:typeof Zt=="string"&&(Kt=Kt||Qt.defaultEncoding,Kt!==Qt.encoding&&(Zt=tt.from(Zt,Kt),Kt=""),Ht=!0),Mt(this,Zt,Kt,!1,Ht)},$t.prototype.unshift=function(Zt){return Mt(this,Zt,null,!0,!1)};function Mt(Zt,Kt,Qt,Ht,qt){var Jt=Zt._readableState;if(Kt===null)Jt.reading=!1,Ft(Zt,Jt);else{var ur;qt||(ur=Dt(Jt,Kt)),ur?Zt.emit("error",ur):Jt.objectMode||Kt&&Kt.length>0?(typeof Kt!="string"&&!Jt.objectMode&&Object.getPrototypeOf(Kt)!==tt.prototype&&(Kt=nt(Kt)),Ht?Jt.endEmitted?Zt.emit("error",new Error("stream.unshift() after end event")):Bt(Zt,Jt,Kt,!0):Jt.ended?Zt.emit("error",new Error("stream.push() after EOF")):(Jt.reading=!1,Jt.decoder&&!Qt?(Kt=Jt.decoder.write(Kt),Jt.objectMode||Kt.length!==0?Bt(Zt,Jt,Kt,!1):vt(Zt,Jt)):Bt(Zt,Jt,Kt,!1))):Ht||(Jt.reading=!1)}return zt(Jt)}function Bt(Zt,Kt,Qt,Ht){Kt.flowing&&Kt.length===0&&!Kt.sync?(Zt.emit("data",Qt),Zt.read(0)):(Kt.length+=Kt.objectMode?1:Qt.length,Ht?Kt.buffer.unshift(Qt):Kt.buffer.push(Qt),Kt.needReadable&&jt(Zt)),vt(Zt,Kt)}function Dt(Zt,Kt){var Qt;return!it(Kt)&&typeof Kt!="string"&&Kt!==void 0&&!Zt.objectMode&&(Qt=new TypeError("Invalid non-string/buffer chunk")),Qt}function zt(Zt){return!Zt.ended&&(Zt.needReadable||Zt.length=Ot?Zt=Ot:(Zt--,Zt|=Zt>>>1,Zt|=Zt>>>2,Zt|=Zt>>>4,Zt|=Zt>>>8,Zt|=Zt>>>16,Zt++),Zt}function Lt(Zt,Kt){return Zt<=0||Kt.length===0&&Kt.ended?0:Kt.objectMode?1:Zt!==Zt?Kt.flowing&&Kt.length?Kt.buffer.head.data.length:Kt.length:(Zt>Kt.highWaterMark&&(Kt.highWaterMark=It(Zt)),Zt<=Kt.length?Zt:Kt.ended?Kt.length:(Kt.needReadable=!0,0))}$t.prototype.read=function(Zt){at("read",Zt),Zt=parseInt(Zt,10);var Kt=this._readableState,Qt=Zt;if(Zt!==0&&(Kt.emittedReadable=!1),Zt===0&&Kt.needReadable&&(Kt.length>=Kt.highWaterMark||Kt.ended))return at("read: emitReadable",Kt.length,Kt.ended),Kt.length===0&&Kt.ended?tr(this):jt(this),null;if(Zt=Lt(Zt,Kt),Zt===0&&Kt.ended)return Kt.length===0&&tr(this),null;var Ht=Kt.needReadable;at("need readable",Ht),(Kt.length===0||Kt.length-Zt0?qt=St(Zt,Kt):qt=null,qt===null?(Kt.needReadable=!0,Zt=0):Kt.length-=Zt,Kt.length===0&&(Kt.ended||(Kt.needReadable=!0),Qt!==Zt&&Kt.ended&&tr(this)),qt!==null&&this.emit("data",qt),qt};function Ft(Zt,Kt){if(!Kt.ended){if(Kt.decoder){var Qt=Kt.decoder.end();Qt&&Qt.length&&(Kt.buffer.push(Qt),Kt.length+=Kt.objectMode?1:Qt.length)}Kt.ended=!0,jt(Zt)}}function jt(Zt){var Kt=Zt._readableState;Kt.needReadable=!1,Kt.emittedReadable||(at("emitReadable",Kt.flowing),Kt.emittedReadable=!0,Kt.sync?a.nextTick(bt,Zt):bt(Zt))}function bt(Zt){at("emit readable"),Zt.emit("readable"),Rt(Zt)}function vt(Zt,Kt){Kt.readingMore||(Kt.readingMore=!0,a.nextTick(ct,Zt,Kt))}function ct(Zt,Kt){for(var Qt=Kt.length;!Kt.reading&&!Kt.flowing&&!Kt.ended&&Kt.length1&&nr(Ht.pipes,Zt)!==-1)&&!Cr&&(at("false write response, pause",Ht.awaitDrain),Ht.awaitDrain++,lr=!0),Qt.pause())}function _r($r){at("onerror",$r),Ar(),Zt.removeListener("error",_r),j(Zt,"error")===0&&Zt.emit("error",$r)}Ct(Zt,"error",_r);function Sr(){Zt.removeListener("finish",kr),Ar()}Zt.once("close",Sr);function kr(){at("onfinish"),Zt.removeListener("close",Sr),Ar()}Zt.once("finish",kr);function Ar(){at("unpipe"),Qt.unpipe(Zt)}return Zt.emit("pipe",Qt),Ht.flowing||(at("pipe resume"),Qt.resume()),Zt};function dt(Zt){return function(){var Kt=Zt._readableState;at("pipeOnDrain",Kt.awaitDrain),Kt.awaitDrain&&Kt.awaitDrain--,Kt.awaitDrain===0&&j(Zt,"data")&&(Kt.flowing=!0,Rt(Zt))}}$t.prototype.unpipe=function(Zt){var Kt=this._readableState,Qt={hasUnpiped:!1};if(Kt.pipesCount===0)return this;if(Kt.pipesCount===1)return Zt&&Zt!==Kt.pipes?this:(Zt||(Zt=Kt.pipes),Kt.pipes=null,Kt.pipesCount=0,Kt.flowing=!1,Zt&&Zt.emit("unpipe",this,Qt),this);if(!Zt){var Ht=Kt.pipes,qt=Kt.pipesCount;Kt.pipes=null,Kt.pipesCount=0,Kt.flowing=!1;for(var Jt=0;Jt=Kt.length?(Kt.decoder?Qt=Kt.buffer.join(""):Kt.buffer.length===1?Qt=Kt.buffer.head.data:Qt=Kt.buffer.concat(Kt.length),Kt.buffer.clear()):Qt=Tt(Zt,Kt.buffer,Kt.decoder),Qt}function Tt(Zt,Kt,Qt){var Ht;return ZtJt.length?Jt.length:Zt;if(ur===Jt.length?qt+=Jt:qt+=Jt.slice(0,Zt),Zt-=ur,Zt===0){ur===Jt.length?(++Ht,Qt.next?Kt.head=Qt.next:Kt.head=Kt.tail=null):(Kt.head=Qt,Qt.data=Jt.slice(ur));break}++Ht}return Kt.length-=Ht,qt}function Nt(Zt,Kt){var Qt=tt.allocUnsafe(Zt),Ht=Kt.head,qt=1;for(Ht.data.copy(Qt),Zt-=Ht.data.length;Ht=Ht.next;){var Jt=Ht.data,ur=Zt>Jt.length?Jt.length:Zt;if(Jt.copy(Qt,Qt.length-Zt,0,ur),Zt-=ur,Zt===0){ur===Jt.length?(++qt,Ht.next?Kt.head=Ht.next:Kt.head=Kt.tail=null):(Kt.head=Ht,Ht.data=Jt.slice(ur));break}++qt}return Kt.length-=qt,Qt}function tr(Zt){var Kt=Zt._readableState;if(Kt.length>0)throw new Error('"endReadable()" called on non-empty stream');Kt.endEmitted||(Kt.ended=!0,a.nextTick(ir,Kt,Zt))}function ir(Zt,Kt){!Zt.endEmitted&&Zt.length===0&&(Zt.endEmitted=!0,Kt.readable=!1,Kt.emit("end"))}function nr(Zt,Kt){for(var Qt=0,Ht=Zt.length;Qt0?ct:dt},tt.min=function(ct,dt){return ct.cmp(dt)<0?ct:dt},tt.prototype._init=function(ct,dt,mt){if(typeof ct=="number")return this._initNumber(ct,dt,mt);if(typeof ct=="object")return this._initArray(ct,dt,mt);dt==="hex"&&(dt=16),j(dt===(dt|0)&&dt>=2&&dt<=36),ct=ct.toString().replace(/\s+/g,"");var xt=0;ct[0]==="-"&&(xt++,this.negative=1),xt=0;xt-=3)Rt=ct[xt]|ct[xt-1]<<8|ct[xt-2]<<16,this.words[At]|=Rt<>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);else if(mt==="le")for(xt=0,At=0;xt>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);return this._strip()};function nt(vt,ct){var dt=vt.charCodeAt(ct);if(dt>=48&&dt<=57)return dt-48;if(dt>=65&&dt<=70)return dt-55;if(dt>=97&&dt<=102)return dt-87;j(!1,"Invalid character in "+vt)}function it(vt,ct,dt){var mt=nt(vt,dt);return dt-1>=ct&&(mt|=nt(vt,dt-1)<<4),mt}tt.prototype._parseHex=function(ct,dt,mt){this.length=Math.ceil((ct.length-dt)/6),this.words=new Array(this.length);for(var xt=0;xt=dt;xt-=2)St=it(ct,dt,xt)<=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8;else{var Tt=ct.length-dt;for(xt=Tt%2===0?dt+1:dt;xt=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8}this._strip()};function st(vt,ct,dt,mt){for(var xt=0,At=0,Rt=Math.min(vt.length,dt),St=ct;St=49?At=Tt-49+10:Tt>=17?At=Tt-17+10:At=Tt,j(Tt>=0&&At1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=at}catch{tt.prototype.inspect=at}else tt.prototype.inspect=at;function at(){return(this.red?""}var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],yt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(ct,dt){ct=ct||10,dt=dt|0||1;var mt;if(ct===16||ct==="hex"){mt="";for(var xt=0,At=0,Rt=0;Rt>>24-xt&16777215,xt+=2,xt>=26&&(xt-=26,Rt--),At!==0||Rt!==this.length-1?mt=ut[6-Tt.length]+Tt+mt:mt=Tt+mt}for(At!==0&&(mt=At.toString(16)+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}if(ct===(ct|0)&&ct>=2&&ct<=36){var Et=ht[ct],Nt=yt[ct];mt="";var tr=this.clone();for(tr.negative=0;!tr.isZero();){var ir=tr.modrn(Nt).toString(ct);tr=tr.idivn(Nt),tr.isZero()?mt=ir+mt:mt=ut[Et-ir.length]+ir+mt}for(this.isZero()&&(mt="0"+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var ct=this.words[0];return this.length===2?ct+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ct+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ct:ct},tt.prototype.toJSON=function(){return this.toString(16,2)},rt&&(tt.prototype.toBuffer=function(ct,dt){return this.toArrayLike(rt,ct,dt)}),tt.prototype.toArray=function(ct,dt){return this.toArrayLike(Array,ct,dt)};var wt=function(ct,dt){return ct.allocUnsafe?ct.allocUnsafe(dt):new ct(dt)};tt.prototype.toArrayLike=function(ct,dt,mt){this._strip();var xt=this.byteLength(),At=mt||Math.max(1,xt);j(xt<=At,"byte array longer than desired length"),j(At>0,"Requested array length <= 0");var Rt=wt(ct,At),St=dt==="le"?"LE":"BE";return this["_toArrayLike"+St](Rt,xt),Rt},tt.prototype._toArrayLikeLE=function(ct,dt){for(var mt=0,xt=0,At=0,Rt=0;At>8&255),mt>16&255),Rt===6?(mt>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt=0&&(ct[mt--]=St>>8&255),mt>=0&&(ct[mt--]=St>>16&255),Rt===6?(mt>=0&&(ct[mt--]=St>>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt>=0)for(ct[mt--]=xt;mt>=0;)ct[mt--]=0},Math.clz32?tt.prototype._countBits=function(ct){return 32-Math.clz32(ct)}:tt.prototype._countBits=function(ct){var dt=ct,mt=0;return dt>=4096&&(mt+=13,dt>>>=13),dt>=64&&(mt+=7,dt>>>=7),dt>=8&&(mt+=4,dt>>>=4),dt>=2&&(mt+=2,dt>>>=2),mt+dt},tt.prototype._zeroBits=function(ct){if(ct===0)return 26;var dt=ct,mt=0;return dt&8191||(mt+=13,dt>>>=13),dt&127||(mt+=7,dt>>>=7),dt&15||(mt+=4,dt>>>=4),dt&3||(mt+=2,dt>>>=2),dt&1||mt++,mt},tt.prototype.bitLength=function(){var ct=this.words[this.length-1],dt=this._countBits(ct);return(this.length-1)*26+dt};function Ct(vt){for(var ct=new Array(vt.bitLength()),dt=0;dt>>xt&1}return ct}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ct=0,dt=0;dtct.length?this.clone().ior(ct):ct.clone().ior(this)},tt.prototype.uor=function(ct){return this.length>ct.length?this.clone().iuor(ct):ct.clone().iuor(this)},tt.prototype.iuand=function(ct){var dt;this.length>ct.length?dt=ct:dt=this;for(var mt=0;mtct.length?this.clone().iand(ct):ct.clone().iand(this)},tt.prototype.uand=function(ct){return this.length>ct.length?this.clone().iuand(ct):ct.clone().iuand(this)},tt.prototype.iuxor=function(ct){var dt,mt;this.length>ct.length?(dt=this,mt=ct):(dt=ct,mt=this);for(var xt=0;xtct.length?this.clone().ixor(ct):ct.clone().ixor(this)},tt.prototype.uxor=function(ct){return this.length>ct.length?this.clone().iuxor(ct):ct.clone().iuxor(this)},tt.prototype.inotn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=Math.ceil(ct/26)|0,mt=ct%26;this._expand(dt),mt>0&&dt--;for(var xt=0;xt0&&(this.words[xt]=~this.words[xt]&67108863>>26-mt),this._strip()},tt.prototype.notn=function(ct){return this.clone().inotn(ct)},tt.prototype.setn=function(ct,dt){j(typeof ct=="number"&&ct>=0);var mt=ct/26|0,xt=ct%26;return this._expand(mt+1),dt?this.words[mt]=this.words[mt]|1<ct.length?(mt=this,xt=ct):(mt=ct,xt=this);for(var At=0,Rt=0;Rt>>26;for(;At!==0&&Rt>>26;if(this.length=mt.length,At!==0)this.words[this.length]=At,this.length++;else if(mt!==this)for(;Rtct.length?this.clone().iadd(ct):ct.clone().iadd(this)},tt.prototype.isub=function(ct){if(ct.negative!==0){ct.negative=0;var dt=this.iadd(ct);return ct.negative=1,dt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ct),this.negative=1,this._normSign();var mt=this.cmp(ct);if(mt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var xt,At;mt>0?(xt=this,At=ct):(xt=ct,At=this);for(var Rt=0,St=0;St>26,this.words[St]=dt&67108863;for(;Rt!==0&&St>26,this.words[St]=dt&67108863;if(Rt===0&&St>>26,tr=Tt&67108863,ir=Math.min(Et,ct.length-1),nr=Math.max(0,Et-vt.length+1);nr<=ir;nr++){var Zt=Et-nr|0;xt=vt.words[Zt]|0,At=ct.words[nr]|0,Rt=xt*At+tr,Nt+=Rt/67108864|0,tr=Rt&67108863}dt.words[Et]=tr|0,Tt=Nt|0}return Tt!==0?dt.words[Et]=Tt|0:dt.length--,dt._strip()}var $t=function(ct,dt,mt){var xt=ct.words,At=dt.words,Rt=mt.words,St=0,Tt,Et,Nt,tr=xt[0]|0,ir=tr&8191,nr=tr>>>13,Zt=xt[1]|0,Kt=Zt&8191,Qt=Zt>>>13,Ht=xt[2]|0,qt=Ht&8191,Jt=Ht>>>13,ur=xt[3]|0,xr=ur&8191,pr=ur>>>13,Cr=xt[4]|0,Mr=Cr&8191,lr=Cr>>>13,fr=xt[5]|0,_r=fr&8191,Sr=fr>>>13,kr=xt[6]|0,Ar=kr&8191,$r=kr>>>13,Or=xt[7]|0,Br=Or&8191,or=Or>>>13,Yt=xt[8]|0,er=Yt&8191,Gt=Yt>>>13,Vt=xt[9]|0,Wt=Vt&8191,ar=Vt>>>13,yr=At[0]|0,Er=yr&8191,Rr=yr>>>13,Wr=At[1]|0,Hr=Wr&8191,Fr=Wr>>>13,pn=At[2]|0,Jr=pn&8191,Qr=pn>>>13,mn=At[3]|0,ln=mn&8191,qr=mn>>>13,En=At[4]|0,un=En&8191,Vr=En>>>13,hn=At[5]|0,fn=hn&8191,Kr=hn>>>13,Rn=At[6]|0,dn=Rn&8191,Gr=Rn>>>13,gn=At[7]|0,an=gn&8191,Zr=gn>>>13,An=At[8]|0,Sn=An&8191,nn=An>>>13,Pn=At[9]|0,yn=Pn&8191,_n=Pn>>>13;mt.negative=ct.negative^dt.negative,mt.length=19,Tt=Math.imul(ir,Er),Et=Math.imul(ir,Rr),Et=Et+Math.imul(nr,Er)|0,Nt=Math.imul(nr,Rr);var ds=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ds>>>26)|0,ds&=67108863,Tt=Math.imul(Kt,Er),Et=Math.imul(Kt,Rr),Et=Et+Math.imul(Qt,Er)|0,Nt=Math.imul(Qt,Rr),Tt=Tt+Math.imul(ir,Hr)|0,Et=Et+Math.imul(ir,Fr)|0,Et=Et+Math.imul(nr,Hr)|0,Nt=Nt+Math.imul(nr,Fr)|0;var fs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(fs>>>26)|0,fs&=67108863,Tt=Math.imul(qt,Er),Et=Math.imul(qt,Rr),Et=Et+Math.imul(Jt,Er)|0,Nt=Math.imul(Jt,Rr),Tt=Tt+Math.imul(Kt,Hr)|0,Et=Et+Math.imul(Kt,Fr)|0,Et=Et+Math.imul(Qt,Hr)|0,Nt=Nt+Math.imul(Qt,Fr)|0,Tt=Tt+Math.imul(ir,Jr)|0,Et=Et+Math.imul(ir,Qr)|0,Et=Et+Math.imul(nr,Jr)|0,Nt=Nt+Math.imul(nr,Qr)|0;var hs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(hs>>>26)|0,hs&=67108863,Tt=Math.imul(xr,Er),Et=Math.imul(xr,Rr),Et=Et+Math.imul(pr,Er)|0,Nt=Math.imul(pr,Rr),Tt=Tt+Math.imul(qt,Hr)|0,Et=Et+Math.imul(qt,Fr)|0,Et=Et+Math.imul(Jt,Hr)|0,Nt=Nt+Math.imul(Jt,Fr)|0,Tt=Tt+Math.imul(Kt,Jr)|0,Et=Et+Math.imul(Kt,Qr)|0,Et=Et+Math.imul(Qt,Jr)|0,Nt=Nt+Math.imul(Qt,Qr)|0,Tt=Tt+Math.imul(ir,ln)|0,Et=Et+Math.imul(ir,qr)|0,Et=Et+Math.imul(nr,ln)|0,Nt=Nt+Math.imul(nr,qr)|0;var ps=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ps>>>26)|0,ps&=67108863,Tt=Math.imul(Mr,Er),Et=Math.imul(Mr,Rr),Et=Et+Math.imul(lr,Er)|0,Nt=Math.imul(lr,Rr),Tt=Tt+Math.imul(xr,Hr)|0,Et=Et+Math.imul(xr,Fr)|0,Et=Et+Math.imul(pr,Hr)|0,Nt=Nt+Math.imul(pr,Fr)|0,Tt=Tt+Math.imul(qt,Jr)|0,Et=Et+Math.imul(qt,Qr)|0,Et=Et+Math.imul(Jt,Jr)|0,Nt=Nt+Math.imul(Jt,Qr)|0,Tt=Tt+Math.imul(Kt,ln)|0,Et=Et+Math.imul(Kt,qr)|0,Et=Et+Math.imul(Qt,ln)|0,Nt=Nt+Math.imul(Qt,qr)|0,Tt=Tt+Math.imul(ir,un)|0,Et=Et+Math.imul(ir,Vr)|0,Et=Et+Math.imul(nr,un)|0,Nt=Nt+Math.imul(nr,Vr)|0;var Vn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Tt=Math.imul(_r,Er),Et=Math.imul(_r,Rr),Et=Et+Math.imul(Sr,Er)|0,Nt=Math.imul(Sr,Rr),Tt=Tt+Math.imul(Mr,Hr)|0,Et=Et+Math.imul(Mr,Fr)|0,Et=Et+Math.imul(lr,Hr)|0,Nt=Nt+Math.imul(lr,Fr)|0,Tt=Tt+Math.imul(xr,Jr)|0,Et=Et+Math.imul(xr,Qr)|0,Et=Et+Math.imul(pr,Jr)|0,Nt=Nt+Math.imul(pr,Qr)|0,Tt=Tt+Math.imul(qt,ln)|0,Et=Et+Math.imul(qt,qr)|0,Et=Et+Math.imul(Jt,ln)|0,Nt=Nt+Math.imul(Jt,qr)|0,Tt=Tt+Math.imul(Kt,un)|0,Et=Et+Math.imul(Kt,Vr)|0,Et=Et+Math.imul(Qt,un)|0,Nt=Nt+Math.imul(Qt,Vr)|0,Tt=Tt+Math.imul(ir,fn)|0,Et=Et+Math.imul(ir,Kr)|0,Et=Et+Math.imul(nr,fn)|0,Nt=Nt+Math.imul(nr,Kr)|0;var ss=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ss>>>26)|0,ss&=67108863,Tt=Math.imul(Ar,Er),Et=Math.imul(Ar,Rr),Et=Et+Math.imul($r,Er)|0,Nt=Math.imul($r,Rr),Tt=Tt+Math.imul(_r,Hr)|0,Et=Et+Math.imul(_r,Fr)|0,Et=Et+Math.imul(Sr,Hr)|0,Nt=Nt+Math.imul(Sr,Fr)|0,Tt=Tt+Math.imul(Mr,Jr)|0,Et=Et+Math.imul(Mr,Qr)|0,Et=Et+Math.imul(lr,Jr)|0,Nt=Nt+Math.imul(lr,Qr)|0,Tt=Tt+Math.imul(xr,ln)|0,Et=Et+Math.imul(xr,qr)|0,Et=Et+Math.imul(pr,ln)|0,Nt=Nt+Math.imul(pr,qr)|0,Tt=Tt+Math.imul(qt,un)|0,Et=Et+Math.imul(qt,Vr)|0,Et=Et+Math.imul(Jt,un)|0,Nt=Nt+Math.imul(Jt,Vr)|0,Tt=Tt+Math.imul(Kt,fn)|0,Et=Et+Math.imul(Kt,Kr)|0,Et=Et+Math.imul(Qt,fn)|0,Nt=Nt+Math.imul(Qt,Kr)|0,Tt=Tt+Math.imul(ir,dn)|0,Et=Et+Math.imul(ir,Gr)|0,Et=Et+Math.imul(nr,dn)|0,Nt=Nt+Math.imul(nr,Gr)|0;var Jn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Tt=Math.imul(Br,Er),Et=Math.imul(Br,Rr),Et=Et+Math.imul(or,Er)|0,Nt=Math.imul(or,Rr),Tt=Tt+Math.imul(Ar,Hr)|0,Et=Et+Math.imul(Ar,Fr)|0,Et=Et+Math.imul($r,Hr)|0,Nt=Nt+Math.imul($r,Fr)|0,Tt=Tt+Math.imul(_r,Jr)|0,Et=Et+Math.imul(_r,Qr)|0,Et=Et+Math.imul(Sr,Jr)|0,Nt=Nt+Math.imul(Sr,Qr)|0,Tt=Tt+Math.imul(Mr,ln)|0,Et=Et+Math.imul(Mr,qr)|0,Et=Et+Math.imul(lr,ln)|0,Nt=Nt+Math.imul(lr,qr)|0,Tt=Tt+Math.imul(xr,un)|0,Et=Et+Math.imul(xr,Vr)|0,Et=Et+Math.imul(pr,un)|0,Nt=Nt+Math.imul(pr,Vr)|0,Tt=Tt+Math.imul(qt,fn)|0,Et=Et+Math.imul(qt,Kr)|0,Et=Et+Math.imul(Jt,fn)|0,Nt=Nt+Math.imul(Jt,Kr)|0,Tt=Tt+Math.imul(Kt,dn)|0,Et=Et+Math.imul(Kt,Gr)|0,Et=Et+Math.imul(Qt,dn)|0,Nt=Nt+Math.imul(Qt,Gr)|0,Tt=Tt+Math.imul(ir,an)|0,Et=Et+Math.imul(ir,Zr)|0,Et=Et+Math.imul(nr,an)|0,Nt=Nt+Math.imul(nr,Zr)|0;var Yn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Tt=Math.imul(er,Er),Et=Math.imul(er,Rr),Et=Et+Math.imul(Gt,Er)|0,Nt=Math.imul(Gt,Rr),Tt=Tt+Math.imul(Br,Hr)|0,Et=Et+Math.imul(Br,Fr)|0,Et=Et+Math.imul(or,Hr)|0,Nt=Nt+Math.imul(or,Fr)|0,Tt=Tt+Math.imul(Ar,Jr)|0,Et=Et+Math.imul(Ar,Qr)|0,Et=Et+Math.imul($r,Jr)|0,Nt=Nt+Math.imul($r,Qr)|0,Tt=Tt+Math.imul(_r,ln)|0,Et=Et+Math.imul(_r,qr)|0,Et=Et+Math.imul(Sr,ln)|0,Nt=Nt+Math.imul(Sr,qr)|0,Tt=Tt+Math.imul(Mr,un)|0,Et=Et+Math.imul(Mr,Vr)|0,Et=Et+Math.imul(lr,un)|0,Nt=Nt+Math.imul(lr,Vr)|0,Tt=Tt+Math.imul(xr,fn)|0,Et=Et+Math.imul(xr,Kr)|0,Et=Et+Math.imul(pr,fn)|0,Nt=Nt+Math.imul(pr,Kr)|0,Tt=Tt+Math.imul(qt,dn)|0,Et=Et+Math.imul(qt,Gr)|0,Et=Et+Math.imul(Jt,dn)|0,Nt=Nt+Math.imul(Jt,Gr)|0,Tt=Tt+Math.imul(Kt,an)|0,Et=Et+Math.imul(Kt,Zr)|0,Et=Et+Math.imul(Qt,an)|0,Nt=Nt+Math.imul(Qt,Zr)|0,Tt=Tt+Math.imul(ir,Sn)|0,Et=Et+Math.imul(ir,nn)|0,Et=Et+Math.imul(nr,Sn)|0,Nt=Nt+Math.imul(nr,nn)|0;var ms=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ms>>>26)|0,ms&=67108863,Tt=Math.imul(Wt,Er),Et=Math.imul(Wt,Rr),Et=Et+Math.imul(ar,Er)|0,Nt=Math.imul(ar,Rr),Tt=Tt+Math.imul(er,Hr)|0,Et=Et+Math.imul(er,Fr)|0,Et=Et+Math.imul(Gt,Hr)|0,Nt=Nt+Math.imul(Gt,Fr)|0,Tt=Tt+Math.imul(Br,Jr)|0,Et=Et+Math.imul(Br,Qr)|0,Et=Et+Math.imul(or,Jr)|0,Nt=Nt+Math.imul(or,Qr)|0,Tt=Tt+Math.imul(Ar,ln)|0,Et=Et+Math.imul(Ar,qr)|0,Et=Et+Math.imul($r,ln)|0,Nt=Nt+Math.imul($r,qr)|0,Tt=Tt+Math.imul(_r,un)|0,Et=Et+Math.imul(_r,Vr)|0,Et=Et+Math.imul(Sr,un)|0,Nt=Nt+Math.imul(Sr,Vr)|0,Tt=Tt+Math.imul(Mr,fn)|0,Et=Et+Math.imul(Mr,Kr)|0,Et=Et+Math.imul(lr,fn)|0,Nt=Nt+Math.imul(lr,Kr)|0,Tt=Tt+Math.imul(xr,dn)|0,Et=Et+Math.imul(xr,Gr)|0,Et=Et+Math.imul(pr,dn)|0,Nt=Nt+Math.imul(pr,Gr)|0,Tt=Tt+Math.imul(qt,an)|0,Et=Et+Math.imul(qt,Zr)|0,Et=Et+Math.imul(Jt,an)|0,Nt=Nt+Math.imul(Jt,Zr)|0,Tt=Tt+Math.imul(Kt,Sn)|0,Et=Et+Math.imul(Kt,nn)|0,Et=Et+Math.imul(Qt,Sn)|0,Nt=Nt+Math.imul(Qt,nn)|0,Tt=Tt+Math.imul(ir,yn)|0,Et=Et+Math.imul(ir,_n)|0,Et=Et+Math.imul(nr,yn)|0,Nt=Nt+Math.imul(nr,_n)|0;var Qn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Tt=Math.imul(Wt,Hr),Et=Math.imul(Wt,Fr),Et=Et+Math.imul(ar,Hr)|0,Nt=Math.imul(ar,Fr),Tt=Tt+Math.imul(er,Jr)|0,Et=Et+Math.imul(er,Qr)|0,Et=Et+Math.imul(Gt,Jr)|0,Nt=Nt+Math.imul(Gt,Qr)|0,Tt=Tt+Math.imul(Br,ln)|0,Et=Et+Math.imul(Br,qr)|0,Et=Et+Math.imul(or,ln)|0,Nt=Nt+Math.imul(or,qr)|0,Tt=Tt+Math.imul(Ar,un)|0,Et=Et+Math.imul(Ar,Vr)|0,Et=Et+Math.imul($r,un)|0,Nt=Nt+Math.imul($r,Vr)|0,Tt=Tt+Math.imul(_r,fn)|0,Et=Et+Math.imul(_r,Kr)|0,Et=Et+Math.imul(Sr,fn)|0,Nt=Nt+Math.imul(Sr,Kr)|0,Tt=Tt+Math.imul(Mr,dn)|0,Et=Et+Math.imul(Mr,Gr)|0,Et=Et+Math.imul(lr,dn)|0,Nt=Nt+Math.imul(lr,Gr)|0,Tt=Tt+Math.imul(xr,an)|0,Et=Et+Math.imul(xr,Zr)|0,Et=Et+Math.imul(pr,an)|0,Nt=Nt+Math.imul(pr,Zr)|0,Tt=Tt+Math.imul(qt,Sn)|0,Et=Et+Math.imul(qt,nn)|0,Et=Et+Math.imul(Jt,Sn)|0,Nt=Nt+Math.imul(Jt,nn)|0,Tt=Tt+Math.imul(Kt,yn)|0,Et=Et+Math.imul(Kt,_n)|0,Et=Et+Math.imul(Qt,yn)|0,Nt=Nt+Math.imul(Qt,_n)|0;var es=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(es>>>26)|0,es&=67108863,Tt=Math.imul(Wt,Jr),Et=Math.imul(Wt,Qr),Et=Et+Math.imul(ar,Jr)|0,Nt=Math.imul(ar,Qr),Tt=Tt+Math.imul(er,ln)|0,Et=Et+Math.imul(er,qr)|0,Et=Et+Math.imul(Gt,ln)|0,Nt=Nt+Math.imul(Gt,qr)|0,Tt=Tt+Math.imul(Br,un)|0,Et=Et+Math.imul(Br,Vr)|0,Et=Et+Math.imul(or,un)|0,Nt=Nt+Math.imul(or,Vr)|0,Tt=Tt+Math.imul(Ar,fn)|0,Et=Et+Math.imul(Ar,Kr)|0,Et=Et+Math.imul($r,fn)|0,Nt=Nt+Math.imul($r,Kr)|0,Tt=Tt+Math.imul(_r,dn)|0,Et=Et+Math.imul(_r,Gr)|0,Et=Et+Math.imul(Sr,dn)|0,Nt=Nt+Math.imul(Sr,Gr)|0,Tt=Tt+Math.imul(Mr,an)|0,Et=Et+Math.imul(Mr,Zr)|0,Et=Et+Math.imul(lr,an)|0,Nt=Nt+Math.imul(lr,Zr)|0,Tt=Tt+Math.imul(xr,Sn)|0,Et=Et+Math.imul(xr,nn)|0,Et=Et+Math.imul(pr,Sn)|0,Nt=Nt+Math.imul(pr,nn)|0,Tt=Tt+Math.imul(qt,yn)|0,Et=Et+Math.imul(qt,_n)|0,Et=Et+Math.imul(Jt,yn)|0,Nt=Nt+Math.imul(Jt,_n)|0;var ls=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ls>>>26)|0,ls&=67108863,Tt=Math.imul(Wt,ln),Et=Math.imul(Wt,qr),Et=Et+Math.imul(ar,ln)|0,Nt=Math.imul(ar,qr),Tt=Tt+Math.imul(er,un)|0,Et=Et+Math.imul(er,Vr)|0,Et=Et+Math.imul(Gt,un)|0,Nt=Nt+Math.imul(Gt,Vr)|0,Tt=Tt+Math.imul(Br,fn)|0,Et=Et+Math.imul(Br,Kr)|0,Et=Et+Math.imul(or,fn)|0,Nt=Nt+Math.imul(or,Kr)|0,Tt=Tt+Math.imul(Ar,dn)|0,Et=Et+Math.imul(Ar,Gr)|0,Et=Et+Math.imul($r,dn)|0,Nt=Nt+Math.imul($r,Gr)|0,Tt=Tt+Math.imul(_r,an)|0,Et=Et+Math.imul(_r,Zr)|0,Et=Et+Math.imul(Sr,an)|0,Nt=Nt+Math.imul(Sr,Zr)|0,Tt=Tt+Math.imul(Mr,Sn)|0,Et=Et+Math.imul(Mr,nn)|0,Et=Et+Math.imul(lr,Sn)|0,Nt=Nt+Math.imul(lr,nn)|0,Tt=Tt+Math.imul(xr,yn)|0,Et=Et+Math.imul(xr,_n)|0,Et=Et+Math.imul(pr,yn)|0,Nt=Nt+Math.imul(pr,_n)|0;var us=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(us>>>26)|0,us&=67108863,Tt=Math.imul(Wt,un),Et=Math.imul(Wt,Vr),Et=Et+Math.imul(ar,un)|0,Nt=Math.imul(ar,Vr),Tt=Tt+Math.imul(er,fn)|0,Et=Et+Math.imul(er,Kr)|0,Et=Et+Math.imul(Gt,fn)|0,Nt=Nt+Math.imul(Gt,Kr)|0,Tt=Tt+Math.imul(Br,dn)|0,Et=Et+Math.imul(Br,Gr)|0,Et=Et+Math.imul(or,dn)|0,Nt=Nt+Math.imul(or,Gr)|0,Tt=Tt+Math.imul(Ar,an)|0,Et=Et+Math.imul(Ar,Zr)|0,Et=Et+Math.imul($r,an)|0,Nt=Nt+Math.imul($r,Zr)|0,Tt=Tt+Math.imul(_r,Sn)|0,Et=Et+Math.imul(_r,nn)|0,Et=Et+Math.imul(Sr,Sn)|0,Nt=Nt+Math.imul(Sr,nn)|0,Tt=Tt+Math.imul(Mr,yn)|0,Et=Et+Math.imul(Mr,_n)|0,Et=Et+Math.imul(lr,yn)|0,Nt=Nt+Math.imul(lr,_n)|0;var Wn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Tt=Math.imul(Wt,fn),Et=Math.imul(Wt,Kr),Et=Et+Math.imul(ar,fn)|0,Nt=Math.imul(ar,Kr),Tt=Tt+Math.imul(er,dn)|0,Et=Et+Math.imul(er,Gr)|0,Et=Et+Math.imul(Gt,dn)|0,Nt=Nt+Math.imul(Gt,Gr)|0,Tt=Tt+Math.imul(Br,an)|0,Et=Et+Math.imul(Br,Zr)|0,Et=Et+Math.imul(or,an)|0,Nt=Nt+Math.imul(or,Zr)|0,Tt=Tt+Math.imul(Ar,Sn)|0,Et=Et+Math.imul(Ar,nn)|0,Et=Et+Math.imul($r,Sn)|0,Nt=Nt+Math.imul($r,nn)|0,Tt=Tt+Math.imul(_r,yn)|0,Et=Et+Math.imul(_r,_n)|0,Et=Et+Math.imul(Sr,yn)|0,Nt=Nt+Math.imul(Sr,_n)|0;var as=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(as>>>26)|0,as&=67108863,Tt=Math.imul(Wt,dn),Et=Math.imul(Wt,Gr),Et=Et+Math.imul(ar,dn)|0,Nt=Math.imul(ar,Gr),Tt=Tt+Math.imul(er,an)|0,Et=Et+Math.imul(er,Zr)|0,Et=Et+Math.imul(Gt,an)|0,Nt=Nt+Math.imul(Gt,Zr)|0,Tt=Tt+Math.imul(Br,Sn)|0,Et=Et+Math.imul(Br,nn)|0,Et=Et+Math.imul(or,Sn)|0,Nt=Nt+Math.imul(or,nn)|0,Tt=Tt+Math.imul(Ar,yn)|0,Et=Et+Math.imul(Ar,_n)|0,Et=Et+Math.imul($r,yn)|0,Nt=Nt+Math.imul($r,_n)|0;var gs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(gs>>>26)|0,gs&=67108863,Tt=Math.imul(Wt,an),Et=Math.imul(Wt,Zr),Et=Et+Math.imul(ar,an)|0,Nt=Math.imul(ar,Zr),Tt=Tt+Math.imul(er,Sn)|0,Et=Et+Math.imul(er,nn)|0,Et=Et+Math.imul(Gt,Sn)|0,Nt=Nt+Math.imul(Gt,nn)|0,Tt=Tt+Math.imul(Br,yn)|0,Et=Et+Math.imul(Br,_n)|0,Et=Et+Math.imul(or,yn)|0,Nt=Nt+Math.imul(or,_n)|0;var vs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(vs>>>26)|0,vs&=67108863,Tt=Math.imul(Wt,Sn),Et=Math.imul(Wt,nn),Et=Et+Math.imul(ar,Sn)|0,Nt=Math.imul(ar,nn),Tt=Tt+Math.imul(er,yn)|0,Et=Et+Math.imul(er,_n)|0,Et=Et+Math.imul(Gt,yn)|0,Nt=Nt+Math.imul(Gt,_n)|0;var Ts=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Tt=Math.imul(Wt,yn),Et=Math.imul(Wt,_n),Et=Et+Math.imul(ar,yn)|0,Nt=Math.imul(ar,_n);var $s=(St+Tt|0)+((Et&8191)<<13)|0;return St=(Nt+(Et>>>13)|0)+($s>>>26)|0,$s&=67108863,Rt[0]=ds,Rt[1]=fs,Rt[2]=hs,Rt[3]=ps,Rt[4]=Vn,Rt[5]=ss,Rt[6]=Jn,Rt[7]=Yn,Rt[8]=ms,Rt[9]=Qn,Rt[10]=es,Rt[11]=ls,Rt[12]=us,Rt[13]=Wn,Rt[14]=as,Rt[15]=gs,Rt[16]=vs,Rt[17]=Ts,Rt[18]=$s,St!==0&&(Rt[19]=St,mt.length++),mt};Math.imul||($t=Pt);function Mt(vt,ct,dt){dt.negative=ct.negative^vt.negative,dt.length=vt.length+ct.length;for(var mt=0,xt=0,At=0;At>>26)|0,xt+=Rt>>>26,Rt&=67108863}dt.words[At]=St,mt=Rt,Rt=xt}return mt!==0?dt.words[At]=mt:dt.length--,dt._strip()}function Bt(vt,ct,dt){return Mt(vt,ct,dt)}tt.prototype.mulTo=function(ct,dt){var mt,xt=this.length+ct.length;return this.length===10&&ct.length===10?mt=$t(this,ct,dt):xt<63?mt=Pt(this,ct,dt):xt<1024?mt=Mt(this,ct,dt):mt=Bt(this,ct,dt),mt},tt.prototype.mul=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),this.mulTo(ct,dt)},tt.prototype.mulf=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),Bt(this,ct,dt)},tt.prototype.imul=function(ct){return this.clone().mulTo(ct,this)},tt.prototype.imuln=function(ct){var dt=ct<0;dt&&(ct=-ct),j(typeof ct=="number"),j(ct<67108864);for(var mt=0,xt=0;xt>=26,mt+=At/67108864|0,mt+=Rt>>>26,this.words[xt]=Rt&67108863}return mt!==0&&(this.words[xt]=mt,this.length++),dt?this.ineg():this},tt.prototype.muln=function(ct){return this.clone().imuln(ct)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(ct){var dt=Ct(ct);if(dt.length===0)return new tt(1);for(var mt=this,xt=0;xt=0);var dt=ct%26,mt=(ct-dt)/26,xt=67108863>>>26-dt<<26-dt,At;if(dt!==0){var Rt=0;for(At=0;At>>26-dt}Rt&&(this.words[At]=Rt,this.length++)}if(mt!==0){for(At=this.length-1;At>=0;At--)this.words[At+mt]=this.words[At];for(At=0;At=0);var xt;dt?xt=(dt-dt%26)/26:xt=0;var At=ct%26,Rt=Math.min((ct-At)/26,this.length),St=67108863^67108863>>>At<Rt)for(this.length-=Rt,Et=0;Et=0&&(Nt!==0||Et>=xt);Et--){var tr=this.words[Et]|0;this.words[Et]=Nt<<26-At|tr>>>At,Nt=tr&St}return Tt&&Nt!==0&&(Tt.words[Tt.length++]=Nt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},tt.prototype.ishrn=function(ct,dt,mt){return j(this.negative===0),this.iushrn(ct,dt,mt)},tt.prototype.shln=function(ct){return this.clone().ishln(ct)},tt.prototype.ushln=function(ct){return this.clone().iushln(ct)},tt.prototype.shrn=function(ct){return this.clone().ishrn(ct)},tt.prototype.ushrn=function(ct){return this.clone().iushrn(ct)},tt.prototype.testn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=ct%26,mt=(ct-dt)/26,xt=1<=0);var dt=ct%26,mt=(ct-dt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=mt)return this;if(dt!==0&&mt++,this.length=Math.min(mt,this.length),dt!==0){var xt=67108863^67108863>>>dt<=67108864;dt++)this.words[dt]-=67108864,dt===this.length-1?this.words[dt+1]=1:this.words[dt+1]++;return this.length=Math.max(this.length,dt+1),this},tt.prototype.isubn=function(ct){if(j(typeof ct=="number"),j(ct<67108864),ct<0)return this.iaddn(-ct);if(this.negative!==0)return this.negative=0,this.iaddn(ct),this.negative=1,this;if(this.words[0]-=ct,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var dt=0;dt>26)-(Tt/67108864|0),this.words[At+mt]=Rt&67108863}for(;At>26,this.words[At+mt]=Rt&67108863;if(St===0)return this._strip();for(j(St===-1),St=0,At=0;At>26,this.words[At]=Rt&67108863;return this.negative=1,this._strip()},tt.prototype._wordDiv=function(ct,dt){var mt=this.length-ct.length,xt=this.clone(),At=ct,Rt=At.words[At.length-1]|0,St=this._countBits(Rt);mt=26-St,mt!==0&&(At=At.ushln(mt),xt.iushln(mt),Rt=At.words[At.length-1]|0);var Tt=xt.length-At.length,Et;if(dt!=="mod"){Et=new tt(null),Et.length=Tt+1,Et.words=new Array(Et.length);for(var Nt=0;Nt=0;ir--){var nr=(xt.words[At.length+ir]|0)*67108864+(xt.words[At.length+ir-1]|0);for(nr=Math.min(nr/Rt|0,67108863),xt._ishlnsubmul(At,nr,ir);xt.negative!==0;)nr--,xt.negative=0,xt._ishlnsubmul(At,1,ir),xt.isZero()||(xt.negative^=1);Et&&(Et.words[ir]=nr)}return Et&&Et._strip(),xt._strip(),dt!=="div"&&mt!==0&&xt.iushrn(mt),{div:Et||null,mod:xt}},tt.prototype.divmod=function(ct,dt,mt){if(j(!ct.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var xt,At,Rt;return this.negative!==0&&ct.negative===0?(Rt=this.neg().divmod(ct,dt),dt!=="mod"&&(xt=Rt.div.neg()),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.iadd(ct)),{div:xt,mod:At}):this.negative===0&&ct.negative!==0?(Rt=this.divmod(ct.neg(),dt),dt!=="mod"&&(xt=Rt.div.neg()),{div:xt,mod:Rt.mod}):this.negative&ct.negative?(Rt=this.neg().divmod(ct.neg(),dt),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.isub(ct)),{div:Rt.div,mod:At}):ct.length>this.length||this.cmp(ct)<0?{div:new tt(0),mod:this}:ct.length===1?dt==="div"?{div:this.divn(ct.words[0]),mod:null}:dt==="mod"?{div:null,mod:new tt(this.modrn(ct.words[0]))}:{div:this.divn(ct.words[0]),mod:new tt(this.modrn(ct.words[0]))}:this._wordDiv(ct,dt)},tt.prototype.div=function(ct){return this.divmod(ct,"div",!1).div},tt.prototype.mod=function(ct){return this.divmod(ct,"mod",!1).mod},tt.prototype.umod=function(ct){return this.divmod(ct,"mod",!0).mod},tt.prototype.divRound=function(ct){var dt=this.divmod(ct);if(dt.mod.isZero())return dt.div;var mt=dt.div.negative!==0?dt.mod.isub(ct):dt.mod,xt=ct.ushrn(1),At=ct.andln(1),Rt=mt.cmp(xt);return Rt<0||At===1&&Rt===0?dt.div:dt.div.negative!==0?dt.div.isubn(1):dt.div.iaddn(1)},tt.prototype.modrn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=(1<<26)%ct,xt=0,At=this.length-1;At>=0;At--)xt=(mt*xt+(this.words[At]|0))%ct;return dt?-xt:xt},tt.prototype.modn=function(ct){return this.modrn(ct)},tt.prototype.idivn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=0,xt=this.length-1;xt>=0;xt--){var At=(this.words[xt]|0)+mt*67108864;this.words[xt]=At/ct|0,mt=At%ct}return this._strip(),dt?this.ineg():this},tt.prototype.divn=function(ct){return this.clone().idivn(ct)},tt.prototype.egcd=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=new tt(0),St=new tt(1),Tt=0;dt.isEven()&&mt.isEven();)dt.iushrn(1),mt.iushrn(1),++Tt;for(var Et=mt.clone(),Nt=dt.clone();!dt.isZero();){for(var tr=0,ir=1;!(dt.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(dt.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(Et),At.isub(Nt)),xt.iushrn(1),At.iushrn(1);for(var nr=0,Zt=1;!(mt.words[0]&Zt)&&nr<26;++nr,Zt<<=1);if(nr>0)for(mt.iushrn(nr);nr-- >0;)(Rt.isOdd()||St.isOdd())&&(Rt.iadd(Et),St.isub(Nt)),Rt.iushrn(1),St.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(Rt),At.isub(St)):(mt.isub(dt),Rt.isub(xt),St.isub(At))}return{a:Rt,b:St,gcd:mt.iushln(Tt)}},tt.prototype._invmp=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=mt.clone();dt.cmpn(1)>0&&mt.cmpn(1)>0;){for(var St=0,Tt=1;!(dt.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(dt.iushrn(St);St-- >0;)xt.isOdd()&&xt.iadd(Rt),xt.iushrn(1);for(var Et=0,Nt=1;!(mt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(mt.iushrn(Et);Et-- >0;)At.isOdd()&&At.iadd(Rt),At.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(At)):(mt.isub(dt),At.isub(xt))}var tr;return dt.cmpn(1)===0?tr=xt:tr=At,tr.cmpn(0)<0&&tr.iadd(ct),tr},tt.prototype.gcd=function(ct){if(this.isZero())return ct.abs();if(ct.isZero())return this.abs();var dt=this.clone(),mt=ct.clone();dt.negative=0,mt.negative=0;for(var xt=0;dt.isEven()&&mt.isEven();xt++)dt.iushrn(1),mt.iushrn(1);do{for(;dt.isEven();)dt.iushrn(1);for(;mt.isEven();)mt.iushrn(1);var At=dt.cmp(mt);if(At<0){var Rt=dt;dt=mt,mt=Rt}else if(At===0||mt.cmpn(1)===0)break;dt.isub(mt)}while(!0);return mt.iushln(xt)},tt.prototype.invm=function(ct){return this.egcd(ct).a.umod(ct)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(ct){return this.words[0]&ct},tt.prototype.bincn=function(ct){j(typeof ct=="number");var dt=ct%26,mt=(ct-dt)/26,xt=1<>>26,St&=67108863,this.words[Rt]=St}return At!==0&&(this.words[Rt]=At,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(ct){var dt=ct<0;if(this.negative!==0&&!dt)return-1;if(this.negative===0&&dt)return 1;this._strip();var mt;if(this.length>1)mt=1;else{dt&&(ct=-ct),j(ct<=67108863,"Number is too big");var xt=this.words[0]|0;mt=xt===ct?0:xtct.length)return 1;if(this.length=0;mt--){var xt=this.words[mt]|0,At=ct.words[mt]|0;if(xt!==At){xtAt&&(dt=1);break}}return dt},tt.prototype.gtn=function(ct){return this.cmpn(ct)===1},tt.prototype.gt=function(ct){return this.cmp(ct)===1},tt.prototype.gten=function(ct){return this.cmpn(ct)>=0},tt.prototype.gte=function(ct){return this.cmp(ct)>=0},tt.prototype.ltn=function(ct){return this.cmpn(ct)===-1},tt.prototype.lt=function(ct){return this.cmp(ct)===-1},tt.prototype.lten=function(ct){return this.cmpn(ct)<=0},tt.prototype.lte=function(ct){return this.cmp(ct)<=0},tt.prototype.eqn=function(ct){return this.cmpn(ct)===0},tt.prototype.eq=function(ct){return this.cmp(ct)===0},tt.red=function(ct){return new jt(ct)},tt.prototype.toRed=function(ct){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),ct.convertTo(this)._forceRed(ct)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(ct){return this.red=ct,this},tt.prototype.forceRed=function(ct){return j(!this.red,"Already a number in reduction context"),this._forceRed(ct)},tt.prototype.redAdd=function(ct){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,ct)},tt.prototype.redIAdd=function(ct){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ct)},tt.prototype.redSub=function(ct){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,ct)},tt.prototype.redISub=function(ct){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,ct)},tt.prototype.redShl=function(ct){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,ct)},tt.prototype.redMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.mul(this,ct)},tt.prototype.redIMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.imul(this,ct)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(ct){return j(this.red&&!ct.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ct)};var Dt={k256:null,p224:null,p192:null,p25519:null};function zt(vt,ct){this.name=vt,this.p=new tt(ct,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}zt.prototype._tmp=function(){var ct=new tt(null);return ct.words=new Array(Math.ceil(this.n/13)),ct},zt.prototype.ireduce=function(ct){var dt=ct,mt;do this.split(dt,this.tmp),dt=this.imulK(dt),dt=dt.iadd(this.tmp),mt=dt.bitLength();while(mt>this.n);var xt=mt0?dt.isub(this.p):dt.strip!==void 0?dt.strip():dt._strip(),dt},zt.prototype.split=function(ct,dt){ct.iushrn(this.n,0,dt)},zt.prototype.imulK=function(ct){return ct.imul(this.k)};function Ot(){zt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Ot,zt),Ot.prototype.split=function(ct,dt){for(var mt=4194303,xt=Math.min(ct.length,9),At=0;At>>22,Rt=St}Rt>>>=22,ct.words[At-10]=Rt,Rt===0&&ct.length>10?ct.length-=10:ct.length-=9},Ot.prototype.imulK=function(ct){ct.words[ct.length]=0,ct.words[ct.length+1]=0,ct.length+=2;for(var dt=0,mt=0;mt>>=26,ct.words[mt]=At,dt=xt}return dt!==0&&(ct.words[ct.length++]=dt),ct},tt._prime=function(ct){if(Dt[ct])return Dt[ct];var dt;if(ct==="k256")dt=new Ot;else if(ct==="p224")dt=new It;else if(ct==="p192")dt=new Lt;else if(ct==="p25519")dt=new Ft;else throw new Error("Unknown prime "+ct);return Dt[ct]=dt,dt};function jt(vt){if(typeof vt=="string"){var ct=tt._prime(vt);this.m=ct.p,this.prime=ct}else j(vt.gtn(1),"modulus must be greater than 1"),this.m=vt,this.prime=null}jt.prototype._verify1=function(ct){j(ct.negative===0,"red works only with positives"),j(ct.red,"red works only with red numbers")},jt.prototype._verify2=function(ct,dt){j((ct.negative|dt.negative)===0,"red works only with positives"),j(ct.red&&ct.red===dt.red,"red works only with red numbers")},jt.prototype.imod=function(ct){return this.prime?this.prime.ireduce(ct)._forceRed(this):(ot(ct,ct.umod(this.m)._forceRed(this)),ct)},jt.prototype.neg=function(ct){return ct.isZero()?ct.clone():this.m.sub(ct)._forceRed(this)},jt.prototype.add=function(ct,dt){this._verify2(ct,dt);var mt=ct.add(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt._forceRed(this)},jt.prototype.iadd=function(ct,dt){this._verify2(ct,dt);var mt=ct.iadd(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt},jt.prototype.sub=function(ct,dt){this._verify2(ct,dt);var mt=ct.sub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt._forceRed(this)},jt.prototype.isub=function(ct,dt){this._verify2(ct,dt);var mt=ct.isub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt},jt.prototype.shl=function(ct,dt){return this._verify1(ct),this.imod(ct.ushln(dt))},jt.prototype.imul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.imul(dt))},jt.prototype.mul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.mul(dt))},jt.prototype.isqr=function(ct){return this.imul(ct,ct.clone())},jt.prototype.sqr=function(ct){return this.mul(ct,ct)},jt.prototype.sqrt=function(ct){if(ct.isZero())return ct.clone();var dt=this.m.andln(3);if(j(dt%2===1),dt===3){var mt=this.m.add(new tt(1)).iushrn(2);return this.pow(ct,mt)}for(var xt=this.m.subn(1),At=0;!xt.isZero()&&xt.andln(1)===0;)At++,xt.iushrn(1);j(!xt.isZero());var Rt=new tt(1).toRed(this),St=Rt.redNeg(),Tt=this.m.subn(1).iushrn(1),Et=this.m.bitLength();for(Et=new tt(2*Et*Et).toRed(this);this.pow(Et,Tt).cmp(St)!==0;)Et.redIAdd(St);for(var Nt=this.pow(Et,xt),tr=this.pow(ct,xt.addn(1).iushrn(1)),ir=this.pow(ct,xt),nr=At;ir.cmp(Rt)!==0;){for(var Zt=ir,Kt=0;Zt.cmp(Rt)!==0;Kt++)Zt=Zt.redSqr();j(Kt=0;At--){for(var Nt=dt.words[At],tr=Et-1;tr>=0;tr--){var ir=Nt>>tr&1;if(Rt!==xt[0]&&(Rt=this.sqr(Rt)),ir===0&&St===0){Tt=0;continue}St<<=1,St|=ir,Tt++,!(Tt!==mt&&(At!==0||tr!==0))&&(Rt=this.mul(Rt,xt[St]),Tt=0,St=0)}Et=26}return Rt},jt.prototype.convertTo=function(ct){var dt=ct.umod(this.m);return dt===ct?dt.clone():dt},jt.prototype.convertFrom=function(ct){var dt=ct.clone();return dt.red=null,dt},tt.mont=function(ct){return new bt(ct)};function bt(vt){jt.call(this,vt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(bt,jt),bt.prototype.convertTo=function(ct){return this.imod(ct.ushln(this.shift))},bt.prototype.convertFrom=function(ct){var dt=this.imod(ct.mul(this.rinv));return dt.red=null,dt},bt.prototype.imul=function(ct,dt){if(ct.isZero()||dt.isZero())return ct.words[0]=0,ct.length=1,ct;var mt=ct.imul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.mul=function(ct,dt){if(ct.isZero()||dt.isZero())return new tt(0)._forceRed(this);var mt=ct.mul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.invm=function(ct){var dt=this.imod(ct._invmp(this.m).mul(this.r2));return dt._forceRed(this)}})(a,commonjsGlobal)}(bn$3)),bn$3.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var a=requireBn$2(),_=requireBrowser$8();function $(tt){var rt=j(tt),nt=rt.toRed(a.mont(tt.modulus)).redPow(new a(tt.publicExponent)).fromRed();return{blinder:nt,unblinder:rt.invm(tt.modulus)}}function j(tt){var rt=tt.modulus.byteLength(),nt;do nt=new a(_(rt));while(nt.cmp(tt.modulus)>=0||!nt.umod(tt.prime1)||!nt.umod(tt.prime2));return nt}function et(tt,rt){var nt=$(rt),it=rt.modulus.byteLength(),st=new a(tt).mul(nt.blinder).umod(rt.modulus),ot=st.toRed(a.mont(rt.prime1)),at=st.toRed(a.mont(rt.prime2)),ut=rt.coefficient,ht=rt.prime1,yt=rt.prime2,wt=ot.redPow(rt.exponent1).fromRed(),Ct=at.redPow(rt.exponent2).fromRed(),Pt=wt.isub(Ct).imul(ut).umod(ht).imul(yt);return Ct.iadd(Pt).imul(nt.unblinder).umod(rt.modulus).toArrayLike(Buffer$g,"be",it)}return et.getr=j,browserifyRsa=et,browserifyRsa}var elliptic$3={};const name$3="elliptic",version$3="6.5.5",description$3="EC cryptography",main$3="lib/elliptic.js",files$2=["lib"],scripts$3={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository$3={type:"git",url:"git@github.com:indutny/elliptic"},keywords$2=["EC","Elliptic","curve","Cryptography"],author$3="Fedor Indutny ",license$3="MIT",bugs$2={url:"https://github.com/indutny/elliptic/issues"},homepage$3="https://github.com/indutny/elliptic",devDependencies$3={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies$3={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0$3={name:name$3,version:version$3,description:description$3,main:main$3,files:files$2,scripts:scripts$3,repository:repository$3,keywords:keywords$2,author:author$3,license:license$3,bugs:bugs$2,homepage:homepage$3,devDependencies:devDependencies$3,dependencies:dependencies$3};var utils$w={},bn$2={exports:{}};bn$2.exports;var hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,function(a){(function(_,$){function j(jt,bt){if(!jt)throw new Error(bt||"Assertion failed")}function et(jt,bt){jt.super_=bt;var vt=function(){};vt.prototype=bt.prototype,jt.prototype=new vt,jt.prototype.constructor=jt}function tt(jt,bt,vt){if(tt.isBN(jt))return jt;this.negative=0,this.words=null,this.length=0,this.red=null,jt!==null&&((bt==="le"||bt==="be")&&(vt=bt,bt=10),this._init(jt||0,bt||10,vt||"be"))}typeof _=="object"?_.exports=tt:$.BN=tt,tt.BN=tt,tt.wordSize=26;var rt;try{typeof window<"u"&&typeof window.Buffer<"u"?rt=window.Buffer:rt=require$$0$4.Buffer}catch{}tt.isBN=function(bt){return bt instanceof tt?!0:bt!==null&&typeof bt=="object"&&bt.constructor.wordSize===tt.wordSize&&Array.isArray(bt.words)},tt.max=function(bt,vt){return bt.cmp(vt)>0?bt:vt},tt.min=function(bt,vt){return bt.cmp(vt)<0?bt:vt},tt.prototype._init=function(bt,vt,ct){if(typeof bt=="number")return this._initNumber(bt,vt,ct);if(typeof bt=="object")return this._initArray(bt,vt,ct);vt==="hex"&&(vt=16),j(vt===(vt|0)&&vt>=2&&vt<=36),bt=bt.toString().replace(/\s+/g,"");var dt=0;bt[0]==="-"&&(dt++,this.negative=1),dt=0;dt-=3)xt=bt[dt]|bt[dt-1]<<8|bt[dt-2]<<16,this.words[mt]|=xt<>>26-At&67108863,At+=24,At>=26&&(At-=26,mt++);else if(ct==="le")for(dt=0,mt=0;dt>>26-At&67108863,At+=24,At>=26&&(At-=26,mt++);return this.strip()};function nt(jt,bt){var vt=jt.charCodeAt(bt);return vt>=65&&vt<=70?vt-55:vt>=97&&vt<=102?vt-87:vt-48&15}function it(jt,bt,vt){var ct=nt(jt,vt);return vt-1>=bt&&(ct|=nt(jt,vt-1)<<4),ct}tt.prototype._parseHex=function(bt,vt,ct){this.length=Math.ceil((bt.length-vt)/6),this.words=new Array(this.length);for(var dt=0;dt=vt;dt-=2)At=it(bt,vt,dt)<=18?(mt-=18,xt+=1,this.words[xt]|=At>>>26):mt+=8;else{var Rt=bt.length-vt;for(dt=Rt%2===0?vt+1:vt;dt=18?(mt-=18,xt+=1,this.words[xt]|=At>>>26):mt+=8}this.strip()};function st(jt,bt,vt,ct){for(var dt=0,mt=Math.min(jt.length,vt),xt=bt;xt=49?dt+=At-49+10:At>=17?dt+=At-17+10:dt+=At}return dt}tt.prototype._parseBase=function(bt,vt,ct){this.words=[0],this.length=1;for(var dt=0,mt=1;mt<=67108863;mt*=vt)dt++;dt--,mt=mt/vt|0;for(var xt=bt.length-ct,At=xt%dt,Rt=Math.min(xt,xt-At)+ct,St=0,Tt=ct;Tt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},tt.prototype.inspect=function(){return(this.red?""};var ot=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],at=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],ut=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(bt,vt){bt=bt||10,vt=vt|0||1;var ct;if(bt===16||bt==="hex"){ct="";for(var dt=0,mt=0,xt=0;xt>>24-dt&16777215,mt!==0||xt!==this.length-1?ct=ot[6-Rt.length]+Rt+ct:ct=Rt+ct,dt+=2,dt>=26&&(dt-=26,xt--)}for(mt!==0&&(ct=mt.toString(16)+ct);ct.length%vt!==0;)ct="0"+ct;return this.negative!==0&&(ct="-"+ct),ct}if(bt===(bt|0)&&bt>=2&&bt<=36){var St=at[bt],Tt=ut[bt];ct="";var Et=this.clone();for(Et.negative=0;!Et.isZero();){var Nt=Et.modn(Tt).toString(bt);Et=Et.idivn(Tt),Et.isZero()?ct=Nt+ct:ct=ot[St-Nt.length]+Nt+ct}for(this.isZero()&&(ct="0"+ct);ct.length%vt!==0;)ct="0"+ct;return this.negative!==0&&(ct="-"+ct),ct}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var bt=this.words[0];return this.length===2?bt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?bt+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-bt:bt},tt.prototype.toJSON=function(){return this.toString(16)},tt.prototype.toBuffer=function(bt,vt){return j(typeof rt<"u"),this.toArrayLike(rt,bt,vt)},tt.prototype.toArray=function(bt,vt){return this.toArrayLike(Array,bt,vt)},tt.prototype.toArrayLike=function(bt,vt,ct){var dt=this.byteLength(),mt=ct||Math.max(1,dt);j(dt<=mt,"byte array longer than desired length"),j(mt>0,"Requested array length <= 0"),this.strip();var xt=vt==="le",At=new bt(mt),Rt,St,Tt=this.clone();if(xt){for(St=0;!Tt.isZero();St++)Rt=Tt.andln(255),Tt.iushrn(8),At[St]=Rt;for(;St=4096&&(ct+=13,vt>>>=13),vt>=64&&(ct+=7,vt>>>=7),vt>=8&&(ct+=4,vt>>>=4),vt>=2&&(ct+=2,vt>>>=2),ct+vt},tt.prototype._zeroBits=function(bt){if(bt===0)return 26;var vt=bt,ct=0;return vt&8191||(ct+=13,vt>>>=13),vt&127||(ct+=7,vt>>>=7),vt&15||(ct+=4,vt>>>=4),vt&3||(ct+=2,vt>>>=2),vt&1||ct++,ct},tt.prototype.bitLength=function(){var bt=this.words[this.length-1],vt=this._countBits(bt);return(this.length-1)*26+vt};function ht(jt){for(var bt=new Array(jt.bitLength()),vt=0;vt>>dt}return bt}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var bt=0,vt=0;vtbt.length?this.clone().ior(bt):bt.clone().ior(this)},tt.prototype.uor=function(bt){return this.length>bt.length?this.clone().iuor(bt):bt.clone().iuor(this)},tt.prototype.iuand=function(bt){var vt;this.length>bt.length?vt=bt:vt=this;for(var ct=0;ctbt.length?this.clone().iand(bt):bt.clone().iand(this)},tt.prototype.uand=function(bt){return this.length>bt.length?this.clone().iuand(bt):bt.clone().iuand(this)},tt.prototype.iuxor=function(bt){var vt,ct;this.length>bt.length?(vt=this,ct=bt):(vt=bt,ct=this);for(var dt=0;dtbt.length?this.clone().ixor(bt):bt.clone().ixor(this)},tt.prototype.uxor=function(bt){return this.length>bt.length?this.clone().iuxor(bt):bt.clone().iuxor(this)},tt.prototype.inotn=function(bt){j(typeof bt=="number"&&bt>=0);var vt=Math.ceil(bt/26)|0,ct=bt%26;this._expand(vt),ct>0&&vt--;for(var dt=0;dt0&&(this.words[dt]=~this.words[dt]&67108863>>26-ct),this.strip()},tt.prototype.notn=function(bt){return this.clone().inotn(bt)},tt.prototype.setn=function(bt,vt){j(typeof bt=="number"&&bt>=0);var ct=bt/26|0,dt=bt%26;return this._expand(ct+1),vt?this.words[ct]=this.words[ct]|1<bt.length?(ct=this,dt=bt):(ct=bt,dt=this);for(var mt=0,xt=0;xt>>26;for(;mt!==0&&xt>>26;if(this.length=ct.length,mt!==0)this.words[this.length]=mt,this.length++;else if(ct!==this)for(;xtbt.length?this.clone().iadd(bt):bt.clone().iadd(this)},tt.prototype.isub=function(bt){if(bt.negative!==0){bt.negative=0;var vt=this.iadd(bt);return bt.negative=1,vt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(bt),this.negative=1,this._normSign();var ct=this.cmp(bt);if(ct===0)return this.negative=0,this.length=1,this.words[0]=0,this;var dt,mt;ct>0?(dt=this,mt=bt):(dt=bt,mt=this);for(var xt=0,At=0;At>26,this.words[At]=vt&67108863;for(;xt!==0&&At>26,this.words[At]=vt&67108863;if(xt===0&&At>>26,Et=Rt&67108863,Nt=Math.min(St,bt.length-1),tr=Math.max(0,St-jt.length+1);tr<=Nt;tr++){var ir=St-tr|0;dt=jt.words[ir]|0,mt=bt.words[tr]|0,xt=dt*mt+Et,Tt+=xt/67108864|0,Et=xt&67108863}vt.words[St]=Et|0,Rt=Tt|0}return Rt!==0?vt.words[St]=Rt|0:vt.length--,vt.strip()}var wt=function(bt,vt,ct){var dt=bt.words,mt=vt.words,xt=ct.words,At=0,Rt,St,Tt,Et=dt[0]|0,Nt=Et&8191,tr=Et>>>13,ir=dt[1]|0,nr=ir&8191,Zt=ir>>>13,Kt=dt[2]|0,Qt=Kt&8191,Ht=Kt>>>13,qt=dt[3]|0,Jt=qt&8191,ur=qt>>>13,xr=dt[4]|0,pr=xr&8191,Cr=xr>>>13,Mr=dt[5]|0,lr=Mr&8191,fr=Mr>>>13,_r=dt[6]|0,Sr=_r&8191,kr=_r>>>13,Ar=dt[7]|0,$r=Ar&8191,Or=Ar>>>13,Br=dt[8]|0,or=Br&8191,Yt=Br>>>13,er=dt[9]|0,Gt=er&8191,Vt=er>>>13,Wt=mt[0]|0,ar=Wt&8191,yr=Wt>>>13,Er=mt[1]|0,Rr=Er&8191,Wr=Er>>>13,Hr=mt[2]|0,Fr=Hr&8191,pn=Hr>>>13,Jr=mt[3]|0,Qr=Jr&8191,mn=Jr>>>13,ln=mt[4]|0,qr=ln&8191,En=ln>>>13,un=mt[5]|0,Vr=un&8191,hn=un>>>13,fn=mt[6]|0,Kr=fn&8191,Rn=fn>>>13,dn=mt[7]|0,Gr=dn&8191,gn=dn>>>13,an=mt[8]|0,Zr=an&8191,An=an>>>13,Sn=mt[9]|0,nn=Sn&8191,Pn=Sn>>>13;ct.negative=bt.negative^vt.negative,ct.length=19,Rt=Math.imul(Nt,ar),St=Math.imul(Nt,yr),St=St+Math.imul(tr,ar)|0,Tt=Math.imul(tr,yr);var yn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(yn>>>26)|0,yn&=67108863,Rt=Math.imul(nr,ar),St=Math.imul(nr,yr),St=St+Math.imul(Zt,ar)|0,Tt=Math.imul(Zt,yr),Rt=Rt+Math.imul(Nt,Rr)|0,St=St+Math.imul(Nt,Wr)|0,St=St+Math.imul(tr,Rr)|0,Tt=Tt+Math.imul(tr,Wr)|0;var _n=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(_n>>>26)|0,_n&=67108863,Rt=Math.imul(Qt,ar),St=Math.imul(Qt,yr),St=St+Math.imul(Ht,ar)|0,Tt=Math.imul(Ht,yr),Rt=Rt+Math.imul(nr,Rr)|0,St=St+Math.imul(nr,Wr)|0,St=St+Math.imul(Zt,Rr)|0,Tt=Tt+Math.imul(Zt,Wr)|0,Rt=Rt+Math.imul(Nt,Fr)|0,St=St+Math.imul(Nt,pn)|0,St=St+Math.imul(tr,Fr)|0,Tt=Tt+Math.imul(tr,pn)|0;var ds=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ds>>>26)|0,ds&=67108863,Rt=Math.imul(Jt,ar),St=Math.imul(Jt,yr),St=St+Math.imul(ur,ar)|0,Tt=Math.imul(ur,yr),Rt=Rt+Math.imul(Qt,Rr)|0,St=St+Math.imul(Qt,Wr)|0,St=St+Math.imul(Ht,Rr)|0,Tt=Tt+Math.imul(Ht,Wr)|0,Rt=Rt+Math.imul(nr,Fr)|0,St=St+Math.imul(nr,pn)|0,St=St+Math.imul(Zt,Fr)|0,Tt=Tt+Math.imul(Zt,pn)|0,Rt=Rt+Math.imul(Nt,Qr)|0,St=St+Math.imul(Nt,mn)|0,St=St+Math.imul(tr,Qr)|0,Tt=Tt+Math.imul(tr,mn)|0;var fs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(fs>>>26)|0,fs&=67108863,Rt=Math.imul(pr,ar),St=Math.imul(pr,yr),St=St+Math.imul(Cr,ar)|0,Tt=Math.imul(Cr,yr),Rt=Rt+Math.imul(Jt,Rr)|0,St=St+Math.imul(Jt,Wr)|0,St=St+Math.imul(ur,Rr)|0,Tt=Tt+Math.imul(ur,Wr)|0,Rt=Rt+Math.imul(Qt,Fr)|0,St=St+Math.imul(Qt,pn)|0,St=St+Math.imul(Ht,Fr)|0,Tt=Tt+Math.imul(Ht,pn)|0,Rt=Rt+Math.imul(nr,Qr)|0,St=St+Math.imul(nr,mn)|0,St=St+Math.imul(Zt,Qr)|0,Tt=Tt+Math.imul(Zt,mn)|0,Rt=Rt+Math.imul(Nt,qr)|0,St=St+Math.imul(Nt,En)|0,St=St+Math.imul(tr,qr)|0,Tt=Tt+Math.imul(tr,En)|0;var hs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(hs>>>26)|0,hs&=67108863,Rt=Math.imul(lr,ar),St=Math.imul(lr,yr),St=St+Math.imul(fr,ar)|0,Tt=Math.imul(fr,yr),Rt=Rt+Math.imul(pr,Rr)|0,St=St+Math.imul(pr,Wr)|0,St=St+Math.imul(Cr,Rr)|0,Tt=Tt+Math.imul(Cr,Wr)|0,Rt=Rt+Math.imul(Jt,Fr)|0,St=St+Math.imul(Jt,pn)|0,St=St+Math.imul(ur,Fr)|0,Tt=Tt+Math.imul(ur,pn)|0,Rt=Rt+Math.imul(Qt,Qr)|0,St=St+Math.imul(Qt,mn)|0,St=St+Math.imul(Ht,Qr)|0,Tt=Tt+Math.imul(Ht,mn)|0,Rt=Rt+Math.imul(nr,qr)|0,St=St+Math.imul(nr,En)|0,St=St+Math.imul(Zt,qr)|0,Tt=Tt+Math.imul(Zt,En)|0,Rt=Rt+Math.imul(Nt,Vr)|0,St=St+Math.imul(Nt,hn)|0,St=St+Math.imul(tr,Vr)|0,Tt=Tt+Math.imul(tr,hn)|0;var ps=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ps>>>26)|0,ps&=67108863,Rt=Math.imul(Sr,ar),St=Math.imul(Sr,yr),St=St+Math.imul(kr,ar)|0,Tt=Math.imul(kr,yr),Rt=Rt+Math.imul(lr,Rr)|0,St=St+Math.imul(lr,Wr)|0,St=St+Math.imul(fr,Rr)|0,Tt=Tt+Math.imul(fr,Wr)|0,Rt=Rt+Math.imul(pr,Fr)|0,St=St+Math.imul(pr,pn)|0,St=St+Math.imul(Cr,Fr)|0,Tt=Tt+Math.imul(Cr,pn)|0,Rt=Rt+Math.imul(Jt,Qr)|0,St=St+Math.imul(Jt,mn)|0,St=St+Math.imul(ur,Qr)|0,Tt=Tt+Math.imul(ur,mn)|0,Rt=Rt+Math.imul(Qt,qr)|0,St=St+Math.imul(Qt,En)|0,St=St+Math.imul(Ht,qr)|0,Tt=Tt+Math.imul(Ht,En)|0,Rt=Rt+Math.imul(nr,Vr)|0,St=St+Math.imul(nr,hn)|0,St=St+Math.imul(Zt,Vr)|0,Tt=Tt+Math.imul(Zt,hn)|0,Rt=Rt+Math.imul(Nt,Kr)|0,St=St+Math.imul(Nt,Rn)|0,St=St+Math.imul(tr,Kr)|0,Tt=Tt+Math.imul(tr,Rn)|0;var Vn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Rt=Math.imul($r,ar),St=Math.imul($r,yr),St=St+Math.imul(Or,ar)|0,Tt=Math.imul(Or,yr),Rt=Rt+Math.imul(Sr,Rr)|0,St=St+Math.imul(Sr,Wr)|0,St=St+Math.imul(kr,Rr)|0,Tt=Tt+Math.imul(kr,Wr)|0,Rt=Rt+Math.imul(lr,Fr)|0,St=St+Math.imul(lr,pn)|0,St=St+Math.imul(fr,Fr)|0,Tt=Tt+Math.imul(fr,pn)|0,Rt=Rt+Math.imul(pr,Qr)|0,St=St+Math.imul(pr,mn)|0,St=St+Math.imul(Cr,Qr)|0,Tt=Tt+Math.imul(Cr,mn)|0,Rt=Rt+Math.imul(Jt,qr)|0,St=St+Math.imul(Jt,En)|0,St=St+Math.imul(ur,qr)|0,Tt=Tt+Math.imul(ur,En)|0,Rt=Rt+Math.imul(Qt,Vr)|0,St=St+Math.imul(Qt,hn)|0,St=St+Math.imul(Ht,Vr)|0,Tt=Tt+Math.imul(Ht,hn)|0,Rt=Rt+Math.imul(nr,Kr)|0,St=St+Math.imul(nr,Rn)|0,St=St+Math.imul(Zt,Kr)|0,Tt=Tt+Math.imul(Zt,Rn)|0,Rt=Rt+Math.imul(Nt,Gr)|0,St=St+Math.imul(Nt,gn)|0,St=St+Math.imul(tr,Gr)|0,Tt=Tt+Math.imul(tr,gn)|0;var ss=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ss>>>26)|0,ss&=67108863,Rt=Math.imul(or,ar),St=Math.imul(or,yr),St=St+Math.imul(Yt,ar)|0,Tt=Math.imul(Yt,yr),Rt=Rt+Math.imul($r,Rr)|0,St=St+Math.imul($r,Wr)|0,St=St+Math.imul(Or,Rr)|0,Tt=Tt+Math.imul(Or,Wr)|0,Rt=Rt+Math.imul(Sr,Fr)|0,St=St+Math.imul(Sr,pn)|0,St=St+Math.imul(kr,Fr)|0,Tt=Tt+Math.imul(kr,pn)|0,Rt=Rt+Math.imul(lr,Qr)|0,St=St+Math.imul(lr,mn)|0,St=St+Math.imul(fr,Qr)|0,Tt=Tt+Math.imul(fr,mn)|0,Rt=Rt+Math.imul(pr,qr)|0,St=St+Math.imul(pr,En)|0,St=St+Math.imul(Cr,qr)|0,Tt=Tt+Math.imul(Cr,En)|0,Rt=Rt+Math.imul(Jt,Vr)|0,St=St+Math.imul(Jt,hn)|0,St=St+Math.imul(ur,Vr)|0,Tt=Tt+Math.imul(ur,hn)|0,Rt=Rt+Math.imul(Qt,Kr)|0,St=St+Math.imul(Qt,Rn)|0,St=St+Math.imul(Ht,Kr)|0,Tt=Tt+Math.imul(Ht,Rn)|0,Rt=Rt+Math.imul(nr,Gr)|0,St=St+Math.imul(nr,gn)|0,St=St+Math.imul(Zt,Gr)|0,Tt=Tt+Math.imul(Zt,gn)|0,Rt=Rt+Math.imul(Nt,Zr)|0,St=St+Math.imul(Nt,An)|0,St=St+Math.imul(tr,Zr)|0,Tt=Tt+Math.imul(tr,An)|0;var Jn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Rt=Math.imul(Gt,ar),St=Math.imul(Gt,yr),St=St+Math.imul(Vt,ar)|0,Tt=Math.imul(Vt,yr),Rt=Rt+Math.imul(or,Rr)|0,St=St+Math.imul(or,Wr)|0,St=St+Math.imul(Yt,Rr)|0,Tt=Tt+Math.imul(Yt,Wr)|0,Rt=Rt+Math.imul($r,Fr)|0,St=St+Math.imul($r,pn)|0,St=St+Math.imul(Or,Fr)|0,Tt=Tt+Math.imul(Or,pn)|0,Rt=Rt+Math.imul(Sr,Qr)|0,St=St+Math.imul(Sr,mn)|0,St=St+Math.imul(kr,Qr)|0,Tt=Tt+Math.imul(kr,mn)|0,Rt=Rt+Math.imul(lr,qr)|0,St=St+Math.imul(lr,En)|0,St=St+Math.imul(fr,qr)|0,Tt=Tt+Math.imul(fr,En)|0,Rt=Rt+Math.imul(pr,Vr)|0,St=St+Math.imul(pr,hn)|0,St=St+Math.imul(Cr,Vr)|0,Tt=Tt+Math.imul(Cr,hn)|0,Rt=Rt+Math.imul(Jt,Kr)|0,St=St+Math.imul(Jt,Rn)|0,St=St+Math.imul(ur,Kr)|0,Tt=Tt+Math.imul(ur,Rn)|0,Rt=Rt+Math.imul(Qt,Gr)|0,St=St+Math.imul(Qt,gn)|0,St=St+Math.imul(Ht,Gr)|0,Tt=Tt+Math.imul(Ht,gn)|0,Rt=Rt+Math.imul(nr,Zr)|0,St=St+Math.imul(nr,An)|0,St=St+Math.imul(Zt,Zr)|0,Tt=Tt+Math.imul(Zt,An)|0,Rt=Rt+Math.imul(Nt,nn)|0,St=St+Math.imul(Nt,Pn)|0,St=St+Math.imul(tr,nn)|0,Tt=Tt+Math.imul(tr,Pn)|0;var Yn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Rt=Math.imul(Gt,Rr),St=Math.imul(Gt,Wr),St=St+Math.imul(Vt,Rr)|0,Tt=Math.imul(Vt,Wr),Rt=Rt+Math.imul(or,Fr)|0,St=St+Math.imul(or,pn)|0,St=St+Math.imul(Yt,Fr)|0,Tt=Tt+Math.imul(Yt,pn)|0,Rt=Rt+Math.imul($r,Qr)|0,St=St+Math.imul($r,mn)|0,St=St+Math.imul(Or,Qr)|0,Tt=Tt+Math.imul(Or,mn)|0,Rt=Rt+Math.imul(Sr,qr)|0,St=St+Math.imul(Sr,En)|0,St=St+Math.imul(kr,qr)|0,Tt=Tt+Math.imul(kr,En)|0,Rt=Rt+Math.imul(lr,Vr)|0,St=St+Math.imul(lr,hn)|0,St=St+Math.imul(fr,Vr)|0,Tt=Tt+Math.imul(fr,hn)|0,Rt=Rt+Math.imul(pr,Kr)|0,St=St+Math.imul(pr,Rn)|0,St=St+Math.imul(Cr,Kr)|0,Tt=Tt+Math.imul(Cr,Rn)|0,Rt=Rt+Math.imul(Jt,Gr)|0,St=St+Math.imul(Jt,gn)|0,St=St+Math.imul(ur,Gr)|0,Tt=Tt+Math.imul(ur,gn)|0,Rt=Rt+Math.imul(Qt,Zr)|0,St=St+Math.imul(Qt,An)|0,St=St+Math.imul(Ht,Zr)|0,Tt=Tt+Math.imul(Ht,An)|0,Rt=Rt+Math.imul(nr,nn)|0,St=St+Math.imul(nr,Pn)|0,St=St+Math.imul(Zt,nn)|0,Tt=Tt+Math.imul(Zt,Pn)|0;var ms=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ms>>>26)|0,ms&=67108863,Rt=Math.imul(Gt,Fr),St=Math.imul(Gt,pn),St=St+Math.imul(Vt,Fr)|0,Tt=Math.imul(Vt,pn),Rt=Rt+Math.imul(or,Qr)|0,St=St+Math.imul(or,mn)|0,St=St+Math.imul(Yt,Qr)|0,Tt=Tt+Math.imul(Yt,mn)|0,Rt=Rt+Math.imul($r,qr)|0,St=St+Math.imul($r,En)|0,St=St+Math.imul(Or,qr)|0,Tt=Tt+Math.imul(Or,En)|0,Rt=Rt+Math.imul(Sr,Vr)|0,St=St+Math.imul(Sr,hn)|0,St=St+Math.imul(kr,Vr)|0,Tt=Tt+Math.imul(kr,hn)|0,Rt=Rt+Math.imul(lr,Kr)|0,St=St+Math.imul(lr,Rn)|0,St=St+Math.imul(fr,Kr)|0,Tt=Tt+Math.imul(fr,Rn)|0,Rt=Rt+Math.imul(pr,Gr)|0,St=St+Math.imul(pr,gn)|0,St=St+Math.imul(Cr,Gr)|0,Tt=Tt+Math.imul(Cr,gn)|0,Rt=Rt+Math.imul(Jt,Zr)|0,St=St+Math.imul(Jt,An)|0,St=St+Math.imul(ur,Zr)|0,Tt=Tt+Math.imul(ur,An)|0,Rt=Rt+Math.imul(Qt,nn)|0,St=St+Math.imul(Qt,Pn)|0,St=St+Math.imul(Ht,nn)|0,Tt=Tt+Math.imul(Ht,Pn)|0;var Qn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Rt=Math.imul(Gt,Qr),St=Math.imul(Gt,mn),St=St+Math.imul(Vt,Qr)|0,Tt=Math.imul(Vt,mn),Rt=Rt+Math.imul(or,qr)|0,St=St+Math.imul(or,En)|0,St=St+Math.imul(Yt,qr)|0,Tt=Tt+Math.imul(Yt,En)|0,Rt=Rt+Math.imul($r,Vr)|0,St=St+Math.imul($r,hn)|0,St=St+Math.imul(Or,Vr)|0,Tt=Tt+Math.imul(Or,hn)|0,Rt=Rt+Math.imul(Sr,Kr)|0,St=St+Math.imul(Sr,Rn)|0,St=St+Math.imul(kr,Kr)|0,Tt=Tt+Math.imul(kr,Rn)|0,Rt=Rt+Math.imul(lr,Gr)|0,St=St+Math.imul(lr,gn)|0,St=St+Math.imul(fr,Gr)|0,Tt=Tt+Math.imul(fr,gn)|0,Rt=Rt+Math.imul(pr,Zr)|0,St=St+Math.imul(pr,An)|0,St=St+Math.imul(Cr,Zr)|0,Tt=Tt+Math.imul(Cr,An)|0,Rt=Rt+Math.imul(Jt,nn)|0,St=St+Math.imul(Jt,Pn)|0,St=St+Math.imul(ur,nn)|0,Tt=Tt+Math.imul(ur,Pn)|0;var es=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(es>>>26)|0,es&=67108863,Rt=Math.imul(Gt,qr),St=Math.imul(Gt,En),St=St+Math.imul(Vt,qr)|0,Tt=Math.imul(Vt,En),Rt=Rt+Math.imul(or,Vr)|0,St=St+Math.imul(or,hn)|0,St=St+Math.imul(Yt,Vr)|0,Tt=Tt+Math.imul(Yt,hn)|0,Rt=Rt+Math.imul($r,Kr)|0,St=St+Math.imul($r,Rn)|0,St=St+Math.imul(Or,Kr)|0,Tt=Tt+Math.imul(Or,Rn)|0,Rt=Rt+Math.imul(Sr,Gr)|0,St=St+Math.imul(Sr,gn)|0,St=St+Math.imul(kr,Gr)|0,Tt=Tt+Math.imul(kr,gn)|0,Rt=Rt+Math.imul(lr,Zr)|0,St=St+Math.imul(lr,An)|0,St=St+Math.imul(fr,Zr)|0,Tt=Tt+Math.imul(fr,An)|0,Rt=Rt+Math.imul(pr,nn)|0,St=St+Math.imul(pr,Pn)|0,St=St+Math.imul(Cr,nn)|0,Tt=Tt+Math.imul(Cr,Pn)|0;var ls=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(ls>>>26)|0,ls&=67108863,Rt=Math.imul(Gt,Vr),St=Math.imul(Gt,hn),St=St+Math.imul(Vt,Vr)|0,Tt=Math.imul(Vt,hn),Rt=Rt+Math.imul(or,Kr)|0,St=St+Math.imul(or,Rn)|0,St=St+Math.imul(Yt,Kr)|0,Tt=Tt+Math.imul(Yt,Rn)|0,Rt=Rt+Math.imul($r,Gr)|0,St=St+Math.imul($r,gn)|0,St=St+Math.imul(Or,Gr)|0,Tt=Tt+Math.imul(Or,gn)|0,Rt=Rt+Math.imul(Sr,Zr)|0,St=St+Math.imul(Sr,An)|0,St=St+Math.imul(kr,Zr)|0,Tt=Tt+Math.imul(kr,An)|0,Rt=Rt+Math.imul(lr,nn)|0,St=St+Math.imul(lr,Pn)|0,St=St+Math.imul(fr,nn)|0,Tt=Tt+Math.imul(fr,Pn)|0;var us=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(us>>>26)|0,us&=67108863,Rt=Math.imul(Gt,Kr),St=Math.imul(Gt,Rn),St=St+Math.imul(Vt,Kr)|0,Tt=Math.imul(Vt,Rn),Rt=Rt+Math.imul(or,Gr)|0,St=St+Math.imul(or,gn)|0,St=St+Math.imul(Yt,Gr)|0,Tt=Tt+Math.imul(Yt,gn)|0,Rt=Rt+Math.imul($r,Zr)|0,St=St+Math.imul($r,An)|0,St=St+Math.imul(Or,Zr)|0,Tt=Tt+Math.imul(Or,An)|0,Rt=Rt+Math.imul(Sr,nn)|0,St=St+Math.imul(Sr,Pn)|0,St=St+Math.imul(kr,nn)|0,Tt=Tt+Math.imul(kr,Pn)|0;var Wn=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Rt=Math.imul(Gt,Gr),St=Math.imul(Gt,gn),St=St+Math.imul(Vt,Gr)|0,Tt=Math.imul(Vt,gn),Rt=Rt+Math.imul(or,Zr)|0,St=St+Math.imul(or,An)|0,St=St+Math.imul(Yt,Zr)|0,Tt=Tt+Math.imul(Yt,An)|0,Rt=Rt+Math.imul($r,nn)|0,St=St+Math.imul($r,Pn)|0,St=St+Math.imul(Or,nn)|0,Tt=Tt+Math.imul(Or,Pn)|0;var as=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(as>>>26)|0,as&=67108863,Rt=Math.imul(Gt,Zr),St=Math.imul(Gt,An),St=St+Math.imul(Vt,Zr)|0,Tt=Math.imul(Vt,An),Rt=Rt+Math.imul(or,nn)|0,St=St+Math.imul(or,Pn)|0,St=St+Math.imul(Yt,nn)|0,Tt=Tt+Math.imul(Yt,Pn)|0;var gs=(At+Rt|0)+((St&8191)<<13)|0;At=(Tt+(St>>>13)|0)+(gs>>>26)|0,gs&=67108863,Rt=Math.imul(Gt,nn),St=Math.imul(Gt,Pn),St=St+Math.imul(Vt,nn)|0,Tt=Math.imul(Vt,Pn);var vs=(At+Rt|0)+((St&8191)<<13)|0;return At=(Tt+(St>>>13)|0)+(vs>>>26)|0,vs&=67108863,xt[0]=yn,xt[1]=_n,xt[2]=ds,xt[3]=fs,xt[4]=hs,xt[5]=ps,xt[6]=Vn,xt[7]=ss,xt[8]=Jn,xt[9]=Yn,xt[10]=ms,xt[11]=Qn,xt[12]=es,xt[13]=ls,xt[14]=us,xt[15]=Wn,xt[16]=as,xt[17]=gs,xt[18]=vs,At!==0&&(xt[19]=At,ct.length++),ct};Math.imul||(wt=yt);function Ct(jt,bt,vt){vt.negative=bt.negative^jt.negative,vt.length=jt.length+bt.length;for(var ct=0,dt=0,mt=0;mt>>26)|0,dt+=xt>>>26,xt&=67108863}vt.words[mt]=At,ct=xt,xt=dt}return ct!==0?vt.words[mt]=ct:vt.length--,vt.strip()}function Pt(jt,bt,vt){var ct=new $t;return ct.mulp(jt,bt,vt)}tt.prototype.mulTo=function(bt,vt){var ct,dt=this.length+bt.length;return this.length===10&&bt.length===10?ct=wt(this,bt,vt):dt<63?ct=yt(this,bt,vt):dt<1024?ct=Ct(this,bt,vt):ct=Pt(this,bt,vt),ct};function $t(jt,bt){this.x=jt,this.y=bt}$t.prototype.makeRBT=function(bt){for(var vt=new Array(bt),ct=tt.prototype._countBits(bt)-1,dt=0;dt>=1;return dt},$t.prototype.permute=function(bt,vt,ct,dt,mt,xt){for(var At=0;At>>1)mt++;return 1<>>13,ct[2*xt+1]=mt&8191,mt=mt>>>13;for(xt=2*vt;xt>=26,vt+=dt/67108864|0,vt+=mt>>>26,this.words[ct]=mt&67108863}return vt!==0&&(this.words[ct]=vt,this.length++),this},tt.prototype.muln=function(bt){return this.clone().imuln(bt)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(bt){var vt=ht(bt);if(vt.length===0)return new tt(1);for(var ct=this,dt=0;dt=0);var vt=bt%26,ct=(bt-vt)/26,dt=67108863>>>26-vt<<26-vt,mt;if(vt!==0){var xt=0;for(mt=0;mt>>26-vt}xt&&(this.words[mt]=xt,this.length++)}if(ct!==0){for(mt=this.length-1;mt>=0;mt--)this.words[mt+ct]=this.words[mt];for(mt=0;mt=0);var dt;vt?dt=(vt-vt%26)/26:dt=0;var mt=bt%26,xt=Math.min((bt-mt)/26,this.length),At=67108863^67108863>>>mt<xt)for(this.length-=xt,St=0;St=0&&(Tt!==0||St>=dt);St--){var Et=this.words[St]|0;this.words[St]=Tt<<26-mt|Et>>>mt,Tt=Et&At}return Rt&&Tt!==0&&(Rt.words[Rt.length++]=Tt),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},tt.prototype.ishrn=function(bt,vt,ct){return j(this.negative===0),this.iushrn(bt,vt,ct)},tt.prototype.shln=function(bt){return this.clone().ishln(bt)},tt.prototype.ushln=function(bt){return this.clone().iushln(bt)},tt.prototype.shrn=function(bt){return this.clone().ishrn(bt)},tt.prototype.ushrn=function(bt){return this.clone().iushrn(bt)},tt.prototype.testn=function(bt){j(typeof bt=="number"&&bt>=0);var vt=bt%26,ct=(bt-vt)/26,dt=1<=0);var vt=bt%26,ct=(bt-vt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=ct)return this;if(vt!==0&&ct++,this.length=Math.min(ct,this.length),vt!==0){var dt=67108863^67108863>>>vt<=67108864;vt++)this.words[vt]-=67108864,vt===this.length-1?this.words[vt+1]=1:this.words[vt+1]++;return this.length=Math.max(this.length,vt+1),this},tt.prototype.isubn=function(bt){if(j(typeof bt=="number"),j(bt<67108864),bt<0)return this.iaddn(-bt);if(this.negative!==0)return this.negative=0,this.iaddn(bt),this.negative=1,this;if(this.words[0]-=bt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var vt=0;vt>26)-(Rt/67108864|0),this.words[mt+ct]=xt&67108863}for(;mt>26,this.words[mt+ct]=xt&67108863;if(At===0)return this.strip();for(j(At===-1),At=0,mt=0;mt>26,this.words[mt]=xt&67108863;return this.negative=1,this.strip()},tt.prototype._wordDiv=function(bt,vt){var ct=this.length-bt.length,dt=this.clone(),mt=bt,xt=mt.words[mt.length-1]|0,At=this._countBits(xt);ct=26-At,ct!==0&&(mt=mt.ushln(ct),dt.iushln(ct),xt=mt.words[mt.length-1]|0);var Rt=dt.length-mt.length,St;if(vt!=="mod"){St=new tt(null),St.length=Rt+1,St.words=new Array(St.length);for(var Tt=0;Tt=0;Nt--){var tr=(dt.words[mt.length+Nt]|0)*67108864+(dt.words[mt.length+Nt-1]|0);for(tr=Math.min(tr/xt|0,67108863),dt._ishlnsubmul(mt,tr,Nt);dt.negative!==0;)tr--,dt.negative=0,dt._ishlnsubmul(mt,1,Nt),dt.isZero()||(dt.negative^=1);St&&(St.words[Nt]=tr)}return St&&St.strip(),dt.strip(),vt!=="div"&&ct!==0&&dt.iushrn(ct),{div:St||null,mod:dt}},tt.prototype.divmod=function(bt,vt,ct){if(j(!bt.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var dt,mt,xt;return this.negative!==0&&bt.negative===0?(xt=this.neg().divmod(bt,vt),vt!=="mod"&&(dt=xt.div.neg()),vt!=="div"&&(mt=xt.mod.neg(),ct&&mt.negative!==0&&mt.iadd(bt)),{div:dt,mod:mt}):this.negative===0&&bt.negative!==0?(xt=this.divmod(bt.neg(),vt),vt!=="mod"&&(dt=xt.div.neg()),{div:dt,mod:xt.mod}):this.negative&bt.negative?(xt=this.neg().divmod(bt.neg(),vt),vt!=="div"&&(mt=xt.mod.neg(),ct&&mt.negative!==0&&mt.isub(bt)),{div:xt.div,mod:mt}):bt.length>this.length||this.cmp(bt)<0?{div:new tt(0),mod:this}:bt.length===1?vt==="div"?{div:this.divn(bt.words[0]),mod:null}:vt==="mod"?{div:null,mod:new tt(this.modn(bt.words[0]))}:{div:this.divn(bt.words[0]),mod:new tt(this.modn(bt.words[0]))}:this._wordDiv(bt,vt)},tt.prototype.div=function(bt){return this.divmod(bt,"div",!1).div},tt.prototype.mod=function(bt){return this.divmod(bt,"mod",!1).mod},tt.prototype.umod=function(bt){return this.divmod(bt,"mod",!0).mod},tt.prototype.divRound=function(bt){var vt=this.divmod(bt);if(vt.mod.isZero())return vt.div;var ct=vt.div.negative!==0?vt.mod.isub(bt):vt.mod,dt=bt.ushrn(1),mt=bt.andln(1),xt=ct.cmp(dt);return xt<0||mt===1&&xt===0?vt.div:vt.div.negative!==0?vt.div.isubn(1):vt.div.iaddn(1)},tt.prototype.modn=function(bt){j(bt<=67108863);for(var vt=(1<<26)%bt,ct=0,dt=this.length-1;dt>=0;dt--)ct=(vt*ct+(this.words[dt]|0))%bt;return ct},tt.prototype.idivn=function(bt){j(bt<=67108863);for(var vt=0,ct=this.length-1;ct>=0;ct--){var dt=(this.words[ct]|0)+vt*67108864;this.words[ct]=dt/bt|0,vt=dt%bt}return this.strip()},tt.prototype.divn=function(bt){return this.clone().idivn(bt)},tt.prototype.egcd=function(bt){j(bt.negative===0),j(!bt.isZero());var vt=this,ct=bt.clone();vt.negative!==0?vt=vt.umod(bt):vt=vt.clone();for(var dt=new tt(1),mt=new tt(0),xt=new tt(0),At=new tt(1),Rt=0;vt.isEven()&&ct.isEven();)vt.iushrn(1),ct.iushrn(1),++Rt;for(var St=ct.clone(),Tt=vt.clone();!vt.isZero();){for(var Et=0,Nt=1;!(vt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(vt.iushrn(Et);Et-- >0;)(dt.isOdd()||mt.isOdd())&&(dt.iadd(St),mt.isub(Tt)),dt.iushrn(1),mt.iushrn(1);for(var tr=0,ir=1;!(ct.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(ct.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(St),At.isub(Tt)),xt.iushrn(1),At.iushrn(1);vt.cmp(ct)>=0?(vt.isub(ct),dt.isub(xt),mt.isub(At)):(ct.isub(vt),xt.isub(dt),At.isub(mt))}return{a:xt,b:At,gcd:ct.iushln(Rt)}},tt.prototype._invmp=function(bt){j(bt.negative===0),j(!bt.isZero());var vt=this,ct=bt.clone();vt.negative!==0?vt=vt.umod(bt):vt=vt.clone();for(var dt=new tt(1),mt=new tt(0),xt=ct.clone();vt.cmpn(1)>0&&ct.cmpn(1)>0;){for(var At=0,Rt=1;!(vt.words[0]&Rt)&&At<26;++At,Rt<<=1);if(At>0)for(vt.iushrn(At);At-- >0;)dt.isOdd()&&dt.iadd(xt),dt.iushrn(1);for(var St=0,Tt=1;!(ct.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(ct.iushrn(St);St-- >0;)mt.isOdd()&&mt.iadd(xt),mt.iushrn(1);vt.cmp(ct)>=0?(vt.isub(ct),dt.isub(mt)):(ct.isub(vt),mt.isub(dt))}var Et;return vt.cmpn(1)===0?Et=dt:Et=mt,Et.cmpn(0)<0&&Et.iadd(bt),Et},tt.prototype.gcd=function(bt){if(this.isZero())return bt.abs();if(bt.isZero())return this.abs();var vt=this.clone(),ct=bt.clone();vt.negative=0,ct.negative=0;for(var dt=0;vt.isEven()&&ct.isEven();dt++)vt.iushrn(1),ct.iushrn(1);do{for(;vt.isEven();)vt.iushrn(1);for(;ct.isEven();)ct.iushrn(1);var mt=vt.cmp(ct);if(mt<0){var xt=vt;vt=ct,ct=xt}else if(mt===0||ct.cmpn(1)===0)break;vt.isub(ct)}while(!0);return ct.iushln(dt)},tt.prototype.invm=function(bt){return this.egcd(bt).a.umod(bt)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(bt){return this.words[0]&bt},tt.prototype.bincn=function(bt){j(typeof bt=="number");var vt=bt%26,ct=(bt-vt)/26,dt=1<>>26,At&=67108863,this.words[xt]=At}return mt!==0&&(this.words[xt]=mt,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(bt){var vt=bt<0;if(this.negative!==0&&!vt)return-1;if(this.negative===0&&vt)return 1;this.strip();var ct;if(this.length>1)ct=1;else{vt&&(bt=-bt),j(bt<=67108863,"Number is too big");var dt=this.words[0]|0;ct=dt===bt?0:dtbt.length)return 1;if(this.length=0;ct--){var dt=this.words[ct]|0,mt=bt.words[ct]|0;if(dt!==mt){dtmt&&(vt=1);break}}return vt},tt.prototype.gtn=function(bt){return this.cmpn(bt)===1},tt.prototype.gt=function(bt){return this.cmp(bt)===1},tt.prototype.gten=function(bt){return this.cmpn(bt)>=0},tt.prototype.gte=function(bt){return this.cmp(bt)>=0},tt.prototype.ltn=function(bt){return this.cmpn(bt)===-1},tt.prototype.lt=function(bt){return this.cmp(bt)===-1},tt.prototype.lten=function(bt){return this.cmpn(bt)<=0},tt.prototype.lte=function(bt){return this.cmp(bt)<=0},tt.prototype.eqn=function(bt){return this.cmpn(bt)===0},tt.prototype.eq=function(bt){return this.cmp(bt)===0},tt.red=function(bt){return new Lt(bt)},tt.prototype.toRed=function(bt){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),bt.convertTo(this)._forceRed(bt)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(bt){return this.red=bt,this},tt.prototype.forceRed=function(bt){return j(!this.red,"Already a number in reduction context"),this._forceRed(bt)},tt.prototype.redAdd=function(bt){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,bt)},tt.prototype.redIAdd=function(bt){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,bt)},tt.prototype.redSub=function(bt){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,bt)},tt.prototype.redISub=function(bt){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,bt)},tt.prototype.redShl=function(bt){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,bt)},tt.prototype.redMul=function(bt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,bt),this.red.mul(this,bt)},tt.prototype.redIMul=function(bt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,bt),this.red.imul(this,bt)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(bt){return j(this.red&&!bt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,bt)};var Mt={k256:null,p224:null,p192:null,p25519:null};function Bt(jt,bt){this.name=jt,this.p=new tt(bt,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var bt=new tt(null);return bt.words=new Array(Math.ceil(this.n/13)),bt},Bt.prototype.ireduce=function(bt){var vt=bt,ct;do this.split(vt,this.tmp),vt=this.imulK(vt),vt=vt.iadd(this.tmp),ct=vt.bitLength();while(ct>this.n);var dt=ct0?vt.isub(this.p):vt.strip!==void 0?vt.strip():vt._strip(),vt},Bt.prototype.split=function(bt,vt){bt.iushrn(this.n,0,vt)},Bt.prototype.imulK=function(bt){return bt.imul(this.k)};function Dt(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Dt,Bt),Dt.prototype.split=function(bt,vt){for(var ct=4194303,dt=Math.min(bt.length,9),mt=0;mt>>22,xt=At}xt>>>=22,bt.words[mt-10]=xt,xt===0&&bt.length>10?bt.length-=10:bt.length-=9},Dt.prototype.imulK=function(bt){bt.words[bt.length]=0,bt.words[bt.length+1]=0,bt.length+=2;for(var vt=0,ct=0;ct>>=26,bt.words[ct]=mt,vt=dt}return vt!==0&&(bt.words[bt.length++]=vt),bt},tt._prime=function(bt){if(Mt[bt])return Mt[bt];var vt;if(bt==="k256")vt=new Dt;else if(bt==="p224")vt=new zt;else if(bt==="p192")vt=new Ot;else if(bt==="p25519")vt=new It;else throw new Error("Unknown prime "+bt);return Mt[bt]=vt,vt};function Lt(jt){if(typeof jt=="string"){var bt=tt._prime(jt);this.m=bt.p,this.prime=bt}else j(jt.gtn(1),"modulus must be greater than 1"),this.m=jt,this.prime=null}Lt.prototype._verify1=function(bt){j(bt.negative===0,"red works only with positives"),j(bt.red,"red works only with red numbers")},Lt.prototype._verify2=function(bt,vt){j((bt.negative|vt.negative)===0,"red works only with positives"),j(bt.red&&bt.red===vt.red,"red works only with red numbers")},Lt.prototype.imod=function(bt){return this.prime?this.prime.ireduce(bt)._forceRed(this):bt.umod(this.m)._forceRed(this)},Lt.prototype.neg=function(bt){return bt.isZero()?bt.clone():this.m.sub(bt)._forceRed(this)},Lt.prototype.add=function(bt,vt){this._verify2(bt,vt);var ct=bt.add(vt);return ct.cmp(this.m)>=0&&ct.isub(this.m),ct._forceRed(this)},Lt.prototype.iadd=function(bt,vt){this._verify2(bt,vt);var ct=bt.iadd(vt);return ct.cmp(this.m)>=0&&ct.isub(this.m),ct},Lt.prototype.sub=function(bt,vt){this._verify2(bt,vt);var ct=bt.sub(vt);return ct.cmpn(0)<0&&ct.iadd(this.m),ct._forceRed(this)},Lt.prototype.isub=function(bt,vt){this._verify2(bt,vt);var ct=bt.isub(vt);return ct.cmpn(0)<0&&ct.iadd(this.m),ct},Lt.prototype.shl=function(bt,vt){return this._verify1(bt),this.imod(bt.ushln(vt))},Lt.prototype.imul=function(bt,vt){return this._verify2(bt,vt),this.imod(bt.imul(vt))},Lt.prototype.mul=function(bt,vt){return this._verify2(bt,vt),this.imod(bt.mul(vt))},Lt.prototype.isqr=function(bt){return this.imul(bt,bt.clone())},Lt.prototype.sqr=function(bt){return this.mul(bt,bt)},Lt.prototype.sqrt=function(bt){if(bt.isZero())return bt.clone();var vt=this.m.andln(3);if(j(vt%2===1),vt===3){var ct=this.m.add(new tt(1)).iushrn(2);return this.pow(bt,ct)}for(var dt=this.m.subn(1),mt=0;!dt.isZero()&&dt.andln(1)===0;)mt++,dt.iushrn(1);j(!dt.isZero());var xt=new tt(1).toRed(this),At=xt.redNeg(),Rt=this.m.subn(1).iushrn(1),St=this.m.bitLength();for(St=new tt(2*St*St).toRed(this);this.pow(St,Rt).cmp(At)!==0;)St.redIAdd(At);for(var Tt=this.pow(St,dt),Et=this.pow(bt,dt.addn(1).iushrn(1)),Nt=this.pow(bt,dt),tr=mt;Nt.cmp(xt)!==0;){for(var ir=Nt,nr=0;ir.cmp(xt)!==0;nr++)ir=ir.redSqr();j(nr=0;mt--){for(var Tt=vt.words[mt],Et=St-1;Et>=0;Et--){var Nt=Tt>>Et&1;if(xt!==dt[0]&&(xt=this.sqr(xt)),Nt===0&&At===0){Rt=0;continue}At<<=1,At|=Nt,Rt++,!(Rt!==ct&&(mt!==0||Et!==0))&&(xt=this.mul(xt,dt[At]),Rt=0,At=0)}St=26}return xt},Lt.prototype.convertTo=function(bt){var vt=bt.umod(this.m);return vt===bt?vt.clone():vt},Lt.prototype.convertFrom=function(bt){var vt=bt.clone();return vt.red=null,vt},tt.mont=function(bt){return new Ft(bt)};function Ft(jt){Lt.call(this,jt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(Ft,Lt),Ft.prototype.convertTo=function(bt){return this.imod(bt.ushln(this.shift))},Ft.prototype.convertFrom=function(bt){var vt=this.imod(bt.mul(this.rinv));return vt.red=null,vt},Ft.prototype.imul=function(bt,vt){if(bt.isZero()||vt.isZero())return bt.words[0]=0,bt.length=1,bt;var ct=bt.imul(vt),dt=ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mt=ct.isub(dt).iushrn(this.shift),xt=mt;return mt.cmp(this.m)>=0?xt=mt.isub(this.m):mt.cmpn(0)<0&&(xt=mt.iadd(this.m)),xt._forceRed(this)},Ft.prototype.mul=function(bt,vt){if(bt.isZero()||vt.isZero())return new tt(0)._forceRed(this);var ct=bt.mul(vt),dt=ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mt=ct.isub(dt).iushrn(this.shift),xt=mt;return mt.cmp(this.m)>=0?xt=mt.isub(this.m):mt.cmpn(0)<0&&(xt=mt.iadd(this.m)),xt._forceRed(this)},Ft.prototype.invm=function(bt){var vt=this.imod(bt._invmp(this.m).mul(this.r2));return vt._forceRed(this)}})(a,commonjsGlobal)}(bn$2)),bn$2.exports}var utils$v={};(function(a){var _=a;function $(tt,rt){if(Array.isArray(tt))return tt.slice();if(!tt)return[];var nt=[];if(typeof tt!="string"){for(var it=0;it>8,at=st&255;ot?nt.push(ot,at):nt.push(at)}return nt}_.toArray=$;function j(tt){return tt.length===1?"0"+tt:tt}_.zero2=j;function et(tt){for(var rt="",nt=0;nt(wt>>1)-1?Pt=(wt>>1)-$t:Pt=$t,Ct.isubn(Pt)):Pt=0,ht[yt]=Pt,Ct.iushrn(1)}return ht}_.getNAF=tt;function rt(ot,at){var ut=[[],[]];ot=ot.clone(),at=at.clone();for(var ht=0,yt=0,wt;ot.cmpn(-ht)>0||at.cmpn(-yt)>0;){var Ct=ot.andln(3)+ht&3,Pt=at.andln(3)+yt&3;Ct===3&&(Ct=-1),Pt===3&&(Pt=-1);var $t;Ct&1?(wt=ot.andln(7)+ht&7,(wt===3||wt===5)&&Pt===2?$t=-Ct:$t=Ct):$t=0,ut[0].push($t);var Mt;Pt&1?(wt=at.andln(7)+yt&7,(wt===3||wt===5)&&Ct===2?Mt=-Pt:Mt=Pt):Mt=0,ut[1].push(Mt),2*ht===$t+1&&(ht=1-ht),2*yt===Mt+1&&(yt=1-yt),ot.iushrn(1),at.iushrn(1)}return ut}_.getJSF=rt;function nt(ot,at,ut){var ht="_"+at;ot.prototype[at]=function(){return this[ht]!==void 0?this[ht]:this[ht]=ut.call(this)}}_.cachedProperty=nt;function it(ot){return typeof ot=="string"?_.toArray(ot,"hex"):ot}_.parseBytes=it;function st(ot){return new $(ot,"hex","le")}_.intFromLE=st}(utils$w)),utils$w}var curve$2={},base$5,hasRequiredBase$2;function requireBase$2(){if(hasRequiredBase$2)return base$5;hasRequiredBase$2=1;var a=requireBn$1(),_=requireUtils$1(),$=_.getNAF,j=_.getJSF,et=_.assert;function tt(nt,it){this.type=nt,this.p=new a(it.p,16),this.red=it.prime?a.red(it.prime):a.mont(this.p),this.zero=new a(0).toRed(this.red),this.one=new a(1).toRed(this.red),this.two=new a(2).toRed(this.red),this.n=it.n&&new a(it.n,16),this.g=it.g&&this.pointFromJSON(it.g,it.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var st=this.n&&this.p.div(this.n);!st||st.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$5=tt,tt.prototype.point=function(){throw new Error("Not implemented")},tt.prototype.validate=function(){throw new Error("Not implemented")},tt.prototype._fixedNafMul=function(it,st){et(it.precomputed);var ot=it._getDoubles(),at=$(st,1,this._bitLength),ut=(1<=yt;Ct--)wt=(wt<<1)+at[Ct];ht.push(wt)}for(var Pt=this.jpoint(null,null,null),$t=this.jpoint(null,null,null),Mt=ut;Mt>0;Mt--){for(yt=0;yt=0;wt--){for(var Ct=0;wt>=0&&ht[wt]===0;wt--)Ct++;if(wt>=0&&Ct++,yt=yt.dblp(Ct),wt<0)break;var Pt=ht[wt];et(Pt!==0),it.type==="affine"?Pt>0?yt=yt.mixedAdd(ut[Pt-1>>1]):yt=yt.mixedAdd(ut[-Pt-1>>1].neg()):Pt>0?yt=yt.add(ut[Pt-1>>1]):yt=yt.add(ut[-Pt-1>>1].neg())}return it.type==="affine"?yt.toP():yt},tt.prototype._wnafMulAdd=function(it,st,ot,at,ut){var ht=this._wnafT1,yt=this._wnafT2,wt=this._wnafT3,Ct=0,Pt,$t,Mt;for(Pt=0;Pt=1;Pt-=2){var Dt=Pt-1,zt=Pt;if(ht[Dt]!==1||ht[zt]!==1){wt[Dt]=$(ot[Dt],ht[Dt],this._bitLength),wt[zt]=$(ot[zt],ht[zt],this._bitLength),Ct=Math.max(wt[Dt].length,Ct),Ct=Math.max(wt[zt].length,Ct);continue}var Ot=[st[Dt],null,null,st[zt]];st[Dt].y.cmp(st[zt].y)===0?(Ot[1]=st[Dt].add(st[zt]),Ot[2]=st[Dt].toJ().mixedAdd(st[zt].neg())):st[Dt].y.cmp(st[zt].y.redNeg())===0?(Ot[1]=st[Dt].toJ().mixedAdd(st[zt]),Ot[2]=st[Dt].add(st[zt].neg())):(Ot[1]=st[Dt].toJ().mixedAdd(st[zt]),Ot[2]=st[Dt].toJ().mixedAdd(st[zt].neg()));var It=[-3,-1,-5,-7,0,7,5,1,3],Lt=j(ot[Dt],ot[zt]);for(Ct=Math.max(Lt[0].length,Ct),wt[Dt]=new Array(Ct),wt[zt]=new Array(Ct),$t=0;$t=0;Pt--){for(var ct=0;Pt>=0;){var dt=!0;for($t=0;$t=0&&ct++,bt=bt.dblp(ct),Pt<0)break;for($t=0;$t0?Mt=yt[$t][mt-1>>1]:mt<0&&(Mt=yt[$t][-mt-1>>1].neg()),Mt.type==="affine"?bt=bt.mixedAdd(Mt):bt=bt.add(Mt))}}for(Pt=0;Pt=Math.ceil((it.bitLength()+1)/st.step):!1},rt.prototype._getDoubles=function(it,st){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var ot=[this],at=this,ut=0;ut=0&&(Dt=Pt,zt=$t),Mt.negative&&(Mt=Mt.neg(),Bt=Bt.neg()),Dt.negative&&(Dt=Dt.neg(),zt=zt.neg()),[{a:Mt,b:Bt},{a:Dt,b:zt}]},tt.prototype._endoSplit=function(st){var ot=this.endo.basis,at=ot[0],ut=ot[1],ht=ut.b.mul(st).divRound(this.n),yt=at.b.neg().mul(st).divRound(this.n),wt=ht.mul(at.a),Ct=yt.mul(ut.a),Pt=ht.mul(at.b),$t=yt.mul(ut.b),Mt=st.sub(wt).sub(Ct),Bt=Pt.add($t).neg();return{k1:Mt,k2:Bt}},tt.prototype.pointFromX=function(st,ot){st=new _(st,16),st.red||(st=st.toRed(this.red));var at=st.redSqr().redMul(st).redIAdd(st.redMul(this.a)).redIAdd(this.b),ut=at.redSqrt();if(ut.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");var ht=ut.fromRed().isOdd();return(ot&&!ht||!ot&&ht)&&(ut=ut.redNeg()),this.point(st,ut)},tt.prototype.validate=function(st){if(st.inf)return!0;var ot=st.x,at=st.y,ut=this.a.redMul(ot),ht=ot.redSqr().redMul(ot).redIAdd(ut).redIAdd(this.b);return at.redSqr().redISub(ht).cmpn(0)===0},tt.prototype._endoWnafMulAdd=function(st,ot,at){for(var ut=this._endoWnafT1,ht=this._endoWnafT2,yt=0;yt":""},rt.prototype.isInfinity=function(){return this.inf},rt.prototype.add=function(st){if(this.inf)return st;if(st.inf)return this;if(this.eq(st))return this.dbl();if(this.neg().eq(st))return this.curve.point(null,null);if(this.x.cmp(st.x)===0)return this.curve.point(null,null);var ot=this.y.redSub(st.y);ot.cmpn(0)!==0&&(ot=ot.redMul(this.x.redSub(st.x).redInvm()));var at=ot.redSqr().redISub(this.x).redISub(st.x),ut=ot.redMul(this.x.redSub(at)).redISub(this.y);return this.curve.point(at,ut)},rt.prototype.dbl=function(){if(this.inf)return this;var st=this.y.redAdd(this.y);if(st.cmpn(0)===0)return this.curve.point(null,null);var ot=this.curve.a,at=this.x.redSqr(),ut=st.redInvm(),ht=at.redAdd(at).redIAdd(at).redIAdd(ot).redMul(ut),yt=ht.redSqr().redISub(this.x.redAdd(this.x)),wt=ht.redMul(this.x.redSub(yt)).redISub(this.y);return this.curve.point(yt,wt)},rt.prototype.getX=function(){return this.x.fromRed()},rt.prototype.getY=function(){return this.y.fromRed()},rt.prototype.mul=function(st){return st=new _(st,16),this.isInfinity()?this:this._hasDoubles(st)?this.curve._fixedNafMul(this,st):this.curve.endo?this.curve._endoWnafMulAdd([this],[st]):this.curve._wnafMul(this,st)},rt.prototype.mulAdd=function(st,ot,at){var ut=[this,ot],ht=[st,at];return this.curve.endo?this.curve._endoWnafMulAdd(ut,ht):this.curve._wnafMulAdd(1,ut,ht,2)},rt.prototype.jmulAdd=function(st,ot,at){var ut=[this,ot],ht=[st,at];return this.curve.endo?this.curve._endoWnafMulAdd(ut,ht,!0):this.curve._wnafMulAdd(1,ut,ht,2,!0)},rt.prototype.eq=function(st){return this===st||this.inf===st.inf&&(this.inf||this.x.cmp(st.x)===0&&this.y.cmp(st.y)===0)},rt.prototype.neg=function(st){if(this.inf)return this;var ot=this.curve.point(this.x,this.y.redNeg());if(st&&this.precomputed){var at=this.precomputed,ut=function(ht){return ht.neg()};ot.precomputed={naf:at.naf&&{wnd:at.naf.wnd,points:at.naf.points.map(ut)},doubles:at.doubles&&{step:at.doubles.step,points:at.doubles.points.map(ut)}}}return ot},rt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var st=this.curve.jpoint(this.x,this.y,this.curve.one);return st};function nt(it,st,ot,at){j.BasePoint.call(this,it,"jacobian"),st===null&&ot===null&&at===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new _(0)):(this.x=new _(st,16),this.y=new _(ot,16),this.z=new _(at,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return $(nt,j.BasePoint),tt.prototype.jpoint=function(st,ot,at){return new nt(this,st,ot,at)},nt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var st=this.z.redInvm(),ot=st.redSqr(),at=this.x.redMul(ot),ut=this.y.redMul(ot).redMul(st);return this.curve.point(at,ut)},nt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},nt.prototype.add=function(st){if(this.isInfinity())return st;if(st.isInfinity())return this;var ot=st.z.redSqr(),at=this.z.redSqr(),ut=this.x.redMul(ot),ht=st.x.redMul(at),yt=this.y.redMul(ot.redMul(st.z)),wt=st.y.redMul(at.redMul(this.z)),Ct=ut.redSub(ht),Pt=yt.redSub(wt);if(Ct.cmpn(0)===0)return Pt.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var $t=Ct.redSqr(),Mt=$t.redMul(Ct),Bt=ut.redMul($t),Dt=Pt.redSqr().redIAdd(Mt).redISub(Bt).redISub(Bt),zt=Pt.redMul(Bt.redISub(Dt)).redISub(yt.redMul(Mt)),Ot=this.z.redMul(st.z).redMul(Ct);return this.curve.jpoint(Dt,zt,Ot)},nt.prototype.mixedAdd=function(st){if(this.isInfinity())return st.toJ();if(st.isInfinity())return this;var ot=this.z.redSqr(),at=this.x,ut=st.x.redMul(ot),ht=this.y,yt=st.y.redMul(ot).redMul(this.z),wt=at.redSub(ut),Ct=ht.redSub(yt);if(wt.cmpn(0)===0)return Ct.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var Pt=wt.redSqr(),$t=Pt.redMul(wt),Mt=at.redMul(Pt),Bt=Ct.redSqr().redIAdd($t).redISub(Mt).redISub(Mt),Dt=Ct.redMul(Mt.redISub(Bt)).redISub(ht.redMul($t)),zt=this.z.redMul(wt);return this.curve.jpoint(Bt,Dt,zt)},nt.prototype.dblp=function(st){if(st===0)return this;if(this.isInfinity())return this;if(!st)return this.dbl();var ot;if(this.curve.zeroA||this.curve.threeA){var at=this;for(ot=0;ot=0)return!1;if(at.redIAdd(ht),this.x.cmp(at)===0)return!0}},nt.prototype.inspect=function(){return this.isInfinity()?"":""},nt.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short$2}var mont$2,hasRequiredMont$1;function requireMont$1(){if(hasRequiredMont$1)return mont$2;hasRequiredMont$1=1;var a=requireBn$1(),_=inherits_browserExports,$=requireBase$2(),j=requireUtils$1();function et(rt){$.call(this,"mont",rt),this.a=new a(rt.a,16).toRed(this.red),this.b=new a(rt.b,16).toRed(this.red),this.i4=new a(4).toRed(this.red).redInvm(),this.two=new a(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}_(et,$),mont$2=et,et.prototype.validate=function(nt){var it=nt.normalize().x,st=it.redSqr(),ot=st.redMul(it).redAdd(st.redMul(this.a)).redAdd(it),at=ot.redSqrt();return at.redSqr().cmp(ot)===0};function tt(rt,nt,it){$.BasePoint.call(this,rt,"projective"),nt===null&&it===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new a(nt,16),this.z=new a(it,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return _(tt,$.BasePoint),et.prototype.decodePoint=function(nt,it){return this.point(j.toArray(nt,it),1)},et.prototype.point=function(nt,it){return new tt(this,nt,it)},et.prototype.pointFromJSON=function(nt){return tt.fromJSON(this,nt)},tt.prototype.precompute=function(){},tt.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},tt.fromJSON=function(nt,it){return new tt(nt,it[0],it[1]||nt.one)},tt.prototype.inspect=function(){return this.isInfinity()?"":""},tt.prototype.isInfinity=function(){return this.z.cmpn(0)===0},tt.prototype.dbl=function(){var nt=this.x.redAdd(this.z),it=nt.redSqr(),st=this.x.redSub(this.z),ot=st.redSqr(),at=it.redSub(ot),ut=it.redMul(ot),ht=at.redMul(ot.redAdd(this.curve.a24.redMul(at)));return this.curve.point(ut,ht)},tt.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.diffAdd=function(nt,it){var st=this.x.redAdd(this.z),ot=this.x.redSub(this.z),at=nt.x.redAdd(nt.z),ut=nt.x.redSub(nt.z),ht=ut.redMul(st),yt=at.redMul(ot),wt=it.z.redMul(ht.redAdd(yt).redSqr()),Ct=it.x.redMul(ht.redISub(yt).redSqr());return this.curve.point(wt,Ct)},tt.prototype.mul=function(nt){for(var it=nt.clone(),st=this,ot=this.curve.point(null,null),at=this,ut=[];it.cmpn(0)!==0;it.iushrn(1))ut.push(it.andln(1));for(var ht=ut.length-1;ht>=0;ht--)ut[ht]===0?(st=st.diffAdd(ot,at),ot=ot.dbl()):(ot=st.diffAdd(ot,at),st=st.dbl());return ot},tt.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.eq=function(nt){return this.getX().cmp(nt.getX())===0},tt.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},tt.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont$2}var edwards$2,hasRequiredEdwards$1;function requireEdwards$1(){if(hasRequiredEdwards$1)return edwards$2;hasRequiredEdwards$1=1;var a=requireUtils$1(),_=requireBn$1(),$=inherits_browserExports,j=requireBase$2(),et=a.assert;function tt(nt){this.twisted=(nt.a|0)!==1,this.mOneA=this.twisted&&(nt.a|0)===-1,this.extended=this.mOneA,j.call(this,"edwards",nt),this.a=new _(nt.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _(nt.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _(nt.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),et(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(nt.c|0)===1}$(tt,j),edwards$2=tt,tt.prototype._mulA=function(it){return this.mOneA?it.redNeg():this.a.redMul(it)},tt.prototype._mulC=function(it){return this.oneC?it:this.c.redMul(it)},tt.prototype.jpoint=function(it,st,ot,at){return this.point(it,st,ot,at)},tt.prototype.pointFromX=function(it,st){it=new _(it,16),it.red||(it=it.toRed(this.red));var ot=it.redSqr(),at=this.c2.redSub(this.a.redMul(ot)),ut=this.one.redSub(this.c2.redMul(this.d).redMul(ot)),ht=at.redMul(ut.redInvm()),yt=ht.redSqrt();if(yt.redSqr().redSub(ht).cmp(this.zero)!==0)throw new Error("invalid point");var wt=yt.fromRed().isOdd();return(st&&!wt||!st&&wt)&&(yt=yt.redNeg()),this.point(it,yt)},tt.prototype.pointFromY=function(it,st){it=new _(it,16),it.red||(it=it.toRed(this.red));var ot=it.redSqr(),at=ot.redSub(this.c2),ut=ot.redMul(this.d).redMul(this.c2).redSub(this.a),ht=at.redMul(ut.redInvm());if(ht.cmp(this.zero)===0){if(st)throw new Error("invalid point");return this.point(this.zero,it)}var yt=ht.redSqrt();if(yt.redSqr().redSub(ht).cmp(this.zero)!==0)throw new Error("invalid point");return yt.fromRed().isOdd()!==st&&(yt=yt.redNeg()),this.point(yt,it)},tt.prototype.validate=function(it){if(it.isInfinity())return!0;it.normalize();var st=it.x.redSqr(),ot=it.y.redSqr(),at=st.redMul(this.a).redAdd(ot),ut=this.c2.redMul(this.one.redAdd(this.d.redMul(st).redMul(ot)));return at.cmp(ut)===0};function rt(nt,it,st,ot,at){j.BasePoint.call(this,nt,"projective"),it===null&&st===null&&ot===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new _(it,16),this.y=new _(st,16),this.z=ot?new _(ot,16):this.curve.one,this.t=at&&new _(at,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return $(rt,j.BasePoint),tt.prototype.pointFromJSON=function(it){return rt.fromJSON(this,it)},tt.prototype.point=function(it,st,ot,at){return new rt(this,it,st,ot,at)},rt.fromJSON=function(it,st){return new rt(it,st[0],st[1],st[2])},rt.prototype.inspect=function(){return this.isInfinity()?"":""},rt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},rt.prototype._extDbl=function(){var it=this.x.redSqr(),st=this.y.redSqr(),ot=this.z.redSqr();ot=ot.redIAdd(ot);var at=this.curve._mulA(it),ut=this.x.redAdd(this.y).redSqr().redISub(it).redISub(st),ht=at.redAdd(st),yt=ht.redSub(ot),wt=at.redSub(st),Ct=ut.redMul(yt),Pt=ht.redMul(wt),$t=ut.redMul(wt),Mt=yt.redMul(ht);return this.curve.point(Ct,Pt,Mt,$t)},rt.prototype._projDbl=function(){var it=this.x.redAdd(this.y).redSqr(),st=this.x.redSqr(),ot=this.y.redSqr(),at,ut,ht,yt,wt,Ct;if(this.curve.twisted){yt=this.curve._mulA(st);var Pt=yt.redAdd(ot);this.zOne?(at=it.redSub(st).redSub(ot).redMul(Pt.redSub(this.curve.two)),ut=Pt.redMul(yt.redSub(ot)),ht=Pt.redSqr().redSub(Pt).redSub(Pt)):(wt=this.z.redSqr(),Ct=Pt.redSub(wt).redISub(wt),at=it.redSub(st).redISub(ot).redMul(Ct),ut=Pt.redMul(yt.redSub(ot)),ht=Pt.redMul(Ct))}else yt=st.redAdd(ot),wt=this.curve._mulC(this.z).redSqr(),Ct=yt.redSub(wt).redSub(wt),at=this.curve._mulC(it.redISub(yt)).redMul(Ct),ut=this.curve._mulC(yt).redMul(st.redISub(ot)),ht=yt.redMul(Ct);return this.curve.point(at,ut,ht)},rt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},rt.prototype._extAdd=function(it){var st=this.y.redSub(this.x).redMul(it.y.redSub(it.x)),ot=this.y.redAdd(this.x).redMul(it.y.redAdd(it.x)),at=this.t.redMul(this.curve.dd).redMul(it.t),ut=this.z.redMul(it.z.redAdd(it.z)),ht=ot.redSub(st),yt=ut.redSub(at),wt=ut.redAdd(at),Ct=ot.redAdd(st),Pt=ht.redMul(yt),$t=wt.redMul(Ct),Mt=ht.redMul(Ct),Bt=yt.redMul(wt);return this.curve.point(Pt,$t,Bt,Mt)},rt.prototype._projAdd=function(it){var st=this.z.redMul(it.z),ot=st.redSqr(),at=this.x.redMul(it.x),ut=this.y.redMul(it.y),ht=this.curve.d.redMul(at).redMul(ut),yt=ot.redSub(ht),wt=ot.redAdd(ht),Ct=this.x.redAdd(this.y).redMul(it.x.redAdd(it.y)).redISub(at).redISub(ut),Pt=st.redMul(yt).redMul(Ct),$t,Mt;return this.curve.twisted?($t=st.redMul(wt).redMul(ut.redSub(this.curve._mulA(at))),Mt=yt.redMul(wt)):($t=st.redMul(wt).redMul(ut.redSub(at)),Mt=this.curve._mulC(yt).redMul(wt)),this.curve.point(Pt,$t,Mt)},rt.prototype.add=function(it){return this.isInfinity()?it:it.isInfinity()?this:this.curve.extended?this._extAdd(it):this._projAdd(it)},rt.prototype.mul=function(it){return this._hasDoubles(it)?this.curve._fixedNafMul(this,it):this.curve._wnafMul(this,it)},rt.prototype.mulAdd=function(it,st,ot){return this.curve._wnafMulAdd(1,[this,st],[it,ot],2,!1)},rt.prototype.jmulAdd=function(it,st,ot){return this.curve._wnafMulAdd(1,[this,st],[it,ot],2,!0)},rt.prototype.normalize=function(){if(this.zOne)return this;var it=this.z.redInvm();return this.x=this.x.redMul(it),this.y=this.y.redMul(it),this.t&&(this.t=this.t.redMul(it)),this.z=this.curve.one,this.zOne=!0,this},rt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},rt.prototype.getX=function(){return this.normalize(),this.x.fromRed()},rt.prototype.getY=function(){return this.normalize(),this.y.fromRed()},rt.prototype.eq=function(it){return this===it||this.getX().cmp(it.getX())===0&&this.getY().cmp(it.getY())===0},rt.prototype.eqXToP=function(it){var st=it.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(st)===0)return!0;for(var ot=it.clone(),at=this.curve.redN.redMul(this.z);;){if(ot.iadd(this.curve.n),ot.cmp(this.curve.p)>=0)return!1;if(st.redIAdd(at),this.x.cmp(st)===0)return!0}},rt.prototype.toP=rt.prototype.normalize,rt.prototype.mixedAdd=rt.prototype.add,edwards$2}var hasRequiredCurve$1;function requireCurve$1(){return hasRequiredCurve$1||(hasRequiredCurve$1=1,function(a){var _=a;_.base=requireBase$2(),_.short=requireShort$1(),_.mont=requireMont$1(),_.edwards=requireEdwards$1()}(curve$2)),curve$2}var curves$4={},hash$4={},utils$u={},assert$g=minimalisticAssert,inherits$5=inherits_browserExports;utils$u.inherits=inherits$5;function isSurrogatePair(a,_){return(a.charCodeAt(_)&64512)!==55296||_<0||_+1>=a.length?!1:(a.charCodeAt(_+1)&64512)===56320}function toArray$3(a,_){if(Array.isArray(a))return a.slice();if(!a)return[];var $=[];if(typeof a=="string")if(_){if(_==="hex")for(a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a),et=0;et>6|192,$[j++]=tt&63|128):isSurrogatePair(a,et)?(tt=65536+((tt&1023)<<10)+(a.charCodeAt(++et)&1023),$[j++]=tt>>18|240,$[j++]=tt>>12&63|128,$[j++]=tt>>6&63|128,$[j++]=tt&63|128):($[j++]=tt>>12|224,$[j++]=tt>>6&63|128,$[j++]=tt&63|128)}else for(et=0;et>>24|a>>>8&65280|a<<8&16711680|(a&255)<<24;return _>>>0}utils$u.htonl=htonl;function toHex32(a,_){for(var $="",j=0;j>>0}return tt}utils$u.join32=join32;function split32(a,_){for(var $=new Array(a.length*4),j=0,et=0;j>>24,$[et+1]=tt>>>16&255,$[et+2]=tt>>>8&255,$[et+3]=tt&255):($[et+3]=tt>>>24,$[et+2]=tt>>>16&255,$[et+1]=tt>>>8&255,$[et]=tt&255)}return $}utils$u.split32=split32;function rotr32$1(a,_){return a>>>_|a<<32-_}utils$u.rotr32=rotr32$1;function rotl32$2(a,_){return a<<_|a>>>32-_}utils$u.rotl32=rotl32$2;function sum32$3(a,_){return a+_>>>0}utils$u.sum32=sum32$3;function sum32_3$1(a,_,$){return a+_+$>>>0}utils$u.sum32_3=sum32_3$1;function sum32_4$2(a,_,$,j){return a+_+$+j>>>0}utils$u.sum32_4=sum32_4$2;function sum32_5$2(a,_,$,j,et){return a+_+$+j+et>>>0}utils$u.sum32_5=sum32_5$2;function sum64$1(a,_,$,j){var et=a[_],tt=a[_+1],rt=j+tt>>>0,nt=(rt>>0,a[_+1]=rt}utils$u.sum64=sum64$1;function sum64_hi$1(a,_,$,j){var et=_+j>>>0,tt=(et<_?1:0)+a+$;return tt>>>0}utils$u.sum64_hi=sum64_hi$1;function sum64_lo$1(a,_,$,j){var et=_+j;return et>>>0}utils$u.sum64_lo=sum64_lo$1;function sum64_4_hi$1(a,_,$,j,et,tt,rt,nt){var it=0,st=_;st=st+j>>>0,it+=st<_?1:0,st=st+tt>>>0,it+=st>>0,it+=st>>0}utils$u.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(a,_,$,j,et,tt,rt,nt){var it=_+j+tt+nt;return it>>>0}utils$u.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(a,_,$,j,et,tt,rt,nt,it,st){var ot=0,at=_;at=at+j>>>0,ot+=at<_?1:0,at=at+tt>>>0,ot+=at>>0,ot+=at>>0,ot+=at>>0}utils$u.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(a,_,$,j,et,tt,rt,nt,it,st){var ot=_+j+tt+nt+st;return ot>>>0}utils$u.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(a,_,$){var j=_<<32-$|a>>>$;return j>>>0}utils$u.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(a,_,$){var j=a<<32-$|_>>>$;return j>>>0}utils$u.rotr64_lo=rotr64_lo$1;function shr64_hi$1(a,_,$){return a>>>$}utils$u.shr64_hi=shr64_hi$1;function shr64_lo$1(a,_,$){var j=a<<32-$|_>>>$;return j>>>0}utils$u.shr64_lo=shr64_lo$1;var common$6={},utils$t=utils$u,assert$f=minimalisticAssert;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$6.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(_,$){if(_=utils$t.toArray(_,$),this.pending?this.pending=this.pending.concat(_):this.pending=_,this.pendingTotal+=_.length,this.pending.length>=this._delta8){_=this.pending;var j=_.length%this._delta8;this.pending=_.slice(_.length-j,_.length),this.pending.length===0&&(this.pending=null),_=utils$t.join32(_,0,_.length-j,this.endian);for(var et=0;et<_.length;et+=this._delta32)this._update(_,et,et+this._delta32)}return this};BlockHash$4.prototype.digest=function(_){return this.update(this._pad()),assert$f(this.pending===null),this._digest(_)};BlockHash$4.prototype._pad=function(){var _=this.pendingTotal,$=this._delta8,j=$-(_+this.padLength)%$,et=new Array(j+this.padLength);et[0]=128;for(var tt=1;tt>>24&255,et[tt++]=_>>>16&255,et[tt++]=_>>>8&255,et[tt++]=_&255}else for(et[tt++]=_&255,et[tt++]=_>>>8&255,et[tt++]=_>>>16&255,et[tt++]=_>>>24&255,et[tt++]=0,et[tt++]=0,et[tt++]=0,et[tt++]=0,rt=8;rt>>3}common$5.g0_256=g0_256$1;function g1_256$1(a){return rotr32(a,17)^rotr32(a,19)^a>>>10}common$5.g1_256=g1_256$1;var utils$r=utils$u,common$4=common$6,shaCommon$1=common$5,rotl32$1=utils$r.rotl32,sum32$2=utils$r.sum32,sum32_5$1=utils$r.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$4.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$r.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512;SHA1.outSize=160;SHA1.hmacStrength=80;SHA1.padLength=64;SHA1.prototype._update=function(_,$){for(var j=this.W,et=0;et<16;et++)j[et]=_[$+et];for(;etthis.blockSize&&(_=new this.Hash().update(_).digest()),assert$c(_.length<=this.blockSize);for(var $=_.length;$=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(_,$,j)}var hmacDrbg=HmacDRBG$1;HmacDRBG$1.prototype._init=function(_,$,j){var et=_.concat($).concat(j);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var tt=0;tt=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(_.concat(j||[])),this._reseed=1};HmacDRBG$1.prototype.generate=function(_,$,j,et){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof $!="string"&&(et=j,j=$,$=null),j&&(j=utils$k.toArray(j,et||"hex"),this._update(j));for(var tt=[];tt.length<_;)this.V=this._hmac().update(this.V).digest(),tt=tt.concat(this.V);var rt=tt.slice(0,_);return this._update(j),this._reseed++,utils$k.encode(rt,$)};var key$5,hasRequiredKey$3;function requireKey$3(){if(hasRequiredKey$3)return key$5;hasRequiredKey$3=1;var a=requireBn$1(),_=requireUtils$1(),$=_.assert;function j(et,tt){this.ec=et,this.priv=null,this.pub=null,tt.priv&&this._importPrivate(tt.priv,tt.privEnc),tt.pub&&this._importPublic(tt.pub,tt.pubEnc)}return key$5=j,j.fromPublic=function(tt,rt,nt){return rt instanceof j?rt:new j(tt,{pub:rt,pubEnc:nt})},j.fromPrivate=function(tt,rt,nt){return rt instanceof j?rt:new j(tt,{priv:rt,privEnc:nt})},j.prototype.validate=function(){var tt=this.getPublic();return tt.isInfinity()?{result:!1,reason:"Invalid public key"}:tt.validate()?tt.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},j.prototype.getPublic=function(tt,rt){return typeof tt=="string"&&(rt=tt,tt=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),rt?this.pub.encode(rt,tt):this.pub},j.prototype.getPrivate=function(tt){return tt==="hex"?this.priv.toString(16,2):this.priv},j.prototype._importPrivate=function(tt,rt){this.priv=new a(tt,rt||16),this.priv=this.priv.umod(this.ec.curve.n)},j.prototype._importPublic=function(tt,rt){if(tt.x||tt.y){this.ec.curve.type==="mont"?$(tt.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&$(tt.x&&tt.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(tt.x,tt.y);return}this.pub=this.ec.curve.decodePoint(tt,rt)},j.prototype.derive=function(tt){return tt.validate()||$(tt.validate(),"public point not validated"),tt.mul(this.priv).getX()},j.prototype.sign=function(tt,rt,nt){return this.ec.sign(tt,this,rt,nt)},j.prototype.verify=function(tt,rt){return this.ec.verify(tt,rt,this)},j.prototype.inspect=function(){return""},key$5}var signature$5,hasRequiredSignature$3;function requireSignature$3(){if(hasRequiredSignature$3)return signature$5;hasRequiredSignature$3=1;var a=requireBn$1(),_=requireUtils$1(),$=_.assert;function j(it,st){if(it instanceof j)return it;this._importDER(it,st)||($(it.r&&it.s,"Signature without r or s"),this.r=new a(it.r,16),this.s=new a(it.s,16),it.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=it.recoveryParam)}signature$5=j;function et(){this.place=0}function tt(it,st){var ot=it[st.place++];if(!(ot&128))return ot;var at=ot&15;if(at===0||at>4)return!1;for(var ut=0,ht=0,yt=st.place;ht>>=0;return ut<=127?!1:(st.place=yt,ut)}function rt(it){for(var st=0,ot=it.length-1;!it[st]&&!(it[st+1]&128)&&st>>3);for(it.push(ot|128);--ot;)it.push(st>>>(ot<<3)&255);it.push(st)}return j.prototype.toDER=function(st){var ot=this.r.toArray(),at=this.s.toArray();for(ot[0]&128&&(ot=[0].concat(ot)),at[0]&128&&(at=[0].concat(at)),ot=rt(ot),at=rt(at);!at[0]&&!(at[1]&128);)at=at.slice(1);var ut=[2];nt(ut,ot.length),ut=ut.concat(ot),ut.push(2),nt(ut,at.length);var ht=ut.concat(at),yt=[48];return nt(yt,ht.length),yt=yt.concat(ht),_.encode(yt,st)},signature$5}var ec$5,hasRequiredEc$1;function requireEc$1(){if(hasRequiredEc$1)return ec$5;hasRequiredEc$1=1;var a=requireBn$1(),_=hmacDrbg,$=requireUtils$1(),j=requireCurves$1(),et=requireBrorand(),tt=$.assert,rt=requireKey$3(),nt=requireSignature$3();function it(st){if(!(this instanceof it))return new it(st);typeof st=="string"&&(tt(Object.prototype.hasOwnProperty.call(j,st),"Unknown curve "+st),st=j[st]),st instanceof j.PresetCurve&&(st={curve:st}),this.curve=st.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=st.curve.g,this.g.precompute(st.curve.n.bitLength()+1),this.hash=st.hash||st.curve.hash}return ec$5=it,it.prototype.keyPair=function(ot){return new rt(this,ot)},it.prototype.keyFromPrivate=function(ot,at){return rt.fromPrivate(this,ot,at)},it.prototype.keyFromPublic=function(ot,at){return rt.fromPublic(this,ot,at)},it.prototype.genKeyPair=function(ot){ot||(ot={});for(var at=new _({hash:this.hash,pers:ot.pers,persEnc:ot.persEnc||"utf8",entropy:ot.entropy||et(this.hash.hmacStrength),entropyEnc:ot.entropy&&ot.entropyEnc||"utf8",nonce:this.n.toArray()}),ut=this.n.byteLength(),ht=this.n.sub(new a(2));;){var yt=new a(at.generate(ut));if(!(yt.cmp(ht)>0))return yt.iaddn(1),this.keyFromPrivate(yt)}},it.prototype._truncateToN=function(ot,at){var ut=ot.byteLength()*8-this.n.bitLength();return ut>0&&(ot=ot.ushrn(ut)),!at&&ot.cmp(this.n)>=0?ot.sub(this.n):ot},it.prototype.sign=function(ot,at,ut,ht){typeof ut=="object"&&(ht=ut,ut=null),ht||(ht={}),at=this.keyFromPrivate(at,ut),ot=this._truncateToN(new a(ot,16));for(var yt=this.n.byteLength(),wt=at.getPrivate().toArray("be",yt),Ct=ot.toArray("be",yt),Pt=new _({hash:this.hash,entropy:wt,nonce:Ct,pers:ht.pers,persEnc:ht.persEnc||"utf8"}),$t=this.n.sub(new a(1)),Mt=0;;Mt++){var Bt=ht.k?ht.k(Mt):new a(Pt.generate(this.n.byteLength()));if(Bt=this._truncateToN(Bt,!0),!(Bt.cmpn(1)<=0||Bt.cmp($t)>=0)){var Dt=this.g.mul(Bt);if(!Dt.isInfinity()){var zt=Dt.getX(),Ot=zt.umod(this.n);if(Ot.cmpn(0)!==0){var It=Bt.invm(this.n).mul(Ot.mul(at.getPrivate()).iadd(ot));if(It=It.umod(this.n),It.cmpn(0)!==0){var Lt=(Dt.getY().isOdd()?1:0)|(zt.cmp(Ot)!==0?2:0);return ht.canonical&&It.cmp(this.nh)>0&&(It=this.n.sub(It),Lt^=1),new nt({r:Ot,s:It,recoveryParam:Lt})}}}}}},it.prototype.verify=function(ot,at,ut,ht){ot=this._truncateToN(new a(ot,16)),ut=this.keyFromPublic(ut,ht),at=new nt(at,"hex");var yt=at.r,wt=at.s;if(yt.cmpn(1)<0||yt.cmp(this.n)>=0||wt.cmpn(1)<0||wt.cmp(this.n)>=0)return!1;var Ct=wt.invm(this.n),Pt=Ct.mul(ot).umod(this.n),$t=Ct.mul(yt).umod(this.n),Mt;return this.curve._maxwellTrick?(Mt=this.g.jmulAdd(Pt,ut.getPublic(),$t),Mt.isInfinity()?!1:Mt.eqXToP(yt)):(Mt=this.g.mulAdd(Pt,ut.getPublic(),$t),Mt.isInfinity()?!1:Mt.getX().umod(this.n).cmp(yt)===0)},it.prototype.recoverPubKey=function(st,ot,at,ut){tt((3&at)===at,"The recovery param is more than two bits"),ot=new nt(ot,ut);var ht=this.n,yt=new a(st),wt=ot.r,Ct=ot.s,Pt=at&1,$t=at>>1;if(wt.cmp(this.curve.p.umod(this.curve.n))>=0&&$t)throw new Error("Unable to find sencond key candinate");$t?wt=this.curve.pointFromX(wt.add(this.curve.n),Pt):wt=this.curve.pointFromX(wt,Pt);var Mt=ot.r.invm(ht),Bt=ht.sub(yt).mul(Mt).umod(ht),Dt=Ct.mul(Mt).umod(ht);return this.g.mulAdd(Bt,wt,Dt)},it.prototype.getKeyRecoveryParam=function(st,ot,at,ut){if(ot=new nt(ot,ut),ot.recoveryParam!==null)return ot.recoveryParam;for(var ht=0;ht<4;ht++){var yt;try{yt=this.recoverPubKey(st,ot,ht)}catch{continue}if(yt.eq(at))return ht}throw new Error("Unable to find valid recovery factor")},ec$5}var key$4,hasRequiredKey$2;function requireKey$2(){if(hasRequiredKey$2)return key$4;hasRequiredKey$2=1;var a=requireUtils$1(),_=a.assert,$=a.parseBytes,j=a.cachedProperty;function et(tt,rt){this.eddsa=tt,this._secret=$(rt.secret),tt.isPoint(rt.pub)?this._pub=rt.pub:this._pubBytes=$(rt.pub)}return et.fromPublic=function(rt,nt){return nt instanceof et?nt:new et(rt,{pub:nt})},et.fromSecret=function(rt,nt){return nt instanceof et?nt:new et(rt,{secret:nt})},et.prototype.secret=function(){return this._secret},j(et,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),j(et,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),j(et,"privBytes",function(){var rt=this.eddsa,nt=this.hash(),it=rt.encodingLength-1,st=nt.slice(0,rt.encodingLength);return st[0]&=248,st[it]&=127,st[it]|=64,st}),j(et,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),j(et,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),j(et,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),et.prototype.sign=function(rt){return _(this._secret,"KeyPair can only verify"),this.eddsa.sign(rt,this)},et.prototype.verify=function(rt,nt){return this.eddsa.verify(rt,nt,this)},et.prototype.getSecret=function(rt){return _(this._secret,"KeyPair is public only"),a.encode(this.secret(),rt)},et.prototype.getPublic=function(rt){return a.encode(this.pubBytes(),rt)},key$4=et,key$4}var signature$4,hasRequiredSignature$2;function requireSignature$2(){if(hasRequiredSignature$2)return signature$4;hasRequiredSignature$2=1;var a=requireBn$1(),_=requireUtils$1(),$=_.assert,j=_.cachedProperty,et=_.parseBytes;function tt(rt,nt){this.eddsa=rt,typeof nt!="object"&&(nt=et(nt)),Array.isArray(nt)&&(nt={R:nt.slice(0,rt.encodingLength),S:nt.slice(rt.encodingLength)}),$(nt.R&&nt.S,"Signature without R or S"),rt.isPoint(nt.R)&&(this._R=nt.R),nt.S instanceof a&&(this._S=nt.S),this._Rencoded=Array.isArray(nt.R)?nt.R:nt.Rencoded,this._Sencoded=Array.isArray(nt.S)?nt.S:nt.Sencoded}return j(tt,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),j(tt,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),j(tt,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),j(tt,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),tt.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},tt.prototype.toHex=function(){return _.encode(this.toBytes(),"hex").toUpperCase()},signature$4=tt,signature$4}var eddsa$2,hasRequiredEddsa$1;function requireEddsa$1(){if(hasRequiredEddsa$1)return eddsa$2;hasRequiredEddsa$1=1;var a=hash$4,_=requireCurves$1(),$=requireUtils$1(),j=$.assert,et=$.parseBytes,tt=requireKey$2(),rt=requireSignature$2();function nt(it){if(j(it==="ed25519","only tested with ed25519 so far"),!(this instanceof nt))return new nt(it);it=_[it].curve,this.curve=it,this.g=it.g,this.g.precompute(it.n.bitLength()+1),this.pointClass=it.point().constructor,this.encodingLength=Math.ceil(it.n.bitLength()/8),this.hash=a.sha512}return eddsa$2=nt,nt.prototype.sign=function(st,ot){st=et(st);var at=this.keyFromSecret(ot),ut=this.hashInt(at.messagePrefix(),st),ht=this.g.mul(ut),yt=this.encodePoint(ht),wt=this.hashInt(yt,at.pubBytes(),st).mul(at.priv()),Ct=ut.add(wt).umod(this.curve.n);return this.makeSignature({R:ht,S:Ct,Rencoded:yt})},nt.prototype.verify=function(st,ot,at){st=et(st),ot=this.makeSignature(ot);var ut=this.keyFromPublic(at),ht=this.hashInt(ot.Rencoded(),ut.pubBytes(),st),yt=this.g.mul(ot.S()),wt=ot.R().add(ut.pub().mul(ht));return wt.eq(yt)},nt.prototype.hashInt=function(){for(var st=this.hash(),ot=0;ot0?ct:dt},tt.min=function(ct,dt){return ct.cmp(dt)<0?ct:dt},tt.prototype._init=function(ct,dt,mt){if(typeof ct=="number")return this._initNumber(ct,dt,mt);if(typeof ct=="object")return this._initArray(ct,dt,mt);dt==="hex"&&(dt=16),j(dt===(dt|0)&&dt>=2&&dt<=36),ct=ct.toString().replace(/\s+/g,"");var xt=0;ct[0]==="-"&&(xt++,this.negative=1),xt=0;xt-=3)Rt=ct[xt]|ct[xt-1]<<8|ct[xt-2]<<16,this.words[At]|=Rt<>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);else if(mt==="le")for(xt=0,At=0;xt>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);return this._strip()};function nt(vt,ct){var dt=vt.charCodeAt(ct);if(dt>=48&&dt<=57)return dt-48;if(dt>=65&&dt<=70)return dt-55;if(dt>=97&&dt<=102)return dt-87;j(!1,"Invalid character in "+vt)}function it(vt,ct,dt){var mt=nt(vt,dt);return dt-1>=ct&&(mt|=nt(vt,dt-1)<<4),mt}tt.prototype._parseHex=function(ct,dt,mt){this.length=Math.ceil((ct.length-dt)/6),this.words=new Array(this.length);for(var xt=0;xt=dt;xt-=2)St=it(ct,dt,xt)<=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8;else{var Tt=ct.length-dt;for(xt=Tt%2===0?dt+1:dt;xt=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8}this._strip()};function st(vt,ct,dt,mt){for(var xt=0,At=0,Rt=Math.min(vt.length,dt),St=ct;St=49?At=Tt-49+10:Tt>=17?At=Tt-17+10:At=Tt,j(Tt>=0&&At1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=at}catch{tt.prototype.inspect=at}else tt.prototype.inspect=at;function at(){return(this.red?""}var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],yt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(ct,dt){ct=ct||10,dt=dt|0||1;var mt;if(ct===16||ct==="hex"){mt="";for(var xt=0,At=0,Rt=0;Rt>>24-xt&16777215,xt+=2,xt>=26&&(xt-=26,Rt--),At!==0||Rt!==this.length-1?mt=ut[6-Tt.length]+Tt+mt:mt=Tt+mt}for(At!==0&&(mt=At.toString(16)+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}if(ct===(ct|0)&&ct>=2&&ct<=36){var Et=ht[ct],Nt=yt[ct];mt="";var tr=this.clone();for(tr.negative=0;!tr.isZero();){var ir=tr.modrn(Nt).toString(ct);tr=tr.idivn(Nt),tr.isZero()?mt=ir+mt:mt=ut[Et-ir.length]+ir+mt}for(this.isZero()&&(mt="0"+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var ct=this.words[0];return this.length===2?ct+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ct+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ct:ct},tt.prototype.toJSON=function(){return this.toString(16,2)},rt&&(tt.prototype.toBuffer=function(ct,dt){return this.toArrayLike(rt,ct,dt)}),tt.prototype.toArray=function(ct,dt){return this.toArrayLike(Array,ct,dt)};var wt=function(ct,dt){return ct.allocUnsafe?ct.allocUnsafe(dt):new ct(dt)};tt.prototype.toArrayLike=function(ct,dt,mt){this._strip();var xt=this.byteLength(),At=mt||Math.max(1,xt);j(xt<=At,"byte array longer than desired length"),j(At>0,"Requested array length <= 0");var Rt=wt(ct,At),St=dt==="le"?"LE":"BE";return this["_toArrayLike"+St](Rt,xt),Rt},tt.prototype._toArrayLikeLE=function(ct,dt){for(var mt=0,xt=0,At=0,Rt=0;At>8&255),mt>16&255),Rt===6?(mt>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt=0&&(ct[mt--]=St>>8&255),mt>=0&&(ct[mt--]=St>>16&255),Rt===6?(mt>=0&&(ct[mt--]=St>>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt>=0)for(ct[mt--]=xt;mt>=0;)ct[mt--]=0},Math.clz32?tt.prototype._countBits=function(ct){return 32-Math.clz32(ct)}:tt.prototype._countBits=function(ct){var dt=ct,mt=0;return dt>=4096&&(mt+=13,dt>>>=13),dt>=64&&(mt+=7,dt>>>=7),dt>=8&&(mt+=4,dt>>>=4),dt>=2&&(mt+=2,dt>>>=2),mt+dt},tt.prototype._zeroBits=function(ct){if(ct===0)return 26;var dt=ct,mt=0;return dt&8191||(mt+=13,dt>>>=13),dt&127||(mt+=7,dt>>>=7),dt&15||(mt+=4,dt>>>=4),dt&3||(mt+=2,dt>>>=2),dt&1||mt++,mt},tt.prototype.bitLength=function(){var ct=this.words[this.length-1],dt=this._countBits(ct);return(this.length-1)*26+dt};function Ct(vt){for(var ct=new Array(vt.bitLength()),dt=0;dt>>xt&1}return ct}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ct=0,dt=0;dtct.length?this.clone().ior(ct):ct.clone().ior(this)},tt.prototype.uor=function(ct){return this.length>ct.length?this.clone().iuor(ct):ct.clone().iuor(this)},tt.prototype.iuand=function(ct){var dt;this.length>ct.length?dt=ct:dt=this;for(var mt=0;mtct.length?this.clone().iand(ct):ct.clone().iand(this)},tt.prototype.uand=function(ct){return this.length>ct.length?this.clone().iuand(ct):ct.clone().iuand(this)},tt.prototype.iuxor=function(ct){var dt,mt;this.length>ct.length?(dt=this,mt=ct):(dt=ct,mt=this);for(var xt=0;xtct.length?this.clone().ixor(ct):ct.clone().ixor(this)},tt.prototype.uxor=function(ct){return this.length>ct.length?this.clone().iuxor(ct):ct.clone().iuxor(this)},tt.prototype.inotn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=Math.ceil(ct/26)|0,mt=ct%26;this._expand(dt),mt>0&&dt--;for(var xt=0;xt0&&(this.words[xt]=~this.words[xt]&67108863>>26-mt),this._strip()},tt.prototype.notn=function(ct){return this.clone().inotn(ct)},tt.prototype.setn=function(ct,dt){j(typeof ct=="number"&&ct>=0);var mt=ct/26|0,xt=ct%26;return this._expand(mt+1),dt?this.words[mt]=this.words[mt]|1<ct.length?(mt=this,xt=ct):(mt=ct,xt=this);for(var At=0,Rt=0;Rt>>26;for(;At!==0&&Rt>>26;if(this.length=mt.length,At!==0)this.words[this.length]=At,this.length++;else if(mt!==this)for(;Rtct.length?this.clone().iadd(ct):ct.clone().iadd(this)},tt.prototype.isub=function(ct){if(ct.negative!==0){ct.negative=0;var dt=this.iadd(ct);return ct.negative=1,dt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ct),this.negative=1,this._normSign();var mt=this.cmp(ct);if(mt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var xt,At;mt>0?(xt=this,At=ct):(xt=ct,At=this);for(var Rt=0,St=0;St>26,this.words[St]=dt&67108863;for(;Rt!==0&&St>26,this.words[St]=dt&67108863;if(Rt===0&&St>>26,tr=Tt&67108863,ir=Math.min(Et,ct.length-1),nr=Math.max(0,Et-vt.length+1);nr<=ir;nr++){var Zt=Et-nr|0;xt=vt.words[Zt]|0,At=ct.words[nr]|0,Rt=xt*At+tr,Nt+=Rt/67108864|0,tr=Rt&67108863}dt.words[Et]=tr|0,Tt=Nt|0}return Tt!==0?dt.words[Et]=Tt|0:dt.length--,dt._strip()}var $t=function(ct,dt,mt){var xt=ct.words,At=dt.words,Rt=mt.words,St=0,Tt,Et,Nt,tr=xt[0]|0,ir=tr&8191,nr=tr>>>13,Zt=xt[1]|0,Kt=Zt&8191,Qt=Zt>>>13,Ht=xt[2]|0,qt=Ht&8191,Jt=Ht>>>13,ur=xt[3]|0,xr=ur&8191,pr=ur>>>13,Cr=xt[4]|0,Mr=Cr&8191,lr=Cr>>>13,fr=xt[5]|0,_r=fr&8191,Sr=fr>>>13,kr=xt[6]|0,Ar=kr&8191,$r=kr>>>13,Or=xt[7]|0,Br=Or&8191,or=Or>>>13,Yt=xt[8]|0,er=Yt&8191,Gt=Yt>>>13,Vt=xt[9]|0,Wt=Vt&8191,ar=Vt>>>13,yr=At[0]|0,Er=yr&8191,Rr=yr>>>13,Wr=At[1]|0,Hr=Wr&8191,Fr=Wr>>>13,pn=At[2]|0,Jr=pn&8191,Qr=pn>>>13,mn=At[3]|0,ln=mn&8191,qr=mn>>>13,En=At[4]|0,un=En&8191,Vr=En>>>13,hn=At[5]|0,fn=hn&8191,Kr=hn>>>13,Rn=At[6]|0,dn=Rn&8191,Gr=Rn>>>13,gn=At[7]|0,an=gn&8191,Zr=gn>>>13,An=At[8]|0,Sn=An&8191,nn=An>>>13,Pn=At[9]|0,yn=Pn&8191,_n=Pn>>>13;mt.negative=ct.negative^dt.negative,mt.length=19,Tt=Math.imul(ir,Er),Et=Math.imul(ir,Rr),Et=Et+Math.imul(nr,Er)|0,Nt=Math.imul(nr,Rr);var ds=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ds>>>26)|0,ds&=67108863,Tt=Math.imul(Kt,Er),Et=Math.imul(Kt,Rr),Et=Et+Math.imul(Qt,Er)|0,Nt=Math.imul(Qt,Rr),Tt=Tt+Math.imul(ir,Hr)|0,Et=Et+Math.imul(ir,Fr)|0,Et=Et+Math.imul(nr,Hr)|0,Nt=Nt+Math.imul(nr,Fr)|0;var fs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(fs>>>26)|0,fs&=67108863,Tt=Math.imul(qt,Er),Et=Math.imul(qt,Rr),Et=Et+Math.imul(Jt,Er)|0,Nt=Math.imul(Jt,Rr),Tt=Tt+Math.imul(Kt,Hr)|0,Et=Et+Math.imul(Kt,Fr)|0,Et=Et+Math.imul(Qt,Hr)|0,Nt=Nt+Math.imul(Qt,Fr)|0,Tt=Tt+Math.imul(ir,Jr)|0,Et=Et+Math.imul(ir,Qr)|0,Et=Et+Math.imul(nr,Jr)|0,Nt=Nt+Math.imul(nr,Qr)|0;var hs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(hs>>>26)|0,hs&=67108863,Tt=Math.imul(xr,Er),Et=Math.imul(xr,Rr),Et=Et+Math.imul(pr,Er)|0,Nt=Math.imul(pr,Rr),Tt=Tt+Math.imul(qt,Hr)|0,Et=Et+Math.imul(qt,Fr)|0,Et=Et+Math.imul(Jt,Hr)|0,Nt=Nt+Math.imul(Jt,Fr)|0,Tt=Tt+Math.imul(Kt,Jr)|0,Et=Et+Math.imul(Kt,Qr)|0,Et=Et+Math.imul(Qt,Jr)|0,Nt=Nt+Math.imul(Qt,Qr)|0,Tt=Tt+Math.imul(ir,ln)|0,Et=Et+Math.imul(ir,qr)|0,Et=Et+Math.imul(nr,ln)|0,Nt=Nt+Math.imul(nr,qr)|0;var ps=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ps>>>26)|0,ps&=67108863,Tt=Math.imul(Mr,Er),Et=Math.imul(Mr,Rr),Et=Et+Math.imul(lr,Er)|0,Nt=Math.imul(lr,Rr),Tt=Tt+Math.imul(xr,Hr)|0,Et=Et+Math.imul(xr,Fr)|0,Et=Et+Math.imul(pr,Hr)|0,Nt=Nt+Math.imul(pr,Fr)|0,Tt=Tt+Math.imul(qt,Jr)|0,Et=Et+Math.imul(qt,Qr)|0,Et=Et+Math.imul(Jt,Jr)|0,Nt=Nt+Math.imul(Jt,Qr)|0,Tt=Tt+Math.imul(Kt,ln)|0,Et=Et+Math.imul(Kt,qr)|0,Et=Et+Math.imul(Qt,ln)|0,Nt=Nt+Math.imul(Qt,qr)|0,Tt=Tt+Math.imul(ir,un)|0,Et=Et+Math.imul(ir,Vr)|0,Et=Et+Math.imul(nr,un)|0,Nt=Nt+Math.imul(nr,Vr)|0;var Vn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Tt=Math.imul(_r,Er),Et=Math.imul(_r,Rr),Et=Et+Math.imul(Sr,Er)|0,Nt=Math.imul(Sr,Rr),Tt=Tt+Math.imul(Mr,Hr)|0,Et=Et+Math.imul(Mr,Fr)|0,Et=Et+Math.imul(lr,Hr)|0,Nt=Nt+Math.imul(lr,Fr)|0,Tt=Tt+Math.imul(xr,Jr)|0,Et=Et+Math.imul(xr,Qr)|0,Et=Et+Math.imul(pr,Jr)|0,Nt=Nt+Math.imul(pr,Qr)|0,Tt=Tt+Math.imul(qt,ln)|0,Et=Et+Math.imul(qt,qr)|0,Et=Et+Math.imul(Jt,ln)|0,Nt=Nt+Math.imul(Jt,qr)|0,Tt=Tt+Math.imul(Kt,un)|0,Et=Et+Math.imul(Kt,Vr)|0,Et=Et+Math.imul(Qt,un)|0,Nt=Nt+Math.imul(Qt,Vr)|0,Tt=Tt+Math.imul(ir,fn)|0,Et=Et+Math.imul(ir,Kr)|0,Et=Et+Math.imul(nr,fn)|0,Nt=Nt+Math.imul(nr,Kr)|0;var ss=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ss>>>26)|0,ss&=67108863,Tt=Math.imul(Ar,Er),Et=Math.imul(Ar,Rr),Et=Et+Math.imul($r,Er)|0,Nt=Math.imul($r,Rr),Tt=Tt+Math.imul(_r,Hr)|0,Et=Et+Math.imul(_r,Fr)|0,Et=Et+Math.imul(Sr,Hr)|0,Nt=Nt+Math.imul(Sr,Fr)|0,Tt=Tt+Math.imul(Mr,Jr)|0,Et=Et+Math.imul(Mr,Qr)|0,Et=Et+Math.imul(lr,Jr)|0,Nt=Nt+Math.imul(lr,Qr)|0,Tt=Tt+Math.imul(xr,ln)|0,Et=Et+Math.imul(xr,qr)|0,Et=Et+Math.imul(pr,ln)|0,Nt=Nt+Math.imul(pr,qr)|0,Tt=Tt+Math.imul(qt,un)|0,Et=Et+Math.imul(qt,Vr)|0,Et=Et+Math.imul(Jt,un)|0,Nt=Nt+Math.imul(Jt,Vr)|0,Tt=Tt+Math.imul(Kt,fn)|0,Et=Et+Math.imul(Kt,Kr)|0,Et=Et+Math.imul(Qt,fn)|0,Nt=Nt+Math.imul(Qt,Kr)|0,Tt=Tt+Math.imul(ir,dn)|0,Et=Et+Math.imul(ir,Gr)|0,Et=Et+Math.imul(nr,dn)|0,Nt=Nt+Math.imul(nr,Gr)|0;var Jn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Tt=Math.imul(Br,Er),Et=Math.imul(Br,Rr),Et=Et+Math.imul(or,Er)|0,Nt=Math.imul(or,Rr),Tt=Tt+Math.imul(Ar,Hr)|0,Et=Et+Math.imul(Ar,Fr)|0,Et=Et+Math.imul($r,Hr)|0,Nt=Nt+Math.imul($r,Fr)|0,Tt=Tt+Math.imul(_r,Jr)|0,Et=Et+Math.imul(_r,Qr)|0,Et=Et+Math.imul(Sr,Jr)|0,Nt=Nt+Math.imul(Sr,Qr)|0,Tt=Tt+Math.imul(Mr,ln)|0,Et=Et+Math.imul(Mr,qr)|0,Et=Et+Math.imul(lr,ln)|0,Nt=Nt+Math.imul(lr,qr)|0,Tt=Tt+Math.imul(xr,un)|0,Et=Et+Math.imul(xr,Vr)|0,Et=Et+Math.imul(pr,un)|0,Nt=Nt+Math.imul(pr,Vr)|0,Tt=Tt+Math.imul(qt,fn)|0,Et=Et+Math.imul(qt,Kr)|0,Et=Et+Math.imul(Jt,fn)|0,Nt=Nt+Math.imul(Jt,Kr)|0,Tt=Tt+Math.imul(Kt,dn)|0,Et=Et+Math.imul(Kt,Gr)|0,Et=Et+Math.imul(Qt,dn)|0,Nt=Nt+Math.imul(Qt,Gr)|0,Tt=Tt+Math.imul(ir,an)|0,Et=Et+Math.imul(ir,Zr)|0,Et=Et+Math.imul(nr,an)|0,Nt=Nt+Math.imul(nr,Zr)|0;var Yn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Tt=Math.imul(er,Er),Et=Math.imul(er,Rr),Et=Et+Math.imul(Gt,Er)|0,Nt=Math.imul(Gt,Rr),Tt=Tt+Math.imul(Br,Hr)|0,Et=Et+Math.imul(Br,Fr)|0,Et=Et+Math.imul(or,Hr)|0,Nt=Nt+Math.imul(or,Fr)|0,Tt=Tt+Math.imul(Ar,Jr)|0,Et=Et+Math.imul(Ar,Qr)|0,Et=Et+Math.imul($r,Jr)|0,Nt=Nt+Math.imul($r,Qr)|0,Tt=Tt+Math.imul(_r,ln)|0,Et=Et+Math.imul(_r,qr)|0,Et=Et+Math.imul(Sr,ln)|0,Nt=Nt+Math.imul(Sr,qr)|0,Tt=Tt+Math.imul(Mr,un)|0,Et=Et+Math.imul(Mr,Vr)|0,Et=Et+Math.imul(lr,un)|0,Nt=Nt+Math.imul(lr,Vr)|0,Tt=Tt+Math.imul(xr,fn)|0,Et=Et+Math.imul(xr,Kr)|0,Et=Et+Math.imul(pr,fn)|0,Nt=Nt+Math.imul(pr,Kr)|0,Tt=Tt+Math.imul(qt,dn)|0,Et=Et+Math.imul(qt,Gr)|0,Et=Et+Math.imul(Jt,dn)|0,Nt=Nt+Math.imul(Jt,Gr)|0,Tt=Tt+Math.imul(Kt,an)|0,Et=Et+Math.imul(Kt,Zr)|0,Et=Et+Math.imul(Qt,an)|0,Nt=Nt+Math.imul(Qt,Zr)|0,Tt=Tt+Math.imul(ir,Sn)|0,Et=Et+Math.imul(ir,nn)|0,Et=Et+Math.imul(nr,Sn)|0,Nt=Nt+Math.imul(nr,nn)|0;var ms=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ms>>>26)|0,ms&=67108863,Tt=Math.imul(Wt,Er),Et=Math.imul(Wt,Rr),Et=Et+Math.imul(ar,Er)|0,Nt=Math.imul(ar,Rr),Tt=Tt+Math.imul(er,Hr)|0,Et=Et+Math.imul(er,Fr)|0,Et=Et+Math.imul(Gt,Hr)|0,Nt=Nt+Math.imul(Gt,Fr)|0,Tt=Tt+Math.imul(Br,Jr)|0,Et=Et+Math.imul(Br,Qr)|0,Et=Et+Math.imul(or,Jr)|0,Nt=Nt+Math.imul(or,Qr)|0,Tt=Tt+Math.imul(Ar,ln)|0,Et=Et+Math.imul(Ar,qr)|0,Et=Et+Math.imul($r,ln)|0,Nt=Nt+Math.imul($r,qr)|0,Tt=Tt+Math.imul(_r,un)|0,Et=Et+Math.imul(_r,Vr)|0,Et=Et+Math.imul(Sr,un)|0,Nt=Nt+Math.imul(Sr,Vr)|0,Tt=Tt+Math.imul(Mr,fn)|0,Et=Et+Math.imul(Mr,Kr)|0,Et=Et+Math.imul(lr,fn)|0,Nt=Nt+Math.imul(lr,Kr)|0,Tt=Tt+Math.imul(xr,dn)|0,Et=Et+Math.imul(xr,Gr)|0,Et=Et+Math.imul(pr,dn)|0,Nt=Nt+Math.imul(pr,Gr)|0,Tt=Tt+Math.imul(qt,an)|0,Et=Et+Math.imul(qt,Zr)|0,Et=Et+Math.imul(Jt,an)|0,Nt=Nt+Math.imul(Jt,Zr)|0,Tt=Tt+Math.imul(Kt,Sn)|0,Et=Et+Math.imul(Kt,nn)|0,Et=Et+Math.imul(Qt,Sn)|0,Nt=Nt+Math.imul(Qt,nn)|0,Tt=Tt+Math.imul(ir,yn)|0,Et=Et+Math.imul(ir,_n)|0,Et=Et+Math.imul(nr,yn)|0,Nt=Nt+Math.imul(nr,_n)|0;var Qn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Tt=Math.imul(Wt,Hr),Et=Math.imul(Wt,Fr),Et=Et+Math.imul(ar,Hr)|0,Nt=Math.imul(ar,Fr),Tt=Tt+Math.imul(er,Jr)|0,Et=Et+Math.imul(er,Qr)|0,Et=Et+Math.imul(Gt,Jr)|0,Nt=Nt+Math.imul(Gt,Qr)|0,Tt=Tt+Math.imul(Br,ln)|0,Et=Et+Math.imul(Br,qr)|0,Et=Et+Math.imul(or,ln)|0,Nt=Nt+Math.imul(or,qr)|0,Tt=Tt+Math.imul(Ar,un)|0,Et=Et+Math.imul(Ar,Vr)|0,Et=Et+Math.imul($r,un)|0,Nt=Nt+Math.imul($r,Vr)|0,Tt=Tt+Math.imul(_r,fn)|0,Et=Et+Math.imul(_r,Kr)|0,Et=Et+Math.imul(Sr,fn)|0,Nt=Nt+Math.imul(Sr,Kr)|0,Tt=Tt+Math.imul(Mr,dn)|0,Et=Et+Math.imul(Mr,Gr)|0,Et=Et+Math.imul(lr,dn)|0,Nt=Nt+Math.imul(lr,Gr)|0,Tt=Tt+Math.imul(xr,an)|0,Et=Et+Math.imul(xr,Zr)|0,Et=Et+Math.imul(pr,an)|0,Nt=Nt+Math.imul(pr,Zr)|0,Tt=Tt+Math.imul(qt,Sn)|0,Et=Et+Math.imul(qt,nn)|0,Et=Et+Math.imul(Jt,Sn)|0,Nt=Nt+Math.imul(Jt,nn)|0,Tt=Tt+Math.imul(Kt,yn)|0,Et=Et+Math.imul(Kt,_n)|0,Et=Et+Math.imul(Qt,yn)|0,Nt=Nt+Math.imul(Qt,_n)|0;var es=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(es>>>26)|0,es&=67108863,Tt=Math.imul(Wt,Jr),Et=Math.imul(Wt,Qr),Et=Et+Math.imul(ar,Jr)|0,Nt=Math.imul(ar,Qr),Tt=Tt+Math.imul(er,ln)|0,Et=Et+Math.imul(er,qr)|0,Et=Et+Math.imul(Gt,ln)|0,Nt=Nt+Math.imul(Gt,qr)|0,Tt=Tt+Math.imul(Br,un)|0,Et=Et+Math.imul(Br,Vr)|0,Et=Et+Math.imul(or,un)|0,Nt=Nt+Math.imul(or,Vr)|0,Tt=Tt+Math.imul(Ar,fn)|0,Et=Et+Math.imul(Ar,Kr)|0,Et=Et+Math.imul($r,fn)|0,Nt=Nt+Math.imul($r,Kr)|0,Tt=Tt+Math.imul(_r,dn)|0,Et=Et+Math.imul(_r,Gr)|0,Et=Et+Math.imul(Sr,dn)|0,Nt=Nt+Math.imul(Sr,Gr)|0,Tt=Tt+Math.imul(Mr,an)|0,Et=Et+Math.imul(Mr,Zr)|0,Et=Et+Math.imul(lr,an)|0,Nt=Nt+Math.imul(lr,Zr)|0,Tt=Tt+Math.imul(xr,Sn)|0,Et=Et+Math.imul(xr,nn)|0,Et=Et+Math.imul(pr,Sn)|0,Nt=Nt+Math.imul(pr,nn)|0,Tt=Tt+Math.imul(qt,yn)|0,Et=Et+Math.imul(qt,_n)|0,Et=Et+Math.imul(Jt,yn)|0,Nt=Nt+Math.imul(Jt,_n)|0;var ls=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ls>>>26)|0,ls&=67108863,Tt=Math.imul(Wt,ln),Et=Math.imul(Wt,qr),Et=Et+Math.imul(ar,ln)|0,Nt=Math.imul(ar,qr),Tt=Tt+Math.imul(er,un)|0,Et=Et+Math.imul(er,Vr)|0,Et=Et+Math.imul(Gt,un)|0,Nt=Nt+Math.imul(Gt,Vr)|0,Tt=Tt+Math.imul(Br,fn)|0,Et=Et+Math.imul(Br,Kr)|0,Et=Et+Math.imul(or,fn)|0,Nt=Nt+Math.imul(or,Kr)|0,Tt=Tt+Math.imul(Ar,dn)|0,Et=Et+Math.imul(Ar,Gr)|0,Et=Et+Math.imul($r,dn)|0,Nt=Nt+Math.imul($r,Gr)|0,Tt=Tt+Math.imul(_r,an)|0,Et=Et+Math.imul(_r,Zr)|0,Et=Et+Math.imul(Sr,an)|0,Nt=Nt+Math.imul(Sr,Zr)|0,Tt=Tt+Math.imul(Mr,Sn)|0,Et=Et+Math.imul(Mr,nn)|0,Et=Et+Math.imul(lr,Sn)|0,Nt=Nt+Math.imul(lr,nn)|0,Tt=Tt+Math.imul(xr,yn)|0,Et=Et+Math.imul(xr,_n)|0,Et=Et+Math.imul(pr,yn)|0,Nt=Nt+Math.imul(pr,_n)|0;var us=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(us>>>26)|0,us&=67108863,Tt=Math.imul(Wt,un),Et=Math.imul(Wt,Vr),Et=Et+Math.imul(ar,un)|0,Nt=Math.imul(ar,Vr),Tt=Tt+Math.imul(er,fn)|0,Et=Et+Math.imul(er,Kr)|0,Et=Et+Math.imul(Gt,fn)|0,Nt=Nt+Math.imul(Gt,Kr)|0,Tt=Tt+Math.imul(Br,dn)|0,Et=Et+Math.imul(Br,Gr)|0,Et=Et+Math.imul(or,dn)|0,Nt=Nt+Math.imul(or,Gr)|0,Tt=Tt+Math.imul(Ar,an)|0,Et=Et+Math.imul(Ar,Zr)|0,Et=Et+Math.imul($r,an)|0,Nt=Nt+Math.imul($r,Zr)|0,Tt=Tt+Math.imul(_r,Sn)|0,Et=Et+Math.imul(_r,nn)|0,Et=Et+Math.imul(Sr,Sn)|0,Nt=Nt+Math.imul(Sr,nn)|0,Tt=Tt+Math.imul(Mr,yn)|0,Et=Et+Math.imul(Mr,_n)|0,Et=Et+Math.imul(lr,yn)|0,Nt=Nt+Math.imul(lr,_n)|0;var Wn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Tt=Math.imul(Wt,fn),Et=Math.imul(Wt,Kr),Et=Et+Math.imul(ar,fn)|0,Nt=Math.imul(ar,Kr),Tt=Tt+Math.imul(er,dn)|0,Et=Et+Math.imul(er,Gr)|0,Et=Et+Math.imul(Gt,dn)|0,Nt=Nt+Math.imul(Gt,Gr)|0,Tt=Tt+Math.imul(Br,an)|0,Et=Et+Math.imul(Br,Zr)|0,Et=Et+Math.imul(or,an)|0,Nt=Nt+Math.imul(or,Zr)|0,Tt=Tt+Math.imul(Ar,Sn)|0,Et=Et+Math.imul(Ar,nn)|0,Et=Et+Math.imul($r,Sn)|0,Nt=Nt+Math.imul($r,nn)|0,Tt=Tt+Math.imul(_r,yn)|0,Et=Et+Math.imul(_r,_n)|0,Et=Et+Math.imul(Sr,yn)|0,Nt=Nt+Math.imul(Sr,_n)|0;var as=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(as>>>26)|0,as&=67108863,Tt=Math.imul(Wt,dn),Et=Math.imul(Wt,Gr),Et=Et+Math.imul(ar,dn)|0,Nt=Math.imul(ar,Gr),Tt=Tt+Math.imul(er,an)|0,Et=Et+Math.imul(er,Zr)|0,Et=Et+Math.imul(Gt,an)|0,Nt=Nt+Math.imul(Gt,Zr)|0,Tt=Tt+Math.imul(Br,Sn)|0,Et=Et+Math.imul(Br,nn)|0,Et=Et+Math.imul(or,Sn)|0,Nt=Nt+Math.imul(or,nn)|0,Tt=Tt+Math.imul(Ar,yn)|0,Et=Et+Math.imul(Ar,_n)|0,Et=Et+Math.imul($r,yn)|0,Nt=Nt+Math.imul($r,_n)|0;var gs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(gs>>>26)|0,gs&=67108863,Tt=Math.imul(Wt,an),Et=Math.imul(Wt,Zr),Et=Et+Math.imul(ar,an)|0,Nt=Math.imul(ar,Zr),Tt=Tt+Math.imul(er,Sn)|0,Et=Et+Math.imul(er,nn)|0,Et=Et+Math.imul(Gt,Sn)|0,Nt=Nt+Math.imul(Gt,nn)|0,Tt=Tt+Math.imul(Br,yn)|0,Et=Et+Math.imul(Br,_n)|0,Et=Et+Math.imul(or,yn)|0,Nt=Nt+Math.imul(or,_n)|0;var vs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(vs>>>26)|0,vs&=67108863,Tt=Math.imul(Wt,Sn),Et=Math.imul(Wt,nn),Et=Et+Math.imul(ar,Sn)|0,Nt=Math.imul(ar,nn),Tt=Tt+Math.imul(er,yn)|0,Et=Et+Math.imul(er,_n)|0,Et=Et+Math.imul(Gt,yn)|0,Nt=Nt+Math.imul(Gt,_n)|0;var Ts=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Tt=Math.imul(Wt,yn),Et=Math.imul(Wt,_n),Et=Et+Math.imul(ar,yn)|0,Nt=Math.imul(ar,_n);var $s=(St+Tt|0)+((Et&8191)<<13)|0;return St=(Nt+(Et>>>13)|0)+($s>>>26)|0,$s&=67108863,Rt[0]=ds,Rt[1]=fs,Rt[2]=hs,Rt[3]=ps,Rt[4]=Vn,Rt[5]=ss,Rt[6]=Jn,Rt[7]=Yn,Rt[8]=ms,Rt[9]=Qn,Rt[10]=es,Rt[11]=ls,Rt[12]=us,Rt[13]=Wn,Rt[14]=as,Rt[15]=gs,Rt[16]=vs,Rt[17]=Ts,Rt[18]=$s,St!==0&&(Rt[19]=St,mt.length++),mt};Math.imul||($t=Pt);function Mt(vt,ct,dt){dt.negative=ct.negative^vt.negative,dt.length=vt.length+ct.length;for(var mt=0,xt=0,At=0;At>>26)|0,xt+=Rt>>>26,Rt&=67108863}dt.words[At]=St,mt=Rt,Rt=xt}return mt!==0?dt.words[At]=mt:dt.length--,dt._strip()}function Bt(vt,ct,dt){return Mt(vt,ct,dt)}tt.prototype.mulTo=function(ct,dt){var mt,xt=this.length+ct.length;return this.length===10&&ct.length===10?mt=$t(this,ct,dt):xt<63?mt=Pt(this,ct,dt):xt<1024?mt=Mt(this,ct,dt):mt=Bt(this,ct,dt),mt},tt.prototype.mul=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),this.mulTo(ct,dt)},tt.prototype.mulf=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),Bt(this,ct,dt)},tt.prototype.imul=function(ct){return this.clone().mulTo(ct,this)},tt.prototype.imuln=function(ct){var dt=ct<0;dt&&(ct=-ct),j(typeof ct=="number"),j(ct<67108864);for(var mt=0,xt=0;xt>=26,mt+=At/67108864|0,mt+=Rt>>>26,this.words[xt]=Rt&67108863}return mt!==0&&(this.words[xt]=mt,this.length++),dt?this.ineg():this},tt.prototype.muln=function(ct){return this.clone().imuln(ct)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(ct){var dt=Ct(ct);if(dt.length===0)return new tt(1);for(var mt=this,xt=0;xt=0);var dt=ct%26,mt=(ct-dt)/26,xt=67108863>>>26-dt<<26-dt,At;if(dt!==0){var Rt=0;for(At=0;At>>26-dt}Rt&&(this.words[At]=Rt,this.length++)}if(mt!==0){for(At=this.length-1;At>=0;At--)this.words[At+mt]=this.words[At];for(At=0;At=0);var xt;dt?xt=(dt-dt%26)/26:xt=0;var At=ct%26,Rt=Math.min((ct-At)/26,this.length),St=67108863^67108863>>>At<Rt)for(this.length-=Rt,Et=0;Et=0&&(Nt!==0||Et>=xt);Et--){var tr=this.words[Et]|0;this.words[Et]=Nt<<26-At|tr>>>At,Nt=tr&St}return Tt&&Nt!==0&&(Tt.words[Tt.length++]=Nt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},tt.prototype.ishrn=function(ct,dt,mt){return j(this.negative===0),this.iushrn(ct,dt,mt)},tt.prototype.shln=function(ct){return this.clone().ishln(ct)},tt.prototype.ushln=function(ct){return this.clone().iushln(ct)},tt.prototype.shrn=function(ct){return this.clone().ishrn(ct)},tt.prototype.ushrn=function(ct){return this.clone().iushrn(ct)},tt.prototype.testn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=ct%26,mt=(ct-dt)/26,xt=1<=0);var dt=ct%26,mt=(ct-dt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=mt)return this;if(dt!==0&&mt++,this.length=Math.min(mt,this.length),dt!==0){var xt=67108863^67108863>>>dt<=67108864;dt++)this.words[dt]-=67108864,dt===this.length-1?this.words[dt+1]=1:this.words[dt+1]++;return this.length=Math.max(this.length,dt+1),this},tt.prototype.isubn=function(ct){if(j(typeof ct=="number"),j(ct<67108864),ct<0)return this.iaddn(-ct);if(this.negative!==0)return this.negative=0,this.iaddn(ct),this.negative=1,this;if(this.words[0]-=ct,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var dt=0;dt>26)-(Tt/67108864|0),this.words[At+mt]=Rt&67108863}for(;At>26,this.words[At+mt]=Rt&67108863;if(St===0)return this._strip();for(j(St===-1),St=0,At=0;At>26,this.words[At]=Rt&67108863;return this.negative=1,this._strip()},tt.prototype._wordDiv=function(ct,dt){var mt=this.length-ct.length,xt=this.clone(),At=ct,Rt=At.words[At.length-1]|0,St=this._countBits(Rt);mt=26-St,mt!==0&&(At=At.ushln(mt),xt.iushln(mt),Rt=At.words[At.length-1]|0);var Tt=xt.length-At.length,Et;if(dt!=="mod"){Et=new tt(null),Et.length=Tt+1,Et.words=new Array(Et.length);for(var Nt=0;Nt=0;ir--){var nr=(xt.words[At.length+ir]|0)*67108864+(xt.words[At.length+ir-1]|0);for(nr=Math.min(nr/Rt|0,67108863),xt._ishlnsubmul(At,nr,ir);xt.negative!==0;)nr--,xt.negative=0,xt._ishlnsubmul(At,1,ir),xt.isZero()||(xt.negative^=1);Et&&(Et.words[ir]=nr)}return Et&&Et._strip(),xt._strip(),dt!=="div"&&mt!==0&&xt.iushrn(mt),{div:Et||null,mod:xt}},tt.prototype.divmod=function(ct,dt,mt){if(j(!ct.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var xt,At,Rt;return this.negative!==0&&ct.negative===0?(Rt=this.neg().divmod(ct,dt),dt!=="mod"&&(xt=Rt.div.neg()),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.iadd(ct)),{div:xt,mod:At}):this.negative===0&&ct.negative!==0?(Rt=this.divmod(ct.neg(),dt),dt!=="mod"&&(xt=Rt.div.neg()),{div:xt,mod:Rt.mod}):this.negative&ct.negative?(Rt=this.neg().divmod(ct.neg(),dt),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.isub(ct)),{div:Rt.div,mod:At}):ct.length>this.length||this.cmp(ct)<0?{div:new tt(0),mod:this}:ct.length===1?dt==="div"?{div:this.divn(ct.words[0]),mod:null}:dt==="mod"?{div:null,mod:new tt(this.modrn(ct.words[0]))}:{div:this.divn(ct.words[0]),mod:new tt(this.modrn(ct.words[0]))}:this._wordDiv(ct,dt)},tt.prototype.div=function(ct){return this.divmod(ct,"div",!1).div},tt.prototype.mod=function(ct){return this.divmod(ct,"mod",!1).mod},tt.prototype.umod=function(ct){return this.divmod(ct,"mod",!0).mod},tt.prototype.divRound=function(ct){var dt=this.divmod(ct);if(dt.mod.isZero())return dt.div;var mt=dt.div.negative!==0?dt.mod.isub(ct):dt.mod,xt=ct.ushrn(1),At=ct.andln(1),Rt=mt.cmp(xt);return Rt<0||At===1&&Rt===0?dt.div:dt.div.negative!==0?dt.div.isubn(1):dt.div.iaddn(1)},tt.prototype.modrn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=(1<<26)%ct,xt=0,At=this.length-1;At>=0;At--)xt=(mt*xt+(this.words[At]|0))%ct;return dt?-xt:xt},tt.prototype.modn=function(ct){return this.modrn(ct)},tt.prototype.idivn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=0,xt=this.length-1;xt>=0;xt--){var At=(this.words[xt]|0)+mt*67108864;this.words[xt]=At/ct|0,mt=At%ct}return this._strip(),dt?this.ineg():this},tt.prototype.divn=function(ct){return this.clone().idivn(ct)},tt.prototype.egcd=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=new tt(0),St=new tt(1),Tt=0;dt.isEven()&&mt.isEven();)dt.iushrn(1),mt.iushrn(1),++Tt;for(var Et=mt.clone(),Nt=dt.clone();!dt.isZero();){for(var tr=0,ir=1;!(dt.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(dt.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(Et),At.isub(Nt)),xt.iushrn(1),At.iushrn(1);for(var nr=0,Zt=1;!(mt.words[0]&Zt)&&nr<26;++nr,Zt<<=1);if(nr>0)for(mt.iushrn(nr);nr-- >0;)(Rt.isOdd()||St.isOdd())&&(Rt.iadd(Et),St.isub(Nt)),Rt.iushrn(1),St.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(Rt),At.isub(St)):(mt.isub(dt),Rt.isub(xt),St.isub(At))}return{a:Rt,b:St,gcd:mt.iushln(Tt)}},tt.prototype._invmp=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=mt.clone();dt.cmpn(1)>0&&mt.cmpn(1)>0;){for(var St=0,Tt=1;!(dt.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(dt.iushrn(St);St-- >0;)xt.isOdd()&&xt.iadd(Rt),xt.iushrn(1);for(var Et=0,Nt=1;!(mt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(mt.iushrn(Et);Et-- >0;)At.isOdd()&&At.iadd(Rt),At.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(At)):(mt.isub(dt),At.isub(xt))}var tr;return dt.cmpn(1)===0?tr=xt:tr=At,tr.cmpn(0)<0&&tr.iadd(ct),tr},tt.prototype.gcd=function(ct){if(this.isZero())return ct.abs();if(ct.isZero())return this.abs();var dt=this.clone(),mt=ct.clone();dt.negative=0,mt.negative=0;for(var xt=0;dt.isEven()&&mt.isEven();xt++)dt.iushrn(1),mt.iushrn(1);do{for(;dt.isEven();)dt.iushrn(1);for(;mt.isEven();)mt.iushrn(1);var At=dt.cmp(mt);if(At<0){var Rt=dt;dt=mt,mt=Rt}else if(At===0||mt.cmpn(1)===0)break;dt.isub(mt)}while(!0);return mt.iushln(xt)},tt.prototype.invm=function(ct){return this.egcd(ct).a.umod(ct)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(ct){return this.words[0]&ct},tt.prototype.bincn=function(ct){j(typeof ct=="number");var dt=ct%26,mt=(ct-dt)/26,xt=1<>>26,St&=67108863,this.words[Rt]=St}return At!==0&&(this.words[Rt]=At,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(ct){var dt=ct<0;if(this.negative!==0&&!dt)return-1;if(this.negative===0&&dt)return 1;this._strip();var mt;if(this.length>1)mt=1;else{dt&&(ct=-ct),j(ct<=67108863,"Number is too big");var xt=this.words[0]|0;mt=xt===ct?0:xtct.length)return 1;if(this.length=0;mt--){var xt=this.words[mt]|0,At=ct.words[mt]|0;if(xt!==At){xtAt&&(dt=1);break}}return dt},tt.prototype.gtn=function(ct){return this.cmpn(ct)===1},tt.prototype.gt=function(ct){return this.cmp(ct)===1},tt.prototype.gten=function(ct){return this.cmpn(ct)>=0},tt.prototype.gte=function(ct){return this.cmp(ct)>=0},tt.prototype.ltn=function(ct){return this.cmpn(ct)===-1},tt.prototype.lt=function(ct){return this.cmp(ct)===-1},tt.prototype.lten=function(ct){return this.cmpn(ct)<=0},tt.prototype.lte=function(ct){return this.cmp(ct)<=0},tt.prototype.eqn=function(ct){return this.cmpn(ct)===0},tt.prototype.eq=function(ct){return this.cmp(ct)===0},tt.red=function(ct){return new jt(ct)},tt.prototype.toRed=function(ct){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),ct.convertTo(this)._forceRed(ct)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(ct){return this.red=ct,this},tt.prototype.forceRed=function(ct){return j(!this.red,"Already a number in reduction context"),this._forceRed(ct)},tt.prototype.redAdd=function(ct){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,ct)},tt.prototype.redIAdd=function(ct){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ct)},tt.prototype.redSub=function(ct){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,ct)},tt.prototype.redISub=function(ct){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,ct)},tt.prototype.redShl=function(ct){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,ct)},tt.prototype.redMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.mul(this,ct)},tt.prototype.redIMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.imul(this,ct)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(ct){return j(this.red&&!ct.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ct)};var Dt={k256:null,p224:null,p192:null,p25519:null};function zt(vt,ct){this.name=vt,this.p=new tt(ct,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}zt.prototype._tmp=function(){var ct=new tt(null);return ct.words=new Array(Math.ceil(this.n/13)),ct},zt.prototype.ireduce=function(ct){var dt=ct,mt;do this.split(dt,this.tmp),dt=this.imulK(dt),dt=dt.iadd(this.tmp),mt=dt.bitLength();while(mt>this.n);var xt=mt0?dt.isub(this.p):dt.strip!==void 0?dt.strip():dt._strip(),dt},zt.prototype.split=function(ct,dt){ct.iushrn(this.n,0,dt)},zt.prototype.imulK=function(ct){return ct.imul(this.k)};function Ot(){zt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Ot,zt),Ot.prototype.split=function(ct,dt){for(var mt=4194303,xt=Math.min(ct.length,9),At=0;At>>22,Rt=St}Rt>>>=22,ct.words[At-10]=Rt,Rt===0&&ct.length>10?ct.length-=10:ct.length-=9},Ot.prototype.imulK=function(ct){ct.words[ct.length]=0,ct.words[ct.length+1]=0,ct.length+=2;for(var dt=0,mt=0;mt>>=26,ct.words[mt]=At,dt=xt}return dt!==0&&(ct.words[ct.length++]=dt),ct},tt._prime=function(ct){if(Dt[ct])return Dt[ct];var dt;if(ct==="k256")dt=new Ot;else if(ct==="p224")dt=new It;else if(ct==="p192")dt=new Lt;else if(ct==="p25519")dt=new Ft;else throw new Error("Unknown prime "+ct);return Dt[ct]=dt,dt};function jt(vt){if(typeof vt=="string"){var ct=tt._prime(vt);this.m=ct.p,this.prime=ct}else j(vt.gtn(1),"modulus must be greater than 1"),this.m=vt,this.prime=null}jt.prototype._verify1=function(ct){j(ct.negative===0,"red works only with positives"),j(ct.red,"red works only with red numbers")},jt.prototype._verify2=function(ct,dt){j((ct.negative|dt.negative)===0,"red works only with positives"),j(ct.red&&ct.red===dt.red,"red works only with red numbers")},jt.prototype.imod=function(ct){return this.prime?this.prime.ireduce(ct)._forceRed(this):(ot(ct,ct.umod(this.m)._forceRed(this)),ct)},jt.prototype.neg=function(ct){return ct.isZero()?ct.clone():this.m.sub(ct)._forceRed(this)},jt.prototype.add=function(ct,dt){this._verify2(ct,dt);var mt=ct.add(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt._forceRed(this)},jt.prototype.iadd=function(ct,dt){this._verify2(ct,dt);var mt=ct.iadd(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt},jt.prototype.sub=function(ct,dt){this._verify2(ct,dt);var mt=ct.sub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt._forceRed(this)},jt.prototype.isub=function(ct,dt){this._verify2(ct,dt);var mt=ct.isub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt},jt.prototype.shl=function(ct,dt){return this._verify1(ct),this.imod(ct.ushln(dt))},jt.prototype.imul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.imul(dt))},jt.prototype.mul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.mul(dt))},jt.prototype.isqr=function(ct){return this.imul(ct,ct.clone())},jt.prototype.sqr=function(ct){return this.mul(ct,ct)},jt.prototype.sqrt=function(ct){if(ct.isZero())return ct.clone();var dt=this.m.andln(3);if(j(dt%2===1),dt===3){var mt=this.m.add(new tt(1)).iushrn(2);return this.pow(ct,mt)}for(var xt=this.m.subn(1),At=0;!xt.isZero()&&xt.andln(1)===0;)At++,xt.iushrn(1);j(!xt.isZero());var Rt=new tt(1).toRed(this),St=Rt.redNeg(),Tt=this.m.subn(1).iushrn(1),Et=this.m.bitLength();for(Et=new tt(2*Et*Et).toRed(this);this.pow(Et,Tt).cmp(St)!==0;)Et.redIAdd(St);for(var Nt=this.pow(Et,xt),tr=this.pow(ct,xt.addn(1).iushrn(1)),ir=this.pow(ct,xt),nr=At;ir.cmp(Rt)!==0;){for(var Zt=ir,Kt=0;Zt.cmp(Rt)!==0;Kt++)Zt=Zt.redSqr();j(Kt=0;At--){for(var Nt=dt.words[At],tr=Et-1;tr>=0;tr--){var ir=Nt>>tr&1;if(Rt!==xt[0]&&(Rt=this.sqr(Rt)),ir===0&&St===0){Tt=0;continue}St<<=1,St|=ir,Tt++,!(Tt!==mt&&(At!==0||tr!==0))&&(Rt=this.mul(Rt,xt[St]),Tt=0,St=0)}Et=26}return Rt},jt.prototype.convertTo=function(ct){var dt=ct.umod(this.m);return dt===ct?dt.clone():dt},jt.prototype.convertFrom=function(ct){var dt=ct.clone();return dt.red=null,dt},tt.mont=function(ct){return new bt(ct)};function bt(vt){jt.call(this,vt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(bt,jt),bt.prototype.convertTo=function(ct){return this.imod(ct.ushln(this.shift))},bt.prototype.convertFrom=function(ct){var dt=this.imod(ct.mul(this.rinv));return dt.red=null,dt},bt.prototype.imul=function(ct,dt){if(ct.isZero()||dt.isZero())return ct.words[0]=0,ct.length=1,ct;var mt=ct.imul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.mul=function(ct,dt){if(ct.isZero()||dt.isZero())return new tt(0)._forceRed(this);var mt=ct.mul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.invm=function(ct){var dt=this.imod(ct._invmp(this.m).mul(this.r2));return dt._forceRed(this)}})(a,commonjsGlobal)}(bn$1)),bn$1.exports}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports){var indexOf=function(a,_){if(a.indexOf)return a.indexOf(_);for(var $=0;$>6],ht=(at&32)===0;if((at&31)===31){var yt=at;for(at=0;(yt&128)===128;){if(yt=st.readUInt8(ot),st.isError(yt))return yt;at<<=7,at|=yt&127}}else at&=31;var wt=et.tag[at];return{cls:ut,primitive:ht,tag:at,tagStr:wt}}function it(st,ot,at){var ut=st.readUInt8(at);if(st.isError(ut))return ut;if(!ot&&ut===128)return null;if(!(ut&128))return ut;var ht=ut&127;if(ht>4)return st.error("length octect is too long");ut=0;for(var yt=0;yt=256;Ct>>=8)wt++;var Pt=new _(2+wt);Pt[0]=yt,Pt[1]=128|wt;for(var Ct=1+wt,$t=ht.length;$t>0;Ct--,$t>>=8)Pt[Ct]=$t&255;return this._createEncoderBuffer([Pt,ht])},rt.prototype._encodeStr=function(ot,at){if(at==="bitstr")return this._createEncoderBuffer([ot.unused|0,ot.data]);if(at==="bmpstr"){for(var ut=new _(ot.length*2),ht=0;ht=40)return this.reporter.error("Second objid identifier OOB");ot.splice(0,2,ot[0]*40+ot[1])}for(var yt=0,ht=0;ht=128;wt>>=7)yt++}for(var Ct=new _(yt),Pt=Ct.length-1,ht=ot.length-1;ht>=0;ht--){var wt=ot[ht];for(Ct[Pt--]=wt&127;(wt>>=7)>0;)Ct[Pt--]=128|wt&127}return this._createEncoderBuffer(Ct)};function nt(st){return st<10?"0"+st:st}rt.prototype._encodeTime=function(ot,at){var ut,ht=new Date(ot);return at==="gentime"?ut=[nt(ht.getFullYear()),nt(ht.getUTCMonth()+1),nt(ht.getUTCDate()),nt(ht.getUTCHours()),nt(ht.getUTCMinutes()),nt(ht.getUTCSeconds()),"Z"].join(""):at==="utctime"?ut=[nt(ht.getFullYear()%100),nt(ht.getUTCMonth()+1),nt(ht.getUTCDate()),nt(ht.getUTCHours()),nt(ht.getUTCMinutes()),nt(ht.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+at+" time is not supported yet"),this._encodeStr(ut,"octstr")},rt.prototype._encodeNull=function(){return this._createEncoderBuffer("")},rt.prototype._encodeInt=function(ot,at){if(typeof ot=="string"){if(!at)return this.reporter.error("String int or enum given, but no values map");if(!at.hasOwnProperty(ot))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(ot));ot=at[ot]}if(typeof ot!="number"&&!_.isBuffer(ot)){var ut=ot.toArray();!ot.sign&&ut[0]&128&&ut.unshift(0),ot=new _(ut)}if(_.isBuffer(ot)){var ht=ot.length;ot.length===0&&ht++;var wt=new _(ht);return ot.copy(wt),ot.length===0&&(wt[0]=0),this._createEncoderBuffer(wt)}if(ot<128)return this._createEncoderBuffer(ot);if(ot<256)return this._createEncoderBuffer([0,ot]);for(var ht=1,yt=ot;yt>=256;yt>>=8)ht++;for(var wt=new Array(ht),yt=wt.length-1;yt>=0;yt--)wt[yt]=ot&255,ot>>=8;return wt[0]&128&&wt.unshift(0),this._createEncoderBuffer(new _(wt))},rt.prototype._encodeBool=function(ot){return this._createEncoderBuffer(ot?255:0)},rt.prototype._use=function(ot,at){return typeof ot=="function"&&(ot=ot(at)),ot._getEncoder("der").tree},rt.prototype._skipDefault=function(ot,at,ut){var ht=this._baseState,yt;if(ht.default===null)return!1;var wt=ot.join();if(ht.defaultBuffer===void 0&&(ht.defaultBuffer=this._encodeValue(ht.default,at,ut).join()),wt.length!==ht.defaultBuffer.length)return!1;for(yt=0;yt=31?ut.error("Multi-octet tag encoding unsupported"):(ot||(ht|=32),ht|=et.tagClassByName[at||"universal"]<<6,ht)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var a=inherits_browserExports,_=requireDer();function $(j){_.call(this,j),this.enc="pem"}return a($,_),pem=$,$.prototype.encode=function(et,tt){for(var rt=_.prototype.encode.call(this,et),nt=rt.toString("base64"),it=["-----BEGIN "+tt.label+"-----"],st=0;st0&&Mt.ishrn(Bt),Mt}function yt(Pt,$t){Pt=ht(Pt,$t),Pt=Pt.mod($t);var Mt=a.from(Pt.toArray());if(Mt.length<$t.byteLength()){var Bt=a.alloc($t.byteLength()-Mt.length);Mt=a.concat([Bt,Mt])}return Mt}function wt(Pt,$t,Mt){var Bt,Dt;do{for(Bt=a.alloc(0);Bt.length*8=0)throw new Error("invalid sig")}return verify_1=tt,verify_1}var browser$3,hasRequiredBrowser$3;function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$3;hasRequiredBrowser$3=1;var a=safeBufferExports.Buffer,_=browser$b,$=requireReadableBrowser(),j=inherits_browserExports,et=requireSign(),tt=requireVerify(),rt=require$$6$1;Object.keys(rt).forEach(function(at){rt[at].id=a.from(rt[at].id,"hex"),rt[at.toLowerCase()]=rt[at]});function nt(at){$.Writable.call(this);var ut=rt[at];if(!ut)throw new Error("Unknown message digest");this._hashType=ut.hash,this._hash=_(ut.hash),this._tag=ut.id,this._signType=ut.sign}j(nt,$.Writable),nt.prototype._write=function(ut,ht,yt){this._hash.update(ut),yt()},nt.prototype.update=function(ut,ht){return this._hash.update(typeof ut=="string"?a.from(ut,ht):ut),this},nt.prototype.sign=function(ut,ht){this.end();var yt=this._hash.digest(),wt=et(yt,ut,this._hashType,this._signType,this._tag);return ht?wt.toString(ht):wt};function it(at){$.Writable.call(this);var ut=rt[at];if(!ut)throw new Error("Unknown message digest");this._hash=_(ut.hash),this._tag=ut.id,this._signType=ut.sign}j(it,$.Writable),it.prototype._write=function(ut,ht,yt){this._hash.update(ut),yt()},it.prototype.update=function(ut,ht){return this._hash.update(typeof ut=="string"?a.from(ut,ht):ut),this},it.prototype.verify=function(ut,ht,yt){var wt=typeof ht=="string"?a.from(ht,yt):ht;this.end();var Ct=this._hash.digest();return tt(wt,Ct,ut,this._signType,this._tag)};function st(at){return new nt(at)}function ot(at){return new it(at)}return browser$3={Sign:st,Verify:ot,createSign:st,createVerify:ot},browser$3}var elliptic$2={};const name$2="elliptic",version$2="6.5.5",description$2="EC cryptography",main$2="lib/elliptic.js",files$1=["lib"],scripts$2={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository$2={type:"git",url:"git@github.com:indutny/elliptic"},keywords$1=["EC","Elliptic","curve","Cryptography"],author$2="Fedor Indutny ",license$2="MIT",bugs$1={url:"https://github.com/indutny/elliptic/issues"},homepage$2="https://github.com/indutny/elliptic",devDependencies$2={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies$2={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0$2={name:name$2,version:version$2,description:description$2,main:main$2,files:files$1,scripts:scripts$2,repository:repository$2,keywords:keywords$1,author:author$2,license:license$2,bugs:bugs$1,homepage:homepage$2,devDependencies:devDependencies$2,dependencies:dependencies$2};var utils$j={},hasRequiredUtils;function requireUtils(){return hasRequiredUtils||(hasRequiredUtils=1,function(a){var _=a,$=bnExports$1,j=minimalisticAssert,et=utils$v;_.assert=j,_.toArray=et.toArray,_.zero2=et.zero2,_.toHex=et.toHex,_.encode=et.encode;function tt(ot,at,ut){var ht=new Array(Math.max(ot.bitLength(),ut)+1),yt;for(yt=0;yt(wt>>1)-1?Pt=(wt>>1)-$t:Pt=$t,Ct.isubn(Pt)):Pt=0,ht[yt]=Pt,Ct.iushrn(1)}return ht}_.getNAF=tt;function rt(ot,at){var ut=[[],[]];ot=ot.clone(),at=at.clone();for(var ht=0,yt=0,wt;ot.cmpn(-ht)>0||at.cmpn(-yt)>0;){var Ct=ot.andln(3)+ht&3,Pt=at.andln(3)+yt&3;Ct===3&&(Ct=-1),Pt===3&&(Pt=-1);var $t;Ct&1?(wt=ot.andln(7)+ht&7,(wt===3||wt===5)&&Pt===2?$t=-Ct:$t=Ct):$t=0,ut[0].push($t);var Mt;Pt&1?(wt=at.andln(7)+yt&7,(wt===3||wt===5)&&Ct===2?Mt=-Pt:Mt=Pt):Mt=0,ut[1].push(Mt),2*ht===$t+1&&(ht=1-ht),2*yt===Mt+1&&(yt=1-yt),ot.iushrn(1),at.iushrn(1)}return ut}_.getJSF=rt;function nt(ot,at,ut){var ht="_"+at;ot.prototype[at]=function(){return this[ht]!==void 0?this[ht]:this[ht]=ut.call(this)}}_.cachedProperty=nt;function it(ot){return typeof ot=="string"?_.toArray(ot,"hex"):ot}_.parseBytes=it;function st(ot){return new $(ot,"hex","le")}_.intFromLE=st}(utils$j)),utils$j}var curve$1={},base$3,hasRequiredBase;function requireBase(){if(hasRequiredBase)return base$3;hasRequiredBase=1;var a=bnExports$1,_=requireUtils(),$=_.getNAF,j=_.getJSF,et=_.assert;function tt(nt,it){this.type=nt,this.p=new a(it.p,16),this.red=it.prime?a.red(it.prime):a.mont(this.p),this.zero=new a(0).toRed(this.red),this.one=new a(1).toRed(this.red),this.two=new a(2).toRed(this.red),this.n=it.n&&new a(it.n,16),this.g=it.g&&this.pointFromJSON(it.g,it.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var st=this.n&&this.p.div(this.n);!st||st.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$3=tt,tt.prototype.point=function(){throw new Error("Not implemented")},tt.prototype.validate=function(){throw new Error("Not implemented")},tt.prototype._fixedNafMul=function(it,st){et(it.precomputed);var ot=it._getDoubles(),at=$(st,1,this._bitLength),ut=(1<=yt;Ct--)wt=(wt<<1)+at[Ct];ht.push(wt)}for(var Pt=this.jpoint(null,null,null),$t=this.jpoint(null,null,null),Mt=ut;Mt>0;Mt--){for(yt=0;yt=0;wt--){for(var Ct=0;wt>=0&&ht[wt]===0;wt--)Ct++;if(wt>=0&&Ct++,yt=yt.dblp(Ct),wt<0)break;var Pt=ht[wt];et(Pt!==0),it.type==="affine"?Pt>0?yt=yt.mixedAdd(ut[Pt-1>>1]):yt=yt.mixedAdd(ut[-Pt-1>>1].neg()):Pt>0?yt=yt.add(ut[Pt-1>>1]):yt=yt.add(ut[-Pt-1>>1].neg())}return it.type==="affine"?yt.toP():yt},tt.prototype._wnafMulAdd=function(it,st,ot,at,ut){var ht=this._wnafT1,yt=this._wnafT2,wt=this._wnafT3,Ct=0,Pt,$t,Mt;for(Pt=0;Pt=1;Pt-=2){var Dt=Pt-1,zt=Pt;if(ht[Dt]!==1||ht[zt]!==1){wt[Dt]=$(ot[Dt],ht[Dt],this._bitLength),wt[zt]=$(ot[zt],ht[zt],this._bitLength),Ct=Math.max(wt[Dt].length,Ct),Ct=Math.max(wt[zt].length,Ct);continue}var Ot=[st[Dt],null,null,st[zt]];st[Dt].y.cmp(st[zt].y)===0?(Ot[1]=st[Dt].add(st[zt]),Ot[2]=st[Dt].toJ().mixedAdd(st[zt].neg())):st[Dt].y.cmp(st[zt].y.redNeg())===0?(Ot[1]=st[Dt].toJ().mixedAdd(st[zt]),Ot[2]=st[Dt].add(st[zt].neg())):(Ot[1]=st[Dt].toJ().mixedAdd(st[zt]),Ot[2]=st[Dt].toJ().mixedAdd(st[zt].neg()));var It=[-3,-1,-5,-7,0,7,5,1,3],Lt=j(ot[Dt],ot[zt]);for(Ct=Math.max(Lt[0].length,Ct),wt[Dt]=new Array(Ct),wt[zt]=new Array(Ct),$t=0;$t=0;Pt--){for(var ct=0;Pt>=0;){var dt=!0;for($t=0;$t=0&&ct++,bt=bt.dblp(ct),Pt<0)break;for($t=0;$t0?Mt=yt[$t][mt-1>>1]:mt<0&&(Mt=yt[$t][-mt-1>>1].neg()),Mt.type==="affine"?bt=bt.mixedAdd(Mt):bt=bt.add(Mt))}}for(Pt=0;Pt=Math.ceil((it.bitLength()+1)/st.step):!1},rt.prototype._getDoubles=function(it,st){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var ot=[this],at=this,ut=0;ut=0&&(Dt=Pt,zt=$t),Mt.negative&&(Mt=Mt.neg(),Bt=Bt.neg()),Dt.negative&&(Dt=Dt.neg(),zt=zt.neg()),[{a:Mt,b:Bt},{a:Dt,b:zt}]},tt.prototype._endoSplit=function(st){var ot=this.endo.basis,at=ot[0],ut=ot[1],ht=ut.b.mul(st).divRound(this.n),yt=at.b.neg().mul(st).divRound(this.n),wt=ht.mul(at.a),Ct=yt.mul(ut.a),Pt=ht.mul(at.b),$t=yt.mul(ut.b),Mt=st.sub(wt).sub(Ct),Bt=Pt.add($t).neg();return{k1:Mt,k2:Bt}},tt.prototype.pointFromX=function(st,ot){st=new _(st,16),st.red||(st=st.toRed(this.red));var at=st.redSqr().redMul(st).redIAdd(st.redMul(this.a)).redIAdd(this.b),ut=at.redSqrt();if(ut.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");var ht=ut.fromRed().isOdd();return(ot&&!ht||!ot&&ht)&&(ut=ut.redNeg()),this.point(st,ut)},tt.prototype.validate=function(st){if(st.inf)return!0;var ot=st.x,at=st.y,ut=this.a.redMul(ot),ht=ot.redSqr().redMul(ot).redIAdd(ut).redIAdd(this.b);return at.redSqr().redISub(ht).cmpn(0)===0},tt.prototype._endoWnafMulAdd=function(st,ot,at){for(var ut=this._endoWnafT1,ht=this._endoWnafT2,yt=0;yt":""},rt.prototype.isInfinity=function(){return this.inf},rt.prototype.add=function(st){if(this.inf)return st;if(st.inf)return this;if(this.eq(st))return this.dbl();if(this.neg().eq(st))return this.curve.point(null,null);if(this.x.cmp(st.x)===0)return this.curve.point(null,null);var ot=this.y.redSub(st.y);ot.cmpn(0)!==0&&(ot=ot.redMul(this.x.redSub(st.x).redInvm()));var at=ot.redSqr().redISub(this.x).redISub(st.x),ut=ot.redMul(this.x.redSub(at)).redISub(this.y);return this.curve.point(at,ut)},rt.prototype.dbl=function(){if(this.inf)return this;var st=this.y.redAdd(this.y);if(st.cmpn(0)===0)return this.curve.point(null,null);var ot=this.curve.a,at=this.x.redSqr(),ut=st.redInvm(),ht=at.redAdd(at).redIAdd(at).redIAdd(ot).redMul(ut),yt=ht.redSqr().redISub(this.x.redAdd(this.x)),wt=ht.redMul(this.x.redSub(yt)).redISub(this.y);return this.curve.point(yt,wt)},rt.prototype.getX=function(){return this.x.fromRed()},rt.prototype.getY=function(){return this.y.fromRed()},rt.prototype.mul=function(st){return st=new _(st,16),this.isInfinity()?this:this._hasDoubles(st)?this.curve._fixedNafMul(this,st):this.curve.endo?this.curve._endoWnafMulAdd([this],[st]):this.curve._wnafMul(this,st)},rt.prototype.mulAdd=function(st,ot,at){var ut=[this,ot],ht=[st,at];return this.curve.endo?this.curve._endoWnafMulAdd(ut,ht):this.curve._wnafMulAdd(1,ut,ht,2)},rt.prototype.jmulAdd=function(st,ot,at){var ut=[this,ot],ht=[st,at];return this.curve.endo?this.curve._endoWnafMulAdd(ut,ht,!0):this.curve._wnafMulAdd(1,ut,ht,2,!0)},rt.prototype.eq=function(st){return this===st||this.inf===st.inf&&(this.inf||this.x.cmp(st.x)===0&&this.y.cmp(st.y)===0)},rt.prototype.neg=function(st){if(this.inf)return this;var ot=this.curve.point(this.x,this.y.redNeg());if(st&&this.precomputed){var at=this.precomputed,ut=function(ht){return ht.neg()};ot.precomputed={naf:at.naf&&{wnd:at.naf.wnd,points:at.naf.points.map(ut)},doubles:at.doubles&&{step:at.doubles.step,points:at.doubles.points.map(ut)}}}return ot},rt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var st=this.curve.jpoint(this.x,this.y,this.curve.one);return st};function nt(it,st,ot,at){j.BasePoint.call(this,it,"jacobian"),st===null&&ot===null&&at===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new _(0)):(this.x=new _(st,16),this.y=new _(ot,16),this.z=new _(at,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return $(nt,j.BasePoint),tt.prototype.jpoint=function(st,ot,at){return new nt(this,st,ot,at)},nt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var st=this.z.redInvm(),ot=st.redSqr(),at=this.x.redMul(ot),ut=this.y.redMul(ot).redMul(st);return this.curve.point(at,ut)},nt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},nt.prototype.add=function(st){if(this.isInfinity())return st;if(st.isInfinity())return this;var ot=st.z.redSqr(),at=this.z.redSqr(),ut=this.x.redMul(ot),ht=st.x.redMul(at),yt=this.y.redMul(ot.redMul(st.z)),wt=st.y.redMul(at.redMul(this.z)),Ct=ut.redSub(ht),Pt=yt.redSub(wt);if(Ct.cmpn(0)===0)return Pt.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var $t=Ct.redSqr(),Mt=$t.redMul(Ct),Bt=ut.redMul($t),Dt=Pt.redSqr().redIAdd(Mt).redISub(Bt).redISub(Bt),zt=Pt.redMul(Bt.redISub(Dt)).redISub(yt.redMul(Mt)),Ot=this.z.redMul(st.z).redMul(Ct);return this.curve.jpoint(Dt,zt,Ot)},nt.prototype.mixedAdd=function(st){if(this.isInfinity())return st.toJ();if(st.isInfinity())return this;var ot=this.z.redSqr(),at=this.x,ut=st.x.redMul(ot),ht=this.y,yt=st.y.redMul(ot).redMul(this.z),wt=at.redSub(ut),Ct=ht.redSub(yt);if(wt.cmpn(0)===0)return Ct.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var Pt=wt.redSqr(),$t=Pt.redMul(wt),Mt=at.redMul(Pt),Bt=Ct.redSqr().redIAdd($t).redISub(Mt).redISub(Mt),Dt=Ct.redMul(Mt.redISub(Bt)).redISub(ht.redMul($t)),zt=this.z.redMul(wt);return this.curve.jpoint(Bt,Dt,zt)},nt.prototype.dblp=function(st){if(st===0)return this;if(this.isInfinity())return this;if(!st)return this.dbl();var ot;if(this.curve.zeroA||this.curve.threeA){var at=this;for(ot=0;ot=0)return!1;if(at.redIAdd(ht),this.x.cmp(at)===0)return!0}},nt.prototype.inspect=function(){return this.isInfinity()?"":""},nt.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short$1}var mont$1,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont$1;hasRequiredMont=1;var a=bnExports$1,_=inherits_browserExports,$=requireBase(),j=requireUtils();function et(rt){$.call(this,"mont",rt),this.a=new a(rt.a,16).toRed(this.red),this.b=new a(rt.b,16).toRed(this.red),this.i4=new a(4).toRed(this.red).redInvm(),this.two=new a(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}_(et,$),mont$1=et,et.prototype.validate=function(nt){var it=nt.normalize().x,st=it.redSqr(),ot=st.redMul(it).redAdd(st.redMul(this.a)).redAdd(it),at=ot.redSqrt();return at.redSqr().cmp(ot)===0};function tt(rt,nt,it){$.BasePoint.call(this,rt,"projective"),nt===null&&it===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new a(nt,16),this.z=new a(it,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return _(tt,$.BasePoint),et.prototype.decodePoint=function(nt,it){return this.point(j.toArray(nt,it),1)},et.prototype.point=function(nt,it){return new tt(this,nt,it)},et.prototype.pointFromJSON=function(nt){return tt.fromJSON(this,nt)},tt.prototype.precompute=function(){},tt.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},tt.fromJSON=function(nt,it){return new tt(nt,it[0],it[1]||nt.one)},tt.prototype.inspect=function(){return this.isInfinity()?"":""},tt.prototype.isInfinity=function(){return this.z.cmpn(0)===0},tt.prototype.dbl=function(){var nt=this.x.redAdd(this.z),it=nt.redSqr(),st=this.x.redSub(this.z),ot=st.redSqr(),at=it.redSub(ot),ut=it.redMul(ot),ht=at.redMul(ot.redAdd(this.curve.a24.redMul(at)));return this.curve.point(ut,ht)},tt.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.diffAdd=function(nt,it){var st=this.x.redAdd(this.z),ot=this.x.redSub(this.z),at=nt.x.redAdd(nt.z),ut=nt.x.redSub(nt.z),ht=ut.redMul(st),yt=at.redMul(ot),wt=it.z.redMul(ht.redAdd(yt).redSqr()),Ct=it.x.redMul(ht.redISub(yt).redSqr());return this.curve.point(wt,Ct)},tt.prototype.mul=function(nt){for(var it=nt.clone(),st=this,ot=this.curve.point(null,null),at=this,ut=[];it.cmpn(0)!==0;it.iushrn(1))ut.push(it.andln(1));for(var ht=ut.length-1;ht>=0;ht--)ut[ht]===0?(st=st.diffAdd(ot,at),ot=ot.dbl()):(ot=st.diffAdd(ot,at),st=st.dbl());return ot},tt.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},tt.prototype.eq=function(nt){return this.getX().cmp(nt.getX())===0},tt.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},tt.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont$1}var edwards$1,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards$1;hasRequiredEdwards=1;var a=requireUtils(),_=bnExports$1,$=inherits_browserExports,j=requireBase(),et=a.assert;function tt(nt){this.twisted=(nt.a|0)!==1,this.mOneA=this.twisted&&(nt.a|0)===-1,this.extended=this.mOneA,j.call(this,"edwards",nt),this.a=new _(nt.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _(nt.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _(nt.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),et(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(nt.c|0)===1}$(tt,j),edwards$1=tt,tt.prototype._mulA=function(it){return this.mOneA?it.redNeg():this.a.redMul(it)},tt.prototype._mulC=function(it){return this.oneC?it:this.c.redMul(it)},tt.prototype.jpoint=function(it,st,ot,at){return this.point(it,st,ot,at)},tt.prototype.pointFromX=function(it,st){it=new _(it,16),it.red||(it=it.toRed(this.red));var ot=it.redSqr(),at=this.c2.redSub(this.a.redMul(ot)),ut=this.one.redSub(this.c2.redMul(this.d).redMul(ot)),ht=at.redMul(ut.redInvm()),yt=ht.redSqrt();if(yt.redSqr().redSub(ht).cmp(this.zero)!==0)throw new Error("invalid point");var wt=yt.fromRed().isOdd();return(st&&!wt||!st&&wt)&&(yt=yt.redNeg()),this.point(it,yt)},tt.prototype.pointFromY=function(it,st){it=new _(it,16),it.red||(it=it.toRed(this.red));var ot=it.redSqr(),at=ot.redSub(this.c2),ut=ot.redMul(this.d).redMul(this.c2).redSub(this.a),ht=at.redMul(ut.redInvm());if(ht.cmp(this.zero)===0){if(st)throw new Error("invalid point");return this.point(this.zero,it)}var yt=ht.redSqrt();if(yt.redSqr().redSub(ht).cmp(this.zero)!==0)throw new Error("invalid point");return yt.fromRed().isOdd()!==st&&(yt=yt.redNeg()),this.point(yt,it)},tt.prototype.validate=function(it){if(it.isInfinity())return!0;it.normalize();var st=it.x.redSqr(),ot=it.y.redSqr(),at=st.redMul(this.a).redAdd(ot),ut=this.c2.redMul(this.one.redAdd(this.d.redMul(st).redMul(ot)));return at.cmp(ut)===0};function rt(nt,it,st,ot,at){j.BasePoint.call(this,nt,"projective"),it===null&&st===null&&ot===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new _(it,16),this.y=new _(st,16),this.z=ot?new _(ot,16):this.curve.one,this.t=at&&new _(at,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return $(rt,j.BasePoint),tt.prototype.pointFromJSON=function(it){return rt.fromJSON(this,it)},tt.prototype.point=function(it,st,ot,at){return new rt(this,it,st,ot,at)},rt.fromJSON=function(it,st){return new rt(it,st[0],st[1],st[2])},rt.prototype.inspect=function(){return this.isInfinity()?"":""},rt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},rt.prototype._extDbl=function(){var it=this.x.redSqr(),st=this.y.redSqr(),ot=this.z.redSqr();ot=ot.redIAdd(ot);var at=this.curve._mulA(it),ut=this.x.redAdd(this.y).redSqr().redISub(it).redISub(st),ht=at.redAdd(st),yt=ht.redSub(ot),wt=at.redSub(st),Ct=ut.redMul(yt),Pt=ht.redMul(wt),$t=ut.redMul(wt),Mt=yt.redMul(ht);return this.curve.point(Ct,Pt,Mt,$t)},rt.prototype._projDbl=function(){var it=this.x.redAdd(this.y).redSqr(),st=this.x.redSqr(),ot=this.y.redSqr(),at,ut,ht,yt,wt,Ct;if(this.curve.twisted){yt=this.curve._mulA(st);var Pt=yt.redAdd(ot);this.zOne?(at=it.redSub(st).redSub(ot).redMul(Pt.redSub(this.curve.two)),ut=Pt.redMul(yt.redSub(ot)),ht=Pt.redSqr().redSub(Pt).redSub(Pt)):(wt=this.z.redSqr(),Ct=Pt.redSub(wt).redISub(wt),at=it.redSub(st).redISub(ot).redMul(Ct),ut=Pt.redMul(yt.redSub(ot)),ht=Pt.redMul(Ct))}else yt=st.redAdd(ot),wt=this.curve._mulC(this.z).redSqr(),Ct=yt.redSub(wt).redSub(wt),at=this.curve._mulC(it.redISub(yt)).redMul(Ct),ut=this.curve._mulC(yt).redMul(st.redISub(ot)),ht=yt.redMul(Ct);return this.curve.point(at,ut,ht)},rt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},rt.prototype._extAdd=function(it){var st=this.y.redSub(this.x).redMul(it.y.redSub(it.x)),ot=this.y.redAdd(this.x).redMul(it.y.redAdd(it.x)),at=this.t.redMul(this.curve.dd).redMul(it.t),ut=this.z.redMul(it.z.redAdd(it.z)),ht=ot.redSub(st),yt=ut.redSub(at),wt=ut.redAdd(at),Ct=ot.redAdd(st),Pt=ht.redMul(yt),$t=wt.redMul(Ct),Mt=ht.redMul(Ct),Bt=yt.redMul(wt);return this.curve.point(Pt,$t,Bt,Mt)},rt.prototype._projAdd=function(it){var st=this.z.redMul(it.z),ot=st.redSqr(),at=this.x.redMul(it.x),ut=this.y.redMul(it.y),ht=this.curve.d.redMul(at).redMul(ut),yt=ot.redSub(ht),wt=ot.redAdd(ht),Ct=this.x.redAdd(this.y).redMul(it.x.redAdd(it.y)).redISub(at).redISub(ut),Pt=st.redMul(yt).redMul(Ct),$t,Mt;return this.curve.twisted?($t=st.redMul(wt).redMul(ut.redSub(this.curve._mulA(at))),Mt=yt.redMul(wt)):($t=st.redMul(wt).redMul(ut.redSub(at)),Mt=this.curve._mulC(yt).redMul(wt)),this.curve.point(Pt,$t,Mt)},rt.prototype.add=function(it){return this.isInfinity()?it:it.isInfinity()?this:this.curve.extended?this._extAdd(it):this._projAdd(it)},rt.prototype.mul=function(it){return this._hasDoubles(it)?this.curve._fixedNafMul(this,it):this.curve._wnafMul(this,it)},rt.prototype.mulAdd=function(it,st,ot){return this.curve._wnafMulAdd(1,[this,st],[it,ot],2,!1)},rt.prototype.jmulAdd=function(it,st,ot){return this.curve._wnafMulAdd(1,[this,st],[it,ot],2,!0)},rt.prototype.normalize=function(){if(this.zOne)return this;var it=this.z.redInvm();return this.x=this.x.redMul(it),this.y=this.y.redMul(it),this.t&&(this.t=this.t.redMul(it)),this.z=this.curve.one,this.zOne=!0,this},rt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},rt.prototype.getX=function(){return this.normalize(),this.x.fromRed()},rt.prototype.getY=function(){return this.normalize(),this.y.fromRed()},rt.prototype.eq=function(it){return this===it||this.getX().cmp(it.getX())===0&&this.getY().cmp(it.getY())===0},rt.prototype.eqXToP=function(it){var st=it.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(st)===0)return!0;for(var ot=it.clone(),at=this.curve.redN.redMul(this.z);;){if(ot.iadd(this.curve.n),ot.cmp(this.curve.p)>=0)return!1;if(st.redIAdd(at),this.x.cmp(st)===0)return!0}},rt.prototype.toP=rt.prototype.normalize,rt.prototype.mixedAdd=rt.prototype.add,edwards$1}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,function(a){var _=a;_.base=requireBase(),_.short=requireShort(),_.mont=requireMont(),_.edwards=requireEdwards()}(curve$1)),curve$1}var curves$3={},secp256k1$1,hasRequiredSecp256k1$1;function requireSecp256k1$1(){return hasRequiredSecp256k1$1||(hasRequiredSecp256k1$1=1,secp256k1$1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1$1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,function(a){var _=a,$=hash$4,j=requireCurve(),et=requireUtils(),tt=et.assert;function rt(st){st.type==="short"?this.curve=new j.short(st):st.type==="edwards"?this.curve=new j.edwards(st):this.curve=new j.mont(st),this.g=this.curve.g,this.n=this.curve.n,this.hash=st.hash,tt(this.g.validate(),"Invalid curve"),tt(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}_.PresetCurve=rt;function nt(st,ot){Object.defineProperty(_,st,{configurable:!0,enumerable:!0,get:function(){var at=new rt(ot);return Object.defineProperty(_,st,{configurable:!0,enumerable:!0,value:at}),at}})}nt("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:$.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),nt("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:$.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),nt("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:$.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),nt("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:$.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),nt("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:$.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),nt("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$.sha256,gRed:!1,g:["9"]}),nt("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var it;try{it=requireSecp256k1$1()}catch{it=void 0}nt("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:$.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",it]})}(curves$3)),curves$3}var key$3,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$3;hasRequiredKey$1=1;var a=bnExports$1,_=requireUtils(),$=_.assert;function j(et,tt){this.ec=et,this.priv=null,this.pub=null,tt.priv&&this._importPrivate(tt.priv,tt.privEnc),tt.pub&&this._importPublic(tt.pub,tt.pubEnc)}return key$3=j,j.fromPublic=function(tt,rt,nt){return rt instanceof j?rt:new j(tt,{pub:rt,pubEnc:nt})},j.fromPrivate=function(tt,rt,nt){return rt instanceof j?rt:new j(tt,{priv:rt,privEnc:nt})},j.prototype.validate=function(){var tt=this.getPublic();return tt.isInfinity()?{result:!1,reason:"Invalid public key"}:tt.validate()?tt.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},j.prototype.getPublic=function(tt,rt){return typeof tt=="string"&&(rt=tt,tt=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),rt?this.pub.encode(rt,tt):this.pub},j.prototype.getPrivate=function(tt){return tt==="hex"?this.priv.toString(16,2):this.priv},j.prototype._importPrivate=function(tt,rt){this.priv=new a(tt,rt||16),this.priv=this.priv.umod(this.ec.curve.n)},j.prototype._importPublic=function(tt,rt){if(tt.x||tt.y){this.ec.curve.type==="mont"?$(tt.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&$(tt.x&&tt.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(tt.x,tt.y);return}this.pub=this.ec.curve.decodePoint(tt,rt)},j.prototype.derive=function(tt){return tt.validate()||$(tt.validate(),"public point not validated"),tt.mul(this.priv).getX()},j.prototype.sign=function(tt,rt,nt){return this.ec.sign(tt,this,rt,nt)},j.prototype.verify=function(tt,rt){return this.ec.verify(tt,rt,this)},j.prototype.inspect=function(){return""},key$3}var signature$3,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$3;hasRequiredSignature$1=1;var a=bnExports$1,_=requireUtils(),$=_.assert;function j(it,st){if(it instanceof j)return it;this._importDER(it,st)||($(it.r&&it.s,"Signature without r or s"),this.r=new a(it.r,16),this.s=new a(it.s,16),it.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=it.recoveryParam)}signature$3=j;function et(){this.place=0}function tt(it,st){var ot=it[st.place++];if(!(ot&128))return ot;var at=ot&15;if(at===0||at>4)return!1;for(var ut=0,ht=0,yt=st.place;ht>>=0;return ut<=127?!1:(st.place=yt,ut)}function rt(it){for(var st=0,ot=it.length-1;!it[st]&&!(it[st+1]&128)&&st>>3);for(it.push(ot|128);--ot;)it.push(st>>>(ot<<3)&255);it.push(st)}return j.prototype.toDER=function(st){var ot=this.r.toArray(),at=this.s.toArray();for(ot[0]&128&&(ot=[0].concat(ot)),at[0]&128&&(at=[0].concat(at)),ot=rt(ot),at=rt(at);!at[0]&&!(at[1]&128);)at=at.slice(1);var ut=[2];nt(ut,ot.length),ut=ut.concat(ot),ut.push(2),nt(ut,at.length);var ht=ut.concat(at),yt=[48];return nt(yt,ht.length),yt=yt.concat(ht),_.encode(yt,st)},signature$3}var ec$4,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$4;hasRequiredEc=1;var a=bnExports$1,_=hmacDrbg,$=requireUtils(),j=requireCurves(),et=requireBrorand(),tt=$.assert,rt=requireKey$1(),nt=requireSignature$1();function it(st){if(!(this instanceof it))return new it(st);typeof st=="string"&&(tt(Object.prototype.hasOwnProperty.call(j,st),"Unknown curve "+st),st=j[st]),st instanceof j.PresetCurve&&(st={curve:st}),this.curve=st.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=st.curve.g,this.g.precompute(st.curve.n.bitLength()+1),this.hash=st.hash||st.curve.hash}return ec$4=it,it.prototype.keyPair=function(ot){return new rt(this,ot)},it.prototype.keyFromPrivate=function(ot,at){return rt.fromPrivate(this,ot,at)},it.prototype.keyFromPublic=function(ot,at){return rt.fromPublic(this,ot,at)},it.prototype.genKeyPair=function(ot){ot||(ot={});for(var at=new _({hash:this.hash,pers:ot.pers,persEnc:ot.persEnc||"utf8",entropy:ot.entropy||et(this.hash.hmacStrength),entropyEnc:ot.entropy&&ot.entropyEnc||"utf8",nonce:this.n.toArray()}),ut=this.n.byteLength(),ht=this.n.sub(new a(2));;){var yt=new a(at.generate(ut));if(!(yt.cmp(ht)>0))return yt.iaddn(1),this.keyFromPrivate(yt)}},it.prototype._truncateToN=function(ot,at){var ut=ot.byteLength()*8-this.n.bitLength();return ut>0&&(ot=ot.ushrn(ut)),!at&&ot.cmp(this.n)>=0?ot.sub(this.n):ot},it.prototype.sign=function(ot,at,ut,ht){typeof ut=="object"&&(ht=ut,ut=null),ht||(ht={}),at=this.keyFromPrivate(at,ut),ot=this._truncateToN(new a(ot,16));for(var yt=this.n.byteLength(),wt=at.getPrivate().toArray("be",yt),Ct=ot.toArray("be",yt),Pt=new _({hash:this.hash,entropy:wt,nonce:Ct,pers:ht.pers,persEnc:ht.persEnc||"utf8"}),$t=this.n.sub(new a(1)),Mt=0;;Mt++){var Bt=ht.k?ht.k(Mt):new a(Pt.generate(this.n.byteLength()));if(Bt=this._truncateToN(Bt,!0),!(Bt.cmpn(1)<=0||Bt.cmp($t)>=0)){var Dt=this.g.mul(Bt);if(!Dt.isInfinity()){var zt=Dt.getX(),Ot=zt.umod(this.n);if(Ot.cmpn(0)!==0){var It=Bt.invm(this.n).mul(Ot.mul(at.getPrivate()).iadd(ot));if(It=It.umod(this.n),It.cmpn(0)!==0){var Lt=(Dt.getY().isOdd()?1:0)|(zt.cmp(Ot)!==0?2:0);return ht.canonical&&It.cmp(this.nh)>0&&(It=this.n.sub(It),Lt^=1),new nt({r:Ot,s:It,recoveryParam:Lt})}}}}}},it.prototype.verify=function(ot,at,ut,ht){ot=this._truncateToN(new a(ot,16)),ut=this.keyFromPublic(ut,ht),at=new nt(at,"hex");var yt=at.r,wt=at.s;if(yt.cmpn(1)<0||yt.cmp(this.n)>=0||wt.cmpn(1)<0||wt.cmp(this.n)>=0)return!1;var Ct=wt.invm(this.n),Pt=Ct.mul(ot).umod(this.n),$t=Ct.mul(yt).umod(this.n),Mt;return this.curve._maxwellTrick?(Mt=this.g.jmulAdd(Pt,ut.getPublic(),$t),Mt.isInfinity()?!1:Mt.eqXToP(yt)):(Mt=this.g.mulAdd(Pt,ut.getPublic(),$t),Mt.isInfinity()?!1:Mt.getX().umod(this.n).cmp(yt)===0)},it.prototype.recoverPubKey=function(st,ot,at,ut){tt((3&at)===at,"The recovery param is more than two bits"),ot=new nt(ot,ut);var ht=this.n,yt=new a(st),wt=ot.r,Ct=ot.s,Pt=at&1,$t=at>>1;if(wt.cmp(this.curve.p.umod(this.curve.n))>=0&&$t)throw new Error("Unable to find sencond key candinate");$t?wt=this.curve.pointFromX(wt.add(this.curve.n),Pt):wt=this.curve.pointFromX(wt,Pt);var Mt=ot.r.invm(ht),Bt=ht.sub(yt).mul(Mt).umod(ht),Dt=Ct.mul(Mt).umod(ht);return this.g.mulAdd(Bt,wt,Dt)},it.prototype.getKeyRecoveryParam=function(st,ot,at,ut){if(ot=new nt(ot,ut),ot.recoveryParam!==null)return ot.recoveryParam;for(var ht=0;ht<4;ht++){var yt;try{yt=this.recoverPubKey(st,ot,ht)}catch{continue}if(yt.eq(at))return ht}throw new Error("Unable to find valid recovery factor")},ec$4}var key$2,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key$2;hasRequiredKey=1;var a=requireUtils(),_=a.assert,$=a.parseBytes,j=a.cachedProperty;function et(tt,rt){this.eddsa=tt,this._secret=$(rt.secret),tt.isPoint(rt.pub)?this._pub=rt.pub:this._pubBytes=$(rt.pub)}return et.fromPublic=function(rt,nt){return nt instanceof et?nt:new et(rt,{pub:nt})},et.fromSecret=function(rt,nt){return nt instanceof et?nt:new et(rt,{secret:nt})},et.prototype.secret=function(){return this._secret},j(et,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),j(et,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),j(et,"privBytes",function(){var rt=this.eddsa,nt=this.hash(),it=rt.encodingLength-1,st=nt.slice(0,rt.encodingLength);return st[0]&=248,st[it]&=127,st[it]|=64,st}),j(et,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),j(et,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),j(et,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),et.prototype.sign=function(rt){return _(this._secret,"KeyPair can only verify"),this.eddsa.sign(rt,this)},et.prototype.verify=function(rt,nt){return this.eddsa.verify(rt,nt,this)},et.prototype.getSecret=function(rt){return _(this._secret,"KeyPair is public only"),a.encode(this.secret(),rt)},et.prototype.getPublic=function(rt){return a.encode(this.pubBytes(),rt)},key$2=et,key$2}var signature$2,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature$2;hasRequiredSignature=1;var a=bnExports$1,_=requireUtils(),$=_.assert,j=_.cachedProperty,et=_.parseBytes;function tt(rt,nt){this.eddsa=rt,typeof nt!="object"&&(nt=et(nt)),Array.isArray(nt)&&(nt={R:nt.slice(0,rt.encodingLength),S:nt.slice(rt.encodingLength)}),$(nt.R&&nt.S,"Signature without R or S"),rt.isPoint(nt.R)&&(this._R=nt.R),nt.S instanceof a&&(this._S=nt.S),this._Rencoded=Array.isArray(nt.R)?nt.R:nt.Rencoded,this._Sencoded=Array.isArray(nt.S)?nt.S:nt.Sencoded}return j(tt,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),j(tt,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),j(tt,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),j(tt,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),tt.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},tt.prototype.toHex=function(){return _.encode(this.toBytes(),"hex").toUpperCase()},signature$2=tt,signature$2}var eddsa$1,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa$1;hasRequiredEddsa=1;var a=hash$4,_=requireCurves(),$=requireUtils(),j=$.assert,et=$.parseBytes,tt=requireKey(),rt=requireSignature();function nt(it){if(j(it==="ed25519","only tested with ed25519 so far"),!(this instanceof nt))return new nt(it);it=_[it].curve,this.curve=it,this.g=it.g,this.g.precompute(it.n.bitLength()+1),this.pointClass=it.point().constructor,this.encodingLength=Math.ceil(it.n.bitLength()/8),this.hash=a.sha512}return eddsa$1=nt,nt.prototype.sign=function(st,ot){st=et(st);var at=this.keyFromSecret(ot),ut=this.hashInt(at.messagePrefix(),st),ht=this.g.mul(ut),yt=this.encodePoint(ht),wt=this.hashInt(yt,at.pubBytes(),st).mul(at.priv()),Ct=ut.add(wt).umod(this.curve.n);return this.makeSignature({R:ht,S:Ct,Rencoded:yt})},nt.prototype.verify=function(st,ot,at){st=et(st),ot=this.makeSignature(ot);var ut=this.keyFromPublic(at),ht=this.hashInt(ot.Rencoded(),ut.pubBytes(),st),yt=this.g.mul(ot.S()),wt=ot.R().add(ut.pub().mul(ht));return wt.eq(yt)},nt.prototype.hashInt=function(){for(var st=this.hash(),ot=0;ot=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return wt?nt($t,Pt):rt($t,Pt)};function st(ut,ht){var yt=ut.modulus.byteLength(),wt=ht.length,Ct=$("sha1").update(it.alloc(0)).digest(),Pt=Ct.length,$t=2*Pt;if(wt>yt-$t-2)throw new Error("message too long");var Mt=it.alloc(yt-wt-$t-2),Bt=yt-Pt-1,Dt=_(Pt),zt=et(it.concat([Ct,Mt,it.alloc(1,1),ht],Bt),j(Dt,Bt)),Ot=et(Dt,j(zt,Pt));return new tt(it.concat([it.alloc(1),Ot,zt],yt))}function ot(ut,ht,yt){var wt=ht.length,Ct=ut.modulus.byteLength();if(wt>Ct-11)throw new Error("message too long");var Pt;return yt?Pt=it.alloc(Ct-wt-3,255):Pt=at(Ct-wt-3),new tt(it.concat([it.from([0,yt?1:2]),Pt,it.alloc(1),ht],Ct))}function at(ut){for(var ht=it.allocUnsafe(ut),yt=0,wt=_(ut*2),Ct=0,Pt;ytPt||new j(ht).cmp(Ct.modulus)>=0)throw new Error("decryption error");var $t;yt?$t=rt(new j(ht),Ct):$t=et(ht,Ct);var Mt=nt.alloc(Pt-$t.length);if($t=nt.concat([Mt,$t],Pt),wt===4)return it(Ct,$t);if(wt===1)return st(Ct,$t,yt);if(wt===3)return $t;throw new Error("unknown padding")};function it(at,ut){var ht=at.modulus.byteLength(),yt=tt("sha1").update(nt.alloc(0)).digest(),wt=yt.length;if(ut[0]!==0)throw new Error("decryption error");var Ct=ut.slice(1,wt+1),Pt=ut.slice(wt+1),$t=$(Ct,_(Pt,wt)),Mt=$(Pt,_($t,ht-wt-1));if(ot(yt,Mt.slice(0,wt)))throw new Error("decryption error");for(var Bt=wt;Mt[Bt]===0;)Bt++;if(Mt[Bt++]!==1)throw new Error("decryption error");return Mt.slice(Bt)}function st(at,ut,ht){for(var yt=ut.slice(0,2),wt=2,Ct=0;ut[wt++]!==0;)if(wt>=ut.length){Ct++;break}var Pt=ut.slice(2,wt-1);if((yt.toString("hex")!=="0002"&&!ht||yt.toString("hex")!=="0001"&&ht)&&Ct++,Pt.length<8&&Ct++,Ct)throw new Error("decryption error");return ut.slice(wt)}function ot(at,ut){at=nt.from(at),ut=nt.from(ut);var ht=0,yt=at.length;at.length!==ut.length&&(ht++,yt=Math.min(at.length,ut.length));for(var wt=-1;++wtrt||ut<0)throw new TypeError("offset must be a uint32");if(ut>et||ut>ht)throw new RangeError("offset out of range")}function it(ut,ht,yt){if(typeof ut!="number"||ut!==ut)throw new TypeError("size must be a number");if(ut>rt||ut<0)throw new TypeError("size must be a uint32");if(ut+ht>yt||ut>et)throw new RangeError("buffer too small")}tt&&tt.getRandomValues||!process$1$1.browser?(browser.randomFill=st,browser.randomFillSync=at):(browser.randomFill=a,browser.randomFillSync=a);function st(ut,ht,yt,wt){if(!j.isBuffer(ut)&&!(ut instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof ht=="function")wt=ht,ht=0,yt=ut.length;else if(typeof yt=="function")wt=yt,yt=ut.length-ht;else if(typeof wt!="function")throw new TypeError('"cb" argument must be a function');return nt(ht,ut.length),it(yt,ht,ut.length),ot(ut,ht,yt,wt)}function ot(ut,ht,yt,wt){if(process$1$1.browser){var Ct=ut.buffer,Pt=new Uint8Array(Ct,ht,yt);if(tt.getRandomValues(Pt),wt){process$1$1.nextTick(function(){wt(null,ut)});return}return ut}if(wt){$(yt,function(Mt,Bt){if(Mt)return wt(Mt);Bt.copy(ut,ht),wt(null,ut)});return}var $t=$(yt);return $t.copy(ut,ht),ut}function at(ut,ht,yt){if(typeof ht>"u"&&(ht=0),!j.isBuffer(ut)&&!(ut instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return nt(ht,ut.length),yt===void 0&&(yt=ut.length-ht),it(yt,ht,ut.length),ot(ut,ht,yt)}return browser}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$8(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=browser$b,cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$7();var a=requireAlgos(),_=Object.keys(a),$=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(_);cryptoBrowserify.getHashes=function(){return $};var j=browser$7;cryptoBrowserify.pbkdf2=j.pbkdf2,cryptoBrowserify.pbkdf2Sync=j.pbkdf2Sync;var et=requireBrowser$5();cryptoBrowserify.Cipher=et.Cipher,cryptoBrowserify.createCipher=et.createCipher,cryptoBrowserify.Cipheriv=et.Cipheriv,cryptoBrowserify.createCipheriv=et.createCipheriv,cryptoBrowserify.Decipher=et.Decipher,cryptoBrowserify.createDecipher=et.createDecipher,cryptoBrowserify.Decipheriv=et.Decipheriv,cryptoBrowserify.createDecipheriv=et.createDecipheriv,cryptoBrowserify.getCiphers=et.getCiphers,cryptoBrowserify.listCiphers=et.listCiphers;var tt=requireBrowser$4();cryptoBrowserify.DiffieHellmanGroup=tt.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=tt.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=tt.getDiffieHellman,cryptoBrowserify.createDiffieHellman=tt.createDiffieHellman,cryptoBrowserify.DiffieHellman=tt.DiffieHellman;var rt=requireBrowser$3();cryptoBrowserify.createSign=rt.createSign,cryptoBrowserify.Sign=rt.Sign,cryptoBrowserify.createVerify=rt.createVerify,cryptoBrowserify.Verify=rt.Verify,cryptoBrowserify.createECDH=requireBrowser$2();var nt=requireBrowser$1();cryptoBrowserify.publicEncrypt=nt.publicEncrypt,cryptoBrowserify.privateEncrypt=nt.privateEncrypt,cryptoBrowserify.publicDecrypt=nt.publicDecrypt,cryptoBrowserify.privateDecrypt=nt.privateDecrypt;var it=requireBrowser();return cryptoBrowserify.randomFill=it.randomFill,cryptoBrowserify.randomFillSync=it.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` -`))},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}Object.defineProperty(node$2,"__esModule",{value:!0});node$2.NodeRandomSource=void 0;const wipe_1$4=wipe$1;class NodeRandomSource{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof commonjsRequire<"u"){const _=requireCryptoBrowserify();_&&_.randomBytes&&(this._crypto=_,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(_){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let $=this._crypto.randomBytes(_);if($.length!==_)throw new Error("NodeRandomSource: got fewer bytes than requested");const j=new Uint8Array(_);for(let et=0;et>>16&65535,ot=nt&65535,at=it>>>16&65535,ut=it&65535;return ot*ut+(st*ut+ot*at<<16>>>0)|0}a.mul=Math.imul||_;function $(nt,it){return nt+it|0}a.add=$;function j(nt,it){return nt-it|0}a.sub=j;function et(nt,it){return nt<>>32-it}a.rotl=et;function tt(nt,it){return nt<<32-it|nt>>>it}a.rotr=tt;function rt(nt){return typeof nt=="number"&&isFinite(nt)&&Math.floor(nt)===nt}a.isInteger=Number.isInteger||rt,a.MAX_SAFE_INTEGER=9007199254740991,a.isSafeInteger=function(nt){return a.isInteger(nt)&&nt>=-a.MAX_SAFE_INTEGER&&nt<=a.MAX_SAFE_INTEGER}})(int);Object.defineProperty(binary,"__esModule",{value:!0});var int_1=int;function readInt16BE(a,_){return _===void 0&&(_=0),(a[_+0]<<8|a[_+1])<<16>>16}binary.readInt16BE=readInt16BE;function readUint16BE(a,_){return _===void 0&&(_=0),(a[_+0]<<8|a[_+1])>>>0}binary.readUint16BE=readUint16BE;function readInt16LE(a,_){return _===void 0&&(_=0),(a[_+1]<<8|a[_])<<16>>16}binary.readInt16LE=readInt16LE;function readUint16LE(a,_){return _===void 0&&(_=0),(a[_+1]<<8|a[_])>>>0}binary.readUint16LE=readUint16LE;function writeUint16BE(a,_,$){return _===void 0&&(_=new Uint8Array(2)),$===void 0&&($=0),_[$+0]=a>>>8,_[$+1]=a>>>0,_}binary.writeUint16BE=writeUint16BE;binary.writeInt16BE=writeUint16BE;function writeUint16LE(a,_,$){return _===void 0&&(_=new Uint8Array(2)),$===void 0&&($=0),_[$+0]=a>>>0,_[$+1]=a>>>8,_}binary.writeUint16LE=writeUint16LE;binary.writeInt16LE=writeUint16LE;function readInt32BE(a,_){return _===void 0&&(_=0),a[_]<<24|a[_+1]<<16|a[_+2]<<8|a[_+3]}binary.readInt32BE=readInt32BE;function readUint32BE(a,_){return _===void 0&&(_=0),(a[_]<<24|a[_+1]<<16|a[_+2]<<8|a[_+3])>>>0}binary.readUint32BE=readUint32BE;function readInt32LE(a,_){return _===void 0&&(_=0),a[_+3]<<24|a[_+2]<<16|a[_+1]<<8|a[_]}binary.readInt32LE=readInt32LE;function readUint32LE(a,_){return _===void 0&&(_=0),(a[_+3]<<24|a[_+2]<<16|a[_+1]<<8|a[_])>>>0}binary.readUint32LE=readUint32LE;function writeUint32BE(a,_,$){return _===void 0&&(_=new Uint8Array(4)),$===void 0&&($=0),_[$+0]=a>>>24,_[$+1]=a>>>16,_[$+2]=a>>>8,_[$+3]=a>>>0,_}binary.writeUint32BE=writeUint32BE;binary.writeInt32BE=writeUint32BE;function writeUint32LE(a,_,$){return _===void 0&&(_=new Uint8Array(4)),$===void 0&&($=0),_[$+0]=a>>>0,_[$+1]=a>>>8,_[$+2]=a>>>16,_[$+3]=a>>>24,_}binary.writeUint32LE=writeUint32LE;binary.writeInt32LE=writeUint32LE;function readInt64BE(a,_){_===void 0&&(_=0);var $=readInt32BE(a,_),j=readInt32BE(a,_+4);return $*4294967296+j-(j>>31)*4294967296}binary.readInt64BE=readInt64BE;function readUint64BE(a,_){_===void 0&&(_=0);var $=readUint32BE(a,_),j=readUint32BE(a,_+4);return $*4294967296+j}binary.readUint64BE=readUint64BE;function readInt64LE(a,_){_===void 0&&(_=0);var $=readInt32LE(a,_),j=readInt32LE(a,_+4);return j*4294967296+$-($>>31)*4294967296}binary.readInt64LE=readInt64LE;function readUint64LE(a,_){_===void 0&&(_=0);var $=readUint32LE(a,_),j=readUint32LE(a,_+4);return j*4294967296+$}binary.readUint64LE=readUint64LE;function writeUint64BE(a,_,$){return _===void 0&&(_=new Uint8Array(8)),$===void 0&&($=0),writeUint32BE(a/4294967296>>>0,_,$),writeUint32BE(a>>>0,_,$+4),_}binary.writeUint64BE=writeUint64BE;binary.writeInt64BE=writeUint64BE;function writeUint64LE(a,_,$){return _===void 0&&(_=new Uint8Array(8)),$===void 0&&($=0),writeUint32LE(a>>>0,_,$),writeUint32LE(a/4294967296>>>0,_,$+4),_}binary.writeUint64LE=writeUint64LE;binary.writeInt64LE=writeUint64LE;function readUintBE(a,_,$){if($===void 0&&($=0),a%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(a/8>_.length-$)throw new Error("readUintBE: array is too short for the given bitLength");for(var j=0,et=1,tt=a/8+$-1;tt>=$;tt--)j+=_[tt]*et,et*=256;return j}binary.readUintBE=readUintBE;function readUintLE(a,_,$){if($===void 0&&($=0),a%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(a/8>_.length-$)throw new Error("readUintLE: array is too short for the given bitLength");for(var j=0,et=1,tt=$;tt<$+a/8;tt++)j+=_[tt]*et,et*=256;return j}binary.readUintLE=readUintLE;function writeUintBE(a,_,$,j){if($===void 0&&($=new Uint8Array(a/8)),j===void 0&&(j=0),a%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(_))throw new Error("writeUintBE value must be an integer");for(var et=1,tt=a/8+j-1;tt>=j;tt--)$[tt]=_/et&255,et*=256;return $}binary.writeUintBE=writeUintBE;function writeUintLE(a,_,$,j){if($===void 0&&($=new Uint8Array(a/8)),j===void 0&&(j=0),a%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(_))throw new Error("writeUintLE value must be an integer");for(var et=1,tt=j;tt256)throw new Error("randomString charset is too long");let ut="";const ht=ot.length,yt=256-256%ht;for(;st>0;){const wt=et(Math.ceil(st*256/yt),at);for(let Ct=0;Ct0;Ct++){const Pt=wt[Ct];Pt>16&1),zt[Ft-1]&=65535;zt[15]=Ot[15]-32767-(zt[14]>>16&1);const Lt=zt[15]>>16&1;zt[14]&=65535,nt(Ot,zt,1-Lt)}for(let It=0;It<16;It++)Bt[2*It]=Ot[It]&255,Bt[2*It+1]=Ot[It]>>8}function st(Bt,Dt){for(let zt=0;zt<16;zt++)Bt[zt]=Dt[2*zt]+(Dt[2*zt+1]<<8);Bt[15]&=32767}function ot(Bt,Dt,zt){for(let Ot=0;Ot<16;Ot++)Bt[Ot]=Dt[Ot]+zt[Ot]}function at(Bt,Dt,zt){for(let Ot=0;Ot<16;Ot++)Bt[Ot]=Dt[Ot]-zt[Ot]}function ut(Bt,Dt,zt){let Ot,It,Lt=0,Ft=0,jt=0,bt=0,vt=0,ct=0,dt=0,mt=0,xt=0,At=0,Rt=0,St=0,Tt=0,Et=0,Nt=0,tr=0,ir=0,nr=0,Zt=0,Kt=0,Qt=0,Ht=0,qt=0,Jt=0,ur=0,xr=0,pr=0,Cr=0,Mr=0,lr=0,fr=0,_r=zt[0],Rr=zt[1],kr=zt[2],Ar=zt[3],Pr=zt[4],Or=zt[5],Br=zt[6],or=zt[7],Yt=zt[8],er=zt[9],Gt=zt[10],Vt=zt[11],Wt=zt[12],ar=zt[13],yr=zt[14],Er=zt[15];Ot=Dt[0],Lt+=Ot*_r,Ft+=Ot*Rr,jt+=Ot*kr,bt+=Ot*Ar,vt+=Ot*Pr,ct+=Ot*Or,dt+=Ot*Br,mt+=Ot*or,xt+=Ot*Yt,At+=Ot*er,Rt+=Ot*Gt,St+=Ot*Vt,Tt+=Ot*Wt,Et+=Ot*ar,Nt+=Ot*yr,tr+=Ot*Er,Ot=Dt[1],Ft+=Ot*_r,jt+=Ot*Rr,bt+=Ot*kr,vt+=Ot*Ar,ct+=Ot*Pr,dt+=Ot*Or,mt+=Ot*Br,xt+=Ot*or,At+=Ot*Yt,Rt+=Ot*er,St+=Ot*Gt,Tt+=Ot*Vt,Et+=Ot*Wt,Nt+=Ot*ar,tr+=Ot*yr,ir+=Ot*Er,Ot=Dt[2],jt+=Ot*_r,bt+=Ot*Rr,vt+=Ot*kr,ct+=Ot*Ar,dt+=Ot*Pr,mt+=Ot*Or,xt+=Ot*Br,At+=Ot*or,Rt+=Ot*Yt,St+=Ot*er,Tt+=Ot*Gt,Et+=Ot*Vt,Nt+=Ot*Wt,tr+=Ot*ar,ir+=Ot*yr,nr+=Ot*Er,Ot=Dt[3],bt+=Ot*_r,vt+=Ot*Rr,ct+=Ot*kr,dt+=Ot*Ar,mt+=Ot*Pr,xt+=Ot*Or,At+=Ot*Br,Rt+=Ot*or,St+=Ot*Yt,Tt+=Ot*er,Et+=Ot*Gt,Nt+=Ot*Vt,tr+=Ot*Wt,ir+=Ot*ar,nr+=Ot*yr,Zt+=Ot*Er,Ot=Dt[4],vt+=Ot*_r,ct+=Ot*Rr,dt+=Ot*kr,mt+=Ot*Ar,xt+=Ot*Pr,At+=Ot*Or,Rt+=Ot*Br,St+=Ot*or,Tt+=Ot*Yt,Et+=Ot*er,Nt+=Ot*Gt,tr+=Ot*Vt,ir+=Ot*Wt,nr+=Ot*ar,Zt+=Ot*yr,Kt+=Ot*Er,Ot=Dt[5],ct+=Ot*_r,dt+=Ot*Rr,mt+=Ot*kr,xt+=Ot*Ar,At+=Ot*Pr,Rt+=Ot*Or,St+=Ot*Br,Tt+=Ot*or,Et+=Ot*Yt,Nt+=Ot*er,tr+=Ot*Gt,ir+=Ot*Vt,nr+=Ot*Wt,Zt+=Ot*ar,Kt+=Ot*yr,Qt+=Ot*Er,Ot=Dt[6],dt+=Ot*_r,mt+=Ot*Rr,xt+=Ot*kr,At+=Ot*Ar,Rt+=Ot*Pr,St+=Ot*Or,Tt+=Ot*Br,Et+=Ot*or,Nt+=Ot*Yt,tr+=Ot*er,ir+=Ot*Gt,nr+=Ot*Vt,Zt+=Ot*Wt,Kt+=Ot*ar,Qt+=Ot*yr,Ht+=Ot*Er,Ot=Dt[7],mt+=Ot*_r,xt+=Ot*Rr,At+=Ot*kr,Rt+=Ot*Ar,St+=Ot*Pr,Tt+=Ot*Or,Et+=Ot*Br,Nt+=Ot*or,tr+=Ot*Yt,ir+=Ot*er,nr+=Ot*Gt,Zt+=Ot*Vt,Kt+=Ot*Wt,Qt+=Ot*ar,Ht+=Ot*yr,qt+=Ot*Er,Ot=Dt[8],xt+=Ot*_r,At+=Ot*Rr,Rt+=Ot*kr,St+=Ot*Ar,Tt+=Ot*Pr,Et+=Ot*Or,Nt+=Ot*Br,tr+=Ot*or,ir+=Ot*Yt,nr+=Ot*er,Zt+=Ot*Gt,Kt+=Ot*Vt,Qt+=Ot*Wt,Ht+=Ot*ar,qt+=Ot*yr,Jt+=Ot*Er,Ot=Dt[9],At+=Ot*_r,Rt+=Ot*Rr,St+=Ot*kr,Tt+=Ot*Ar,Et+=Ot*Pr,Nt+=Ot*Or,tr+=Ot*Br,ir+=Ot*or,nr+=Ot*Yt,Zt+=Ot*er,Kt+=Ot*Gt,Qt+=Ot*Vt,Ht+=Ot*Wt,qt+=Ot*ar,Jt+=Ot*yr,ur+=Ot*Er,Ot=Dt[10],Rt+=Ot*_r,St+=Ot*Rr,Tt+=Ot*kr,Et+=Ot*Ar,Nt+=Ot*Pr,tr+=Ot*Or,ir+=Ot*Br,nr+=Ot*or,Zt+=Ot*Yt,Kt+=Ot*er,Qt+=Ot*Gt,Ht+=Ot*Vt,qt+=Ot*Wt,Jt+=Ot*ar,ur+=Ot*yr,xr+=Ot*Er,Ot=Dt[11],St+=Ot*_r,Tt+=Ot*Rr,Et+=Ot*kr,Nt+=Ot*Ar,tr+=Ot*Pr,ir+=Ot*Or,nr+=Ot*Br,Zt+=Ot*or,Kt+=Ot*Yt,Qt+=Ot*er,Ht+=Ot*Gt,qt+=Ot*Vt,Jt+=Ot*Wt,ur+=Ot*ar,xr+=Ot*yr,pr+=Ot*Er,Ot=Dt[12],Tt+=Ot*_r,Et+=Ot*Rr,Nt+=Ot*kr,tr+=Ot*Ar,ir+=Ot*Pr,nr+=Ot*Or,Zt+=Ot*Br,Kt+=Ot*or,Qt+=Ot*Yt,Ht+=Ot*er,qt+=Ot*Gt,Jt+=Ot*Vt,ur+=Ot*Wt,xr+=Ot*ar,pr+=Ot*yr,Cr+=Ot*Er,Ot=Dt[13],Et+=Ot*_r,Nt+=Ot*Rr,tr+=Ot*kr,ir+=Ot*Ar,nr+=Ot*Pr,Zt+=Ot*Or,Kt+=Ot*Br,Qt+=Ot*or,Ht+=Ot*Yt,qt+=Ot*er,Jt+=Ot*Gt,ur+=Ot*Vt,xr+=Ot*Wt,pr+=Ot*ar,Cr+=Ot*yr,Mr+=Ot*Er,Ot=Dt[14],Nt+=Ot*_r,tr+=Ot*Rr,ir+=Ot*kr,nr+=Ot*Ar,Zt+=Ot*Pr,Kt+=Ot*Or,Qt+=Ot*Br,Ht+=Ot*or,qt+=Ot*Yt,Jt+=Ot*er,ur+=Ot*Gt,xr+=Ot*Vt,pr+=Ot*Wt,Cr+=Ot*ar,Mr+=Ot*yr,lr+=Ot*Er,Ot=Dt[15],tr+=Ot*_r,ir+=Ot*Rr,nr+=Ot*kr,Zt+=Ot*Ar,Kt+=Ot*Pr,Qt+=Ot*Or,Ht+=Ot*Br,qt+=Ot*or,Jt+=Ot*Yt,ur+=Ot*er,xr+=Ot*Gt,pr+=Ot*Vt,Cr+=Ot*Wt,Mr+=Ot*ar,lr+=Ot*yr,fr+=Ot*Er,Lt+=38*ir,Ft+=38*nr,jt+=38*Zt,bt+=38*Kt,vt+=38*Qt,ct+=38*Ht,dt+=38*qt,mt+=38*Jt,xt+=38*ur,At+=38*xr,Rt+=38*pr,St+=38*Cr,Tt+=38*Mr,Et+=38*lr,Nt+=38*fr,It=1,Ot=Lt+It+65535,It=Math.floor(Ot/65536),Lt=Ot-It*65536,Ot=Ft+It+65535,It=Math.floor(Ot/65536),Ft=Ot-It*65536,Ot=jt+It+65535,It=Math.floor(Ot/65536),jt=Ot-It*65536,Ot=bt+It+65535,It=Math.floor(Ot/65536),bt=Ot-It*65536,Ot=vt+It+65535,It=Math.floor(Ot/65536),vt=Ot-It*65536,Ot=ct+It+65535,It=Math.floor(Ot/65536),ct=Ot-It*65536,Ot=dt+It+65535,It=Math.floor(Ot/65536),dt=Ot-It*65536,Ot=mt+It+65535,It=Math.floor(Ot/65536),mt=Ot-It*65536,Ot=xt+It+65535,It=Math.floor(Ot/65536),xt=Ot-It*65536,Ot=At+It+65535,It=Math.floor(Ot/65536),At=Ot-It*65536,Ot=Rt+It+65535,It=Math.floor(Ot/65536),Rt=Ot-It*65536,Ot=St+It+65535,It=Math.floor(Ot/65536),St=Ot-It*65536,Ot=Tt+It+65535,It=Math.floor(Ot/65536),Tt=Ot-It*65536,Ot=Et+It+65535,It=Math.floor(Ot/65536),Et=Ot-It*65536,Ot=Nt+It+65535,It=Math.floor(Ot/65536),Nt=Ot-It*65536,Ot=tr+It+65535,It=Math.floor(Ot/65536),tr=Ot-It*65536,Lt+=It-1+37*(It-1),It=1,Ot=Lt+It+65535,It=Math.floor(Ot/65536),Lt=Ot-It*65536,Ot=Ft+It+65535,It=Math.floor(Ot/65536),Ft=Ot-It*65536,Ot=jt+It+65535,It=Math.floor(Ot/65536),jt=Ot-It*65536,Ot=bt+It+65535,It=Math.floor(Ot/65536),bt=Ot-It*65536,Ot=vt+It+65535,It=Math.floor(Ot/65536),vt=Ot-It*65536,Ot=ct+It+65535,It=Math.floor(Ot/65536),ct=Ot-It*65536,Ot=dt+It+65535,It=Math.floor(Ot/65536),dt=Ot-It*65536,Ot=mt+It+65535,It=Math.floor(Ot/65536),mt=Ot-It*65536,Ot=xt+It+65535,It=Math.floor(Ot/65536),xt=Ot-It*65536,Ot=At+It+65535,It=Math.floor(Ot/65536),At=Ot-It*65536,Ot=Rt+It+65535,It=Math.floor(Ot/65536),Rt=Ot-It*65536,Ot=St+It+65535,It=Math.floor(Ot/65536),St=Ot-It*65536,Ot=Tt+It+65535,It=Math.floor(Ot/65536),Tt=Ot-It*65536,Ot=Et+It+65535,It=Math.floor(Ot/65536),Et=Ot-It*65536,Ot=Nt+It+65535,It=Math.floor(Ot/65536),Nt=Ot-It*65536,Ot=tr+It+65535,It=Math.floor(Ot/65536),tr=Ot-It*65536,Lt+=It-1+37*(It-1),Bt[0]=Lt,Bt[1]=Ft,Bt[2]=jt,Bt[3]=bt,Bt[4]=vt,Bt[5]=ct,Bt[6]=dt,Bt[7]=mt,Bt[8]=xt,Bt[9]=At,Bt[10]=Rt,Bt[11]=St,Bt[12]=Tt,Bt[13]=Et,Bt[14]=Nt,Bt[15]=tr}function ht(Bt,Dt){ut(Bt,Dt,Dt)}function yt(Bt,Dt){const zt=j();for(let Ot=0;Ot<16;Ot++)zt[Ot]=Dt[Ot];for(let Ot=253;Ot>=0;Ot--)ht(zt,zt),Ot!==2&&Ot!==4&&ut(zt,zt,Dt);for(let Ot=0;Ot<16;Ot++)Bt[Ot]=zt[Ot]}function wt(Bt,Dt){const zt=new Uint8Array(32),Ot=new Float64Array(80),It=j(),Lt=j(),Ft=j(),jt=j(),bt=j(),vt=j();for(let xt=0;xt<31;xt++)zt[xt]=Bt[xt];zt[31]=Bt[31]&127|64,zt[0]&=248,st(Ot,Dt);for(let xt=0;xt<16;xt++)Lt[xt]=Ot[xt];It[0]=jt[0]=1;for(let xt=254;xt>=0;--xt){const At=zt[xt>>>3]>>>(xt&7)&1;nt(It,Lt,At),nt(Ft,jt,At),ot(bt,It,Ft),at(It,It,Ft),ot(Ft,Lt,jt),at(Lt,Lt,jt),ht(jt,bt),ht(vt,It),ut(It,Ft,It),ut(Ft,Lt,bt),ot(bt,It,Ft),at(It,It,Ft),ht(Lt,It),at(Ft,jt,vt),ut(It,Ft,tt),ot(It,It,jt),ut(Ft,Ft,It),ut(It,jt,vt),ut(jt,Lt,Ot),ht(Lt,bt),nt(It,Lt,At),nt(Ft,jt,At)}for(let xt=0;xt<16;xt++)Ot[xt+16]=It[xt],Ot[xt+32]=Ft[xt],Ot[xt+48]=Lt[xt],Ot[xt+64]=jt[xt];const ct=Ot.subarray(32),dt=Ot.subarray(16);yt(ct,ct),ut(dt,dt,ct);const mt=new Uint8Array(32);return it(mt,dt),mt}a.scalarMult=wt;function Ct(Bt){return wt(Bt,et)}a.scalarMultBase=Ct;function Pt(Bt){if(Bt.length!==a.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${a.SECRET_KEY_LENGTH} bytes`);const Dt=new Uint8Array(Bt);return{publicKey:Ct(Dt),secretKey:Dt}}a.generateKeyPairFromSeed=Pt;function $t(Bt){const Dt=(0,_.randomBytes)(32,Bt),zt=Pt(Dt);return(0,$.wipe)(Dt),zt}a.generateKeyPair=$t;function Mt(Bt,Dt,zt=!1){if(Bt.length!==a.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(Dt.length!==a.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const Ot=wt(Bt,Dt);if(zt){let It=0;for(let Lt=0;Lt>>25,Rt=Ot+Mt|0,jt^=Rt<<9|Rt>>>23,Rt=jt+Ot|0,dt^=Rt<<13|Rt>>>19,Rt=dt+jt|0,Mt^=Rt<<18|Rt>>>14,Rt=It+Bt|0,bt^=Rt<<7|Rt>>>25,Rt=bt+It|0,mt^=Rt<<9|Rt>>>23,Rt=mt+bt|0,Bt^=Rt<<13|Rt>>>19,Rt=Bt+mt|0,It^=Rt<<18|Rt>>>14,Rt=vt+Lt|0,xt^=Rt<<7|Rt>>>25,Rt=xt+vt|0,Dt^=Rt<<9|Rt>>>23,Rt=Dt+xt|0,Lt^=Rt<<13|Rt>>>19,Rt=Lt+Dt|0,vt^=Rt<<18|Rt>>>14,Rt=At+ct|0,zt^=Rt<<7|Rt>>>25,Rt=zt+At|0,Ft^=Rt<<9|Rt>>>23,Rt=Ft+zt|0,ct^=Rt<<13|Rt>>>19,Rt=ct+Ft|0,At^=Rt<<18|Rt>>>14,Rt=Mt+zt|0,Bt^=Rt<<7|Rt>>>25,Rt=Bt+Mt|0,Dt^=Rt<<9|Rt>>>23,Rt=Dt+Bt|0,zt^=Rt<<13|Rt>>>19,Rt=zt+Dt|0,Mt^=Rt<<18|Rt>>>14,Rt=It+Ot|0,Lt^=Rt<<7|Rt>>>25,Rt=Lt+It|0,Ft^=Rt<<9|Rt>>>23,Rt=Ft+Lt|0,Ot^=Rt<<13|Rt>>>19,Rt=Ot+Ft|0,It^=Rt<<18|Rt>>>14,Rt=vt+bt|0,ct^=Rt<<7|Rt>>>25,Rt=ct+vt|0,jt^=Rt<<9|Rt>>>23,Rt=jt+ct|0,bt^=Rt<<13|Rt>>>19,Rt=bt+jt|0,vt^=Rt<<18|Rt>>>14,Rt=At+xt|0,dt^=Rt<<7|Rt>>>25,Rt=dt+At|0,mt^=Rt<<9|Rt>>>23,Rt=mt+dt|0,xt^=Rt<<13|Rt>>>19,Rt=xt+mt|0,At^=Rt<<18|Rt>>>14;binary_1$1.writeUint32LE(Mt+j|0,a,0),binary_1$1.writeUint32LE(Bt+et|0,a,4),binary_1$1.writeUint32LE(Dt+tt|0,a,8),binary_1$1.writeUint32LE(zt+rt|0,a,12),binary_1$1.writeUint32LE(Ot+nt|0,a,16),binary_1$1.writeUint32LE(It+it|0,a,20),binary_1$1.writeUint32LE(Lt+st|0,a,24),binary_1$1.writeUint32LE(Ft+ot|0,a,28),binary_1$1.writeUint32LE(jt+at|0,a,32),binary_1$1.writeUint32LE(bt+ut|0,a,36),binary_1$1.writeUint32LE(vt+ht|0,a,40),binary_1$1.writeUint32LE(ct+yt|0,a,44),binary_1$1.writeUint32LE(dt+wt|0,a,48),binary_1$1.writeUint32LE(mt+Ct|0,a,52),binary_1$1.writeUint32LE(xt+Pt|0,a,56),binary_1$1.writeUint32LE(At+$t|0,a,60)}function streamXOR$1(a,_,$,j,et){if(et===void 0&&(et=0),a.length!==32)throw new Error("Salsa20: key size must be 32 bytes");if(j.length<$.length)throw new Error("Salsa20: destination is shorter than source");var tt,rt;if(et===0){if(_.length!==8)throw new Error("Salsa20 nonce must be 8 bytes");tt=new Uint8Array(16),tt.set(_),rt=_.length}else{if(_.length!==16)throw new Error("Salsa20 nonce with counter must be 16 bytes");tt=_,rt=16-et}for(var nt=new Uint8Array(64),it=0;it<$.length;it+=64){core(nt,tt,a);for(var st=it;st>>=8,_++;if(j>0)throw new Error("Salsa20: counter overflow")}Object.defineProperty(xsalsa20,"__esModule",{value:!0});var binary_1=binary,salsa20_1=salsa20,wipe_1$2=wipe$1;function streamXOR(a,_,$,j,et){if(et===void 0&&(et=0),et===0){if(_.length!==24)throw new Error("XSalsa20 nonce must be 24 bytes")}else if(_.length!==32)throw new Error("XSalsa20 nonce with counter must be 32 bytes");var tt=hsalsa(a,_.subarray(0,16),new Uint8Array(32)),rt=salsa20_1.streamXOR(tt,_.subarray(16),$,j,et);return wipe_1$2.wipe(tt),rt}xsalsa20.streamXOR=streamXOR;function stream(a,_,$,j){return j===void 0&&(j=0),wipe_1$2.wipe($),streamXOR(a,_,$,$,j)}xsalsa20.stream=stream;var ROUNDS=20;function hsalsa(a,_,$){for(var j=1634760805,et=a[3]<<24|a[2]<<16|a[1]<<8|a[0],tt=a[7]<<24|a[6]<<16|a[5]<<8|a[4],rt=a[11]<<24|a[10]<<16|a[9]<<8|a[8],nt=a[15]<<24|a[14]<<16|a[13]<<8|a[12],it=857760878,st=_[3]<<24|_[2]<<16|_[1]<<8|_[0],ot=_[7]<<24|_[6]<<16|_[5]<<8|_[4],at=_[11]<<24|_[10]<<16|_[9]<<8|_[8],ut=_[15]<<24|_[14]<<16|_[13]<<8|_[12],ht=2036477234,yt=a[19]<<24|a[18]<<16|a[17]<<8|a[16],wt=a[23]<<24|a[22]<<16|a[21]<<8|a[20],Ct=a[27]<<24|a[26]<<16|a[25]<<8|a[24],Pt=a[31]<<24|a[30]<<16|a[29]<<8|a[28],$t=1797285236,Mt,Bt=0;Bt>>25,Mt=nt+j|0,at^=Mt<<9|Mt>>>23,Mt=at+nt|0,wt^=Mt<<13|Mt>>>19,Mt=wt+at|0,j^=Mt<<18|Mt>>>14,Mt=it+et|0,ut^=Mt<<7|Mt>>>25,Mt=ut+it|0,Ct^=Mt<<9|Mt>>>23,Mt=Ct+ut|0,et^=Mt<<13|Mt>>>19,Mt=et+Ct|0,it^=Mt<<18|Mt>>>14,Mt=ht+st|0,Pt^=Mt<<7|Mt>>>25,Mt=Pt+ht|0,tt^=Mt<<9|Mt>>>23,Mt=tt+Pt|0,st^=Mt<<13|Mt>>>19,Mt=st+tt|0,ht^=Mt<<18|Mt>>>14,Mt=$t+yt|0,rt^=Mt<<7|Mt>>>25,Mt=rt+$t|0,ot^=Mt<<9|Mt>>>23,Mt=ot+rt|0,yt^=Mt<<13|Mt>>>19,Mt=yt+ot|0,$t^=Mt<<18|Mt>>>14,Mt=j+rt|0,et^=Mt<<7|Mt>>>25,Mt=et+j|0,tt^=Mt<<9|Mt>>>23,Mt=tt+et|0,rt^=Mt<<13|Mt>>>19,Mt=rt+tt|0,j^=Mt<<18|Mt>>>14,Mt=it+nt|0,st^=Mt<<7|Mt>>>25,Mt=st+it|0,ot^=Mt<<9|Mt>>>23,Mt=ot+st|0,nt^=Mt<<13|Mt>>>19,Mt=nt+ot|0,it^=Mt<<18|Mt>>>14,Mt=ht+ut|0,yt^=Mt<<7|Mt>>>25,Mt=yt+ht|0,at^=Mt<<9|Mt>>>23,Mt=at+yt|0,ut^=Mt<<13|Mt>>>19,Mt=ut+at|0,ht^=Mt<<18|Mt>>>14,Mt=$t+Pt|0,wt^=Mt<<7|Mt>>>25,Mt=wt+$t|0,Ct^=Mt<<9|Mt>>>23,Mt=Ct+wt|0,Pt^=Mt<<13|Mt>>>19,Mt=Pt+Ct|0,$t^=Mt<<18|Mt>>>14;return binary_1.writeUint32LE(j,$,0),binary_1.writeUint32LE(it,$,4),binary_1.writeUint32LE(ht,$,8),binary_1.writeUint32LE($t,$,12),binary_1.writeUint32LE(st,$,16),binary_1.writeUint32LE(ot,$,20),binary_1.writeUint32LE(at,$,24),binary_1.writeUint32LE(ut,$,28),$}xsalsa20.hsalsa=hsalsa;var secretbox={},poly1305={},constantTime={};Object.defineProperty(constantTime,"__esModule",{value:!0});function select(a,_,$){return~(a-1)&_|a-1&$}constantTime.select=select;function lessOrEqual(a,_){return(a|0)-(_|0)-1>>>31&1}constantTime.lessOrEqual=lessOrEqual;function compare$d(a,_){if(a.length!==_.length)return 0;for(var $=0,j=0;j>>8}constantTime.compare=compare$d;function equal(a,_){return a.length===0||_.length===0?!1:compare$d(a,_)!==0}constantTime.equal=equal;(function(a){Object.defineProperty(a,"__esModule",{value:!0});var _=constantTime,$=wipe$1;a.DIGEST_LENGTH=16;var j=function(){function rt(nt){this.digestLength=a.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var it=nt[0]|nt[1]<<8;this._r[0]=it&8191;var st=nt[2]|nt[3]<<8;this._r[1]=(it>>>13|st<<3)&8191;var ot=nt[4]|nt[5]<<8;this._r[2]=(st>>>10|ot<<6)&7939;var at=nt[6]|nt[7]<<8;this._r[3]=(ot>>>7|at<<9)&8191;var ut=nt[8]|nt[9]<<8;this._r[4]=(at>>>4|ut<<12)&255,this._r[5]=ut>>>1&8190;var ht=nt[10]|nt[11]<<8;this._r[6]=(ut>>>14|ht<<2)&8191;var yt=nt[12]|nt[13]<<8;this._r[7]=(ht>>>11|yt<<5)&8065;var wt=nt[14]|nt[15]<<8;this._r[8]=(yt>>>8|wt<<8)&8191,this._r[9]=wt>>>5&127,this._pad[0]=nt[16]|nt[17]<<8,this._pad[1]=nt[18]|nt[19]<<8,this._pad[2]=nt[20]|nt[21]<<8,this._pad[3]=nt[22]|nt[23]<<8,this._pad[4]=nt[24]|nt[25]<<8,this._pad[5]=nt[26]|nt[27]<<8,this._pad[6]=nt[28]|nt[29]<<8,this._pad[7]=nt[30]|nt[31]<<8}return rt.prototype._blocks=function(nt,it,st){for(var ot=this._fin?0:2048,at=this._h[0],ut=this._h[1],ht=this._h[2],yt=this._h[3],wt=this._h[4],Ct=this._h[5],Pt=this._h[6],$t=this._h[7],Mt=this._h[8],Bt=this._h[9],Dt=this._r[0],zt=this._r[1],Ot=this._r[2],It=this._r[3],Lt=this._r[4],Ft=this._r[5],jt=this._r[6],bt=this._r[7],vt=this._r[8],ct=this._r[9];st>=16;){var dt=nt[it+0]|nt[it+1]<<8;at+=dt&8191;var mt=nt[it+2]|nt[it+3]<<8;ut+=(dt>>>13|mt<<3)&8191;var xt=nt[it+4]|nt[it+5]<<8;ht+=(mt>>>10|xt<<6)&8191;var At=nt[it+6]|nt[it+7]<<8;yt+=(xt>>>7|At<<9)&8191;var Rt=nt[it+8]|nt[it+9]<<8;wt+=(At>>>4|Rt<<12)&8191,Ct+=Rt>>>1&8191;var St=nt[it+10]|nt[it+11]<<8;Pt+=(Rt>>>14|St<<2)&8191;var Tt=nt[it+12]|nt[it+13]<<8;$t+=(St>>>11|Tt<<5)&8191;var Et=nt[it+14]|nt[it+15]<<8;Mt+=(Tt>>>8|Et<<8)&8191,Bt+=Et>>>5|ot;var Nt=0,tr=Nt;tr+=at*Dt,tr+=ut*(5*ct),tr+=ht*(5*vt),tr+=yt*(5*bt),tr+=wt*(5*jt),Nt=tr>>>13,tr&=8191,tr+=Ct*(5*Ft),tr+=Pt*(5*Lt),tr+=$t*(5*It),tr+=Mt*(5*Ot),tr+=Bt*(5*zt),Nt+=tr>>>13,tr&=8191;var ir=Nt;ir+=at*zt,ir+=ut*Dt,ir+=ht*(5*ct),ir+=yt*(5*vt),ir+=wt*(5*bt),Nt=ir>>>13,ir&=8191,ir+=Ct*(5*jt),ir+=Pt*(5*Ft),ir+=$t*(5*Lt),ir+=Mt*(5*It),ir+=Bt*(5*Ot),Nt+=ir>>>13,ir&=8191;var nr=Nt;nr+=at*Ot,nr+=ut*zt,nr+=ht*Dt,nr+=yt*(5*ct),nr+=wt*(5*vt),Nt=nr>>>13,nr&=8191,nr+=Ct*(5*bt),nr+=Pt*(5*jt),nr+=$t*(5*Ft),nr+=Mt*(5*Lt),nr+=Bt*(5*It),Nt+=nr>>>13,nr&=8191;var Zt=Nt;Zt+=at*It,Zt+=ut*Ot,Zt+=ht*zt,Zt+=yt*Dt,Zt+=wt*(5*ct),Nt=Zt>>>13,Zt&=8191,Zt+=Ct*(5*vt),Zt+=Pt*(5*bt),Zt+=$t*(5*jt),Zt+=Mt*(5*Ft),Zt+=Bt*(5*Lt),Nt+=Zt>>>13,Zt&=8191;var Kt=Nt;Kt+=at*Lt,Kt+=ut*It,Kt+=ht*Ot,Kt+=yt*zt,Kt+=wt*Dt,Nt=Kt>>>13,Kt&=8191,Kt+=Ct*(5*ct),Kt+=Pt*(5*vt),Kt+=$t*(5*bt),Kt+=Mt*(5*jt),Kt+=Bt*(5*Ft),Nt+=Kt>>>13,Kt&=8191;var Qt=Nt;Qt+=at*Ft,Qt+=ut*Lt,Qt+=ht*It,Qt+=yt*Ot,Qt+=wt*zt,Nt=Qt>>>13,Qt&=8191,Qt+=Ct*Dt,Qt+=Pt*(5*ct),Qt+=$t*(5*vt),Qt+=Mt*(5*bt),Qt+=Bt*(5*jt),Nt+=Qt>>>13,Qt&=8191;var Ht=Nt;Ht+=at*jt,Ht+=ut*Ft,Ht+=ht*Lt,Ht+=yt*It,Ht+=wt*Ot,Nt=Ht>>>13,Ht&=8191,Ht+=Ct*zt,Ht+=Pt*Dt,Ht+=$t*(5*ct),Ht+=Mt*(5*vt),Ht+=Bt*(5*bt),Nt+=Ht>>>13,Ht&=8191;var qt=Nt;qt+=at*bt,qt+=ut*jt,qt+=ht*Ft,qt+=yt*Lt,qt+=wt*It,Nt=qt>>>13,qt&=8191,qt+=Ct*Ot,qt+=Pt*zt,qt+=$t*Dt,qt+=Mt*(5*ct),qt+=Bt*(5*vt),Nt+=qt>>>13,qt&=8191;var Jt=Nt;Jt+=at*vt,Jt+=ut*bt,Jt+=ht*jt,Jt+=yt*Ft,Jt+=wt*Lt,Nt=Jt>>>13,Jt&=8191,Jt+=Ct*It,Jt+=Pt*Ot,Jt+=$t*zt,Jt+=Mt*Dt,Jt+=Bt*(5*ct),Nt+=Jt>>>13,Jt&=8191;var ur=Nt;ur+=at*ct,ur+=ut*vt,ur+=ht*bt,ur+=yt*jt,ur+=wt*Ft,Nt=ur>>>13,ur&=8191,ur+=Ct*Lt,ur+=Pt*It,ur+=$t*Ot,ur+=Mt*zt,ur+=Bt*Dt,Nt+=ur>>>13,ur&=8191,Nt=(Nt<<2)+Nt|0,Nt=Nt+tr|0,tr=Nt&8191,Nt=Nt>>>13,ir+=Nt,at=tr,ut=ir,ht=nr,yt=Zt,wt=Kt,Ct=Qt,Pt=Ht,$t=qt,Mt=Jt,Bt=ur,it+=16,st-=16}this._h[0]=at,this._h[1]=ut,this._h[2]=ht,this._h[3]=yt,this._h[4]=wt,this._h[5]=Ct,this._h[6]=Pt,this._h[7]=$t,this._h[8]=Mt,this._h[9]=Bt},rt.prototype.finish=function(nt,it){it===void 0&&(it=0);var st=new Uint16Array(10),ot,at,ut,ht;if(this._leftover){for(ht=this._leftover,this._buffer[ht++]=1;ht<16;ht++)this._buffer[ht]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(ot=this._h[1]>>>13,this._h[1]&=8191,ht=2;ht<10;ht++)this._h[ht]+=ot,ot=this._h[ht]>>>13,this._h[ht]&=8191;for(this._h[0]+=ot*5,ot=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=ot,ot=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=ot,st[0]=this._h[0]+5,ot=st[0]>>>13,st[0]&=8191,ht=1;ht<10;ht++)st[ht]=this._h[ht]+ot,ot=st[ht]>>>13,st[ht]&=8191;for(st[9]-=8192,at=(ot^1)-1,ht=0;ht<10;ht++)st[ht]&=at;for(at=~at,ht=0;ht<10;ht++)this._h[ht]=this._h[ht]&at|st[ht];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,ut=this._h[0]+this._pad[0],this._h[0]=ut&65535,ht=1;ht<8;ht++)ut=(this._h[ht]+this._pad[ht]|0)+(ut>>>16)|0,this._h[ht]=ut&65535;return nt[it+0]=this._h[0]>>>0,nt[it+1]=this._h[0]>>>8,nt[it+2]=this._h[1]>>>0,nt[it+3]=this._h[1]>>>8,nt[it+4]=this._h[2]>>>0,nt[it+5]=this._h[2]>>>8,nt[it+6]=this._h[3]>>>0,nt[it+7]=this._h[3]>>>8,nt[it+8]=this._h[4]>>>0,nt[it+9]=this._h[4]>>>8,nt[it+10]=this._h[5]>>>0,nt[it+11]=this._h[5]>>>8,nt[it+12]=this._h[6]>>>0,nt[it+13]=this._h[6]>>>8,nt[it+14]=this._h[7]>>>0,nt[it+15]=this._h[7]>>>8,this._finished=!0,this},rt.prototype.update=function(nt){var it=0,st=nt.length,ot;if(this._leftover){ot=16-this._leftover,ot>st&&(ot=st);for(var at=0;at=16&&(ot=st-st%16,this._blocks(nt,it,ot),it+=ot,st-=ot),st){for(var at=0;at32&&(0,xsalsa20_1.streamXOR)(a,et,$.subarray(32),tt.subarray(48),8);const rt=(0,poly1305_1.oneTimeAuth)(j.subarray(0,32),tt.subarray(16));for(let nt=0;nt32&&(0,xsalsa20_1.streamXOR)(a,et,rt.subarray(32),nt.subarray(32),8),(0,wipe_1$1.wipe)(tt),(0,wipe_1$1.wipe)(j),(0,wipe_1$1.wipe)(et),nt}secretbox.openSecretBox=openSecretBox;function generateKey(a){return(0,random_1.randomBytes)(32,a)}secretbox.generateKey=generateKey;(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.openBox=a.box=a.precomputeSharedKey=a.generateKeyPair=void 0;const _=x25519,$=xsalsa20,j=secretbox,et=wipe$1;var tt=x25519;Object.defineProperty(a,"generateKeyPair",{enumerable:!0,get:function(){return tt.generateKeyPair}});const rt=new Uint8Array(16);function nt(ot,at){const ut=(0,_.scalarMult)(at,ot);return(0,$.hsalsa)(ut,rt,ut),ut}a.precomputeSharedKey=nt;function it(ot,at,ut,ht){const yt=nt(ot,at),wt=(0,j.secretBox)(yt,ut,ht);return(0,et.wipe)(yt),wt}a.box=it;function st(ot,at,ut,ht){const yt=nt(ot,at),wt=(0,j.openSecretBox)(yt,ut,ht);return(0,et.wipe)(yt),wt}a.openBox=st})(box);(function(a){var _=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(j,et,tt,rt){rt===void 0&&(rt=tt);var nt=Object.getOwnPropertyDescriptor(et,tt);(!nt||("get"in nt?!et.__esModule:nt.writable||nt.configurable))&&(nt={enumerable:!0,get:function(){return et[tt]}}),Object.defineProperty(j,rt,nt)}:function(j,et,tt,rt){rt===void 0&&(rt=tt),j[rt]=et[tt]}),$=commonjsGlobal&&commonjsGlobal.__exportStar||function(j,et){for(var tt in j)tt!=="default"&&!Object.prototype.hasOwnProperty.call(et,tt)&&_(et,j,tt)};Object.defineProperty(a,"__esModule",{value:!0}),$(box,a),$(secretbox,a)})(nacl);var utf8={};Object.defineProperty(utf8,"__esModule",{value:!0});var INVALID_UTF16="utf8: invalid string",INVALID_UTF8="utf8: invalid source encoding";function encode$7(a){for(var _=new Uint8Array(encodedLength(a)),$=0,j=0;j>6,_[$++]=128|et&63):et<55296?(_[$++]=224|et>>12,_[$++]=128|et>>6&63,_[$++]=128|et&63):(j++,et=(et&1023)<<10,et|=a.charCodeAt(j)&1023,et+=65536,_[$++]=240|et>>18,_[$++]=128|et>>12&63,_[$++]=128|et>>6&63,_[$++]=128|et&63)}return _}var encode_1=utf8.encode=encode$7;function encodedLength(a){for(var _=0,$=0;$=a.length-1)throw new Error(INVALID_UTF16);$++,_+=4}else throw new Error(INVALID_UTF16)}return _}utf8.encodedLength=encodedLength;function decode$3(a){for(var _=[],$=0;$=a.length)throw new Error(INVALID_UTF8);var tt=a[++$];if((tt&192)!==128)throw new Error(INVALID_UTF8);j=(j&31)<<6|tt&63,et=128}else if(j<240){if($>=a.length-1)throw new Error(INVALID_UTF8);var tt=a[++$],rt=a[++$];if((tt&192)!==128||(rt&192)!==128)throw new Error(INVALID_UTF8);j=(j&15)<<12|(tt&63)<<6|rt&63,et=2048}else if(j<248){if($>=a.length-2)throw new Error(INVALID_UTF8);var tt=a[++$],rt=a[++$],nt=a[++$];if((tt&192)!==128||(rt&192)!==128||(nt&192)!==128)throw new Error(INVALID_UTF8);j=(j&15)<<18|(tt&63)<<12|(rt&63)<<6|nt&63,et=65536}else throw new Error(INVALID_UTF8);if(j=55296&&j<=57343)throw new Error(INVALID_UTF8);if(j>=65536){if(j>1114111)throw new Error(INVALID_UTF8);j-=65536,_.push(String.fromCharCode(55296|j>>10)),j=56320|j&1023}}_.push(String.fromCharCode(j))}return _.join("")}utf8.decode=decode$3;var blake2b$1={};(function(a){Object.defineProperty(a,"__esModule",{value:!0});var _=binary,$=wipe$1;a.BLOCK_SIZE=128,a.DIGEST_LENGTH=64,a.KEY_LENGTH=64,a.PERSONALIZATION_LENGTH=16,a.SALT_LENGTH=16,a.MAX_LEAF_SIZE=Math.pow(2,32)-1,a.MAX_FANOUT=255,a.MAX_MAX_DEPTH=255;var j=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),et=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],tt=function(){function nt(it,st){if(it===void 0&&(it=64),this.digestLength=it,this.blockSize=a.BLOCK_SIZE,this._state=new Int32Array(j),this._buffer=new Uint8Array(a.BLOCK_SIZE),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),it<1||it>a.DIGEST_LENGTH)throw new Error("blake2b: wrong digest length");st&&this.validateConfig(st);var ot=0;st&&st.key&&(ot=st.key.length);var at=1,ut=1;st&&st.tree&&(at=st.tree.fanout,ut=st.tree.maxDepth),this._state[0]^=it|ot<<8|at<<16|ut<<24,st&&st.tree&&(this._state[1]^=st.tree.leafSize,this._state[2]^=st.tree.nodeOffsetLowBits,this._state[3]^=st.tree.nodeOffsetHighBits,this._state[4]^=st.tree.nodeDepth|st.tree.innerDigestLength<<8,this._lastNode=st.tree.lastNode),st&&st.salt&&(this._state[8]^=_.readUint32LE(st.salt,0),this._state[9]^=_.readUint32LE(st.salt,4),this._state[10]^=_.readUint32LE(st.salt,8),this._state[11]^=_.readUint32LE(st.salt,12)),st&&st.personalization&&(this._state[12]^=_.readUint32LE(st.personalization,0),this._state[13]^=_.readUint32LE(st.personalization,4),this._state[14]^=_.readUint32LE(st.personalization,8),this._state[15]^=_.readUint32LE(st.personalization,12)),this._initialState=new Uint32Array(this._state),st&&st.key&&ot>0&&(this._paddedKey=new Uint8Array(a.BLOCK_SIZE),this._paddedKey.set(st.key),this._buffer.set(this._paddedKey),this._bufferLength=a.BLOCK_SIZE)}return nt.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=a.BLOCK_SIZE):this._bufferLength=0,$.wipe(this._ctr),$.wipe(this._flag),this._finished=!1,this},nt.prototype.validateConfig=function(it){if(it.key&&it.key.length>a.KEY_LENGTH)throw new Error("blake2b: wrong key length");if(it.salt&&it.salt.length!==a.SALT_LENGTH)throw new Error("blake2b: wrong salt length");if(it.personalization&&it.personalization.length!==a.PERSONALIZATION_LENGTH)throw new Error("blake2b: wrong personalization length");if(it.tree){if(it.tree.fanout<0||it.tree.fanout>a.MAX_FANOUT)throw new Error("blake2b: wrong tree fanout");if(it.tree.maxDepth<0||it.tree.maxDepth>a.MAX_MAX_DEPTH)throw new Error("blake2b: wrong tree depth");if(it.tree.leafSize<0||it.tree.leafSize>a.MAX_LEAF_SIZE)throw new Error("blake2b: wrong leaf size");if(it.tree.innerDigestLength<0||it.tree.innerDigestLength>a.DIGEST_LENGTH)throw new Error("blake2b: wrong tree inner digest length")}},nt.prototype.update=function(it,st){if(st===void 0&&(st=it.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var ot=a.BLOCK_SIZE-this._bufferLength,at=0;if(st===0)return this;if(st>ot){for(var ut=0;uta.BLOCK_SIZE;){for(var ut=0;ut>>16,dt=zt&65535,mt=zt>>>16;vt+=Ot&65535,ct+=Ot>>>16,dt+=It&65535,mt+=It>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,zt=dt&65535|mt<<16,Dt=vt&65535|ct<<16,vt=Dt&65535,ct=Dt>>>16,dt=zt&65535,mt=zt>>>16,vt+=Pt&65535,ct+=Pt>>>16,dt+=$t&65535,mt+=$t>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,zt=dt&65535|mt<<16,Dt=vt&65535|ct<<16,jt^=Dt,bt^=zt,vt=bt,bt=jt,jt=vt,vt=Lt&65535,ct=Lt>>>16,dt=Ft&65535,mt=Ft>>>16,vt+=jt&65535,ct+=jt>>>16,dt+=bt&65535,mt+=bt>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,Ft=dt&65535|mt<<16,Lt=vt&65535|ct<<16,Ot^=Lt,It^=Ft,vt=Ot<<8|It>>>24,Ot=It<<8|Ot>>>24,It=vt,vt=Dt&65535,ct=Dt>>>16,dt=zt&65535,mt=zt>>>16,vt+=Ot&65535,ct+=Ot>>>16,dt+=It&65535,mt+=It>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,zt=dt&65535|mt<<16,Dt=vt&65535|ct<<16,vt=Dt&65535,ct=Dt>>>16,dt=zt&65535,mt=zt>>>16,vt+=Mt&65535,ct+=Mt>>>16,dt+=Bt&65535,mt+=Bt>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,zt=dt&65535|mt<<16,Dt=vt&65535|ct<<16,jt^=Dt,bt^=zt,vt=jt<<16|bt>>>16,jt=bt<<16|jt>>>16,bt=vt,vt=Lt&65535,ct=Lt>>>16,dt=Ft&65535,mt=Ft>>>16,vt+=jt&65535,ct+=jt>>>16,dt+=bt&65535,mt+=bt>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,Ft=dt&65535|mt<<16,Lt=vt&65535|ct<<16,Ot^=Lt,It^=Ft,vt=It<<1|Ot>>>31,Ot=Ot<<1|It>>>31,It=vt,it[st]=Dt,it[ht]=zt,it[ot]=Ot,it[yt]=It,it[at]=Lt,it[wt]=Ft,it[ut]=jt,it[Ct]=bt},nt.prototype._incrementCounter=function(it){for(var st=0;st<3;st++){var ot=this._ctr[st]+it;if(this._ctr[st]=ot>>>0,this._ctr[st]===ot)return;it=1}},nt.prototype._processBlock=function(it){this._incrementCounter(it);var st=this._vtmp;st.set(this._state),st.set(j,16),st[12*2+0]^=this._ctr[0],st[12*2+1]^=this._ctr[1],st[13*2+0]^=this._ctr[2],st[13*2+1]^=this._ctr[3],st[14*2+0]^=this._flag[0],st[14*2+1]^=this._flag[1],st[15*2+0]^=this._flag[2],st[15*2+1]^=this._flag[3];for(var ot=this._mtmp,at=0;at<32;at++)ot[at]=_.readUint32LE(this._buffer,at*4);for(var ut=0;ut<12;ut++)this._G(st,0,8,16,24,1,9,17,25,ot[et[ut][0]],ot[et[ut][0]+1],ot[et[ut][1]],ot[et[ut][1]+1]),this._G(st,2,10,18,26,3,11,19,27,ot[et[ut][2]],ot[et[ut][2]+1],ot[et[ut][3]],ot[et[ut][3]+1]),this._G(st,4,12,20,28,5,13,21,29,ot[et[ut][4]],ot[et[ut][4]+1],ot[et[ut][5]],ot[et[ut][5]+1]),this._G(st,6,14,22,30,7,15,23,31,ot[et[ut][6]],ot[et[ut][6]+1],ot[et[ut][7]],ot[et[ut][7]+1]),this._G(st,0,10,20,30,1,11,21,31,ot[et[ut][8]],ot[et[ut][8]+1],ot[et[ut][9]],ot[et[ut][9]+1]),this._G(st,2,12,22,24,3,13,23,25,ot[et[ut][10]],ot[et[ut][10]+1],ot[et[ut][11]],ot[et[ut][11]+1]),this._G(st,4,14,16,26,5,15,17,27,ot[et[ut][12]],ot[et[ut][12]+1],ot[et[ut][13]],ot[et[ut][13]+1]),this._G(st,6,8,18,28,7,9,19,29,ot[et[ut][14]],ot[et[ut][14]+1],ot[et[ut][15]],ot[et[ut][15]+1]);for(var at=0;at<16;at++)this._state[at]^=st[at]^st[at+16]},nt}();a.BLAKE2b=tt;function rt(nt,it,st){it===void 0&&(it=a.DIGEST_LENGTH);var ot=new tt(it,st);ot.update(nt);var at=ot.digest();return ot.clean(),at}a.hash=rt})(blake2b$1);var ed25519={},sha512$2={};(function(a){Object.defineProperty(a,"__esModule",{value:!0});var _=binary,$=wipe$1;a.DIGEST_LENGTH=64,a.BLOCK_SIZE=128;var j=function(){function nt(){this.digestLength=a.DIGEST_LENGTH,this.blockSize=a.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return nt.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},nt.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},nt.prototype.clean=function(){$.wipe(this._buffer),$.wipe(this._tempHi),$.wipe(this._tempLo),this.reset()},nt.prototype.update=function(it,st){if(st===void 0&&(st=it.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var ot=0;if(this._bytesHashed+=st,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=it[ot++],st--;this._bufferLength===this.blockSize&&(tt(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(st>=this.blockSize&&(ot=tt(this._tempHi,this._tempLo,this._stateHi,this._stateLo,it,ot,st),st%=this.blockSize);st>0;)this._buffer[this._bufferLength++]=it[ot++],st--;return this},nt.prototype.finish=function(it){if(!this._finished){var st=this._bytesHashed,ot=this._bufferLength,at=st/536870912|0,ut=st<<3,ht=st%128<112?128:256;this._buffer[ot]=128;for(var yt=ot+1;yt0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},nt.prototype.restoreState=function(it){return this._stateHi.set(it.stateHi),this._stateLo.set(it.stateLo),this._bufferLength=it.bufferLength,it.buffer&&this._buffer.set(it.buffer),this._bytesHashed=it.bytesHashed,this._finished=!1,this},nt.prototype.cleanSavedState=function(it){$.wipe(it.stateHi),$.wipe(it.stateLo),it.buffer&&$.wipe(it.buffer),it.bufferLength=0,it.bytesHashed=0},nt}();a.SHA512=j;var et=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function tt(nt,it,st,ot,at,ut,ht){for(var yt=st[0],wt=st[1],Ct=st[2],Pt=st[3],$t=st[4],Mt=st[5],Bt=st[6],Dt=st[7],zt=ot[0],Ot=ot[1],It=ot[2],Lt=ot[3],Ft=ot[4],jt=ot[5],bt=ot[6],vt=ot[7],ct,dt,mt,xt,At,Rt,St,Tt;ht>=128;){for(var Et=0;Et<16;Et++){var Nt=8*Et+ut;nt[Et]=_.readUint32BE(at,Nt),it[Et]=_.readUint32BE(at,Nt+4)}for(var Et=0;Et<80;Et++){var tr=yt,ir=wt,nr=Ct,Zt=Pt,Kt=$t,Qt=Mt,Ht=Bt,qt=Dt,Jt=zt,ur=Ot,xr=It,pr=Lt,Cr=Ft,Mr=jt,lr=bt,fr=vt;if(ct=Dt,dt=vt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=($t>>>14|Ft<<18)^($t>>>18|Ft<<14)^(Ft>>>9|$t<<23),dt=(Ft>>>14|$t<<18)^(Ft>>>18|$t<<14)^($t>>>9|Ft<<23),At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,ct=$t&Mt^~$t&Bt,dt=Ft&jt^~Ft&bt,At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,ct=et[Et*2],dt=et[Et*2+1],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,ct=nt[Et%16],dt=it[Et%16],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,mt=St&65535|Tt<<16,xt=At&65535|Rt<<16,ct=mt,dt=xt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=(yt>>>28|zt<<4)^(zt>>>2|yt<<30)^(zt>>>7|yt<<25),dt=(zt>>>28|yt<<4)^(yt>>>2|zt<<30)^(yt>>>7|zt<<25),At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,ct=yt&wt^yt&Ct^wt&Ct,dt=zt&Ot^zt&It^Ot&It,At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,qt=St&65535|Tt<<16,fr=At&65535|Rt<<16,ct=Zt,dt=pr,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=mt,dt=xt,At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,Zt=St&65535|Tt<<16,pr=At&65535|Rt<<16,wt=tr,Ct=ir,Pt=nr,$t=Zt,Mt=Kt,Bt=Qt,Dt=Ht,yt=qt,Ot=Jt,It=ur,Lt=xr,Ft=pr,jt=Cr,bt=Mr,vt=lr,zt=fr,Et%16===15)for(var Nt=0;Nt<16;Nt++)ct=nt[Nt],dt=it[Nt],At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=nt[(Nt+9)%16],dt=it[(Nt+9)%16],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,mt=nt[(Nt+1)%16],xt=it[(Nt+1)%16],ct=(mt>>>1|xt<<31)^(mt>>>8|xt<<24)^mt>>>7,dt=(xt>>>1|mt<<31)^(xt>>>8|mt<<24)^(xt>>>7|mt<<25),At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,mt=nt[(Nt+14)%16],xt=it[(Nt+14)%16],ct=(mt>>>19|xt<<13)^(xt>>>29|mt<<3)^mt>>>6,dt=(xt>>>19|mt<<13)^(mt>>>29|xt<<3)^(xt>>>6|mt<<26),At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,nt[Nt]=St&65535|Tt<<16,it[Nt]=At&65535|Rt<<16}ct=yt,dt=zt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[0],dt=ot[0],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[0]=yt=St&65535|Tt<<16,ot[0]=zt=At&65535|Rt<<16,ct=wt,dt=Ot,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[1],dt=ot[1],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[1]=wt=St&65535|Tt<<16,ot[1]=Ot=At&65535|Rt<<16,ct=Ct,dt=It,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[2],dt=ot[2],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[2]=Ct=St&65535|Tt<<16,ot[2]=It=At&65535|Rt<<16,ct=Pt,dt=Lt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[3],dt=ot[3],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[3]=Pt=St&65535|Tt<<16,ot[3]=Lt=At&65535|Rt<<16,ct=$t,dt=Ft,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[4],dt=ot[4],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[4]=$t=St&65535|Tt<<16,ot[4]=Ft=At&65535|Rt<<16,ct=Mt,dt=jt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[5],dt=ot[5],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[5]=Mt=St&65535|Tt<<16,ot[5]=jt=At&65535|Rt<<16,ct=Bt,dt=bt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[6],dt=ot[6],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[6]=Bt=St&65535|Tt<<16,ot[6]=bt=At&65535|Rt<<16,ct=Dt,dt=vt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[7],dt=ot[7],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[7]=Dt=St&65535|Tt<<16,ot[7]=vt=At&65535|Rt<<16,ut+=128,ht-=128}return ut}function rt(nt){var it=new j;it.update(nt);var st=it.digest();return it.clean(),st}a.hash=rt})(sha512$2);(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.convertSecretKeyToX25519=a.convertPublicKeyToX25519=a.verify=a.sign=a.extractPublicKeyFromSecretKey=a.generateKeyPair=a.generateKeyPairFromSeed=a.SEED_LENGTH=a.SECRET_KEY_LENGTH=a.PUBLIC_KEY_LENGTH=a.SIGNATURE_LENGTH=void 0;const _=random,$=sha512$2,j=wipe$1;a.SIGNATURE_LENGTH=64,a.PUBLIC_KEY_LENGTH=32,a.SECRET_KEY_LENGTH=64,a.SEED_LENGTH=32;function et(Zt){const Kt=new Float64Array(16);if(Zt)for(let Qt=0;Qt>16&1),Qt[ur-1]&=65535;Qt[15]=Ht[15]-32767-(Qt[14]>>16&1);const Jt=Qt[15]>>16&1;Qt[14]&=65535,wt(Ht,Qt,1-Jt)}for(let qt=0;qt<16;qt++)Zt[2*qt]=Ht[qt]&255,Zt[2*qt+1]=Ht[qt]>>8}function Pt(Zt,Kt){let Qt=0;for(let Ht=0;Ht<32;Ht++)Qt|=Zt[Ht]^Kt[Ht];return(1&Qt-1>>>8)-1}function $t(Zt,Kt){const Qt=new Uint8Array(32),Ht=new Uint8Array(32);return Ct(Qt,Zt),Ct(Ht,Kt),Pt(Qt,Ht)}function Mt(Zt){const Kt=new Uint8Array(32);return Ct(Kt,Zt),Kt[0]&1}function Bt(Zt,Kt){for(let Qt=0;Qt<16;Qt++)Zt[Qt]=Kt[2*Qt]+(Kt[2*Qt+1]<<8);Zt[15]&=32767}function Dt(Zt,Kt,Qt){for(let Ht=0;Ht<16;Ht++)Zt[Ht]=Kt[Ht]+Qt[Ht]}function zt(Zt,Kt,Qt){for(let Ht=0;Ht<16;Ht++)Zt[Ht]=Kt[Ht]-Qt[Ht]}function Ot(Zt,Kt,Qt){let Ht,qt,Jt=0,ur=0,xr=0,pr=0,Cr=0,Mr=0,lr=0,fr=0,_r=0,Rr=0,kr=0,Ar=0,Pr=0,Or=0,Br=0,or=0,Yt=0,er=0,Gt=0,Vt=0,Wt=0,ar=0,yr=0,Er=0,Sr=0,Wr=0,Hr=0,Fr=0,pn=0,Jr=0,Qr=0,mn=Qt[0],ln=Qt[1],qr=Qt[2],En=Qt[3],un=Qt[4],Vr=Qt[5],hn=Qt[6],fn=Qt[7],Kr=Qt[8],Rn=Qt[9],dn=Qt[10],Gr=Qt[11],gn=Qt[12],an=Qt[13],Zr=Qt[14],An=Qt[15];Ht=Kt[0],Jt+=Ht*mn,ur+=Ht*ln,xr+=Ht*qr,pr+=Ht*En,Cr+=Ht*un,Mr+=Ht*Vr,lr+=Ht*hn,fr+=Ht*fn,_r+=Ht*Kr,Rr+=Ht*Rn,kr+=Ht*dn,Ar+=Ht*Gr,Pr+=Ht*gn,Or+=Ht*an,Br+=Ht*Zr,or+=Ht*An,Ht=Kt[1],ur+=Ht*mn,xr+=Ht*ln,pr+=Ht*qr,Cr+=Ht*En,Mr+=Ht*un,lr+=Ht*Vr,fr+=Ht*hn,_r+=Ht*fn,Rr+=Ht*Kr,kr+=Ht*Rn,Ar+=Ht*dn,Pr+=Ht*Gr,Or+=Ht*gn,Br+=Ht*an,or+=Ht*Zr,Yt+=Ht*An,Ht=Kt[2],xr+=Ht*mn,pr+=Ht*ln,Cr+=Ht*qr,Mr+=Ht*En,lr+=Ht*un,fr+=Ht*Vr,_r+=Ht*hn,Rr+=Ht*fn,kr+=Ht*Kr,Ar+=Ht*Rn,Pr+=Ht*dn,Or+=Ht*Gr,Br+=Ht*gn,or+=Ht*an,Yt+=Ht*Zr,er+=Ht*An,Ht=Kt[3],pr+=Ht*mn,Cr+=Ht*ln,Mr+=Ht*qr,lr+=Ht*En,fr+=Ht*un,_r+=Ht*Vr,Rr+=Ht*hn,kr+=Ht*fn,Ar+=Ht*Kr,Pr+=Ht*Rn,Or+=Ht*dn,Br+=Ht*Gr,or+=Ht*gn,Yt+=Ht*an,er+=Ht*Zr,Gt+=Ht*An,Ht=Kt[4],Cr+=Ht*mn,Mr+=Ht*ln,lr+=Ht*qr,fr+=Ht*En,_r+=Ht*un,Rr+=Ht*Vr,kr+=Ht*hn,Ar+=Ht*fn,Pr+=Ht*Kr,Or+=Ht*Rn,Br+=Ht*dn,or+=Ht*Gr,Yt+=Ht*gn,er+=Ht*an,Gt+=Ht*Zr,Vt+=Ht*An,Ht=Kt[5],Mr+=Ht*mn,lr+=Ht*ln,fr+=Ht*qr,_r+=Ht*En,Rr+=Ht*un,kr+=Ht*Vr,Ar+=Ht*hn,Pr+=Ht*fn,Or+=Ht*Kr,Br+=Ht*Rn,or+=Ht*dn,Yt+=Ht*Gr,er+=Ht*gn,Gt+=Ht*an,Vt+=Ht*Zr,Wt+=Ht*An,Ht=Kt[6],lr+=Ht*mn,fr+=Ht*ln,_r+=Ht*qr,Rr+=Ht*En,kr+=Ht*un,Ar+=Ht*Vr,Pr+=Ht*hn,Or+=Ht*fn,Br+=Ht*Kr,or+=Ht*Rn,Yt+=Ht*dn,er+=Ht*Gr,Gt+=Ht*gn,Vt+=Ht*an,Wt+=Ht*Zr,ar+=Ht*An,Ht=Kt[7],fr+=Ht*mn,_r+=Ht*ln,Rr+=Ht*qr,kr+=Ht*En,Ar+=Ht*un,Pr+=Ht*Vr,Or+=Ht*hn,Br+=Ht*fn,or+=Ht*Kr,Yt+=Ht*Rn,er+=Ht*dn,Gt+=Ht*Gr,Vt+=Ht*gn,Wt+=Ht*an,ar+=Ht*Zr,yr+=Ht*An,Ht=Kt[8],_r+=Ht*mn,Rr+=Ht*ln,kr+=Ht*qr,Ar+=Ht*En,Pr+=Ht*un,Or+=Ht*Vr,Br+=Ht*hn,or+=Ht*fn,Yt+=Ht*Kr,er+=Ht*Rn,Gt+=Ht*dn,Vt+=Ht*Gr,Wt+=Ht*gn,ar+=Ht*an,yr+=Ht*Zr,Er+=Ht*An,Ht=Kt[9],Rr+=Ht*mn,kr+=Ht*ln,Ar+=Ht*qr,Pr+=Ht*En,Or+=Ht*un,Br+=Ht*Vr,or+=Ht*hn,Yt+=Ht*fn,er+=Ht*Kr,Gt+=Ht*Rn,Vt+=Ht*dn,Wt+=Ht*Gr,ar+=Ht*gn,yr+=Ht*an,Er+=Ht*Zr,Sr+=Ht*An,Ht=Kt[10],kr+=Ht*mn,Ar+=Ht*ln,Pr+=Ht*qr,Or+=Ht*En,Br+=Ht*un,or+=Ht*Vr,Yt+=Ht*hn,er+=Ht*fn,Gt+=Ht*Kr,Vt+=Ht*Rn,Wt+=Ht*dn,ar+=Ht*Gr,yr+=Ht*gn,Er+=Ht*an,Sr+=Ht*Zr,Wr+=Ht*An,Ht=Kt[11],Ar+=Ht*mn,Pr+=Ht*ln,Or+=Ht*qr,Br+=Ht*En,or+=Ht*un,Yt+=Ht*Vr,er+=Ht*hn,Gt+=Ht*fn,Vt+=Ht*Kr,Wt+=Ht*Rn,ar+=Ht*dn,yr+=Ht*Gr,Er+=Ht*gn,Sr+=Ht*an,Wr+=Ht*Zr,Hr+=Ht*An,Ht=Kt[12],Pr+=Ht*mn,Or+=Ht*ln,Br+=Ht*qr,or+=Ht*En,Yt+=Ht*un,er+=Ht*Vr,Gt+=Ht*hn,Vt+=Ht*fn,Wt+=Ht*Kr,ar+=Ht*Rn,yr+=Ht*dn,Er+=Ht*Gr,Sr+=Ht*gn,Wr+=Ht*an,Hr+=Ht*Zr,Fr+=Ht*An,Ht=Kt[13],Or+=Ht*mn,Br+=Ht*ln,or+=Ht*qr,Yt+=Ht*En,er+=Ht*un,Gt+=Ht*Vr,Vt+=Ht*hn,Wt+=Ht*fn,ar+=Ht*Kr,yr+=Ht*Rn,Er+=Ht*dn,Sr+=Ht*Gr,Wr+=Ht*gn,Hr+=Ht*an,Fr+=Ht*Zr,pn+=Ht*An,Ht=Kt[14],Br+=Ht*mn,or+=Ht*ln,Yt+=Ht*qr,er+=Ht*En,Gt+=Ht*un,Vt+=Ht*Vr,Wt+=Ht*hn,ar+=Ht*fn,yr+=Ht*Kr,Er+=Ht*Rn,Sr+=Ht*dn,Wr+=Ht*Gr,Hr+=Ht*gn,Fr+=Ht*an,pn+=Ht*Zr,Jr+=Ht*An,Ht=Kt[15],or+=Ht*mn,Yt+=Ht*ln,er+=Ht*qr,Gt+=Ht*En,Vt+=Ht*un,Wt+=Ht*Vr,ar+=Ht*hn,yr+=Ht*fn,Er+=Ht*Kr,Sr+=Ht*Rn,Wr+=Ht*dn,Hr+=Ht*Gr,Fr+=Ht*gn,pn+=Ht*an,Jr+=Ht*Zr,Qr+=Ht*An,Jt+=38*Yt,ur+=38*er,xr+=38*Gt,pr+=38*Vt,Cr+=38*Wt,Mr+=38*ar,lr+=38*yr,fr+=38*Er,_r+=38*Sr,Rr+=38*Wr,kr+=38*Hr,Ar+=38*Fr,Pr+=38*pn,Or+=38*Jr,Br+=38*Qr,qt=1,Ht=Jt+qt+65535,qt=Math.floor(Ht/65536),Jt=Ht-qt*65536,Ht=ur+qt+65535,qt=Math.floor(Ht/65536),ur=Ht-qt*65536,Ht=xr+qt+65535,qt=Math.floor(Ht/65536),xr=Ht-qt*65536,Ht=pr+qt+65535,qt=Math.floor(Ht/65536),pr=Ht-qt*65536,Ht=Cr+qt+65535,qt=Math.floor(Ht/65536),Cr=Ht-qt*65536,Ht=Mr+qt+65535,qt=Math.floor(Ht/65536),Mr=Ht-qt*65536,Ht=lr+qt+65535,qt=Math.floor(Ht/65536),lr=Ht-qt*65536,Ht=fr+qt+65535,qt=Math.floor(Ht/65536),fr=Ht-qt*65536,Ht=_r+qt+65535,qt=Math.floor(Ht/65536),_r=Ht-qt*65536,Ht=Rr+qt+65535,qt=Math.floor(Ht/65536),Rr=Ht-qt*65536,Ht=kr+qt+65535,qt=Math.floor(Ht/65536),kr=Ht-qt*65536,Ht=Ar+qt+65535,qt=Math.floor(Ht/65536),Ar=Ht-qt*65536,Ht=Pr+qt+65535,qt=Math.floor(Ht/65536),Pr=Ht-qt*65536,Ht=Or+qt+65535,qt=Math.floor(Ht/65536),Or=Ht-qt*65536,Ht=Br+qt+65535,qt=Math.floor(Ht/65536),Br=Ht-qt*65536,Ht=or+qt+65535,qt=Math.floor(Ht/65536),or=Ht-qt*65536,Jt+=qt-1+37*(qt-1),qt=1,Ht=Jt+qt+65535,qt=Math.floor(Ht/65536),Jt=Ht-qt*65536,Ht=ur+qt+65535,qt=Math.floor(Ht/65536),ur=Ht-qt*65536,Ht=xr+qt+65535,qt=Math.floor(Ht/65536),xr=Ht-qt*65536,Ht=pr+qt+65535,qt=Math.floor(Ht/65536),pr=Ht-qt*65536,Ht=Cr+qt+65535,qt=Math.floor(Ht/65536),Cr=Ht-qt*65536,Ht=Mr+qt+65535,qt=Math.floor(Ht/65536),Mr=Ht-qt*65536,Ht=lr+qt+65535,qt=Math.floor(Ht/65536),lr=Ht-qt*65536,Ht=fr+qt+65535,qt=Math.floor(Ht/65536),fr=Ht-qt*65536,Ht=_r+qt+65535,qt=Math.floor(Ht/65536),_r=Ht-qt*65536,Ht=Rr+qt+65535,qt=Math.floor(Ht/65536),Rr=Ht-qt*65536,Ht=kr+qt+65535,qt=Math.floor(Ht/65536),kr=Ht-qt*65536,Ht=Ar+qt+65535,qt=Math.floor(Ht/65536),Ar=Ht-qt*65536,Ht=Pr+qt+65535,qt=Math.floor(Ht/65536),Pr=Ht-qt*65536,Ht=Or+qt+65535,qt=Math.floor(Ht/65536),Or=Ht-qt*65536,Ht=Br+qt+65535,qt=Math.floor(Ht/65536),Br=Ht-qt*65536,Ht=or+qt+65535,qt=Math.floor(Ht/65536),or=Ht-qt*65536,Jt+=qt-1+37*(qt-1),Zt[0]=Jt,Zt[1]=ur,Zt[2]=xr,Zt[3]=pr,Zt[4]=Cr,Zt[5]=Mr,Zt[6]=lr,Zt[7]=fr,Zt[8]=_r,Zt[9]=Rr,Zt[10]=kr,Zt[11]=Ar,Zt[12]=Pr,Zt[13]=Or,Zt[14]=Br,Zt[15]=or}function It(Zt,Kt){Ot(Zt,Kt,Kt)}function Lt(Zt,Kt){const Qt=et();let Ht;for(Ht=0;Ht<16;Ht++)Qt[Ht]=Kt[Ht];for(Ht=253;Ht>=0;Ht--)It(Qt,Qt),Ht!==2&&Ht!==4&&Ot(Qt,Qt,Kt);for(Ht=0;Ht<16;Ht++)Zt[Ht]=Qt[Ht]}function Ft(Zt,Kt){const Qt=et();let Ht;for(Ht=0;Ht<16;Ht++)Qt[Ht]=Kt[Ht];for(Ht=250;Ht>=0;Ht--)It(Qt,Qt),Ht!==1&&Ot(Qt,Qt,Kt);for(Ht=0;Ht<16;Ht++)Zt[Ht]=Qt[Ht]}function jt(Zt,Kt){const Qt=et(),Ht=et(),qt=et(),Jt=et(),ur=et(),xr=et(),pr=et(),Cr=et(),Mr=et();zt(Qt,Zt[1],Zt[0]),zt(Mr,Kt[1],Kt[0]),Ot(Qt,Qt,Mr),Dt(Ht,Zt[0],Zt[1]),Dt(Mr,Kt[0],Kt[1]),Ot(Ht,Ht,Mr),Ot(qt,Zt[3],Kt[3]),Ot(qt,qt,st),Ot(Jt,Zt[2],Kt[2]),Dt(Jt,Jt,Jt),zt(ur,Ht,Qt),zt(xr,Jt,qt),Dt(pr,Jt,qt),Dt(Cr,Ht,Qt),Ot(Zt[0],ur,xr),Ot(Zt[1],Cr,pr),Ot(Zt[2],pr,xr),Ot(Zt[3],ur,Cr)}function bt(Zt,Kt,Qt){for(let Ht=0;Ht<4;Ht++)wt(Zt[Ht],Kt[Ht],Qt)}function vt(Zt,Kt){const Qt=et(),Ht=et(),qt=et();Lt(qt,Kt[2]),Ot(Qt,Kt[0],qt),Ot(Ht,Kt[1],qt),Ct(Zt,Ht),Zt[31]^=Mt(Qt)<<7}function ct(Zt,Kt,Qt){ht(Zt[0],rt),ht(Zt[1],nt),ht(Zt[2],nt),ht(Zt[3],rt);for(let Ht=255;Ht>=0;--Ht){const qt=Qt[Ht/8|0]>>(Ht&7)&1;bt(Zt,Kt,qt),jt(Kt,Zt),jt(Zt,Zt),bt(Zt,Kt,qt)}}function dt(Zt,Kt){const Qt=[et(),et(),et(),et()];ht(Qt[0],ot),ht(Qt[1],at),ht(Qt[2],nt),Ot(Qt[3],ot,at),ct(Zt,Qt,Kt)}function mt(Zt){if(Zt.length!==a.SEED_LENGTH)throw new Error(`ed25519: seed must be ${a.SEED_LENGTH} bytes`);const Kt=(0,$.hash)(Zt);Kt[0]&=248,Kt[31]&=127,Kt[31]|=64;const Qt=new Uint8Array(32),Ht=[et(),et(),et(),et()];dt(Ht,Kt),vt(Qt,Ht);const qt=new Uint8Array(64);return qt.set(Zt),qt.set(Qt,32),{publicKey:Qt,secretKey:qt}}a.generateKeyPairFromSeed=mt;function xt(Zt){const Kt=(0,_.randomBytes)(32,Zt),Qt=mt(Kt);return(0,j.wipe)(Kt),Qt}a.generateKeyPair=xt;function At(Zt){if(Zt.length!==a.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${a.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Zt.subarray(32))}a.extractPublicKeyFromSecretKey=At;const Rt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function St(Zt,Kt){let Qt,Ht,qt,Jt;for(Ht=63;Ht>=32;--Ht){for(Qt=0,qt=Ht-32,Jt=Ht-12;qt>4)*Rt[qt],Qt=Kt[qt]>>8,Kt[qt]&=255;for(qt=0;qt<32;qt++)Kt[qt]-=Qt*Rt[qt];for(Ht=0;Ht<32;Ht++)Kt[Ht+1]+=Kt[Ht]>>8,Zt[Ht]=Kt[Ht]&255}function Tt(Zt){const Kt=new Float64Array(64);for(let Qt=0;Qt<64;Qt++)Kt[Qt]=Zt[Qt];for(let Qt=0;Qt<64;Qt++)Zt[Qt]=0;St(Zt,Kt)}function Et(Zt,Kt){const Qt=new Float64Array(64),Ht=[et(),et(),et(),et()],qt=(0,$.hash)(Zt.subarray(0,32));qt[0]&=248,qt[31]&=127,qt[31]|=64;const Jt=new Uint8Array(64);Jt.set(qt.subarray(32),32);const ur=new $.SHA512;ur.update(Jt.subarray(32)),ur.update(Kt);const xr=ur.digest();ur.clean(),Tt(xr),dt(Ht,xr),vt(Jt,Ht),ur.reset(),ur.update(Jt.subarray(0,32)),ur.update(Zt.subarray(32)),ur.update(Kt);const pr=ur.digest();Tt(pr);for(let Cr=0;Cr<32;Cr++)Qt[Cr]=xr[Cr];for(let Cr=0;Cr<32;Cr++)for(let Mr=0;Mr<32;Mr++)Qt[Cr+Mr]+=pr[Cr]*qt[Mr];return St(Jt.subarray(32),Qt),Jt}a.sign=Et;function Nt(Zt,Kt){const Qt=et(),Ht=et(),qt=et(),Jt=et(),ur=et(),xr=et(),pr=et();return ht(Zt[2],nt),Bt(Zt[1],Kt),It(qt,Zt[1]),Ot(Jt,qt,it),zt(qt,qt,Zt[2]),Dt(Jt,Zt[2],Jt),It(ur,Jt),It(xr,ur),Ot(pr,xr,ur),Ot(Qt,pr,qt),Ot(Qt,Qt,Jt),Ft(Qt,Qt),Ot(Qt,Qt,qt),Ot(Qt,Qt,Jt),Ot(Qt,Qt,Jt),Ot(Zt[0],Qt,Jt),It(Ht,Zt[0]),Ot(Ht,Ht,Jt),$t(Ht,qt)&&Ot(Zt[0],Zt[0],ut),It(Ht,Zt[0]),Ot(Ht,Ht,Jt),$t(Ht,qt)?-1:(Mt(Zt[0])===Kt[31]>>7&&zt(Zt[0],rt,Zt[0]),Ot(Zt[3],Zt[0],Zt[1]),0)}function tr(Zt,Kt,Qt){const Ht=new Uint8Array(32),qt=[et(),et(),et(),et()],Jt=[et(),et(),et(),et()];if(Qt.length!==a.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${a.SIGNATURE_LENGTH} bytes`);if(Nt(Jt,Zt))return!1;const ur=new $.SHA512;ur.update(Qt.subarray(0,32)),ur.update(Zt),ur.update(Kt);const xr=ur.digest();return Tt(xr),ct(qt,Jt,xr),dt(Jt,Qt.subarray(32)),jt(qt,Jt),vt(Ht,qt),!Pt(Qt,Ht)}a.verify=tr;function ir(Zt){let Kt=[et(),et(),et(),et()];if(Nt(Kt,Zt))throw new Error("Ed25519: invalid public key");let Qt=et(),Ht=et(),qt=Kt[1];Dt(Qt,nt,qt),zt(Ht,nt,qt),Lt(Ht,Ht),Ot(Qt,Qt,Ht);let Jt=new Uint8Array(32);return Ct(Jt,Qt),Jt}a.convertPublicKeyToX25519=ir;function nr(Zt){const Kt=(0,$.hash)(Zt.subarray(0,32));Kt[0]&=248,Kt[31]&=127,Kt[31]|=64;const Qt=new Uint8Array(Kt.subarray(0,32));return(0,j.wipe)(Kt),Qt}a.convertSecretKeyToX25519=nr})(ed25519);var bytes$1={};Object.defineProperty(bytes$1,"__esModule",{value:!0});function concat$1(){for(var a=0,_=0;_{if(!["tz1","tz2","tz3","tz4","KT1","txr1","sr1"].some($=>a.toLowerCase().startsWith($.toLowerCase())))return!1;try{bs58check$2.decode(a)}catch{return!1}return!0};async function generateGUID(){const a=random.randomBytes(16);return[a.slice(0,4),a.slice(4,6),a.slice(6,8),a.slice(8,10),a.slice(10,16)].map(function(_){return Buffer$g.from(_).toString("hex")}).join("-")}const CONTRACT_PREFIX="KT1",secretbox_NONCEBYTES=24,secretbox_MACBYTES=16;var BeaconMessageType;(function(a){a.BlockchainRequest="blockchain_request",a.PermissionRequest="permission_request",a.SignPayloadRequest="sign_payload_request",a.OperationRequest="operation_request",a.BroadcastRequest="broadcast_request",a.ChangeAccountRequest="change_account_request",a.BlockchainResponse="blockchain_response",a.PermissionResponse="permission_response",a.SignPayloadResponse="sign_payload_response",a.ProofOfEventChallengeRequest="proof_of_event_challenge_request",a.ProofOfEventChallengeResponse="proof_of_event_challenge_response",a.SimulatedProofOfEventChallengeRequest="simulated_proof_of_event_challenge_request",a.SimulatedProofOfEventChallengeResponse="simulated_proof_of_event_challenge_response",a.OperationResponse="operation_response",a.BroadcastResponse="broadcast_response",a.Acknowledge="acknowledge",a.Disconnect="disconnect",a.Error="error"})(BeaconMessageType||(BeaconMessageType={}));var PermissionScope;(function(a){a.SIGN="sign",a.OPERATION_REQUEST="operation_request",a.ENCRYPT="encrypt",a.NOTIFICATION="notification",a.THRESHOLD="threshold"})(PermissionScope||(PermissionScope={}));var NetworkType;(function(a){a.MAINNET="mainnet",a.GHOSTNET="ghostnet",a.WEEKLYNET="weeklynet",a.DAILYNET="dailynet",a.DELPHINET="delphinet",a.EDONET="edonet",a.FLORENCENET="florencenet",a.GRANADANET="granadanet",a.HANGZHOUNET="hangzhounet",a.ITHACANET="ithacanet",a.JAKARTANET="jakartanet",a.KATHMANDUNET="kathmandunet",a.LIMANET="limanet",a.MUMBAINET="mumbainet",a.NAIROBINET="nairobinet",a.OXFORDNET="oxfordnet",a.PARISNET="parisnet",a.CUSTOM="custom"})(NetworkType||(NetworkType={}));var TezosOperationType;(function(a){a.ORIGINATION="origination",a.DELEGATION="delegation",a.REVEAL="reveal",a.TRANSACTION="transaction",a.ACTIVATE_ACCOUNT="activate_account",a.ENDORSEMENT="endorsement",a.SEED_NONCE_REVELATION="seed_nonce_revelation",a.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",a.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",a.PROPOSALS="proposals",a.BALLOT="ballot",a.ATTESTATION="attestation",a.PREATTESTATION="preattestation",a.PREENDORSEMENT="preendorsement",a.SET_DEPOSITS_LIMIT="set_deposits_limit",a.DOUBLE_PREATTESTATION_EVIDENCE="double_preattestation_evidence",a.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",a.ATTESTATION_WITH_SLOT="attestation_with_slot",a.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",a.DOUBLE_ATTESTATION_EVIDENCE="double_attestation_evidence",a.FAILING_NOOP="failing_noop",a.REGISTER_GLOBAL_CONSTANT="register_global_constant",a.TRANSFER_TICKET="transfer_ticket",a.INCREASE_PAID_STORAGE="increase_paid_storage",a.UPDATE_CONSENSUS_KEY="update_consensus_key",a.DRAIN_DELEGATE="drain_delegate",a.VDF_REVELATION="vdf_revelation",a.EVENT="event",a.TICKET_UPDATES="ticket_updates",a.SMART_ROLLUP_ORIGINATE="smart_rollup_originate",a.SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",a.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",a.SMART_ROLLUP_PUBLISH="smart_rollup_publish",a.SMART_ROLLUP_CEMENT="smart_rollup_cement",a.SMART_ROLLUP_RECOVER_BOND="smart_rollup_recover_bond",a.SMART_ROLLUP_REFUTE="smart_rollup_refute",a.SMART_ROLLUP_TIMEOUT="smart_rollup_timeout",a.DAL_PUBLISH_COMMITMENT="dal_publish_commitment"})(TezosOperationType||(TezosOperationType={}));var Origin;(function(a){a.WEBSITE="website",a.EXTENSION="extension",a.P2P="p2p",a.WALLETCONNECT="walletconnect"})(Origin||(Origin={}));var ExtensionMessageTarget;(function(a){a.BACKGROUND="toBackground",a.PAGE="toPage",a.EXTENSION="toExtension"})(ExtensionMessageTarget||(ExtensionMessageTarget={}));var BeaconErrorType;(function(a){a.BROADCAST_ERROR="BROADCAST_ERROR",a.NETWORK_NOT_SUPPORTED="NETWORK_NOT_SUPPORTED",a.NO_ADDRESS_ERROR="NO_ADDRESS_ERROR",a.NO_PRIVATE_KEY_FOUND_ERROR="NO_PRIVATE_KEY_FOUND_ERROR",a.NOT_GRANTED_ERROR="NOT_GRANTED_ERROR",a.PARAMETERS_INVALID_ERROR="PARAMETERS_INVALID_ERROR",a.TOO_MANY_OPERATIONS="TOO_MANY_OPERATIONS",a.TRANSACTION_INVALID_ERROR="TRANSACTION_INVALID_ERROR",a.SIGNATURE_TYPE_NOT_SUPPORTED="SIGNATURE_TYPE_NOT_SUPPORTED",a.ABORTED_ERROR="ABORTED_ERROR",a.UNKNOWN_ERROR="UNKNOWN_ERROR"})(BeaconErrorType||(BeaconErrorType={}));var TransportStatus;(function(a){a.NOT_CONNECTED="NOT_CONNECTED",a.CONNECTING="CONNECTING",a.CONNECTED="CONNECTED"})(TransportStatus||(TransportStatus={}));var TransportType;(function(a){a.CHROME_MESSAGE="chrome_message",a.WALLETCONNECT="walletconnect",a.POST_MESSAGE="post_message",a.LEDGER="ledger",a.P2P="p2p"})(TransportType||(TransportType={}));class Storage{static isSupported(){return Promise.resolve(!1)}}var StorageKey;(function(a){a.TRANSPORT_P2P_PEERS_DAPP="beacon:communication-peers-dapp",a.TRANSPORT_P2P_PEERS_WALLET="beacon:communication-peers-wallet",a.TRANSPORT_POSTMESSAGE_PEERS_DAPP="beacon:postmessage-peers-dapp",a.TRANSPORT_POSTMESSAGE_PEERS_WALLET="beacon:postmessage-peers-wallet",a.TRANSPORT_WALLETCONNECT_PEERS_DAPP="beacon:walletconnect-peers-dapp",a.LAST_SELECTED_WALLET="beacon:last-selected-wallet",a.ACCOUNTS="beacon:accounts",a.ACTIVE_ACCOUNT="beacon:active-account",a.PUSH_TOKENS="beacon:push-tokens",a.BEACON_SDK_SECRET_SEED="beacon:sdk-secret-seed",a.APP_METADATA_LIST="beacon:app-metadata-list",a.PERMISSION_LIST="beacon:permissions",a.ONGOING_PROOF_OF_EVENT_CHALLENGES="beacon:ongoing-proof-of-event-challenges",a.BEACON_SDK_VERSION="beacon:sdk_version",a.MATRIX_PRESERVED_STATE="beacon:sdk-matrix-preserved-state",a.MATRIX_PEER_ROOM_IDS="beacon:matrix-peer-rooms",a.MATRIX_SELECTED_NODE="beacon:matrix-selected-node",a.MULTI_NODE_SETUP_DONE="beacon:multi-node-setup",a.USER_ID="beacon:user-id",a.ENABLE_METRICS="beacon:enable_metrics",a.WC_2_CORE_PAIRING="wc@2:core:0.3:pairing",a.WC_2_CLIENT_SESSION="wc@2:client:0.3:session",a.WC_2_CORE_KEYCHAIN="wc@2:core:0.3:keychain",a.WC_2_CORE_MESSAGES="wc@2:core:0.3:messages",a.WC_2_CLIENT_PROPOSAL="wc@2:client:0.3:proposal",a.WC_2_CORE_SUBSCRIPTION="wc@2:core:0.3:subscription",a.WC_2_CORE_HISTORY="wc@2:core:0.3:history",a.WC_2_CORE_EXPIRER="wc@2:core:0.3:expirer"})(StorageKey||(StorageKey={}));const defaultValues={[StorageKey.TRANSPORT_P2P_PEERS_DAPP]:[],[StorageKey.TRANSPORT_P2P_PEERS_WALLET]:[],[StorageKey.TRANSPORT_POSTMESSAGE_PEERS_DAPP]:[],[StorageKey.TRANSPORT_POSTMESSAGE_PEERS_WALLET]:[],[StorageKey.TRANSPORT_WALLETCONNECT_PEERS_DAPP]:[],[StorageKey.LAST_SELECTED_WALLET]:void 0,[StorageKey.ACCOUNTS]:[],[StorageKey.ACTIVE_ACCOUNT]:void 0,[StorageKey.PUSH_TOKENS]:[],[StorageKey.BEACON_SDK_SECRET_SEED]:void 0,[StorageKey.APP_METADATA_LIST]:[],[StorageKey.PERMISSION_LIST]:[],[StorageKey.ONGOING_PROOF_OF_EVENT_CHALLENGES]:[],[StorageKey.BEACON_SDK_VERSION]:void 0,[StorageKey.MATRIX_PRESERVED_STATE]:{},[StorageKey.MATRIX_PEER_ROOM_IDS]:{},[StorageKey.MATRIX_SELECTED_NODE]:void 0,[StorageKey.MULTI_NODE_SETUP_DONE]:void 0,[StorageKey.WC_2_CLIENT_SESSION]:void 0,[StorageKey.USER_ID]:void 0,[StorageKey.ENABLE_METRICS]:void 0,[StorageKey.WC_2_CORE_PAIRING]:void 0,[StorageKey.WC_2_CORE_KEYCHAIN]:void 0,[StorageKey.WC_2_CORE_MESSAGES]:void 0,[StorageKey.WC_2_CLIENT_PROPOSAL]:void 0,[StorageKey.WC_2_CORE_SUBSCRIPTION]:void 0,[StorageKey.WC_2_CORE_HISTORY]:void 0,[StorageKey.WC_2_CORE_EXPIRER]:void 0};class P2PPairingRequest{constructor(_,$,j,et,tt,rt,nt){Yr(this,"type","p2p-pairing-request");Yr(this,"relayServer");Yr(this,"id");Yr(this,"name");Yr(this,"icon");Yr(this,"appUrl");Yr(this,"publicKey");Yr(this,"version");this.id=_,this.name=$,this.icon=rt,this.appUrl=nt,this.publicKey=j,this.version=et,this.relayServer=tt}}class ExtendedP2PPairingRequest extends P2PPairingRequest{constructor($,j,et,tt,rt,nt,it,st){super($,j,et,tt,rt,it,st);Yr(this,"senderId");this.senderId=nt}}var SigningType;(function(a){a.RAW="raw",a.OPERATION="operation",a.MICHELINE="micheline"})(SigningType||(SigningType={}));class P2PPairingResponse{constructor(_,$,j,et,tt,rt,nt){Yr(this,"type","p2p-pairing-request");Yr(this,"relayServer");Yr(this,"id");Yr(this,"name");Yr(this,"icon");Yr(this,"appUrl");Yr(this,"publicKey");Yr(this,"version");this.id=_,this.name=$,this.icon=rt,this.appUrl=nt,this.publicKey=j,this.version=et,this.relayServer=tt}}class PostMessagePairingRequest{constructor(_,$,j,et,tt,rt){Yr(this,"type","postmessage-pairing-request");Yr(this,"id");Yr(this,"name");Yr(this,"icon");Yr(this,"appUrl");Yr(this,"publicKey");Yr(this,"version");this.id=_,this.name=$,this.icon=tt,this.appUrl=rt,this.publicKey=j,this.version=et}}class ExtendedPostMessagePairingRequest extends PostMessagePairingRequest{constructor($,j,et,tt,rt,nt,it){super($,j,et,tt,nt,it);Yr(this,"senderId");this.senderId=rt}}class WalletConnectPairingRequest{constructor(_,$,j,et,tt,rt,nt){Yr(this,"type","walletconnect-pairing-request");Yr(this,"uri");Yr(this,"id");Yr(this,"name");Yr(this,"icon");Yr(this,"appUrl");Yr(this,"publicKey");Yr(this,"version");this.id=_,this.name=$,this.icon=rt,this.appUrl=nt,this.publicKey=j,this.version=et,this.uri=tt}}class ExtendedWalletConnectPairingRequest extends WalletConnectPairingRequest{constructor($,j,et,tt,rt,nt,it,st){super($,j,et,tt,nt,it,st);Yr(this,"senderId");this.senderId=rt}}var ColorMode;(function(a){a.LIGHT="light",a.DARK="dark"})(ColorMode||(ColorMode={}));var Regions;(function(a){a.EUROPE_EAST="europe-east",a.EUROPE_WEST="europe-west",a.NORTH_AMERICA_EAST="north-america-east",a.NORTH_AMERICA_WEST="north-america-west",a.CENTRAL_AMERICA="central-america",a.SOUTH_AMERICA="south-america",a.ASIA_EAST="asia-east",a.ASIA_WEST="asia-west",a.AFRICA="africa",a.AUSTRALIA="australia"})(Regions||(Regions={}));const SDK_VERSION="4.2.2",BEACON_VERSION="3",NOTIFICATION_ORACLE_URL="https://beacon-notification-oracle.dev.gke.papers.tech",cbs=[a=>{}];let windowRef={postMessage:(a,_)=>{console.log("GOT MOCK POST MESSAGE",a),cbs.forEach($=>{$({data:a})})},addEventListener:(a,_)=>{cbs.push(_)},removeEventListener:(a,_)=>{cbs.splice(cbs.indexOf($=>$===_),1)},location:{origin:"*"}};try{typeof window<"u"&&(windowRef=window)}catch(a){console.log(`not defined: ${a}`)}class MockAnalytics{track(_,$,j,et){}}class BeaconClient{constructor(_){Yr(this,"name");Yr(this,"iconUrl");Yr(this,"appUrl");Yr(this,"_beaconId",new ExposedPromise);Yr(this,"storage");Yr(this,"analytics");Yr(this,"_keyPair",new ExposedPromise);if(!_.name)throw new Error("Name not set");if(!_.storage)throw new Error("Storage not set");this.name=_.name,this.iconUrl=_.iconUrl,this.appUrl=_.appUrl??windowRef.location.origin,this.storage=_.storage,this.analytics=_.analytics??new MockAnalytics,windowRef.beaconCreatedClientInstance?console.error("[BEACON] It looks like you created multiple Beacon SDK Client instances. This can lead to problems. Only create one instance and re-use it everywhere."):windowRef.beaconCreatedClientInstance=!0,this.initSDK().catch(console.error)}get beaconId(){return this._beaconId.promise}get keyPair(){return this._keyPair.promise}async destroy(){await this.removeBeaconEntriesFromStorage(),windowRef.beaconCreatedClientInstance=!1}async initSDK(){return this.storage.set(StorageKey.BEACON_SDK_VERSION,SDK_VERSION).catch(console.error),this.loadOrCreateBeaconSecret().catch(console.error),this.keyPair.then(_=>{this._beaconId.resolve(toHex$1(_.publicKey))})}async removeBeaconEntriesFromStorage(){const _=Object.values(StorageKey);await Promise.all(_.map($=>this.storage.delete($)))}async loadOrCreateBeaconSecret(){const _=await this.storage.get(StorageKey.BEACON_SDK_SECRET_SEED);if(_&&typeof _=="string")this._keyPair.resolve(await getKeypairFromSeed(_));else{const $=await generateGUID();await this.storage.set(StorageKey.BEACON_SDK_SECRET_SEED,$),this._keyPair.resolve(await getKeypairFromSeed($))}}}function fixArrayType(a){return a}class StorageManager{constructor(_,$){Yr(this,"storage");Yr(this,"storageKey");this.storage=_,this.storageKey=$}async getAll(){return await this.storage.get(this.storageKey)??[]}async getOne(_){const $=await this.storage.get(this.storageKey);return $.find(_)}async addOne(_,$,j=!0){const et=await this.storage.get(this.storageKey);if(!et.some($))et.push(_);else if(j)for(let tt=0;tt!_(et));return this.storage.set(this.storageKey,j)}async removeAll(){return this.storage.delete(this.storageKey)}}const getAccountIdentifier=async(a,_)=>{const $=[a,_.type];_.name&&$.push(`name:${_.name}`),_.rpcUrl&&$.push(`rpc:${_.rpcUrl}`);const j=Buffer$g.from(blake2b$1.hash(encode_1($.join("-")),10));return bs58check$2.encode(j)};class PermissionValidator{static async hasPermission(_,$,j){switch(_.type){case BeaconMessageType.PermissionRequest:case BeaconMessageType.BroadcastRequest:return!0;case BeaconMessageType.OperationRequest:{const et=await getAccountIdentifier(_.sourceAddress,_.network),tt=await $(et);return tt?tt.scopes.includes(PermissionScope.OPERATION_REQUEST):!1}case BeaconMessageType.SignPayloadRequest:{const tt=(await j()).filter(rt=>rt.address===_.sourceAddress);return tt.length===0?!1:tt.some(rt=>rt.scopes.includes(PermissionScope.SIGN))}default:throw new Error("Message not handled")}}}class AccountManager{constructor(_){Yr(this,"storageManager");this.storageManager=new StorageManager(_,StorageKey.ACCOUNTS)}async getAccounts(){return await this.storageManager.getAll()??[]}async getAccount(_){return this.storageManager.getOne($=>$.accountIdentifier===_)}async addAccount(_){return this.storageManager.addOne(_,$=>$.accountIdentifier===_.accountIdentifier)}async updateAccount(_,$){const j=await this.getAccount(_);if(!j)return;const et={...j,...$};return await this.storageManager.addOne(et,tt=>tt.accountIdentifier===_,!0),et}async removeAccount(_){return this.storageManager.remove($=>$.accountIdentifier===_)}async removeAccounts(_){return this.storageManager.remove($=>_.includes($.accountIdentifier))}async removeAllAccounts(){return this.storageManager.removeAll()}async hasPermission(_){return PermissionValidator.hasPermission(_,this.getAccount.bind(this),this.getAccounts.bind(this))}}const isHex$1=a=>/^[A-F0-9]+$/i.test(a),getSenderId=async a=>{isHex$1(a)||console.error("PublicKey needs to be in hex format!");const _=Buffer$g.from(blake2b$1.hash(Buffer$g.from(a,"hex"),5));return bs58check$2.encode(_)};let debug$2=!!windowRef.beaconSdkDebugEnabled;debug$2&&console.log("[BEACON]: Debug mode is ON (turned on either by the developer or a browser extension)");const getDebugEnabled=()=>debug$2;class InternalLogger{constructor(){}debug(_,$,...j){this._log("debug",_,$,j)}log(_,$,...j){this._log("log",_,$,j)}warn(_,$,...j){this._log("warn",_,$,j)}error(_,$,...j){this._log("error",_,$,j)}time(_,$){_?console.time($):console.timeEnd($)}timeLog(_,$,...j){this._log("timeLog",_,$,j)}_log(_,$,j,et=[]){if(!getDebugEnabled())return;let tt=`[BEACON] ${new Date().toISOString()} [${$}](${j})`,rt=et;switch(et[0]&&typeof et[0]=="string"&&(tt+=` ${et[0]}`,rt=et.slice(1)),_){case"error":console.group(tt),console.error(...rt);break;case"warn":console.group(tt),console.warn(...rt);break;case"debug":console.groupCollapsed(tt),console.debug(...rt);break;case"timeLog":console.group(tt),console.timeLog(...rt);break;default:console.group(tt),console.log(...rt)}console.groupEnd()}}class Logger{constructor(_){Yr(this,"name");this.name=_}debug(_,...$){logger$9.debug(this.name,_,$)}log(_,...$){logger$9.log(this.name,_,$)}warn(_,...$){logger$9.warn(this.name,_,$)}error(_,...$){logger$9.error(this.name,_,$)}time(_,$){logger$9.time(_,$)}timeLog(_,...$){logger$9.timeLog(_,$)}}let logger$9=new InternalLogger;const logger$8=new Logger("Client");class Client extends BeaconClient{constructor($){super($);Yr(this,"accountManager");Yr(this,"handleResponse");Yr(this,"rateLimit",2);Yr(this,"rateLimitWindowInSeconds",5);Yr(this,"requestCounter",[]);Yr(this,"matrixNodes");Yr(this,"transportListeners",new Map);Yr(this,"_transport",new ExposedPromise);this.accountManager=new AccountManager($.storage),this.matrixNodes=$.matrixNodes??{},this.handleResponse=(j,et)=>{throw new Error(`not overwritten${JSON.stringify(j)} - ${JSON.stringify(et)}`)}}get transport(){return this._transport.promise}get connectionStatus(){var $;return(($=this._transport.promiseResult)==null?void 0:$.connectionStatus)??TransportStatus.NOT_CONNECTED}get ready(){return this.transport.then(()=>{})}async cleanup(){if(this.transportListeners.size&&this._transport.isResolved()){const $=await this.transport;await Promise.all(Array.from(this.transportListeners.values()).map(j=>$.removeListener(j))),this.transportListeners.clear()}}async getAccounts(){return this.accountManager.getAccounts()}async getAccount($){return this.accountManager.getAccount($)}async removeAccount($){return this.accountManager.removeAccount($)}async removeAllAccounts(){return this.accountManager.removeAllAccounts()}async addRequestAndCheckIfRateLimited(){const $=new Date().getTime();return this.requestCounter=this.requestCounter.filter(j=>j+this.rateLimitWindowInSeconds*1e3>$),this.requestCounter.push($),this.requestCounter.length>this.rateLimit}async init($){return this._transport.isResolved()?(await this.transport).type:(await this.setTransport($),$.type)}async getOwnAppMetadata(){return{senderId:await getSenderId(await this.beaconId),name:this.name,icon:this.iconUrl}}async getPeers(){return(await this.transport).getPeers()}async addPeer($){return(await this.transport).addPeer($)}async destroy(){if(this._transport.isResolved()){const $=await this.transport;await this.cleanup(),await $.disconnect(),$.type===TransportType.WALLETCONNECT&&await $.doClientCleanup()}await super.destroy()}async setTransport($){$?this._transport.isSettled()?this._transport=ExposedPromise.resolve($):this._transport.resolve($):this._transport.isSettled()&&(this._transport=new ExposedPromise)}async addListener($){this.transportListeners.has($.type)&&await $.removeListener(this.transportListeners.get($.type));const j=async(et,tt)=>{if(typeof et=="string"){const rt=await new Serializer().deserialize(et);this.handleResponse(rt,tt)}};this.transportListeners.set($.type,j),$.addListener(j).catch(et=>logger$8.error("addListener",et))}async sendDisconnectToPeer($,j){const et={id:await generateGUID(),version:$.version,senderId:await getSenderId(await this.beaconId),type:BeaconMessageType.Disconnect},tt=await new Serializer().serialize(et);await(j??await this.transport).send(tt,$)}}const logger$7=new Logger("Transport");let Transport$2=class{constructor(_,$,j){Yr(this,"type",TransportType.POST_MESSAGE);Yr(this,"name");Yr(this,"_isConnected",TransportStatus.NOT_CONNECTED);Yr(this,"peerManager");Yr(this,"client");Yr(this,"newPeerListener");Yr(this,"listeners",[]);this.name=_,this.client=$,this.peerManager=j}setEventHandler(_,$){this.client.eventHandlers.set(_,$)}get connectionStatus(){return this._isConnected}static async isAvailable(){return Promise.resolve(!1)}async connect(){logger$7.log("connect"),this._isConnected=TransportStatus.CONNECTED}async disconnect(){logger$7.log("disconnect"),this._isConnected=TransportStatus.NOT_CONNECTED}async send(_,$){if($)return this.client.sendMessage(_,$);{const et=(await this.getPeers()).map(tt=>this.client.sendMessage(_,tt));return(await Promise.all(et))[0]}}async addListener(_){logger$7.debug("addListener"),this.listeners.push(_)}async removeListener(_){logger$7.log("removeListener"),this.listeners=this.listeners.filter($=>$!==_)}async getPeers(){return this.peerManager.getPeers()}async addPeer(_,$=!0){logger$7.log("addPeer","adding peer",_),await this.peerManager.addPeer(_),await this.listen(_.publicKey)}async removePeer(_){logger$7.log("removePeer","removing peer",_),await this.peerManager.removePeer(_.publicKey),this.client&&await this.client.unsubscribeFromEncryptedMessage(_.publicKey)}async removeAllPeers(){logger$7.log("removeAllPeers"),await this.peerManager.removeAllPeers(),this.client&&await this.client.unsubscribeFromEncryptedMessages()}async notifyListeners(_,$){this.listeners.length===0?logger$7.warn("notifyListeners","0 listeners notified!",this):logger$7.log("notifyListeners",`Notifying ${this.listeners.length} listeners`,this),this.listeners.forEach(j=>{j(_,$)})}};class LocalStorage extends Storage{constructor($){super();Yr(this,"prefix");this.prefix=$}static async isSupported(){return Promise.resolve(typeof window<"u"&&!!window.localStorage)}async get($){const j=localStorage.getItem(this.getPrefixedKey($));if(j)try{return JSON.parse(j)}catch{return j}else return typeof defaultValues[$]=="object"?JSON.parse(JSON.stringify(defaultValues[$])):defaultValues[$]}async set($,j){return typeof j=="string"?localStorage.setItem(this.getPrefixedKey($),j):localStorage.setItem(this.getPrefixedKey($),JSON.stringify(j))}async delete($){return Promise.resolve(localStorage.removeItem(this.getPrefixedKey($)))}async subscribeToStorageChanged($){window.addEventListener("storage",j=>{j.key?$({eventType:"entryModified",key:this.getPrefixedKey(j.key),oldValue:j.oldValue,newValue:j.newValue}):$({eventType:"storageCleared",key:null,oldValue:null,newValue:null})},!1)}getPrefixedKey($){return this.prefix?`${this.prefix}-${$}`:$}}class Serializer{async serialize(_){const $=JSON.stringify(_);return bs58check$2.encode(Buffer$g.from($))}async deserialize(_){if(typeof _!="string")throw new Error("Encoded payload needs to be a string");return JSON.parse(bs58check$2.decode(_).toString())}}class AppMetadataManager{constructor(_){Yr(this,"storageManager");this.storageManager=new StorageManager(_,StorageKey.APP_METADATA_LIST)}async getAppMetadataList(){return await this.storageManager.getAll()??[]}async getAppMetadata(_){return this.storageManager.getOne($=>$.senderId===_)}async addAppMetadata(_){return this.storageManager.addOne(_,$=>$.senderId===_.senderId)}async removeAppMetadata(_){return this.storageManager.remove($=>$.senderId===_)}async removeAppMetadatas(_){return this.storageManager.remove($=>_.includes($.senderId))}async removeAllAppMetadata(){return this.storageManager.removeAll()}}class PermissionManager{constructor(_){Yr(this,"storageManager");this.storageManager=new StorageManager(_,StorageKey.PERMISSION_LIST)}async getPermissions(){return await this.storageManager.getAll()??[]}async getPermission(_){return this.storageManager.getOne($=>$.accountIdentifier===_)}async addPermission(_){return this.storageManager.addOne(_,$=>$.accountIdentifier===_.accountIdentifier&&$.senderId===_.senderId)}async removePermission(_){return this.storageManager.remove($=>$.accountIdentifier===_)}async removePermissions(_){return this.storageManager.remove($=>_.includes($.accountIdentifier))}async removeAllPermissions(){return this.storageManager.removeAll()}async hasPermission(_){return PermissionValidator.hasPermission(_,this.getPermission.bind(this),this.getPermissions.bind(this))}}class PeerManager{constructor(_,$){Yr(this,"storageManager");this.storageManager=new StorageManager(_,$)}async hasPeer(_){return!!await this.getPeer(_)}async getPeers(){return await this.storageManager.getAll()??[]}async getPeer(_){return this.storageManager.getOne($=>$.publicKey===_)}async addPeer(_){return this.storageManager.addOne(_,$=>$.publicKey===_.publicKey)}async removePeer(_){return this.storageManager.remove($=>$.publicKey===_)}async removePeers(_){return this.storageManager.remove($=>_.includes($.publicKey))}async removeAllPeers(){return this.storageManager.removeAll()}}var x25519Session={},keyagreement={},hasRequiredKeyagreement;function requireKeyagreement(){return hasRequiredKeyagreement||(hasRequiredKeyagreement=1,function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.X25519Session=a.SECRET_SEED_LENGTH=a.SAVED_STATE_LENGTH=a.ACCEPT_MESSAGE_LENGTH=a.OFFER_MESSAGE_LENGTH=void 0;const _=random,$=wipe$1,j=x25519,et=requireX25519Session();a.OFFER_MESSAGE_LENGTH=j.PUBLIC_KEY_LENGTH,a.ACCEPT_MESSAGE_LENGTH=j.PUBLIC_KEY_LENGTH,a.SAVED_STATE_LENGTH=j.SECRET_KEY_LENGTH,a.SECRET_SEED_LENGTH=j.SECRET_KEY_LENGTH;class tt{constructor(nt,it){this.offerMessageLength=a.OFFER_MESSAGE_LENGTH,this.acceptMessageLength=a.ACCEPT_MESSAGE_LENGTH,this.sharedKeyLength=j.SHARED_KEY_LENGTH,this.savedStateLength=a.SAVED_STATE_LENGTH,this._seed=nt||(0,_.randomBytes)(j.SECRET_KEY_LENGTH,it)}saveState(){return new Uint8Array(this._seed)}restoreState(nt){return this._seed=new Uint8Array(nt),this}clean(){this._seed&&(0,$.wipe)(this._seed),this._keyPair&&((0,$.wipe)(this._keyPair.secretKey),(0,$.wipe)(this._keyPair.publicKey)),this._sharedKey&&(0,$.wipe)(this._sharedKey),this._sessionKeys&&((0,$.wipe)(this._sessionKeys.receive),(0,$.wipe)(this._sessionKeys.send))}offer(){return this._keyPair=(0,j.generateKeyPairFromSeed)(this._seed),new Uint8Array(this._keyPair.publicKey)}accept(nt){if(this._keyPair)throw new Error("X25519Session: accept shouldn't be called by offering party");if(nt.length!==this.offerMessageLength)throw new Error("X25519Session: incorrect offer message length");if(this._sharedKey)throw new Error("X25519Session: accept was already called");const it=(0,j.generateKeyPairFromSeed)(this._seed);return this._sharedKey=(0,j.sharedKey)(it.secretKey,nt),this._sessionKeys=(0,et.clientSessionKeysFromSharedKey)(this._sharedKey,it.publicKey,nt),(0,$.wipe)(it.secretKey),it.publicKey}finish(nt){if(nt.length!==this.acceptMessageLength)throw new Error("X25519Session: incorrect accept message length");if(!this._keyPair)throw new Error("X25519Session: no offer state");if(this._sharedKey)throw new Error("X25519Session: finish was already called");return this._sharedKey=(0,j.sharedKey)(this._keyPair.secretKey,nt),this._sessionKeys=(0,et.serverSessionKeysFromSharedKey)(this._sharedKey,this._keyPair.publicKey,nt),this}getSharedKey(){if(!this._sharedKey)throw new Error("X25519Session: no shared key established");return new Uint8Array(this._sharedKey)}getSessionKeys(){if(!this._sessionKeys)throw new Error("X25519Session: no shared key established");return{receive:new Uint8Array(this._sessionKeys.receive),send:new Uint8Array(this._sessionKeys.send)}}}a.X25519Session=tt}(keyagreement)),keyagreement}var hasRequiredX25519Session;function requireX25519Session(){return hasRequiredX25519Session||(hasRequiredX25519Session=1,function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.clientSessionKeys=a.serverSessionKeys=a.clientSessionKeysFromSharedKey=a.serverSessionKeysFromSharedKey=a.X25519Session=void 0;const _=blake2b$1,$=x25519;var j=requireKeyagreement();Object.defineProperty(a,"X25519Session",{enumerable:!0,get:function(){return j.X25519Session}});const et=32;function tt(st,ot,at,ut=_.BLAKE2b){const ht=new ut;if(ht.digestLength!==et*2)throw new Error("X25519: incorrect digest length");const yt=ht.update(st).update(at).update(ot).digest();return{send:yt.subarray(0,et),receive:yt.subarray(et)}}a.serverSessionKeysFromSharedKey=tt;function rt(st,ot,at,ut=_.BLAKE2b){const ht=new ut;if(ht.digestLength!==et*2)throw new Error("X25519: incorrect digest length");const yt=ht.update(st).update(ot).update(at).digest();return{receive:yt.subarray(0,et),send:yt.subarray(et)}}a.clientSessionKeysFromSharedKey=rt;function nt(st,ot,at=_.BLAKE2b){const ut=(0,$.sharedKey)(st.secretKey,ot);return tt(ut,st.publicKey,ot,at)}a.serverSessionKeys=nt;function it(st,ot,at=_.BLAKE2b){const ut=(0,$.sharedKey)(st.secretKey,ot);return rt(ut,st.publicKey,ot,at)}a.clientSessionKeys=it}(x25519Session)),x25519Session}var x25519SessionExports=requireX25519Session();class CommunicationClient{constructor(_){Yr(this,"keyPair");Yr(this,"eventHandlers",new Map);Yr(this,"isMobileOS",()=>/(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet|Windows Phone|SymbianOS|Kindle)/i.test(navigator.userAgent));this.keyPair=_}async getPublicKey(){var _;return toHex$1((_=this.keyPair)==null?void 0:_.publicKey)}async getPublicKeyHash(){return getHexHash(this.keyPair.publicKey)}async createCryptoBoxServer(_,$){return x25519SessionExports.serverSessionKeys({publicKey:ed25519.convertPublicKeyToX25519($.publicKey),secretKey:ed25519.convertSecretKeyToX25519($.secretKey)},ed25519.convertPublicKeyToX25519(Buffer$g.from(_,"hex")))}async createCryptoBoxClient(_,$){return x25519SessionExports.clientSessionKeys({publicKey:ed25519.convertPublicKeyToX25519($.publicKey),secretKey:ed25519.convertSecretKeyToX25519($.secretKey)},ed25519.convertPublicKeyToX25519(Buffer$g.from(_,"hex")))}async encryptMessageAsymmetric(_,$){return sealCryptobox($,Buffer$g.from(_,"hex"))}}function bind$2(a,_){return function(){return a.apply(_,arguments)}}const{toString:toString$4}=Object.prototype,{getPrototypeOf:getPrototypeOf$4}=Object,kindOf$1=(a=>_=>{const $=toString$4.call(_);return a[$]||(a[$]=$.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest$1=a=>(a=a.toLowerCase(),_=>kindOf$1(_)===a),typeOfTest$1=a=>_=>typeof _===a,{isArray:isArray$4}=Array,isUndefined$1=typeOfTest$1("undefined");function isBuffer$2(a){return a!==null&&!isUndefined$1(a)&&a.constructor!==null&&!isUndefined$1(a.constructor)&&isFunction$3(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const isArrayBuffer$1=kindOfTest$1("ArrayBuffer");function isArrayBufferView$1(a){let _;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?_=ArrayBuffer.isView(a):_=a&&a.buffer&&isArrayBuffer$1(a.buffer),_}const isString$2=typeOfTest$1("string"),isFunction$3=typeOfTest$1("function"),isNumber$1=typeOfTest$1("number"),isObject$3=a=>a!==null&&typeof a=="object",isBoolean$2=a=>a===!0||a===!1,isPlainObject$5=a=>{if(kindOf$1(a)!=="object")return!1;const _=getPrototypeOf$4(a);return(_===null||_===Object.prototype||Object.getPrototypeOf(_)===null)&&!(Symbol.toStringTag in a)&&!(Symbol.iterator in a)},isDate$2=kindOfTest$1("Date"),isFile$1=kindOfTest$1("File"),isBlob$1=kindOfTest$1("Blob"),isFileList$1=kindOfTest$1("FileList"),isStream$1=a=>isObject$3(a)&&isFunction$3(a.pipe),isFormData$1=a=>{let _;return a&&(typeof FormData=="function"&&a instanceof FormData||isFunction$3(a.append)&&((_=kindOf$1(a))==="formdata"||_==="object"&&isFunction$3(a.toString)&&a.toString()==="[object FormData]"))},isURLSearchParams$1=kindOfTest$1("URLSearchParams"),trim$2=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach$1(a,_,{allOwnKeys:$=!1}={}){if(a===null||typeof a>"u")return;let j,et;if(typeof a!="object"&&(a=[a]),isArray$4(a))for(j=0,et=a.length;j0;)if(et=$[j],_===et.toLowerCase())return et;return null}const _global$1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined$1=a=>!isUndefined$1(a)&&a!==_global$1;function merge$1(){const{caseless:a}=isContextDefined$1(this)&&this||{},_={},$=(j,et)=>{const tt=a&&findKey$2(_,et)||et;isPlainObject$5(_[tt])&&isPlainObject$5(j)?_[tt]=merge$1(_[tt],j):isPlainObject$5(j)?_[tt]=merge$1({},j):isArray$4(j)?_[tt]=j.slice():_[tt]=j};for(let j=0,et=arguments.length;j(forEach$1(_,(et,tt)=>{$&&isFunction$3(et)?a[tt]=bind$2(et,$):a[tt]=et},{allOwnKeys:j}),a),stripBOM$1=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),inherits$4=(a,_,$,j)=>{a.prototype=Object.create(_.prototype,j),a.prototype.constructor=a,Object.defineProperty(a,"super",{value:_.prototype}),$&&Object.assign(a.prototype,$)},toFlatObject$1=(a,_,$,j)=>{let et,tt,rt;const nt={};if(_=_||{},a==null)return _;do{for(et=Object.getOwnPropertyNames(a),tt=et.length;tt-- >0;)rt=et[tt],(!j||j(rt,a,_))&&!nt[rt]&&(_[rt]=a[rt],nt[rt]=!0);a=$!==!1&&getPrototypeOf$4(a)}while(a&&(!$||$(a,_))&&a!==Object.prototype);return _},endsWith$1=(a,_,$)=>{a=String(a),($===void 0||$>a.length)&&($=a.length),$-=_.length;const j=a.indexOf(_,$);return j!==-1&&j===$},toArray$2=a=>{if(!a)return null;if(isArray$4(a))return a;let _=a.length;if(!isNumber$1(_))return null;const $=new Array(_);for(;_-- >0;)$[_]=a[_];return $},isTypedArray$1=(a=>_=>a&&_ instanceof a)(typeof Uint8Array<"u"&&getPrototypeOf$4(Uint8Array)),forEachEntry$1=(a,_)=>{const j=(a&&a[Symbol.iterator]).call(a);let et;for(;(et=j.next())&&!et.done;){const tt=et.value;_.call(a,tt[0],tt[1])}},matchAll$1=(a,_)=>{let $;const j=[];for(;($=a.exec(_))!==null;)j.push($);return j},isHTMLForm$1=kindOfTest$1("HTMLFormElement"),toCamelCase$1=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function($,j,et){return j.toUpperCase()+et}),hasOwnProperty$1=(({hasOwnProperty:a})=>(_,$)=>a.call(_,$))(Object.prototype),isRegExp$1=kindOfTest$1("RegExp"),reduceDescriptors$1=(a,_)=>{const $=Object.getOwnPropertyDescriptors(a),j={};forEach$1($,(et,tt)=>{let rt;(rt=_(et,tt,a))!==!1&&(j[tt]=rt||et)}),Object.defineProperties(a,j)},freezeMethods$1=a=>{reduceDescriptors$1(a,(_,$)=>{if(isFunction$3(a)&&["arguments","caller","callee"].indexOf($)!==-1)return!1;const j=a[$];if(isFunction$3(j)){if(_.enumerable=!1,"writable"in _){_.writable=!1;return}_.set||(_.set=()=>{throw Error("Can not rewrite read-only method '"+$+"'")})}})},toObjectSet$1=(a,_)=>{const $={},j=et=>{et.forEach(tt=>{$[tt]=!0})};return isArray$4(a)?j(a):j(String(a).split(_)),$},noop$7=()=>{},toFiniteNumber$1=(a,_)=>(a=+a,Number.isFinite(a)?a:_),ALPHA$1="abcdefghijklmnopqrstuvwxyz",DIGIT$1="0123456789",ALPHABET$2={DIGIT:DIGIT$1,ALPHA:ALPHA$1,ALPHA_DIGIT:ALPHA$1+ALPHA$1.toUpperCase()+DIGIT$1},generateString$1=(a=16,_=ALPHABET$2.ALPHA_DIGIT)=>{let $="";const{length:j}=_;for(;a--;)$+=_[Math.random()*j|0];return $};function isSpecCompliantForm$1(a){return!!(a&&isFunction$3(a.append)&&a[Symbol.toStringTag]==="FormData"&&a[Symbol.iterator])}const toJSONObject$1=a=>{const _=new Array(10),$=(j,et)=>{if(isObject$3(j)){if(_.indexOf(j)>=0)return;if(!("toJSON"in j)){_[et]=j;const tt=isArray$4(j)?[]:{};return forEach$1(j,(rt,nt)=>{const it=$(rt,et+1);!isUndefined$1(it)&&(tt[nt]=it)}),_[et]=void 0,tt}}return j};return $(a,0)},isAsyncFn$1=kindOfTest$1("AsyncFunction"),isThenable$2=a=>a&&(isObject$3(a)||isFunction$3(a))&&isFunction$3(a.then)&&isFunction$3(a.catch),utils$i={isArray:isArray$4,isArrayBuffer:isArrayBuffer$1,isBuffer:isBuffer$2,isFormData:isFormData$1,isArrayBufferView:isArrayBufferView$1,isString:isString$2,isNumber:isNumber$1,isBoolean:isBoolean$2,isObject:isObject$3,isPlainObject:isPlainObject$5,isUndefined:isUndefined$1,isDate:isDate$2,isFile:isFile$1,isBlob:isBlob$1,isRegExp:isRegExp$1,isFunction:isFunction$3,isStream:isStream$1,isURLSearchParams:isURLSearchParams$1,isTypedArray:isTypedArray$1,isFileList:isFileList$1,forEach:forEach$1,merge:merge$1,extend:extend$1,trim:trim$2,stripBOM:stripBOM$1,inherits:inherits$4,toFlatObject:toFlatObject$1,kindOf:kindOf$1,kindOfTest:kindOfTest$1,endsWith:endsWith$1,toArray:toArray$2,forEachEntry:forEachEntry$1,matchAll:matchAll$1,isHTMLForm:isHTMLForm$1,hasOwnProperty:hasOwnProperty$1,hasOwnProp:hasOwnProperty$1,reduceDescriptors:reduceDescriptors$1,freezeMethods:freezeMethods$1,toObjectSet:toObjectSet$1,toCamelCase:toCamelCase$1,noop:noop$7,toFiniteNumber:toFiniteNumber$1,findKey:findKey$2,global:_global$1,isContextDefined:isContextDefined$1,ALPHABET:ALPHABET$2,generateString:generateString$1,isSpecCompliantForm:isSpecCompliantForm$1,toJSONObject:toJSONObject$1,isAsyncFn:isAsyncFn$1,isThenable:isThenable$2};function AxiosError$1(a,_,$,j,et){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=a,this.name="AxiosError",_&&(this.code=_),$&&(this.config=$),j&&(this.request=j),et&&(this.response=et)}utils$i.inherits(AxiosError$1,Error,{toJSON:function a(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$i.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$3=AxiosError$1.prototype,descriptors$1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(a=>{descriptors$1[a]={value:a}});Object.defineProperties(AxiosError$1,descriptors$1);Object.defineProperty(prototype$3,"isAxiosError",{value:!0});AxiosError$1.from=(a,_,$,j,et,tt)=>{const rt=Object.create(prototype$3);return utils$i.toFlatObject(a,rt,function(it){return it!==Error.prototype},nt=>nt!=="isAxiosError"),AxiosError$1.call(rt,a.message,_,$,j,et),rt.cause=a,rt.name=a.name,tt&&Object.assign(rt,tt),rt};const httpAdapter$1=null;function isVisitable$1(a){return utils$i.isPlainObject(a)||utils$i.isArray(a)}function removeBrackets$1(a){return utils$i.endsWith(a,"[]")?a.slice(0,-2):a}function renderKey$1(a,_,$){return a?a.concat(_).map(function(et,tt){return et=removeBrackets$1(et),!$&&tt?"["+et+"]":et}).join($?".":""):_}function isFlatArray$1(a){return utils$i.isArray(a)&&!a.some(isVisitable$1)}const predicates$1=utils$i.toFlatObject(utils$i,{},null,function a(_){return/^is[A-Z]/.test(_)});function toFormData$1(a,_,$){if(!utils$i.isObject(a))throw new TypeError("target must be an object");_=_||new FormData,$=utils$i.toFlatObject($,{metaTokens:!0,dots:!1,indexes:!1},!1,function(wt,Ct){return!utils$i.isUndefined(Ct[wt])});const j=$.metaTokens,et=$.visitor||ot,tt=$.dots,rt=$.indexes,it=($.Blob||typeof Blob<"u"&&Blob)&&utils$i.isSpecCompliantForm(_);if(!utils$i.isFunction(et))throw new TypeError("visitor must be a function");function st(yt){if(yt===null)return"";if(utils$i.isDate(yt))return yt.toISOString();if(!it&&utils$i.isBlob(yt))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$i.isArrayBuffer(yt)||utils$i.isTypedArray(yt)?it&&typeof Blob=="function"?new Blob([yt]):Buffer$g.from(yt):yt}function ot(yt,wt,Ct){let Pt=yt;if(yt&&!Ct&&typeof yt=="object"){if(utils$i.endsWith(wt,"{}"))wt=j?wt:wt.slice(0,-2),yt=JSON.stringify(yt);else if(utils$i.isArray(yt)&&isFlatArray$1(yt)||(utils$i.isFileList(yt)||utils$i.endsWith(wt,"[]"))&&(Pt=utils$i.toArray(yt)))return wt=removeBrackets$1(wt),Pt.forEach(function(Mt,Bt){!(utils$i.isUndefined(Mt)||Mt===null)&&_.append(rt===!0?renderKey$1([wt],Bt,tt):rt===null?wt:wt+"[]",st(Mt))}),!1}return isVisitable$1(yt)?!0:(_.append(renderKey$1(Ct,wt,tt),st(yt)),!1)}const at=[],ut=Object.assign(predicates$1,{defaultVisitor:ot,convertValue:st,isVisitable:isVisitable$1});function ht(yt,wt){if(!utils$i.isUndefined(yt)){if(at.indexOf(yt)!==-1)throw Error("Circular reference detected in "+wt.join("."));at.push(yt),utils$i.forEach(yt,function(Pt,$t){(!(utils$i.isUndefined(Pt)||Pt===null)&&et.call(_,Pt,utils$i.isString($t)?$t.trim():$t,wt,ut))===!0&&ht(Pt,wt?wt.concat($t):[$t])}),at.pop()}}if(!utils$i.isObject(a))throw new TypeError("data must be an object");return ht(a),_}function encode$6(a){const _={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(j){return _[j]})}function AxiosURLSearchParams$1(a,_){this._pairs=[],a&&toFormData$1(a,this,_)}const prototype$2=AxiosURLSearchParams$1.prototype;prototype$2.append=function a(_,$){this._pairs.push([_,$])};prototype$2.toString=function a(_){const $=_?function(j){return _.call(this,j,encode$6)}:encode$6;return this._pairs.map(function(et){return $(et[0])+"="+$(et[1])},"").join("&")};function encode$5(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL$1(a,_,$){if(!_)return a;const j=$&&$.encode||encode$5,et=$&&$.serialize;let tt;if(et?tt=et(_,$):tt=utils$i.isURLSearchParams(_)?_.toString():new AxiosURLSearchParams$1(_,$).toString(j),tt){const rt=a.indexOf("#");rt!==-1&&(a=a.slice(0,rt)),a+=(a.indexOf("?")===-1?"?":"&")+tt}return a}let InterceptorManager$1=class{constructor(){this.handlers=[]}use(_,$,j){return this.handlers.push({fulfilled:_,rejected:$,synchronous:j?j.synchronous:!1,runWhen:j?j.runWhen:null}),this.handlers.length-1}eject(_){this.handlers[_]&&(this.handlers[_]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(_){utils$i.forEach(this.handlers,function(j){j!==null&&_(j)})}};const transitionalDefaults$1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$2=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams$1,FormData$2=typeof FormData<"u"?FormData:null,Blob$2=typeof Blob<"u"?Blob:null,platform$3={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$2,FormData:FormData$2,Blob:Blob$2},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv$1=typeof window<"u"&&typeof document<"u",hasStandardBrowserEnv$1=(a=>hasBrowserEnv$1&&["ReactNative","NativeScript","NS"].indexOf(a)<0)(typeof navigator<"u"&&navigator.product),hasStandardBrowserWebWorkerEnv$1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",utils$h=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:hasBrowserEnv$1,hasStandardBrowserEnv:hasStandardBrowserEnv$1,hasStandardBrowserWebWorkerEnv:hasStandardBrowserWebWorkerEnv$1},Symbol.toStringTag,{value:"Module"})),platform$2={...utils$h,...platform$3};function toURLEncodedForm$1(a,_){return toFormData$1(a,new platform$2.classes.URLSearchParams,Object.assign({visitor:function($,j,et,tt){return platform$2.isNode&&utils$i.isBuffer($)?(this.append(j,$.toString("base64")),!1):tt.defaultVisitor.apply(this,arguments)}},_))}function parsePropPath$1(a){return utils$i.matchAll(/\w+|\[(\w*)]/g,a).map(_=>_[0]==="[]"?"":_[1]||_[0])}function arrayToObject$1(a){const _={},$=Object.keys(a);let j;const et=$.length;let tt;for(j=0;j=$.length;return rt=!rt&&utils$i.isArray(et)?et.length:rt,it?(utils$i.hasOwnProp(et,rt)?et[rt]=[et[rt],j]:et[rt]=j,!nt):((!et[rt]||!utils$i.isObject(et[rt]))&&(et[rt]=[]),_($,j,et[rt],tt)&&utils$i.isArray(et[rt])&&(et[rt]=arrayToObject$1(et[rt])),!nt)}if(utils$i.isFormData(a)&&utils$i.isFunction(a.entries)){const $={};return utils$i.forEachEntry(a,(j,et)=>{_(parsePropPath$1(j),et,$,0)}),$}return null}function stringifySafely$1(a,_,$){if(utils$i.isString(a))try{return(_||JSON.parse)(a),utils$i.trim(a)}catch(j){if(j.name!=="SyntaxError")throw j}return($||JSON.stringify)(a)}const defaults$2={transitional:transitionalDefaults$1,adapter:["xhr","http"],transformRequest:[function a(_,$){const j=$.getContentType()||"",et=j.indexOf("application/json")>-1,tt=utils$i.isObject(_);if(tt&&utils$i.isHTMLForm(_)&&(_=new FormData(_)),utils$i.isFormData(_))return et&&et?JSON.stringify(formDataToJSON$1(_)):_;if(utils$i.isArrayBuffer(_)||utils$i.isBuffer(_)||utils$i.isStream(_)||utils$i.isFile(_)||utils$i.isBlob(_))return _;if(utils$i.isArrayBufferView(_))return _.buffer;if(utils$i.isURLSearchParams(_))return $.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),_.toString();let nt;if(tt){if(j.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm$1(_,this.formSerializer).toString();if((nt=utils$i.isFileList(_))||j.indexOf("multipart/form-data")>-1){const it=this.env&&this.env.FormData;return toFormData$1(nt?{"files[]":_}:_,it&&new it,this.formSerializer)}}return tt||et?($.setContentType("application/json",!1),stringifySafely$1(_)):_}],transformResponse:[function a(_){const $=this.transitional||defaults$2.transitional,j=$&&$.forcedJSONParsing,et=this.responseType==="json";if(_&&utils$i.isString(_)&&(j&&!this.responseType||et)){const rt=!($&&$.silentJSONParsing)&&et;try{return JSON.parse(_)}catch(nt){if(rt)throw nt.name==="SyntaxError"?AxiosError$1.from(nt,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):nt}}return _}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform$2.classes.FormData,Blob:platform$2.classes.Blob},validateStatus:function a(_){return _>=200&&_<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$i.forEach(["delete","get","head","post","put","patch"],a=>{defaults$2.headers[a]={}});const ignoreDuplicateOf$1=utils$i.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders$1=a=>{const _={};let $,j,et;return a&&a.split(` +`))},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}Object.defineProperty(node$2,"__esModule",{value:!0});node$2.NodeRandomSource=void 0;const wipe_1$4=wipe$1;class NodeRandomSource{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof commonjsRequire<"u"){const _=requireCryptoBrowserify();_&&_.randomBytes&&(this._crypto=_,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(_){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let $=this._crypto.randomBytes(_);if($.length!==_)throw new Error("NodeRandomSource: got fewer bytes than requested");const j=new Uint8Array(_);for(let et=0;et>>16&65535,ot=nt&65535,at=it>>>16&65535,ut=it&65535;return ot*ut+(st*ut+ot*at<<16>>>0)|0}a.mul=Math.imul||_;function $(nt,it){return nt+it|0}a.add=$;function j(nt,it){return nt-it|0}a.sub=j;function et(nt,it){return nt<>>32-it}a.rotl=et;function tt(nt,it){return nt<<32-it|nt>>>it}a.rotr=tt;function rt(nt){return typeof nt=="number"&&isFinite(nt)&&Math.floor(nt)===nt}a.isInteger=Number.isInteger||rt,a.MAX_SAFE_INTEGER=9007199254740991,a.isSafeInteger=function(nt){return a.isInteger(nt)&&nt>=-a.MAX_SAFE_INTEGER&&nt<=a.MAX_SAFE_INTEGER}})(int);Object.defineProperty(binary,"__esModule",{value:!0});var int_1=int;function readInt16BE(a,_){return _===void 0&&(_=0),(a[_+0]<<8|a[_+1])<<16>>16}binary.readInt16BE=readInt16BE;function readUint16BE(a,_){return _===void 0&&(_=0),(a[_+0]<<8|a[_+1])>>>0}binary.readUint16BE=readUint16BE;function readInt16LE(a,_){return _===void 0&&(_=0),(a[_+1]<<8|a[_])<<16>>16}binary.readInt16LE=readInt16LE;function readUint16LE(a,_){return _===void 0&&(_=0),(a[_+1]<<8|a[_])>>>0}binary.readUint16LE=readUint16LE;function writeUint16BE(a,_,$){return _===void 0&&(_=new Uint8Array(2)),$===void 0&&($=0),_[$+0]=a>>>8,_[$+1]=a>>>0,_}binary.writeUint16BE=writeUint16BE;binary.writeInt16BE=writeUint16BE;function writeUint16LE(a,_,$){return _===void 0&&(_=new Uint8Array(2)),$===void 0&&($=0),_[$+0]=a>>>0,_[$+1]=a>>>8,_}binary.writeUint16LE=writeUint16LE;binary.writeInt16LE=writeUint16LE;function readInt32BE(a,_){return _===void 0&&(_=0),a[_]<<24|a[_+1]<<16|a[_+2]<<8|a[_+3]}binary.readInt32BE=readInt32BE;function readUint32BE(a,_){return _===void 0&&(_=0),(a[_]<<24|a[_+1]<<16|a[_+2]<<8|a[_+3])>>>0}binary.readUint32BE=readUint32BE;function readInt32LE(a,_){return _===void 0&&(_=0),a[_+3]<<24|a[_+2]<<16|a[_+1]<<8|a[_]}binary.readInt32LE=readInt32LE;function readUint32LE(a,_){return _===void 0&&(_=0),(a[_+3]<<24|a[_+2]<<16|a[_+1]<<8|a[_])>>>0}binary.readUint32LE=readUint32LE;function writeUint32BE(a,_,$){return _===void 0&&(_=new Uint8Array(4)),$===void 0&&($=0),_[$+0]=a>>>24,_[$+1]=a>>>16,_[$+2]=a>>>8,_[$+3]=a>>>0,_}binary.writeUint32BE=writeUint32BE;binary.writeInt32BE=writeUint32BE;function writeUint32LE(a,_,$){return _===void 0&&(_=new Uint8Array(4)),$===void 0&&($=0),_[$+0]=a>>>0,_[$+1]=a>>>8,_[$+2]=a>>>16,_[$+3]=a>>>24,_}binary.writeUint32LE=writeUint32LE;binary.writeInt32LE=writeUint32LE;function readInt64BE(a,_){_===void 0&&(_=0);var $=readInt32BE(a,_),j=readInt32BE(a,_+4);return $*4294967296+j-(j>>31)*4294967296}binary.readInt64BE=readInt64BE;function readUint64BE(a,_){_===void 0&&(_=0);var $=readUint32BE(a,_),j=readUint32BE(a,_+4);return $*4294967296+j}binary.readUint64BE=readUint64BE;function readInt64LE(a,_){_===void 0&&(_=0);var $=readInt32LE(a,_),j=readInt32LE(a,_+4);return j*4294967296+$-($>>31)*4294967296}binary.readInt64LE=readInt64LE;function readUint64LE(a,_){_===void 0&&(_=0);var $=readUint32LE(a,_),j=readUint32LE(a,_+4);return j*4294967296+$}binary.readUint64LE=readUint64LE;function writeUint64BE(a,_,$){return _===void 0&&(_=new Uint8Array(8)),$===void 0&&($=0),writeUint32BE(a/4294967296>>>0,_,$),writeUint32BE(a>>>0,_,$+4),_}binary.writeUint64BE=writeUint64BE;binary.writeInt64BE=writeUint64BE;function writeUint64LE(a,_,$){return _===void 0&&(_=new Uint8Array(8)),$===void 0&&($=0),writeUint32LE(a>>>0,_,$),writeUint32LE(a/4294967296>>>0,_,$+4),_}binary.writeUint64LE=writeUint64LE;binary.writeInt64LE=writeUint64LE;function readUintBE(a,_,$){if($===void 0&&($=0),a%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(a/8>_.length-$)throw new Error("readUintBE: array is too short for the given bitLength");for(var j=0,et=1,tt=a/8+$-1;tt>=$;tt--)j+=_[tt]*et,et*=256;return j}binary.readUintBE=readUintBE;function readUintLE(a,_,$){if($===void 0&&($=0),a%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(a/8>_.length-$)throw new Error("readUintLE: array is too short for the given bitLength");for(var j=0,et=1,tt=$;tt<$+a/8;tt++)j+=_[tt]*et,et*=256;return j}binary.readUintLE=readUintLE;function writeUintBE(a,_,$,j){if($===void 0&&($=new Uint8Array(a/8)),j===void 0&&(j=0),a%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(_))throw new Error("writeUintBE value must be an integer");for(var et=1,tt=a/8+j-1;tt>=j;tt--)$[tt]=_/et&255,et*=256;return $}binary.writeUintBE=writeUintBE;function writeUintLE(a,_,$,j){if($===void 0&&($=new Uint8Array(a/8)),j===void 0&&(j=0),a%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(_))throw new Error("writeUintLE value must be an integer");for(var et=1,tt=j;tt256)throw new Error("randomString charset is too long");let ut="";const ht=ot.length,yt=256-256%ht;for(;st>0;){const wt=et(Math.ceil(st*256/yt),at);for(let Ct=0;Ct0;Ct++){const Pt=wt[Ct];Pt>16&1),zt[Ft-1]&=65535;zt[15]=Ot[15]-32767-(zt[14]>>16&1);const Lt=zt[15]>>16&1;zt[14]&=65535,nt(Ot,zt,1-Lt)}for(let It=0;It<16;It++)Bt[2*It]=Ot[It]&255,Bt[2*It+1]=Ot[It]>>8}function st(Bt,Dt){for(let zt=0;zt<16;zt++)Bt[zt]=Dt[2*zt]+(Dt[2*zt+1]<<8);Bt[15]&=32767}function ot(Bt,Dt,zt){for(let Ot=0;Ot<16;Ot++)Bt[Ot]=Dt[Ot]+zt[Ot]}function at(Bt,Dt,zt){for(let Ot=0;Ot<16;Ot++)Bt[Ot]=Dt[Ot]-zt[Ot]}function ut(Bt,Dt,zt){let Ot,It,Lt=0,Ft=0,jt=0,bt=0,vt=0,ct=0,dt=0,mt=0,xt=0,At=0,Rt=0,St=0,Tt=0,Et=0,Nt=0,tr=0,ir=0,nr=0,Zt=0,Kt=0,Qt=0,Ht=0,qt=0,Jt=0,ur=0,xr=0,pr=0,Cr=0,Mr=0,lr=0,fr=0,_r=zt[0],Sr=zt[1],kr=zt[2],Ar=zt[3],$r=zt[4],Or=zt[5],Br=zt[6],or=zt[7],Yt=zt[8],er=zt[9],Gt=zt[10],Vt=zt[11],Wt=zt[12],ar=zt[13],yr=zt[14],Er=zt[15];Ot=Dt[0],Lt+=Ot*_r,Ft+=Ot*Sr,jt+=Ot*kr,bt+=Ot*Ar,vt+=Ot*$r,ct+=Ot*Or,dt+=Ot*Br,mt+=Ot*or,xt+=Ot*Yt,At+=Ot*er,Rt+=Ot*Gt,St+=Ot*Vt,Tt+=Ot*Wt,Et+=Ot*ar,Nt+=Ot*yr,tr+=Ot*Er,Ot=Dt[1],Ft+=Ot*_r,jt+=Ot*Sr,bt+=Ot*kr,vt+=Ot*Ar,ct+=Ot*$r,dt+=Ot*Or,mt+=Ot*Br,xt+=Ot*or,At+=Ot*Yt,Rt+=Ot*er,St+=Ot*Gt,Tt+=Ot*Vt,Et+=Ot*Wt,Nt+=Ot*ar,tr+=Ot*yr,ir+=Ot*Er,Ot=Dt[2],jt+=Ot*_r,bt+=Ot*Sr,vt+=Ot*kr,ct+=Ot*Ar,dt+=Ot*$r,mt+=Ot*Or,xt+=Ot*Br,At+=Ot*or,Rt+=Ot*Yt,St+=Ot*er,Tt+=Ot*Gt,Et+=Ot*Vt,Nt+=Ot*Wt,tr+=Ot*ar,ir+=Ot*yr,nr+=Ot*Er,Ot=Dt[3],bt+=Ot*_r,vt+=Ot*Sr,ct+=Ot*kr,dt+=Ot*Ar,mt+=Ot*$r,xt+=Ot*Or,At+=Ot*Br,Rt+=Ot*or,St+=Ot*Yt,Tt+=Ot*er,Et+=Ot*Gt,Nt+=Ot*Vt,tr+=Ot*Wt,ir+=Ot*ar,nr+=Ot*yr,Zt+=Ot*Er,Ot=Dt[4],vt+=Ot*_r,ct+=Ot*Sr,dt+=Ot*kr,mt+=Ot*Ar,xt+=Ot*$r,At+=Ot*Or,Rt+=Ot*Br,St+=Ot*or,Tt+=Ot*Yt,Et+=Ot*er,Nt+=Ot*Gt,tr+=Ot*Vt,ir+=Ot*Wt,nr+=Ot*ar,Zt+=Ot*yr,Kt+=Ot*Er,Ot=Dt[5],ct+=Ot*_r,dt+=Ot*Sr,mt+=Ot*kr,xt+=Ot*Ar,At+=Ot*$r,Rt+=Ot*Or,St+=Ot*Br,Tt+=Ot*or,Et+=Ot*Yt,Nt+=Ot*er,tr+=Ot*Gt,ir+=Ot*Vt,nr+=Ot*Wt,Zt+=Ot*ar,Kt+=Ot*yr,Qt+=Ot*Er,Ot=Dt[6],dt+=Ot*_r,mt+=Ot*Sr,xt+=Ot*kr,At+=Ot*Ar,Rt+=Ot*$r,St+=Ot*Or,Tt+=Ot*Br,Et+=Ot*or,Nt+=Ot*Yt,tr+=Ot*er,ir+=Ot*Gt,nr+=Ot*Vt,Zt+=Ot*Wt,Kt+=Ot*ar,Qt+=Ot*yr,Ht+=Ot*Er,Ot=Dt[7],mt+=Ot*_r,xt+=Ot*Sr,At+=Ot*kr,Rt+=Ot*Ar,St+=Ot*$r,Tt+=Ot*Or,Et+=Ot*Br,Nt+=Ot*or,tr+=Ot*Yt,ir+=Ot*er,nr+=Ot*Gt,Zt+=Ot*Vt,Kt+=Ot*Wt,Qt+=Ot*ar,Ht+=Ot*yr,qt+=Ot*Er,Ot=Dt[8],xt+=Ot*_r,At+=Ot*Sr,Rt+=Ot*kr,St+=Ot*Ar,Tt+=Ot*$r,Et+=Ot*Or,Nt+=Ot*Br,tr+=Ot*or,ir+=Ot*Yt,nr+=Ot*er,Zt+=Ot*Gt,Kt+=Ot*Vt,Qt+=Ot*Wt,Ht+=Ot*ar,qt+=Ot*yr,Jt+=Ot*Er,Ot=Dt[9],At+=Ot*_r,Rt+=Ot*Sr,St+=Ot*kr,Tt+=Ot*Ar,Et+=Ot*$r,Nt+=Ot*Or,tr+=Ot*Br,ir+=Ot*or,nr+=Ot*Yt,Zt+=Ot*er,Kt+=Ot*Gt,Qt+=Ot*Vt,Ht+=Ot*Wt,qt+=Ot*ar,Jt+=Ot*yr,ur+=Ot*Er,Ot=Dt[10],Rt+=Ot*_r,St+=Ot*Sr,Tt+=Ot*kr,Et+=Ot*Ar,Nt+=Ot*$r,tr+=Ot*Or,ir+=Ot*Br,nr+=Ot*or,Zt+=Ot*Yt,Kt+=Ot*er,Qt+=Ot*Gt,Ht+=Ot*Vt,qt+=Ot*Wt,Jt+=Ot*ar,ur+=Ot*yr,xr+=Ot*Er,Ot=Dt[11],St+=Ot*_r,Tt+=Ot*Sr,Et+=Ot*kr,Nt+=Ot*Ar,tr+=Ot*$r,ir+=Ot*Or,nr+=Ot*Br,Zt+=Ot*or,Kt+=Ot*Yt,Qt+=Ot*er,Ht+=Ot*Gt,qt+=Ot*Vt,Jt+=Ot*Wt,ur+=Ot*ar,xr+=Ot*yr,pr+=Ot*Er,Ot=Dt[12],Tt+=Ot*_r,Et+=Ot*Sr,Nt+=Ot*kr,tr+=Ot*Ar,ir+=Ot*$r,nr+=Ot*Or,Zt+=Ot*Br,Kt+=Ot*or,Qt+=Ot*Yt,Ht+=Ot*er,qt+=Ot*Gt,Jt+=Ot*Vt,ur+=Ot*Wt,xr+=Ot*ar,pr+=Ot*yr,Cr+=Ot*Er,Ot=Dt[13],Et+=Ot*_r,Nt+=Ot*Sr,tr+=Ot*kr,ir+=Ot*Ar,nr+=Ot*$r,Zt+=Ot*Or,Kt+=Ot*Br,Qt+=Ot*or,Ht+=Ot*Yt,qt+=Ot*er,Jt+=Ot*Gt,ur+=Ot*Vt,xr+=Ot*Wt,pr+=Ot*ar,Cr+=Ot*yr,Mr+=Ot*Er,Ot=Dt[14],Nt+=Ot*_r,tr+=Ot*Sr,ir+=Ot*kr,nr+=Ot*Ar,Zt+=Ot*$r,Kt+=Ot*Or,Qt+=Ot*Br,Ht+=Ot*or,qt+=Ot*Yt,Jt+=Ot*er,ur+=Ot*Gt,xr+=Ot*Vt,pr+=Ot*Wt,Cr+=Ot*ar,Mr+=Ot*yr,lr+=Ot*Er,Ot=Dt[15],tr+=Ot*_r,ir+=Ot*Sr,nr+=Ot*kr,Zt+=Ot*Ar,Kt+=Ot*$r,Qt+=Ot*Or,Ht+=Ot*Br,qt+=Ot*or,Jt+=Ot*Yt,ur+=Ot*er,xr+=Ot*Gt,pr+=Ot*Vt,Cr+=Ot*Wt,Mr+=Ot*ar,lr+=Ot*yr,fr+=Ot*Er,Lt+=38*ir,Ft+=38*nr,jt+=38*Zt,bt+=38*Kt,vt+=38*Qt,ct+=38*Ht,dt+=38*qt,mt+=38*Jt,xt+=38*ur,At+=38*xr,Rt+=38*pr,St+=38*Cr,Tt+=38*Mr,Et+=38*lr,Nt+=38*fr,It=1,Ot=Lt+It+65535,It=Math.floor(Ot/65536),Lt=Ot-It*65536,Ot=Ft+It+65535,It=Math.floor(Ot/65536),Ft=Ot-It*65536,Ot=jt+It+65535,It=Math.floor(Ot/65536),jt=Ot-It*65536,Ot=bt+It+65535,It=Math.floor(Ot/65536),bt=Ot-It*65536,Ot=vt+It+65535,It=Math.floor(Ot/65536),vt=Ot-It*65536,Ot=ct+It+65535,It=Math.floor(Ot/65536),ct=Ot-It*65536,Ot=dt+It+65535,It=Math.floor(Ot/65536),dt=Ot-It*65536,Ot=mt+It+65535,It=Math.floor(Ot/65536),mt=Ot-It*65536,Ot=xt+It+65535,It=Math.floor(Ot/65536),xt=Ot-It*65536,Ot=At+It+65535,It=Math.floor(Ot/65536),At=Ot-It*65536,Ot=Rt+It+65535,It=Math.floor(Ot/65536),Rt=Ot-It*65536,Ot=St+It+65535,It=Math.floor(Ot/65536),St=Ot-It*65536,Ot=Tt+It+65535,It=Math.floor(Ot/65536),Tt=Ot-It*65536,Ot=Et+It+65535,It=Math.floor(Ot/65536),Et=Ot-It*65536,Ot=Nt+It+65535,It=Math.floor(Ot/65536),Nt=Ot-It*65536,Ot=tr+It+65535,It=Math.floor(Ot/65536),tr=Ot-It*65536,Lt+=It-1+37*(It-1),It=1,Ot=Lt+It+65535,It=Math.floor(Ot/65536),Lt=Ot-It*65536,Ot=Ft+It+65535,It=Math.floor(Ot/65536),Ft=Ot-It*65536,Ot=jt+It+65535,It=Math.floor(Ot/65536),jt=Ot-It*65536,Ot=bt+It+65535,It=Math.floor(Ot/65536),bt=Ot-It*65536,Ot=vt+It+65535,It=Math.floor(Ot/65536),vt=Ot-It*65536,Ot=ct+It+65535,It=Math.floor(Ot/65536),ct=Ot-It*65536,Ot=dt+It+65535,It=Math.floor(Ot/65536),dt=Ot-It*65536,Ot=mt+It+65535,It=Math.floor(Ot/65536),mt=Ot-It*65536,Ot=xt+It+65535,It=Math.floor(Ot/65536),xt=Ot-It*65536,Ot=At+It+65535,It=Math.floor(Ot/65536),At=Ot-It*65536,Ot=Rt+It+65535,It=Math.floor(Ot/65536),Rt=Ot-It*65536,Ot=St+It+65535,It=Math.floor(Ot/65536),St=Ot-It*65536,Ot=Tt+It+65535,It=Math.floor(Ot/65536),Tt=Ot-It*65536,Ot=Et+It+65535,It=Math.floor(Ot/65536),Et=Ot-It*65536,Ot=Nt+It+65535,It=Math.floor(Ot/65536),Nt=Ot-It*65536,Ot=tr+It+65535,It=Math.floor(Ot/65536),tr=Ot-It*65536,Lt+=It-1+37*(It-1),Bt[0]=Lt,Bt[1]=Ft,Bt[2]=jt,Bt[3]=bt,Bt[4]=vt,Bt[5]=ct,Bt[6]=dt,Bt[7]=mt,Bt[8]=xt,Bt[9]=At,Bt[10]=Rt,Bt[11]=St,Bt[12]=Tt,Bt[13]=Et,Bt[14]=Nt,Bt[15]=tr}function ht(Bt,Dt){ut(Bt,Dt,Dt)}function yt(Bt,Dt){const zt=j();for(let Ot=0;Ot<16;Ot++)zt[Ot]=Dt[Ot];for(let Ot=253;Ot>=0;Ot--)ht(zt,zt),Ot!==2&&Ot!==4&&ut(zt,zt,Dt);for(let Ot=0;Ot<16;Ot++)Bt[Ot]=zt[Ot]}function wt(Bt,Dt){const zt=new Uint8Array(32),Ot=new Float64Array(80),It=j(),Lt=j(),Ft=j(),jt=j(),bt=j(),vt=j();for(let xt=0;xt<31;xt++)zt[xt]=Bt[xt];zt[31]=Bt[31]&127|64,zt[0]&=248,st(Ot,Dt);for(let xt=0;xt<16;xt++)Lt[xt]=Ot[xt];It[0]=jt[0]=1;for(let xt=254;xt>=0;--xt){const At=zt[xt>>>3]>>>(xt&7)&1;nt(It,Lt,At),nt(Ft,jt,At),ot(bt,It,Ft),at(It,It,Ft),ot(Ft,Lt,jt),at(Lt,Lt,jt),ht(jt,bt),ht(vt,It),ut(It,Ft,It),ut(Ft,Lt,bt),ot(bt,It,Ft),at(It,It,Ft),ht(Lt,It),at(Ft,jt,vt),ut(It,Ft,tt),ot(It,It,jt),ut(Ft,Ft,It),ut(It,jt,vt),ut(jt,Lt,Ot),ht(Lt,bt),nt(It,Lt,At),nt(Ft,jt,At)}for(let xt=0;xt<16;xt++)Ot[xt+16]=It[xt],Ot[xt+32]=Ft[xt],Ot[xt+48]=Lt[xt],Ot[xt+64]=jt[xt];const ct=Ot.subarray(32),dt=Ot.subarray(16);yt(ct,ct),ut(dt,dt,ct);const mt=new Uint8Array(32);return it(mt,dt),mt}a.scalarMult=wt;function Ct(Bt){return wt(Bt,et)}a.scalarMultBase=Ct;function Pt(Bt){if(Bt.length!==a.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${a.SECRET_KEY_LENGTH} bytes`);const Dt=new Uint8Array(Bt);return{publicKey:Ct(Dt),secretKey:Dt}}a.generateKeyPairFromSeed=Pt;function $t(Bt){const Dt=(0,_.randomBytes)(32,Bt),zt=Pt(Dt);return(0,$.wipe)(Dt),zt}a.generateKeyPair=$t;function Mt(Bt,Dt,zt=!1){if(Bt.length!==a.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(Dt.length!==a.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const Ot=wt(Bt,Dt);if(zt){let It=0;for(let Lt=0;Lt>>25,Rt=Ot+Mt|0,jt^=Rt<<9|Rt>>>23,Rt=jt+Ot|0,dt^=Rt<<13|Rt>>>19,Rt=dt+jt|0,Mt^=Rt<<18|Rt>>>14,Rt=It+Bt|0,bt^=Rt<<7|Rt>>>25,Rt=bt+It|0,mt^=Rt<<9|Rt>>>23,Rt=mt+bt|0,Bt^=Rt<<13|Rt>>>19,Rt=Bt+mt|0,It^=Rt<<18|Rt>>>14,Rt=vt+Lt|0,xt^=Rt<<7|Rt>>>25,Rt=xt+vt|0,Dt^=Rt<<9|Rt>>>23,Rt=Dt+xt|0,Lt^=Rt<<13|Rt>>>19,Rt=Lt+Dt|0,vt^=Rt<<18|Rt>>>14,Rt=At+ct|0,zt^=Rt<<7|Rt>>>25,Rt=zt+At|0,Ft^=Rt<<9|Rt>>>23,Rt=Ft+zt|0,ct^=Rt<<13|Rt>>>19,Rt=ct+Ft|0,At^=Rt<<18|Rt>>>14,Rt=Mt+zt|0,Bt^=Rt<<7|Rt>>>25,Rt=Bt+Mt|0,Dt^=Rt<<9|Rt>>>23,Rt=Dt+Bt|0,zt^=Rt<<13|Rt>>>19,Rt=zt+Dt|0,Mt^=Rt<<18|Rt>>>14,Rt=It+Ot|0,Lt^=Rt<<7|Rt>>>25,Rt=Lt+It|0,Ft^=Rt<<9|Rt>>>23,Rt=Ft+Lt|0,Ot^=Rt<<13|Rt>>>19,Rt=Ot+Ft|0,It^=Rt<<18|Rt>>>14,Rt=vt+bt|0,ct^=Rt<<7|Rt>>>25,Rt=ct+vt|0,jt^=Rt<<9|Rt>>>23,Rt=jt+ct|0,bt^=Rt<<13|Rt>>>19,Rt=bt+jt|0,vt^=Rt<<18|Rt>>>14,Rt=At+xt|0,dt^=Rt<<7|Rt>>>25,Rt=dt+At|0,mt^=Rt<<9|Rt>>>23,Rt=mt+dt|0,xt^=Rt<<13|Rt>>>19,Rt=xt+mt|0,At^=Rt<<18|Rt>>>14;binary_1$1.writeUint32LE(Mt+j|0,a,0),binary_1$1.writeUint32LE(Bt+et|0,a,4),binary_1$1.writeUint32LE(Dt+tt|0,a,8),binary_1$1.writeUint32LE(zt+rt|0,a,12),binary_1$1.writeUint32LE(Ot+nt|0,a,16),binary_1$1.writeUint32LE(It+it|0,a,20),binary_1$1.writeUint32LE(Lt+st|0,a,24),binary_1$1.writeUint32LE(Ft+ot|0,a,28),binary_1$1.writeUint32LE(jt+at|0,a,32),binary_1$1.writeUint32LE(bt+ut|0,a,36),binary_1$1.writeUint32LE(vt+ht|0,a,40),binary_1$1.writeUint32LE(ct+yt|0,a,44),binary_1$1.writeUint32LE(dt+wt|0,a,48),binary_1$1.writeUint32LE(mt+Ct|0,a,52),binary_1$1.writeUint32LE(xt+Pt|0,a,56),binary_1$1.writeUint32LE(At+$t|0,a,60)}function streamXOR$1(a,_,$,j,et){if(et===void 0&&(et=0),a.length!==32)throw new Error("Salsa20: key size must be 32 bytes");if(j.length<$.length)throw new Error("Salsa20: destination is shorter than source");var tt,rt;if(et===0){if(_.length!==8)throw new Error("Salsa20 nonce must be 8 bytes");tt=new Uint8Array(16),tt.set(_),rt=_.length}else{if(_.length!==16)throw new Error("Salsa20 nonce with counter must be 16 bytes");tt=_,rt=16-et}for(var nt=new Uint8Array(64),it=0;it<$.length;it+=64){core(nt,tt,a);for(var st=it;st>>=8,_++;if(j>0)throw new Error("Salsa20: counter overflow")}Object.defineProperty(xsalsa20,"__esModule",{value:!0});var binary_1=binary,salsa20_1=salsa20,wipe_1$2=wipe$1;function streamXOR(a,_,$,j,et){if(et===void 0&&(et=0),et===0){if(_.length!==24)throw new Error("XSalsa20 nonce must be 24 bytes")}else if(_.length!==32)throw new Error("XSalsa20 nonce with counter must be 32 bytes");var tt=hsalsa(a,_.subarray(0,16),new Uint8Array(32)),rt=salsa20_1.streamXOR(tt,_.subarray(16),$,j,et);return wipe_1$2.wipe(tt),rt}xsalsa20.streamXOR=streamXOR;function stream(a,_,$,j){return j===void 0&&(j=0),wipe_1$2.wipe($),streamXOR(a,_,$,$,j)}xsalsa20.stream=stream;var ROUNDS=20;function hsalsa(a,_,$){for(var j=1634760805,et=a[3]<<24|a[2]<<16|a[1]<<8|a[0],tt=a[7]<<24|a[6]<<16|a[5]<<8|a[4],rt=a[11]<<24|a[10]<<16|a[9]<<8|a[8],nt=a[15]<<24|a[14]<<16|a[13]<<8|a[12],it=857760878,st=_[3]<<24|_[2]<<16|_[1]<<8|_[0],ot=_[7]<<24|_[6]<<16|_[5]<<8|_[4],at=_[11]<<24|_[10]<<16|_[9]<<8|_[8],ut=_[15]<<24|_[14]<<16|_[13]<<8|_[12],ht=2036477234,yt=a[19]<<24|a[18]<<16|a[17]<<8|a[16],wt=a[23]<<24|a[22]<<16|a[21]<<8|a[20],Ct=a[27]<<24|a[26]<<16|a[25]<<8|a[24],Pt=a[31]<<24|a[30]<<16|a[29]<<8|a[28],$t=1797285236,Mt,Bt=0;Bt>>25,Mt=nt+j|0,at^=Mt<<9|Mt>>>23,Mt=at+nt|0,wt^=Mt<<13|Mt>>>19,Mt=wt+at|0,j^=Mt<<18|Mt>>>14,Mt=it+et|0,ut^=Mt<<7|Mt>>>25,Mt=ut+it|0,Ct^=Mt<<9|Mt>>>23,Mt=Ct+ut|0,et^=Mt<<13|Mt>>>19,Mt=et+Ct|0,it^=Mt<<18|Mt>>>14,Mt=ht+st|0,Pt^=Mt<<7|Mt>>>25,Mt=Pt+ht|0,tt^=Mt<<9|Mt>>>23,Mt=tt+Pt|0,st^=Mt<<13|Mt>>>19,Mt=st+tt|0,ht^=Mt<<18|Mt>>>14,Mt=$t+yt|0,rt^=Mt<<7|Mt>>>25,Mt=rt+$t|0,ot^=Mt<<9|Mt>>>23,Mt=ot+rt|0,yt^=Mt<<13|Mt>>>19,Mt=yt+ot|0,$t^=Mt<<18|Mt>>>14,Mt=j+rt|0,et^=Mt<<7|Mt>>>25,Mt=et+j|0,tt^=Mt<<9|Mt>>>23,Mt=tt+et|0,rt^=Mt<<13|Mt>>>19,Mt=rt+tt|0,j^=Mt<<18|Mt>>>14,Mt=it+nt|0,st^=Mt<<7|Mt>>>25,Mt=st+it|0,ot^=Mt<<9|Mt>>>23,Mt=ot+st|0,nt^=Mt<<13|Mt>>>19,Mt=nt+ot|0,it^=Mt<<18|Mt>>>14,Mt=ht+ut|0,yt^=Mt<<7|Mt>>>25,Mt=yt+ht|0,at^=Mt<<9|Mt>>>23,Mt=at+yt|0,ut^=Mt<<13|Mt>>>19,Mt=ut+at|0,ht^=Mt<<18|Mt>>>14,Mt=$t+Pt|0,wt^=Mt<<7|Mt>>>25,Mt=wt+$t|0,Ct^=Mt<<9|Mt>>>23,Mt=Ct+wt|0,Pt^=Mt<<13|Mt>>>19,Mt=Pt+Ct|0,$t^=Mt<<18|Mt>>>14;return binary_1.writeUint32LE(j,$,0),binary_1.writeUint32LE(it,$,4),binary_1.writeUint32LE(ht,$,8),binary_1.writeUint32LE($t,$,12),binary_1.writeUint32LE(st,$,16),binary_1.writeUint32LE(ot,$,20),binary_1.writeUint32LE(at,$,24),binary_1.writeUint32LE(ut,$,28),$}xsalsa20.hsalsa=hsalsa;var secretbox={},poly1305={},constantTime={};Object.defineProperty(constantTime,"__esModule",{value:!0});function select(a,_,$){return~(a-1)&_|a-1&$}constantTime.select=select;function lessOrEqual(a,_){return(a|0)-(_|0)-1>>>31&1}constantTime.lessOrEqual=lessOrEqual;function compare$d(a,_){if(a.length!==_.length)return 0;for(var $=0,j=0;j>>8}constantTime.compare=compare$d;function equal(a,_){return a.length===0||_.length===0?!1:compare$d(a,_)!==0}constantTime.equal=equal;(function(a){Object.defineProperty(a,"__esModule",{value:!0});var _=constantTime,$=wipe$1;a.DIGEST_LENGTH=16;var j=function(){function rt(nt){this.digestLength=a.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var it=nt[0]|nt[1]<<8;this._r[0]=it&8191;var st=nt[2]|nt[3]<<8;this._r[1]=(it>>>13|st<<3)&8191;var ot=nt[4]|nt[5]<<8;this._r[2]=(st>>>10|ot<<6)&7939;var at=nt[6]|nt[7]<<8;this._r[3]=(ot>>>7|at<<9)&8191;var ut=nt[8]|nt[9]<<8;this._r[4]=(at>>>4|ut<<12)&255,this._r[5]=ut>>>1&8190;var ht=nt[10]|nt[11]<<8;this._r[6]=(ut>>>14|ht<<2)&8191;var yt=nt[12]|nt[13]<<8;this._r[7]=(ht>>>11|yt<<5)&8065;var wt=nt[14]|nt[15]<<8;this._r[8]=(yt>>>8|wt<<8)&8191,this._r[9]=wt>>>5&127,this._pad[0]=nt[16]|nt[17]<<8,this._pad[1]=nt[18]|nt[19]<<8,this._pad[2]=nt[20]|nt[21]<<8,this._pad[3]=nt[22]|nt[23]<<8,this._pad[4]=nt[24]|nt[25]<<8,this._pad[5]=nt[26]|nt[27]<<8,this._pad[6]=nt[28]|nt[29]<<8,this._pad[7]=nt[30]|nt[31]<<8}return rt.prototype._blocks=function(nt,it,st){for(var ot=this._fin?0:2048,at=this._h[0],ut=this._h[1],ht=this._h[2],yt=this._h[3],wt=this._h[4],Ct=this._h[5],Pt=this._h[6],$t=this._h[7],Mt=this._h[8],Bt=this._h[9],Dt=this._r[0],zt=this._r[1],Ot=this._r[2],It=this._r[3],Lt=this._r[4],Ft=this._r[5],jt=this._r[6],bt=this._r[7],vt=this._r[8],ct=this._r[9];st>=16;){var dt=nt[it+0]|nt[it+1]<<8;at+=dt&8191;var mt=nt[it+2]|nt[it+3]<<8;ut+=(dt>>>13|mt<<3)&8191;var xt=nt[it+4]|nt[it+5]<<8;ht+=(mt>>>10|xt<<6)&8191;var At=nt[it+6]|nt[it+7]<<8;yt+=(xt>>>7|At<<9)&8191;var Rt=nt[it+8]|nt[it+9]<<8;wt+=(At>>>4|Rt<<12)&8191,Ct+=Rt>>>1&8191;var St=nt[it+10]|nt[it+11]<<8;Pt+=(Rt>>>14|St<<2)&8191;var Tt=nt[it+12]|nt[it+13]<<8;$t+=(St>>>11|Tt<<5)&8191;var Et=nt[it+14]|nt[it+15]<<8;Mt+=(Tt>>>8|Et<<8)&8191,Bt+=Et>>>5|ot;var Nt=0,tr=Nt;tr+=at*Dt,tr+=ut*(5*ct),tr+=ht*(5*vt),tr+=yt*(5*bt),tr+=wt*(5*jt),Nt=tr>>>13,tr&=8191,tr+=Ct*(5*Ft),tr+=Pt*(5*Lt),tr+=$t*(5*It),tr+=Mt*(5*Ot),tr+=Bt*(5*zt),Nt+=tr>>>13,tr&=8191;var ir=Nt;ir+=at*zt,ir+=ut*Dt,ir+=ht*(5*ct),ir+=yt*(5*vt),ir+=wt*(5*bt),Nt=ir>>>13,ir&=8191,ir+=Ct*(5*jt),ir+=Pt*(5*Ft),ir+=$t*(5*Lt),ir+=Mt*(5*It),ir+=Bt*(5*Ot),Nt+=ir>>>13,ir&=8191;var nr=Nt;nr+=at*Ot,nr+=ut*zt,nr+=ht*Dt,nr+=yt*(5*ct),nr+=wt*(5*vt),Nt=nr>>>13,nr&=8191,nr+=Ct*(5*bt),nr+=Pt*(5*jt),nr+=$t*(5*Ft),nr+=Mt*(5*Lt),nr+=Bt*(5*It),Nt+=nr>>>13,nr&=8191;var Zt=Nt;Zt+=at*It,Zt+=ut*Ot,Zt+=ht*zt,Zt+=yt*Dt,Zt+=wt*(5*ct),Nt=Zt>>>13,Zt&=8191,Zt+=Ct*(5*vt),Zt+=Pt*(5*bt),Zt+=$t*(5*jt),Zt+=Mt*(5*Ft),Zt+=Bt*(5*Lt),Nt+=Zt>>>13,Zt&=8191;var Kt=Nt;Kt+=at*Lt,Kt+=ut*It,Kt+=ht*Ot,Kt+=yt*zt,Kt+=wt*Dt,Nt=Kt>>>13,Kt&=8191,Kt+=Ct*(5*ct),Kt+=Pt*(5*vt),Kt+=$t*(5*bt),Kt+=Mt*(5*jt),Kt+=Bt*(5*Ft),Nt+=Kt>>>13,Kt&=8191;var Qt=Nt;Qt+=at*Ft,Qt+=ut*Lt,Qt+=ht*It,Qt+=yt*Ot,Qt+=wt*zt,Nt=Qt>>>13,Qt&=8191,Qt+=Ct*Dt,Qt+=Pt*(5*ct),Qt+=$t*(5*vt),Qt+=Mt*(5*bt),Qt+=Bt*(5*jt),Nt+=Qt>>>13,Qt&=8191;var Ht=Nt;Ht+=at*jt,Ht+=ut*Ft,Ht+=ht*Lt,Ht+=yt*It,Ht+=wt*Ot,Nt=Ht>>>13,Ht&=8191,Ht+=Ct*zt,Ht+=Pt*Dt,Ht+=$t*(5*ct),Ht+=Mt*(5*vt),Ht+=Bt*(5*bt),Nt+=Ht>>>13,Ht&=8191;var qt=Nt;qt+=at*bt,qt+=ut*jt,qt+=ht*Ft,qt+=yt*Lt,qt+=wt*It,Nt=qt>>>13,qt&=8191,qt+=Ct*Ot,qt+=Pt*zt,qt+=$t*Dt,qt+=Mt*(5*ct),qt+=Bt*(5*vt),Nt+=qt>>>13,qt&=8191;var Jt=Nt;Jt+=at*vt,Jt+=ut*bt,Jt+=ht*jt,Jt+=yt*Ft,Jt+=wt*Lt,Nt=Jt>>>13,Jt&=8191,Jt+=Ct*It,Jt+=Pt*Ot,Jt+=$t*zt,Jt+=Mt*Dt,Jt+=Bt*(5*ct),Nt+=Jt>>>13,Jt&=8191;var ur=Nt;ur+=at*ct,ur+=ut*vt,ur+=ht*bt,ur+=yt*jt,ur+=wt*Ft,Nt=ur>>>13,ur&=8191,ur+=Ct*Lt,ur+=Pt*It,ur+=$t*Ot,ur+=Mt*zt,ur+=Bt*Dt,Nt+=ur>>>13,ur&=8191,Nt=(Nt<<2)+Nt|0,Nt=Nt+tr|0,tr=Nt&8191,Nt=Nt>>>13,ir+=Nt,at=tr,ut=ir,ht=nr,yt=Zt,wt=Kt,Ct=Qt,Pt=Ht,$t=qt,Mt=Jt,Bt=ur,it+=16,st-=16}this._h[0]=at,this._h[1]=ut,this._h[2]=ht,this._h[3]=yt,this._h[4]=wt,this._h[5]=Ct,this._h[6]=Pt,this._h[7]=$t,this._h[8]=Mt,this._h[9]=Bt},rt.prototype.finish=function(nt,it){it===void 0&&(it=0);var st=new Uint16Array(10),ot,at,ut,ht;if(this._leftover){for(ht=this._leftover,this._buffer[ht++]=1;ht<16;ht++)this._buffer[ht]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(ot=this._h[1]>>>13,this._h[1]&=8191,ht=2;ht<10;ht++)this._h[ht]+=ot,ot=this._h[ht]>>>13,this._h[ht]&=8191;for(this._h[0]+=ot*5,ot=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=ot,ot=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=ot,st[0]=this._h[0]+5,ot=st[0]>>>13,st[0]&=8191,ht=1;ht<10;ht++)st[ht]=this._h[ht]+ot,ot=st[ht]>>>13,st[ht]&=8191;for(st[9]-=8192,at=(ot^1)-1,ht=0;ht<10;ht++)st[ht]&=at;for(at=~at,ht=0;ht<10;ht++)this._h[ht]=this._h[ht]&at|st[ht];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,ut=this._h[0]+this._pad[0],this._h[0]=ut&65535,ht=1;ht<8;ht++)ut=(this._h[ht]+this._pad[ht]|0)+(ut>>>16)|0,this._h[ht]=ut&65535;return nt[it+0]=this._h[0]>>>0,nt[it+1]=this._h[0]>>>8,nt[it+2]=this._h[1]>>>0,nt[it+3]=this._h[1]>>>8,nt[it+4]=this._h[2]>>>0,nt[it+5]=this._h[2]>>>8,nt[it+6]=this._h[3]>>>0,nt[it+7]=this._h[3]>>>8,nt[it+8]=this._h[4]>>>0,nt[it+9]=this._h[4]>>>8,nt[it+10]=this._h[5]>>>0,nt[it+11]=this._h[5]>>>8,nt[it+12]=this._h[6]>>>0,nt[it+13]=this._h[6]>>>8,nt[it+14]=this._h[7]>>>0,nt[it+15]=this._h[7]>>>8,this._finished=!0,this},rt.prototype.update=function(nt){var it=0,st=nt.length,ot;if(this._leftover){ot=16-this._leftover,ot>st&&(ot=st);for(var at=0;at=16&&(ot=st-st%16,this._blocks(nt,it,ot),it+=ot,st-=ot),st){for(var at=0;at32&&(0,xsalsa20_1.streamXOR)(a,et,$.subarray(32),tt.subarray(48),8);const rt=(0,poly1305_1.oneTimeAuth)(j.subarray(0,32),tt.subarray(16));for(let nt=0;nt32&&(0,xsalsa20_1.streamXOR)(a,et,rt.subarray(32),nt.subarray(32),8),(0,wipe_1$1.wipe)(tt),(0,wipe_1$1.wipe)(j),(0,wipe_1$1.wipe)(et),nt}secretbox.openSecretBox=openSecretBox;function generateKey(a){return(0,random_1.randomBytes)(32,a)}secretbox.generateKey=generateKey;(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.openBox=a.box=a.precomputeSharedKey=a.generateKeyPair=void 0;const _=x25519,$=xsalsa20,j=secretbox,et=wipe$1;var tt=x25519;Object.defineProperty(a,"generateKeyPair",{enumerable:!0,get:function(){return tt.generateKeyPair}});const rt=new Uint8Array(16);function nt(ot,at){const ut=(0,_.scalarMult)(at,ot);return(0,$.hsalsa)(ut,rt,ut),ut}a.precomputeSharedKey=nt;function it(ot,at,ut,ht){const yt=nt(ot,at),wt=(0,j.secretBox)(yt,ut,ht);return(0,et.wipe)(yt),wt}a.box=it;function st(ot,at,ut,ht){const yt=nt(ot,at),wt=(0,j.openSecretBox)(yt,ut,ht);return(0,et.wipe)(yt),wt}a.openBox=st})(box);(function(a){var _=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(j,et,tt,rt){rt===void 0&&(rt=tt);var nt=Object.getOwnPropertyDescriptor(et,tt);(!nt||("get"in nt?!et.__esModule:nt.writable||nt.configurable))&&(nt={enumerable:!0,get:function(){return et[tt]}}),Object.defineProperty(j,rt,nt)}:function(j,et,tt,rt){rt===void 0&&(rt=tt),j[rt]=et[tt]}),$=commonjsGlobal&&commonjsGlobal.__exportStar||function(j,et){for(var tt in j)tt!=="default"&&!Object.prototype.hasOwnProperty.call(et,tt)&&_(et,j,tt)};Object.defineProperty(a,"__esModule",{value:!0}),$(box,a),$(secretbox,a)})(nacl);var utf8={};Object.defineProperty(utf8,"__esModule",{value:!0});var INVALID_UTF16="utf8: invalid string",INVALID_UTF8="utf8: invalid source encoding";function encode$7(a){for(var _=new Uint8Array(encodedLength(a)),$=0,j=0;j>6,_[$++]=128|et&63):et<55296?(_[$++]=224|et>>12,_[$++]=128|et>>6&63,_[$++]=128|et&63):(j++,et=(et&1023)<<10,et|=a.charCodeAt(j)&1023,et+=65536,_[$++]=240|et>>18,_[$++]=128|et>>12&63,_[$++]=128|et>>6&63,_[$++]=128|et&63)}return _}var encode_1=utf8.encode=encode$7;function encodedLength(a){for(var _=0,$=0;$=a.length-1)throw new Error(INVALID_UTF16);$++,_+=4}else throw new Error(INVALID_UTF16)}return _}utf8.encodedLength=encodedLength;function decode$3(a){for(var _=[],$=0;$=a.length)throw new Error(INVALID_UTF8);var tt=a[++$];if((tt&192)!==128)throw new Error(INVALID_UTF8);j=(j&31)<<6|tt&63,et=128}else if(j<240){if($>=a.length-1)throw new Error(INVALID_UTF8);var tt=a[++$],rt=a[++$];if((tt&192)!==128||(rt&192)!==128)throw new Error(INVALID_UTF8);j=(j&15)<<12|(tt&63)<<6|rt&63,et=2048}else if(j<248){if($>=a.length-2)throw new Error(INVALID_UTF8);var tt=a[++$],rt=a[++$],nt=a[++$];if((tt&192)!==128||(rt&192)!==128||(nt&192)!==128)throw new Error(INVALID_UTF8);j=(j&15)<<18|(tt&63)<<12|(rt&63)<<6|nt&63,et=65536}else throw new Error(INVALID_UTF8);if(j=55296&&j<=57343)throw new Error(INVALID_UTF8);if(j>=65536){if(j>1114111)throw new Error(INVALID_UTF8);j-=65536,_.push(String.fromCharCode(55296|j>>10)),j=56320|j&1023}}_.push(String.fromCharCode(j))}return _.join("")}utf8.decode=decode$3;var blake2b$1={};(function(a){Object.defineProperty(a,"__esModule",{value:!0});var _=binary,$=wipe$1;a.BLOCK_SIZE=128,a.DIGEST_LENGTH=64,a.KEY_LENGTH=64,a.PERSONALIZATION_LENGTH=16,a.SALT_LENGTH=16,a.MAX_LEAF_SIZE=Math.pow(2,32)-1,a.MAX_FANOUT=255,a.MAX_MAX_DEPTH=255;var j=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),et=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],tt=function(){function nt(it,st){if(it===void 0&&(it=64),this.digestLength=it,this.blockSize=a.BLOCK_SIZE,this._state=new Int32Array(j),this._buffer=new Uint8Array(a.BLOCK_SIZE),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),it<1||it>a.DIGEST_LENGTH)throw new Error("blake2b: wrong digest length");st&&this.validateConfig(st);var ot=0;st&&st.key&&(ot=st.key.length);var at=1,ut=1;st&&st.tree&&(at=st.tree.fanout,ut=st.tree.maxDepth),this._state[0]^=it|ot<<8|at<<16|ut<<24,st&&st.tree&&(this._state[1]^=st.tree.leafSize,this._state[2]^=st.tree.nodeOffsetLowBits,this._state[3]^=st.tree.nodeOffsetHighBits,this._state[4]^=st.tree.nodeDepth|st.tree.innerDigestLength<<8,this._lastNode=st.tree.lastNode),st&&st.salt&&(this._state[8]^=_.readUint32LE(st.salt,0),this._state[9]^=_.readUint32LE(st.salt,4),this._state[10]^=_.readUint32LE(st.salt,8),this._state[11]^=_.readUint32LE(st.salt,12)),st&&st.personalization&&(this._state[12]^=_.readUint32LE(st.personalization,0),this._state[13]^=_.readUint32LE(st.personalization,4),this._state[14]^=_.readUint32LE(st.personalization,8),this._state[15]^=_.readUint32LE(st.personalization,12)),this._initialState=new Uint32Array(this._state),st&&st.key&&ot>0&&(this._paddedKey=new Uint8Array(a.BLOCK_SIZE),this._paddedKey.set(st.key),this._buffer.set(this._paddedKey),this._bufferLength=a.BLOCK_SIZE)}return nt.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=a.BLOCK_SIZE):this._bufferLength=0,$.wipe(this._ctr),$.wipe(this._flag),this._finished=!1,this},nt.prototype.validateConfig=function(it){if(it.key&&it.key.length>a.KEY_LENGTH)throw new Error("blake2b: wrong key length");if(it.salt&&it.salt.length!==a.SALT_LENGTH)throw new Error("blake2b: wrong salt length");if(it.personalization&&it.personalization.length!==a.PERSONALIZATION_LENGTH)throw new Error("blake2b: wrong personalization length");if(it.tree){if(it.tree.fanout<0||it.tree.fanout>a.MAX_FANOUT)throw new Error("blake2b: wrong tree fanout");if(it.tree.maxDepth<0||it.tree.maxDepth>a.MAX_MAX_DEPTH)throw new Error("blake2b: wrong tree depth");if(it.tree.leafSize<0||it.tree.leafSize>a.MAX_LEAF_SIZE)throw new Error("blake2b: wrong leaf size");if(it.tree.innerDigestLength<0||it.tree.innerDigestLength>a.DIGEST_LENGTH)throw new Error("blake2b: wrong tree inner digest length")}},nt.prototype.update=function(it,st){if(st===void 0&&(st=it.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var ot=a.BLOCK_SIZE-this._bufferLength,at=0;if(st===0)return this;if(st>ot){for(var ut=0;uta.BLOCK_SIZE;){for(var ut=0;ut>>16,dt=zt&65535,mt=zt>>>16;vt+=Ot&65535,ct+=Ot>>>16,dt+=It&65535,mt+=It>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,zt=dt&65535|mt<<16,Dt=vt&65535|ct<<16,vt=Dt&65535,ct=Dt>>>16,dt=zt&65535,mt=zt>>>16,vt+=Pt&65535,ct+=Pt>>>16,dt+=$t&65535,mt+=$t>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,zt=dt&65535|mt<<16,Dt=vt&65535|ct<<16,jt^=Dt,bt^=zt,vt=bt,bt=jt,jt=vt,vt=Lt&65535,ct=Lt>>>16,dt=Ft&65535,mt=Ft>>>16,vt+=jt&65535,ct+=jt>>>16,dt+=bt&65535,mt+=bt>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,Ft=dt&65535|mt<<16,Lt=vt&65535|ct<<16,Ot^=Lt,It^=Ft,vt=Ot<<8|It>>>24,Ot=It<<8|Ot>>>24,It=vt,vt=Dt&65535,ct=Dt>>>16,dt=zt&65535,mt=zt>>>16,vt+=Ot&65535,ct+=Ot>>>16,dt+=It&65535,mt+=It>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,zt=dt&65535|mt<<16,Dt=vt&65535|ct<<16,vt=Dt&65535,ct=Dt>>>16,dt=zt&65535,mt=zt>>>16,vt+=Mt&65535,ct+=Mt>>>16,dt+=Bt&65535,mt+=Bt>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,zt=dt&65535|mt<<16,Dt=vt&65535|ct<<16,jt^=Dt,bt^=zt,vt=jt<<16|bt>>>16,jt=bt<<16|jt>>>16,bt=vt,vt=Lt&65535,ct=Lt>>>16,dt=Ft&65535,mt=Ft>>>16,vt+=jt&65535,ct+=jt>>>16,dt+=bt&65535,mt+=bt>>>16,ct+=vt>>>16,dt+=ct>>>16,mt+=dt>>>16,Ft=dt&65535|mt<<16,Lt=vt&65535|ct<<16,Ot^=Lt,It^=Ft,vt=It<<1|Ot>>>31,Ot=Ot<<1|It>>>31,It=vt,it[st]=Dt,it[ht]=zt,it[ot]=Ot,it[yt]=It,it[at]=Lt,it[wt]=Ft,it[ut]=jt,it[Ct]=bt},nt.prototype._incrementCounter=function(it){for(var st=0;st<3;st++){var ot=this._ctr[st]+it;if(this._ctr[st]=ot>>>0,this._ctr[st]===ot)return;it=1}},nt.prototype._processBlock=function(it){this._incrementCounter(it);var st=this._vtmp;st.set(this._state),st.set(j,16),st[12*2+0]^=this._ctr[0],st[12*2+1]^=this._ctr[1],st[13*2+0]^=this._ctr[2],st[13*2+1]^=this._ctr[3],st[14*2+0]^=this._flag[0],st[14*2+1]^=this._flag[1],st[15*2+0]^=this._flag[2],st[15*2+1]^=this._flag[3];for(var ot=this._mtmp,at=0;at<32;at++)ot[at]=_.readUint32LE(this._buffer,at*4);for(var ut=0;ut<12;ut++)this._G(st,0,8,16,24,1,9,17,25,ot[et[ut][0]],ot[et[ut][0]+1],ot[et[ut][1]],ot[et[ut][1]+1]),this._G(st,2,10,18,26,3,11,19,27,ot[et[ut][2]],ot[et[ut][2]+1],ot[et[ut][3]],ot[et[ut][3]+1]),this._G(st,4,12,20,28,5,13,21,29,ot[et[ut][4]],ot[et[ut][4]+1],ot[et[ut][5]],ot[et[ut][5]+1]),this._G(st,6,14,22,30,7,15,23,31,ot[et[ut][6]],ot[et[ut][6]+1],ot[et[ut][7]],ot[et[ut][7]+1]),this._G(st,0,10,20,30,1,11,21,31,ot[et[ut][8]],ot[et[ut][8]+1],ot[et[ut][9]],ot[et[ut][9]+1]),this._G(st,2,12,22,24,3,13,23,25,ot[et[ut][10]],ot[et[ut][10]+1],ot[et[ut][11]],ot[et[ut][11]+1]),this._G(st,4,14,16,26,5,15,17,27,ot[et[ut][12]],ot[et[ut][12]+1],ot[et[ut][13]],ot[et[ut][13]+1]),this._G(st,6,8,18,28,7,9,19,29,ot[et[ut][14]],ot[et[ut][14]+1],ot[et[ut][15]],ot[et[ut][15]+1]);for(var at=0;at<16;at++)this._state[at]^=st[at]^st[at+16]},nt}();a.BLAKE2b=tt;function rt(nt,it,st){it===void 0&&(it=a.DIGEST_LENGTH);var ot=new tt(it,st);ot.update(nt);var at=ot.digest();return ot.clean(),at}a.hash=rt})(blake2b$1);var ed25519={},sha512$2={};(function(a){Object.defineProperty(a,"__esModule",{value:!0});var _=binary,$=wipe$1;a.DIGEST_LENGTH=64,a.BLOCK_SIZE=128;var j=function(){function nt(){this.digestLength=a.DIGEST_LENGTH,this.blockSize=a.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return nt.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},nt.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},nt.prototype.clean=function(){$.wipe(this._buffer),$.wipe(this._tempHi),$.wipe(this._tempLo),this.reset()},nt.prototype.update=function(it,st){if(st===void 0&&(st=it.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var ot=0;if(this._bytesHashed+=st,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=it[ot++],st--;this._bufferLength===this.blockSize&&(tt(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(st>=this.blockSize&&(ot=tt(this._tempHi,this._tempLo,this._stateHi,this._stateLo,it,ot,st),st%=this.blockSize);st>0;)this._buffer[this._bufferLength++]=it[ot++],st--;return this},nt.prototype.finish=function(it){if(!this._finished){var st=this._bytesHashed,ot=this._bufferLength,at=st/536870912|0,ut=st<<3,ht=st%128<112?128:256;this._buffer[ot]=128;for(var yt=ot+1;yt0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},nt.prototype.restoreState=function(it){return this._stateHi.set(it.stateHi),this._stateLo.set(it.stateLo),this._bufferLength=it.bufferLength,it.buffer&&this._buffer.set(it.buffer),this._bytesHashed=it.bytesHashed,this._finished=!1,this},nt.prototype.cleanSavedState=function(it){$.wipe(it.stateHi),$.wipe(it.stateLo),it.buffer&&$.wipe(it.buffer),it.bufferLength=0,it.bytesHashed=0},nt}();a.SHA512=j;var et=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function tt(nt,it,st,ot,at,ut,ht){for(var yt=st[0],wt=st[1],Ct=st[2],Pt=st[3],$t=st[4],Mt=st[5],Bt=st[6],Dt=st[7],zt=ot[0],Ot=ot[1],It=ot[2],Lt=ot[3],Ft=ot[4],jt=ot[5],bt=ot[6],vt=ot[7],ct,dt,mt,xt,At,Rt,St,Tt;ht>=128;){for(var Et=0;Et<16;Et++){var Nt=8*Et+ut;nt[Et]=_.readUint32BE(at,Nt),it[Et]=_.readUint32BE(at,Nt+4)}for(var Et=0;Et<80;Et++){var tr=yt,ir=wt,nr=Ct,Zt=Pt,Kt=$t,Qt=Mt,Ht=Bt,qt=Dt,Jt=zt,ur=Ot,xr=It,pr=Lt,Cr=Ft,Mr=jt,lr=bt,fr=vt;if(ct=Dt,dt=vt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=($t>>>14|Ft<<18)^($t>>>18|Ft<<14)^(Ft>>>9|$t<<23),dt=(Ft>>>14|$t<<18)^(Ft>>>18|$t<<14)^($t>>>9|Ft<<23),At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,ct=$t&Mt^~$t&Bt,dt=Ft&jt^~Ft&bt,At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,ct=et[Et*2],dt=et[Et*2+1],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,ct=nt[Et%16],dt=it[Et%16],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,mt=St&65535|Tt<<16,xt=At&65535|Rt<<16,ct=mt,dt=xt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=(yt>>>28|zt<<4)^(zt>>>2|yt<<30)^(zt>>>7|yt<<25),dt=(zt>>>28|yt<<4)^(yt>>>2|zt<<30)^(yt>>>7|zt<<25),At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,ct=yt&wt^yt&Ct^wt&Ct,dt=zt&Ot^zt&It^Ot&It,At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,qt=St&65535|Tt<<16,fr=At&65535|Rt<<16,ct=Zt,dt=pr,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=mt,dt=xt,At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,Zt=St&65535|Tt<<16,pr=At&65535|Rt<<16,wt=tr,Ct=ir,Pt=nr,$t=Zt,Mt=Kt,Bt=Qt,Dt=Ht,yt=qt,Ot=Jt,It=ur,Lt=xr,Ft=pr,jt=Cr,bt=Mr,vt=lr,zt=fr,Et%16===15)for(var Nt=0;Nt<16;Nt++)ct=nt[Nt],dt=it[Nt],At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=nt[(Nt+9)%16],dt=it[(Nt+9)%16],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,mt=nt[(Nt+1)%16],xt=it[(Nt+1)%16],ct=(mt>>>1|xt<<31)^(mt>>>8|xt<<24)^mt>>>7,dt=(xt>>>1|mt<<31)^(xt>>>8|mt<<24)^(xt>>>7|mt<<25),At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,mt=nt[(Nt+14)%16],xt=it[(Nt+14)%16],ct=(mt>>>19|xt<<13)^(xt>>>29|mt<<3)^mt>>>6,dt=(xt>>>19|mt<<13)^(mt>>>29|xt<<3)^(xt>>>6|mt<<26),At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,nt[Nt]=St&65535|Tt<<16,it[Nt]=At&65535|Rt<<16}ct=yt,dt=zt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[0],dt=ot[0],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[0]=yt=St&65535|Tt<<16,ot[0]=zt=At&65535|Rt<<16,ct=wt,dt=Ot,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[1],dt=ot[1],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[1]=wt=St&65535|Tt<<16,ot[1]=Ot=At&65535|Rt<<16,ct=Ct,dt=It,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[2],dt=ot[2],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[2]=Ct=St&65535|Tt<<16,ot[2]=It=At&65535|Rt<<16,ct=Pt,dt=Lt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[3],dt=ot[3],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[3]=Pt=St&65535|Tt<<16,ot[3]=Lt=At&65535|Rt<<16,ct=$t,dt=Ft,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[4],dt=ot[4],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[4]=$t=St&65535|Tt<<16,ot[4]=Ft=At&65535|Rt<<16,ct=Mt,dt=jt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[5],dt=ot[5],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[5]=Mt=St&65535|Tt<<16,ot[5]=jt=At&65535|Rt<<16,ct=Bt,dt=bt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[6],dt=ot[6],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[6]=Bt=St&65535|Tt<<16,ot[6]=bt=At&65535|Rt<<16,ct=Dt,dt=vt,At=dt&65535,Rt=dt>>>16,St=ct&65535,Tt=ct>>>16,ct=st[7],dt=ot[7],At+=dt&65535,Rt+=dt>>>16,St+=ct&65535,Tt+=ct>>>16,Rt+=At>>>16,St+=Rt>>>16,Tt+=St>>>16,st[7]=Dt=St&65535|Tt<<16,ot[7]=vt=At&65535|Rt<<16,ut+=128,ht-=128}return ut}function rt(nt){var it=new j;it.update(nt);var st=it.digest();return it.clean(),st}a.hash=rt})(sha512$2);(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.convertSecretKeyToX25519=a.convertPublicKeyToX25519=a.verify=a.sign=a.extractPublicKeyFromSecretKey=a.generateKeyPair=a.generateKeyPairFromSeed=a.SEED_LENGTH=a.SECRET_KEY_LENGTH=a.PUBLIC_KEY_LENGTH=a.SIGNATURE_LENGTH=void 0;const _=random,$=sha512$2,j=wipe$1;a.SIGNATURE_LENGTH=64,a.PUBLIC_KEY_LENGTH=32,a.SECRET_KEY_LENGTH=64,a.SEED_LENGTH=32;function et(Zt){const Kt=new Float64Array(16);if(Zt)for(let Qt=0;Qt>16&1),Qt[ur-1]&=65535;Qt[15]=Ht[15]-32767-(Qt[14]>>16&1);const Jt=Qt[15]>>16&1;Qt[14]&=65535,wt(Ht,Qt,1-Jt)}for(let qt=0;qt<16;qt++)Zt[2*qt]=Ht[qt]&255,Zt[2*qt+1]=Ht[qt]>>8}function Pt(Zt,Kt){let Qt=0;for(let Ht=0;Ht<32;Ht++)Qt|=Zt[Ht]^Kt[Ht];return(1&Qt-1>>>8)-1}function $t(Zt,Kt){const Qt=new Uint8Array(32),Ht=new Uint8Array(32);return Ct(Qt,Zt),Ct(Ht,Kt),Pt(Qt,Ht)}function Mt(Zt){const Kt=new Uint8Array(32);return Ct(Kt,Zt),Kt[0]&1}function Bt(Zt,Kt){for(let Qt=0;Qt<16;Qt++)Zt[Qt]=Kt[2*Qt]+(Kt[2*Qt+1]<<8);Zt[15]&=32767}function Dt(Zt,Kt,Qt){for(let Ht=0;Ht<16;Ht++)Zt[Ht]=Kt[Ht]+Qt[Ht]}function zt(Zt,Kt,Qt){for(let Ht=0;Ht<16;Ht++)Zt[Ht]=Kt[Ht]-Qt[Ht]}function Ot(Zt,Kt,Qt){let Ht,qt,Jt=0,ur=0,xr=0,pr=0,Cr=0,Mr=0,lr=0,fr=0,_r=0,Sr=0,kr=0,Ar=0,$r=0,Or=0,Br=0,or=0,Yt=0,er=0,Gt=0,Vt=0,Wt=0,ar=0,yr=0,Er=0,Rr=0,Wr=0,Hr=0,Fr=0,pn=0,Jr=0,Qr=0,mn=Qt[0],ln=Qt[1],qr=Qt[2],En=Qt[3],un=Qt[4],Vr=Qt[5],hn=Qt[6],fn=Qt[7],Kr=Qt[8],Rn=Qt[9],dn=Qt[10],Gr=Qt[11],gn=Qt[12],an=Qt[13],Zr=Qt[14],An=Qt[15];Ht=Kt[0],Jt+=Ht*mn,ur+=Ht*ln,xr+=Ht*qr,pr+=Ht*En,Cr+=Ht*un,Mr+=Ht*Vr,lr+=Ht*hn,fr+=Ht*fn,_r+=Ht*Kr,Sr+=Ht*Rn,kr+=Ht*dn,Ar+=Ht*Gr,$r+=Ht*gn,Or+=Ht*an,Br+=Ht*Zr,or+=Ht*An,Ht=Kt[1],ur+=Ht*mn,xr+=Ht*ln,pr+=Ht*qr,Cr+=Ht*En,Mr+=Ht*un,lr+=Ht*Vr,fr+=Ht*hn,_r+=Ht*fn,Sr+=Ht*Kr,kr+=Ht*Rn,Ar+=Ht*dn,$r+=Ht*Gr,Or+=Ht*gn,Br+=Ht*an,or+=Ht*Zr,Yt+=Ht*An,Ht=Kt[2],xr+=Ht*mn,pr+=Ht*ln,Cr+=Ht*qr,Mr+=Ht*En,lr+=Ht*un,fr+=Ht*Vr,_r+=Ht*hn,Sr+=Ht*fn,kr+=Ht*Kr,Ar+=Ht*Rn,$r+=Ht*dn,Or+=Ht*Gr,Br+=Ht*gn,or+=Ht*an,Yt+=Ht*Zr,er+=Ht*An,Ht=Kt[3],pr+=Ht*mn,Cr+=Ht*ln,Mr+=Ht*qr,lr+=Ht*En,fr+=Ht*un,_r+=Ht*Vr,Sr+=Ht*hn,kr+=Ht*fn,Ar+=Ht*Kr,$r+=Ht*Rn,Or+=Ht*dn,Br+=Ht*Gr,or+=Ht*gn,Yt+=Ht*an,er+=Ht*Zr,Gt+=Ht*An,Ht=Kt[4],Cr+=Ht*mn,Mr+=Ht*ln,lr+=Ht*qr,fr+=Ht*En,_r+=Ht*un,Sr+=Ht*Vr,kr+=Ht*hn,Ar+=Ht*fn,$r+=Ht*Kr,Or+=Ht*Rn,Br+=Ht*dn,or+=Ht*Gr,Yt+=Ht*gn,er+=Ht*an,Gt+=Ht*Zr,Vt+=Ht*An,Ht=Kt[5],Mr+=Ht*mn,lr+=Ht*ln,fr+=Ht*qr,_r+=Ht*En,Sr+=Ht*un,kr+=Ht*Vr,Ar+=Ht*hn,$r+=Ht*fn,Or+=Ht*Kr,Br+=Ht*Rn,or+=Ht*dn,Yt+=Ht*Gr,er+=Ht*gn,Gt+=Ht*an,Vt+=Ht*Zr,Wt+=Ht*An,Ht=Kt[6],lr+=Ht*mn,fr+=Ht*ln,_r+=Ht*qr,Sr+=Ht*En,kr+=Ht*un,Ar+=Ht*Vr,$r+=Ht*hn,Or+=Ht*fn,Br+=Ht*Kr,or+=Ht*Rn,Yt+=Ht*dn,er+=Ht*Gr,Gt+=Ht*gn,Vt+=Ht*an,Wt+=Ht*Zr,ar+=Ht*An,Ht=Kt[7],fr+=Ht*mn,_r+=Ht*ln,Sr+=Ht*qr,kr+=Ht*En,Ar+=Ht*un,$r+=Ht*Vr,Or+=Ht*hn,Br+=Ht*fn,or+=Ht*Kr,Yt+=Ht*Rn,er+=Ht*dn,Gt+=Ht*Gr,Vt+=Ht*gn,Wt+=Ht*an,ar+=Ht*Zr,yr+=Ht*An,Ht=Kt[8],_r+=Ht*mn,Sr+=Ht*ln,kr+=Ht*qr,Ar+=Ht*En,$r+=Ht*un,Or+=Ht*Vr,Br+=Ht*hn,or+=Ht*fn,Yt+=Ht*Kr,er+=Ht*Rn,Gt+=Ht*dn,Vt+=Ht*Gr,Wt+=Ht*gn,ar+=Ht*an,yr+=Ht*Zr,Er+=Ht*An,Ht=Kt[9],Sr+=Ht*mn,kr+=Ht*ln,Ar+=Ht*qr,$r+=Ht*En,Or+=Ht*un,Br+=Ht*Vr,or+=Ht*hn,Yt+=Ht*fn,er+=Ht*Kr,Gt+=Ht*Rn,Vt+=Ht*dn,Wt+=Ht*Gr,ar+=Ht*gn,yr+=Ht*an,Er+=Ht*Zr,Rr+=Ht*An,Ht=Kt[10],kr+=Ht*mn,Ar+=Ht*ln,$r+=Ht*qr,Or+=Ht*En,Br+=Ht*un,or+=Ht*Vr,Yt+=Ht*hn,er+=Ht*fn,Gt+=Ht*Kr,Vt+=Ht*Rn,Wt+=Ht*dn,ar+=Ht*Gr,yr+=Ht*gn,Er+=Ht*an,Rr+=Ht*Zr,Wr+=Ht*An,Ht=Kt[11],Ar+=Ht*mn,$r+=Ht*ln,Or+=Ht*qr,Br+=Ht*En,or+=Ht*un,Yt+=Ht*Vr,er+=Ht*hn,Gt+=Ht*fn,Vt+=Ht*Kr,Wt+=Ht*Rn,ar+=Ht*dn,yr+=Ht*Gr,Er+=Ht*gn,Rr+=Ht*an,Wr+=Ht*Zr,Hr+=Ht*An,Ht=Kt[12],$r+=Ht*mn,Or+=Ht*ln,Br+=Ht*qr,or+=Ht*En,Yt+=Ht*un,er+=Ht*Vr,Gt+=Ht*hn,Vt+=Ht*fn,Wt+=Ht*Kr,ar+=Ht*Rn,yr+=Ht*dn,Er+=Ht*Gr,Rr+=Ht*gn,Wr+=Ht*an,Hr+=Ht*Zr,Fr+=Ht*An,Ht=Kt[13],Or+=Ht*mn,Br+=Ht*ln,or+=Ht*qr,Yt+=Ht*En,er+=Ht*un,Gt+=Ht*Vr,Vt+=Ht*hn,Wt+=Ht*fn,ar+=Ht*Kr,yr+=Ht*Rn,Er+=Ht*dn,Rr+=Ht*Gr,Wr+=Ht*gn,Hr+=Ht*an,Fr+=Ht*Zr,pn+=Ht*An,Ht=Kt[14],Br+=Ht*mn,or+=Ht*ln,Yt+=Ht*qr,er+=Ht*En,Gt+=Ht*un,Vt+=Ht*Vr,Wt+=Ht*hn,ar+=Ht*fn,yr+=Ht*Kr,Er+=Ht*Rn,Rr+=Ht*dn,Wr+=Ht*Gr,Hr+=Ht*gn,Fr+=Ht*an,pn+=Ht*Zr,Jr+=Ht*An,Ht=Kt[15],or+=Ht*mn,Yt+=Ht*ln,er+=Ht*qr,Gt+=Ht*En,Vt+=Ht*un,Wt+=Ht*Vr,ar+=Ht*hn,yr+=Ht*fn,Er+=Ht*Kr,Rr+=Ht*Rn,Wr+=Ht*dn,Hr+=Ht*Gr,Fr+=Ht*gn,pn+=Ht*an,Jr+=Ht*Zr,Qr+=Ht*An,Jt+=38*Yt,ur+=38*er,xr+=38*Gt,pr+=38*Vt,Cr+=38*Wt,Mr+=38*ar,lr+=38*yr,fr+=38*Er,_r+=38*Rr,Sr+=38*Wr,kr+=38*Hr,Ar+=38*Fr,$r+=38*pn,Or+=38*Jr,Br+=38*Qr,qt=1,Ht=Jt+qt+65535,qt=Math.floor(Ht/65536),Jt=Ht-qt*65536,Ht=ur+qt+65535,qt=Math.floor(Ht/65536),ur=Ht-qt*65536,Ht=xr+qt+65535,qt=Math.floor(Ht/65536),xr=Ht-qt*65536,Ht=pr+qt+65535,qt=Math.floor(Ht/65536),pr=Ht-qt*65536,Ht=Cr+qt+65535,qt=Math.floor(Ht/65536),Cr=Ht-qt*65536,Ht=Mr+qt+65535,qt=Math.floor(Ht/65536),Mr=Ht-qt*65536,Ht=lr+qt+65535,qt=Math.floor(Ht/65536),lr=Ht-qt*65536,Ht=fr+qt+65535,qt=Math.floor(Ht/65536),fr=Ht-qt*65536,Ht=_r+qt+65535,qt=Math.floor(Ht/65536),_r=Ht-qt*65536,Ht=Sr+qt+65535,qt=Math.floor(Ht/65536),Sr=Ht-qt*65536,Ht=kr+qt+65535,qt=Math.floor(Ht/65536),kr=Ht-qt*65536,Ht=Ar+qt+65535,qt=Math.floor(Ht/65536),Ar=Ht-qt*65536,Ht=$r+qt+65535,qt=Math.floor(Ht/65536),$r=Ht-qt*65536,Ht=Or+qt+65535,qt=Math.floor(Ht/65536),Or=Ht-qt*65536,Ht=Br+qt+65535,qt=Math.floor(Ht/65536),Br=Ht-qt*65536,Ht=or+qt+65535,qt=Math.floor(Ht/65536),or=Ht-qt*65536,Jt+=qt-1+37*(qt-1),qt=1,Ht=Jt+qt+65535,qt=Math.floor(Ht/65536),Jt=Ht-qt*65536,Ht=ur+qt+65535,qt=Math.floor(Ht/65536),ur=Ht-qt*65536,Ht=xr+qt+65535,qt=Math.floor(Ht/65536),xr=Ht-qt*65536,Ht=pr+qt+65535,qt=Math.floor(Ht/65536),pr=Ht-qt*65536,Ht=Cr+qt+65535,qt=Math.floor(Ht/65536),Cr=Ht-qt*65536,Ht=Mr+qt+65535,qt=Math.floor(Ht/65536),Mr=Ht-qt*65536,Ht=lr+qt+65535,qt=Math.floor(Ht/65536),lr=Ht-qt*65536,Ht=fr+qt+65535,qt=Math.floor(Ht/65536),fr=Ht-qt*65536,Ht=_r+qt+65535,qt=Math.floor(Ht/65536),_r=Ht-qt*65536,Ht=Sr+qt+65535,qt=Math.floor(Ht/65536),Sr=Ht-qt*65536,Ht=kr+qt+65535,qt=Math.floor(Ht/65536),kr=Ht-qt*65536,Ht=Ar+qt+65535,qt=Math.floor(Ht/65536),Ar=Ht-qt*65536,Ht=$r+qt+65535,qt=Math.floor(Ht/65536),$r=Ht-qt*65536,Ht=Or+qt+65535,qt=Math.floor(Ht/65536),Or=Ht-qt*65536,Ht=Br+qt+65535,qt=Math.floor(Ht/65536),Br=Ht-qt*65536,Ht=or+qt+65535,qt=Math.floor(Ht/65536),or=Ht-qt*65536,Jt+=qt-1+37*(qt-1),Zt[0]=Jt,Zt[1]=ur,Zt[2]=xr,Zt[3]=pr,Zt[4]=Cr,Zt[5]=Mr,Zt[6]=lr,Zt[7]=fr,Zt[8]=_r,Zt[9]=Sr,Zt[10]=kr,Zt[11]=Ar,Zt[12]=$r,Zt[13]=Or,Zt[14]=Br,Zt[15]=or}function It(Zt,Kt){Ot(Zt,Kt,Kt)}function Lt(Zt,Kt){const Qt=et();let Ht;for(Ht=0;Ht<16;Ht++)Qt[Ht]=Kt[Ht];for(Ht=253;Ht>=0;Ht--)It(Qt,Qt),Ht!==2&&Ht!==4&&Ot(Qt,Qt,Kt);for(Ht=0;Ht<16;Ht++)Zt[Ht]=Qt[Ht]}function Ft(Zt,Kt){const Qt=et();let Ht;for(Ht=0;Ht<16;Ht++)Qt[Ht]=Kt[Ht];for(Ht=250;Ht>=0;Ht--)It(Qt,Qt),Ht!==1&&Ot(Qt,Qt,Kt);for(Ht=0;Ht<16;Ht++)Zt[Ht]=Qt[Ht]}function jt(Zt,Kt){const Qt=et(),Ht=et(),qt=et(),Jt=et(),ur=et(),xr=et(),pr=et(),Cr=et(),Mr=et();zt(Qt,Zt[1],Zt[0]),zt(Mr,Kt[1],Kt[0]),Ot(Qt,Qt,Mr),Dt(Ht,Zt[0],Zt[1]),Dt(Mr,Kt[0],Kt[1]),Ot(Ht,Ht,Mr),Ot(qt,Zt[3],Kt[3]),Ot(qt,qt,st),Ot(Jt,Zt[2],Kt[2]),Dt(Jt,Jt,Jt),zt(ur,Ht,Qt),zt(xr,Jt,qt),Dt(pr,Jt,qt),Dt(Cr,Ht,Qt),Ot(Zt[0],ur,xr),Ot(Zt[1],Cr,pr),Ot(Zt[2],pr,xr),Ot(Zt[3],ur,Cr)}function bt(Zt,Kt,Qt){for(let Ht=0;Ht<4;Ht++)wt(Zt[Ht],Kt[Ht],Qt)}function vt(Zt,Kt){const Qt=et(),Ht=et(),qt=et();Lt(qt,Kt[2]),Ot(Qt,Kt[0],qt),Ot(Ht,Kt[1],qt),Ct(Zt,Ht),Zt[31]^=Mt(Qt)<<7}function ct(Zt,Kt,Qt){ht(Zt[0],rt),ht(Zt[1],nt),ht(Zt[2],nt),ht(Zt[3],rt);for(let Ht=255;Ht>=0;--Ht){const qt=Qt[Ht/8|0]>>(Ht&7)&1;bt(Zt,Kt,qt),jt(Kt,Zt),jt(Zt,Zt),bt(Zt,Kt,qt)}}function dt(Zt,Kt){const Qt=[et(),et(),et(),et()];ht(Qt[0],ot),ht(Qt[1],at),ht(Qt[2],nt),Ot(Qt[3],ot,at),ct(Zt,Qt,Kt)}function mt(Zt){if(Zt.length!==a.SEED_LENGTH)throw new Error(`ed25519: seed must be ${a.SEED_LENGTH} bytes`);const Kt=(0,$.hash)(Zt);Kt[0]&=248,Kt[31]&=127,Kt[31]|=64;const Qt=new Uint8Array(32),Ht=[et(),et(),et(),et()];dt(Ht,Kt),vt(Qt,Ht);const qt=new Uint8Array(64);return qt.set(Zt),qt.set(Qt,32),{publicKey:Qt,secretKey:qt}}a.generateKeyPairFromSeed=mt;function xt(Zt){const Kt=(0,_.randomBytes)(32,Zt),Qt=mt(Kt);return(0,j.wipe)(Kt),Qt}a.generateKeyPair=xt;function At(Zt){if(Zt.length!==a.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${a.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Zt.subarray(32))}a.extractPublicKeyFromSecretKey=At;const Rt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function St(Zt,Kt){let Qt,Ht,qt,Jt;for(Ht=63;Ht>=32;--Ht){for(Qt=0,qt=Ht-32,Jt=Ht-12;qt>4)*Rt[qt],Qt=Kt[qt]>>8,Kt[qt]&=255;for(qt=0;qt<32;qt++)Kt[qt]-=Qt*Rt[qt];for(Ht=0;Ht<32;Ht++)Kt[Ht+1]+=Kt[Ht]>>8,Zt[Ht]=Kt[Ht]&255}function Tt(Zt){const Kt=new Float64Array(64);for(let Qt=0;Qt<64;Qt++)Kt[Qt]=Zt[Qt];for(let Qt=0;Qt<64;Qt++)Zt[Qt]=0;St(Zt,Kt)}function Et(Zt,Kt){const Qt=new Float64Array(64),Ht=[et(),et(),et(),et()],qt=(0,$.hash)(Zt.subarray(0,32));qt[0]&=248,qt[31]&=127,qt[31]|=64;const Jt=new Uint8Array(64);Jt.set(qt.subarray(32),32);const ur=new $.SHA512;ur.update(Jt.subarray(32)),ur.update(Kt);const xr=ur.digest();ur.clean(),Tt(xr),dt(Ht,xr),vt(Jt,Ht),ur.reset(),ur.update(Jt.subarray(0,32)),ur.update(Zt.subarray(32)),ur.update(Kt);const pr=ur.digest();Tt(pr);for(let Cr=0;Cr<32;Cr++)Qt[Cr]=xr[Cr];for(let Cr=0;Cr<32;Cr++)for(let Mr=0;Mr<32;Mr++)Qt[Cr+Mr]+=pr[Cr]*qt[Mr];return St(Jt.subarray(32),Qt),Jt}a.sign=Et;function Nt(Zt,Kt){const Qt=et(),Ht=et(),qt=et(),Jt=et(),ur=et(),xr=et(),pr=et();return ht(Zt[2],nt),Bt(Zt[1],Kt),It(qt,Zt[1]),Ot(Jt,qt,it),zt(qt,qt,Zt[2]),Dt(Jt,Zt[2],Jt),It(ur,Jt),It(xr,ur),Ot(pr,xr,ur),Ot(Qt,pr,qt),Ot(Qt,Qt,Jt),Ft(Qt,Qt),Ot(Qt,Qt,qt),Ot(Qt,Qt,Jt),Ot(Qt,Qt,Jt),Ot(Zt[0],Qt,Jt),It(Ht,Zt[0]),Ot(Ht,Ht,Jt),$t(Ht,qt)&&Ot(Zt[0],Zt[0],ut),It(Ht,Zt[0]),Ot(Ht,Ht,Jt),$t(Ht,qt)?-1:(Mt(Zt[0])===Kt[31]>>7&&zt(Zt[0],rt,Zt[0]),Ot(Zt[3],Zt[0],Zt[1]),0)}function tr(Zt,Kt,Qt){const Ht=new Uint8Array(32),qt=[et(),et(),et(),et()],Jt=[et(),et(),et(),et()];if(Qt.length!==a.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${a.SIGNATURE_LENGTH} bytes`);if(Nt(Jt,Zt))return!1;const ur=new $.SHA512;ur.update(Qt.subarray(0,32)),ur.update(Zt),ur.update(Kt);const xr=ur.digest();return Tt(xr),ct(qt,Jt,xr),dt(Jt,Qt.subarray(32)),jt(qt,Jt),vt(Ht,qt),!Pt(Qt,Ht)}a.verify=tr;function ir(Zt){let Kt=[et(),et(),et(),et()];if(Nt(Kt,Zt))throw new Error("Ed25519: invalid public key");let Qt=et(),Ht=et(),qt=Kt[1];Dt(Qt,nt,qt),zt(Ht,nt,qt),Lt(Ht,Ht),Ot(Qt,Qt,Ht);let Jt=new Uint8Array(32);return Ct(Jt,Qt),Jt}a.convertPublicKeyToX25519=ir;function nr(Zt){const Kt=(0,$.hash)(Zt.subarray(0,32));Kt[0]&=248,Kt[31]&=127,Kt[31]|=64;const Qt=new Uint8Array(Kt.subarray(0,32));return(0,j.wipe)(Kt),Qt}a.convertSecretKeyToX25519=nr})(ed25519);var bytes$1={};Object.defineProperty(bytes$1,"__esModule",{value:!0});function concat$1(){for(var a=0,_=0;_{if(!["tz1","tz2","tz3","tz4","KT1","txr1","sr1"].some($=>a.toLowerCase().startsWith($.toLowerCase())))return!1;try{bs58check$2.decode(a)}catch{return!1}return!0};async function generateGUID(){const a=random.randomBytes(16);return[a.slice(0,4),a.slice(4,6),a.slice(6,8),a.slice(8,10),a.slice(10,16)].map(function(_){return Buffer$g.from(_).toString("hex")}).join("-")}const CONTRACT_PREFIX="KT1",secretbox_NONCEBYTES=24,secretbox_MACBYTES=16;var BeaconMessageType;(function(a){a.BlockchainRequest="blockchain_request",a.PermissionRequest="permission_request",a.SignPayloadRequest="sign_payload_request",a.OperationRequest="operation_request",a.BroadcastRequest="broadcast_request",a.ChangeAccountRequest="change_account_request",a.BlockchainResponse="blockchain_response",a.PermissionResponse="permission_response",a.SignPayloadResponse="sign_payload_response",a.ProofOfEventChallengeRequest="proof_of_event_challenge_request",a.ProofOfEventChallengeResponse="proof_of_event_challenge_response",a.SimulatedProofOfEventChallengeRequest="simulated_proof_of_event_challenge_request",a.SimulatedProofOfEventChallengeResponse="simulated_proof_of_event_challenge_response",a.OperationResponse="operation_response",a.BroadcastResponse="broadcast_response",a.Acknowledge="acknowledge",a.Disconnect="disconnect",a.Error="error"})(BeaconMessageType||(BeaconMessageType={}));var PermissionScope;(function(a){a.SIGN="sign",a.OPERATION_REQUEST="operation_request",a.ENCRYPT="encrypt",a.NOTIFICATION="notification",a.THRESHOLD="threshold"})(PermissionScope||(PermissionScope={}));var NetworkType;(function(a){a.MAINNET="mainnet",a.GHOSTNET="ghostnet",a.WEEKLYNET="weeklynet",a.DAILYNET="dailynet",a.DELPHINET="delphinet",a.EDONET="edonet",a.FLORENCENET="florencenet",a.GRANADANET="granadanet",a.HANGZHOUNET="hangzhounet",a.ITHACANET="ithacanet",a.JAKARTANET="jakartanet",a.KATHMANDUNET="kathmandunet",a.LIMANET="limanet",a.MUMBAINET="mumbainet",a.NAIROBINET="nairobinet",a.OXFORDNET="oxfordnet",a.PARISNET="parisnet",a.CUSTOM="custom"})(NetworkType||(NetworkType={}));var TezosOperationType;(function(a){a.ORIGINATION="origination",a.DELEGATION="delegation",a.REVEAL="reveal",a.TRANSACTION="transaction",a.ACTIVATE_ACCOUNT="activate_account",a.ENDORSEMENT="endorsement",a.SEED_NONCE_REVELATION="seed_nonce_revelation",a.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",a.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",a.PROPOSALS="proposals",a.BALLOT="ballot",a.ATTESTATION="attestation",a.PREATTESTATION="preattestation",a.PREENDORSEMENT="preendorsement",a.SET_DEPOSITS_LIMIT="set_deposits_limit",a.DOUBLE_PREATTESTATION_EVIDENCE="double_preattestation_evidence",a.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",a.ATTESTATION_WITH_SLOT="attestation_with_slot",a.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",a.DOUBLE_ATTESTATION_EVIDENCE="double_attestation_evidence",a.FAILING_NOOP="failing_noop",a.REGISTER_GLOBAL_CONSTANT="register_global_constant",a.TRANSFER_TICKET="transfer_ticket",a.INCREASE_PAID_STORAGE="increase_paid_storage",a.UPDATE_CONSENSUS_KEY="update_consensus_key",a.DRAIN_DELEGATE="drain_delegate",a.VDF_REVELATION="vdf_revelation",a.EVENT="event",a.TICKET_UPDATES="ticket_updates",a.SMART_ROLLUP_ORIGINATE="smart_rollup_originate",a.SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",a.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",a.SMART_ROLLUP_PUBLISH="smart_rollup_publish",a.SMART_ROLLUP_CEMENT="smart_rollup_cement",a.SMART_ROLLUP_RECOVER_BOND="smart_rollup_recover_bond",a.SMART_ROLLUP_REFUTE="smart_rollup_refute",a.SMART_ROLLUP_TIMEOUT="smart_rollup_timeout",a.DAL_PUBLISH_COMMITMENT="dal_publish_commitment"})(TezosOperationType||(TezosOperationType={}));var Origin;(function(a){a.WEBSITE="website",a.EXTENSION="extension",a.P2P="p2p",a.WALLETCONNECT="walletconnect"})(Origin||(Origin={}));var ExtensionMessageTarget;(function(a){a.BACKGROUND="toBackground",a.PAGE="toPage",a.EXTENSION="toExtension"})(ExtensionMessageTarget||(ExtensionMessageTarget={}));var BeaconErrorType;(function(a){a.BROADCAST_ERROR="BROADCAST_ERROR",a.NETWORK_NOT_SUPPORTED="NETWORK_NOT_SUPPORTED",a.NO_ADDRESS_ERROR="NO_ADDRESS_ERROR",a.NO_PRIVATE_KEY_FOUND_ERROR="NO_PRIVATE_KEY_FOUND_ERROR",a.NOT_GRANTED_ERROR="NOT_GRANTED_ERROR",a.PARAMETERS_INVALID_ERROR="PARAMETERS_INVALID_ERROR",a.TOO_MANY_OPERATIONS="TOO_MANY_OPERATIONS",a.TRANSACTION_INVALID_ERROR="TRANSACTION_INVALID_ERROR",a.SIGNATURE_TYPE_NOT_SUPPORTED="SIGNATURE_TYPE_NOT_SUPPORTED",a.ABORTED_ERROR="ABORTED_ERROR",a.UNKNOWN_ERROR="UNKNOWN_ERROR"})(BeaconErrorType||(BeaconErrorType={}));var TransportStatus;(function(a){a.NOT_CONNECTED="NOT_CONNECTED",a.CONNECTING="CONNECTING",a.CONNECTED="CONNECTED"})(TransportStatus||(TransportStatus={}));var TransportType;(function(a){a.CHROME_MESSAGE="chrome_message",a.WALLETCONNECT="walletconnect",a.POST_MESSAGE="post_message",a.LEDGER="ledger",a.P2P="p2p"})(TransportType||(TransportType={}));class Storage{static isSupported(){return Promise.resolve(!1)}}var StorageKey;(function(a){a.TRANSPORT_P2P_PEERS_DAPP="beacon:communication-peers-dapp",a.TRANSPORT_P2P_PEERS_WALLET="beacon:communication-peers-wallet",a.TRANSPORT_POSTMESSAGE_PEERS_DAPP="beacon:postmessage-peers-dapp",a.TRANSPORT_POSTMESSAGE_PEERS_WALLET="beacon:postmessage-peers-wallet",a.TRANSPORT_WALLETCONNECT_PEERS_DAPP="beacon:walletconnect-peers-dapp",a.LAST_SELECTED_WALLET="beacon:last-selected-wallet",a.ACCOUNTS="beacon:accounts",a.ACTIVE_ACCOUNT="beacon:active-account",a.PUSH_TOKENS="beacon:push-tokens",a.BEACON_SDK_SECRET_SEED="beacon:sdk-secret-seed",a.APP_METADATA_LIST="beacon:app-metadata-list",a.PERMISSION_LIST="beacon:permissions",a.ONGOING_PROOF_OF_EVENT_CHALLENGES="beacon:ongoing-proof-of-event-challenges",a.BEACON_SDK_VERSION="beacon:sdk_version",a.MATRIX_PRESERVED_STATE="beacon:sdk-matrix-preserved-state",a.MATRIX_PEER_ROOM_IDS="beacon:matrix-peer-rooms",a.MATRIX_SELECTED_NODE="beacon:matrix-selected-node",a.MULTI_NODE_SETUP_DONE="beacon:multi-node-setup",a.USER_ID="beacon:user-id",a.ENABLE_METRICS="beacon:enable_metrics",a.WC_2_CORE_PAIRING="wc@2:core:0.3:pairing",a.WC_2_CLIENT_SESSION="wc@2:client:0.3:session",a.WC_2_CORE_KEYCHAIN="wc@2:core:0.3:keychain",a.WC_2_CORE_MESSAGES="wc@2:core:0.3:messages",a.WC_2_CLIENT_PROPOSAL="wc@2:client:0.3:proposal",a.WC_2_CORE_SUBSCRIPTION="wc@2:core:0.3:subscription",a.WC_2_CORE_HISTORY="wc@2:core:0.3:history",a.WC_2_CORE_EXPIRER="wc@2:core:0.3:expirer"})(StorageKey||(StorageKey={}));const defaultValues={[StorageKey.TRANSPORT_P2P_PEERS_DAPP]:[],[StorageKey.TRANSPORT_P2P_PEERS_WALLET]:[],[StorageKey.TRANSPORT_POSTMESSAGE_PEERS_DAPP]:[],[StorageKey.TRANSPORT_POSTMESSAGE_PEERS_WALLET]:[],[StorageKey.TRANSPORT_WALLETCONNECT_PEERS_DAPP]:[],[StorageKey.LAST_SELECTED_WALLET]:void 0,[StorageKey.ACCOUNTS]:[],[StorageKey.ACTIVE_ACCOUNT]:void 0,[StorageKey.PUSH_TOKENS]:[],[StorageKey.BEACON_SDK_SECRET_SEED]:void 0,[StorageKey.APP_METADATA_LIST]:[],[StorageKey.PERMISSION_LIST]:[],[StorageKey.ONGOING_PROOF_OF_EVENT_CHALLENGES]:[],[StorageKey.BEACON_SDK_VERSION]:void 0,[StorageKey.MATRIX_PRESERVED_STATE]:{},[StorageKey.MATRIX_PEER_ROOM_IDS]:{},[StorageKey.MATRIX_SELECTED_NODE]:void 0,[StorageKey.MULTI_NODE_SETUP_DONE]:void 0,[StorageKey.WC_2_CLIENT_SESSION]:void 0,[StorageKey.USER_ID]:void 0,[StorageKey.ENABLE_METRICS]:void 0,[StorageKey.WC_2_CORE_PAIRING]:void 0,[StorageKey.WC_2_CORE_KEYCHAIN]:void 0,[StorageKey.WC_2_CORE_MESSAGES]:void 0,[StorageKey.WC_2_CLIENT_PROPOSAL]:void 0,[StorageKey.WC_2_CORE_SUBSCRIPTION]:void 0,[StorageKey.WC_2_CORE_HISTORY]:void 0,[StorageKey.WC_2_CORE_EXPIRER]:void 0};class P2PPairingRequest{constructor(_,$,j,et,tt,rt,nt){Yr(this,"type","p2p-pairing-request");Yr(this,"relayServer");Yr(this,"id");Yr(this,"name");Yr(this,"icon");Yr(this,"appUrl");Yr(this,"publicKey");Yr(this,"version");this.id=_,this.name=$,this.icon=rt,this.appUrl=nt,this.publicKey=j,this.version=et,this.relayServer=tt}}class ExtendedP2PPairingRequest extends P2PPairingRequest{constructor($,j,et,tt,rt,nt,it,st){super($,j,et,tt,rt,it,st);Yr(this,"senderId");this.senderId=nt}}var SigningType;(function(a){a.RAW="raw",a.OPERATION="operation",a.MICHELINE="micheline"})(SigningType||(SigningType={}));class P2PPairingResponse{constructor(_,$,j,et,tt,rt,nt){Yr(this,"type","p2p-pairing-request");Yr(this,"relayServer");Yr(this,"id");Yr(this,"name");Yr(this,"icon");Yr(this,"appUrl");Yr(this,"publicKey");Yr(this,"version");this.id=_,this.name=$,this.icon=rt,this.appUrl=nt,this.publicKey=j,this.version=et,this.relayServer=tt}}class PostMessagePairingRequest{constructor(_,$,j,et,tt,rt){Yr(this,"type","postmessage-pairing-request");Yr(this,"id");Yr(this,"name");Yr(this,"icon");Yr(this,"appUrl");Yr(this,"publicKey");Yr(this,"version");this.id=_,this.name=$,this.icon=tt,this.appUrl=rt,this.publicKey=j,this.version=et}}class ExtendedPostMessagePairingRequest extends PostMessagePairingRequest{constructor($,j,et,tt,rt,nt,it){super($,j,et,tt,nt,it);Yr(this,"senderId");this.senderId=rt}}class WalletConnectPairingRequest{constructor(_,$,j,et,tt,rt,nt){Yr(this,"type","walletconnect-pairing-request");Yr(this,"uri");Yr(this,"id");Yr(this,"name");Yr(this,"icon");Yr(this,"appUrl");Yr(this,"publicKey");Yr(this,"version");this.id=_,this.name=$,this.icon=rt,this.appUrl=nt,this.publicKey=j,this.version=et,this.uri=tt}}class ExtendedWalletConnectPairingRequest extends WalletConnectPairingRequest{constructor($,j,et,tt,rt,nt,it,st){super($,j,et,tt,nt,it,st);Yr(this,"senderId");this.senderId=rt}}var ColorMode;(function(a){a.LIGHT="light",a.DARK="dark"})(ColorMode||(ColorMode={}));var Regions;(function(a){a.EUROPE_EAST="europe-east",a.EUROPE_WEST="europe-west",a.NORTH_AMERICA_EAST="north-america-east",a.NORTH_AMERICA_WEST="north-america-west",a.CENTRAL_AMERICA="central-america",a.SOUTH_AMERICA="south-america",a.ASIA_EAST="asia-east",a.ASIA_WEST="asia-west",a.AFRICA="africa",a.AUSTRALIA="australia"})(Regions||(Regions={}));const SDK_VERSION="4.2.2",BEACON_VERSION="3",NOTIFICATION_ORACLE_URL="https://beacon-notification-oracle.dev.gke.papers.tech",cbs=[a=>{}];let windowRef={postMessage:(a,_)=>{console.log("GOT MOCK POST MESSAGE",a),cbs.forEach($=>{$({data:a})})},addEventListener:(a,_)=>{cbs.push(_)},removeEventListener:(a,_)=>{cbs.splice(cbs.indexOf($=>$===_),1)},location:{origin:"*"}};try{typeof window<"u"&&(windowRef=window)}catch(a){console.log(`not defined: ${a}`)}class MockAnalytics{track(_,$,j,et){}}class BeaconClient{constructor(_){Yr(this,"name");Yr(this,"iconUrl");Yr(this,"appUrl");Yr(this,"_beaconId",new ExposedPromise);Yr(this,"storage");Yr(this,"analytics");Yr(this,"_keyPair",new ExposedPromise);if(!_.name)throw new Error("Name not set");if(!_.storage)throw new Error("Storage not set");this.name=_.name,this.iconUrl=_.iconUrl,this.appUrl=_.appUrl??windowRef.location.origin,this.storage=_.storage,this.analytics=_.analytics??new MockAnalytics,windowRef.beaconCreatedClientInstance?console.error("[BEACON] It looks like you created multiple Beacon SDK Client instances. This can lead to problems. Only create one instance and re-use it everywhere."):windowRef.beaconCreatedClientInstance=!0,this.initSDK().catch(console.error)}get beaconId(){return this._beaconId.promise}get keyPair(){return this._keyPair.promise}async destroy(){await this.removeBeaconEntriesFromStorage(),windowRef.beaconCreatedClientInstance=!1}async initSDK(){return this.storage.set(StorageKey.BEACON_SDK_VERSION,SDK_VERSION).catch(console.error),this.loadOrCreateBeaconSecret().catch(console.error),this.keyPair.then(_=>{this._beaconId.resolve(toHex$1(_.publicKey))})}async removeBeaconEntriesFromStorage(){const _=Object.values(StorageKey);await Promise.all(_.map($=>this.storage.delete($)))}async loadOrCreateBeaconSecret(){const _=await this.storage.get(StorageKey.BEACON_SDK_SECRET_SEED);if(_&&typeof _=="string")this._keyPair.resolve(await getKeypairFromSeed(_));else{const $=await generateGUID();await this.storage.set(StorageKey.BEACON_SDK_SECRET_SEED,$),this._keyPair.resolve(await getKeypairFromSeed($))}}}function fixArrayType(a){return a}class StorageManager{constructor(_,$){Yr(this,"storage");Yr(this,"storageKey");this.storage=_,this.storageKey=$}async getAll(){return await this.storage.get(this.storageKey)??[]}async getOne(_){const $=await this.storage.get(this.storageKey);return $.find(_)}async addOne(_,$,j=!0){const et=await this.storage.get(this.storageKey);if(!et.some($))et.push(_);else if(j)for(let tt=0;tt!_(et));return this.storage.set(this.storageKey,j)}async removeAll(){return this.storage.delete(this.storageKey)}}const getAccountIdentifier=async(a,_)=>{const $=[a,_.type];_.name&&$.push(`name:${_.name}`),_.rpcUrl&&$.push(`rpc:${_.rpcUrl}`);const j=Buffer$g.from(blake2b$1.hash(encode_1($.join("-")),10));return bs58check$2.encode(j)};class PermissionValidator{static async hasPermission(_,$,j){switch(_.type){case BeaconMessageType.PermissionRequest:case BeaconMessageType.BroadcastRequest:return!0;case BeaconMessageType.OperationRequest:{const et=await getAccountIdentifier(_.sourceAddress,_.network),tt=await $(et);return tt?tt.scopes.includes(PermissionScope.OPERATION_REQUEST):!1}case BeaconMessageType.SignPayloadRequest:{const tt=(await j()).filter(rt=>rt.address===_.sourceAddress);return tt.length===0?!1:tt.some(rt=>rt.scopes.includes(PermissionScope.SIGN))}default:throw new Error("Message not handled")}}}class AccountManager{constructor(_){Yr(this,"storageManager");this.storageManager=new StorageManager(_,StorageKey.ACCOUNTS)}async getAccounts(){return await this.storageManager.getAll()??[]}async getAccount(_){return this.storageManager.getOne($=>$.accountIdentifier===_)}async addAccount(_){return this.storageManager.addOne(_,$=>$.accountIdentifier===_.accountIdentifier)}async updateAccount(_,$){const j=await this.getAccount(_);if(!j)return;const et={...j,...$};return await this.storageManager.addOne(et,tt=>tt.accountIdentifier===_,!0),et}async removeAccount(_){return this.storageManager.remove($=>$.accountIdentifier===_)}async removeAccounts(_){return this.storageManager.remove($=>_.includes($.accountIdentifier))}async removeAllAccounts(){return this.storageManager.removeAll()}async hasPermission(_){return PermissionValidator.hasPermission(_,this.getAccount.bind(this),this.getAccounts.bind(this))}}const isHex$1=a=>/^[A-F0-9]+$/i.test(a),getSenderId=async a=>{isHex$1(a)||console.error("PublicKey needs to be in hex format!");const _=Buffer$g.from(blake2b$1.hash(Buffer$g.from(a,"hex"),5));return bs58check$2.encode(_)};let debug$2=!!windowRef.beaconSdkDebugEnabled;debug$2&&console.log("[BEACON]: Debug mode is ON (turned on either by the developer or a browser extension)");const getDebugEnabled=()=>debug$2;class InternalLogger{constructor(){}debug(_,$,...j){this._log("debug",_,$,j)}log(_,$,...j){this._log("log",_,$,j)}warn(_,$,...j){this._log("warn",_,$,j)}error(_,$,...j){this._log("error",_,$,j)}time(_,$){_?console.time($):console.timeEnd($)}timeLog(_,$,...j){this._log("timeLog",_,$,j)}_log(_,$,j,et=[]){if(!getDebugEnabled())return;let tt=`[BEACON] ${new Date().toISOString()} [${$}](${j})`,rt=et;switch(et[0]&&typeof et[0]=="string"&&(tt+=` ${et[0]}`,rt=et.slice(1)),_){case"error":console.group(tt),console.error(...rt);break;case"warn":console.group(tt),console.warn(...rt);break;case"debug":console.groupCollapsed(tt),console.debug(...rt);break;case"timeLog":console.group(tt),console.timeLog(...rt);break;default:console.group(tt),console.log(...rt)}console.groupEnd()}}class Logger{constructor(_){Yr(this,"name");this.name=_}debug(_,...$){logger$9.debug(this.name,_,$)}log(_,...$){logger$9.log(this.name,_,$)}warn(_,...$){logger$9.warn(this.name,_,$)}error(_,...$){logger$9.error(this.name,_,$)}time(_,$){logger$9.time(_,$)}timeLog(_,...$){logger$9.timeLog(_,$)}}let logger$9=new InternalLogger;const logger$8=new Logger("Client");class Client extends BeaconClient{constructor($){super($);Yr(this,"accountManager");Yr(this,"handleResponse");Yr(this,"rateLimit",2);Yr(this,"rateLimitWindowInSeconds",5);Yr(this,"requestCounter",[]);Yr(this,"matrixNodes");Yr(this,"transportListeners",new Map);Yr(this,"_transport",new ExposedPromise);this.accountManager=new AccountManager($.storage),this.matrixNodes=$.matrixNodes??{},this.handleResponse=(j,et)=>{throw new Error(`not overwritten${JSON.stringify(j)} - ${JSON.stringify(et)}`)}}get transport(){return this._transport.promise}get connectionStatus(){var $;return(($=this._transport.promiseResult)==null?void 0:$.connectionStatus)??TransportStatus.NOT_CONNECTED}get ready(){return this.transport.then(()=>{})}async cleanup(){if(this.transportListeners.size&&this._transport.isResolved()){const $=await this.transport;await Promise.all(Array.from(this.transportListeners.values()).map(j=>$.removeListener(j))),this.transportListeners.clear()}}async getAccounts(){return this.accountManager.getAccounts()}async getAccount($){return this.accountManager.getAccount($)}async removeAccount($){return this.accountManager.removeAccount($)}async removeAllAccounts(){return this.accountManager.removeAllAccounts()}async addRequestAndCheckIfRateLimited(){const $=new Date().getTime();return this.requestCounter=this.requestCounter.filter(j=>j+this.rateLimitWindowInSeconds*1e3>$),this.requestCounter.push($),this.requestCounter.length>this.rateLimit}async init($){return this._transport.isResolved()?(await this.transport).type:(await this.setTransport($),$.type)}async getOwnAppMetadata(){return{senderId:await getSenderId(await this.beaconId),name:this.name,icon:this.iconUrl}}async getPeers(){return(await this.transport).getPeers()}async addPeer($){return(await this.transport).addPeer($)}async destroy(){if(this._transport.isResolved()){const $=await this.transport;await this.cleanup(),await $.disconnect(),$.type===TransportType.WALLETCONNECT&&await $.doClientCleanup()}await super.destroy()}async setTransport($){$?this._transport.isSettled()?this._transport=ExposedPromise.resolve($):this._transport.resolve($):this._transport.isSettled()&&(this._transport=new ExposedPromise)}async addListener($){this.transportListeners.has($.type)&&await $.removeListener(this.transportListeners.get($.type));const j=async(et,tt)=>{if(typeof et=="string"){const rt=await new Serializer().deserialize(et);this.handleResponse(rt,tt)}};this.transportListeners.set($.type,j),$.addListener(j).catch(et=>logger$8.error("addListener",et))}async sendDisconnectToPeer($,j){const et={id:await generateGUID(),version:$.version,senderId:await getSenderId(await this.beaconId),type:BeaconMessageType.Disconnect},tt=await new Serializer().serialize(et);await(j??await this.transport).send(tt,$)}}const logger$7=new Logger("Transport");let Transport$2=class{constructor(_,$,j){Yr(this,"type",TransportType.POST_MESSAGE);Yr(this,"name");Yr(this,"_isConnected",TransportStatus.NOT_CONNECTED);Yr(this,"peerManager");Yr(this,"client");Yr(this,"newPeerListener");Yr(this,"listeners",[]);this.name=_,this.client=$,this.peerManager=j}setEventHandler(_,$){this.client.eventHandlers.set(_,$)}get connectionStatus(){return this._isConnected}static async isAvailable(){return Promise.resolve(!1)}async connect(){logger$7.log("connect"),this._isConnected=TransportStatus.CONNECTED}async disconnect(){logger$7.log("disconnect"),this._isConnected=TransportStatus.NOT_CONNECTED}async send(_,$){if($)return this.client.sendMessage(_,$);{const et=(await this.getPeers()).map(tt=>this.client.sendMessage(_,tt));return(await Promise.all(et))[0]}}async addListener(_){logger$7.debug("addListener"),this.listeners.push(_)}async removeListener(_){logger$7.log("removeListener"),this.listeners=this.listeners.filter($=>$!==_)}async getPeers(){return this.peerManager.getPeers()}async addPeer(_,$=!0){logger$7.log("addPeer","adding peer",_),await this.peerManager.addPeer(_),await this.listen(_.publicKey)}async removePeer(_){logger$7.log("removePeer","removing peer",_),await this.peerManager.removePeer(_.publicKey),this.client&&await this.client.unsubscribeFromEncryptedMessage(_.publicKey)}async removeAllPeers(){logger$7.log("removeAllPeers"),await this.peerManager.removeAllPeers(),this.client&&await this.client.unsubscribeFromEncryptedMessages()}async notifyListeners(_,$){this.listeners.length===0?logger$7.warn("notifyListeners","0 listeners notified!",this):logger$7.log("notifyListeners",`Notifying ${this.listeners.length} listeners`,this),this.listeners.forEach(j=>{j(_,$)})}};class LocalStorage extends Storage{constructor($){super();Yr(this,"prefix");this.prefix=$}static async isSupported(){return Promise.resolve(typeof window<"u"&&!!window.localStorage)}async get($){const j=localStorage.getItem(this.getPrefixedKey($));if(j)try{return JSON.parse(j)}catch{return j}else return typeof defaultValues[$]=="object"?JSON.parse(JSON.stringify(defaultValues[$])):defaultValues[$]}async set($,j){return typeof j=="string"?localStorage.setItem(this.getPrefixedKey($),j):localStorage.setItem(this.getPrefixedKey($),JSON.stringify(j))}async delete($){return Promise.resolve(localStorage.removeItem(this.getPrefixedKey($)))}async subscribeToStorageChanged($){window.addEventListener("storage",j=>{j.key?$({eventType:"entryModified",key:this.getPrefixedKey(j.key),oldValue:j.oldValue,newValue:j.newValue}):$({eventType:"storageCleared",key:null,oldValue:null,newValue:null})},!1)}getPrefixedKey($){return this.prefix?`${this.prefix}-${$}`:$}}class Serializer{async serialize(_){const $=JSON.stringify(_);return bs58check$2.encode(Buffer$g.from($))}async deserialize(_){if(typeof _!="string")throw new Error("Encoded payload needs to be a string");return JSON.parse(bs58check$2.decode(_).toString())}}class AppMetadataManager{constructor(_){Yr(this,"storageManager");this.storageManager=new StorageManager(_,StorageKey.APP_METADATA_LIST)}async getAppMetadataList(){return await this.storageManager.getAll()??[]}async getAppMetadata(_){return this.storageManager.getOne($=>$.senderId===_)}async addAppMetadata(_){return this.storageManager.addOne(_,$=>$.senderId===_.senderId)}async removeAppMetadata(_){return this.storageManager.remove($=>$.senderId===_)}async removeAppMetadatas(_){return this.storageManager.remove($=>_.includes($.senderId))}async removeAllAppMetadata(){return this.storageManager.removeAll()}}class PermissionManager{constructor(_){Yr(this,"storageManager");this.storageManager=new StorageManager(_,StorageKey.PERMISSION_LIST)}async getPermissions(){return await this.storageManager.getAll()??[]}async getPermission(_){return this.storageManager.getOne($=>$.accountIdentifier===_)}async addPermission(_){return this.storageManager.addOne(_,$=>$.accountIdentifier===_.accountIdentifier&&$.senderId===_.senderId)}async removePermission(_){return this.storageManager.remove($=>$.accountIdentifier===_)}async removePermissions(_){return this.storageManager.remove($=>_.includes($.accountIdentifier))}async removeAllPermissions(){return this.storageManager.removeAll()}async hasPermission(_){return PermissionValidator.hasPermission(_,this.getPermission.bind(this),this.getPermissions.bind(this))}}class PeerManager{constructor(_,$){Yr(this,"storageManager");this.storageManager=new StorageManager(_,$)}async hasPeer(_){return!!await this.getPeer(_)}async getPeers(){return await this.storageManager.getAll()??[]}async getPeer(_){return this.storageManager.getOne($=>$.publicKey===_)}async addPeer(_){return this.storageManager.addOne(_,$=>$.publicKey===_.publicKey)}async removePeer(_){return this.storageManager.remove($=>$.publicKey===_)}async removePeers(_){return this.storageManager.remove($=>_.includes($.publicKey))}async removeAllPeers(){return this.storageManager.removeAll()}}var x25519Session={},keyagreement={},hasRequiredKeyagreement;function requireKeyagreement(){return hasRequiredKeyagreement||(hasRequiredKeyagreement=1,function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.X25519Session=a.SECRET_SEED_LENGTH=a.SAVED_STATE_LENGTH=a.ACCEPT_MESSAGE_LENGTH=a.OFFER_MESSAGE_LENGTH=void 0;const _=random,$=wipe$1,j=x25519,et=requireX25519Session();a.OFFER_MESSAGE_LENGTH=j.PUBLIC_KEY_LENGTH,a.ACCEPT_MESSAGE_LENGTH=j.PUBLIC_KEY_LENGTH,a.SAVED_STATE_LENGTH=j.SECRET_KEY_LENGTH,a.SECRET_SEED_LENGTH=j.SECRET_KEY_LENGTH;class tt{constructor(nt,it){this.offerMessageLength=a.OFFER_MESSAGE_LENGTH,this.acceptMessageLength=a.ACCEPT_MESSAGE_LENGTH,this.sharedKeyLength=j.SHARED_KEY_LENGTH,this.savedStateLength=a.SAVED_STATE_LENGTH,this._seed=nt||(0,_.randomBytes)(j.SECRET_KEY_LENGTH,it)}saveState(){return new Uint8Array(this._seed)}restoreState(nt){return this._seed=new Uint8Array(nt),this}clean(){this._seed&&(0,$.wipe)(this._seed),this._keyPair&&((0,$.wipe)(this._keyPair.secretKey),(0,$.wipe)(this._keyPair.publicKey)),this._sharedKey&&(0,$.wipe)(this._sharedKey),this._sessionKeys&&((0,$.wipe)(this._sessionKeys.receive),(0,$.wipe)(this._sessionKeys.send))}offer(){return this._keyPair=(0,j.generateKeyPairFromSeed)(this._seed),new Uint8Array(this._keyPair.publicKey)}accept(nt){if(this._keyPair)throw new Error("X25519Session: accept shouldn't be called by offering party");if(nt.length!==this.offerMessageLength)throw new Error("X25519Session: incorrect offer message length");if(this._sharedKey)throw new Error("X25519Session: accept was already called");const it=(0,j.generateKeyPairFromSeed)(this._seed);return this._sharedKey=(0,j.sharedKey)(it.secretKey,nt),this._sessionKeys=(0,et.clientSessionKeysFromSharedKey)(this._sharedKey,it.publicKey,nt),(0,$.wipe)(it.secretKey),it.publicKey}finish(nt){if(nt.length!==this.acceptMessageLength)throw new Error("X25519Session: incorrect accept message length");if(!this._keyPair)throw new Error("X25519Session: no offer state");if(this._sharedKey)throw new Error("X25519Session: finish was already called");return this._sharedKey=(0,j.sharedKey)(this._keyPair.secretKey,nt),this._sessionKeys=(0,et.serverSessionKeysFromSharedKey)(this._sharedKey,this._keyPair.publicKey,nt),this}getSharedKey(){if(!this._sharedKey)throw new Error("X25519Session: no shared key established");return new Uint8Array(this._sharedKey)}getSessionKeys(){if(!this._sessionKeys)throw new Error("X25519Session: no shared key established");return{receive:new Uint8Array(this._sessionKeys.receive),send:new Uint8Array(this._sessionKeys.send)}}}a.X25519Session=tt}(keyagreement)),keyagreement}var hasRequiredX25519Session;function requireX25519Session(){return hasRequiredX25519Session||(hasRequiredX25519Session=1,function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.clientSessionKeys=a.serverSessionKeys=a.clientSessionKeysFromSharedKey=a.serverSessionKeysFromSharedKey=a.X25519Session=void 0;const _=blake2b$1,$=x25519;var j=requireKeyagreement();Object.defineProperty(a,"X25519Session",{enumerable:!0,get:function(){return j.X25519Session}});const et=32;function tt(st,ot,at,ut=_.BLAKE2b){const ht=new ut;if(ht.digestLength!==et*2)throw new Error("X25519: incorrect digest length");const yt=ht.update(st).update(at).update(ot).digest();return{send:yt.subarray(0,et),receive:yt.subarray(et)}}a.serverSessionKeysFromSharedKey=tt;function rt(st,ot,at,ut=_.BLAKE2b){const ht=new ut;if(ht.digestLength!==et*2)throw new Error("X25519: incorrect digest length");const yt=ht.update(st).update(ot).update(at).digest();return{receive:yt.subarray(0,et),send:yt.subarray(et)}}a.clientSessionKeysFromSharedKey=rt;function nt(st,ot,at=_.BLAKE2b){const ut=(0,$.sharedKey)(st.secretKey,ot);return tt(ut,st.publicKey,ot,at)}a.serverSessionKeys=nt;function it(st,ot,at=_.BLAKE2b){const ut=(0,$.sharedKey)(st.secretKey,ot);return rt(ut,st.publicKey,ot,at)}a.clientSessionKeys=it}(x25519Session)),x25519Session}var x25519SessionExports=requireX25519Session();class CommunicationClient{constructor(_){Yr(this,"keyPair");Yr(this,"eventHandlers",new Map);Yr(this,"isMobileOS",()=>/(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet|Windows Phone|SymbianOS|Kindle)/i.test(navigator.userAgent));this.keyPair=_}async getPublicKey(){var _;return toHex$1((_=this.keyPair)==null?void 0:_.publicKey)}async getPublicKeyHash(){return getHexHash(this.keyPair.publicKey)}async createCryptoBoxServer(_,$){return x25519SessionExports.serverSessionKeys({publicKey:ed25519.convertPublicKeyToX25519($.publicKey),secretKey:ed25519.convertSecretKeyToX25519($.secretKey)},ed25519.convertPublicKeyToX25519(Buffer$g.from(_,"hex")))}async createCryptoBoxClient(_,$){return x25519SessionExports.clientSessionKeys({publicKey:ed25519.convertPublicKeyToX25519($.publicKey),secretKey:ed25519.convertSecretKeyToX25519($.secretKey)},ed25519.convertPublicKeyToX25519(Buffer$g.from(_,"hex")))}async encryptMessageAsymmetric(_,$){return sealCryptobox($,Buffer$g.from(_,"hex"))}}function bind$2(a,_){return function(){return a.apply(_,arguments)}}const{toString:toString$4}=Object.prototype,{getPrototypeOf:getPrototypeOf$4}=Object,kindOf$1=(a=>_=>{const $=toString$4.call(_);return a[$]||(a[$]=$.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest$1=a=>(a=a.toLowerCase(),_=>kindOf$1(_)===a),typeOfTest$1=a=>_=>typeof _===a,{isArray:isArray$4}=Array,isUndefined$1=typeOfTest$1("undefined");function isBuffer$2(a){return a!==null&&!isUndefined$1(a)&&a.constructor!==null&&!isUndefined$1(a.constructor)&&isFunction$3(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const isArrayBuffer$1=kindOfTest$1("ArrayBuffer");function isArrayBufferView$1(a){let _;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?_=ArrayBuffer.isView(a):_=a&&a.buffer&&isArrayBuffer$1(a.buffer),_}const isString$2=typeOfTest$1("string"),isFunction$3=typeOfTest$1("function"),isNumber$1=typeOfTest$1("number"),isObject$3=a=>a!==null&&typeof a=="object",isBoolean$2=a=>a===!0||a===!1,isPlainObject$5=a=>{if(kindOf$1(a)!=="object")return!1;const _=getPrototypeOf$4(a);return(_===null||_===Object.prototype||Object.getPrototypeOf(_)===null)&&!(Symbol.toStringTag in a)&&!(Symbol.iterator in a)},isDate$2=kindOfTest$1("Date"),isFile$1=kindOfTest$1("File"),isBlob$1=kindOfTest$1("Blob"),isFileList$1=kindOfTest$1("FileList"),isStream$1=a=>isObject$3(a)&&isFunction$3(a.pipe),isFormData$1=a=>{let _;return a&&(typeof FormData=="function"&&a instanceof FormData||isFunction$3(a.append)&&((_=kindOf$1(a))==="formdata"||_==="object"&&isFunction$3(a.toString)&&a.toString()==="[object FormData]"))},isURLSearchParams$1=kindOfTest$1("URLSearchParams"),trim$2=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach$1(a,_,{allOwnKeys:$=!1}={}){if(a===null||typeof a>"u")return;let j,et;if(typeof a!="object"&&(a=[a]),isArray$4(a))for(j=0,et=a.length;j0;)if(et=$[j],_===et.toLowerCase())return et;return null}const _global$1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined$1=a=>!isUndefined$1(a)&&a!==_global$1;function merge$1(){const{caseless:a}=isContextDefined$1(this)&&this||{},_={},$=(j,et)=>{const tt=a&&findKey$2(_,et)||et;isPlainObject$5(_[tt])&&isPlainObject$5(j)?_[tt]=merge$1(_[tt],j):isPlainObject$5(j)?_[tt]=merge$1({},j):isArray$4(j)?_[tt]=j.slice():_[tt]=j};for(let j=0,et=arguments.length;j(forEach$1(_,(et,tt)=>{$&&isFunction$3(et)?a[tt]=bind$2(et,$):a[tt]=et},{allOwnKeys:j}),a),stripBOM$1=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),inherits$4=(a,_,$,j)=>{a.prototype=Object.create(_.prototype,j),a.prototype.constructor=a,Object.defineProperty(a,"super",{value:_.prototype}),$&&Object.assign(a.prototype,$)},toFlatObject$1=(a,_,$,j)=>{let et,tt,rt;const nt={};if(_=_||{},a==null)return _;do{for(et=Object.getOwnPropertyNames(a),tt=et.length;tt-- >0;)rt=et[tt],(!j||j(rt,a,_))&&!nt[rt]&&(_[rt]=a[rt],nt[rt]=!0);a=$!==!1&&getPrototypeOf$4(a)}while(a&&(!$||$(a,_))&&a!==Object.prototype);return _},endsWith$1=(a,_,$)=>{a=String(a),($===void 0||$>a.length)&&($=a.length),$-=_.length;const j=a.indexOf(_,$);return j!==-1&&j===$},toArray$2=a=>{if(!a)return null;if(isArray$4(a))return a;let _=a.length;if(!isNumber$1(_))return null;const $=new Array(_);for(;_-- >0;)$[_]=a[_];return $},isTypedArray$1=(a=>_=>a&&_ instanceof a)(typeof Uint8Array<"u"&&getPrototypeOf$4(Uint8Array)),forEachEntry$1=(a,_)=>{const j=(a&&a[Symbol.iterator]).call(a);let et;for(;(et=j.next())&&!et.done;){const tt=et.value;_.call(a,tt[0],tt[1])}},matchAll$1=(a,_)=>{let $;const j=[];for(;($=a.exec(_))!==null;)j.push($);return j},isHTMLForm$1=kindOfTest$1("HTMLFormElement"),toCamelCase$1=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function($,j,et){return j.toUpperCase()+et}),hasOwnProperty$1=(({hasOwnProperty:a})=>(_,$)=>a.call(_,$))(Object.prototype),isRegExp$1=kindOfTest$1("RegExp"),reduceDescriptors$1=(a,_)=>{const $=Object.getOwnPropertyDescriptors(a),j={};forEach$1($,(et,tt)=>{let rt;(rt=_(et,tt,a))!==!1&&(j[tt]=rt||et)}),Object.defineProperties(a,j)},freezeMethods$1=a=>{reduceDescriptors$1(a,(_,$)=>{if(isFunction$3(a)&&["arguments","caller","callee"].indexOf($)!==-1)return!1;const j=a[$];if(isFunction$3(j)){if(_.enumerable=!1,"writable"in _){_.writable=!1;return}_.set||(_.set=()=>{throw Error("Can not rewrite read-only method '"+$+"'")})}})},toObjectSet$1=(a,_)=>{const $={},j=et=>{et.forEach(tt=>{$[tt]=!0})};return isArray$4(a)?j(a):j(String(a).split(_)),$},noop$7=()=>{},toFiniteNumber$1=(a,_)=>(a=+a,Number.isFinite(a)?a:_),ALPHA$1="abcdefghijklmnopqrstuvwxyz",DIGIT$1="0123456789",ALPHABET$2={DIGIT:DIGIT$1,ALPHA:ALPHA$1,ALPHA_DIGIT:ALPHA$1+ALPHA$1.toUpperCase()+DIGIT$1},generateString$1=(a=16,_=ALPHABET$2.ALPHA_DIGIT)=>{let $="";const{length:j}=_;for(;a--;)$+=_[Math.random()*j|0];return $};function isSpecCompliantForm$1(a){return!!(a&&isFunction$3(a.append)&&a[Symbol.toStringTag]==="FormData"&&a[Symbol.iterator])}const toJSONObject$1=a=>{const _=new Array(10),$=(j,et)=>{if(isObject$3(j)){if(_.indexOf(j)>=0)return;if(!("toJSON"in j)){_[et]=j;const tt=isArray$4(j)?[]:{};return forEach$1(j,(rt,nt)=>{const it=$(rt,et+1);!isUndefined$1(it)&&(tt[nt]=it)}),_[et]=void 0,tt}}return j};return $(a,0)},isAsyncFn$1=kindOfTest$1("AsyncFunction"),isThenable$2=a=>a&&(isObject$3(a)||isFunction$3(a))&&isFunction$3(a.then)&&isFunction$3(a.catch),utils$i={isArray:isArray$4,isArrayBuffer:isArrayBuffer$1,isBuffer:isBuffer$2,isFormData:isFormData$1,isArrayBufferView:isArrayBufferView$1,isString:isString$2,isNumber:isNumber$1,isBoolean:isBoolean$2,isObject:isObject$3,isPlainObject:isPlainObject$5,isUndefined:isUndefined$1,isDate:isDate$2,isFile:isFile$1,isBlob:isBlob$1,isRegExp:isRegExp$1,isFunction:isFunction$3,isStream:isStream$1,isURLSearchParams:isURLSearchParams$1,isTypedArray:isTypedArray$1,isFileList:isFileList$1,forEach:forEach$1,merge:merge$1,extend:extend$1,trim:trim$2,stripBOM:stripBOM$1,inherits:inherits$4,toFlatObject:toFlatObject$1,kindOf:kindOf$1,kindOfTest:kindOfTest$1,endsWith:endsWith$1,toArray:toArray$2,forEachEntry:forEachEntry$1,matchAll:matchAll$1,isHTMLForm:isHTMLForm$1,hasOwnProperty:hasOwnProperty$1,hasOwnProp:hasOwnProperty$1,reduceDescriptors:reduceDescriptors$1,freezeMethods:freezeMethods$1,toObjectSet:toObjectSet$1,toCamelCase:toCamelCase$1,noop:noop$7,toFiniteNumber:toFiniteNumber$1,findKey:findKey$2,global:_global$1,isContextDefined:isContextDefined$1,ALPHABET:ALPHABET$2,generateString:generateString$1,isSpecCompliantForm:isSpecCompliantForm$1,toJSONObject:toJSONObject$1,isAsyncFn:isAsyncFn$1,isThenable:isThenable$2};function AxiosError$1(a,_,$,j,et){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=a,this.name="AxiosError",_&&(this.code=_),$&&(this.config=$),j&&(this.request=j),et&&(this.response=et)}utils$i.inherits(AxiosError$1,Error,{toJSON:function a(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$i.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$3=AxiosError$1.prototype,descriptors$1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(a=>{descriptors$1[a]={value:a}});Object.defineProperties(AxiosError$1,descriptors$1);Object.defineProperty(prototype$3,"isAxiosError",{value:!0});AxiosError$1.from=(a,_,$,j,et,tt)=>{const rt=Object.create(prototype$3);return utils$i.toFlatObject(a,rt,function(it){return it!==Error.prototype},nt=>nt!=="isAxiosError"),AxiosError$1.call(rt,a.message,_,$,j,et),rt.cause=a,rt.name=a.name,tt&&Object.assign(rt,tt),rt};const httpAdapter$1=null;function isVisitable$1(a){return utils$i.isPlainObject(a)||utils$i.isArray(a)}function removeBrackets$1(a){return utils$i.endsWith(a,"[]")?a.slice(0,-2):a}function renderKey$1(a,_,$){return a?a.concat(_).map(function(et,tt){return et=removeBrackets$1(et),!$&&tt?"["+et+"]":et}).join($?".":""):_}function isFlatArray$1(a){return utils$i.isArray(a)&&!a.some(isVisitable$1)}const predicates$1=utils$i.toFlatObject(utils$i,{},null,function a(_){return/^is[A-Z]/.test(_)});function toFormData$1(a,_,$){if(!utils$i.isObject(a))throw new TypeError("target must be an object");_=_||new FormData,$=utils$i.toFlatObject($,{metaTokens:!0,dots:!1,indexes:!1},!1,function(wt,Ct){return!utils$i.isUndefined(Ct[wt])});const j=$.metaTokens,et=$.visitor||ot,tt=$.dots,rt=$.indexes,it=($.Blob||typeof Blob<"u"&&Blob)&&utils$i.isSpecCompliantForm(_);if(!utils$i.isFunction(et))throw new TypeError("visitor must be a function");function st(yt){if(yt===null)return"";if(utils$i.isDate(yt))return yt.toISOString();if(!it&&utils$i.isBlob(yt))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$i.isArrayBuffer(yt)||utils$i.isTypedArray(yt)?it&&typeof Blob=="function"?new Blob([yt]):Buffer$g.from(yt):yt}function ot(yt,wt,Ct){let Pt=yt;if(yt&&!Ct&&typeof yt=="object"){if(utils$i.endsWith(wt,"{}"))wt=j?wt:wt.slice(0,-2),yt=JSON.stringify(yt);else if(utils$i.isArray(yt)&&isFlatArray$1(yt)||(utils$i.isFileList(yt)||utils$i.endsWith(wt,"[]"))&&(Pt=utils$i.toArray(yt)))return wt=removeBrackets$1(wt),Pt.forEach(function(Mt,Bt){!(utils$i.isUndefined(Mt)||Mt===null)&&_.append(rt===!0?renderKey$1([wt],Bt,tt):rt===null?wt:wt+"[]",st(Mt))}),!1}return isVisitable$1(yt)?!0:(_.append(renderKey$1(Ct,wt,tt),st(yt)),!1)}const at=[],ut=Object.assign(predicates$1,{defaultVisitor:ot,convertValue:st,isVisitable:isVisitable$1});function ht(yt,wt){if(!utils$i.isUndefined(yt)){if(at.indexOf(yt)!==-1)throw Error("Circular reference detected in "+wt.join("."));at.push(yt),utils$i.forEach(yt,function(Pt,$t){(!(utils$i.isUndefined(Pt)||Pt===null)&&et.call(_,Pt,utils$i.isString($t)?$t.trim():$t,wt,ut))===!0&&ht(Pt,wt?wt.concat($t):[$t])}),at.pop()}}if(!utils$i.isObject(a))throw new TypeError("data must be an object");return ht(a),_}function encode$6(a){const _={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(j){return _[j]})}function AxiosURLSearchParams$1(a,_){this._pairs=[],a&&toFormData$1(a,this,_)}const prototype$2=AxiosURLSearchParams$1.prototype;prototype$2.append=function a(_,$){this._pairs.push([_,$])};prototype$2.toString=function a(_){const $=_?function(j){return _.call(this,j,encode$6)}:encode$6;return this._pairs.map(function(et){return $(et[0])+"="+$(et[1])},"").join("&")};function encode$5(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL$1(a,_,$){if(!_)return a;const j=$&&$.encode||encode$5,et=$&&$.serialize;let tt;if(et?tt=et(_,$):tt=utils$i.isURLSearchParams(_)?_.toString():new AxiosURLSearchParams$1(_,$).toString(j),tt){const rt=a.indexOf("#");rt!==-1&&(a=a.slice(0,rt)),a+=(a.indexOf("?")===-1?"?":"&")+tt}return a}let InterceptorManager$1=class{constructor(){this.handlers=[]}use(_,$,j){return this.handlers.push({fulfilled:_,rejected:$,synchronous:j?j.synchronous:!1,runWhen:j?j.runWhen:null}),this.handlers.length-1}eject(_){this.handlers[_]&&(this.handlers[_]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(_){utils$i.forEach(this.handlers,function(j){j!==null&&_(j)})}};const transitionalDefaults$1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$2=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams$1,FormData$2=typeof FormData<"u"?FormData:null,Blob$2=typeof Blob<"u"?Blob:null,platform$3={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$2,FormData:FormData$2,Blob:Blob$2},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv$1=typeof window<"u"&&typeof document<"u",hasStandardBrowserEnv$1=(a=>hasBrowserEnv$1&&["ReactNative","NativeScript","NS"].indexOf(a)<0)(typeof navigator<"u"&&navigator.product),hasStandardBrowserWebWorkerEnv$1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",utils$h=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:hasBrowserEnv$1,hasStandardBrowserEnv:hasStandardBrowserEnv$1,hasStandardBrowserWebWorkerEnv:hasStandardBrowserWebWorkerEnv$1},Symbol.toStringTag,{value:"Module"})),platform$2={...utils$h,...platform$3};function toURLEncodedForm$1(a,_){return toFormData$1(a,new platform$2.classes.URLSearchParams,Object.assign({visitor:function($,j,et,tt){return platform$2.isNode&&utils$i.isBuffer($)?(this.append(j,$.toString("base64")),!1):tt.defaultVisitor.apply(this,arguments)}},_))}function parsePropPath$1(a){return utils$i.matchAll(/\w+|\[(\w*)]/g,a).map(_=>_[0]==="[]"?"":_[1]||_[0])}function arrayToObject$1(a){const _={},$=Object.keys(a);let j;const et=$.length;let tt;for(j=0;j=$.length;return rt=!rt&&utils$i.isArray(et)?et.length:rt,it?(utils$i.hasOwnProp(et,rt)?et[rt]=[et[rt],j]:et[rt]=j,!nt):((!et[rt]||!utils$i.isObject(et[rt]))&&(et[rt]=[]),_($,j,et[rt],tt)&&utils$i.isArray(et[rt])&&(et[rt]=arrayToObject$1(et[rt])),!nt)}if(utils$i.isFormData(a)&&utils$i.isFunction(a.entries)){const $={};return utils$i.forEachEntry(a,(j,et)=>{_(parsePropPath$1(j),et,$,0)}),$}return null}function stringifySafely$1(a,_,$){if(utils$i.isString(a))try{return(_||JSON.parse)(a),utils$i.trim(a)}catch(j){if(j.name!=="SyntaxError")throw j}return($||JSON.stringify)(a)}const defaults$2={transitional:transitionalDefaults$1,adapter:["xhr","http"],transformRequest:[function a(_,$){const j=$.getContentType()||"",et=j.indexOf("application/json")>-1,tt=utils$i.isObject(_);if(tt&&utils$i.isHTMLForm(_)&&(_=new FormData(_)),utils$i.isFormData(_))return et&&et?JSON.stringify(formDataToJSON$1(_)):_;if(utils$i.isArrayBuffer(_)||utils$i.isBuffer(_)||utils$i.isStream(_)||utils$i.isFile(_)||utils$i.isBlob(_))return _;if(utils$i.isArrayBufferView(_))return _.buffer;if(utils$i.isURLSearchParams(_))return $.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),_.toString();let nt;if(tt){if(j.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm$1(_,this.formSerializer).toString();if((nt=utils$i.isFileList(_))||j.indexOf("multipart/form-data")>-1){const it=this.env&&this.env.FormData;return toFormData$1(nt?{"files[]":_}:_,it&&new it,this.formSerializer)}}return tt||et?($.setContentType("application/json",!1),stringifySafely$1(_)):_}],transformResponse:[function a(_){const $=this.transitional||defaults$2.transitional,j=$&&$.forcedJSONParsing,et=this.responseType==="json";if(_&&utils$i.isString(_)&&(j&&!this.responseType||et)){const rt=!($&&$.silentJSONParsing)&&et;try{return JSON.parse(_)}catch(nt){if(rt)throw nt.name==="SyntaxError"?AxiosError$1.from(nt,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):nt}}return _}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform$2.classes.FormData,Blob:platform$2.classes.Blob},validateStatus:function a(_){return _>=200&&_<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$i.forEach(["delete","get","head","post","put","patch"],a=>{defaults$2.headers[a]={}});const ignoreDuplicateOf$1=utils$i.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders$1=a=>{const _={};let $,j,et;return a&&a.split(` `).forEach(function(rt){et=rt.indexOf(":"),$=rt.substring(0,et).trim().toLowerCase(),j=rt.substring(et+1).trim(),!(!$||_[$]&&ignoreDuplicateOf$1[$])&&($==="set-cookie"?_[$]?_[$].push(j):_[$]=[j]:_[$]=_[$]?_[$]+", "+j:j)}),_},$internals$1=Symbol("internals");function normalizeHeader$1(a){return a&&String(a).trim().toLowerCase()}function normalizeValue$1(a){return a===!1||a==null?a:utils$i.isArray(a)?a.map(normalizeValue$1):String(a)}function parseTokens$1(a){const _=Object.create(null),$=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let j;for(;j=$.exec(a);)_[j[1]]=j[2];return _}const isValidHeaderName$1=a=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(a.trim());function matchHeaderValue$1(a,_,$,j,et){if(utils$i.isFunction(j))return j.call(this,_,$);if(et&&(_=$),!!utils$i.isString(_)){if(utils$i.isString(j))return _.indexOf(j)!==-1;if(utils$i.isRegExp(j))return j.test(_)}}function formatHeader$1(a){return a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(_,$,j)=>$.toUpperCase()+j)}function buildAccessors$1(a,_){const $=utils$i.toCamelCase(" "+_);["get","set","has"].forEach(j=>{Object.defineProperty(a,j+$,{value:function(et,tt,rt){return this[j].call(this,_,et,tt,rt)},configurable:!0})})}let AxiosHeaders$1=class{constructor(_){_&&this.set(_)}set(_,$,j){const et=this;function tt(nt,it,st){const ot=normalizeHeader$1(it);if(!ot)throw new Error("header name must be a non-empty string");const at=utils$i.findKey(et,ot);(!at||et[at]===void 0||st===!0||st===void 0&&et[at]!==!1)&&(et[at||it]=normalizeValue$1(nt))}const rt=(nt,it)=>utils$i.forEach(nt,(st,ot)=>tt(st,ot,it));return utils$i.isPlainObject(_)||_ instanceof this.constructor?rt(_,$):utils$i.isString(_)&&(_=_.trim())&&!isValidHeaderName$1(_)?rt(parseHeaders$1(_),$):_!=null&&tt($,_,j),this}get(_,$){if(_=normalizeHeader$1(_),_){const j=utils$i.findKey(this,_);if(j){const et=this[j];if(!$)return et;if($===!0)return parseTokens$1(et);if(utils$i.isFunction($))return $.call(this,et,j);if(utils$i.isRegExp($))return $.exec(et);throw new TypeError("parser must be boolean|regexp|function")}}}has(_,$){if(_=normalizeHeader$1(_),_){const j=utils$i.findKey(this,_);return!!(j&&this[j]!==void 0&&(!$||matchHeaderValue$1(this,this[j],j,$)))}return!1}delete(_,$){const j=this;let et=!1;function tt(rt){if(rt=normalizeHeader$1(rt),rt){const nt=utils$i.findKey(j,rt);nt&&(!$||matchHeaderValue$1(j,j[nt],nt,$))&&(delete j[nt],et=!0)}}return utils$i.isArray(_)?_.forEach(tt):tt(_),et}clear(_){const $=Object.keys(this);let j=$.length,et=!1;for(;j--;){const tt=$[j];(!_||matchHeaderValue$1(this,this[tt],tt,_,!0))&&(delete this[tt],et=!0)}return et}normalize(_){const $=this,j={};return utils$i.forEach(this,(et,tt)=>{const rt=utils$i.findKey(j,tt);if(rt){$[rt]=normalizeValue$1(et),delete $[tt];return}const nt=_?formatHeader$1(tt):String(tt).trim();nt!==tt&&delete $[tt],$[nt]=normalizeValue$1(et),j[nt]=!0}),this}concat(..._){return this.constructor.concat(this,..._)}toJSON(_){const $=Object.create(null);return utils$i.forEach(this,(j,et)=>{j!=null&&j!==!1&&($[et]=_&&utils$i.isArray(j)?j.join(", "):j)}),$}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([_,$])=>_+": "+$).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(_){return _ instanceof this?_:new this(_)}static concat(_,...$){const j=new this(_);return $.forEach(et=>j.set(et)),j}static accessor(_){const j=(this[$internals$1]=this[$internals$1]={accessors:{}}).accessors,et=this.prototype;function tt(rt){const nt=normalizeHeader$1(rt);j[nt]||(buildAccessors$1(et,rt),j[nt]=!0)}return utils$i.isArray(_)?_.forEach(tt):tt(_),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$i.reduceDescriptors(AxiosHeaders$1.prototype,({value:a},_)=>{let $=_[0].toUpperCase()+_.slice(1);return{get:()=>a,set(j){this[$]=j}}});utils$i.freezeMethods(AxiosHeaders$1);function transformData$1(a,_){const $=this||defaults$2,j=_||$,et=AxiosHeaders$1.from(j.headers);let tt=j.data;return utils$i.forEach(a,function(nt){tt=nt.call($,tt,et.normalize(),_?_.status:void 0)}),et.normalize(),tt}function isCancel$1(a){return!!(a&&a.__CANCEL__)}function CanceledError$1(a,_,$){AxiosError$1.call(this,a??"canceled",AxiosError$1.ERR_CANCELED,_,$),this.name="CanceledError"}utils$i.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle$1(a,_,$){const j=$.config.validateStatus;!$.status||!j||j($.status)?a($):_(new AxiosError$1("Request failed with status code "+$.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor($.status/100)-4],$.config,$.request,$))}const cookies$1=platform$2.hasStandardBrowserEnv?{write(a,_,$,j,et,tt){const rt=[a+"="+encodeURIComponent(_)];utils$i.isNumber($)&&rt.push("expires="+new Date($).toGMTString()),utils$i.isString(j)&&rt.push("path="+j),utils$i.isString(et)&&rt.push("domain="+et),tt===!0&&rt.push("secure"),document.cookie=rt.join("; ")},read(a){const _=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return _?decodeURIComponent(_[3]):null},remove(a){this.write(a,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL$1(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function combineURLs$1(a,_){return _?a.replace(/\/?\/$/,"")+"/"+_.replace(/^\/+/,""):a}function buildFullPath$1(a,_){return a&&!isAbsoluteURL$1(_)?combineURLs$1(a,_):_}const isURLSameOrigin$1=platform$2.hasStandardBrowserEnv?function a(){const _=/(msie|trident)/i.test(navigator.userAgent),$=document.createElement("a");let j;function et(tt){let rt=tt;return _&&($.setAttribute("href",rt),rt=$.href),$.setAttribute("href",rt),{href:$.href,protocol:$.protocol?$.protocol.replace(/:$/,""):"",host:$.host,search:$.search?$.search.replace(/^\?/,""):"",hash:$.hash?$.hash.replace(/^#/,""):"",hostname:$.hostname,port:$.port,pathname:$.pathname.charAt(0)==="/"?$.pathname:"/"+$.pathname}}return j=et(window.location.href),function(rt){const nt=utils$i.isString(rt)?et(rt):rt;return nt.protocol===j.protocol&&nt.host===j.host}}():function a(){return function(){return!0}}();function parseProtocol$1(a){const _=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return _&&_[1]||""}function speedometer$1(a,_){a=a||10;const $=new Array(a),j=new Array(a);let et=0,tt=0,rt;return _=_!==void 0?_:1e3,function(it){const st=Date.now(),ot=j[tt];rt||(rt=st),$[et]=it,j[et]=st;let at=tt,ut=0;for(;at!==et;)ut+=$[at++],at=at%a;if(et=(et+1)%a,et===tt&&(tt=(tt+1)%a),st-rt<_)return;const ht=ot&&st-ot;return ht?Math.round(ut*1e3/ht):void 0}}function progressEventReducer$1(a,_){let $=0;const j=speedometer$1(50,250);return et=>{const tt=et.loaded,rt=et.lengthComputable?et.total:void 0,nt=tt-$,it=j(nt),st=tt<=rt;$=tt;const ot={loaded:tt,total:rt,progress:rt?tt/rt:void 0,bytes:nt,rate:it||void 0,estimated:it&&rt&&st?(rt-tt)/it:void 0,event:et};ot[_?"download":"upload"]=!0,a(ot)}}const isXHRAdapterSupported$1=typeof XMLHttpRequest<"u",xhrAdapter$1=isXHRAdapterSupported$1&&function(a){return new Promise(function($,j){let et=a.data;const tt=AxiosHeaders$1.from(a.headers).normalize();let{responseType:rt,withXSRFToken:nt}=a,it;function st(){a.cancelToken&&a.cancelToken.unsubscribe(it),a.signal&&a.signal.removeEventListener("abort",it)}let ot;if(utils$i.isFormData(et)){if(platform$2.hasStandardBrowserEnv||platform$2.hasStandardBrowserWebWorkerEnv)tt.setContentType(!1);else if((ot=tt.getContentType())!==!1){const[wt,...Ct]=ot?ot.split(";").map(Pt=>Pt.trim()).filter(Boolean):[];tt.setContentType([wt||"multipart/form-data",...Ct].join("; "))}}let at=new XMLHttpRequest;if(a.auth){const wt=a.auth.username||"",Ct=a.auth.password?unescape(encodeURIComponent(a.auth.password)):"";tt.set("Authorization","Basic "+btoa(wt+":"+Ct))}const ut=buildFullPath$1(a.baseURL,a.url);at.open(a.method.toUpperCase(),buildURL$1(ut,a.params,a.paramsSerializer),!0),at.timeout=a.timeout;function ht(){if(!at)return;const wt=AxiosHeaders$1.from("getAllResponseHeaders"in at&&at.getAllResponseHeaders()),Pt={data:!rt||rt==="text"||rt==="json"?at.responseText:at.response,status:at.status,statusText:at.statusText,headers:wt,config:a,request:at};settle$1(function(Mt){$(Mt),st()},function(Mt){j(Mt),st()},Pt),at=null}if("onloadend"in at?at.onloadend=ht:at.onreadystatechange=function(){!at||at.readyState!==4||at.status===0&&!(at.responseURL&&at.responseURL.indexOf("file:")===0)||setTimeout(ht)},at.onabort=function(){at&&(j(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,a,at)),at=null)},at.onerror=function(){j(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,a,at)),at=null},at.ontimeout=function(){let Ct=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const Pt=a.transitional||transitionalDefaults$1;a.timeoutErrorMessage&&(Ct=a.timeoutErrorMessage),j(new AxiosError$1(Ct,Pt.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,a,at)),at=null},platform$2.hasStandardBrowserEnv&&(nt&&utils$i.isFunction(nt)&&(nt=nt(a)),nt||nt!==!1&&isURLSameOrigin$1(ut))){const wt=a.xsrfHeaderName&&a.xsrfCookieName&&cookies$1.read(a.xsrfCookieName);wt&&tt.set(a.xsrfHeaderName,wt)}et===void 0&&tt.setContentType(null),"setRequestHeader"in at&&utils$i.forEach(tt.toJSON(),function(Ct,Pt){at.setRequestHeader(Pt,Ct)}),utils$i.isUndefined(a.withCredentials)||(at.withCredentials=!!a.withCredentials),rt&&rt!=="json"&&(at.responseType=a.responseType),typeof a.onDownloadProgress=="function"&&at.addEventListener("progress",progressEventReducer$1(a.onDownloadProgress,!0)),typeof a.onUploadProgress=="function"&&at.upload&&at.upload.addEventListener("progress",progressEventReducer$1(a.onUploadProgress)),(a.cancelToken||a.signal)&&(it=wt=>{at&&(j(!wt||wt.type?new CanceledError$1(null,a,at):wt),at.abort(),at=null)},a.cancelToken&&a.cancelToken.subscribe(it),a.signal&&(a.signal.aborted?it():a.signal.addEventListener("abort",it)));const yt=parseProtocol$1(ut);if(yt&&platform$2.protocols.indexOf(yt)===-1){j(new AxiosError$1("Unsupported protocol "+yt+":",AxiosError$1.ERR_BAD_REQUEST,a));return}at.send(et||null)})},knownAdapters$1={http:httpAdapter$1,xhr:xhrAdapter$1};utils$i.forEach(knownAdapters$1,(a,_)=>{if(a){try{Object.defineProperty(a,"name",{value:_})}catch{}Object.defineProperty(a,"adapterName",{value:_})}});const renderReason$1=a=>`- ${a}`,isResolvedHandle$1=a=>utils$i.isFunction(a)||a===null||a===!1,adapters$1={getAdapter:a=>{a=utils$i.isArray(a)?a:[a];const{length:_}=a;let $,j;const et={};for(let tt=0;tt<_;tt++){$=a[tt];let rt;if(j=$,!isResolvedHandle$1($)&&(j=knownAdapters$1[(rt=String($)).toLowerCase()],j===void 0))throw new AxiosError$1(`Unknown adapter '${rt}'`);if(j)break;et[rt||"#"+tt]=j}if(!j){const tt=Object.entries(et).map(([nt,it])=>`adapter ${nt} `+(it===!1?"is not supported by the environment":"is not available in the build"));let rt=_?tt.length>1?`since : `+tt.map(renderReason$1).join(` @@ -450,7 +450,7 @@ use chrome, FireFox or Internet Explorer 11`)}var _=safeBufferExports,$=requireB `):" "+renderReason(tt[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+rt,"ERR_NOT_SUPPORT")}return j},adapters:knownAdapters};function throwIfCancellationRequested(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new CanceledError(null,a)}function dispatchRequest(a){return throwIfCancellationRequested(a),a.headers=AxiosHeaders.from(a.headers),a.data=transformData.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(a.adapter||defaults$1.adapter)(a).then(function(j){return throwIfCancellationRequested(a),j.data=transformData.call(a,a.transformResponse,j),j.headers=AxiosHeaders.from(j.headers),j},function(j){return isCancel(j)||(throwIfCancellationRequested(a),j&&j.response&&(j.response.data=transformData.call(a,a.transformResponse,j.response),j.response.headers=AxiosHeaders.from(j.response.headers))),Promise.reject(j)})}const VERSION$2="1.7.1",validators$1={};["object","boolean","number","function","string","symbol"].forEach((a,_)=>{validators$1[a]=function(j){return typeof j===a||"a"+(_<1?"n ":" ")+a}});const deprecatedWarnings={};validators$1.transitional=function a(_,$,j){function et(tt,rt){return"[Axios v"+VERSION$2+"] Transitional option '"+tt+"'"+rt+(j?". "+j:"")}return(tt,rt,nt)=>{if(_===!1)throw new AxiosError(et(rt," has been removed"+($?" in "+$:"")),AxiosError.ERR_DEPRECATED);return $&&!deprecatedWarnings[rt]&&(deprecatedWarnings[rt]=!0,console.warn(et(rt," has been deprecated since v"+$+" and will be removed in the near future"))),_?_(tt,rt,nt):!0}};function assertOptions(a,_,$){if(typeof a!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const j=Object.keys(a);let et=j.length;for(;et-- >0;){const tt=j[et],rt=_[tt];if(rt){const nt=a[tt],it=nt===void 0||rt(nt,tt,a);if(it!==!0)throw new AxiosError("option "+tt+" must be "+it,AxiosError.ERR_BAD_OPTION_VALUE);continue}if($!==!0)throw new AxiosError("Unknown option "+tt,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(_){this.defaults=_,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(_,$){try{return await this._request(_,$)}catch(j){if(j instanceof Error){let et;Error.captureStackTrace?Error.captureStackTrace(et={}):et=new Error;const tt=et.stack?et.stack.replace(/^.+\n/,""):"";try{j.stack?tt&&!String(j.stack).endsWith(tt.replace(/^.+\n.+\n/,""))&&(j.stack+=` `+tt):j.stack=tt}catch{}}throw j}}_request(_,$){typeof _=="string"?($=$||{},$.url=_):$=_||{},$=mergeConfig(this.defaults,$);const{transitional:j,paramsSerializer:et,headers:tt}=$;j!==void 0&&validator.assertOptions(j,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),et!=null&&(utils$g.isFunction(et)?$.paramsSerializer={serialize:et}:validator.assertOptions(et,{encode:validators.function,serialize:validators.function},!0)),$.method=($.method||this.defaults.method||"get").toLowerCase();let rt=tt&&utils$g.merge(tt.common,tt[$.method]);tt&&utils$g.forEach(["delete","get","head","post","put","patch","common"],yt=>{delete tt[yt]}),$.headers=AxiosHeaders.concat(rt,tt);const nt=[];let it=!0;this.interceptors.request.forEach(function(wt){typeof wt.runWhen=="function"&&wt.runWhen($)===!1||(it=it&&wt.synchronous,nt.unshift(wt.fulfilled,wt.rejected))});const st=[];this.interceptors.response.forEach(function(wt){st.push(wt.fulfilled,wt.rejected)});let ot,at=0,ut;if(!it){const yt=[dispatchRequest.bind(this),void 0];for(yt.unshift.apply(yt,nt),yt.push.apply(yt,st),ut=yt.length,ot=Promise.resolve($);at{if(!j._listeners)return;let tt=j._listeners.length;for(;tt-- >0;)j._listeners[tt](et);j._listeners=null}),this.promise.then=et=>{let tt;const rt=new Promise(nt=>{j.subscribe(nt),tt=nt}).then(et);return rt.cancel=function(){j.unsubscribe(tt)},rt},_(function(tt,rt,nt){j.reason||(j.reason=new CanceledError(tt,rt,nt),$(j.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(_){if(this.reason){_(this.reason);return}this._listeners?this._listeners.push(_):this._listeners=[_]}unsubscribe(_){if(!this._listeners)return;const $=this._listeners.indexOf(_);$!==-1&&this._listeners.splice($,1)}static source(){let _;return{token:new CancelToken(function(et){_=et}),cancel:_}}}function spread(a){return function($){return a.apply(null,$)}}function isAxiosError(a){return utils$g.isObject(a)&&a.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([a,_])=>{HttpStatusCode[_]=a});function createInstance(a){const _=new Axios(a),$=bind$1(Axios.prototype.request,_);return utils$g.extend($,Axios.prototype,_,{allOwnKeys:!0}),utils$g.extend($,_,null,{allOwnKeys:!0}),$.create=function(et){return createInstance(mergeConfig(a,et))},$}const axios=createInstance(defaults$1);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION$2;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function a(_){return Promise.all(_)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=a=>formDataToJSON(utils$g.isHTMLForm(a)?new FormData(a):a);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;class WalletP2PTransport extends P2PTransport{constructor(_,$,j,et,tt,rt){super(_,$,j,et,StorageKey.TRANSPORT_P2P_PEERS_WALLET,tt,rt)}async addPeer(_,$=!0){await super.addPeer(_),$&&await this.client.sendPairingResponse(_)}}const logger$2=new Logger("IncomingRequestInterceptor");class IncomingRequestInterceptor{static async intercept(_){logger$2.log("INTERCEPTING REQUEST",_.message),_.message.version==="2"?IncomingRequestInterceptor.handleV2Message(_):_.message.version==="3"&&IncomingRequestInterceptor.handleV3Message(_)}static async getAppMetadata(_,$){const j=await _.getAppMetadata($);if(!j)throw new Error("AppMetadata not found");return j}static async handleV2Message(_){const{message:$,connectionInfo:j,appMetadataManager:et,interceptorCallback:tt}=_;switch($.type){case BeaconMessageType.PermissionRequest:logger$2.log("PERMISSION REQUEST V*",$),$.appMetadata.beaconId&&!$.appMetadata.senderId&&($.appMetadata.senderId=$.appMetadata.beaconId,delete $.appMetadata.beaconId),await et.addAppMetadata($.appMetadata),tt($,j);break;case BeaconMessageType.OperationRequest:{const nt={appMetadata:await IncomingRequestInterceptor.getAppMetadata(et,$.senderId),...$};tt(nt,j)}break;case BeaconMessageType.SignPayloadRequest:{const nt={appMetadata:await IncomingRequestInterceptor.getAppMetadata(et,$.senderId),...$};tt(nt,j)}break;case BeaconMessageType.BroadcastRequest:{const nt={appMetadata:await IncomingRequestInterceptor.getAppMetadata(et,$.senderId),...$};tt(nt,j)}break;case BeaconMessageType.ProofOfEventChallengeRequest:{const nt={appMetadata:await IncomingRequestInterceptor.getAppMetadata(et,$.senderId),...$};tt(nt,j)}break;case BeaconMessageType.SimulatedProofOfEventChallengeRequest:{const nt={appMetadata:await IncomingRequestInterceptor.getAppMetadata(et,$.senderId),...$};tt(nt,j)}break;case BeaconMessageType.SimulatedProofOfEventChallengeRequest:{const nt={appMetadata:await IncomingRequestInterceptor.getAppMetadata(et,$.senderId),...$};tt(nt,j)}break;default:logger$2.log("intercept","Message not handled"),assertNever$1()}}static async handleV3Message(_){const{message:$,connectionInfo:j,appMetadataManager:et,interceptorCallback:tt}=_,rt=$,nt=rt.message;switch(nt.type){case BeaconMessageType.PermissionRequest:await et.addAppMetadata({...nt.blockchainData.appMetadata,senderId:$.senderId}),tt(rt,j);break;case BeaconMessageType.BlockchainRequest:{const it={...rt};tt(it,j)}break;default:logger$2.log("intercept","Message not handled"),assertNever$1()}}}function assertNever$1(a){throw new Error("Function not implemented.")}const logger$1=new Logger("OutgoingResponseInterceptor");class OutgoingResponseInterceptor{static async intercept(_){_.request.version==="2"?OutgoingResponseInterceptor.handleV2Message(_):_.request.version==="3"&&OutgoingResponseInterceptor.handleV3Message(_)}static async handleV3Message(_){const{message:$,appMetadataManager:j,interceptorCallback:et}=_,rt=$.message;logger$1.log("LOGGING OUTGOING V3",rt,j),et($)}static async handleV2Message(_){const{senderId:$,request:j,message:et,ownAppMetadata:tt,permissionManager:rt,appMetadataManager:nt,interceptorCallback:it}=_;switch(et.type){case BeaconMessageType.Error:{const st={type:et.type,version:"2",senderId:$,id:et.id,errorType:et.errorType};if(et.errorType===BeaconErrorType.TRANSACTION_INVALID_ERROR&&et.errorData){const ot=et.errorData;Array.isArray(ot)&&ot.every(at=>!!at.kind&&!!at.id)?st.errorData=et.errorData:logger$1.warn("ErrorData provided is not in correct format. It needs to be an array of RPC errors. It will not be included in the message sent to the dApp")}it(st);break}case BeaconMessageType.Acknowledge:{const st={type:et.type,version:"2",senderId:$,id:et.id};it(st);break}case BeaconMessageType.PermissionResponse:{const st={senderId:$,version:"2",appMetadata:tt,...et};if(!st.address&&!st.publicKey)throw new Error("Address or PublicKey must be defined");const ot=st.publicKey,at=st.address??await getAddressFromPublicKey(ot);if(!isValidAddress(at))throw new Error(`Invalid address: "${at}"`);if(et.walletType==="abstracted_account"&&at.substring(0,3)!==CONTRACT_PREFIX)throw new Error(`Invalid abstracted account address "${at}", it should be a ${CONTRACT_PREFIX} address`);const ut=await nt.getAppMetadata(j.senderId);if(!ut)throw new Error("AppMetadata not found");const ht={accountIdentifier:await getAccountIdentifier(at,st.network),senderId:j.senderId,appMetadata:ut,website:"",address:at,publicKey:ot,network:st.network,scopes:st.scopes,connectedAt:new Date().getTime()};rt.addPermission(ht).catch(console.error),it(st);break}case BeaconMessageType.OperationResponse:{const st={senderId:$,version:"2",...et};it(st)}break;case BeaconMessageType.SignPayloadResponse:{const st={senderId:$,version:"2",...et};it(st)}break;case BeaconMessageType.BroadcastResponse:{const st={senderId:$,version:"2",...et};it(st)}break;case BeaconMessageType.ProofOfEventChallengeResponse:{const st={senderId:$,version:"2",...et};it(st)}break;case BeaconMessageType.SimulatedProofOfEventChallengeResponse:{const st={senderId:$,version:"2",...et};it(st)}break;default:logger$1.log("intercept","Message not handled"),assertNever()}}}function assertNever(a){throw new Error("Function not implemented.")}const logger=new Logger("WalletClient");let WalletClient$1=class extends Client{constructor($){super({storage:$&&$.storage?$.storage:new LocalStorage,...$});Yr(this,"_isConnected",new ExposedPromise);Yr(this,"permissionManager");Yr(this,"appMetadataManager");Yr(this,"pendingRequests",[]);this.permissionManager=new PermissionManager(this.storage),this.appMetadataManager=new AppMetadataManager(this.storage)}get isConnected(){return this._isConnected.promise}async init(){const $=await this.keyPair,j=new WalletP2PTransport(this.name,$,this.storage,this.matrixNodes,this.iconUrl,this.appUrl);return super.init(j)}async connect($){return this.handleResponse=async(j,et)=>{if(j.version==="3"){const tt=j;if(tt.message.type===BeaconMessageType.Disconnect)return this.disconnect(tt.senderId);this.pendingRequests.some(rt=>rt[0].id===j.id)||(this.pendingRequests.push([tt,et]),await this.sendAcknowledgeResponse(tt,et),await IncomingRequestInterceptor.intercept({message:tt,connectionInfo:et,appMetadataManager:this.appMetadataManager,interceptorCallback:$}))}else{const tt=j;if(tt.type===BeaconMessageType.Disconnect)return this.disconnect(tt.senderId);this.pendingRequests.some(rt=>rt[0].id===j.id)||(this.pendingRequests.push([tt,et]),tt.version!=="1"&&await this.sendAcknowledgeResponse(tt,et),await IncomingRequestInterceptor.intercept({message:tt,connectionInfo:et,appMetadataManager:this.appMetadataManager,interceptorCallback:$}))}},this._connect()}async getRegisterPushChallenge($,j,et=NOTIFICATION_ORACLE_URL){const tt=(await axios.get(`${et}/challenge`)).data,rt=["Tezos Signed Message: ",tt.id,tt.timestamp,j,$].join(" "),nt=toHex$1(rt),it="0501"+nt.length.toString(16).padStart(8,"0")+nt;return{challenge:tt,payloadToSign:it}}async registerPush($,j,et,tt,rt,nt,it=NOTIFICATION_ORACLE_URL){const st=await this.storage.get(StorageKey.PUSH_TOKENS),ot=st.find(ht=>ht.publicKey===tt&&ht.backendUrl===et);if(ot)return ot;const at=(await axios.post(`${it}/register`,{name:this.name,challenge:$,accountPublicKey:tt,signature:j,backendUrl:et,protocolIdentifier:rt,deviceId:nt})).data,ut={publicKey:tt,backendUrl:et,accessToken:at.accessToken,managementToken:at.managementToken};return st.push(ut),await this.storage.set(StorageKey.PUSH_TOKENS,st),ut}async _connect(){const $=await this.transport;$.connectionStatus===TransportStatus.NOT_CONNECTED&&(await $.connect(),$.addListener(async(j,et)=>{if(typeof j=="string"){const tt=await new Serializer().deserialize(j);this.handleResponse(tt,et)}}).catch(j=>logger.log("_connect",j)),this._isConnected.resolve(!0))}async respond($){logger.log("RESPONSE",$);const j=this.pendingRequests.find(et=>et[0].id===$.id);if(!j)throw new Error("No matching request found!");this.pendingRequests=this.pendingRequests.filter(et=>et[0].id!==$.id),await OutgoingResponseInterceptor.intercept({senderId:await getSenderId(await this.beaconId),request:j[0],message:$,ownAppMetadata:await this.getOwnAppMetadata(),permissionManager:this.permissionManager,appMetadataManager:this.appMetadataManager,interceptorCallback:async et=>{await this.respondToMessage(et,j[1])}})}async getAppMetadataList(){return this.appMetadataManager.getAppMetadataList()}async getAppMetadata($){return this.appMetadataManager.getAppMetadata($)}async removeAppMetadata($){return this.appMetadataManager.removeAppMetadata($)}async removeAllAppMetadata(){return this.appMetadataManager.removeAllAppMetadata()}async getPermissions(){return this.permissionManager.getPermissions()}async getPermission($){return this.permissionManager.getPermission($)}async removePermission($){return this.permissionManager.removePermission($)}async removeAllPermissions(){return this.permissionManager.removeAllPermissions()}async getPeerInfo($){const j=await getSenderId($.publicKey);return $ instanceof PostMessagePairingRequest?new ExtendedPostMessagePairingRequest($.id,$.name,$.publicKey,$.version,j):$ instanceof P2PPairingRequest?new ExtendedP2PPairingRequest($.id,$.name,$.publicKey,$.version,$.relayServer,j):$ instanceof ExtendedWalletConnectPairingRequest?new ExtendedWalletConnectPairingRequest($.id,$.name,$.publicKey,$.version,j,$.uri):{...$,senderId:j}}async addPeer($,j=!0){return(await this.transport).addPeer(await this.getPeerInfo($),j)}async removePeer($,j=!1){const et=(await this.transport).removePeer($);return await this.removePermissionsForPeers([$]),j&&await this.sendDisconnectToPeer($),et}async removeAllPeers($=!1){const j=await(await this.transport).getPeers(),et=(await this.transport).removeAllPeers();if(await this.removePermissionsForPeers(j),$){const tt=j.map(rt=>this.sendDisconnectToPeer(rt));await Promise.all(tt)}return et}async removePermissionsForPeers($){const j=await this.permissionManager.getPermissions(),et=$.map(nt=>nt.senderId),rt=j.filter(nt=>et.includes(nt.appMetadata.senderId)).map(nt=>nt.accountIdentifier);await this.permissionManager.removePermissions(rt)}async sendAcknowledgeResponse($,j){const et={id:$.id,type:BeaconMessageType.Acknowledge};await OutgoingResponseInterceptor.intercept({senderId:await getSenderId(await this.beaconId),request:$,message:et,ownAppMetadata:await this.getOwnAppMetadata(),permissionManager:this.permissionManager,appMetadataManager:this.appMetadataManager,interceptorCallback:async tt=>{await this.respondToMessage(tt,j)}})}async respondToMessage($,j){const et=await new Serializer().serialize($);if(j){const rt=(await this.getPeers()).find(nt=>nt.publicKey===j.id);await(await this.transport).send(et,rt)}else await(await this.transport).send(et)}async disconnect($){const j=await this.transport,tt=(await j.getPeers()).find(rt=>rt.senderId===$);tt&&await this.removePeer(tt),await j.disconnect()}};const WalletClient=new WalletClient$1({name:"Umami",iconUrl:"",appUrl:"https://umamiwallet.com/"});var KEY_PREFIX$2="persist:",FLUSH="persist/FLUSH",REHYDRATE="persist/REHYDRATE",PAUSE="persist/PAUSE",PERSIST="persist/PERSIST",PURGE="persist/PURGE",REGISTER="persist/REGISTER",DEFAULT_VERSION=-1;function _typeof$5(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function($){return typeof $}:_typeof$5=function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},_typeof$5(a)}function ownKeys$8(a,_){var $=Object.keys(a);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(a);_&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(a,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$8(a){for(var _=1;_=0)&&Object.prototype.propertyIsEnumerable.call(a,j)&&($[j]=a[j])}return $}function _objectWithoutPropertiesLoose$2(a,_){if(a==null)return{};var $={},j=Object.keys(a),et,tt;for(tt=0;tt=0)&&($[et]=a[et]);return $}var DEFAULT_TIMEOUT=5e3;function persistReducer(a,_){var $=a.version!==void 0?a.version:DEFAULT_VERSION;a.debug;var j=a.stateReconciler===void 0?autoMergeLevel1:a.stateReconciler,et=a.getStoredState||getStoredState,tt=a.timeout!==void 0?a.timeout:DEFAULT_TIMEOUT,rt=null,nt=!1,it=!0,st=function(at){return at._persist.rehydrated&&rt&&!it&&rt.update(at),at};return function(ot,at){var ut=ot||{},ht=ut._persist,yt=_objectWithoutProperties$1(ut,["_persist"]),wt=yt;if(at.type===PERSIST){var Ct=!1,Pt=function(It,Lt){Ct||(at.rehydrate(a.key,It,Lt),Ct=!0)};if(tt&&setTimeout(function(){!Ct&&Pt(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(a.key,'"')))},tt),it=!1,rt||(rt=createPersistoid(a)),ht)return _objectSpread$7({},_(wt,at),{_persist:ht});if(typeof at.rehydrate!="function"||typeof at.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return at.register(a.key),et(a).then(function(Ot){var It=a.migrate||function(Lt,Ft){return Promise.resolve(Lt)};It(Ot,$).then(function(Lt){Pt(Lt)},function(Lt){Pt(void 0,Lt)})},function(Ot){Pt(void 0,Ot)}),_objectSpread$7({},_(wt,at),{_persist:{version:$,rehydrated:!1}})}else{if(at.type===PURGE)return nt=!0,at.result(purgeStoredState(a)),_objectSpread$7({},_(wt,at),{_persist:ht});if(at.type===FLUSH)return at.result(rt&&rt.flush()),_objectSpread$7({},_(wt,at),{_persist:ht});if(at.type===PAUSE)it=!0;else if(at.type===REHYDRATE){if(nt)return _objectSpread$7({},wt,{_persist:_objectSpread$7({},ht,{rehydrated:!0})});if(at.key===a.key){var $t=_(wt,at),Mt=at.payload,Bt=j!==!1&&Mt!==void 0?j(Mt,ot,$t,a):$t,Dt=_objectSpread$7({},Bt,{_persist:_objectSpread$7({},ht,{rehydrated:!0})});return st(Dt)}}}if(!ht)return _(ot,at);var zt=_(wt,at);return zt===wt?ot:st(_objectSpread$7({},zt,{_persist:ht}))}}function formatProdErrorMessage$1(a){return`Minified Redux error #${a}; visit https://redux.js.org/Errors?code=${a} for the full message or use the non-minified dev environment for full errors. `}var $$observable=typeof Symbol=="function"&&Symbol.observable||"@@observable",symbol_observable_default=$$observable,randomString$1=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString$1()}`,REPLACE:`@@redux/REPLACE${randomString$1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString$1()}`},actionTypes_default=ActionTypes;function isPlainObject$3(a){if(typeof a!="object"||a===null)return!1;let _=a;for(;Object.getPrototypeOf(_)!==null;)_=Object.getPrototypeOf(_);return Object.getPrototypeOf(a)===_||Object.getPrototypeOf(a)===null}function createStore(a,_,$){if(typeof a!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof _=="function"&&typeof $=="function"||typeof $=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof _=="function"&&typeof $>"u"&&($=_,_=void 0),typeof $<"u"){if(typeof $!="function")throw new Error(formatProdErrorMessage$1(1));return $(createStore)(a,_)}let j=a,et=_,tt=new Map,rt=tt,nt=0,it=!1;function st(){rt===tt&&(rt=new Map,tt.forEach((Ct,Pt)=>{rt.set(Pt,Ct)}))}function ot(){if(it)throw new Error(formatProdErrorMessage$1(3));return et}function at(Ct){if(typeof Ct!="function")throw new Error(formatProdErrorMessage$1(4));if(it)throw new Error(formatProdErrorMessage$1(5));let Pt=!0;st();const $t=nt++;return rt.set($t,Ct),function(){if(Pt){if(it)throw new Error(formatProdErrorMessage$1(6));Pt=!1,st(),rt.delete($t),tt=null}}}function ut(Ct){if(!isPlainObject$3(Ct))throw new Error(formatProdErrorMessage$1(7));if(typeof Ct.type>"u")throw new Error(formatProdErrorMessage$1(8));if(typeof Ct.type!="string")throw new Error(formatProdErrorMessage$1(17));if(it)throw new Error(formatProdErrorMessage$1(9));try{it=!0,et=j(et,Ct)}finally{it=!1}return(tt=rt).forEach($t=>{$t()}),Ct}function ht(Ct){if(typeof Ct!="function")throw new Error(formatProdErrorMessage$1(10));j=Ct,ut({type:actionTypes_default.REPLACE})}function yt(){const Ct=at;return{subscribe(Pt){if(typeof Pt!="object"||Pt===null)throw new Error(formatProdErrorMessage$1(11));function $t(){const Bt=Pt;Bt.next&&Bt.next(ot())}return $t(),{unsubscribe:Ct($t)}},[symbol_observable_default](){return this}}}return ut({type:actionTypes_default.INIT}),{dispatch:ut,subscribe:at,getState:ot,replaceReducer:ht,[symbol_observable_default]:yt}}function assertReducerShape(a){Object.keys(a).forEach(_=>{const $=a[_];if(typeof $(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(formatProdErrorMessage$1(12));if(typeof $(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage$1(13))})}function combineReducers(a){const _=Object.keys(a),$={};for(let tt=0;tt<_.length;tt++){const rt=_[tt];typeof a[rt]=="function"&&($[rt]=a[rt])}const j=Object.keys($);let et;try{assertReducerShape($)}catch(tt){et=tt}return function(rt={},nt){if(et)throw et;let it=!1;const st={};for(let ot=0;ot"u")throw nt&&nt.type,new Error(formatProdErrorMessage$1(14));st[at]=yt,it=it||yt!==ht}return it=it||j.length!==Object.keys(rt).length,it?st:rt}}function compose(...a){return a.length===0?_=>_:a.length===1?a[0]:a.reduce((_,$)=>(...j)=>_($(...j)))}function applyMiddleware(...a){return _=>($,j)=>{const et=_($,j);let tt=()=>{throw new Error(formatProdErrorMessage$1(15))};const rt={getState:et.getState,dispatch:(it,...st)=>tt(it,...st)},nt=a.map(it=>it(rt));return tt=compose(...nt)(et.dispatch),{...et,dispatch:tt}}}function isAction(a){return isPlainObject$3(a)&&"type"in a&&typeof a.type=="string"}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(a){if(Symbol.iterator in Object(a)||Object.prototype.toString.call(a)==="[object Arguments]")return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a)){for(var _=0,$=new Array(a.length);_0&&arguments[0]!==void 0?arguments[0]:initialState$a,$=arguments.length>1?arguments[1]:void 0;switch($.type){case REGISTER:return _objectSpread$6({},_,{registry:[].concat(_toConsumableArray(_.registry),[$.key])});case REHYDRATE:var j=_.registry.indexOf($.key),et=_toConsumableArray(_.registry);return et.splice(j,1),_objectSpread$6({},_,{registry:et,bootstrapped:et.length===0});default:return _}};function persistStore(a,_,$){var j=createStore(persistorReducer,initialState$a,void 0),et=function(it){j.dispatch({type:REGISTER,key:it})},tt=function(it,st,ot){var at={type:REHYDRATE,payload:st,err:ot,key:it};a.dispatch(at),j.dispatch(at)},rt=_objectSpread$6({},j,{purge:function(){var it=[];return a.dispatch({type:PURGE,result:function(ot){it.push(ot)}}),Promise.all(it)},flush:function(){var it=[];return a.dispatch({type:FLUSH,result:function(ot){it.push(ot)}}),Promise.all(it)},pause:function(){a.dispatch({type:PAUSE})},persist:function(){a.dispatch({type:PERSIST,register:et,rehydrate:tt})}});return rt.persist(),rt}var NOTHING$1=Symbol.for("immer-nothing"),DRAFTABLE$1=Symbol.for("immer-draftable"),DRAFT_STATE$1=Symbol.for("immer-state");function die$1(a,..._){throw new Error(`[Immer] minified error nr: ${a}. Full error at: https://bit.ly/3cXEKWf`)}var getPrototypeOf$2=Object.getPrototypeOf;function isDraft$1(a){return!!a&&!!a[DRAFT_STATE$1]}function isDraftable$1(a){var _;return a?isPlainObject$2(a)||Array.isArray(a)||!!a[DRAFTABLE$1]||!!((_=a.constructor)!=null&&_[DRAFTABLE$1])||isMap$1(a)||isSet$1(a):!1}var objectCtorString$1=Object.prototype.constructor.toString();function isPlainObject$2(a){if(!a||typeof a!="object")return!1;const _=getPrototypeOf$2(a);if(_===null)return!0;const $=Object.hasOwnProperty.call(_,"constructor")&&_.constructor;return $===Object?!0:typeof $=="function"&&Function.toString.call($)===objectCtorString$1}function each$1(a,_){getArchtype$1(a)===0?Reflect.ownKeys(a).forEach($=>{_($,a[$],a)}):a.forEach(($,j)=>_(j,$,a))}function getArchtype$1(a){const _=a[DRAFT_STATE$1];return _?_.type_:Array.isArray(a)?1:isMap$1(a)?2:isSet$1(a)?3:0}function has$1(a,_){return getArchtype$1(a)===2?a.has(_):Object.prototype.hasOwnProperty.call(a,_)}function set$1(a,_,$){const j=getArchtype$1(a);j===2?a.set(_,$):j===3?a.add($):a[_]=$}function is$1(a,_){return a===_?a!==0||1/a===1/_:a!==a&&_!==_}function isMap$1(a){return a instanceof Map}function isSet$1(a){return a instanceof Set}function latest$1(a){return a.copy_||a.base_}function shallowCopy$1(a,_){if(isMap$1(a))return new Map(a);if(isSet$1(a))return new Set(a);if(Array.isArray(a))return Array.prototype.slice.call(a);if(!_&&isPlainObject$2(a))return getPrototypeOf$2(a)?{...a}:Object.assign(Object.create(null),a);const $=Object.getOwnPropertyDescriptors(a);delete $[DRAFT_STATE$1];let j=Reflect.ownKeys($);for(let et=0;et1&&(a.set=a.add=a.clear=a.delete=dontMutateFrozenCollections$1),Object.freeze(a),_&&Object.entries(a).forEach(([$,j])=>freeze$1(j,!0))),a}function dontMutateFrozenCollections$1(){die$1(2)}function isFrozen$1(a){return Object.isFrozen(a)}var plugins$1={};function getPlugin$1(a){const _=plugins$1[a];return _||die$1(0,a),_}var currentScope$1;function getCurrentScope$1(){return currentScope$1}function createScope$1(a,_){return{drafts_:[],parent_:a,immer_:_,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function usePatchesInScope$1(a,_){_&&(getPlugin$1("Patches"),a.patches_=[],a.inversePatches_=[],a.patchListener_=_)}function revokeScope$1(a){leaveScope$1(a),a.drafts_.forEach(revokeDraft$1),a.drafts_=null}function leaveScope$1(a){a===currentScope$1&&(currentScope$1=a.parent_)}function enterScope$1(a){return currentScope$1=createScope$1(currentScope$1,a)}function revokeDraft$1(a){const _=a[DRAFT_STATE$1];_.type_===0||_.type_===1?_.revoke_():_.revoked_=!0}function processResult$1(a,_){_.unfinalizedDrafts_=_.drafts_.length;const $=_.drafts_[0];return a!==void 0&&a!==$?($[DRAFT_STATE$1].modified_&&(revokeScope$1(_),die$1(4)),isDraftable$1(a)&&(a=finalize$1(_,a),_.parent_||maybeFreeze$1(_,a)),_.patches_&&getPlugin$1("Patches").generateReplacementPatches_($[DRAFT_STATE$1].base_,a,_.patches_,_.inversePatches_)):a=finalize$1(_,$,[]),revokeScope$1(_),_.patches_&&_.patchListener_(_.patches_,_.inversePatches_),a!==NOTHING$1?a:void 0}function finalize$1(a,_,$){if(isFrozen$1(_))return _;const j=_[DRAFT_STATE$1];if(!j)return each$1(_,(et,tt)=>finalizeProperty$1(a,j,_,et,tt,$)),_;if(j.scope_!==a)return _;if(!j.modified_)return maybeFreeze$1(a,j.base_,!0),j.base_;if(!j.finalized_){j.finalized_=!0,j.scope_.unfinalizedDrafts_--;const et=j.copy_;let tt=et,rt=!1;j.type_===3&&(tt=new Set(et),et.clear(),rt=!0),each$1(tt,(nt,it)=>finalizeProperty$1(a,j,et,nt,it,$,rt)),maybeFreeze$1(a,et,!1),$&&a.patches_&&getPlugin$1("Patches").generatePatches_(j,$,a.patches_,a.inversePatches_)}return j.copy_}function finalizeProperty$1(a,_,$,j,et,tt,rt){if(isDraft$1(et)){const nt=tt&&_&&_.type_!==3&&!has$1(_.assigned_,j)?tt.concat(j):void 0,it=finalize$1(a,et,nt);if(set$1($,j,it),isDraft$1(it))a.canAutoFreeze_=!1;else return}else rt&&$.add(et);if(isDraftable$1(et)&&!isFrozen$1(et)){if(!a.immer_.autoFreeze_&&a.unfinalizedDrafts_<1)return;finalize$1(a,et),(!_||!_.scope_.parent_)&&typeof j!="symbol"&&Object.prototype.propertyIsEnumerable.call($,j)&&maybeFreeze$1(a,et)}}function maybeFreeze$1(a,_,$=!1){!a.parent_&&a.immer_.autoFreeze_&&a.canAutoFreeze_&&freeze$1(_,$)}function createProxyProxy$1(a,_){const $=Array.isArray(a),j={type_:$?1:0,scope_:_?_.scope_:getCurrentScope$1(),modified_:!1,finalized_:!1,assigned_:{},parent_:_,base_:a,draft_:null,copy_:null,revoke_:null,isManual_:!1};let et=j,tt=objectTraps$1;$&&(et=[j],tt=arrayTraps$1);const{revoke:rt,proxy:nt}=Proxy.revocable(et,tt);return j.draft_=nt,j.revoke_=rt,nt}var objectTraps$1={get(a,_){if(_===DRAFT_STATE$1)return a;const $=latest$1(a);if(!has$1($,_))return readPropFromProto$1(a,$,_);const j=$[_];return a.finalized_||!isDraftable$1(j)?j:j===peek$1(a.base_,_)?(prepareCopy$1(a),a.copy_[_]=createProxy$1(j,a)):j},has(a,_){return _ in latest$1(a)},ownKeys(a){return Reflect.ownKeys(latest$1(a))},set(a,_,$){const j=getDescriptorFromProto$1(latest$1(a),_);if(j!=null&&j.set)return j.set.call(a.draft_,$),!0;if(!a.modified_){const et=peek$1(latest$1(a),_),tt=et==null?void 0:et[DRAFT_STATE$1];if(tt&&tt.base_===$)return a.copy_[_]=$,a.assigned_[_]=!1,!0;if(is$1($,et)&&($!==void 0||has$1(a.base_,_)))return!0;prepareCopy$1(a),markChanged$1(a)}return a.copy_[_]===$&&($!==void 0||_ in a.copy_)||Number.isNaN($)&&Number.isNaN(a.copy_[_])||(a.copy_[_]=$,a.assigned_[_]=!0),!0},deleteProperty(a,_){return peek$1(a.base_,_)!==void 0||_ in a.base_?(a.assigned_[_]=!1,prepareCopy$1(a),markChanged$1(a)):delete a.assigned_[_],a.copy_&&delete a.copy_[_],!0},getOwnPropertyDescriptor(a,_){const $=latest$1(a),j=Reflect.getOwnPropertyDescriptor($,_);return j&&{writable:!0,configurable:a.type_!==1||_!=="length",enumerable:j.enumerable,value:$[_]}},defineProperty(){die$1(11)},getPrototypeOf(a){return getPrototypeOf$2(a.base_)},setPrototypeOf(){die$1(12)}},arrayTraps$1={};each$1(objectTraps$1,(a,_)=>{arrayTraps$1[a]=function(){return arguments[0]=arguments[0][0],_.apply(this,arguments)}});arrayTraps$1.deleteProperty=function(a,_){return arrayTraps$1.set.call(this,a,_,void 0)};arrayTraps$1.set=function(a,_,$){return objectTraps$1.set.call(this,a[0],_,$,a[0])};function peek$1(a,_){const $=a[DRAFT_STATE$1];return($?latest$1($):a)[_]}function readPropFromProto$1(a,_,$){var et;const j=getDescriptorFromProto$1(_,$);return j?"value"in j?j.value:(et=j.get)==null?void 0:et.call(a.draft_):void 0}function getDescriptorFromProto$1(a,_){if(!(_ in a))return;let $=getPrototypeOf$2(a);for(;$;){const j=Object.getOwnPropertyDescriptor($,_);if(j)return j;$=getPrototypeOf$2($)}}function markChanged$1(a){a.modified_||(a.modified_=!0,a.parent_&&markChanged$1(a.parent_))}function prepareCopy$1(a){a.copy_||(a.copy_=shallowCopy$1(a.base_,a.scope_.immer_.useStrictShallowCopy_))}var Immer2$1=class{constructor(_){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=($,j,et)=>{if(typeof $=="function"&&typeof j!="function"){const rt=j;j=$;const nt=this;return function(st=rt,...ot){return nt.produce(st,at=>j.call(this,at,...ot))}}typeof j!="function"&&die$1(6),et!==void 0&&typeof et!="function"&&die$1(7);let tt;if(isDraftable$1($)){const rt=enterScope$1(this),nt=createProxy$1($,void 0);let it=!0;try{tt=j(nt),it=!1}finally{it?revokeScope$1(rt):leaveScope$1(rt)}return usePatchesInScope$1(rt,et),processResult$1(tt,rt)}else if(!$||typeof $!="object"){if(tt=j($),tt===void 0&&(tt=$),tt===NOTHING$1&&(tt=void 0),this.autoFreeze_&&freeze$1(tt,!0),et){const rt=[],nt=[];getPlugin$1("Patches").generateReplacementPatches_($,tt,rt,nt),et(rt,nt)}return tt}else die$1(1,$)},this.produceWithPatches=($,j)=>{if(typeof $=="function")return(nt,...it)=>this.produceWithPatches(nt,st=>$(st,...it));let et,tt;return[this.produce($,j,(nt,it)=>{et=nt,tt=it}),et,tt]},typeof(_==null?void 0:_.autoFreeze)=="boolean"&&this.setAutoFreeze(_.autoFreeze),typeof(_==null?void 0:_.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(_.useStrictShallowCopy)}createDraft(_){isDraftable$1(_)||die$1(8),isDraft$1(_)&&(_=current$1(_));const $=enterScope$1(this),j=createProxy$1(_,void 0);return j[DRAFT_STATE$1].isManual_=!0,leaveScope$1($),j}finishDraft(_,$){const j=_&&_[DRAFT_STATE$1];(!j||!j.isManual_)&&die$1(9);const{scope_:et}=j;return usePatchesInScope$1(et,$),processResult$1(void 0,et)}setAutoFreeze(_){this.autoFreeze_=_}setUseStrictShallowCopy(_){this.useStrictShallowCopy_=_}applyPatches(_,$){let j;for(j=$.length-1;j>=0;j--){const tt=$[j];if(tt.path.length===0&&tt.op==="replace"){_=tt.value;break}}j>-1&&($=$.slice(j+1));const et=getPlugin$1("Patches").applyPatches_;return isDraft$1(_)?et(_,$):this.produce(_,tt=>et(tt,$))}};function createProxy$1(a,_){const $=isMap$1(a)?getPlugin$1("MapSet").proxyMap_(a,_):isSet$1(a)?getPlugin$1("MapSet").proxySet_(a,_):createProxyProxy$1(a,_);return(_?_.scope_:getCurrentScope$1()).drafts_.push($),$}function current$1(a){return isDraft$1(a)||die$1(10,a),currentImpl$1(a)}function currentImpl$1(a){if(!isDraftable$1(a)||isFrozen$1(a))return a;const _=a[DRAFT_STATE$1];let $;if(_){if(!_.modified_)return _.base_;_.finalized_=!0,$=shallowCopy$1(a,_.scope_.immer_.useStrictShallowCopy_)}else $=shallowCopy$1(a,!0);return each$1($,(j,et)=>{set$1($,j,currentImpl$1(et))}),_&&(_.finalized_=!1),$}var immer$1=new Immer2$1,produce$1=immer$1.produce;immer$1.produceWithPatches.bind(immer$1);immer$1.setAutoFreeze.bind(immer$1);immer$1.setUseStrictShallowCopy.bind(immer$1);immer$1.applyPatches.bind(immer$1);immer$1.createDraft.bind(immer$1);immer$1.finishDraft.bind(immer$1);function assertIsFunction(a,_=`expected a function, instead received ${typeof a}`){if(typeof a!="function")throw new TypeError(_)}function assertIsObject(a,_=`expected an object, instead received ${typeof a}`){if(typeof a!="object")throw new TypeError(_)}function assertIsArrayOfFunctions(a,_="expected all items to be functions, instead received the following types: "){if(!a.every($=>typeof $=="function")){const $=a.map(j=>typeof j=="function"?`function ${j.name||"unnamed"}()`:typeof j).join(", ");throw new TypeError(`${_}[${$}]`)}}var ensureIsArray=a=>Array.isArray(a)?a:[a];function getDependencies(a){const _=Array.isArray(a[0])?a[0]:a;return assertIsArrayOfFunctions(_,"createSelector expects all input-selectors to be functions, but received the following types: "),_}function collectInputSelectorResults(a,_){const $=[],{length:j}=a;for(let et=0;et{$=createCacheNode(),rt.resetResultsCount()},rt.resultsCount=()=>tt,rt.resetResultsCount=()=>{tt=0},rt}function createSelectorCreator(a,..._){const $=typeof a=="function"?{memoize:a,memoizeOptions:_}:a,j=(...et)=>{let tt=0,rt=0,nt,it={},st=et.pop();typeof st=="object"&&(it=st,st=et.pop()),assertIsFunction(st,`createSelector expects an output function after the inputs, but received: [${typeof st}]`);const ot={...$,...it},{memoize:at,memoizeOptions:ut=[],argsMemoize:ht=weakMapMemoize,argsMemoizeOptions:yt=[],devModeChecks:wt={}}=ot,Ct=ensureIsArray(ut),Pt=ensureIsArray(yt),$t=getDependencies(et),Mt=at(function(){return tt++,st.apply(null,arguments)},...Ct),Bt=ht(function(){rt++;const zt=collectInputSelectorResults($t,arguments);return nt=Mt.apply(null,zt),nt},...Pt);return Object.assign(Bt,{resultFunc:st,memoizedResultFunc:Mt,dependencies:$t,dependencyRecomputations:()=>rt,resetDependencyRecomputations:()=>{rt=0},lastResult:()=>nt,recomputations:()=>tt,resetRecomputations:()=>{tt=0},memoize:at,argsMemoize:ht})};return Object.assign(j,{withTypes:()=>j}),j}var createSelector=createSelectorCreator(weakMapMemoize),createStructuredSelector=Object.assign((a,_=createSelector)=>{assertIsObject(a,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof a}`);const $=Object.keys(a),j=$.map(tt=>a[tt]);return _(j,(...tt)=>tt.reduce((rt,nt,it)=>(rt[$[it]]=nt,rt),{}))},{withTypes:()=>createStructuredSelector});function createThunkMiddleware(a){return({dispatch:$,getState:j})=>et=>tt=>typeof tt=="function"?tt($,j,a):et(tt)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,createDraftSafeSelectorCreator=(...a)=>{const _=createSelectorCreator(...a),$=Object.assign((...j)=>{const et=_(...j),tt=(rt,...nt)=>et(isDraft$1(rt)?current$1(rt):rt,...nt);return Object.assign(tt,et),tt},{withTypes:()=>$});return $};createDraftSafeSelectorCreator(weakMapMemoize);var composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose:compose.apply(null,arguments)},hasMatchFunction=a=>a&&typeof a.match=="function";function createAction(a,_){function $(...j){if(_){let et=_(...j);if(!et)throw new Error(formatProdErrorMessage(0));return{type:a,payload:et.payload,..."meta"in et&&{meta:et.meta},..."error"in et&&{error:et.error}}}return{type:a,payload:j[0]}}return $.toString=()=>`${a}`,$.type=a,$.match=j=>isAction(j)&&j.type===a,$}var Tuple=class ip extends Array{constructor(..._){super(..._),Object.setPrototypeOf(this,ip.prototype)}static get[Symbol.species](){return ip}concat(..._){return super.concat.apply(this,_)}prepend(..._){return _.length===1&&Array.isArray(_[0])?new ip(..._[0].concat(this)):new ip(..._.concat(this))}};function freezeDraftable(a){return isDraftable$1(a)?produce$1(a,()=>{}):a}function emplace(a,_,$){if(a.has(_)){let et=a.get(_);return $.update&&(et=$.update(et,_,a),a.set(_,et)),et}if(!$.insert)throw new Error(formatProdErrorMessage(10));const j=$.insert(_,a);return a.set(_,j),j}function isBoolean(a){return typeof a=="boolean"}var buildGetDefaultMiddleware=()=>function(_){const{thunk:$=!0,immutableCheck:j=!0,serializableCheck:et=!0,actionCreatorCheck:tt=!0}=_??{};let rt=new Tuple;return $&&(isBoolean($)?rt.push(thunk):rt.push(withExtraArgument($.extraArgument))),rt},SHOULD_AUTOBATCH="RTK_autoBatch",createQueueWithTimer=a=>_=>{setTimeout(_,a)},rAF=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:createQueueWithTimer(10),autoBatchEnhancer=(a={type:"raf"})=>_=>(...$)=>{const j=_(...$);let et=!0,tt=!1,rt=!1;const nt=new Set,it=a.type==="tick"?queueMicrotask:a.type==="raf"?rAF:a.type==="callback"?a.queueNotification:createQueueWithTimer(a.timeout),st=()=>{rt=!1,tt&&(tt=!1,nt.forEach(ot=>ot()))};return Object.assign({},j,{subscribe(ot){const at=()=>et&&ot(),ut=j.subscribe(at);return nt.add(ot),()=>{ut(),nt.delete(ot)}},dispatch(ot){var at;try{return et=!((at=ot==null?void 0:ot.meta)!=null&&at[SHOULD_AUTOBATCH]),tt=!et,tt&&(rt||(rt=!0,it(st))),j.dispatch(ot)}finally{et=!0}}})},buildGetDefaultEnhancers=a=>function($){const{autoBatch:j=!0}=$??{};let et=new Tuple(a);return j&&et.push(autoBatchEnhancer(typeof j=="object"?j:void 0)),et},IS_PRODUCTION=!0;function configureStore(a){const _=buildGetDefaultMiddleware(),{reducer:$=void 0,middleware:j,devTools:et=!0,preloadedState:tt=void 0,enhancers:rt=void 0}=a||{};let nt;if(typeof $=="function")nt=$;else if(isPlainObject$3($))nt=combineReducers($);else throw new Error(formatProdErrorMessage(1));let it;typeof j=="function"?it=j(_):it=_();let st=compose;et&&(st=composeWithDevTools({trace:!IS_PRODUCTION,...typeof et=="object"&&et}));const ot=applyMiddleware(...it),at=buildGetDefaultEnhancers(ot);let ut=typeof rt=="function"?rt(at):at();const ht=st(...ut);return createStore(nt,tt,ht)}function executeReducerBuilderCallback(a){const _={},$=[];let j;const et={addCase(tt,rt){const nt=typeof tt=="string"?tt:tt.type;if(!nt)throw new Error(formatProdErrorMessage(28));if(nt in _)throw new Error(formatProdErrorMessage(29));return _[nt]=rt,et},addMatcher(tt,rt){return $.push({matcher:tt,reducer:rt}),et},addDefaultCase(tt){return j=tt,et}};return a(et),[_,$,j]}function isStateFunction(a){return typeof a=="function"}function createReducer(a,_){let[$,j,et]=executeReducerBuilderCallback(_),tt;if(isStateFunction(a))tt=()=>freezeDraftable(a());else{const nt=freezeDraftable(a);tt=()=>nt}function rt(nt=tt(),it){let st=[$[it.type],...j.filter(({matcher:ot})=>ot(it)).map(({reducer:ot})=>ot)];return st.filter(ot=>!!ot).length===0&&(st=[et]),st.reduce((ot,at)=>{if(at)if(isDraft$1(ot)){const ht=at(ot,it);return ht===void 0?ot:ht}else{if(isDraftable$1(ot))return produce$1(ot,ut=>at(ut,it));{const ut=at(ot,it);if(ut===void 0){if(ot===null)return ot;throw new Error(formatProdErrorMessage(9))}return ut}}return ot},nt)}return rt.getInitialState=tt,rt}var urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",nanoid=(a=21)=>{let _="",$=a;for(;$--;)_+=urlAlphabet[Math.random()*64|0];return _},matches=(a,_)=>hasMatchFunction(a)?a.match(_):a(_);function isAnyOf(...a){return _=>a.some($=>matches($,_))}var commonProperties=["name","message","stack","code"],RejectWithValue=class{constructor(a,_){Yr(this,"_type");this.payload=a,this.meta=_}},FulfillWithMeta=class{constructor(a,_){Yr(this,"_type");this.payload=a,this.meta=_}},miniSerializeError=a=>{if(typeof a=="object"&&a!==null){const _={};for(const $ of commonProperties)typeof a[$]=="string"&&(_[$]=a[$]);return _}return{message:String(a)}},createAsyncThunk=(()=>{function a(_,$,j){const et=createAction(_+"/fulfilled",(it,st,ot,at)=>({payload:it,meta:{...at||{},arg:ot,requestId:st,requestStatus:"fulfilled"}})),tt=createAction(_+"/pending",(it,st,ot)=>({payload:void 0,meta:{...ot||{},arg:st,requestId:it,requestStatus:"pending"}})),rt=createAction(_+"/rejected",(it,st,ot,at,ut)=>({payload:at,error:(j&&j.serializeError||miniSerializeError)(it||"Rejected"),meta:{...ut||{},arg:ot,requestId:st,rejectedWithValue:!!at,requestStatus:"rejected",aborted:(it==null?void 0:it.name)==="AbortError",condition:(it==null?void 0:it.name)==="ConditionError"}}));function nt(it){return(st,ot,at)=>{const ut=j!=null&&j.idGenerator?j.idGenerator(it):nanoid(),ht=new AbortController;let yt,wt;function Ct($t){wt=$t,ht.abort()}const Pt=async function(){var Bt,Dt;let $t;try{let zt=(Bt=j==null?void 0:j.condition)==null?void 0:Bt.call(j,it,{getState:ot,extra:at});if(isThenable(zt)&&(zt=await zt),zt===!1||ht.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const Ot=new Promise((It,Lt)=>{yt=()=>{Lt({name:"AbortError",message:wt||"Aborted"})},ht.signal.addEventListener("abort",yt)});st(tt(ut,it,(Dt=j==null?void 0:j.getPendingMeta)==null?void 0:Dt.call(j,{requestId:ut,arg:it},{getState:ot,extra:at}))),$t=await Promise.race([Ot,Promise.resolve($(it,{dispatch:st,getState:ot,extra:at,requestId:ut,signal:ht.signal,abort:Ct,rejectWithValue:(It,Lt)=>new RejectWithValue(It,Lt),fulfillWithValue:(It,Lt)=>new FulfillWithMeta(It,Lt)})).then(It=>{if(It instanceof RejectWithValue)throw It;return It instanceof FulfillWithMeta?et(It.payload,ut,it,It.meta):et(It,ut,it)})])}catch(zt){$t=zt instanceof RejectWithValue?rt(null,ut,it,zt.payload,zt.meta):rt(zt,ut,it)}finally{yt&&ht.signal.removeEventListener("abort",yt)}return j&&!j.dispatchConditionRejection&&rt.match($t)&&$t.meta.condition||st($t),$t}();return Object.assign(Pt,{abort:Ct,requestId:ut,arg:it,unwrap(){return Pt.then(unwrapResult)}})}}return Object.assign(nt,{pending:tt,rejected:rt,fulfilled:et,settled:isAnyOf(rt,et),typePrefix:_})}return a.withTypes=()=>a,a})();function unwrapResult(a){if(a.meta&&a.meta.rejectedWithValue)throw a.payload;if(a.error)throw a.error;return a.payload}function isThenable(a){return a!==null&&typeof a=="object"&&typeof a.then=="function"}var asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType(a,_){return`${a}/${_}`}function buildCreateSlice({creators:a}={}){var $;const _=($=a==null?void 0:a.asyncThunk)==null?void 0:$[asyncThunkSymbol];return function(et){const{name:tt,reducerPath:rt=tt}=et;if(!tt)throw new Error(formatProdErrorMessage(11));typeof process$1$1<"u";const nt=(typeof et.reducers=="function"?et.reducers(buildReducerCreators()):et.reducers)||{},it=Object.keys(nt),st={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},ot={addCase(Mt,Bt){const Dt=typeof Mt=="string"?Mt:Mt.type;if(!Dt)throw new Error(formatProdErrorMessage(12));if(Dt in st.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return st.sliceCaseReducersByType[Dt]=Bt,ot},addMatcher(Mt,Bt){return st.sliceMatchers.push({matcher:Mt,reducer:Bt}),ot},exposeAction(Mt,Bt){return st.actionCreators[Mt]=Bt,ot},exposeCaseReducer(Mt,Bt){return st.sliceCaseReducersByName[Mt]=Bt,ot}};it.forEach(Mt=>{const Bt=nt[Mt],Dt={reducerName:Mt,type:getType(tt,Mt),createNotation:typeof et.reducers=="function"};isAsyncThunkSliceReducerDefinition(Bt)?handleThunkCaseReducerDefinition(Dt,Bt,ot,_):handleNormalReducerDefinition(Dt,Bt,ot)});function at(){const[Mt={},Bt=[],Dt=void 0]=typeof et.extraReducers=="function"?executeReducerBuilderCallback(et.extraReducers):[et.extraReducers],zt={...Mt,...st.sliceCaseReducersByType};return createReducer(et.initialState,Ot=>{for(let It in zt)Ot.addCase(It,zt[It]);for(let It of st.sliceMatchers)Ot.addMatcher(It.matcher,It.reducer);for(let It of Bt)Ot.addMatcher(It.matcher,It.reducer);Dt&&Ot.addDefaultCase(Dt)})}const ut=Mt=>Mt,ht=new Map;let yt;function wt(Mt,Bt){return yt||(yt=at()),yt(Mt,Bt)}function Ct(){return yt||(yt=at()),yt.getInitialState()}function Pt(Mt,Bt=!1){function Dt(Ot){let It=Ot[Mt];return typeof It>"u"&&Bt&&(It=Ct()),It}function zt(Ot=ut){const It=emplace(ht,Bt,{insert:()=>new WeakMap});return emplace(It,Ot,{insert:()=>{const Lt={};for(const[Ft,jt]of Object.entries(et.selectors??{}))Lt[Ft]=wrapSelector(jt,Ot,Ct,Bt);return Lt}})}return{reducerPath:Mt,getSelectors:zt,get selectors(){return zt(Dt)},selectSlice:Dt}}const $t={name:tt,reducer:wt,actions:st.actionCreators,caseReducers:st.sliceCaseReducersByName,getInitialState:Ct,...Pt(rt),injectInto(Mt,{reducerPath:Bt,...Dt}={}){const zt=Bt??rt;return Mt.inject({reducerPath:zt,reducer:wt},Dt),{...$t,...Pt(zt,!0)}}};return $t}}function wrapSelector(a,_,$,j){function et(tt,...rt){let nt=_(tt);return typeof nt>"u"&&j&&(nt=$()),a(nt,...rt)}return et.unwrapped=a,et}var createSlice=buildCreateSlice();function buildReducerCreators(){function a(_,$){return{_reducerDefinitionType:"asyncThunk",payloadCreator:_,...$}}return a.withTypes=()=>a,{reducer(_){return Object.assign({[_.name](...$){return _(...$)}}[_.name],{_reducerDefinitionType:"reducer"})},preparedReducer(_,$){return{_reducerDefinitionType:"reducerWithPrepare",prepare:_,reducer:$}},asyncThunk:a}}function handleNormalReducerDefinition({type:a,reducerName:_,createNotation:$},j,et){let tt,rt;if("reducer"in j){if($&&!isCaseReducerWithPrepareDefinition(j))throw new Error(formatProdErrorMessage(17));tt=j.reducer,rt=j.prepare}else tt=j;et.addCase(a,tt).exposeCaseReducer(_,tt).exposeAction(_,rt?createAction(a,rt):createAction(a))}function isAsyncThunkSliceReducerDefinition(a){return a._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(a){return a._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:a,reducerName:_},$,j,et){if(!et)throw new Error(formatProdErrorMessage(18));const{payloadCreator:tt,fulfilled:rt,pending:nt,rejected:it,settled:st,options:ot}=$,at=et(a,tt,ot);j.exposeAction(_,at),rt&&j.addCase(at.fulfilled,rt),nt&&j.addCase(at.pending,nt),it&&j.addCase(at.rejected,it),st&&j.addMatcher(at.settled,st),j.exposeCaseReducer(_,{fulfilled:rt||noop$5,pending:nt||noop$5,rejected:it||noop$5,settled:st||noop$5})}function noop$5(){}var assertFunction=(a,_)=>{if(typeof a!="function")throw new Error(formatProdErrorMessage(32))},alm="listenerMiddleware",getListenerEntryPropsFrom=a=>{let{type:_,actionCreator:$,matcher:j,predicate:et,effect:tt}=a;if(_)et=createAction(_).match;else if($)_=$.type,et=$.match;else if(j)et=j;else if(!et)throw new Error(formatProdErrorMessage(21));return assertFunction(tt),{predicate:et,type:_,effect:tt}},createListenerEntry=Object.assign(a=>{const{type:_,predicate:$,effect:j}=getListenerEntryPropsFrom(a);return{id:nanoid(),effect:j,type:_,predicate:$,pending:new Set,unsubscribe:()=>{throw new Error(formatProdErrorMessage(22))}}},{withTypes:()=>createListenerEntry}),addListener=Object.assign(createAction(`${alm}/add`),{withTypes:()=>addListener});createAction(`${alm}/removeAll`);var removeListener=Object.assign(createAction(`${alm}/remove`),{withTypes:()=>removeListener});function formatProdErrorMessage(a){return`Minified Redux Toolkit error #${a}; visit https://redux-toolkit.js.org/Errors?code=${a} for the full message or use the non-minified dev environment for full errors. `}var createWebStorage$1={},getStorage$1={};getStorage$1.__esModule=!0;getStorage$1.default=getStorage;function _typeof$4(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$4=function($){return typeof $}:_typeof$4=function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},_typeof$4(a)}function noop$4(){}var noopStorage={getItem:noop$4,setItem:noop$4,removeItem:noop$4};function hasStorage(a){if((typeof self>"u"?"undefined":_typeof$4(self))!=="object"||!(a in self))return!1;try{var _=self[a],$="redux-persist ".concat(a," test");_.setItem($,"test"),_.getItem($),_.removeItem($)}catch{return!1}return!0}function getStorage(a){var _="".concat(a,"Storage");return hasStorage(_)?self[_]:noopStorage}createWebStorage$1.__esModule=!0;createWebStorage$1.default=createWebStorage;var _getStorage=_interopRequireDefault$6(getStorage$1);function _interopRequireDefault$6(a){return a&&a.__esModule?a:{default:a}}function createWebStorage(a){var _=(0,_getStorage.default)(a);return{getItem:function(j){return new Promise(function(et,tt){et(_.getItem(j))})},setItem:function(j,et){return new Promise(function(tt,rt){tt(_.setItem(j,et))})},removeItem:function(j){return new Promise(function(et,tt){et(_.removeItem(j))})}}}var default_1=void 0,_createWebStorage=_interopRequireDefault$5(createWebStorage$1);function _interopRequireDefault$5(a){return a&&a.__esModule?a:{default:a}}var _default$5=(0,_createWebStorage.default)("local");default_1=_default$5;function createAsyncMigrate(a,_){return async($,j)=>{if(!$)return;const et=$._persist&&$._persist.version!==void 0?$._persist.version:DEFAULT_VERSION;if(et===j||et>j)return $;const tt=Object.keys(a).map(nt=>parseInt(nt)).filter(nt=>j>=nt&&nt>et).sort((nt,it)=>nt-it);let rt=$;for(const nt of tt)rt=await a[nt](rt);return rt}}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state");function die(a,..._){throw new Error(`[Immer] minified error nr: ${a}. Full error at: https://bit.ly/3cXEKWf`)}var getPrototypeOf$1=Object.getPrototypeOf;function isDraft(a){return!!a&&!!a[DRAFT_STATE]}function isDraftable(a){var _;return a?isPlainObject$1(a)||Array.isArray(a)||!!a[DRAFTABLE]||!!((_=a.constructor)!=null&&_[DRAFTABLE])||isMap(a)||isSet(a):!1}var objectCtorString=Object.prototype.constructor.toString();function isPlainObject$1(a){if(!a||typeof a!="object")return!1;const _=getPrototypeOf$1(a);if(_===null)return!0;const $=Object.hasOwnProperty.call(_,"constructor")&&_.constructor;return $===Object?!0:typeof $=="function"&&Function.toString.call($)===objectCtorString}function each(a,_){getArchtype(a)===0?Reflect.ownKeys(a).forEach($=>{_($,a[$],a)}):a.forEach(($,j)=>_(j,$,a))}function getArchtype(a){const _=a[DRAFT_STATE];return _?_.type_:Array.isArray(a)?1:isMap(a)?2:isSet(a)?3:0}function has(a,_){return getArchtype(a)===2?a.has(_):Object.prototype.hasOwnProperty.call(a,_)}function set(a,_,$){const j=getArchtype(a);j===2?a.set(_,$):j===3?a.add($):a[_]=$}function is(a,_){return a===_?a!==0||1/a===1/_:a!==a&&_!==_}function isMap(a){return a instanceof Map}function isSet(a){return a instanceof Set}function latest(a){return a.copy_||a.base_}function shallowCopy(a,_){if(isMap(a))return new Map(a);if(isSet(a))return new Set(a);if(Array.isArray(a))return Array.prototype.slice.call(a);const $=isPlainObject$1(a);if(_===!0||_==="class_only"&&!$){const j=Object.getOwnPropertyDescriptors(a);delete j[DRAFT_STATE];let et=Reflect.ownKeys(j);for(let tt=0;tt1&&(a.set=a.add=a.clear=a.delete=dontMutateFrozenCollections),Object.freeze(a),_&&Object.entries(a).forEach(([$,j])=>freeze(j,!0))),a}function dontMutateFrozenCollections(){die(2)}function isFrozen(a){return Object.isFrozen(a)}var plugins={};function getPlugin(a){const _=plugins[a];return _||die(0,a),_}var currentScope;function getCurrentScope(){return currentScope}function createScope(a,_){return{drafts_:[],parent_:a,immer_:_,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function usePatchesInScope(a,_){_&&(getPlugin("Patches"),a.patches_=[],a.inversePatches_=[],a.patchListener_=_)}function revokeScope(a){leaveScope(a),a.drafts_.forEach(revokeDraft),a.drafts_=null}function leaveScope(a){a===currentScope&&(currentScope=a.parent_)}function enterScope(a){return currentScope=createScope(currentScope,a)}function revokeDraft(a){const _=a[DRAFT_STATE];_.type_===0||_.type_===1?_.revoke_():_.revoked_=!0}function processResult(a,_){_.unfinalizedDrafts_=_.drafts_.length;const $=_.drafts_[0];return a!==void 0&&a!==$?($[DRAFT_STATE].modified_&&(revokeScope(_),die(4)),isDraftable(a)&&(a=finalize(_,a),_.parent_||maybeFreeze(_,a)),_.patches_&&getPlugin("Patches").generateReplacementPatches_($[DRAFT_STATE].base_,a,_.patches_,_.inversePatches_)):a=finalize(_,$,[]),revokeScope(_),_.patches_&&_.patchListener_(_.patches_,_.inversePatches_),a!==NOTHING?a:void 0}function finalize(a,_,$){if(isFrozen(_))return _;const j=_[DRAFT_STATE];if(!j)return each(_,(et,tt)=>finalizeProperty(a,j,_,et,tt,$)),_;if(j.scope_!==a)return _;if(!j.modified_)return maybeFreeze(a,j.base_,!0),j.base_;if(!j.finalized_){j.finalized_=!0,j.scope_.unfinalizedDrafts_--;const et=j.copy_;let tt=et,rt=!1;j.type_===3&&(tt=new Set(et),et.clear(),rt=!0),each(tt,(nt,it)=>finalizeProperty(a,j,et,nt,it,$,rt)),maybeFreeze(a,et,!1),$&&a.patches_&&getPlugin("Patches").generatePatches_(j,$,a.patches_,a.inversePatches_)}return j.copy_}function finalizeProperty(a,_,$,j,et,tt,rt){if(isDraft(et)){const nt=tt&&_&&_.type_!==3&&!has(_.assigned_,j)?tt.concat(j):void 0,it=finalize(a,et,nt);if(set($,j,it),isDraft(it))a.canAutoFreeze_=!1;else return}else rt&&$.add(et);if(isDraftable(et)&&!isFrozen(et)){if(!a.immer_.autoFreeze_&&a.unfinalizedDrafts_<1)return;finalize(a,et),(!_||!_.scope_.parent_)&&typeof j!="symbol"&&Object.prototype.propertyIsEnumerable.call($,j)&&maybeFreeze(a,et)}}function maybeFreeze(a,_,$=!1){!a.parent_&&a.immer_.autoFreeze_&&a.canAutoFreeze_&&freeze(_,$)}function createProxyProxy(a,_){const $=Array.isArray(a),j={type_:$?1:0,scope_:_?_.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:{},parent_:_,base_:a,draft_:null,copy_:null,revoke_:null,isManual_:!1};let et=j,tt=objectTraps;$&&(et=[j],tt=arrayTraps);const{revoke:rt,proxy:nt}=Proxy.revocable(et,tt);return j.draft_=nt,j.revoke_=rt,nt}var objectTraps={get(a,_){if(_===DRAFT_STATE)return a;const $=latest(a);if(!has($,_))return readPropFromProto(a,$,_);const j=$[_];return a.finalized_||!isDraftable(j)?j:j===peek(a.base_,_)?(prepareCopy(a),a.copy_[_]=createProxy(j,a)):j},has(a,_){return _ in latest(a)},ownKeys(a){return Reflect.ownKeys(latest(a))},set(a,_,$){const j=getDescriptorFromProto(latest(a),_);if(j!=null&&j.set)return j.set.call(a.draft_,$),!0;if(!a.modified_){const et=peek(latest(a),_),tt=et==null?void 0:et[DRAFT_STATE];if(tt&&tt.base_===$)return a.copy_[_]=$,a.assigned_[_]=!1,!0;if(is($,et)&&($!==void 0||has(a.base_,_)))return!0;prepareCopy(a),markChanged(a)}return a.copy_[_]===$&&($!==void 0||_ in a.copy_)||Number.isNaN($)&&Number.isNaN(a.copy_[_])||(a.copy_[_]=$,a.assigned_[_]=!0),!0},deleteProperty(a,_){return peek(a.base_,_)!==void 0||_ in a.base_?(a.assigned_[_]=!1,prepareCopy(a),markChanged(a)):delete a.assigned_[_],a.copy_&&delete a.copy_[_],!0},getOwnPropertyDescriptor(a,_){const $=latest(a),j=Reflect.getOwnPropertyDescriptor($,_);return j&&{writable:!0,configurable:a.type_!==1||_!=="length",enumerable:j.enumerable,value:$[_]}},defineProperty(){die(11)},getPrototypeOf(a){return getPrototypeOf$1(a.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(a,_)=>{arrayTraps[a]=function(){return arguments[0]=arguments[0][0],_.apply(this,arguments)}});arrayTraps.deleteProperty=function(a,_){return arrayTraps.set.call(this,a,_,void 0)};arrayTraps.set=function(a,_,$){return objectTraps.set.call(this,a[0],_,$,a[0])};function peek(a,_){const $=a[DRAFT_STATE];return($?latest($):a)[_]}function readPropFromProto(a,_,$){var et;const j=getDescriptorFromProto(_,$);return j?"value"in j?j.value:(et=j.get)==null?void 0:et.call(a.draft_):void 0}function getDescriptorFromProto(a,_){if(!(_ in a))return;let $=getPrototypeOf$1(a);for(;$;){const j=Object.getOwnPropertyDescriptor($,_);if(j)return j;$=getPrototypeOf$1($)}}function markChanged(a){a.modified_||(a.modified_=!0,a.parent_&&markChanged(a.parent_))}function prepareCopy(a){a.copy_||(a.copy_=shallowCopy(a.base_,a.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(a){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(_,$,j)=>{if(typeof _=="function"&&typeof $!="function"){const tt=$;$=_;const rt=this;return function(it=tt,...st){return rt.produce(it,ot=>$.call(this,ot,...st))}}typeof $!="function"&&die(6),j!==void 0&&typeof j!="function"&&die(7);let et;if(isDraftable(_)){const tt=enterScope(this),rt=createProxy(_,void 0);let nt=!0;try{et=$(rt),nt=!1}finally{nt?revokeScope(tt):leaveScope(tt)}return usePatchesInScope(tt,j),processResult(et,tt)}else if(!_||typeof _!="object"){if(et=$(_),et===void 0&&(et=_),et===NOTHING&&(et=void 0),this.autoFreeze_&&freeze(et,!0),j){const tt=[],rt=[];getPlugin("Patches").generateReplacementPatches_(_,et,tt,rt),j(tt,rt)}return et}else die(1,_)},this.produceWithPatches=(_,$)=>{if(typeof _=="function")return(rt,...nt)=>this.produceWithPatches(rt,it=>_(it,...nt));let j,et;return[this.produce(_,$,(rt,nt)=>{j=rt,et=nt}),j,et]},typeof(a==null?void 0:a.autoFreeze)=="boolean"&&this.setAutoFreeze(a.autoFreeze),typeof(a==null?void 0:a.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(a.useStrictShallowCopy)}createDraft(a){isDraftable(a)||die(8),isDraft(a)&&(a=current(a));const _=enterScope(this),$=createProxy(a,void 0);return $[DRAFT_STATE].isManual_=!0,leaveScope(_),$}finishDraft(a,_){const $=a&&a[DRAFT_STATE];(!$||!$.isManual_)&&die(9);const{scope_:j}=$;return usePatchesInScope(j,_),processResult(void 0,j)}setAutoFreeze(a){this.autoFreeze_=a}setUseStrictShallowCopy(a){this.useStrictShallowCopy_=a}applyPatches(a,_){let $;for($=_.length-1;$>=0;$--){const et=_[$];if(et.path.length===0&&et.op==="replace"){a=et.value;break}}$>-1&&(_=_.slice($+1));const j=getPlugin("Patches").applyPatches_;return isDraft(a)?j(a,_):this.produce(a,et=>j(et,_))}};function createProxy(a,_){const $=isMap(a)?getPlugin("MapSet").proxyMap_(a,_):isSet(a)?getPlugin("MapSet").proxySet_(a,_):createProxyProxy(a,_);return(_?_.scope_:getCurrentScope()).drafts_.push($),$}function current(a){return isDraft(a)||die(10,a),currentImpl(a)}function currentImpl(a){if(!isDraftable(a)||isFrozen(a))return a;const _=a[DRAFT_STATE];let $;if(_){if(!_.modified_)return _.base_;_.finalized_=!0,$=shallowCopy(a,_.scope_.immer_.useStrictShallowCopy_)}else $=shallowCopy(a,!0);return each($,(j,et)=>{set($,j,currentImpl(et))}),_&&(_.finalized_=!1),$}var immer=new Immer2,produce=immer.produce;immer.produceWithPatches.bind(immer);immer.setAutoFreeze.bind(immer);immer.setUseStrictShallowCopy.bind(immer);immer.applyPatches.bind(immer);immer.createDraft.bind(immer);immer.finishDraft.bind(immer);const initialState$9={html:"",seen:!0},announcementSlice=createSlice({name:"announcements",initialState:initialState$9,reducers:{reset:()=>initialState$9,setCurrent:(a,{payload:_})=>{_!==a.html&&(a.seen=!1),a.html=_},setSeen:a=>{a.seen=!0}}}),ERROR_MSG_INPUT="Input must be an string, Buffer or Uint8Array";function normalizeInput(a){let _;if(a instanceof Uint8Array)_=a;else if(typeof a=="string")_=new TextEncoder().encode(a);else throw new Error(ERROR_MSG_INPUT);return _}function toHex(a){return Array.prototype.map.call(a,function(_){return(_<16?"0":"")+_.toString(16)}).join("")}function uint32ToHex(a){return(4294967296+a).toString(16).substring(1)}function debugPrint(a,_,$){let j=` `+a+" = ";for(let et=0;et<_.length;et+=2){if($===32)j+=uint32ToHex(_[et]).toUpperCase(),j+=" ",j+=uint32ToHex(_[et+1]).toUpperCase();else if($===64)j+=uint32ToHex(_[et+1]).toUpperCase(),j+=uint32ToHex(_[et]).toUpperCase();else throw new Error("Invalid size "+$);et%6===4?j+=` -`+new Array(a.length+4).join(" "):et<_.length-2&&(j+=" ")}console.log(j)}function testSpeed(a,_,$){let j=new Date().getTime();const et=new Uint8Array(_);for(let rt=0;rt<_;rt++)et[rt]=rt%256;const tt=new Date().getTime();console.log("Generated random input in "+(tt-j)+"ms"),j=tt;for(let rt=0;rt<$;rt++){const nt=a(et),it=new Date().getTime(),st=it-j;j=it,console.log("Hashed in "+st+"ms: "+nt.substring(0,20)+"..."),console.log(Math.round(_/(1<<20)/(st/1e3)*100)/100+" MB PER SECOND")}}var util$3={normalizeInput,toHex,debugPrint,testSpeed};const util$2=util$3;function ADD64AA(a,_,$){const j=a[_]+a[$];let et=a[_+1]+a[$+1];j>=4294967296&&et++,a[_]=j,a[_+1]=et}function ADD64AC(a,_,$,j){let et=a[_]+$;$<0&&(et+=4294967296);let tt=a[_+1]+j;et>=4294967296&&tt++,a[_]=et,a[_+1]=tt}function B2B_GET32(a,_){return a[_]^a[_+1]<<8^a[_+2]<<16^a[_+3]<<24}function B2B_G(a,_,$,j,et,tt){const rt=m$1[et],nt=m$1[et+1],it=m$1[tt],st=m$1[tt+1];ADD64AA(v$2,a,_),ADD64AC(v$2,a,rt,nt);let ot=v$2[j]^v$2[a],at=v$2[j+1]^v$2[a+1];v$2[j]=at,v$2[j+1]=ot,ADD64AA(v$2,$,j),ot=v$2[_]^v$2[$],at=v$2[_+1]^v$2[$+1],v$2[_]=ot>>>24^at<<8,v$2[_+1]=at>>>24^ot<<8,ADD64AA(v$2,a,_),ADD64AC(v$2,a,it,st),ot=v$2[j]^v$2[a],at=v$2[j+1]^v$2[a+1],v$2[j]=ot>>>16^at<<16,v$2[j+1]=at>>>16^ot<<16,ADD64AA(v$2,$,j),ot=v$2[_]^v$2[$],at=v$2[_+1]^v$2[$+1],v$2[_]=at>>>31^ot<<1,v$2[_+1]=ot>>>31^at<<1}const BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[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],SIGMA82=new Uint8Array(SIGMA8.map(function(a){return a*2})),v$2=new Uint32Array(32),m$1=new Uint32Array(32);function blake2bCompress(a,_){let $=0;for($=0;$<16;$++)v$2[$]=a.h[$],v$2[$+16]=BLAKE2B_IV32[$];for(v$2[24]=v$2[24]^a.t,v$2[25]=v$2[25]^a.t/4294967296,_&&(v$2[28]=~v$2[28],v$2[29]=~v$2[29]),$=0;$<32;$++)m$1[$]=B2B_GET32(a.b,4*$);for($=0;$<12;$++)B2B_G(0,8,16,24,SIGMA82[$*16+0],SIGMA82[$*16+1]),B2B_G(2,10,18,26,SIGMA82[$*16+2],SIGMA82[$*16+3]),B2B_G(4,12,20,28,SIGMA82[$*16+4],SIGMA82[$*16+5]),B2B_G(6,14,22,30,SIGMA82[$*16+6],SIGMA82[$*16+7]),B2B_G(0,10,20,30,SIGMA82[$*16+8],SIGMA82[$*16+9]),B2B_G(2,12,22,24,SIGMA82[$*16+10],SIGMA82[$*16+11]),B2B_G(4,14,16,26,SIGMA82[$*16+12],SIGMA82[$*16+13]),B2B_G(6,8,18,28,SIGMA82[$*16+14],SIGMA82[$*16+15]);for($=0;$<16;$++)a.h[$]=a.h[$]^v$2[$]^v$2[$+16]}const parameterBlock=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 blake2bInit(a,_,$,j){if(a===0||a>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(_&&_.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if($&&$.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(j&&j.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const et={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:a};parameterBlock.fill(0),parameterBlock[0]=a,_&&(parameterBlock[1]=_.length),parameterBlock[2]=1,parameterBlock[3]=1,$&¶meterBlock.set($,32),j&¶meterBlock.set(j,48);for(let tt=0;tt<16;tt++)et.h[tt]=BLAKE2B_IV32[tt]^B2B_GET32(parameterBlock,tt*4);return _&&(blake2bUpdate(et,_),et.c=128),et}function blake2bUpdate(a,_){for(let $=0;$<_.length;$++)a.c===128&&(a.t+=a.c,blake2bCompress(a,!1),a.c=0),a.b[a.c++]=_[$]}function blake2bFinal(a){for(a.t+=a.c;a.c<128;)a.b[a.c++]=0;blake2bCompress(a,!0);const _=new Uint8Array(a.outlen);for(let $=0;$>2]>>8*($&3);return _}function blake2b(a,_,$,j,et){$=$||64,a=util$2.normalizeInput(a),j&&(j=util$2.normalizeInput(j)),et&&(et=util$2.normalizeInput(et));const tt=blake2bInit($,_,j,et);return blake2bUpdate(tt,a),blake2bFinal(tt)}function blake2bHex(a,_,$,j,et){const tt=blake2b(a,_,$,j,et);return util$2.toHex(tt)}var blake2b_1={blake2b,blake2bHex,blake2bInit,blake2bUpdate,blake2bFinal};const util$1=util$3;function B2S_GET32(a,_){return a[_]^a[_+1]<<8^a[_+2]<<16^a[_+3]<<24}function B2S_G(a,_,$,j,et,tt){v$1[a]=v$1[a]+v$1[_]+et,v$1[j]=ROTR32(v$1[j]^v$1[a],16),v$1[$]=v$1[$]+v$1[j],v$1[_]=ROTR32(v$1[_]^v$1[$],12),v$1[a]=v$1[a]+v$1[_]+tt,v$1[j]=ROTR32(v$1[j]^v$1[a],8),v$1[$]=v$1[$]+v$1[j],v$1[_]=ROTR32(v$1[_]^v$1[$],7)}function ROTR32(a,_){return a>>>_^a<<32-_}const BLAKE2S_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SIGMA=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]),v$1=new Uint32Array(16),m=new Uint32Array(16);function blake2sCompress(a,_){let $=0;for($=0;$<8;$++)v$1[$]=a.h[$],v$1[$+8]=BLAKE2S_IV[$];for(v$1[12]^=a.t,v$1[13]^=a.t/4294967296,_&&(v$1[14]=~v$1[14]),$=0;$<16;$++)m[$]=B2S_GET32(a.b,4*$);for($=0;$<10;$++)B2S_G(0,4,8,12,m[SIGMA[$*16+0]],m[SIGMA[$*16+1]]),B2S_G(1,5,9,13,m[SIGMA[$*16+2]],m[SIGMA[$*16+3]]),B2S_G(2,6,10,14,m[SIGMA[$*16+4]],m[SIGMA[$*16+5]]),B2S_G(3,7,11,15,m[SIGMA[$*16+6]],m[SIGMA[$*16+7]]),B2S_G(0,5,10,15,m[SIGMA[$*16+8]],m[SIGMA[$*16+9]]),B2S_G(1,6,11,12,m[SIGMA[$*16+10]],m[SIGMA[$*16+11]]),B2S_G(2,7,8,13,m[SIGMA[$*16+12]],m[SIGMA[$*16+13]]),B2S_G(3,4,9,14,m[SIGMA[$*16+14]],m[SIGMA[$*16+15]]);for($=0;$<8;$++)a.h[$]^=v$1[$]^v$1[$+8]}function blake2sInit(a,_){if(!(a>0&&a<=32))throw new Error("Incorrect output length, should be in [1, 32]");const $=_?_.length:0;if(_&&!($>0&&$<=32))throw new Error("Incorrect key length, should be in [1, 32]");const j={h:new Uint32Array(BLAKE2S_IV),b:new Uint8Array(64),c:0,t:0,outlen:a};return j.h[0]^=16842752^$<<8^a,$>0&&(blake2sUpdate(j,_),j.c=64),j}function blake2sUpdate(a,_){for(let $=0;$<_.length;$++)a.c===64&&(a.t+=a.c,blake2sCompress(a,!1),a.c=0),a.b[a.c++]=_[$]}function blake2sFinal(a){for(a.t+=a.c;a.c<64;)a.b[a.c++]=0;blake2sCompress(a,!0);const _=new Uint8Array(a.outlen);for(let $=0;$>2]>>8*($&3)&255;return _}function blake2s(a,_,$){$=$||32,a=util$1.normalizeInput(a);const j=blake2sInit($,_);return blake2sUpdate(j,a),blake2sFinal(j)}function blake2sHex(a,_,$){const j=blake2s(a,_,$);return util$1.toHex(j)}var blake2s_1={blake2s,blake2sHex,blake2sInit,blake2sUpdate,blake2sFinal};const b2b=blake2b_1,b2s=blake2s_1;var blakejs={blake2b:b2b.blake2b,blake2bHex:b2b.blake2bHex,blake2bInit:b2b.blake2bInit,blake2bUpdate:b2b.blake2bUpdate,blake2bFinal:b2b.blake2bFinal,blake2s:b2s.blake2s,blake2sHex:b2s.blake2sHex,blake2sInit:b2s.blake2sInit,blake2sUpdate:b2s.blake2sUpdate,blake2sFinal:b2s.blake2sFinal};const blake=getDefaultExportFromCjs$1(blakejs);var sha256$2={},_sha2={},_assert={};Object.defineProperty(_assert,"__esModule",{value:!0});_assert.output=_assert.exists=_assert.hash=_assert.bytes=_assert.bool=_assert.number=void 0;function number$1(a){if(!Number.isSafeInteger(a)||a<0)throw new Error(`Wrong positive integer: ${a}`)}_assert.number=number$1;function bool$1(a){if(typeof a!="boolean")throw new Error(`Expected boolean, not ${a}`)}_assert.bool=bool$1;function bytes(a,..._){if(!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length>0&&!_.includes(a.length))throw new TypeError(`Expected Uint8Array of length ${_}, not of length=${a.length}`)}_assert.bytes=bytes;function hash$2(a){if(typeof a!="function"||typeof a.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$1(a.outputLen),number$1(a.blockLen)}_assert.hash=hash$2;function exists(a,_=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(_&&a.finished)throw new Error("Hash#digest() has already been called")}_assert.exists=exists;function output(a,_){bytes(a);const $=_.outputLen;if(a.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}_assert.output=output;const assert$a={number:number$1,bool:bool$1,bytes,hash:hash$2,exists,output};_assert.default=assert$a;var utils$e={},crypto$1={};Object.defineProperty(crypto$1,"__esModule",{value:!0});crypto$1.crypto=void 0;crypto$1.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(a){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(a,"__esModule",{value:!0}),a.randomBytes=a.wrapConstructorWithOpts=a.wrapConstructor=a.checkOpts=a.Hash=a.concatBytes=a.toBytes=a.utf8ToBytes=a.asyncLoop=a.nextTick=a.hexToBytes=a.bytesToHex=a.isLE=a.rotr=a.createView=a.u32=a.u8=void 0;const _=crypto$1,$=Bt=>new Uint8Array(Bt.buffer,Bt.byteOffset,Bt.byteLength);a.u8=$;const j=Bt=>new Uint32Array(Bt.buffer,Bt.byteOffset,Math.floor(Bt.byteLength/4));a.u32=j;const et=Bt=>new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);a.createView=et;const tt=(Bt,Dt)=>Bt<<32-Dt|Bt>>>Dt;if(a.rotr=tt,a.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!a.isLE)throw new Error("Non little-endian hardware is not supported");const rt=Array.from({length:256},(Bt,Dt)=>Dt.toString(16).padStart(2,"0"));function nt(Bt){if(!(Bt instanceof Uint8Array))throw new Error("Uint8Array expected");let Dt="";for(let zt=0;zt{};a.nextTick=st;async function ot(Bt,Dt,zt){let Ot=Date.now();for(let It=0;It=0&&LtOt instanceof Uint8Array))throw new Error("Uint8Array list expected");if(Bt.length===1)return Bt[0];const Dt=Bt.reduce((Ot,It)=>Ot+It.length,0),zt=new Uint8Array(Dt);for(let Ot=0,It=0;OtObject.prototype.toString.call(Bt)==="[object Object]"&&Bt.constructor===Object;function Ct(Bt,Dt){if(Dt!==void 0&&(typeof Dt!="object"||!wt(Dt)))throw new TypeError("Options should be object or undefined");return Object.assign(Bt,Dt)}a.checkOpts=Ct;function Pt(Bt){const Dt=Ot=>Bt().update(ut(Ot)).digest(),zt=Bt();return Dt.outputLen=zt.outputLen,Dt.blockLen=zt.blockLen,Dt.create=()=>Bt(),Dt}a.wrapConstructor=Pt;function $t(Bt){const Dt=(Ot,It)=>Bt(It).update(ut(Ot)).digest(),zt=Bt({});return Dt.outputLen=zt.outputLen,Dt.blockLen=zt.blockLen,Dt.create=Ot=>Bt(Ot),Dt}a.wrapConstructorWithOpts=$t;function Mt(Bt=32){if(_.crypto&&typeof _.crypto.getRandomValues=="function")return _.crypto.getRandomValues(new Uint8Array(Bt));throw new Error("crypto.getRandomValues must be defined")}a.randomBytes=Mt})(utils$e);Object.defineProperty(_sha2,"__esModule",{value:!0});_sha2.SHA2=void 0;const _assert_js_1$2=_assert,utils_js_1$4=utils$e;function setBigUint64(a,_,$,j){if(typeof a.setBigUint64=="function")return a.setBigUint64(_,$,j);const et=BigInt(32),tt=BigInt(4294967295),rt=Number($>>et&tt),nt=Number($&tt),it=j?4:0,st=j?0:4;a.setUint32(_+it,rt,j),a.setUint32(_+st,nt,j)}class SHA2 extends utils_js_1$4.Hash{constructor(_,$,j,et){super(),this.blockLen=_,this.outputLen=$,this.padOffset=j,this.isLE=et,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(_),this.view=(0,utils_js_1$4.createView)(this.buffer)}update(_){_assert_js_1$2.default.exists(this);const{view:$,buffer:j,blockLen:et}=this;_=(0,utils_js_1$4.toBytes)(_);const tt=_.length;for(let rt=0;rtet-rt&&(this.process(j,0),rt=0);for(let at=rt;atot.length)throw new Error("_sha2: outputLen bigger than state");for(let at=0;ata&_^~a&$,Maj=(a,_,$)=>a&_^a&$^_&$,SHA256_K=new Uint32Array([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]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends _sha2_js_1$1.SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:_,B:$,C:j,D:et,E:tt,F:rt,G:nt,H:it}=this;return[_,$,j,et,tt,rt,nt,it]}set(_,$,j,et,tt,rt,nt,it){this.A=_|0,this.B=$|0,this.C=j|0,this.D=et|0,this.E=tt|0,this.F=rt|0,this.G=nt|0,this.H=it|0}process(_,$){for(let at=0;at<16;at++,$+=4)SHA256_W[at]=_.getUint32($,!1);for(let at=16;at<64;at++){const ut=SHA256_W[at-15],ht=SHA256_W[at-2],yt=(0,utils_js_1$3.rotr)(ut,7)^(0,utils_js_1$3.rotr)(ut,18)^ut>>>3,wt=(0,utils_js_1$3.rotr)(ht,17)^(0,utils_js_1$3.rotr)(ht,19)^ht>>>10;SHA256_W[at]=wt+SHA256_W[at-7]+yt+SHA256_W[at-16]|0}let{A:j,B:et,C:tt,D:rt,E:nt,F:it,G:st,H:ot}=this;for(let at=0;at<64;at++){const ut=(0,utils_js_1$3.rotr)(nt,6)^(0,utils_js_1$3.rotr)(nt,11)^(0,utils_js_1$3.rotr)(nt,25),ht=ot+ut+Chi(nt,it,st)+SHA256_K[at]+SHA256_W[at]|0,wt=((0,utils_js_1$3.rotr)(j,2)^(0,utils_js_1$3.rotr)(j,13)^(0,utils_js_1$3.rotr)(j,22))+Maj(j,et,tt)|0;ot=st,st=it,it=nt,nt=rt+ht|0,rt=tt,tt=et,et=j,j=ht+wt|0}j=j+this.A|0,et=et+this.B|0,tt=tt+this.C|0,rt=rt+this.D|0,nt=nt+this.E|0,it=it+this.F|0,st=st+this.G|0,ot=ot+this.H|0,this.set(j,et,tt,rt,nt,it,st,ot)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}sha256$2.sha256=(0,utils_js_1$3.wrapConstructor)(()=>new SHA256);sha256$2.sha224=(0,utils_js_1$3.wrapConstructor)(()=>new SHA224);function base$2(a){if(a.length>=255)throw new TypeError("Alphabet too long");for(var _=new Uint8Array(256),$=0;$<_.length;$++)_[$]=255;for(var j=0;j>>0,Mt=new Uint8Array($t);Ct!==Pt;){for(var Bt=ht[Ct],Dt=0,zt=$t-1;(Bt!==0||Dt>>0,Mt[zt]=Bt%rt>>>0,Bt=Bt/rt>>>0;if(Bt!==0)throw new Error("Non-zero carry");wt=Dt,Ct++}for(var Ot=$t-wt;Ot!==$t&&Mt[Ot]===0;)Ot++;for(var It=nt.repeat(yt);Ot<$t;++Ot)It+=a.charAt(Mt[Ot]);return It}function at(ht){if(typeof ht!="string")throw new TypeError("Expected String");if(ht.length===0)return new Uint8Array;for(var yt=0,wt=0,Ct=0;ht[yt]===nt;)wt++,yt++;for(var Pt=(ht.length-yt)*it+1>>>0,$t=new Uint8Array(Pt);ht[yt];){var Mt=_[ht.charCodeAt(yt)];if(Mt===255)return;for(var Bt=0,Dt=Pt-1;(Mt!==0||Bt>>0,$t[Dt]=Mt%256>>>0,Mt=Mt/256>>>0;if(Mt!==0)throw new Error("Non-zero carry");Ct=Bt,yt++}for(var zt=Pt-Ct;zt!==Pt&&$t[zt]===0;)zt++;for(var Ot=new Uint8Array(wt+(Pt-zt)),It=wt;zt!==Pt;)Ot[It++]=$t[zt++];return Ot}function ut(ht){var yt=at(ht);if(yt)return yt;throw new Error("Non-base"+rt+" character")}return{encode:ot,decodeUnsafe:at,decode:ut}}var src$1=base$2;const basex=src$1,ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var bs58=basex(ALPHABET),base58=bs58,base$1=function(a){function _(tt){var rt=Uint8Array.from(tt),nt=a(rt),it=rt.length+4,st=new Uint8Array(it);return st.set(rt,0),st.set(nt.subarray(0,4),rt.length),base58.encode(st,it)}function $(tt){var rt=tt.slice(0,-4),nt=tt.slice(-4),it=a(rt);if(!(nt[0]^it[0]|nt[1]^it[1]|nt[2]^it[2]|nt[3]^it[3]))return rt}function j(tt){var rt=base58.decodeUnsafe(tt);if(rt)return $(rt)}function et(tt){var rt=base58.decode(tt),nt=$(rt);if(!nt)throw new Error("Invalid checksum");return nt}return{encode:_,decode:et,decodeUnsafe:j}},{sha256:sha256$1}=sha256$2,bs58checkBase=base$1;function sha256x2(a){return sha256$1(sha256$1(a))}var bs58check=bs58checkBase(sha256x2);const bs58check$1=getDefaultExportFromCjs$1(bs58check);class TaquitoError extends Error{}class ParameterValidationError extends TaquitoError{}class RpcError extends TaquitoError{}class TezosToolkitConfigError extends TaquitoError{}class UnsupportedActionError extends TaquitoError{}class NetworkError extends TaquitoError{}class InvalidAddressError extends ParameterValidationError{constructor(_,$){super(),this.address=_,this.errorDetail=$,this.name="InvalidAddressError",this.message=`Invalid address "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidBlockHashError extends ParameterValidationError{constructor(_,$){super(),this.blockHash=_,this.errorDetail=$,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidAmountError extends ParameterValidationError{constructor(_){super(),this.amount=_,this.name="InvalidAmountError",this.message=`Invalid amount "${_}"`}}class InvalidDerivationPathError extends ParameterValidationError{constructor(_,$){super(),this.derivationPath=_,this.errorDetail=$,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidHexStringError extends ParameterValidationError{constructor(_,$){super(),this.hexString=_,this.errorDetail=$,this.name="InvalidHexStringError",this.message=`Invalid hex string "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidMessageError extends ParameterValidationError{constructor(_,$){super(),this.msg=_,this.errorDetail=$,this.name="InvalidMessageError",this.message=`Invalid message "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidViewParameterError extends ParameterValidationError{constructor(_,$,j,et){super(),this.viewName=_,this.sigs=$,this.args=j,this.cause=et,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(j)} received for name "${_}" expecting one of the following signatures ${JSON.stringify($)}.`}}class InvalidKeyError extends ParameterValidationError{constructor(_){super(),this.errorDetail=_,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=_?` ${_}.`:"."}}class InvalidPublicKeyError extends ParameterValidationError{constructor(_,$){super(),this.publicKey=_,this.errorDetail=$,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidContractAddressError extends ParameterValidationError{constructor(_,$){super(),this.contractAddress=_,this.errorDetail=$,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidChainIdError extends ParameterValidationError{constructor(_,$){super(),this.chainId=_,this.errorDetail=$,this.name="InvalidChainIdError",this.message=`Invalid chain id "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidKeyHashError extends ParameterValidationError{constructor(_,$){super(),this.keyHash=_,this.errorDetail=$,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidOperationHashError extends ParameterValidationError{constructor(_,$){super(),this.operationHash=_,this.errorDetail=$,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidOperationKindError extends ParameterValidationError{constructor(_,$){super(),this.operationKind=_,this.errorDetail=$,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${_}"`,this.message+=$?` ${$}.`:"."}}class DeprecationError extends UnsupportedActionError{constructor(_){super(),this.message=_,this.name="DeprecationError"}}class ProhibitedActionError extends UnsupportedActionError{constructor(_){super(),this.message=_,this.name="ProhibitedActionError"}}class PublicKeyNotFoundError extends TaquitoError{constructor(_,$){super(),this.pkh=_,this.cause=$,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${_}" in either wallet or contract API.`}}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$2=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX$1=1e9;function clone(a){var _,$,j,et=$t.prototype={constructor:$t,toString:null,valueOf:null},tt=new $t(1),rt=20,nt=4,it=-7,st=21,ot=-1e7,at=1e7,ut=!1,ht=1,yt=0,wt={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Ct="0123456789abcdefghijklmnopqrstuvwxyz",Pt=!0;function $t(It,Lt){var Ft,jt,bt,vt,ct,dt,mt,xt,At=this;if(!(At instanceof $t))return new $t(It,Lt);if(Lt==null){if(It&&It._isBigNumber===!0){At.s=It.s,!It.c||It.e>at?At.c=At.e=null:It.e=10;ct/=10,vt++);vt>at?At.c=At.e=null:(At.e=vt,At.c=[It]);return}xt=String(It)}else{if(!isNumeric.test(xt=String(It)))return j(At,xt,dt);At.s=xt.charCodeAt(0)==45?(xt=xt.slice(1),-1):1}(vt=xt.indexOf("."))>-1&&(xt=xt.replace(".","")),(ct=xt.search(/e/i))>0?(vt<0&&(vt=ct),vt+=+xt.slice(ct+1),xt=xt.substring(0,ct)):vt<0&&(vt=xt.length)}else{if(intCheck(Lt,2,Ct.length,"Base"),Lt==10&&Pt)return At=new $t(It),zt(At,rt+At.e+1,nt);if(xt=String(It),dt=typeof It=="number"){if(It*0!=0)return j(At,xt,dt,Lt);if(At.s=1/It<0?(xt=xt.slice(1),-1):1,$t.DEBUG&&xt.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+It)}else At.s=xt.charCodeAt(0)===45?(xt=xt.slice(1),-1):1;for(Ft=Ct.slice(0,Lt),vt=ct=0,mt=xt.length;ctvt){vt=mt;continue}}else if(!bt&&(xt==xt.toUpperCase()&&(xt=xt.toLowerCase())||xt==xt.toLowerCase()&&(xt=xt.toUpperCase()))){bt=!0,ct=-1,vt=0;continue}return j(At,String(It),dt,Lt)}dt=!1,xt=$(xt,Lt,10,At.s),(vt=xt.indexOf("."))>-1?xt=xt.replace(".",""):vt=xt.length}for(ct=0;xt.charCodeAt(ct)===48;ct++);for(mt=xt.length;xt.charCodeAt(--mt)===48;);if(xt=xt.slice(ct,++mt)){if(mt-=ct,dt&&$t.DEBUG&&mt>15&&(It>MAX_SAFE_INTEGER$2||It!==mathfloor(It)))throw Error(tooManyDigits+At.s*It);if((vt=vt-ct-1)>at)At.c=At.e=null;else if(vt=-MAX$1&&bt<=MAX$1&&bt===mathfloor(bt)){if(jt[0]===0){if(bt===0&&jt.length===1)return!0;break e}if(Lt=(bt+1)%LOG_BASE,Lt<1&&(Lt+=LOG_BASE),String(jt[0]).length==Lt){for(Lt=0;Lt=BASE||Ft!==mathfloor(Ft))break e;if(Ft!==0)return!0}}}else if(jt===null&&bt===null&&(vt===null||vt===1||vt===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+It)},$t.maximum=$t.max=function(){return Bt(arguments,-1)},$t.minimum=$t.min=function(){return Bt(arguments,1)},$t.random=function(){var It=9007199254740992,Lt=Math.random()*It&2097151?function(){return mathfloor(Math.random()*It)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(Ft){var jt,bt,vt,ct,dt,mt=0,xt=[],At=new $t(tt);if(Ft==null?Ft=rt:intCheck(Ft,0,MAX$1),ct=mathceil(Ft/LOG_BASE),ut)if(crypto.getRandomValues){for(jt=crypto.getRandomValues(new Uint32Array(ct*=2));mt>>11),dt>=9e15?(bt=crypto.getRandomValues(new Uint32Array(2)),jt[mt]=bt[0],jt[mt+1]=bt[1]):(xt.push(dt%1e14),mt+=2);mt=ct/2}else if(crypto.randomBytes){for(jt=crypto.randomBytes(ct*=7);mt=9e15?crypto.randomBytes(7).copy(jt,mt):(xt.push(dt%1e14),mt+=7);mt=ct/7}else throw ut=!1,Error(bignumberError+"crypto unavailable");if(!ut)for(;mt=10;dt/=10,mt++);mtbt-1&&(dt[ct+1]==null&&(dt[ct+1]=0),dt[ct+1]+=dt[ct]/bt|0,dt[ct]%=bt)}return dt.reverse()}return function(Ft,jt,bt,vt,ct){var dt,mt,xt,At,Rt,St,Tt,Et,Nt=Ft.indexOf("."),tr=rt,ir=nt;for(Nt>=0&&(At=yt,yt=0,Ft=Ft.replace(".",""),Et=new $t(jt),St=Et.pow(Ft.length-Nt),yt=At,Et.c=Lt(toFixedPoint(coeffToString(St.c),St.e,"0"),10,bt,It),Et.e=Et.c.length),Tt=Lt(Ft,jt,bt,ct?(dt=Ct,It):(dt=It,Ct)),xt=At=Tt.length;Tt[--At]==0;Tt.pop());if(!Tt[0])return dt.charAt(0);if(Nt<0?--xt:(St.c=Tt,St.e=xt,St.s=vt,St=_(St,Et,tr,ir,bt),Tt=St.c,Rt=St.r,xt=St.e),mt=xt+tr+1,Nt=Tt[mt],At=bt/2,Rt=Rt||mt<0||Tt[mt+1]!=null,Rt=ir<4?(Nt!=null||Rt)&&(ir==0||ir==(St.s<0?3:2)):Nt>At||Nt==At&&(ir==4||Rt||ir==6&&Tt[mt-1]&1||ir==(St.s<0?8:7)),mt<1||!Tt[0])Ft=Rt?toFixedPoint(dt.charAt(1),-tr,dt.charAt(0)):dt.charAt(0);else{if(Tt.length=mt,Rt)for(--bt;++Tt[--mt]>bt;)Tt[mt]=0,mt||(++xt,Tt=[1].concat(Tt));for(At=Tt.length;!Tt[--At];);for(Nt=0,Ft="";Nt<=At;Ft+=dt.charAt(Tt[Nt++]));Ft=toFixedPoint(Ft,xt,dt.charAt(0))}return Ft}}(),_=function(){function It(jt,bt,vt){var ct,dt,mt,xt,At=0,Rt=jt.length,St=bt%SQRT_BASE,Tt=bt/SQRT_BASE|0;for(jt=jt.slice();Rt--;)mt=jt[Rt]%SQRT_BASE,xt=jt[Rt]/SQRT_BASE|0,ct=Tt*mt+xt*St,dt=St*mt+ct%SQRT_BASE*SQRT_BASE+At,At=(dt/vt|0)+(ct/SQRT_BASE|0)+Tt*xt,jt[Rt]=dt%vt;return At&&(jt=[At].concat(jt)),jt}function Lt(jt,bt,vt,ct){var dt,mt;if(vt!=ct)mt=vt>ct?1:-1;else for(dt=mt=0;dtbt[dt]?1:-1;break}return mt}function Ft(jt,bt,vt,ct){for(var dt=0;vt--;)jt[vt]-=dt,dt=jt[vt]1;jt.splice(0,1));}return function(jt,bt,vt,ct,dt){var mt,xt,At,Rt,St,Tt,Et,Nt,tr,ir,nr,Zt,Kt,Qt,Ht,qt,Jt,ur=jt.s==bt.s?1:-1,xr=jt.c,pr=bt.c;if(!xr||!xr[0]||!pr||!pr[0])return new $t(!jt.s||!bt.s||(xr?pr&&xr[0]==pr[0]:!pr)?NaN:xr&&xr[0]==0||!pr?ur*0:ur/0);for(Nt=new $t(ur),tr=Nt.c=[],xt=jt.e-bt.e,ur=vt+xt+1,dt||(dt=BASE,xt=bitFloor(jt.e/LOG_BASE)-bitFloor(bt.e/LOG_BASE),ur=ur/LOG_BASE|0),At=0;pr[At]==(xr[At]||0);At++);if(pr[At]>(xr[At]||0)&&xt--,ur<0)tr.push(1),Rt=!0;else{for(Qt=xr.length,qt=pr.length,At=0,ur+=2,St=mathfloor(dt/(pr[0]+1)),St>1&&(pr=It(pr,St,dt),xr=It(xr,St,dt),qt=pr.length,Qt=xr.length),Kt=qt,ir=xr.slice(0,qt),nr=ir.length;nr=dt/2&&Ht++;do{if(St=0,mt=Lt(pr,ir,qt,nr),mt<0){if(Zt=ir[0],qt!=nr&&(Zt=Zt*dt+(ir[1]||0)),St=mathfloor(Zt/Ht),St>1)for(St>=dt&&(St=dt-1),Tt=It(pr,St,dt),Et=Tt.length,nr=ir.length;Lt(Tt,ir,Et,nr)==1;)St--,Ft(Tt,qt=10;ur/=10,At++);zt(Nt,vt+(Nt.e=At+xt*LOG_BASE-1)+1,ct,Rt)}else Nt.e=xt,Nt.r=+Rt;return Nt}}();function Mt(It,Lt,Ft,jt){var bt,vt,ct,dt,mt;if(Ft==null?Ft=nt:intCheck(Ft,0,8),!It.c)return It.toString();if(bt=It.c[0],ct=It.e,Lt==null)mt=coeffToString(It.c),mt=jt==1||jt==2&&(ct<=it||ct>=st)?toExponential(mt,ct):toFixedPoint(mt,ct,"0");else if(It=zt(new $t(It),Lt,Ft),vt=It.e,mt=coeffToString(It.c),dt=mt.length,jt==1||jt==2&&(Lt<=vt||vt<=it)){for(;dtdt){if(--Lt>0)for(mt+=".";Lt--;mt+="0");}else if(Lt+=vt-dt,Lt>0)for(vt+1==dt&&(mt+=".");Lt--;mt+="0");return It.s<0&&bt?"-"+mt:mt}function Bt(It,Lt){for(var Ft,jt,bt=1,vt=new $t(It[0]);bt=10;bt/=10,jt++);return(Ft=jt+Ft*LOG_BASE-1)>at?It.c=It.e=null:Ft=10;dt/=10,bt++);if(vt=Lt-bt,vt<0)vt+=LOG_BASE,ct=Lt,mt=Rt[xt=0],At=mathfloor(mt/St[bt-ct-1]%10);else if(xt=mathceil((vt+1)/LOG_BASE),xt>=Rt.length)if(jt){for(;Rt.length<=xt;Rt.push(0));mt=At=0,bt=1,vt%=LOG_BASE,ct=vt-LOG_BASE+1}else break e;else{for(mt=dt=Rt[xt],bt=1;dt>=10;dt/=10,bt++);vt%=LOG_BASE,ct=vt-LOG_BASE+bt,At=ct<0?0:mathfloor(mt/St[bt-ct-1]%10)}if(jt=jt||Lt<0||Rt[xt+1]!=null||(ct<0?mt:mt%St[bt-ct-1]),jt=Ft<4?(At||jt)&&(Ft==0||Ft==(It.s<0?3:2)):At>5||At==5&&(Ft==4||jt||Ft==6&&(vt>0?ct>0?mt/St[bt-ct]:0:Rt[xt-1])%10&1||Ft==(It.s<0?8:7)),Lt<1||!Rt[0])return Rt.length=0,jt?(Lt-=It.e+1,Rt[0]=St[(LOG_BASE-Lt%LOG_BASE)%LOG_BASE],It.e=-Lt||0):Rt[0]=It.e=0,It;if(vt==0?(Rt.length=xt,dt=1,xt--):(Rt.length=xt+1,dt=St[LOG_BASE-vt],Rt[xt]=ct>0?mathfloor(mt/St[bt-ct]%St[ct])*dt:0),jt)for(;;)if(xt==0){for(vt=1,ct=Rt[0];ct>=10;ct/=10,vt++);for(ct=Rt[0]+=dt,dt=1;ct>=10;ct/=10,dt++);vt!=dt&&(It.e++,Rt[0]==BASE&&(Rt[0]=1));break}else{if(Rt[xt]+=dt,Rt[xt]!=BASE)break;Rt[xt--]=0,dt=1}for(vt=Rt.length;Rt[--vt]===0;Rt.pop());}It.e>at?It.c=It.e=null:It.e=st?toExponential(Lt,Ft):toFixedPoint(Lt,Ft,"0"),It.s<0?"-"+Lt:Lt)}return et.absoluteValue=et.abs=function(){var It=new $t(this);return It.s<0&&(It.s=1),It},et.comparedTo=function(It,Lt){return compare$c(this,new $t(It,Lt))},et.decimalPlaces=et.dp=function(It,Lt){var Ft,jt,bt,vt=this;if(It!=null)return intCheck(It,0,MAX$1),Lt==null?Lt=nt:intCheck(Lt,0,8),zt(new $t(vt),It+vt.e+1,Lt);if(!(Ft=vt.c))return null;if(jt=((bt=Ft.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,bt=Ft[bt])for(;bt%10==0;bt/=10,jt--);return jt<0&&(jt=0),jt},et.dividedBy=et.div=function(It,Lt){return _(this,new $t(It,Lt),rt,nt)},et.dividedToIntegerBy=et.idiv=function(It,Lt){return _(this,new $t(It,Lt),0,1)},et.exponentiatedBy=et.pow=function(It,Lt){var Ft,jt,bt,vt,ct,dt,mt,xt,At,Rt=this;if(It=new $t(It),It.c&&!It.isInteger())throw Error(bignumberError+"Exponent not an integer: "+Ot(It));if(Lt!=null&&(Lt=new $t(Lt)),dt=It.e>14,!Rt.c||!Rt.c[0]||Rt.c[0]==1&&!Rt.e&&Rt.c.length==1||!It.c||!It.c[0])return At=new $t(Math.pow(+Ot(Rt),dt?It.s*(2-isOdd(It)):+Ot(It))),Lt?At.mod(Lt):At;if(mt=It.s<0,Lt){if(Lt.c?!Lt.c[0]:!Lt.s)return new $t(NaN);jt=!mt&&Rt.isInteger()&&Lt.isInteger(),jt&&(Rt=Rt.mod(Lt))}else{if(It.e>9&&(Rt.e>0||Rt.e<-1||(Rt.e==0?Rt.c[0]>1||dt&&Rt.c[1]>=24e7:Rt.c[0]<8e13||dt&&Rt.c[0]<=9999975e7)))return vt=Rt.s<0&&isOdd(It)?-0:0,Rt.e>-1&&(vt=1/vt),new $t(mt?1/vt:vt);yt&&(vt=mathceil(yt/LOG_BASE+2))}for(dt?(Ft=new $t(.5),mt&&(It.s=1),xt=isOdd(It)):(bt=Math.abs(+Ot(It)),xt=bt%2),At=new $t(tt);;){if(xt){if(At=At.times(Rt),!At.c)break;vt?At.c.length>vt&&(At.c.length=vt):jt&&(At=At.mod(Lt))}if(bt){if(bt=mathfloor(bt/2),bt===0)break;xt=bt%2}else if(It=It.times(Ft),zt(It,It.e+1,1),It.e>14)xt=isOdd(It);else{if(bt=+Ot(It),bt===0)break;xt=bt%2}Rt=Rt.times(Rt),vt?Rt.c&&Rt.c.length>vt&&(Rt.c.length=vt):jt&&(Rt=Rt.mod(Lt))}return jt?At:(mt&&(At=tt.div(At)),Lt?At.mod(Lt):vt?zt(At,yt,nt,ct):At)},et.integerValue=function(It){var Lt=new $t(this);return It==null?It=nt:intCheck(It,0,8),zt(Lt,Lt.e+1,It)},et.isEqualTo=et.eq=function(It,Lt){return compare$c(this,new $t(It,Lt))===0},et.isFinite=function(){return!!this.c},et.isGreaterThan=et.gt=function(It,Lt){return compare$c(this,new $t(It,Lt))>0},et.isGreaterThanOrEqualTo=et.gte=function(It,Lt){return(Lt=compare$c(this,new $t(It,Lt)))===1||Lt===0},et.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},et.isLessThan=et.lt=function(It,Lt){return compare$c(this,new $t(It,Lt))<0},et.isLessThanOrEqualTo=et.lte=function(It,Lt){return(Lt=compare$c(this,new $t(It,Lt)))===-1||Lt===0},et.isNaN=function(){return!this.s},et.isNegative=function(){return this.s<0},et.isPositive=function(){return this.s>0},et.isZero=function(){return!!this.c&&this.c[0]==0},et.minus=function(It,Lt){var Ft,jt,bt,vt,ct=this,dt=ct.s;if(It=new $t(It,Lt),Lt=It.s,!dt||!Lt)return new $t(NaN);if(dt!=Lt)return It.s=-Lt,ct.plus(It);var mt=ct.e/LOG_BASE,xt=It.e/LOG_BASE,At=ct.c,Rt=It.c;if(!mt||!xt){if(!At||!Rt)return At?(It.s=-Lt,It):new $t(Rt?ct:NaN);if(!At[0]||!Rt[0])return Rt[0]?(It.s=-Lt,It):new $t(At[0]?ct:nt==3?-0:0)}if(mt=bitFloor(mt),xt=bitFloor(xt),At=At.slice(),dt=mt-xt){for((vt=dt<0)?(dt=-dt,bt=At):(xt=mt,bt=Rt),bt.reverse(),Lt=dt;Lt--;bt.push(0));bt.reverse()}else for(jt=(vt=(dt=At.length)<(Lt=Rt.length))?dt:Lt,dt=Lt=0;Lt0)for(;Lt--;At[Ft++]=0);for(Lt=BASE-1;jt>dt;){if(At[--jt]=0;){for(Ft=0,St=Zt[bt]%tr,Tt=Zt[bt]/tr|0,ct=mt,vt=bt+ct;vt>bt;)xt=nr[--ct]%tr,At=nr[ct]/tr|0,dt=Tt*xt+At*St,xt=St*xt+dt%tr*tr+Et[vt]+Ft,Ft=(xt/Nt|0)+(dt/tr|0)+Tt*At,Et[vt--]=xt%Nt;Et[vt]=Ft}return Ft?++jt:Et.splice(0,1),Dt(It,Et,jt)},et.negated=function(){var It=new $t(this);return It.s=-It.s||null,It},et.plus=function(It,Lt){var Ft,jt=this,bt=jt.s;if(It=new $t(It,Lt),Lt=It.s,!bt||!Lt)return new $t(NaN);if(bt!=Lt)return It.s=-Lt,jt.minus(It);var vt=jt.e/LOG_BASE,ct=It.e/LOG_BASE,dt=jt.c,mt=It.c;if(!vt||!ct){if(!dt||!mt)return new $t(bt/0);if(!dt[0]||!mt[0])return mt[0]?It:new $t(dt[0]?jt:bt*0)}if(vt=bitFloor(vt),ct=bitFloor(ct),dt=dt.slice(),bt=vt-ct){for(bt>0?(ct=vt,Ft=mt):(bt=-bt,Ft=dt),Ft.reverse();bt--;Ft.push(0));Ft.reverse()}for(bt=dt.length,Lt=mt.length,bt-Lt<0&&(Ft=mt,mt=dt,dt=Ft,Lt=bt),bt=0;Lt;)bt=(dt[--Lt]=dt[Lt]+mt[Lt]+bt)/BASE|0,dt[Lt]=BASE===dt[Lt]?0:dt[Lt]%BASE;return bt&&(dt=[bt].concat(dt),++ct),Dt(It,dt,ct)},et.precision=et.sd=function(It,Lt){var Ft,jt,bt,vt=this;if(It!=null&&It!==!!It)return intCheck(It,1,MAX$1),Lt==null?Lt=nt:intCheck(Lt,0,8),zt(new $t(vt),It,Lt);if(!(Ft=vt.c))return null;if(bt=Ft.length-1,jt=bt*LOG_BASE+1,bt=Ft[bt]){for(;bt%10==0;bt/=10,jt--);for(bt=Ft[0];bt>=10;bt/=10,jt++);}return It&&vt.e+1>jt&&(jt=vt.e+1),jt},et.shiftedBy=function(It){return intCheck(It,-MAX_SAFE_INTEGER$2,MAX_SAFE_INTEGER$2),this.times("1e"+It)},et.squareRoot=et.sqrt=function(){var It,Lt,Ft,jt,bt,vt=this,ct=vt.c,dt=vt.s,mt=vt.e,xt=rt+4,At=new $t("0.5");if(dt!==1||!ct||!ct[0])return new $t(!dt||dt<0&&(!ct||ct[0])?NaN:ct?vt:1/0);if(dt=Math.sqrt(+Ot(vt)),dt==0||dt==1/0?(Lt=coeffToString(ct),(Lt.length+mt)%2==0&&(Lt+="0"),dt=Math.sqrt(+Lt),mt=bitFloor((mt+1)/2)-(mt<0||mt%2),dt==1/0?Lt="5e"+mt:(Lt=dt.toExponential(),Lt=Lt.slice(0,Lt.indexOf("e")+1)+mt),Ft=new $t(Lt)):Ft=new $t(dt+""),Ft.c[0]){for(mt=Ft.e,dt=mt+xt,dt<3&&(dt=0);;)if(bt=Ft,Ft=At.times(bt.plus(_(vt,bt,xt,1))),coeffToString(bt.c).slice(0,dt)===(Lt=coeffToString(Ft.c)).slice(0,dt))if(Ft.e0&&Et>0){for(vt=Et%dt||dt,At=Tt.substr(0,vt);vt0&&(At+=xt+Tt.slice(vt)),St&&(At="-"+At)}jt=Rt?At+(Ft.decimalSeparator||"")+((mt=+Ft.fractionGroupSize)?Rt.replace(new RegExp("\\d{"+mt+"}\\B","g"),"$&"+(Ft.fractionGroupSeparator||"")):Rt):At}return(Ft.prefix||"")+jt+(Ft.suffix||"")},et.toFraction=function(It){var Lt,Ft,jt,bt,vt,ct,dt,mt,xt,At,Rt,St,Tt=this,Et=Tt.c;if(It!=null&&(dt=new $t(It),!dt.isInteger()&&(dt.c||dt.s!==1)||dt.lt(tt)))throw Error(bignumberError+"Argument "+(dt.isInteger()?"out of range: ":"not an integer: ")+Ot(dt));if(!Et)return new $t(Tt);for(Lt=new $t(tt),xt=Ft=new $t(tt),jt=mt=new $t(tt),St=coeffToString(Et),vt=Lt.e=St.length-Tt.e-1,Lt.c[0]=POWS_TEN[(ct=vt%LOG_BASE)<0?LOG_BASE+ct:ct],It=!It||dt.comparedTo(Lt)>0?vt>0?Lt:xt:dt,ct=at,at=1/0,dt=new $t(St),mt.c[0]=0;At=_(dt,Lt,0,1),bt=Ft.plus(At.times(jt)),bt.comparedTo(It)!=1;)Ft=jt,jt=bt,xt=mt.plus(At.times(bt=xt)),mt=bt,Lt=dt.minus(At.times(bt=Lt)),dt=bt;return bt=_(It.minus(Ft),jt,0,1),mt=mt.plus(bt.times(xt)),Ft=Ft.plus(bt.times(jt)),mt.s=xt.s=Tt.s,vt=vt*2,Rt=_(xt,jt,vt,nt).minus(Tt).abs().comparedTo(_(mt,Ft,vt,nt).minus(Tt).abs())<1?[xt,jt]:[mt,Ft],at=ct,Rt},et.toNumber=function(){return+Ot(this)},et.toPrecision=function(It,Lt){return It!=null&&intCheck(It,1,MAX$1),Mt(this,It,Lt,2)},et.toString=function(It){var Lt,Ft=this,jt=Ft.s,bt=Ft.e;return bt===null?jt?(Lt="Infinity",jt<0&&(Lt="-"+Lt)):Lt="NaN":(It==null?Lt=bt<=it||bt>=st?toExponential(coeffToString(Ft.c),bt):toFixedPoint(coeffToString(Ft.c),bt,"0"):It===10&&Pt?(Ft=zt(new $t(Ft),rt+bt+1,nt),Lt=toFixedPoint(coeffToString(Ft.c),Ft.e,"0")):(intCheck(It,2,Ct.length,"Base"),Lt=$(toFixedPoint(coeffToString(Ft.c),bt,"0"),10,It,jt,!0)),jt<0&&Ft.c[0]&&(Lt="-"+Lt)),Lt},et.valueOf=et.toJSON=function(){return Ot(this)},et._isBigNumber=!0,et[Symbol.toStringTag]="BigNumber",et[Symbol.for("nodejs.util.inspect.custom")]=et.valueOf,a!=null&&$t.set(a),$t}function bitFloor(a){var _=a|0;return a>0||a===_?_:_-1}function coeffToString(a){for(var _,$,j=1,et=a.length,tt=a[0]+"";jst^$?1:-1;for(nt=(it=et.length)<(st=tt.length)?it:st,rt=0;rttt[rt]^$?1:-1;return it==st?0:it>st^$?1:-1}function intCheck(a,_,$,j){if(a<_||a>$||a!==mathfloor(a))throw Error(bignumberError+(j||"Argument")+(typeof a=="number"?a<_||a>$?" out of range: ":" not an integer: ":" not a primitive number: ")+String(a))}function isOdd(a){var _=a.c.length-1;return bitFloor(a.e/LOG_BASE)==_&&a.c[_]%2!=0}function toExponential(a,_){return(a.length>1?a.charAt(0)+"."+a.slice(1):a)+(_<0?"e":"e+")+_}function toFixedPoint(a,_,$){var j,et;if(_<0){for(et=$+".";++_;et+=$);a=et+a}else if(j=a.length,++_>j){for(et=$,_-=j;--_;et+=$);a+=et}else _",license$1="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage$1="https://github.com/indutny/elliptic",devDependencies$1={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies$1={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0$1={name:name$1,version:version$1,description:description$1,main:main$1,files,scripts:scripts$1,repository:repository$1,keywords,author:author$1,license:license$1,bugs,homepage:homepage$1,devDependencies:devDependencies$1,dependencies:dependencies$1};var utils$d={};(function(a){var _=a,$=bnExports$1,j=minimalisticAssert,et=utils$v;_.assert=j,_.toArray=et.toArray,_.zero2=et.zero2,_.toHex=et.toHex,_.encode=et.encode;function tt(ot,at,ut){var ht=new Array(Math.max(ot.bitLength(),ut)+1);ht.fill(0);for(var yt=1<(yt>>1)-1?Pt=(yt>>1)-$t:Pt=$t,wt.isubn(Pt)):Pt=0,ht[Ct]=Pt,wt.iushrn(1)}return ht}_.getNAF=tt;function rt(ot,at){var ut=[[],[]];ot=ot.clone(),at=at.clone();for(var ht=0,yt=0,wt;ot.cmpn(-ht)>0||at.cmpn(-yt)>0;){var Ct=ot.andln(3)+ht&3,Pt=at.andln(3)+yt&3;Ct===3&&(Ct=-1),Pt===3&&(Pt=-1);var $t;Ct&1?(wt=ot.andln(7)+ht&7,(wt===3||wt===5)&&Pt===2?$t=-Ct:$t=Ct):$t=0,ut[0].push($t);var Mt;Pt&1?(wt=at.andln(7)+yt&7,(wt===3||wt===5)&&Ct===2?Mt=-Pt:Mt=Pt):Mt=0,ut[1].push(Mt),2*ht===$t+1&&(ht=1-ht),2*yt===Mt+1&&(yt=1-yt),ot.iushrn(1),at.iushrn(1)}return ut}_.getJSF=rt;function nt(ot,at,ut){var ht="_"+at;ot.prototype[at]=function(){return this[ht]!==void 0?this[ht]:this[ht]=ut.call(this)}}_.cachedProperty=nt;function it(ot){return typeof ot=="string"?_.toArray(ot,"hex"):ot}_.parseBytes=it;function st(ot){return new $(ot,"hex","le")}_.intFromLE=st})(utils$d);var curve={},BN$8=bnExports$1,utils$c=utils$d,getNAF=utils$c.getNAF,getJSF=utils$c.getJSF,assert$9=utils$c.assert;function BaseCurve(a,_){this.type=a,this.p=new BN$8(_.p,16),this.red=_.prime?BN$8.red(_.prime):BN$8.mont(this.p),this.zero=new BN$8(0).toRed(this.red),this.one=new BN$8(1).toRed(this.red),this.two=new BN$8(2).toRed(this.red),this.n=_.n&&new BN$8(_.n,16),this.g=_.g&&this.pointFromJSON(_.g,_.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var $=this.n&&this.p.div(this.n);!$||$.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base=BaseCurve;BaseCurve.prototype.point=function a(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function a(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function a(_,$){assert$9(_.precomputed);var j=_._getDoubles(),et=getNAF($,1,this._bitLength),tt=(1<=nt;st--)it=(it<<1)+et[st];rt.push(it)}for(var ot=this.jpoint(null,null,null),at=this.jpoint(null,null,null),ut=tt;ut>0;ut--){for(nt=0;nt=0;it--){for(var st=0;it>=0&&rt[it]===0;it--)st++;if(it>=0&&st++,nt=nt.dblp(st),it<0)break;var ot=rt[it];assert$9(ot!==0),_.type==="affine"?ot>0?nt=nt.mixedAdd(tt[ot-1>>1]):nt=nt.mixedAdd(tt[-ot-1>>1].neg()):ot>0?nt=nt.add(tt[ot-1>>1]):nt=nt.add(tt[-ot-1>>1].neg())}return _.type==="affine"?nt.toP():nt};BaseCurve.prototype._wnafMulAdd=function a(_,$,j,et,tt){var rt=this._wnafT1,nt=this._wnafT2,it=this._wnafT3,st=0,ot,at,ut;for(ot=0;ot=1;ot-=2){var yt=ot-1,wt=ot;if(rt[yt]!==1||rt[wt]!==1){it[yt]=getNAF(j[yt],rt[yt],this._bitLength),it[wt]=getNAF(j[wt],rt[wt],this._bitLength),st=Math.max(it[yt].length,st),st=Math.max(it[wt].length,st);continue}var Ct=[$[yt],null,null,$[wt]];$[yt].y.cmp($[wt].y)===0?(Ct[1]=$[yt].add($[wt]),Ct[2]=$[yt].toJ().mixedAdd($[wt].neg())):$[yt].y.cmp($[wt].y.redNeg())===0?(Ct[1]=$[yt].toJ().mixedAdd($[wt]),Ct[2]=$[yt].add($[wt].neg())):(Ct[1]=$[yt].toJ().mixedAdd($[wt]),Ct[2]=$[yt].toJ().mixedAdd($[wt].neg()));var Pt=[-3,-1,-5,-7,0,7,5,1,3],$t=getJSF(j[yt],j[wt]);for(st=Math.max($t[0].length,st),it[yt]=new Array(st),it[wt]=new Array(st),at=0;at=0;ot--){for(var Ot=0;ot>=0;){var It=!0;for(at=0;at=0&&Ot++,Dt=Dt.dblp(Ot),ot<0)break;for(at=0;at0?ut=nt[at][Lt-1>>1]:Lt<0&&(ut=nt[at][-Lt-1>>1].neg()),ut.type==="affine"?Dt=Dt.mixedAdd(ut):Dt=Dt.add(ut))}}for(ot=0;ot=Math.ceil((_.bitLength()+1)/$.step):!1};BasePoint.prototype._getDoubles=function a(_,$){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var j=[this],et=this,tt=0;tt<$;tt+=_){for(var rt=0;rt<_;rt++)et=et.dbl();j.push(et)}return{step:_,points:j}};BasePoint.prototype._getNAFPoints=function a(_){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var $=[this],j=(1<<_)-1,et=j===1?null:this.dbl(),tt=1;tt=0&&(ht=st,yt=ot),at.negative&&(at=at.neg(),ut=ut.neg()),ht.negative&&(ht=ht.neg(),yt=yt.neg()),[{a:at,b:ut},{a:ht,b:yt}]};ShortCurve.prototype._endoSplit=function a(_){var $=this.endo.basis,j=$[0],et=$[1],tt=et.b.mul(_).divRound(this.n),rt=j.b.neg().mul(_).divRound(this.n),nt=tt.mul(j.a),it=rt.mul(et.a),st=tt.mul(j.b),ot=rt.mul(et.b),at=_.sub(nt).sub(it),ut=st.add(ot).neg();return{k1:at,k2:ut}};ShortCurve.prototype.pointFromX=function a(_,$){_=new BN$7(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr().redMul(_).redIAdd(_.redMul(this.a)).redIAdd(this.b),et=j.redSqrt();if(et.redSqr().redSub(j).cmp(this.zero)!==0)throw new Error("invalid point");var tt=et.fromRed().isOdd();return($&&!tt||!$&&tt)&&(et=et.redNeg()),this.point(_,et)};ShortCurve.prototype.validate=function a(_){if(_.inf)return!0;var $=_.x,j=_.y,et=this.a.redMul($),tt=$.redSqr().redMul($).redIAdd(et).redIAdd(this.b);return j.redSqr().redISub(tt).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function a(_,$,j){for(var et=this._endoWnafT1,tt=this._endoWnafT2,rt=0;rt<_.length;rt++){var nt=this._endoSplit($[rt]),it=_[rt],st=it._getBeta();nt.k1.negative&&(nt.k1.ineg(),it=it.neg(!0)),nt.k2.negative&&(nt.k2.ineg(),st=st.neg(!0)),et[rt*2]=it,et[rt*2+1]=st,tt[rt*2]=nt.k1,tt[rt*2+1]=nt.k2}for(var ot=this._wnafMulAdd(1,et,tt,rt*2,j),at=0;at":""};Point$2.prototype.isInfinity=function a(){return this.inf};Point$2.prototype.add=function a(_){if(this.inf)return _;if(_.inf)return this;if(this.eq(_))return this.dbl();if(this.neg().eq(_))return this.curve.point(null,null);if(this.x.cmp(_.x)===0)return this.curve.point(null,null);var $=this.y.redSub(_.y);$.cmpn(0)!==0&&($=$.redMul(this.x.redSub(_.x).redInvm()));var j=$.redSqr().redISub(this.x).redISub(_.x),et=$.redMul(this.x.redSub(j)).redISub(this.y);return this.curve.point(j,et)};Point$2.prototype.dbl=function a(){if(this.inf)return this;var _=this.y.redAdd(this.y);if(_.cmpn(0)===0)return this.curve.point(null,null);var $=this.curve.a,j=this.x.redSqr(),et=_.redInvm(),tt=j.redAdd(j).redIAdd(j).redIAdd($).redMul(et),rt=tt.redSqr().redISub(this.x.redAdd(this.x)),nt=tt.redMul(this.x.redSub(rt)).redISub(this.y);return this.curve.point(rt,nt)};Point$2.prototype.getX=function a(){return this.x.fromRed()};Point$2.prototype.getY=function a(){return this.y.fromRed()};Point$2.prototype.mul=function a(_){return _=new BN$7(_,16),this.isInfinity()?this:this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve.endo?this.curve._endoWnafMulAdd([this],[_]):this.curve._wnafMul(this,_)};Point$2.prototype.mulAdd=function a(_,$,j){var et=[this,$],tt=[_,j];return this.curve.endo?this.curve._endoWnafMulAdd(et,tt):this.curve._wnafMulAdd(1,et,tt,2)};Point$2.prototype.jmulAdd=function a(_,$,j){var et=[this,$],tt=[_,j];return this.curve.endo?this.curve._endoWnafMulAdd(et,tt,!0):this.curve._wnafMulAdd(1,et,tt,2,!0)};Point$2.prototype.eq=function a(_){return this===_||this.inf===_.inf&&(this.inf||this.x.cmp(_.x)===0&&this.y.cmp(_.y)===0)};Point$2.prototype.neg=function a(_){if(this.inf)return this;var $=this.curve.point(this.x,this.y.redNeg());if(_&&this.precomputed){var j=this.precomputed,et=function(tt){return tt.neg()};$.precomputed={naf:j.naf&&{wnd:j.naf.wnd,points:j.naf.points.map(et)},doubles:j.doubles&&{step:j.doubles.step,points:j.doubles.points.map(et)}}}return $};Point$2.prototype.toJ=function a(){if(this.inf)return this.curve.jpoint(null,null,null);var _=this.curve.jpoint(this.x,this.y,this.curve.one);return _};function JPoint(a,_,$,j){Base$2.BasePoint.call(this,a,"jacobian"),_===null&&$===null&&j===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$7(0)):(this.x=new BN$7(_,16),this.y=new BN$7($,16),this.z=new BN$7(j,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$2(JPoint,Base$2.BasePoint);ShortCurve.prototype.jpoint=function a(_,$,j){return new JPoint(this,_,$,j)};JPoint.prototype.toP=function a(){if(this.isInfinity())return this.curve.point(null,null);var _=this.z.redInvm(),$=_.redSqr(),j=this.x.redMul($),et=this.y.redMul($).redMul(_);return this.curve.point(j,et)};JPoint.prototype.neg=function a(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function a(_){if(this.isInfinity())return _;if(_.isInfinity())return this;var $=_.z.redSqr(),j=this.z.redSqr(),et=this.x.redMul($),tt=_.x.redMul(j),rt=this.y.redMul($.redMul(_.z)),nt=_.y.redMul(j.redMul(this.z)),it=et.redSub(tt),st=rt.redSub(nt);if(it.cmpn(0)===0)return st.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ot=it.redSqr(),at=ot.redMul(it),ut=et.redMul(ot),ht=st.redSqr().redIAdd(at).redISub(ut).redISub(ut),yt=st.redMul(ut.redISub(ht)).redISub(rt.redMul(at)),wt=this.z.redMul(_.z).redMul(it);return this.curve.jpoint(ht,yt,wt)};JPoint.prototype.mixedAdd=function a(_){if(this.isInfinity())return _.toJ();if(_.isInfinity())return this;var $=this.z.redSqr(),j=this.x,et=_.x.redMul($),tt=this.y,rt=_.y.redMul($).redMul(this.z),nt=j.redSub(et),it=tt.redSub(rt);if(nt.cmpn(0)===0)return it.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var st=nt.redSqr(),ot=st.redMul(nt),at=j.redMul(st),ut=it.redSqr().redIAdd(ot).redISub(at).redISub(at),ht=it.redMul(at.redISub(ut)).redISub(tt.redMul(ot)),yt=this.z.redMul(nt);return this.curve.jpoint(ut,ht,yt)};JPoint.prototype.dblp=function a(_){if(_===0)return this;if(this.isInfinity())return this;if(!_)return this.dbl();var $;if(this.curve.zeroA||this.curve.threeA){var j=this;for($=0;$<_;$++)j=j.dbl();return j}var et=this.curve.a,tt=this.curve.tinv,rt=this.x,nt=this.y,it=this.z,st=it.redSqr().redSqr(),ot=nt.redAdd(nt);for($=0;$<_;$++){var at=rt.redSqr(),ut=ot.redSqr(),ht=ut.redSqr(),yt=at.redAdd(at).redIAdd(at).redIAdd(et.redMul(st)),wt=rt.redMul(ut),Ct=yt.redSqr().redISub(wt.redAdd(wt)),Pt=wt.redISub(Ct),$t=yt.redMul(Pt);$t=$t.redIAdd($t).redISub(ht);var Mt=ot.redMul(it);$+1<_&&(st=st.redMul(ht)),rt=Ct,it=Mt,ot=$t}return this.curve.jpoint(rt,ot.redMul(tt),it)};JPoint.prototype.dbl=function a(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};JPoint.prototype._zeroDbl=function a(){var _,$,j;if(this.zOne){var et=this.x.redSqr(),tt=this.y.redSqr(),rt=tt.redSqr(),nt=this.x.redAdd(tt).redSqr().redISub(et).redISub(rt);nt=nt.redIAdd(nt);var it=et.redAdd(et).redIAdd(et),st=it.redSqr().redISub(nt).redISub(nt),ot=rt.redIAdd(rt);ot=ot.redIAdd(ot),ot=ot.redIAdd(ot),_=st,$=it.redMul(nt.redISub(st)).redISub(ot),j=this.y.redAdd(this.y)}else{var at=this.x.redSqr(),ut=this.y.redSqr(),ht=ut.redSqr(),yt=this.x.redAdd(ut).redSqr().redISub(at).redISub(ht);yt=yt.redIAdd(yt);var wt=at.redAdd(at).redIAdd(at),Ct=wt.redSqr(),Pt=ht.redIAdd(ht);Pt=Pt.redIAdd(Pt),Pt=Pt.redIAdd(Pt),_=Ct.redISub(yt).redISub(yt),$=wt.redMul(yt.redISub(_)).redISub(Pt),j=this.y.redMul(this.z),j=j.redIAdd(j)}return this.curve.jpoint(_,$,j)};JPoint.prototype._threeDbl=function a(){var _,$,j;if(this.zOne){var et=this.x.redSqr(),tt=this.y.redSqr(),rt=tt.redSqr(),nt=this.x.redAdd(tt).redSqr().redISub(et).redISub(rt);nt=nt.redIAdd(nt);var it=et.redAdd(et).redIAdd(et).redIAdd(this.curve.a),st=it.redSqr().redISub(nt).redISub(nt);_=st;var ot=rt.redIAdd(rt);ot=ot.redIAdd(ot),ot=ot.redIAdd(ot),$=it.redMul(nt.redISub(st)).redISub(ot),j=this.y.redAdd(this.y)}else{var at=this.z.redSqr(),ut=this.y.redSqr(),ht=this.x.redMul(ut),yt=this.x.redSub(at).redMul(this.x.redAdd(at));yt=yt.redAdd(yt).redIAdd(yt);var wt=ht.redIAdd(ht);wt=wt.redIAdd(wt);var Ct=wt.redAdd(wt);_=yt.redSqr().redISub(Ct),j=this.y.redAdd(this.z).redSqr().redISub(ut).redISub(at);var Pt=ut.redSqr();Pt=Pt.redIAdd(Pt),Pt=Pt.redIAdd(Pt),Pt=Pt.redIAdd(Pt),$=yt.redMul(wt.redISub(_)).redISub(Pt)}return this.curve.jpoint(_,$,j)};JPoint.prototype._dbl=function a(){var _=this.curve.a,$=this.x,j=this.y,et=this.z,tt=et.redSqr().redSqr(),rt=$.redSqr(),nt=j.redSqr(),it=rt.redAdd(rt).redIAdd(rt).redIAdd(_.redMul(tt)),st=$.redAdd($);st=st.redIAdd(st);var ot=st.redMul(nt),at=it.redSqr().redISub(ot.redAdd(ot)),ut=ot.redISub(at),ht=nt.redSqr();ht=ht.redIAdd(ht),ht=ht.redIAdd(ht),ht=ht.redIAdd(ht);var yt=it.redMul(ut).redISub(ht),wt=j.redAdd(j).redMul(et);return this.curve.jpoint(at,yt,wt)};JPoint.prototype.trpl=function a(){if(!this.curve.zeroA)return this.dbl().add(this);var _=this.x.redSqr(),$=this.y.redSqr(),j=this.z.redSqr(),et=$.redSqr(),tt=_.redAdd(_).redIAdd(_),rt=tt.redSqr(),nt=this.x.redAdd($).redSqr().redISub(_).redISub(et);nt=nt.redIAdd(nt),nt=nt.redAdd(nt).redIAdd(nt),nt=nt.redISub(rt);var it=nt.redSqr(),st=et.redIAdd(et);st=st.redIAdd(st),st=st.redIAdd(st),st=st.redIAdd(st);var ot=tt.redIAdd(nt).redSqr().redISub(rt).redISub(it).redISub(st),at=$.redMul(ot);at=at.redIAdd(at),at=at.redIAdd(at);var ut=this.x.redMul(it).redISub(at);ut=ut.redIAdd(ut),ut=ut.redIAdd(ut);var ht=this.y.redMul(ot.redMul(st.redISub(ot)).redISub(nt.redMul(it)));ht=ht.redIAdd(ht),ht=ht.redIAdd(ht),ht=ht.redIAdd(ht);var yt=this.z.redAdd(nt).redSqr().redISub(j).redISub(it);return this.curve.jpoint(ut,ht,yt)};JPoint.prototype.mul=function a(_,$){return _=new BN$7(_,$),this.curve._wnafMul(this,_)};JPoint.prototype.eq=function a(_){if(_.type==="affine")return this.eq(_.toJ());if(this===_)return!0;var $=this.z.redSqr(),j=_.z.redSqr();if(this.x.redMul(j).redISub(_.x.redMul($)).cmpn(0)!==0)return!1;var et=$.redMul(this.z),tt=j.redMul(_.z);return this.y.redMul(tt).redISub(_.y.redMul(et)).cmpn(0)===0};JPoint.prototype.eqXToP=function a(_){var $=this.z.redSqr(),j=_.toRed(this.curve.red).redMul($);if(this.x.cmp(j)===0)return!0;for(var et=_.clone(),tt=this.curve.redN.redMul($);;){if(et.iadd(this.curve.n),et.cmp(this.curve.p)>=0)return!1;if(j.redIAdd(tt),this.x.cmp(j)===0)return!0}};JPoint.prototype.inspect=function a(){return this.isInfinity()?"":""};JPoint.prototype.isInfinity=function a(){return this.z.cmpn(0)===0};var BN$6=bnExports$1,inherits$1=inherits_browserExports,Base$1=base,utils$a=utils$d;function MontCurve(a){Base$1.call(this,"mont",a),this.a=new BN$6(a.a,16).toRed(this.red),this.b=new BN$6(a.b,16).toRed(this.red),this.i4=new BN$6(4).toRed(this.red).redInvm(),this.two=new BN$6(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$1(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function a(_){var $=_.normalize().x,j=$.redSqr(),et=j.redMul($).redAdd(j.redMul(this.a)).redAdd($),tt=et.redSqrt();return tt.redSqr().cmp(et)===0};function Point$1(a,_,$){Base$1.BasePoint.call(this,a,"projective"),_===null&&$===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$6(_,16),this.z=new BN$6($,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$1(Point$1,Base$1.BasePoint);MontCurve.prototype.decodePoint=function a(_,$){return this.point(utils$a.toArray(_,$),1)};MontCurve.prototype.point=function a(_,$){return new Point$1(this,_,$)};MontCurve.prototype.pointFromJSON=function a(_){return Point$1.fromJSON(this,_)};Point$1.prototype.precompute=function a(){};Point$1.prototype._encode=function a(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$1.fromJSON=function a(_,$){return new Point$1(_,$[0],$[1]||_.one)};Point$1.prototype.inspect=function a(){return this.isInfinity()?"":""};Point$1.prototype.isInfinity=function a(){return this.z.cmpn(0)===0};Point$1.prototype.dbl=function a(){var _=this.x.redAdd(this.z),$=_.redSqr(),j=this.x.redSub(this.z),et=j.redSqr(),tt=$.redSub(et),rt=$.redMul(et),nt=tt.redMul(et.redAdd(this.curve.a24.redMul(tt)));return this.curve.point(rt,nt)};Point$1.prototype.add=function a(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.diffAdd=function a(_,$){var j=this.x.redAdd(this.z),et=this.x.redSub(this.z),tt=_.x.redAdd(_.z),rt=_.x.redSub(_.z),nt=rt.redMul(j),it=tt.redMul(et),st=$.z.redMul(nt.redAdd(it).redSqr()),ot=$.x.redMul(nt.redISub(it).redSqr());return this.curve.point(st,ot)};Point$1.prototype.mul=function a(_){for(var $=_.clone(),j=this,et=this.curve.point(null,null),tt=this,rt=[];$.cmpn(0)!==0;$.iushrn(1))rt.push($.andln(1));for(var nt=rt.length-1;nt>=0;nt--)rt[nt]===0?(j=j.diffAdd(et,tt),et=et.dbl()):(et=j.diffAdd(et,tt),j=j.dbl());return et};Point$1.prototype.mulAdd=function a(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.jumlAdd=function a(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.eq=function a(_){return this.getX().cmp(_.getX())===0};Point$1.prototype.normalize=function a(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$1.prototype.getX=function a(){return this.normalize(),this.x.fromRed()};var utils$9=utils$d,BN$5=bnExports$1,inherits=inherits_browserExports,Base=base,assert$7=utils$9.assert;function EdwardsCurve(a){this.twisted=(a.a|0)!==1,this.mOneA=this.twisted&&(a.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",a),this.a=new BN$5(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$5(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$5(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$7(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(a.c|0)===1}inherits(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function a(_){return this.mOneA?_.redNeg():this.a.redMul(_)};EdwardsCurve.prototype._mulC=function a(_){return this.oneC?_:this.c.redMul(_)};EdwardsCurve.prototype.jpoint=function a(_,$,j,et){return this.point(_,$,j,et)};EdwardsCurve.prototype.pointFromX=function a(_,$){_=new BN$5(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr(),et=this.c2.redSub(this.a.redMul(j)),tt=this.one.redSub(this.c2.redMul(this.d).redMul(j)),rt=et.redMul(tt.redInvm()),nt=rt.redSqrt();if(nt.redSqr().redSub(rt).cmp(this.zero)!==0)throw new Error("invalid point");var it=nt.fromRed().isOdd();return($&&!it||!$&&it)&&(nt=nt.redNeg()),this.point(_,nt)};EdwardsCurve.prototype.pointFromY=function a(_,$){_=new BN$5(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr(),et=j.redSub(this.c2),tt=j.redMul(this.d).redMul(this.c2).redSub(this.a),rt=et.redMul(tt.redInvm());if(rt.cmp(this.zero)===0){if($)throw new Error("invalid point");return this.point(this.zero,_)}var nt=rt.redSqrt();if(nt.redSqr().redSub(rt).cmp(this.zero)!==0)throw new Error("invalid point");return nt.fromRed().isOdd()!==$&&(nt=nt.redNeg()),this.point(nt,_)};EdwardsCurve.prototype.validate=function a(_){if(_.isInfinity())return!0;_.normalize();var $=_.x.redSqr(),j=_.y.redSqr(),et=$.redMul(this.a).redAdd(j),tt=this.c2.redMul(this.one.redAdd(this.d.redMul($).redMul(j)));return et.cmp(tt)===0};function Point(a,_,$,j,et){Base.BasePoint.call(this,a,"projective"),_===null&&$===null&&j===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$5(_,16),this.y=new BN$5($,16),this.z=j?new BN$5(j,16):this.curve.one,this.t=et&&new BN$5(et,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits(Point,Base.BasePoint);EdwardsCurve.prototype.pointFromJSON=function a(_){return Point.fromJSON(this,_)};EdwardsCurve.prototype.point=function a(_,$,j,et){return new Point(this,_,$,j,et)};Point.fromJSON=function a(_,$){return new Point(_,$[0],$[1],$[2])};Point.prototype.inspect=function a(){return this.isInfinity()?"":""};Point.prototype.isInfinity=function a(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function a(){var _=this.x.redSqr(),$=this.y.redSqr(),j=this.z.redSqr();j=j.redIAdd(j);var et=this.curve._mulA(_),tt=this.x.redAdd(this.y).redSqr().redISub(_).redISub($),rt=et.redAdd($),nt=rt.redSub(j),it=et.redSub($),st=tt.redMul(nt),ot=rt.redMul(it),at=tt.redMul(it),ut=nt.redMul(rt);return this.curve.point(st,ot,ut,at)};Point.prototype._projDbl=function a(){var _=this.x.redAdd(this.y).redSqr(),$=this.x.redSqr(),j=this.y.redSqr(),et,tt,rt,nt,it,st;if(this.curve.twisted){nt=this.curve._mulA($);var ot=nt.redAdd(j);this.zOne?(et=_.redSub($).redSub(j).redMul(ot.redSub(this.curve.two)),tt=ot.redMul(nt.redSub(j)),rt=ot.redSqr().redSub(ot).redSub(ot)):(it=this.z.redSqr(),st=ot.redSub(it).redISub(it),et=_.redSub($).redISub(j).redMul(st),tt=ot.redMul(nt.redSub(j)),rt=ot.redMul(st))}else nt=$.redAdd(j),it=this.curve._mulC(this.z).redSqr(),st=nt.redSub(it).redSub(it),et=this.curve._mulC(_.redISub(nt)).redMul(st),tt=this.curve._mulC(nt).redMul($.redISub(j)),rt=nt.redMul(st);return this.curve.point(et,tt,rt)};Point.prototype.dbl=function a(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point.prototype._extAdd=function a(_){var $=this.y.redSub(this.x).redMul(_.y.redSub(_.x)),j=this.y.redAdd(this.x).redMul(_.y.redAdd(_.x)),et=this.t.redMul(this.curve.dd).redMul(_.t),tt=this.z.redMul(_.z.redAdd(_.z)),rt=j.redSub($),nt=tt.redSub(et),it=tt.redAdd(et),st=j.redAdd($),ot=rt.redMul(nt),at=it.redMul(st),ut=rt.redMul(st),ht=nt.redMul(it);return this.curve.point(ot,at,ht,ut)};Point.prototype._projAdd=function a(_){var $=this.z.redMul(_.z),j=$.redSqr(),et=this.x.redMul(_.x),tt=this.y.redMul(_.y),rt=this.curve.d.redMul(et).redMul(tt),nt=j.redSub(rt),it=j.redAdd(rt),st=this.x.redAdd(this.y).redMul(_.x.redAdd(_.y)).redISub(et).redISub(tt),ot=$.redMul(nt).redMul(st),at,ut;return this.curve.twisted?(at=$.redMul(it).redMul(tt.redSub(this.curve._mulA(et))),ut=nt.redMul(it)):(at=$.redMul(it).redMul(tt.redSub(et)),ut=this.curve._mulC(nt).redMul(it)),this.curve.point(ot,at,ut)};Point.prototype.add=function a(_){return this.isInfinity()?_:_.isInfinity()?this:this.curve.extended?this._extAdd(_):this._projAdd(_)};Point.prototype.mul=function a(_){return this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve._wnafMul(this,_)};Point.prototype.mulAdd=function a(_,$,j){return this.curve._wnafMulAdd(1,[this,$],[_,j],2,!1)};Point.prototype.jmulAdd=function a(_,$,j){return this.curve._wnafMulAdd(1,[this,$],[_,j],2,!0)};Point.prototype.normalize=function a(){if(this.zOne)return this;var _=this.z.redInvm();return this.x=this.x.redMul(_),this.y=this.y.redMul(_),this.t&&(this.t=this.t.redMul(_)),this.z=this.curve.one,this.zOne=!0,this};Point.prototype.neg=function a(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function a(){return this.normalize(),this.x.fromRed()};Point.prototype.getY=function a(){return this.normalize(),this.y.fromRed()};Point.prototype.eq=function a(_){return this===_||this.getX().cmp(_.getX())===0&&this.getY().cmp(_.getY())===0};Point.prototype.eqXToP=function a(_){var $=_.toRed(this.curve.red).redMul(this.z);if(this.x.cmp($)===0)return!0;for(var j=_.clone(),et=this.curve.redN.redMul(this.z);;){if(j.iadd(this.curve.n),j.cmp(this.curve.p)>=0)return!1;if($.redIAdd(et),this.x.cmp($)===0)return!0}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;(function(a){var _=a;_.base=base,_.short=short,_.mont=mont,_.edwards=edwards})(curve);var curves$2={},secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}(function(a){var _=a,$=hash$4,j=curve,et=utils$d,tt=et.assert;function rt(st){st.type==="short"?this.curve=new j.short(st):st.type==="edwards"?this.curve=new j.edwards(st):this.curve=new j.mont(st),this.g=this.curve.g,this.n=this.curve.n,this.hash=st.hash,tt(this.g.validate(),"Invalid curve"),tt(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}_.PresetCurve=rt;function nt(st,ot){Object.defineProperty(_,st,{configurable:!0,enumerable:!0,get:function(){var at=new rt(ot);return Object.defineProperty(_,st,{configurable:!0,enumerable:!0,value:at}),at}})}nt("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:$.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),nt("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:$.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),nt("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:$.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),nt("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:$.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),nt("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:$.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),nt("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$.sha256,gRed:!1,g:["9"]}),nt("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var it;try{it=requireSecp256k1()}catch{it=void 0}nt("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:$.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",it]})})(curves$2);var BN$4=bnExports$1,utils$8=utils$d,assert$6=utils$8.assert;function KeyPair$3(a,_){this.ec=a,this.priv=null,this.pub=null,_.priv&&this._importPrivate(_.priv,_.privEnc),_.pub&&this._importPublic(_.pub,_.pubEnc)}var key$1=KeyPair$3;KeyPair$3.fromPublic=function a(_,$,j){return $ instanceof KeyPair$3?$:new KeyPair$3(_,{pub:$,pubEnc:j})};KeyPair$3.fromPrivate=function a(_,$,j){return $ instanceof KeyPair$3?$:new KeyPair$3(_,{priv:$,privEnc:j})};KeyPair$3.prototype.validate=function a(){var _=this.getPublic();return _.isInfinity()?{result:!1,reason:"Invalid public key"}:_.validate()?_.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};KeyPair$3.prototype.getPublic=function a(_,$){return typeof _=="string"&&($=_,_=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),$?this.pub.encode($,_):this.pub};KeyPair$3.prototype.getPrivate=function a(_){return _==="hex"?this.priv.toString(16,2):this.priv};KeyPair$3.prototype._importPrivate=function a(_,$){this.priv=new BN$4(_,$||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair$3.prototype._importPublic=function a(_,$){if(_.x||_.y){this.ec.curve.type==="mont"?assert$6(_.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$6(_.x&&_.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(_.x,_.y);return}this.pub=this.ec.curve.decodePoint(_,$)};KeyPair$3.prototype.derive=function a(_){return _.validate()||assert$6(_.validate(),"public point not validated"),_.mul(this.priv).getX()};KeyPair$3.prototype.sign=function a(_,$,j){return this.ec.sign(_,this,$,j)};KeyPair$3.prototype.verify=function a(_,$){return this.ec.verify(_,$,this)};KeyPair$3.prototype.inspect=function a(){return""};var BN$3=bnExports$1,utils$7=utils$d,assert$5=utils$7.assert;function Signature$3(a,_){if(a instanceof Signature$3)return a;this._importDER(a,_)||(assert$5(a.r&&a.s,"Signature without r or s"),this.r=new BN$3(a.r,16),this.s=new BN$3(a.s,16),a.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=a.recoveryParam)}var signature$1=Signature$3;function Position(){this.place=0}function getLength(a,_){var $=a[_.place++];if(!($&128))return $;var j=$&15;if(j===0||j>4)return!1;for(var et=0,tt=0,rt=_.place;tt>>=0;return et<=127?!1:(_.place=rt,et)}function rmPadding(a){for(var _=0,$=a.length-1;!a[_]&&!(a[_+1]&128)&&_<$;)_++;return _===0?a:a.slice(_)}Signature$3.prototype._importDER=function a(_,$){_=utils$7.toArray(_,$);var j=new Position;if(_[j.place++]!==48)return!1;var et=getLength(_,j);if(et===!1||et+j.place!==_.length||_[j.place++]!==2)return!1;var tt=getLength(_,j);if(tt===!1)return!1;var rt=_.slice(j.place,tt+j.place);if(j.place+=tt,_[j.place++]!==2)return!1;var nt=getLength(_,j);if(nt===!1||_.length!==nt+j.place)return!1;var it=_.slice(j.place,nt+j.place);if(rt[0]===0)if(rt[1]&128)rt=rt.slice(1);else return!1;if(it[0]===0)if(it[1]&128)it=it.slice(1);else return!1;return this.r=new BN$3(rt),this.s=new BN$3(it),this.recoveryParam=null,!0};function constructLength(a,_){if(_<128){a.push(_);return}var $=1+(Math.log(_)/Math.LN2>>>3);for(a.push($|128);--$;)a.push(_>>>($<<3)&255);a.push(_)}Signature$3.prototype.toDER=function a(_){var $=this.r.toArray(),j=this.s.toArray();for($[0]&128&&($=[0].concat($)),j[0]&128&&(j=[0].concat(j)),$=rmPadding($),j=rmPadding(j);!j[0]&&!(j[1]&128);)j=j.slice(1);var et=[2];constructLength(et,$.length),et=et.concat($),et.push(2),constructLength(et,j.length);var tt=et.concat(j),rt=[48];return constructLength(rt,tt.length),rt=rt.concat(tt),utils$7.encode(rt,_)};var BN$2=bnExports$1,HmacDRBG=hmacDrbg,utils$6=utils$d,curves$1=curves$2,rand=requireBrorand(),assert$4=utils$6.assert,KeyPair$2=key$1,Signature$2=signature$1;function EC(a){if(!(this instanceof EC))return new EC(a);typeof a=="string"&&(assert$4(Object.prototype.hasOwnProperty.call(curves$1,a),"Unknown curve "+a),a=curves$1[a]),a instanceof curves$1.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),this.hash=a.hash||a.curve.hash}var ec$3=EC;EC.prototype.keyPair=function a(_){return new KeyPair$2(this,_)};EC.prototype.keyFromPrivate=function a(_,$){return KeyPair$2.fromPrivate(this,_,$)};EC.prototype.keyFromPublic=function a(_,$){return KeyPair$2.fromPublic(this,_,$)};EC.prototype.genKeyPair=function a(_){_||(_={});for(var $=new HmacDRBG({hash:this.hash,pers:_.pers,persEnc:_.persEnc||"utf8",entropy:_.entropy||rand(this.hash.hmacStrength),entropyEnc:_.entropy&&_.entropyEnc||"utf8",nonce:this.n.toArray()}),j=this.n.byteLength(),et=this.n.sub(new BN$2(2));;){var tt=new BN$2($.generate(j));if(!(tt.cmp(et)>0))return tt.iaddn(1),this.keyFromPrivate(tt)}};EC.prototype._truncateToN=function a(_,$){var j=_.byteLength()*8-this.n.bitLength();return j>0&&(_=_.ushrn(j)),!$&&_.cmp(this.n)>=0?_.sub(this.n):_};EC.prototype.sign=function a(_,$,j,et){typeof j=="object"&&(et=j,j=null),et||(et={}),$=this.keyFromPrivate($,j),_=this._truncateToN(new BN$2(_,16));for(var tt=this.n.byteLength(),rt=$.getPrivate().toArray("be",tt),nt=_.toArray("be",tt),it=new HmacDRBG({hash:this.hash,entropy:rt,nonce:nt,pers:et.pers,persEnc:et.persEnc||"utf8"}),st=this.n.sub(new BN$2(1)),ot=0;;ot++){var at=et.k?et.k(ot):new BN$2(it.generate(this.n.byteLength()));if(at=this._truncateToN(at,!0),!(at.cmpn(1)<=0||at.cmp(st)>=0)){var ut=this.g.mul(at);if(!ut.isInfinity()){var ht=ut.getX(),yt=ht.umod(this.n);if(yt.cmpn(0)!==0){var wt=at.invm(this.n).mul(yt.mul($.getPrivate()).iadd(_));if(wt=wt.umod(this.n),wt.cmpn(0)!==0){var Ct=(ut.getY().isOdd()?1:0)|(ht.cmp(yt)!==0?2:0);return et.canonical&&wt.cmp(this.nh)>0&&(wt=this.n.sub(wt),Ct^=1),new Signature$2({r:yt,s:wt,recoveryParam:Ct})}}}}}};EC.prototype.verify=function a(_,$,j,et){_=this._truncateToN(new BN$2(_,16)),j=this.keyFromPublic(j,et),$=new Signature$2($,"hex");var tt=$.r,rt=$.s;if(tt.cmpn(1)<0||tt.cmp(this.n)>=0||rt.cmpn(1)<0||rt.cmp(this.n)>=0)return!1;var nt=rt.invm(this.n),it=nt.mul(_).umod(this.n),st=nt.mul(tt).umod(this.n),ot;return this.curve._maxwellTrick?(ot=this.g.jmulAdd(it,j.getPublic(),st),ot.isInfinity()?!1:ot.eqXToP(tt)):(ot=this.g.mulAdd(it,j.getPublic(),st),ot.isInfinity()?!1:ot.getX().umod(this.n).cmp(tt)===0)};EC.prototype.recoverPubKey=function(a,_,$,j){assert$4((3&$)===$,"The recovery param is more than two bits"),_=new Signature$2(_,j);var et=this.n,tt=new BN$2(a),rt=_.r,nt=_.s,it=$&1,st=$>>1;if(rt.cmp(this.curve.p.umod(this.curve.n))>=0&&st)throw new Error("Unable to find sencond key candinate");st?rt=this.curve.pointFromX(rt.add(this.curve.n),it):rt=this.curve.pointFromX(rt,it);var ot=_.r.invm(et),at=et.sub(tt).mul(ot).umod(et),ut=nt.mul(ot).umod(et);return this.g.mulAdd(at,rt,ut)};EC.prototype.getKeyRecoveryParam=function(a,_,$,j){if(_=new Signature$2(_,j),_.recoveryParam!==null)return _.recoveryParam;for(var et=0;et<4;et++){var tt;try{tt=this.recoverPubKey(a,_,et)}catch{continue}if(tt.eq($))return et}throw new Error("Unable to find valid recovery factor")};var utils$5=utils$d,assert$3=utils$5.assert,parseBytes$3=utils$5.parseBytes,cachedProperty$1=utils$5.cachedProperty;function KeyPair$1(a,_){this.eddsa=a,this._secret=parseBytes$3(_.secret),a.isPoint(_.pub)?this._pub=_.pub:this._pubBytes=parseBytes$3(_.pub)}KeyPair$1.fromPublic=function a(_,$){return $ instanceof KeyPair$1?$:new KeyPair$1(_,{pub:$})};KeyPair$1.fromSecret=function a(_,$){return $ instanceof KeyPair$1?$:new KeyPair$1(_,{secret:$})};KeyPair$1.prototype.secret=function a(){return this._secret};cachedProperty$1(KeyPair$1,"pubBytes",function a(){return this.eddsa.encodePoint(this.pub())});cachedProperty$1(KeyPair$1,"pub",function a(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$1(KeyPair$1,"privBytes",function a(){var _=this.eddsa,$=this.hash(),j=_.encodingLength-1,et=$.slice(0,_.encodingLength);return et[0]&=248,et[j]&=127,et[j]|=64,et});cachedProperty$1(KeyPair$1,"priv",function a(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$1(KeyPair$1,"hash",function a(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$1(KeyPair$1,"messagePrefix",function a(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$1.prototype.sign=function a(_){return assert$3(this._secret,"KeyPair can only verify"),this.eddsa.sign(_,this)};KeyPair$1.prototype.verify=function a(_,$){return this.eddsa.verify(_,$,this)};KeyPair$1.prototype.getSecret=function a(_){return assert$3(this._secret,"KeyPair is public only"),utils$5.encode(this.secret(),_)};KeyPair$1.prototype.getPublic=function a(_){return utils$5.encode(this.pubBytes(),_)};var key=KeyPair$1,BN$1=bnExports$1,utils$4=utils$d,assert$2=utils$4.assert,cachedProperty=utils$4.cachedProperty,parseBytes$2=utils$4.parseBytes;function Signature$1(a,_){this.eddsa=a,typeof _!="object"&&(_=parseBytes$2(_)),Array.isArray(_)&&(_={R:_.slice(0,a.encodingLength),S:_.slice(a.encodingLength)}),assert$2(_.R&&_.S,"Signature without R or S"),a.isPoint(_.R)&&(this._R=_.R),_.S instanceof BN$1&&(this._S=_.S),this._Rencoded=Array.isArray(_.R)?_.R:_.Rencoded,this._Sencoded=Array.isArray(_.S)?_.S:_.Sencoded}cachedProperty(Signature$1,"S",function a(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature$1,"R",function a(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature$1,"Rencoded",function a(){return this.eddsa.encodePoint(this.R())});cachedProperty(Signature$1,"Sencoded",function a(){return this.eddsa.encodeInt(this.S())});Signature$1.prototype.toBytes=function a(){return this.Rencoded().concat(this.Sencoded())};Signature$1.prototype.toHex=function a(){return utils$4.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash$1=hash$4,curves=curves$2,utils$3=utils$d,assert$1=utils$3.assert,parseBytes$1=utils$3.parseBytes,KeyPair=key,Signature=signature;function EDDSA(a){if(assert$1(a==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(a);a=curves[a].curve,this.curve=a,this.g=a.g,this.g.precompute(a.n.bitLength()+1),this.pointClass=a.point().constructor,this.encodingLength=Math.ceil(a.n.bitLength()/8),this.hash=hash$1.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function a(_,$){_=parseBytes$1(_);var j=this.keyFromSecret($),et=this.hashInt(j.messagePrefix(),_),tt=this.g.mul(et),rt=this.encodePoint(tt),nt=this.hashInt(rt,j.pubBytes(),_).mul(j.priv()),it=et.add(nt).umod(this.curve.n);return this.makeSignature({R:tt,S:it,Rencoded:rt})};EDDSA.prototype.verify=function a(_,$,j){_=parseBytes$1(_),$=this.makeSignature($);var et=this.keyFromPublic(j),tt=this.hashInt($.Rencoded(),et.pubBytes(),_),rt=this.g.mul($.S()),nt=$.R().add(et.pub().mul(tt));return nt.eq(rt)};EDDSA.prototype.hashInt=function a(){for(var _=this.hash(),$=0;$bs58check$1.decode(a).slice(_.length);function b58decode(a){const _=bs58check$1.decode(a),j={[prefix.tz1.toString()]:"0000",[prefix.tz2.toString()]:"0001",[prefix.tz3.toString()]:"0002"}[new Uint8Array(_.slice(0,3)).toString()];if(j){const et=buf2hex(_.slice(3));return j+et}else return"01"+buf2hex(_.slice(3,42))+"00"}function encodeAddress(a){if(a.substring(0,2)==="0x"&&(a=a.slice(2)),a.substring(0,2)==="00"){const _={"0000":prefix.tz1,"0001":prefix.tz2,"0002":prefix.tz3};return b58cencode(a.substring(4),_[a.substring(0,4)])}return b58cencode(a.substring(2,42),prefix.KT)}function encodeKey(a){if(a[0]==="0"){const _={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return b58cencode(a.substring(2),_[a.substring(0,2)])}}function encodeKeyHash(a){if(a[0]==="0"){const _={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return b58cencode(a.substring(2),_[a.substring(0,2)])}}const hex2buf=a=>{if(a.length%2!==0)throw new InvalidHexStringError(a,": Expecting even number of characters");const _=stripHexPrefix$1(a);if(!_.match(/^([\da-f]{2})*$/gi))throw new InvalidHexStringError(a,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const $=new Uint8Array(_.length/2);let j=0;for(let et=0;et<_.length;et+=2){const tt=parseInt(_.slice(et,et+2),16);if(Number.isNaN(tt))throw new ValueConversionError(a,"Uint8Array");$[j++]=tt}return $},mergebuf=(a,_)=>{const $=new Uint8Array(a.length+_.length);return $.set(a),$.set(_,a.length),$},buf2hex=a=>{const _=[];return a.forEach($=>{const et=`00${$.toString(16)}`.slice(-2);_.push(et)}),_.join("")};function hex2Bytes(a){const _=stripHexPrefix$1(a);if(!_.match(/^(0x)?([\da-f]{2})*$/gi))throw new InvalidHexStringError(a,": Expecting even number of characters: 0-9, a-z, A-Z, optionally prefixed with 0x");return buffer$1.Buffer.from(_,"hex")}function stripHexPrefix$1(a){return a.startsWith("0x")?a.slice(2):a}var util;(function(a){a.assertEqual=et=>et;function _(et){}a.assertIs=_;function $(et){throw new Error}a.assertNever=$,a.arrayToEnum=et=>{const tt={};for(const rt of et)tt[rt]=rt;return tt},a.getValidEnumValues=et=>{const tt=a.objectKeys(et).filter(nt=>typeof et[et[nt]]!="number"),rt={};for(const nt of tt)rt[nt]=et[nt];return a.objectValues(rt)},a.objectValues=et=>a.objectKeys(et).map(function(tt){return et[tt]}),a.objectKeys=typeof Object.keys=="function"?et=>Object.keys(et):et=>{const tt=[];for(const rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&tt.push(rt);return tt},a.find=(et,tt)=>{for(const rt of et)if(tt(rt))return rt},a.isInteger=typeof Number.isInteger=="function"?et=>Number.isInteger(et):et=>typeof et=="number"&&isFinite(et)&&Math.floor(et)===et;function j(et,tt=" | "){return et.map(rt=>typeof rt=="string"?`'${rt}'`:rt).join(tt)}a.joinValues=j,a.jsonStringifyReplacer=(et,tt)=>typeof tt=="bigint"?tt.toString():tt})(util||(util={}));var objectUtil;(function(a){a.mergeShapes=(_,$)=>({..._,...$})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=a=>{switch(typeof a){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(a)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(a)?ZodParsedType.array:a===null?ZodParsedType.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&a instanceof Map?ZodParsedType.map:typeof Set<"u"&&a instanceof Set?ZodParsedType.set:typeof Date<"u"&&a instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.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"]),quotelessJson=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(_){super(),this.issues=[],this.addIssue=j=>{this.issues=[...this.issues,j]},this.addIssues=(j=[])=>{this.issues=[...this.issues,...j]};const $=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,$):this.__proto__=$,this.name="ZodError",this.issues=_}get errors(){return this.issues}format(_){const $=_||function(tt){return tt.message},j={_errors:[]},et=tt=>{for(const rt of tt.issues)if(rt.code==="invalid_union")rt.unionErrors.map(et);else if(rt.code==="invalid_return_type")et(rt.returnTypeError);else if(rt.code==="invalid_arguments")et(rt.argumentsError);else if(rt.path.length===0)j._errors.push($(rt));else{let nt=j,it=0;for(;it$.message){const $={},j=[];for(const et of this.issues)et.path.length>0?($[et.path[0]]=$[et.path[0]]||[],$[et.path[0]].push(_(et))):j.push(_(et));return{formErrors:j,fieldErrors:$}}get formErrors(){return this.flatten()}}ZodError.create=a=>new ZodError(a);const errorMap=(a,_)=>{let $;switch(a.code){case ZodIssueCode.invalid_type:a.received===ZodParsedType.undefined?$="Required":$=`Expected ${a.expected}, received ${a.received}`;break;case ZodIssueCode.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(a.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:$=`Unrecognized key(s) in object: ${util.joinValues(a.keys,", ")}`;break;case ZodIssueCode.invalid_union:$="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${util.joinValues(a.options)}`;break;case ZodIssueCode.invalid_enum_value:$=`Invalid enum value. Expected ${util.joinValues(a.options)}, received '${a.received}'`;break;case ZodIssueCode.invalid_arguments:$="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:$="Invalid function return type";break;case ZodIssueCode.invalid_date:$="Invalid date";break;case ZodIssueCode.invalid_string:typeof a.validation=="object"?"includes"in a.validation?($=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&($=`${$} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?$=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?$=`Invalid input: must end with "${a.validation.endsWith}"`:util.assertNever(a.validation):a.validation!=="regex"?$=`Invalid ${a.validation}`:$="Invalid";break;case ZodIssueCode.too_small:a.type==="array"?$=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?$=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?$=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?$=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:$="Invalid input";break;case ZodIssueCode.too_big:a.type==="array"?$=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?$=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?$=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?$=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?$=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:$="Invalid input";break;case ZodIssueCode.custom:$="Invalid input";break;case ZodIssueCode.invalid_intersection_types:$="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:$=`Number must be a multiple of ${a.multipleOf}`;break;case ZodIssueCode.not_finite:$="Number must be finite";break;default:$=_.defaultError,util.assertNever(a)}return{message:$}};let overrideErrorMap=errorMap;function setErrorMap(a){overrideErrorMap=a}function getErrorMap(){return overrideErrorMap}const makeIssue=a=>{const{data:_,path:$,errorMaps:j,issueData:et}=a,tt=[...$,...et.path||[]],rt={...et,path:tt};if(et.message!==void 0)return{...et,path:tt,message:et.message};let nt="";const it=j.filter(st=>!!st).slice().reverse();for(const st of it)nt=st(rt,{data:_,defaultError:nt}).message;return{...et,path:tt,message:nt}},EMPTY_PATH=[];function addIssueToContext(a,_){const $=getErrorMap(),j=makeIssue({issueData:_,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,$,$===errorMap?void 0:errorMap].filter(et=>!!et)});a.common.issues.push(j)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(_,$){const j=[];for(const et of $){if(et.status==="aborted")return INVALID;et.status==="dirty"&&_.dirty(),j.push(et.value)}return{status:_.value,value:j}}static async mergeObjectAsync(_,$){const j=[];for(const et of $){const tt=await et.key,rt=await et.value;j.push({key:tt,value:rt})}return ParseStatus.mergeObjectSync(_,j)}static mergeObjectSync(_,$){const j={};for(const et of $){const{key:tt,value:rt}=et;if(tt.status==="aborted"||rt.status==="aborted")return INVALID;tt.status==="dirty"&&_.dirty(),rt.status==="dirty"&&_.dirty(),tt.value!=="__proto__"&&(typeof rt.value<"u"||et.alwaysSet)&&(j[tt.value]=rt.value)}return{status:_.value,value:j}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=a=>({status:"dirty",value:a}),OK=a=>({status:"valid",value:a}),isAborted=a=>a.status==="aborted",isDirty=a=>a.status==="dirty",isValid$1=a=>a.status==="valid",isAsync=a=>typeof Promise<"u"&&a instanceof Promise;function __classPrivateFieldGet$1(a,_,$,j){if(typeof _=="function"?a!==_||!j:!_.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return _.get(a)}function __classPrivateFieldSet$1(a,_,$,j,et){if(typeof _=="function"?a!==_||!et:!_.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return _.set(a,$),$}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(a){a.errToObj=_=>typeof _=="string"?{message:_}:_||{},a.toString=_=>typeof _=="string"?_:_==null?void 0:_.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(_,$,j,et){this._cachedPath=[],this.parent=_,this.data=$,this._path=j,this._key=et}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}}const handleResult=(a,_)=>{if(isValid$1(_))return{success:!0,data:_.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const $=new ZodError(a.common.issues);return this._error=$,this._error}}};function processCreateParams(a){if(!a)return{};const{errorMap:_,invalid_type_error:$,required_error:j,description:et}=a;if(_&&($||j))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return _?{errorMap:_,description:et}:{errorMap:(rt,nt)=>{var it,st;const{message:ot}=a;return rt.code==="invalid_enum_value"?{message:ot??nt.defaultError}:typeof nt.data>"u"?{message:(it=ot??j)!==null&&it!==void 0?it:nt.defaultError}:rt.code!=="invalid_type"?{message:nt.defaultError}:{message:(st=ot??$)!==null&&st!==void 0?st:nt.defaultError}},description:et}}class ZodType{constructor(_){this.spa=this.safeParseAsync,this._def=_,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(_){return getParsedType(_.data)}_getOrReturnCtx(_,$){return $||{common:_.parent.common,data:_.data,parsedType:getParsedType(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}_processInputParams(_){return{status:new ParseStatus,ctx:{common:_.parent.common,data:_.data,parsedType:getParsedType(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}}_parseSync(_){const $=this._parse(_);if(isAsync($))throw new Error("Synchronous parse encountered promise.");return $}_parseAsync(_){const $=this._parse(_);return Promise.resolve($)}parse(_,$){const j=this.safeParse(_,$);if(j.success)return j.data;throw j.error}safeParse(_,$){var j;const et={common:{issues:[],async:(j=$==null?void 0:$.async)!==null&&j!==void 0?j:!1,contextualErrorMap:$==null?void 0:$.errorMap},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:getParsedType(_)},tt=this._parseSync({data:_,path:et.path,parent:et});return handleResult(et,tt)}async parseAsync(_,$){const j=await this.safeParseAsync(_,$);if(j.success)return j.data;throw j.error}async safeParseAsync(_,$){const j={common:{issues:[],contextualErrorMap:$==null?void 0:$.errorMap,async:!0},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:getParsedType(_)},et=this._parse({data:_,path:j.path,parent:j}),tt=await(isAsync(et)?et:Promise.resolve(et));return handleResult(j,tt)}refine(_,$){const j=et=>typeof $=="string"||typeof $>"u"?{message:$}:typeof $=="function"?$(et):$;return this._refinement((et,tt)=>{const rt=_(et),nt=()=>tt.addIssue({code:ZodIssueCode.custom,...j(et)});return typeof Promise<"u"&&rt instanceof Promise?rt.then(it=>it?!0:(nt(),!1)):rt?!0:(nt(),!1)})}refinement(_,$){return this._refinement((j,et)=>_(j)?!0:(et.addIssue(typeof $=="function"?$(j,et):$),!1))}_refinement(_){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:_}})}superRefine(_){return this._refinement(_)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(_){return ZodUnion.create([this,_],this._def)}and(_){return ZodIntersection.create(this,_,this._def)}transform(_){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:_}})}default(_){const $=typeof _=="function"?_:()=>_;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:$,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(_){const $=typeof _=="function"?_:()=>_;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:$,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(_){const $=this.constructor;return new $({...this._def,description:_})}pipe(_){return ZodPipeline.create(this,_)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[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,nanoidRegex=/^[a-z0-9_-]{21}$/i,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6Regex=/^(([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})))$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(a){let _="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return a.precision?_=`${_}\\.\\d{${a.precision}}`:a.precision==null&&(_=`${_}(\\.\\d+)?`),_}function timeRegex(a){return new RegExp(`^${timeRegexSource(a)}$`)}function datetimeRegex(a){let _=`${dateRegexSource}T${timeRegexSource(a)}`;const $=[];return $.push(a.local?"Z?":"Z"),a.offset&&$.push("([+-]\\d{2}:?\\d{2})"),_=`${_}(${$.join("|")})`,new RegExp(`^${_}$`)}function isValidIP(a,_){return!!((_==="v4"||!_)&&ipv4Regex.test(a)||(_==="v6"||!_)&&ipv6Regex.test(a))}class ZodString extends ZodType{_parse(_){if(this._def.coerce&&(_.data=String(_.data)),this._getType(_)!==ZodParsedType.string){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:tt.parsedType}),INVALID}const j=new ParseStatus;let et;for(const tt of this._def.checks)if(tt.kind==="min")_.data.lengthtt.value&&(et=this._getOrReturnCtx(_,et),addIssueToContext(et,{code:ZodIssueCode.too_big,maximum:tt.value,type:"string",inclusive:!0,exact:!1,message:tt.message}),j.dirty());else if(tt.kind==="length"){const rt=_.data.length>tt.value,nt=_.data.length_.test(et),{validation:$,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(j)})}_addCheck(_){return new ZodString({...this._def,checks:[...this._def.checks,_]})}email(_){return this._addCheck({kind:"email",...errorUtil.errToObj(_)})}url(_){return this._addCheck({kind:"url",...errorUtil.errToObj(_)})}emoji(_){return this._addCheck({kind:"emoji",...errorUtil.errToObj(_)})}uuid(_){return this._addCheck({kind:"uuid",...errorUtil.errToObj(_)})}nanoid(_){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(_)})}cuid(_){return this._addCheck({kind:"cuid",...errorUtil.errToObj(_)})}cuid2(_){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(_)})}ulid(_){return this._addCheck({kind:"ulid",...errorUtil.errToObj(_)})}base64(_){return this._addCheck({kind:"base64",...errorUtil.errToObj(_)})}ip(_){return this._addCheck({kind:"ip",...errorUtil.errToObj(_)})}datetime(_){var $,j;return typeof _=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:_}):this._addCheck({kind:"datetime",precision:typeof(_==null?void 0:_.precision)>"u"?null:_==null?void 0:_.precision,offset:($=_==null?void 0:_.offset)!==null&&$!==void 0?$:!1,local:(j=_==null?void 0:_.local)!==null&&j!==void 0?j:!1,...errorUtil.errToObj(_==null?void 0:_.message)})}date(_){return this._addCheck({kind:"date",message:_})}time(_){return typeof _=="string"?this._addCheck({kind:"time",precision:null,message:_}):this._addCheck({kind:"time",precision:typeof(_==null?void 0:_.precision)>"u"?null:_==null?void 0:_.precision,...errorUtil.errToObj(_==null?void 0:_.message)})}duration(_){return this._addCheck({kind:"duration",...errorUtil.errToObj(_)})}regex(_,$){return this._addCheck({kind:"regex",regex:_,...errorUtil.errToObj($)})}includes(_,$){return this._addCheck({kind:"includes",value:_,position:$==null?void 0:$.position,...errorUtil.errToObj($==null?void 0:$.message)})}startsWith(_,$){return this._addCheck({kind:"startsWith",value:_,...errorUtil.errToObj($)})}endsWith(_,$){return this._addCheck({kind:"endsWith",value:_,...errorUtil.errToObj($)})}min(_,$){return this._addCheck({kind:"min",value:_,...errorUtil.errToObj($)})}max(_,$){return this._addCheck({kind:"max",value:_,...errorUtil.errToObj($)})}length(_,$){return this._addCheck({kind:"length",value:_,...errorUtil.errToObj($)})}nonempty(_){return this.min(1,errorUtil.errToObj(_))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(_=>_.kind==="datetime")}get isDate(){return!!this._def.checks.find(_=>_.kind==="date")}get isTime(){return!!this._def.checks.find(_=>_.kind==="time")}get isDuration(){return!!this._def.checks.find(_=>_.kind==="duration")}get isEmail(){return!!this._def.checks.find(_=>_.kind==="email")}get isURL(){return!!this._def.checks.find(_=>_.kind==="url")}get isEmoji(){return!!this._def.checks.find(_=>_.kind==="emoji")}get isUUID(){return!!this._def.checks.find(_=>_.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(_=>_.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(_=>_.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(_=>_.kind==="cuid2")}get isULID(){return!!this._def.checks.find(_=>_.kind==="ulid")}get isIP(){return!!this._def.checks.find(_=>_.kind==="ip")}get isBase64(){return!!this._def.checks.find(_=>_.kind==="base64")}get minLength(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxLength(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}}ZodString.create=a=>{var _;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(_=a==null?void 0:a.coerce)!==null&&_!==void 0?_:!1,...processCreateParams(a)})};function floatSafeRemainder(a,_){const $=(a.toString().split(".")[1]||"").length,j=(_.toString().split(".")[1]||"").length,et=$>j?$:j,tt=parseInt(a.toFixed(et).replace(".","")),rt=parseInt(_.toFixed(et).replace(".",""));return tt%rt/Math.pow(10,et)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(_){if(this._def.coerce&&(_.data=Number(_.data)),this._getType(_)!==ZodParsedType.number){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:tt.parsedType}),INVALID}let j;const et=new ParseStatus;for(const tt of this._def.checks)tt.kind==="int"?util.isInteger(_.data)||(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:tt.message}),et.dirty()):tt.kind==="min"?(tt.inclusive?_.datatt.value:_.data>=tt.value)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:tt.value,type:"number",inclusive:tt.inclusive,exact:!1,message:tt.message}),et.dirty()):tt.kind==="multipleOf"?floatSafeRemainder(_.data,tt.value)!==0&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:tt.value,message:tt.message}),et.dirty()):tt.kind==="finite"?Number.isFinite(_.data)||(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_finite,message:tt.message}),et.dirty()):util.assertNever(tt);return{status:et.value,value:_.data}}gte(_,$){return this.setLimit("min",_,!0,errorUtil.toString($))}gt(_,$){return this.setLimit("min",_,!1,errorUtil.toString($))}lte(_,$){return this.setLimit("max",_,!0,errorUtil.toString($))}lt(_,$){return this.setLimit("max",_,!1,errorUtil.toString($))}setLimit(_,$,j,et){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:_,value:$,inclusive:j,message:errorUtil.toString(et)}]})}_addCheck(_){return new ZodNumber({...this._def,checks:[...this._def.checks,_]})}int(_){return this._addCheck({kind:"int",message:errorUtil.toString(_)})}positive(_){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(_)})}negative(_){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(_)})}multipleOf(_,$){return this._addCheck({kind:"multipleOf",value:_,message:errorUtil.toString($)})}finite(_){return this._addCheck({kind:"finite",message:errorUtil.toString(_)})}safe(_){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(_)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(_)})}get minValue(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxValue(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}get isInt(){return!!this._def.checks.find(_=>_.kind==="int"||_.kind==="multipleOf"&&util.isInteger(_.value))}get isFinite(){let _=null,$=null;for(const j of this._def.checks){if(j.kind==="finite"||j.kind==="int"||j.kind==="multipleOf")return!0;j.kind==="min"?($===null||j.value>$)&&($=j.value):j.kind==="max"&&(_===null||j.value<_)&&(_=j.value)}return Number.isFinite($)&&Number.isFinite(_)}}ZodNumber.create=a=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1,...processCreateParams(a)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(_){if(this._def.coerce&&(_.data=BigInt(_.data)),this._getType(_)!==ZodParsedType.bigint){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:tt.parsedType}),INVALID}let j;const et=new ParseStatus;for(const tt of this._def.checks)tt.kind==="min"?(tt.inclusive?_.datatt.value:_.data>=tt.value)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.too_big,type:"bigint",maximum:tt.value,inclusive:tt.inclusive,message:tt.message}),et.dirty()):tt.kind==="multipleOf"?_.data%tt.value!==BigInt(0)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:tt.value,message:tt.message}),et.dirty()):util.assertNever(tt);return{status:et.value,value:_.data}}gte(_,$){return this.setLimit("min",_,!0,errorUtil.toString($))}gt(_,$){return this.setLimit("min",_,!1,errorUtil.toString($))}lte(_,$){return this.setLimit("max",_,!0,errorUtil.toString($))}lt(_,$){return this.setLimit("max",_,!1,errorUtil.toString($))}setLimit(_,$,j,et){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:_,value:$,inclusive:j,message:errorUtil.toString(et)}]})}_addCheck(_){return new ZodBigInt({...this._def,checks:[...this._def.checks,_]})}positive(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(_)})}negative(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(_)})}multipleOf(_,$){return this._addCheck({kind:"multipleOf",value:_,message:errorUtil.toString($)})}get minValue(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxValue(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}}ZodBigInt.create=a=>{var _;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(_=a==null?void 0:a.coerce)!==null&&_!==void 0?_:!1,...processCreateParams(a)})};class ZodBoolean extends ZodType{_parse(_){if(this._def.coerce&&(_.data=!!_.data),this._getType(_)!==ZodParsedType.boolean){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:j.parsedType}),INVALID}return OK(_.data)}}ZodBoolean.create=a=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...processCreateParams(a)});class ZodDate extends ZodType{_parse(_){if(this._def.coerce&&(_.data=new Date(_.data)),this._getType(_)!==ZodParsedType.date){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:tt.parsedType}),INVALID}if(isNaN(_.data.getTime())){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_date}),INVALID}const j=new ParseStatus;let et;for(const tt of this._def.checks)tt.kind==="min"?_.data.getTime()tt.value&&(et=this._getOrReturnCtx(_,et),addIssueToContext(et,{code:ZodIssueCode.too_big,message:tt.message,inclusive:!0,exact:!1,maximum:tt.value,type:"date"}),j.dirty()):util.assertNever(tt);return{status:j.value,value:new Date(_.data.getTime())}}_addCheck(_){return new ZodDate({...this._def,checks:[...this._def.checks,_]})}min(_,$){return this._addCheck({kind:"min",value:_.getTime(),message:errorUtil.toString($)})}max(_,$){return this._addCheck({kind:"max",value:_.getTime(),message:errorUtil.toString($)})}get minDate(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _!=null?new Date(_):null}get maxDate(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _!=null?new Date(_):null}}ZodDate.create=a=>new ZodDate({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(a)});class ZodSymbol extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.symbol){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:j.parsedType}),INVALID}return OK(_.data)}}ZodSymbol.create=a=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(a)});class ZodUndefined extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:j.parsedType}),INVALID}return OK(_.data)}}ZodUndefined.create=a=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(a)});class ZodNull extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.null){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:j.parsedType}),INVALID}return OK(_.data)}}ZodNull.create=a=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(a)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(_){return OK(_.data)}}ZodAny.create=a=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(a)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(_){return OK(_.data)}}ZodUnknown.create=a=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(a)});class ZodNever extends ZodType{_parse(_){const $=this._getOrReturnCtx(_);return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:$.parsedType}),INVALID}}ZodNever.create=a=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(a)});class ZodVoid extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:j.parsedType}),INVALID}return OK(_.data)}}ZodVoid.create=a=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(a)});class ZodArray extends ZodType{_parse(_){const{ctx:$,status:j}=this._processInputParams(_),et=this._def;if($.parsedType!==ZodParsedType.array)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:$.parsedType}),INVALID;if(et.exactLength!==null){const rt=$.data.length>et.exactLength.value,nt=$.data.lengthet.maxLength.value&&(addIssueToContext($,{code:ZodIssueCode.too_big,maximum:et.maxLength.value,type:"array",inclusive:!0,exact:!1,message:et.maxLength.message}),j.dirty()),$.common.async)return Promise.all([...$.data].map((rt,nt)=>et.type._parseAsync(new ParseInputLazyPath($,rt,$.path,nt)))).then(rt=>ParseStatus.mergeArray(j,rt));const tt=[...$.data].map((rt,nt)=>et.type._parseSync(new ParseInputLazyPath($,rt,$.path,nt)));return ParseStatus.mergeArray(j,tt)}get element(){return this._def.type}min(_,$){return new ZodArray({...this._def,minLength:{value:_,message:errorUtil.toString($)}})}max(_,$){return new ZodArray({...this._def,maxLength:{value:_,message:errorUtil.toString($)}})}length(_,$){return new ZodArray({...this._def,exactLength:{value:_,message:errorUtil.toString($)}})}nonempty(_){return this.min(1,_)}}ZodArray.create=(a,_)=>new ZodArray({type:a,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(_)});function deepPartialify(a){if(a instanceof ZodObject){const _={};for(const $ in a.shape){const j=a.shape[$];_[$]=ZodOptional.create(deepPartialify(j))}return new ZodObject({...a._def,shape:()=>_})}else return a instanceof ZodArray?new ZodArray({...a._def,type:deepPartialify(a.element)}):a instanceof ZodOptional?ZodOptional.create(deepPartialify(a.unwrap())):a instanceof ZodNullable?ZodNullable.create(deepPartialify(a.unwrap())):a instanceof ZodTuple?ZodTuple.create(a.items.map(_=>deepPartialify(_))):a}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const _=this._def.shape(),$=util.objectKeys(_);return this._cached={shape:_,keys:$}}_parse(_){if(this._getType(_)!==ZodParsedType.object){const st=this._getOrReturnCtx(_);return addIssueToContext(st,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:st.parsedType}),INVALID}const{status:j,ctx:et}=this._processInputParams(_),{shape:tt,keys:rt}=this._getCached(),nt=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const st in et.data)rt.includes(st)||nt.push(st);const it=[];for(const st of rt){const ot=tt[st],at=et.data[st];it.push({key:{status:"valid",value:st},value:ot._parse(new ParseInputLazyPath(et,at,et.path,st)),alwaysSet:st in et.data})}if(this._def.catchall instanceof ZodNever){const st=this._def.unknownKeys;if(st==="passthrough")for(const ot of nt)it.push({key:{status:"valid",value:ot},value:{status:"valid",value:et.data[ot]}});else if(st==="strict")nt.length>0&&(addIssueToContext(et,{code:ZodIssueCode.unrecognized_keys,keys:nt}),j.dirty());else if(st!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const st=this._def.catchall;for(const ot of nt){const at=et.data[ot];it.push({key:{status:"valid",value:ot},value:st._parse(new ParseInputLazyPath(et,at,et.path,ot)),alwaysSet:ot in et.data})}}return et.common.async?Promise.resolve().then(async()=>{const st=[];for(const ot of it){const at=await ot.key,ut=await ot.value;st.push({key:at,value:ut,alwaysSet:ot.alwaysSet})}return st}).then(st=>ParseStatus.mergeObjectSync(j,st)):ParseStatus.mergeObjectSync(j,it)}get shape(){return this._def.shape()}strict(_){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",..._!==void 0?{errorMap:($,j)=>{var et,tt,rt,nt;const it=(rt=(tt=(et=this._def).errorMap)===null||tt===void 0?void 0:tt.call(et,$,j).message)!==null&&rt!==void 0?rt:j.defaultError;return $.code==="unrecognized_keys"?{message:(nt=errorUtil.errToObj(_).message)!==null&&nt!==void 0?nt:it}:{message:it}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(_){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),..._})})}merge(_){return new ZodObject({unknownKeys:_._def.unknownKeys,catchall:_._def.catchall,shape:()=>({...this._def.shape(),..._._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(_,$){return this.augment({[_]:$})}catchall(_){return new ZodObject({...this._def,catchall:_})}pick(_){const $={};return util.objectKeys(_).forEach(j=>{_[j]&&this.shape[j]&&($[j]=this.shape[j])}),new ZodObject({...this._def,shape:()=>$})}omit(_){const $={};return util.objectKeys(this.shape).forEach(j=>{_[j]||($[j]=this.shape[j])}),new ZodObject({...this._def,shape:()=>$})}deepPartial(){return deepPartialify(this)}partial(_){const $={};return util.objectKeys(this.shape).forEach(j=>{const et=this.shape[j];_&&!_[j]?$[j]=et:$[j]=et.optional()}),new ZodObject({...this._def,shape:()=>$})}required(_){const $={};return util.objectKeys(this.shape).forEach(j=>{if(_&&!_[j])$[j]=this.shape[j];else{let tt=this.shape[j];for(;tt instanceof ZodOptional;)tt=tt._def.innerType;$[j]=tt}}),new ZodObject({...this._def,shape:()=>$})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(a,_)=>new ZodObject({shape:()=>a,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});ZodObject.strictCreate=(a,_)=>new ZodObject({shape:()=>a,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});ZodObject.lazycreate=(a,_)=>new ZodObject({shape:a,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});class ZodUnion extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j=this._def.options;function et(tt){for(const nt of tt)if(nt.result.status==="valid")return nt.result;for(const nt of tt)if(nt.result.status==="dirty")return $.common.issues.push(...nt.ctx.common.issues),nt.result;const rt=tt.map(nt=>new ZodError(nt.ctx.common.issues));return addIssueToContext($,{code:ZodIssueCode.invalid_union,unionErrors:rt}),INVALID}if($.common.async)return Promise.all(j.map(async tt=>{const rt={...$,common:{...$.common,issues:[]},parent:null};return{result:await tt._parseAsync({data:$.data,path:$.path,parent:rt}),ctx:rt}})).then(et);{let tt;const rt=[];for(const it of j){const st={...$,common:{...$.common,issues:[]},parent:null},ot=it._parseSync({data:$.data,path:$.path,parent:st});if(ot.status==="valid")return ot;ot.status==="dirty"&&!tt&&(tt={result:ot,ctx:st}),st.common.issues.length&&rt.push(st.common.issues)}if(tt)return $.common.issues.push(...tt.ctx.common.issues),tt.result;const nt=rt.map(it=>new ZodError(it));return addIssueToContext($,{code:ZodIssueCode.invalid_union,unionErrors:nt}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(a,_)=>new ZodUnion({options:a,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(_)});const getDiscriminator=a=>a instanceof ZodLazy?getDiscriminator(a.schema):a instanceof ZodEffects?getDiscriminator(a.innerType()):a instanceof ZodLiteral?[a.value]:a instanceof ZodEnum?a.options:a instanceof ZodNativeEnum?util.objectValues(a.enum):a instanceof ZodDefault?getDiscriminator(a._def.innerType):a instanceof ZodUndefined?[void 0]:a instanceof ZodNull?[null]:a instanceof ZodOptional?[void 0,...getDiscriminator(a.unwrap())]:a instanceof ZodNullable?[null,...getDiscriminator(a.unwrap())]:a instanceof ZodBranded||a instanceof ZodReadonly?getDiscriminator(a.unwrap()):a instanceof ZodCatch?getDiscriminator(a._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_);if($.parsedType!==ZodParsedType.object)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:$.parsedType}),INVALID;const j=this.discriminator,et=$.data[j],tt=this.optionsMap.get(et);return tt?$.common.async?tt._parseAsync({data:$.data,path:$.path,parent:$}):tt._parseSync({data:$.data,path:$.path,parent:$}):(addIssueToContext($,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[j]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(_,$,j){const et=new Map;for(const tt of $){const rt=getDiscriminator(tt.shape[_]);if(!rt.length)throw new Error(`A discriminator value for key \`${_}\` could not be extracted from all schema options`);for(const nt of rt){if(et.has(nt))throw new Error(`Discriminator property ${String(_)} has duplicate value ${String(nt)}`);et.set(nt,tt)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:_,options:$,optionsMap:et,...processCreateParams(j)})}}function mergeValues(a,_){const $=getParsedType(a),j=getParsedType(_);if(a===_)return{valid:!0,data:a};if($===ZodParsedType.object&&j===ZodParsedType.object){const et=util.objectKeys(_),tt=util.objectKeys(a).filter(nt=>et.indexOf(nt)!==-1),rt={...a,..._};for(const nt of tt){const it=mergeValues(a[nt],_[nt]);if(!it.valid)return{valid:!1};rt[nt]=it.data}return{valid:!0,data:rt}}else if($===ZodParsedType.array&&j===ZodParsedType.array){if(a.length!==_.length)return{valid:!1};const et=[];for(let tt=0;tt{if(isAborted(tt)||isAborted(rt))return INVALID;const nt=mergeValues(tt.value,rt.value);return nt.valid?((isDirty(tt)||isDirty(rt))&&$.dirty(),{status:$.value,value:nt.data}):(addIssueToContext(j,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return j.common.async?Promise.all([this._def.left._parseAsync({data:j.data,path:j.path,parent:j}),this._def.right._parseAsync({data:j.data,path:j.path,parent:j})]).then(([tt,rt])=>et(tt,rt)):et(this._def.left._parseSync({data:j.data,path:j.path,parent:j}),this._def.right._parseSync({data:j.data,path:j.path,parent:j}))}}ZodIntersection.create=(a,_,$)=>new ZodIntersection({left:a,right:_,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams($)});class ZodTuple extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.array)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:j.parsedType}),INVALID;if(j.data.lengththis._def.items.length&&(addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty());const tt=[...j.data].map((rt,nt)=>{const it=this._def.items[nt]||this._def.rest;return it?it._parse(new ParseInputLazyPath(j,rt,j.path,nt)):null}).filter(rt=>!!rt);return j.common.async?Promise.all(tt).then(rt=>ParseStatus.mergeArray($,rt)):ParseStatus.mergeArray($,tt)}get items(){return this._def.items}rest(_){return new ZodTuple({...this._def,rest:_})}}ZodTuple.create=(a,_)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:a,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(_)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.object)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:j.parsedType}),INVALID;const et=[],tt=this._def.keyType,rt=this._def.valueType;for(const nt in j.data)et.push({key:tt._parse(new ParseInputLazyPath(j,nt,j.path,nt)),value:rt._parse(new ParseInputLazyPath(j,j.data[nt],j.path,nt)),alwaysSet:nt in j.data});return j.common.async?ParseStatus.mergeObjectAsync($,et):ParseStatus.mergeObjectSync($,et)}get element(){return this._def.valueType}static create(_,$,j){return $ instanceof ZodType?new ZodRecord({keyType:_,valueType:$,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(j)}):new ZodRecord({keyType:ZodString.create(),valueType:_,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams($)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.map)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:j.parsedType}),INVALID;const et=this._def.keyType,tt=this._def.valueType,rt=[...j.data.entries()].map(([nt,it],st)=>({key:et._parse(new ParseInputLazyPath(j,nt,j.path,[st,"key"])),value:tt._parse(new ParseInputLazyPath(j,it,j.path,[st,"value"]))}));if(j.common.async){const nt=new Map;return Promise.resolve().then(async()=>{for(const it of rt){const st=await it.key,ot=await it.value;if(st.status==="aborted"||ot.status==="aborted")return INVALID;(st.status==="dirty"||ot.status==="dirty")&&$.dirty(),nt.set(st.value,ot.value)}return{status:$.value,value:nt}})}else{const nt=new Map;for(const it of rt){const st=it.key,ot=it.value;if(st.status==="aborted"||ot.status==="aborted")return INVALID;(st.status==="dirty"||ot.status==="dirty")&&$.dirty(),nt.set(st.value,ot.value)}return{status:$.value,value:nt}}}}ZodMap.create=(a,_,$)=>new ZodMap({valueType:_,keyType:a,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams($)});class ZodSet extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.set)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:j.parsedType}),INVALID;const et=this._def;et.minSize!==null&&j.data.sizeet.maxSize.value&&(addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:et.maxSize.value,type:"set",inclusive:!0,exact:!1,message:et.maxSize.message}),$.dirty());const tt=this._def.valueType;function rt(it){const st=new Set;for(const ot of it){if(ot.status==="aborted")return INVALID;ot.status==="dirty"&&$.dirty(),st.add(ot.value)}return{status:$.value,value:st}}const nt=[...j.data.values()].map((it,st)=>tt._parse(new ParseInputLazyPath(j,it,j.path,st)));return j.common.async?Promise.all(nt).then(it=>rt(it)):rt(nt)}min(_,$){return new ZodSet({...this._def,minSize:{value:_,message:errorUtil.toString($)}})}max(_,$){return new ZodSet({...this._def,maxSize:{value:_,message:errorUtil.toString($)}})}size(_,$){return this.min(_,$).max(_,$)}nonempty(_){return this.min(1,_)}}ZodSet.create=(a,_)=>new ZodSet({valueType:a,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(_)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(_){const{ctx:$}=this._processInputParams(_);if($.parsedType!==ZodParsedType.function)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:$.parsedType}),INVALID;function j(nt,it){return makeIssue({data:nt,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,getErrorMap(),errorMap].filter(st=>!!st),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:it}})}function et(nt,it){return makeIssue({data:nt,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,getErrorMap(),errorMap].filter(st=>!!st),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:it}})}const tt={errorMap:$.common.contextualErrorMap},rt=$.data;if(this._def.returns instanceof ZodPromise){const nt=this;return OK(async function(...it){const st=new ZodError([]),ot=await nt._def.args.parseAsync(it,tt).catch(ht=>{throw st.addIssue(j(it,ht)),st}),at=await Reflect.apply(rt,this,ot);return await nt._def.returns._def.type.parseAsync(at,tt).catch(ht=>{throw st.addIssue(et(at,ht)),st})})}else{const nt=this;return OK(function(...it){const st=nt._def.args.safeParse(it,tt);if(!st.success)throw new ZodError([j(it,st.error)]);const ot=Reflect.apply(rt,this,st.data),at=nt._def.returns.safeParse(ot,tt);if(!at.success)throw new ZodError([et(ot,at.error)]);return at.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(..._){return new ZodFunction({...this._def,args:ZodTuple.create(_).rest(ZodUnknown.create())})}returns(_){return new ZodFunction({...this._def,returns:_})}implement(_){return this.parse(_)}strictImplement(_){return this.parse(_)}static create(_,$,j){return new ZodFunction({args:_||ZodTuple.create([]).rest(ZodUnknown.create()),returns:$||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(j)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(_){const{ctx:$}=this._processInputParams(_);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}}ZodLazy.create=(a,_)=>new ZodLazy({getter:a,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(_)});class ZodLiteral extends ZodType{_parse(_){if(_.data!==this._def.value){const $=this._getOrReturnCtx(_);return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:_.data}}get value(){return this._def.value}}ZodLiteral.create=(a,_)=>new ZodLiteral({value:a,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(_)});function createZodEnum(a,_){return new ZodEnum({values:a,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(_)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(_){if(typeof _.data!="string"){const $=this._getOrReturnCtx(_),j=this._def.values;return addIssueToContext($,{expected:util.joinValues(j),received:$.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet$1(this,_ZodEnum_cache)||__classPrivateFieldSet$1(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet$1(this,_ZodEnum_cache).has(_.data)){const $=this._getOrReturnCtx(_),j=this._def.values;return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_enum_value,options:j}),INVALID}return OK(_.data)}get options(){return this._def.values}get enum(){const _={};for(const $ of this._def.values)_[$]=$;return _}get Values(){const _={};for(const $ of this._def.values)_[$]=$;return _}get Enum(){const _={};for(const $ of this._def.values)_[$]=$;return _}extract(_,$=this._def){return ZodEnum.create(_,{...this._def,...$})}exclude(_,$=this._def){return ZodEnum.create(this.options.filter(j=>!_.includes(j)),{...this._def,...$})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(_){const $=util.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(_);if(j.parsedType!==ZodParsedType.string&&j.parsedType!==ZodParsedType.number){const et=util.objectValues($);return addIssueToContext(j,{expected:util.joinValues(et),received:j.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet$1(this,_ZodNativeEnum_cache)||__classPrivateFieldSet$1(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet$1(this,_ZodNativeEnum_cache).has(_.data)){const et=util.objectValues($);return addIssueToContext(j,{received:j.data,code:ZodIssueCode.invalid_enum_value,options:et}),INVALID}return OK(_.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(a,_)=>new ZodNativeEnum({values:a,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(_)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(_){const{ctx:$}=this._processInputParams(_);if($.parsedType!==ZodParsedType.promise&&$.common.async===!1)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:$.parsedType}),INVALID;const j=$.parsedType===ZodParsedType.promise?$.data:Promise.resolve($.data);return OK(j.then(et=>this._def.type.parseAsync(et,{path:$.path,errorMap:$.common.contextualErrorMap})))}}ZodPromise.create=(a,_)=>new ZodPromise({type:a,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(_)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(_){const{status:$,ctx:j}=this._processInputParams(_),et=this._def.effect||null,tt={addIssue:rt=>{addIssueToContext(j,rt),rt.fatal?$.abort():$.dirty()},get path(){return j.path}};if(tt.addIssue=tt.addIssue.bind(tt),et.type==="preprocess"){const rt=et.transform(j.data,tt);if(j.common.async)return Promise.resolve(rt).then(async nt=>{if($.value==="aborted")return INVALID;const it=await this._def.schema._parseAsync({data:nt,path:j.path,parent:j});return it.status==="aborted"?INVALID:it.status==="dirty"||$.value==="dirty"?DIRTY(it.value):it});{if($.value==="aborted")return INVALID;const nt=this._def.schema._parseSync({data:rt,path:j.path,parent:j});return nt.status==="aborted"?INVALID:nt.status==="dirty"||$.value==="dirty"?DIRTY(nt.value):nt}}if(et.type==="refinement"){const rt=nt=>{const it=et.refinement(nt,tt);if(j.common.async)return Promise.resolve(it);if(it instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return nt};if(j.common.async===!1){const nt=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});return nt.status==="aborted"?INVALID:(nt.status==="dirty"&&$.dirty(),rt(nt.value),{status:$.value,value:nt.value})}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then(nt=>nt.status==="aborted"?INVALID:(nt.status==="dirty"&&$.dirty(),rt(nt.value).then(()=>({status:$.value,value:nt.value}))))}if(et.type==="transform")if(j.common.async===!1){const rt=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(!isValid$1(rt))return rt;const nt=et.transform(rt.value,tt);if(nt instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$.value,value:nt}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then(rt=>isValid$1(rt)?Promise.resolve(et.transform(rt.value,tt)).then(nt=>({status:$.value,value:nt})):rt);util.assertNever(et)}}ZodEffects.create=(a,_,$)=>new ZodEffects({schema:a,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:_,...processCreateParams($)});ZodEffects.createWithPreprocess=(a,_,$)=>new ZodEffects({schema:_,effect:{type:"preprocess",transform:a},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams($)});class ZodOptional extends ZodType{_parse(_){return this._getType(_)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}ZodOptional.create=(a,_)=>new ZodOptional({innerType:a,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(_)});class ZodNullable extends ZodType{_parse(_){return this._getType(_)===ZodParsedType.null?OK(null):this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}ZodNullable.create=(a,_)=>new ZodNullable({innerType:a,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(_)});class ZodDefault extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_);let j=$.data;return $.parsedType===ZodParsedType.undefined&&(j=this._def.defaultValue()),this._def.innerType._parse({data:j,path:$.path,parent:$})}removeDefault(){return this._def.innerType}}ZodDefault.create=(a,_)=>new ZodDefault({innerType:a,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof _.default=="function"?_.default:()=>_.default,...processCreateParams(_)});class ZodCatch extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j={...$,common:{...$.common,issues:[]}},et=this._def.innerType._parse({data:j.data,path:j.path,parent:{...j}});return isAsync(et)?et.then(tt=>({status:"valid",value:tt.status==="valid"?tt.value:this._def.catchValue({get error(){return new ZodError(j.common.issues)},input:j.data})})):{status:"valid",value:et.status==="valid"?et.value:this._def.catchValue({get error(){return new ZodError(j.common.issues)},input:j.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(a,_)=>new ZodCatch({innerType:a,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof _.catch=="function"?_.catch:()=>_.catch,...processCreateParams(_)});class ZodNaN extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.nan){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:j.parsedType}),INVALID}return{status:"valid",value:_.data}}}ZodNaN.create=a=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(a)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j=$.data;return this._def.type._parse({data:j,path:$.path,parent:$})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.common.async)return(async()=>{const tt=await this._def.in._parseAsync({data:j.data,path:j.path,parent:j});return tt.status==="aborted"?INVALID:tt.status==="dirty"?($.dirty(),DIRTY(tt.value)):this._def.out._parseAsync({data:tt.value,path:j.path,parent:j})})();{const et=this._def.in._parseSync({data:j.data,path:j.path,parent:j});return et.status==="aborted"?INVALID:et.status==="dirty"?($.dirty(),{status:"dirty",value:et.value}):this._def.out._parseSync({data:et.value,path:j.path,parent:j})}}static create(_,$){return new ZodPipeline({in:_,out:$,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(_){const $=this._def.innerType._parse(_),j=et=>(isValid$1(et)&&(et.value=Object.freeze(et.value)),et);return isAsync($)?$.then(et=>j(et)):j($)}unwrap(){return this._def.innerType}}ZodReadonly.create=(a,_)=>new ZodReadonly({innerType:a,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(_)});function custom(a,_={},$){return a?ZodAny.create().superRefine((j,et)=>{var tt,rt;if(!a(j)){const nt=typeof _=="function"?_(j):typeof _=="string"?{message:_}:_,it=(rt=(tt=nt.fatal)!==null&&tt!==void 0?tt:$)!==null&&rt!==void 0?rt:!0,st=typeof nt=="string"?{message:nt}:nt;et.addIssue({code:"custom",...st,fatal:it})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(a,_={message:`Input not instance of ${a.name}`})=>custom($=>$ instanceof a,_),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType$1=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce$2={string:a=>ZodString.create({...a,coerce:!0}),number:a=>ZodNumber.create({...a,coerce:!0}),boolean:a=>ZodBoolean.create({...a,coerce:!0}),bigint:a=>ZodBigInt.create({...a,coerce:!0}),date:a=>ZodDate.create({...a,coerce:!0})},NEVER$1=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid:isValid$1,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce$2,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType$1,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER$1,ZodIssueCode,quotelessJson,ZodError});const Schema$1=z.object({address:z.string()}),parsePkh=a=>{if(isValidContractPkh(a))return parseContractPkh(a);if(isValidImplicitPkh(a))return parseImplicitPkh(a);throw new Error(`Cannot parse address type: ${a}`)},isAddressValid=a=>validateAddress(a)===ValidationResult.VALID,isValidContractPkh=a=>isAddressValid(a)&&a.match(/^KT1\w+/),isValidImplicitPkh=a=>isAddressValid(a)&&a.match(/^tz[1234]\w+/),parseContractPkh=a=>{if(isValidContractPkh(a))return{type:"contract",pkh:a};throw new Error(`Invalid contract address: ${a}`)},parseImplicitPkh=a=>{if(isValidImplicitPkh(a))return{type:"implicit",pkh:a};throw new Error(`Invalid implicit address: ${a}`)},encodeReserved=[encodeURIComponent,encodeURIComponent];function encode$2(a,_=","){const $=(j,et)=>{const tt=a[et%a.length];return typeof j>"u"?"":typeof j=="object"?Array.isArray(j)?j.map(tt).join(_):Object.entries(j).reduce((nt,it)=>[...nt,...it],[]).map(tt).join(_):tt(String(j))};return(j,...et)=>j.reduce((tt,rt,nt)=>`${tt}${rt}${$(et[nt],nt)}`,"")}function delimited(a=","){return(_,$=encodeReserved)=>Object.entries(_).filter(([,j])=>j!==void 0).map(([j,et])=>encode$2($,a)`${j}=${et}`).join("&")}function stripUndefined(a){return a&&JSON.parse(JSON.stringify(a))}function joinUrl(...a){return a.filter(Boolean).map((_,$)=>$===0?_:_.replace(/^\/+/,"")).map((_,$,j)=>$===j.length-1?_:_.replace(/\/+$/,"")).join("/")}function query(...a){const _=a.filter(Boolean).join("&");return _&&`?${_}`}function explode(a,_=encodeReserved){const $=encode$2(_);return Object.entries(a).filter(([,j])=>j!==void 0).map(([j,et])=>Array.isArray(et)?et.map(tt=>$`${j}=${tt}`).join("&"):typeof et=="object"?explode(et,_):$`${j}=${et}`).join("&")}const form=delimited(),SUCCESS_CODES=[200,201,202,204];async function ok(a){const _=await a;if(SUCCESS_CODES.some($=>$==_.status))return _.data;throw new HttpError(_.status,_.data)}class HttpError extends Error{constructor($,j){super(`Error: ${$}`);Yr(this,"status");Yr(this,"data");this.status=$,this.data=j}}function runtime$1(a){async function _(tt,rt){const nt=await et(tt,rt);let it;try{it=await nt.text()}catch{}return{status:nt.status,headers:nt.headers,contentType:nt.headers.get("content-type"),data:it}}async function $(tt,rt={}){const{status:nt,headers:it,contentType:st,data:ot}=await _(tt,{...rt,headers:{Accept:"application/json",...rt.headers}});return(st?st.includes("json"):!1)?{status:nt,headers:it,data:ot?JSON.parse(ot):null}:{status:nt,headers:it,data:ot}}async function j(tt,rt={}){const nt=await et(tt,rt);let it;try{it=await nt.blob()}catch{}return{status:nt.status,headers:nt.headers,data:it}}async function et(tt,rt={}){const{baseUrl:nt,headers:it,fetch:st,...ot}={...a,...rt},at=joinUrl(nt,tt);return await(st||fetch)(at,{...ot,headers:stripUndefined({...a.headers,...it})})}return{ok,fetchText:_,fetchJson:$,fetchBlob:j,json({body:tt,headers:rt,...nt}){return{...nt,...tt!=null&&{body:JSON.stringify(tt)},headers:{...rt,"Content-Type":"application/json"}}},form({body:tt,headers:rt,...nt}){return{...nt,...tt!=null&&{body:form(tt)},headers:{...rt,"Content-Type":"application/x-www-form-urlencoded"}}},multipart({body:tt,...rt}){if(tt==null)return rt;const nt=new(a.formDataConstructor||rt.formDataConstructor||FormData);return Object.entries(tt).forEach(([it,st])=>{nt.append(it,st)}),{...rt,body:nt}}}}const jsonParameter=(a,_)=>{if(!_)return{};const $={};return Object.entries(_).forEach(([j,et])=>{if(!(et instanceof Object))throw new Error(`Expected ${a} value to be object, received ${typeof et}`);const{jsonPath:tt,jsonValue:rt}=et;if(rt==null)throw new Error(`Expected jsonValue in ${a} -> ${j}, found: ${rt}`);const it=[a,tt,j].filter(st=>st!==void 0).join(".");$[it]=rt}),$},anyofParameter=(a,_)=>{if(!_)return{};const{fields:$}=_;(rt=>{if(!Array.isArray(rt))throw new Error(`Expected ${a} fields to be Array. Received ${typeof rt}.`);return rt.forEach(nt=>{if(typeof nt!="string")throw new Error(`Expected ${a} fields to be strings. Received ${typeof nt}`)}),!0})($);const et={},tt=$.join(".");if(_.value){const rt=`${a}.${tt}`;et[rt]=_.value}for(const rt of["in","eq","null"])if(_[rt]){const nt=`${a}.${tt}.${rt}`;return et[nt]=Array.isArray(_[rt])?_[rt].join(","):_[rt],et}return et},queryParameter=(a,_)=>{if(!_)return{};const $={};return Object.entries(_).forEach(([j,et])=>{const tt=`${a}.${j}`;$[tt]=et}),$},parsers={jsonParameter,queryParameter,anyofParameter},defaults={baseUrl:"https://api.tzkt.io"},oazapfts=runtime$1(defaults);function accountsGet({id:a,address:_,$type:$,kind:j,delegate:et,balance:tt,staked:rt,lastActivity:nt,select:it,sort:st,offset:ot,limit:at}={},ut){return oazapfts.ok(oazapfts.fetchJson(`/v1/accounts${query(explode({limit:at,...parsers.queryParameter("id",a),...parsers.queryParameter("address",_),...parsers.queryParameter("type",$),...parsers.queryParameter("kind",j),...parsers.queryParameter("delegate",et),...parsers.queryParameter("balance",tt),...parsers.queryParameter("staked",rt),...parsers.queryParameter("lastActivity",nt),...parsers.queryParameter("select",it),...parsers.queryParameter("sort",st),...parsers.queryParameter("offset",ot)}))}`,{...ut}))}function blocksGetCount(a){return oazapfts.ok(oazapfts.fetchJson("/v1/blocks/count",{...a}))}function contractsGet({address:a,kind:_,tzips:$,creator:j,manager:et,delegate:tt,balance:rt,lastActivity:nt,typeHash:it,codeHash:st,select:ot,sort:at,offset:ut,limit:ht,includeStorage:yt}={},wt){return oazapfts.ok(oazapfts.fetchJson(`/v1/contracts${query(explode({limit:ht,includeStorage:yt,...parsers.queryParameter("address",a),...parsers.queryParameter("kind",_),...parsers.queryParameter("tzips",$),...parsers.queryParameter("creator",j),...parsers.queryParameter("manager",et),...parsers.queryParameter("delegate",tt),...parsers.queryParameter("balance",rt),...parsers.queryParameter("lastActivity",nt),...parsers.queryParameter("typeHash",it),...parsers.queryParameter("codeHash",st),...parsers.queryParameter("select",ot),...parsers.queryParameter("sort",at),...parsers.queryParameter("offset",ut)}))}`,{...wt}))}function delegatesGet({active:a,lastActivity:_,select:$,sort:j,offset:et,limit:tt}={},rt){return oazapfts.ok(oazapfts.fetchJson(`/v1/delegates${query(explode({limit:tt,...parsers.queryParameter("active",a),...parsers.queryParameter("lastActivity",_),...parsers.queryParameter("select",$),...parsers.queryParameter("sort",j),...parsers.queryParameter("offset",et)}))}`,{...rt}))}function operationsGetDelegations({anyof:a,initiator:_,sender:$,prevDelegate:j,newDelegate:et,level:tt,timestamp:rt,senderCodeHash:nt,status:it,select:st,sort:ot,offset:at,limit:ut,quote:ht}={},yt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/delegations${query(explode({limit:ut,quote:ht,...parsers.anyofParameter("anyof",a),...parsers.queryParameter("initiator",_),...parsers.queryParameter("sender",$),...parsers.queryParameter("prevDelegate",j),...parsers.queryParameter("newDelegate",et),...parsers.queryParameter("level",tt),...parsers.queryParameter("timestamp",rt),...parsers.queryParameter("senderCodeHash",nt),...parsers.queryParameter("status",it),...parsers.queryParameter("select",st),...parsers.queryParameter("sort",ot),...parsers.queryParameter("offset",at)}))}`,{...yt}))}function operationsGetOriginations({anyof:a,initiator:_,sender:$,contractManager:j,contractDelegate:et,originatedContract:tt,id:rt,typeHash:nt,codeHash:it,level:st,timestamp:ot,senderCodeHash:at,anyCodeHash:ut,status:ht,select:yt,sort:wt,offset:Ct,limit:Pt,micheline:$t,quote:Mt}={},Bt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/originations${query(explode({limit:Pt,micheline:$t,quote:Mt,...parsers.anyofParameter("anyof",a),...parsers.queryParameter("initiator",_),...parsers.queryParameter("sender",$),...parsers.queryParameter("contractManager",j),...parsers.queryParameter("contractDelegate",et),...parsers.queryParameter("originatedContract",tt),...parsers.queryParameter("id",rt),...parsers.queryParameter("typeHash",nt),...parsers.queryParameter("codeHash",it),...parsers.queryParameter("level",st),...parsers.queryParameter("timestamp",ot),...parsers.queryParameter("senderCodeHash",at),...parsers.queryParameter("anyCodeHash",ut),...parsers.queryParameter("status",ht),...parsers.queryParameter("select",yt),...parsers.queryParameter("sort",wt),...parsers.queryParameter("offset",Ct)}))}`,{...Bt}))}function operationsGetTransactions({anyof:a,initiator:_,sender:$,target:j,amount:et,id:tt,level:rt,timestamp:nt,senderCodeHash:it,targetCodeHash:st,codeHash:ot,entrypoint:at,parameter:ut,hasInternals:ht,status:yt,select:wt,sort:Ct,offset:Pt,limit:$t,micheline:Mt,quote:Bt}={},Dt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/transactions${query(explode({limit:$t,micheline:Mt,quote:Bt,...parsers.anyofParameter("anyof",a),...parsers.queryParameter("initiator",_),...parsers.queryParameter("sender",$),...parsers.queryParameter("target",j),...parsers.queryParameter("amount",et),...parsers.queryParameter("id",tt),...parsers.queryParameter("level",rt),...parsers.queryParameter("timestamp",nt),...parsers.queryParameter("senderCodeHash",it),...parsers.queryParameter("targetCodeHash",st),...parsers.queryParameter("codeHash",ot),...parsers.queryParameter("entrypoint",at),...parsers.jsonParameter("parameter",ut),...parsers.queryParameter("hasInternals",ht),...parsers.queryParameter("status",yt),...parsers.queryParameter("select",wt),...parsers.queryParameter("sort",Ct),...parsers.queryParameter("offset",Pt)}))}`,{...Dt}))}function quotesGetLast(a){return oazapfts.ok(oazapfts.fetchJson("/v1/quotes/last",{...a}))}function tokensGetTokenBalances({id:a,account:_,tokenId:$,tokenContract:j,tokenTokenId:et,tokenStandard:tt,tokenMetadata:rt,tokenHasFilters:nt,balance:it,firstLevel:st,firstTime:ot,lastLevel:at,lastTime:ut,indexedAt:ht,sort:yt,offset:wt,limit:Ct,select:Pt}={},$t){return oazapfts.ok(oazapfts.fetchJson(`/v1/tokens/balances${query(explode({"token.HasFilters":nt,limit:Ct,...parsers.queryParameter("id",a),...parsers.queryParameter("account",_),...parsers.queryParameter("token.id",$),...parsers.queryParameter("token.contract",j),...parsers.queryParameter("token.tokenId",et),...parsers.queryParameter("token.standard",tt),...parsers.jsonParameter("token.metadata",rt),...parsers.queryParameter("balance",it),...parsers.queryParameter("firstLevel",st),...parsers.queryParameter("firstTime",ot),...parsers.queryParameter("lastLevel",at),...parsers.queryParameter("lastTime",ut),...parsers.queryParameter("indexedAt",ht),...parsers.queryParameter("sort",yt),...parsers.queryParameter("offset",wt),...parsers.queryParameter("select",Pt)}))}`,{...$t}))}function tokensGetTokenTransfers({id:a,level:_,timestamp:$,tokenId:j,tokenContract:et,tokenTokenId:tt,tokenStandard:rt,tokenMetadata:nt,tokenHasFilters:it,anyof:st,$from:ot,to:at,amount:ut,transactionId:ht,originationId:yt,migrationId:wt,indexedAt:Ct,sort:Pt,offset:$t,limit:Mt,select:Bt}={},Dt){return oazapfts.ok(oazapfts.fetchJson(`/v1/tokens/transfers${query(explode({"token.HasFilters":it,limit:Mt,...parsers.queryParameter("id",a),...parsers.queryParameter("level",_),...parsers.queryParameter("timestamp",$),...parsers.queryParameter("token.id",j),...parsers.queryParameter("token.contract",et),...parsers.queryParameter("token.tokenId",tt),...parsers.queryParameter("token.standard",rt),...parsers.jsonParameter("token.metadata",nt),...parsers.anyofParameter("anyof",st),...parsers.queryParameter("from",ot),...parsers.queryParameter("to",at),...parsers.queryParameter("amount",ut),...parsers.queryParameter("transactionId",ht),...parsers.queryParameter("originationId",yt),...parsers.queryParameter("migrationId",wt),...parsers.queryParameter("indexedAt",Ct),...parsers.queryParameter("sort",Pt),...parsers.queryParameter("offset",$t),...parsers.queryParameter("select",Bt)}))}`,{...Dt}))}let e$1=class{constructor(_){this.queue=void 0,this.maxConcurrent=void 0,this.count=void 0,this.queue=[],this.maxConcurrent=_,this.count=0}get canAcquire(){return this.countthis.queue.push(_))}release(){const _=this.queue.shift();_?setTimeout(_,0):this.count--}};const t$4="_default";class s{constructor(_=1){this.semaphoreInstances=void 0,this.maxConcurrent=void 0,this.semaphoreInstances={},this.maxConcurrent=_}hasSemaphoreInstance(_=t$4){return!!this.semaphoreInstances[_]}getSemaphoreInstance(_=t$4){return this.hasSemaphoreInstance(_)||(this.semaphoreInstances[_]=new e$1(this.maxConcurrent)),this.semaphoreInstances[_]}tidy(_=t$4){this.hasSemaphoreInstance(_)&&this.getSemaphoreInstance(_).count===0&&delete this.semaphoreInstances[_]}canAcquire(_=t$4){return this.getSemaphoreInstance(_).canAcquire}acquire(_=t$4){return this.getSemaphoreInstance(_).acquire()}release(_=t$4){this.getSemaphoreInstance(_).release(),this.tidy(_)}count(_=t$4){return this.hasSemaphoreInstance(_)?this.getSemaphoreInstance(_).count:0}hasTasks(_=t$4){return this.count(_)>0}async request(_,$=t$4){try{return await this.acquire($),await _()}finally{this.release($)}}async requestIfAvailable(_,$=t$4){return this.canAcquire($)?this.request(_,$):null}}function assign$1(a,_){for(const $ in _)Object.defineProperty(a,$,{value:_[$],enumerable:!0,configurable:!0});return a}function createError(a,_,$){if(!a||typeof a=="string")throw new TypeError("Please pass an Error to err-code");$||($={}),typeof _=="object"&&($=_,_=void 0),_!=null&&($.code=_);try{return assign$1(a,$)}catch{$.message=a.message,$.stack=a.stack;const et=function(){};return et.prototype=Object.create(Object.getPrototypeOf(a)),assign$1(new et,$)}}var errCode=createError,retry$3={};function RetryOperation(a,_){typeof _=="boolean"&&(_={forever:_}),this._originalTimeouts=JSON.parse(JSON.stringify(a)),this._timeouts=a,this._options=_||{},this._maxRetryTime=_&&_.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(a){if(this._timeout&&clearTimeout(this._timeout),!a)return!1;var _=new Date().getTime();if(a&&_-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(a);var $=this._timeouts.shift();if($===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),$=this._timeouts.shift();else return!1;var j=this,et=setTimeout(function(){j._attempts++,j._operationTimeoutCb&&(j._timeout=setTimeout(function(){j._operationTimeoutCb(j._attempts)},j._operationTimeout),j._options.unref&&j._timeout.unref()),j._fn(j._attempts)},$);return this._options.unref&&et.unref(),!0};RetryOperation.prototype.attempt=function(a,_){this._fn=a,_&&(_.timeout&&(this._operationTimeout=_.timeout),_.cb&&(this._operationTimeoutCb=_.cb));var $=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){$._operationTimeoutCb()},$._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(a){console.log("Using RetryOperation.try() is deprecated"),this.attempt(a)};RetryOperation.prototype.start=function(a){console.log("Using RetryOperation.start() is deprecated"),this.attempt(a)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var a={},_=null,$=0,j=0;j=$&&(_=et,$=rt)}return _};(function(a){var _=retry_operation;a.operation=function($){var j=a.timeouts($);return new _(j,{forever:$&&$.forever,unref:$&&$.unref,maxRetryTime:$&&$.maxRetryTime})},a.timeouts=function($){if($ instanceof Array)return[].concat($);var j={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var et in $)j[et]=$[et];if(j.minTimeout>j.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var tt=[],rt=0;rttzktRateLimiter.acquire().then(()=>promiseRetry$1(_=>a().catch(_),{retries:3,minTimeout:100})).catch(_=>{throw"status"in _&&"data"in _?new Error(`Fetching data from tzkt failed with: ${_.status}, ${_.data}`):_}).finally(()=>tzktRateLimiter.release()),MULTISIG_FETCH_LIMIT=1e4,TYPE_HASH=1963879877,CODE_HASH=-1890025422,getAllMultiSigContracts=async a=>withRateLimit(async()=>{try{const _=`${a.tzktApiUrl}/v1/contracts?typeHash=${TYPE_HASH}&codeHash=${CODE_HASH}&includeStorage=true&limit=${MULTISIG_FETCH_LIMIT}`,{data:$}=await axios.get(_);return $}catch(_){throw new Error(`Error fetching same contracts from tzkt: ${_.message}`)}}),getExistingContracts=(a,_)=>withRateLimit(()=>contractsGet({address:{in:[a.join(",")]},select:{fields:["address"]},limit:Math.min(1e4,a.length)},{baseUrl:_.tzktApiUrl})),getPendingOperations=async(a,_)=>withRateLimit(async()=>{if(a.length===0)return Promise.resolve([]);const $=`${_.tzktApiUrl}/v1/bigmaps/keys?active=true&bigmap.in=${a.join(",")}&limit=${MULTISIG_FETCH_LIMIT}`,{data:j}=await axios.get($);return j}),parseMultisig=a=>({address:parseContractPkh(a.address),threshold:Number(a.storage.threshold),signers:a.storage.signers.map(parseImplicitPkh),pendingOperationsBigmapId:a.storage.pending_ops}),getRelevantMultisigContracts=async(a,_)=>(await getAllMultiSigContracts(_)).filter(({storage:{signers:j}})=>lodashExports.every(j,isValidImplicitPkh)?j.filter(tt=>a.has(tt)).length>0:!1).map(parseMultisig),getNetworksForContracts=async(a,_)=>{const $=new Map;return _.length===0||(await Promise.all(a.map(async et=>(await getExistingContracts(_,et)).map(tt=>[tt,et.name])))).flat().forEach(([et,tt])=>$.set(et,tt)),$},parseMultisigOperation=a=>{const{bigmap:_,key:$,value:j}=a;if($===null||j===null)throw new Error("parseMultisigOperation failed");return{id:$,bigmapId:_,rawActions:j.actions,approvals:j.approvals.map(parseImplicitPkh)}},getPendingOperationsForMultisigs=async(a,_)=>{if(a.length===0)return[];const $=a.map(et=>et.pendingOperationsBigmapId),j=await getPendingOperations($,_);return lodashExports.compact(j.map(parseMultisigOperation))},VERSION$1=6,mainStoreMigrations={0:a=>produce(a,_=>{_.multisigs.labelsMap={}}),1:a=>produce(a,_=>{_.announcement=initialState$9}),2:lodashExports.identity,3:a=>produce(a,_=>{_.networks.current.name==="ghostnet"&&(_.networks.current.buyTezUrl="https://faucet.ghostnet.teztnets.com/");for(const $ of _.networks.available)if($.name==="ghostnet"){$.buyTezUrl="https://faucet.ghostnet.teztnets.com/";break}}),4:lodashExports.identity,5:a=>produce(a,_=>{delete _.assets.transfers.tez}),6:async a=>{const _=Object.values(a.contacts).filter(tt=>isValidImplicitPkh(tt.pkh)).map(tt=>[tt.pkh,{...tt,network:void 0}]),$=Object.values(a.contacts).filter(tt=>isValidContractPkh(tt.pkh)).map(tt=>tt.pkh),et=[...(await getNetworksForContracts(a.networks.available,$)).entries()].map(([tt,rt])=>[tt,{...a.contacts[tt],network:rt}]);return produce(a,tt=>{tt.contacts=lodashExports.fromPairs([..._,...et])})}},accountsMigrations={0:lodashExports.identity,1:lodashExports.identity,2:a=>produce(a,_=>{_.items.forEach($=>{$.type==="secret_key"&&($.curve="ed25519")})}),3:lodashExports.identity,4:a=>produce(a,_=>{_.items.forEach($=>{$.type==="ledger"&&!$.derivationPathTemplate&&($.derivationPathTemplate=void 0,$.derivationPath==="44'/1729'/0'/0'"?$.derivationPathTemplate="44'/1729'/?'/0'":$.derivationPath==="44'/1729'/0'/0'/0'"&&($.derivationPathTemplate="44'/1729'/?'/0'/0'"))})}),5:lodashExports.identity,6:lodashExports.identity},AES_MODE="AES-GCM",BYTE_TO_BIT=8,KEY_SIZE=32,NUM_ITERATIONS_V2=6e5,NUM_ITERATIONS_V1=1e4,derivePasswordBasedKeyV1=async(a,_)=>derivePasswordBasedKey(Buffer$g.alloc(32,a,"utf-8"),_,NUM_ITERATIONS_V1),derivePasswordBasedKeyV2=async(a,_)=>derivePasswordBasedKey(Buffer$g.from(a,"utf-8"),_,NUM_ITERATIONS_V2),derivePasswordBasedKey=async(a,_,$)=>{const j={name:"PBKDF2",salt:_,iterations:$,hash:"SHA-256"},et=await crypto.subtle.importKey("raw",a,j.name,!1,["deriveKey"]);return await crypto.subtle.deriveKey(j,et,{name:AES_MODE,length:KEY_SIZE*BYTE_TO_BIT},!1,["encrypt","decrypt"])},SALT_SIZE=32,IV_SIZE=12,encrypt$1=async(a,_)=>{const $=crypto.getRandomValues(new Uint8Array(SALT_SIZE)),j=await derivePasswordBasedKeyV2(_,$),et=crypto.getRandomValues(new Uint8Array(IV_SIZE)),tt=await crypto.subtle.encrypt({name:AES_MODE,iv:et},j,Buffer$g.from(a,"utf-8"));return{iv:buf2hex(Buffer$g.from(et)),salt:buf2hex(Buffer$g.from($)),data:buf2hex(Buffer$g.from(tt))}},decrypt$1=async(a,_,$="V2")=>{const{iv:j,salt:et,data:tt}=a;try{const rt=$==="V2"?await derivePasswordBasedKeyV2(_,hex2Bytes(et)):await derivePasswordBasedKeyV1(_,hex2Bytes(et)),nt=await crypto.subtle.decrypt({name:AES_MODE,iv:hex2Bytes(j)},rt,hex2Bytes(tt));return Buffer$g.from(nt).toString("utf-8")}catch{throw new Error("Error decrypting data: Invalid password")}},changeMnemonicPassword=createAsyncThunk("accounts/changeMnemonicPassword",async({currentPassword:a,newPassword:_},{getState:$})=>{if(a===_)throw new Error("New password must be different from the current password");const{items:j,seedPhrases:et}=$().accounts;if(j.filter(rt=>rt.type==="mnemonic").length===0)throw new Error("No mnemonic accounts found");const tt=await Promise.all(Object.entries(et).map(async([rt,nt])=>{if(!nt)throw new Error("No encrypted mnemonic found");try{const it=await decrypt$1(nt,a),st=await encrypt$1(it,_);return[rt,st]}catch(it){throw new Error(it.message)}}));return{newEncryptedMnemonics:lodashExports.fromPairs(tt)}}),initialState$8={items:[],seedPhrases:{},secretKeys:{}},accountsSlice=createSlice({name:"accounts",initialState:initialState$8,extraReducers:a=>{a.addCase(changeMnemonicPassword.fulfilled,(_,$)=>{const{newEncryptedMnemonics:j}=$.payload;_.seedPhrases=j})},reducers:{reset:()=>initialState$8,removeMnemonicAndAccounts:(a,{payload:_})=>{const{fingerPrint:$}=_,j=a.items.filter(et=>!(et.type==="mnemonic"&&et.seedFingerPrint===$));a.items=j,delete a.seedPhrases[$]},removeNonMnemonicAccounts:(a,{payload:_})=>{a.items=lodashExports.remove(a.items,$=>$.type==="mnemonic"||$.type!==_.accountType),_.accountType==="secret_key"&&(a.secretKeys={})},removeAccount:(a,{payload:_})=>{lodashExports.remove(a.items,$=>$.address.pkh===_.address.pkh),_.type==="secret_key"&&delete a.secretKeys[_.address.pkh]},renameAccount:(a,{payload:_})=>{const{account:$,newName:j}=_;if(j.length===0)throw new Error("Cannot rename account to an empty name.");if(a.items.find(tt=>tt.label===j))throw new Error(`Cannot rename account ${$.address.pkh} to ${j} since the name already exists.`);const et=a.items.find(tt=>tt.address.pkh===$.address.pkh&&tt.label===$.label);et&&(et.label=j)},addAccount:(a,{payload:_})=>{a.items=concatUnique(a.items,[_])},addMnemonicAccounts:(a,{payload:{encryptedMnemonic:_,accounts:$,seedFingerprint:j}})=>{a.items=concatUnique(a.items,$),a.seedPhrases[j]=_},addSecretKey:(a,{payload:{pkh:_,encryptedSecretKey:$}})=>{a.secretKeys[_]=$}}}),concatUnique=(a,_)=>(_.forEach($=>{if(a.some(j=>j.address.pkh===$.address.pkh))throw new Error(`Can't add account with address ${$.address.pkh} because it already exists.`)}),[...a,..._]);accountsSlice.actions;const FA12TokenSchema=z.object({standard:z.string().regex(/^fa1\.2$/i),contract:Schema$1}),FA2TokenSchema=z.object({standard:z.string().regex(/^fa2$/i),tokenId:z.string(),contract:Schema$1}),NFTSchema=z.object({id:z.number(),standard:z.string().regex(/^fa2$/i),tokenId:z.string(),contract:Schema$1,totalSupply:z.string().optional(),metadata:z.object({displayUri:z.string(),decimals:z.void().or(z.string().regex(/^0$/))})}),fromRaw$1=a=>{const _=a.metadata;if(a.standard==="fa1.2"){const et=FA12TokenSchema.safeParse(a);return et.success?{type:"fa1.2",metadata:_,contract:et.data.contract.address,tokenId:"0"}:(console.warn("Invalid FA1 token: "+JSON.stringify(a)),null)}const $=NFTSchema.safeParse(a);if($.success)return{metadata:_,type:"nft",id:$.data.id,contract:$.data.contract.address,tokenId:$.data.tokenId,displayUri:$.data.metadata.displayUri,totalSupply:$.data.totalSupply};const j=FA2TokenSchema.safeParse(a);return j.success?{type:"fa2",metadata:_,contract:j.data.contract.address,tokenId:j.data.tokenId}:(console.warn("Invalid FA2 token: "+JSON.stringify(a)),null)},fullId=a=>`${a.contract}:${a.tokenId}`,defaultTokenName=a=>{switch(a.type){case"fa1.2":return DEFAULT_FA1_NAME;case"fa2":return DEFAULT_FA2_NAME;case"nft":return DEFAULT_NFT_NAME}},tokenNameSafe=a=>tokenName(a)||defaultTokenName(a),tokenName=a=>{var _;return(_=a.metadata)==null?void 0:_.name},defaultTokenSymbol=a=>{switch(a.type){case"fa1.2":return DEFAULT_FA1_SYMBOL;case"fa2":return DEFAULT_FA2_SYMBOL;case"nft":return DEFAULT_NFT_SYMBOL}},tokenSymbolSafe=a=>tokenSymbol(a)||defaultTokenSymbol(a),tokenSymbol=a=>{var _;return(_=a.metadata)==null?void 0:_.symbol},tokenDecimals=a=>{var _;return((_=a.metadata)==null?void 0:_.decimals)??DEFAULT_TOKEN_DECIMALS},getRealAmount=(a,_)=>{const $=new BigNumber(_),j=tokenDecimals(a);return $.multipliedBy(new BigNumber(10).exponentiatedBy(j)).toFixed()},formatTokenAmount=(a,_=DEFAULT_TOKEN_DECIMALS)=>{const $=BigNumber(a).dividedBy(BigNumber(10).pow(_));try{return new Intl.NumberFormat("en-US",{minimumFractionDigits:Number(_),maximumFractionDigits:Number(_)}).format($.toNumber())}catch{return console.warn(`Can't format token amount with decimals = ${_}`),formatTokenAmount(a,"0")}},tokenPrettyAmount=(a,_,$)=>{var nt;if(_.type==="nft")return a;const j=tokenSymbolSafe(_),et=(nt=_.metadata)==null?void 0:nt.decimals,tt=$!=null&&$.showSymbol?` ${j}`:"";return`${formatTokenAmount(a,et)}${tt}`},artifactUri=a=>a.metadata.artifactUri||a.displayUri,thumbnailUri=a=>a.metadata.thumbnailUri||a.displayUri,mimeType=a=>{var _,$;return($=(_=a.metadata.formats)==null?void 0:_.find(j=>j.uri===artifactUri(a)))==null?void 0:$.mimeType},royalties=a=>{const _=a.metadata.royalties;if(!_)return[];const $=Math.pow(10,Number(_.decimals)),j=Object.entries(_.shares).map(([et,tt])=>({address:et,share:Number(tt)*100/$}));return j.sort((et,tt)=>et.share`${tokenUri(a,_)}/metadata`,tokenUri=({contract:a,tokenId:_},$)=>`${$.tzktExplorerUrl}/${a}/tokens/${_}`,DEFAULT_FA1_NAME="FA1.2 token",DEFAULT_FA2_NAME="FA2 token",DEFAULT_NFT_NAME="NFT",DEFAULT_FA1_SYMBOL="FA1.2",DEFAULT_FA2_SYMBOL="FA2",DEFAULT_NFT_SYMBOL="NFT",DEFAULT_TOKEN_DECIMALS="0",fromRaw=a=>{const _=fromRaw$1(a.token);return!_||!a.balance?null:{balance:a.balance,lastLevel:a.lastLevel,..._}},keepNFTs=a=>a.filter(_=>_.type==="nft"),keepFA1s=a=>a.filter(_=>_.type==="fa1.2"),keepFA2s=a=>a.filter(_=>_.type==="fa2"),initialState$7={blockLevel:null,balances:{mutez:{},tokens:{}},transfers:{tokens:{}},delegationLevels:{},bakers:[],conversionRate:void 0,refetchTrigger:0,isLoading:!1,lastTimeUpdated:null},assetsSlice=createSlice({name:"assets",initialState:initialState$7,extraReducers:a=>a.addCase(accountsSlice.actions.reset,()=>initialState$7),reducers:{reset:()=>initialState$7,updateBlockLevel:(a,{payload:_})=>{a.blockLevel=_},updateTokenTransfers:(a,{payload:_})=>{_.forEach($=>{a.transfers.tokens[$.transactionId]=$})},updateTezBalance:(a,{payload:_})=>{a.balances.mutez=_.reduce(($,j)=>({...$,[j.address]:String(j.balance)}),{}),a.delegationLevels=_.reduce(($,j)=>({...$,[j.address]:j.delegationLevel}),{})},updateTokenBalance:(a,{payload:_})=>{const $=lodashExports.groupBy(_,j=>j.account.address);a.balances.tokens=lodashExports.mapValues($,j=>lodashExports.compact(j.map(fromRaw)).map(({balance:et,contract:tt,tokenId:rt,lastLevel:nt})=>({balance:et,contract:tt,tokenId:rt,lastLevel:nt})))},removeAccountsData:(a,{payload:_})=>{_.forEach($=>{delete a.balances.mutez[$],delete a.balances.tokens[$],delete a.delegationLevels[$]})},updateBakers:(a,{payload:_})=>{a.bakers=_},updateConversionRate:(a,{payload:_})=>{a.conversionRate=_},refetch:a=>{a.refetchTrigger+=1},setIsLoading:(a,{payload:_})=>{a.isLoading=_},setLastTimeUpdated:(a,{payload:_})=>{a.lastTimeUpdated=_}}}),assetsActions=assetsSlice.actions,MAINNET={name:"mainnet",rpcUrl:"https://prod.tcinfra.net/rpc/mainnet/",tzktApiUrl:"https://api.mainnet.tzkt.io",tzktExplorerUrl:"https://tzkt.io",buyTezUrl:"https://widget.wert.io"},GHOSTNET={name:"ghostnet",rpcUrl:"https://ghostnet.ecadinfra.com",tzktApiUrl:"https://api.ghostnet.tzkt.io",tzktExplorerUrl:"https://ghostnet.tzkt.io",buyTezUrl:"https://faucet.ghostnet.teztnets.com/"},isDefault=a=>DefaultNetworks.map(_=>_.name).includes(a.name),DefaultNetworks=[MAINNET,GHOSTNET],initialState$6=lodashExports.fromPairs(DefaultNetworks.map(a=>[a.name,[]])),batchesSlice=createSlice({name:"batches",initialState:initialState$6,reducers:{reset:()=>initialState$6,add:(a,{payload:{operations:_,network:$}})=>{$.name in a||(a[$.name]=[]);const j=a[$.name],et=j.find(tt=>tt.sender.address.pkh===_.sender.address.pkh);if(et){et.operations.push(..._.operations);return}j.push(_)},clear:(a,{payload:{pkh:_,network:$}})=>{const j=a[$.name]||[],et=lodashExports.findIndex(j,tt=>tt.sender.address.pkh===_);et!==-1&&j.splice(et,1)},removeItem:(a,{payload:{pkh:_,index:$,network:j}})=>{const et=a[j.name]||[],tt=lodashExports.findIndex(et,nt=>nt.sender.address.pkh===_);if(tt===-1)return;const rt=et[tt];$lodashExports.fromPairs(Object.entries(a).map(([$,j])=>{const et=(j||[]).filter(tt=>!_.includes(tt.sender.address.pkh));return[$,et]}))}}),batchesActions=batchesSlice.actions,initialState$5={},beaconSlice=createSlice({name:"beacon",initialState:initialState$5,reducers:{reset:()=>initialState$5,addConnection:(a,{payload:_})=>{a[_.dAppId]={accountPkh:_.accountPkh,networkType:_.networkType}},removeConnection:(a,{payload:_})=>{delete a[_]},removeConnections:(a,{payload:_})=>lodashExports.fromPairs(Object.entries(a).filter(([$,j])=>!_.includes(j.accountPkh)))}});beaconSlice.actions;const initialState$4={},contactsSlice=createSlice({name:"contacts",initialState:initialState$4,reducers:{reset:()=>initialState$4,upsert:(a,{payload:_})=>{a[_.pkh]=_},remove:(a,{payload:_})=>{delete a[_]}}}),contactsActions=contactsSlice.actions,MAX_ERRORS_LEN=100,initialState$3=[],errorsSlice=createSlice({name:"errors",initialState:initialState$3,reducers:{reset:()=>initialState$3,add(a,{payload:_}){a.length===MAX_ERRORS_LEN&&a.shift(),a.push(_)}}}),initialState$2={items:[],pendingOperations:{},labelsMap:{}},multisigsSlice=createSlice({name:"multisigs",initialState:initialState$2,reducers:{reset:()=>initialState$2,mockAddAccount:(a,{payload:_})=>{a.items.push({label:`Multisig Account ${a.items.length}`,type:"multisig",..._})},setMultisigs:(a,{payload:_})=>{const $=lodashExports.fromPairs(a.items.map(j=>[j.address.pkh,j.label]));a.items=_.map((j,et)=>({...j,label:$[j.address.pkh]||a.labelsMap[j.address.pkh]||`Multisig Account ${et}`,type:"multisig"}))},addMultisigLabel:(a,{payload:{pkh:_,label:$}})=>{a.labelsMap[_]=$},setPendingOperations:(a,{payload:_})=>{a.pendingOperations=lodashExports.groupBy(_,$=>$.bigmapId)},setName:(a,{payload:_})=>{const{account:{address:{pkh:$}},newName:j}=_,et=a.items.find(tt=>tt.address.pkh===$);et&&(et.label=j)},removeMultisigsData:(a,{payload:_})=>{const $=a.items.filter(j=>_.includes(j.address.pkh)).map(j=>String(j.pendingOperationsBigmapId));a.pendingOperations=lodashExports.omit(a.pendingOperations,$),a.labelsMap=lodashExports.omit(a.labelsMap,_)}}}),multisigActions=multisigsSlice.actions,initialState$1={available:DefaultNetworks,current:MAINNET},networksSlice=createSlice({name:"networks",initialState:initialState$1,reducers:{reset:()=>initialState$1,setCurrent:(a,{payload:_})=>{a.current=_},upsertNetwork:(a,{payload:_})=>{if(isDefault(_))return;const $=a.available.findIndex(j=>j.name===_.name);if(a.current.name===_.name&&(a.current=_),$!==-1){a.available[$]=_;return}a.available.push(_)},removeNetwork:(a,{payload:_})=>{isDefault(_)||lodashExports.remove(a.available,$=>$.name===_.name)}}}),networksActions=networksSlice.actions,initialState=lodashExports.fromPairs(DefaultNetworks.map(a=>[a.name,{}])),tokensSlice=createSlice({name:"tokens",initialState,reducers:{reset:()=>initialState,addTokens:(a,{payload:{network:_,tokens:$}})=>{lodashExports.compact($.map(fromRaw$1)).forEach(j=>{lodashExports.setWith(a,[_.name,j.contract,j.tokenId],j,Object)})}}}),tokensActions=tokensSlice.actions,rootPersistConfig={key:"root",version:VERSION$1,storage:default_1,blacklist:["accounts"],migrate:createAsyncMigrate(mainStoreMigrations)},accountsPersistConfig={key:"accounts",version:VERSION$1,storage:default_1,migrate:createAsyncMigrate(accountsMigrations)},rootReducers=combineReducers({accounts:persistReducer(accountsPersistConfig,accountsSlice.reducer),announcement:announcementSlice.reducer,assets:assetsSlice.reducer,batches:batchesSlice.reducer,beacon:beaconSlice.reducer,contacts:contactsSlice.reducer,errors:errorsSlice.reducer,multisigs:multisigsSlice.reducer,networks:networksSlice.reducer,tokens:tokensSlice.reducer}),reducer=persistReducer(rootPersistConfig,rootReducers),store=configureStore({reducer,middleware:a=>a({serializableCheck:{ignoredActions:[FLUSH,REHYDRATE,PAUSE,PERSIST,PURGE,REGISTER]}})}),persistor=persistStore(store),FormErrorMessage=({children:a,..._})=>jsxRuntimeExports.jsxs(FormErrorMessage$1,{color:colors.orange,fontSize:"12px",..._,children:[jsxRuntimeExports.jsx(Icon,{as:ExclamationIcon,marginRight:"6px"}),a]}),CONFIRMATION_CODE="wasabi",reset=()=>WalletClient.destroy().catch(lodashExports.noop).finally(()=>{persistor.pause(),localStorage.clear(),window.location.reload()}),OffboardingForm=()=>{const a=useForm({mode:"onBlur"}),{register:_,handleSubmit:$,formState:{isValid:j,errors:et},getValues:tt}=a,rt=()=>{if(!(!tt("check")||tt("confirmationCode")!==CONFIRMATION_CODE))return reset()};return jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsxs("form",{onSubmit:$(rt),children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalHeader,{marginBottom:"10px",textAlign:"center",children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(WarningIcon,{width:"40px",height:"40px",marginBottom:"20px"}),jsxRuntimeExports.jsx(Heading,{children:"Off-board Wallet"})]})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text,{marginBottom:"8px",color:colors.gray[400],fontWeight:"bold",textAlign:"center",size:"sm",children:"This will permanently remove any data from this computer."}),jsxRuntimeExports.jsxs(Text,{color:colors.gray[400],textAlign:"center",size:"sm",children:["Please enter « ",CONFIRMATION_CODE," » to confirm. The accounts are still available to be imported in the future; in order to regain access to your accounts, please make sure that you keep the recovery phrase."]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Divider,{borderColor:colors.gray[700],marginY:"20px"}),jsxRuntimeExports.jsx(FormControl,{isInvalid:!!et.check,children:jsxRuntimeExports.jsx(Checkbox,{..._("check",{required:!0}),children:jsxRuntimeExports.jsx(Text,{marginLeft:"8px",fontWeight:"bold",children:"I have read the warning and I am certain I want to remove my private keys locally. I also made sure to keep my recovery phrase."})})}),jsxRuntimeExports.jsx(Divider,{borderColor:colors.gray[700],marginY:"20px"}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!et.confirmationCode,paddingY:5,children:[jsxRuntimeExports.jsx(Input,{type:"text",..._("confirmationCode",{required:"Confirmation is required",validate:nt=>nt===CONFIRMATION_CODE||"Confirmation code does not match"}),placeholder:"Enter code word to confirm"}),et.confirmationCode&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.confirmationCode.message})]})]})]}),jsxRuntimeExports.jsx(ModalFooter,{padding:0,children:jsxRuntimeExports.jsx(Button,{width:"100%",marginBottom:"8px",isDisabled:!j,size:"lg",type:"submit",variant:"warning",children:"Confirm"})})]})})},useOffboardingModal=()=>{const{isOpen:a,onOpen:_,onClose:$}=useDisclosure$1();return{modalElement:jsxRuntimeExports.jsxs(Modal,{isCentered:!0,isOpen:a,onClose:$,children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[900],children:jsxRuntimeExports.jsx(OffboardingForm,{})})]}),onOpen:_}},CircleIcon=({icon:a,size:_,onClick:$=()=>{}})=>jsxRuntimeExports.jsx(Box,{width:_,height:_,margin:"auto",background:colors.gray[700],borderRadius:"full",onClick:$,children:jsxRuntimeExports.jsx(Center,{height:"100%",children:a})}),ModalContentWrapper=({children:a,icon:_,title:$,subtitle:j})=>jsxRuntimeExports.jsxs(VStack,{maxHeight:"83vh",spacing:0,children:[jsxRuntimeExports.jsx(Box,{marginBottom:"16px",children:jsxRuntimeExports.jsx(CircleIcon,{icon:_,size:"48px"})}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",width:"340px",marginBottom:"32px",children:[jsxRuntimeExports.jsx(Heading,{lineHeight:"26px",size:"xl",children:$}),j&&jsxRuntimeExports.jsx(Text,{marginTop:"10px",color:colors.gray[400],lineHeight:"18px",textAlign:"center",size:"sm",children:j})]}),a]}),name="umami",productName="umami",version="2.1.0",author="Trilitech ",description="Tezos Wallet",homepage="https://umamiwallet.com",repository="https://github.com/trilitech/umami-v2",license="MIT",engines={node:">=20 <21.0.0"},type$5="commonjs",main="build/electron.js",scripts={build:"vite build",dev:"vite dev",preview:"vite preview","electron:package:linux":"electron-builder -l","electron:package:mac":"electron-builder -m","electron:package:mac:debug":"yarn electron:package:mac -c electron-builder.dev.yml","electron:package:win":"electron-builder -w","electron:start":"electronmon .",docs:"typedoc --tsconfig tsconfig.e2e.json","format:ci":"prettier --check .",format:"prettier --write .","lint:ci":"eslint src --ext .js,.jsx,.ts,.tsx --max-warnings=0",lint:"eslint src --ext .js,.jsx,.ts,.tsx --fix",test:"cross-env TZ=CET jest","test:watch":"yarn test --watch","test:e2e":"cross-env TS_NODE_PROJECT=tsconfig.e2e.json cucumber-js","test:e2e:focus":"yarn test:e2e --tags='@focus'","theme:watch":"chakra-cli tokens src/style/theme.ts --watch",theme:"chakra-cli tokens src/style/theme.ts"},devDependencies={"@airgap/beacon-wallet":"^4.2.2","@babel/core":"^7.24.5","@babel/preset-env":"^7.24.5","@babel/preset-react":"^7.24.1","@babel/preset-typescript":"^7.24.1","@babel/runtime":"^7.24.5","@chakra-ui/anatomy":"2.2.2","@chakra-ui/cli":"^2.4.1","@chakra-ui/icons":"^2.1.1","@chakra-ui/react":"^2.8.2","@chakra-ui/styled-system":"2.9.2","@chakra-ui/system":"^2.6.2","@chriscdn/promise-semaphore":"^2.0.9","@cucumber/cucumber":"^10.7.0","@electron/notarize":"^2.3.2","@emotion/react":"^11.11.4","@emotion/styled":"^11.11.5","@ledgerhq/hw-transport-webusb":"^6.28.6","@playwright/test":"^1.44.0","@reduxjs/toolkit":"^2.2.5","@stylistic/eslint-plugin":"^2.1.0","@tanstack/eslint-plugin-query":"^5.35.6","@tanstack/react-query":"^5.37.1","@tanstack/react-query-devtools":"^5.37.1","@taquito/ledger-signer":"^19.2.1","@taquito/michel-codec":"^19.2.1","@taquito/rpc":"^19.2.1","@taquito/signer":"^19.2.1","@taquito/taquito":"19.2.1","@taquito/utils":"^19.2.1","@testing-library/dom":"^10.1.0","@testing-library/jest-dom":"6.4.5","@testing-library/react":"14.3.0","@testing-library/user-event":"14.5.2","@toruslabs/customauth":"^15.0.5","@types/babel__core":"^7","@types/babel__preset-env":"^7","@types/identity-obj-proxy":"^3","@types/jest":"^29.5.12","@types/md5":"^2.3.5","@types/node":"20.12.12","@types/papaparse":"^5.3.14","@types/pluralize":"^0.0.33","@types/promise-retry":"^1.1.6","@types/react":"18.3.2","@types/react-dom":"18.3.0","@types/react-test-renderer":"^18","@typescript-eslint/eslint-plugin":"^7.9.0","@typescript-eslint/parser":"^7.9.0","@tzkt/sdk-api":"^2.2.1","@vitejs/plugin-react":"^4.2.1",axios:"^1.7.1","babel-jest":"^29.7.0","bignumber.js":"^9.1.2",bip39:"^3.1.0",concurrently:"^8.2.2","cross-env":"^7.0.3","date-fns":"^3.6.0",electron:"^30.0.6","electron-builder":"^24.13.3",electronmon:"^2.0.3",eslint:"^8.57.0","eslint-import-resolver-typescript":"^3.6.1","eslint-plugin-chakra-ui":"^0.11.0","eslint-plugin-deprecation":"^2.0.0","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^28.5.0","eslint-plugin-jest-dom":"^5.4.0","eslint-plugin-react":"^7.34.1","eslint-plugin-react-hooks":"^4.6.2","eslint-plugin-react-redux":"^4.1.0","eslint-plugin-testing-library":"^6.2.2","eslint-plugin-tsdoc":"^0.2.17","eslint-plugin-unused-imports":"^3.2.0","framer-motion":"^11.2.4","http-server":"^14.1.1","identity-obj-proxy":"^3.0.0",immer:"^10.1.1",jest:"29.7.0","jest-canvas-mock":"^2.5.2","jest-environment-jsdom":"^29.7.0","jest-fail-on-console":"^3.3.0","jest-resolve":"29.7.0","jest-watch-typeahead":"^2.2.2",lodash:"^4.17.21",md5:"^2.3.0",mockdate:"^3.0.5",ordinal:"^1.0.3",papaparse:"^5.4.1",pluralize:"^8.0.0",prettier:"^3.2.5","prettier-plugin-gherkin":"^2.2.1",process:"^0.11.10","promise-retry":"^2.0.1",react:"^18.3.1","react-dom":"^18.3.1","react-error-boundary":"^4.0.13","react-hook-form":"^7.51.4","react-hooks-testing-library":"^0.6.0","react-player":"^2.16.0","react-qrcode-logo":"^2.10.0","react-redux":"9.1.2","react-refresh":"^0.14.2","react-remove-scroll":"^2.5.10","react-responsive-carousel":"^3.2.23","react-router-dom":"^6.23.1","react-test-renderer":"^18.3.1",redux:"^5.0.1","redux-persist":"^6.0.0","ts-node":"^10.9.2",typedoc:"^0.25.13","typedoc-plugin-missing-exports":"^2.2.0",typescript:"5.4.5",vite:"^5.2.11","vite-plugin-checker":"^0.6.4","vite-plugin-node-polyfills":"^0.22.0",zipurl:"^0.2.18",zod:"^3.23.8"},packageManager="yarn@4.2.2",dependencies={"electron-updater":"^6.2.1"},resolutions={jsdom:"^23.0.1","@types/jsdom":"^21.1.6"},packageInfo={name,productName,version,author,description,homepage,repository,license,engines,type:type$5,main,scripts,devDependencies,packageManager,dependencies,resolutions};var withSelector={exports:{}},useSyncExternalStoreWithSelector_production_min={};/** +`+new Array(a.length+4).join(" "):et<_.length-2&&(j+=" ")}console.log(j)}function testSpeed(a,_,$){let j=new Date().getTime();const et=new Uint8Array(_);for(let rt=0;rt<_;rt++)et[rt]=rt%256;const tt=new Date().getTime();console.log("Generated random input in "+(tt-j)+"ms"),j=tt;for(let rt=0;rt<$;rt++){const nt=a(et),it=new Date().getTime(),st=it-j;j=it,console.log("Hashed in "+st+"ms: "+nt.substring(0,20)+"..."),console.log(Math.round(_/(1<<20)/(st/1e3)*100)/100+" MB PER SECOND")}}var util$3={normalizeInput,toHex,debugPrint,testSpeed};const util$2=util$3;function ADD64AA(a,_,$){const j=a[_]+a[$];let et=a[_+1]+a[$+1];j>=4294967296&&et++,a[_]=j,a[_+1]=et}function ADD64AC(a,_,$,j){let et=a[_]+$;$<0&&(et+=4294967296);let tt=a[_+1]+j;et>=4294967296&&tt++,a[_]=et,a[_+1]=tt}function B2B_GET32(a,_){return a[_]^a[_+1]<<8^a[_+2]<<16^a[_+3]<<24}function B2B_G(a,_,$,j,et,tt){const rt=m$1[et],nt=m$1[et+1],it=m$1[tt],st=m$1[tt+1];ADD64AA(v$2,a,_),ADD64AC(v$2,a,rt,nt);let ot=v$2[j]^v$2[a],at=v$2[j+1]^v$2[a+1];v$2[j]=at,v$2[j+1]=ot,ADD64AA(v$2,$,j),ot=v$2[_]^v$2[$],at=v$2[_+1]^v$2[$+1],v$2[_]=ot>>>24^at<<8,v$2[_+1]=at>>>24^ot<<8,ADD64AA(v$2,a,_),ADD64AC(v$2,a,it,st),ot=v$2[j]^v$2[a],at=v$2[j+1]^v$2[a+1],v$2[j]=ot>>>16^at<<16,v$2[j+1]=at>>>16^ot<<16,ADD64AA(v$2,$,j),ot=v$2[_]^v$2[$],at=v$2[_+1]^v$2[$+1],v$2[_]=at>>>31^ot<<1,v$2[_+1]=ot>>>31^at<<1}const BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[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],SIGMA82=new Uint8Array(SIGMA8.map(function(a){return a*2})),v$2=new Uint32Array(32),m$1=new Uint32Array(32);function blake2bCompress(a,_){let $=0;for($=0;$<16;$++)v$2[$]=a.h[$],v$2[$+16]=BLAKE2B_IV32[$];for(v$2[24]=v$2[24]^a.t,v$2[25]=v$2[25]^a.t/4294967296,_&&(v$2[28]=~v$2[28],v$2[29]=~v$2[29]),$=0;$<32;$++)m$1[$]=B2B_GET32(a.b,4*$);for($=0;$<12;$++)B2B_G(0,8,16,24,SIGMA82[$*16+0],SIGMA82[$*16+1]),B2B_G(2,10,18,26,SIGMA82[$*16+2],SIGMA82[$*16+3]),B2B_G(4,12,20,28,SIGMA82[$*16+4],SIGMA82[$*16+5]),B2B_G(6,14,22,30,SIGMA82[$*16+6],SIGMA82[$*16+7]),B2B_G(0,10,20,30,SIGMA82[$*16+8],SIGMA82[$*16+9]),B2B_G(2,12,22,24,SIGMA82[$*16+10],SIGMA82[$*16+11]),B2B_G(4,14,16,26,SIGMA82[$*16+12],SIGMA82[$*16+13]),B2B_G(6,8,18,28,SIGMA82[$*16+14],SIGMA82[$*16+15]);for($=0;$<16;$++)a.h[$]=a.h[$]^v$2[$]^v$2[$+16]}const parameterBlock=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 blake2bInit(a,_,$,j){if(a===0||a>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(_&&_.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if($&&$.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(j&&j.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const et={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:a};parameterBlock.fill(0),parameterBlock[0]=a,_&&(parameterBlock[1]=_.length),parameterBlock[2]=1,parameterBlock[3]=1,$&¶meterBlock.set($,32),j&¶meterBlock.set(j,48);for(let tt=0;tt<16;tt++)et.h[tt]=BLAKE2B_IV32[tt]^B2B_GET32(parameterBlock,tt*4);return _&&(blake2bUpdate(et,_),et.c=128),et}function blake2bUpdate(a,_){for(let $=0;$<_.length;$++)a.c===128&&(a.t+=a.c,blake2bCompress(a,!1),a.c=0),a.b[a.c++]=_[$]}function blake2bFinal(a){for(a.t+=a.c;a.c<128;)a.b[a.c++]=0;blake2bCompress(a,!0);const _=new Uint8Array(a.outlen);for(let $=0;$>2]>>8*($&3);return _}function blake2b(a,_,$,j,et){$=$||64,a=util$2.normalizeInput(a),j&&(j=util$2.normalizeInput(j)),et&&(et=util$2.normalizeInput(et));const tt=blake2bInit($,_,j,et);return blake2bUpdate(tt,a),blake2bFinal(tt)}function blake2bHex(a,_,$,j,et){const tt=blake2b(a,_,$,j,et);return util$2.toHex(tt)}var blake2b_1={blake2b,blake2bHex,blake2bInit,blake2bUpdate,blake2bFinal};const util$1=util$3;function B2S_GET32(a,_){return a[_]^a[_+1]<<8^a[_+2]<<16^a[_+3]<<24}function B2S_G(a,_,$,j,et,tt){v$1[a]=v$1[a]+v$1[_]+et,v$1[j]=ROTR32(v$1[j]^v$1[a],16),v$1[$]=v$1[$]+v$1[j],v$1[_]=ROTR32(v$1[_]^v$1[$],12),v$1[a]=v$1[a]+v$1[_]+tt,v$1[j]=ROTR32(v$1[j]^v$1[a],8),v$1[$]=v$1[$]+v$1[j],v$1[_]=ROTR32(v$1[_]^v$1[$],7)}function ROTR32(a,_){return a>>>_^a<<32-_}const BLAKE2S_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SIGMA=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]),v$1=new Uint32Array(16),m=new Uint32Array(16);function blake2sCompress(a,_){let $=0;for($=0;$<8;$++)v$1[$]=a.h[$],v$1[$+8]=BLAKE2S_IV[$];for(v$1[12]^=a.t,v$1[13]^=a.t/4294967296,_&&(v$1[14]=~v$1[14]),$=0;$<16;$++)m[$]=B2S_GET32(a.b,4*$);for($=0;$<10;$++)B2S_G(0,4,8,12,m[SIGMA[$*16+0]],m[SIGMA[$*16+1]]),B2S_G(1,5,9,13,m[SIGMA[$*16+2]],m[SIGMA[$*16+3]]),B2S_G(2,6,10,14,m[SIGMA[$*16+4]],m[SIGMA[$*16+5]]),B2S_G(3,7,11,15,m[SIGMA[$*16+6]],m[SIGMA[$*16+7]]),B2S_G(0,5,10,15,m[SIGMA[$*16+8]],m[SIGMA[$*16+9]]),B2S_G(1,6,11,12,m[SIGMA[$*16+10]],m[SIGMA[$*16+11]]),B2S_G(2,7,8,13,m[SIGMA[$*16+12]],m[SIGMA[$*16+13]]),B2S_G(3,4,9,14,m[SIGMA[$*16+14]],m[SIGMA[$*16+15]]);for($=0;$<8;$++)a.h[$]^=v$1[$]^v$1[$+8]}function blake2sInit(a,_){if(!(a>0&&a<=32))throw new Error("Incorrect output length, should be in [1, 32]");const $=_?_.length:0;if(_&&!($>0&&$<=32))throw new Error("Incorrect key length, should be in [1, 32]");const j={h:new Uint32Array(BLAKE2S_IV),b:new Uint8Array(64),c:0,t:0,outlen:a};return j.h[0]^=16842752^$<<8^a,$>0&&(blake2sUpdate(j,_),j.c=64),j}function blake2sUpdate(a,_){for(let $=0;$<_.length;$++)a.c===64&&(a.t+=a.c,blake2sCompress(a,!1),a.c=0),a.b[a.c++]=_[$]}function blake2sFinal(a){for(a.t+=a.c;a.c<64;)a.b[a.c++]=0;blake2sCompress(a,!0);const _=new Uint8Array(a.outlen);for(let $=0;$>2]>>8*($&3)&255;return _}function blake2s(a,_,$){$=$||32,a=util$1.normalizeInput(a);const j=blake2sInit($,_);return blake2sUpdate(j,a),blake2sFinal(j)}function blake2sHex(a,_,$){const j=blake2s(a,_,$);return util$1.toHex(j)}var blake2s_1={blake2s,blake2sHex,blake2sInit,blake2sUpdate,blake2sFinal};const b2b=blake2b_1,b2s=blake2s_1;var blakejs={blake2b:b2b.blake2b,blake2bHex:b2b.blake2bHex,blake2bInit:b2b.blake2bInit,blake2bUpdate:b2b.blake2bUpdate,blake2bFinal:b2b.blake2bFinal,blake2s:b2s.blake2s,blake2sHex:b2s.blake2sHex,blake2sInit:b2s.blake2sInit,blake2sUpdate:b2s.blake2sUpdate,blake2sFinal:b2s.blake2sFinal};const blake=getDefaultExportFromCjs$1(blakejs);var sha256$2={},_sha2={},_assert={};Object.defineProperty(_assert,"__esModule",{value:!0});_assert.output=_assert.exists=_assert.hash=_assert.bytes=_assert.bool=_assert.number=void 0;function number$1(a){if(!Number.isSafeInteger(a)||a<0)throw new Error(`Wrong positive integer: ${a}`)}_assert.number=number$1;function bool$1(a){if(typeof a!="boolean")throw new Error(`Expected boolean, not ${a}`)}_assert.bool=bool$1;function bytes(a,..._){if(!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length>0&&!_.includes(a.length))throw new TypeError(`Expected Uint8Array of length ${_}, not of length=${a.length}`)}_assert.bytes=bytes;function hash$2(a){if(typeof a!="function"||typeof a.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$1(a.outputLen),number$1(a.blockLen)}_assert.hash=hash$2;function exists(a,_=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(_&&a.finished)throw new Error("Hash#digest() has already been called")}_assert.exists=exists;function output(a,_){bytes(a);const $=_.outputLen;if(a.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}_assert.output=output;const assert$a={number:number$1,bool:bool$1,bytes,hash:hash$2,exists,output};_assert.default=assert$a;var utils$e={},crypto$1={};Object.defineProperty(crypto$1,"__esModule",{value:!0});crypto$1.crypto=void 0;crypto$1.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(a){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(a,"__esModule",{value:!0}),a.randomBytes=a.wrapConstructorWithOpts=a.wrapConstructor=a.checkOpts=a.Hash=a.concatBytes=a.toBytes=a.utf8ToBytes=a.asyncLoop=a.nextTick=a.hexToBytes=a.bytesToHex=a.isLE=a.rotr=a.createView=a.u32=a.u8=void 0;const _=crypto$1,$=Bt=>new Uint8Array(Bt.buffer,Bt.byteOffset,Bt.byteLength);a.u8=$;const j=Bt=>new Uint32Array(Bt.buffer,Bt.byteOffset,Math.floor(Bt.byteLength/4));a.u32=j;const et=Bt=>new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);a.createView=et;const tt=(Bt,Dt)=>Bt<<32-Dt|Bt>>>Dt;if(a.rotr=tt,a.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!a.isLE)throw new Error("Non little-endian hardware is not supported");const rt=Array.from({length:256},(Bt,Dt)=>Dt.toString(16).padStart(2,"0"));function nt(Bt){if(!(Bt instanceof Uint8Array))throw new Error("Uint8Array expected");let Dt="";for(let zt=0;zt{};a.nextTick=st;async function ot(Bt,Dt,zt){let Ot=Date.now();for(let It=0;It=0&&LtOt instanceof Uint8Array))throw new Error("Uint8Array list expected");if(Bt.length===1)return Bt[0];const Dt=Bt.reduce((Ot,It)=>Ot+It.length,0),zt=new Uint8Array(Dt);for(let Ot=0,It=0;OtObject.prototype.toString.call(Bt)==="[object Object]"&&Bt.constructor===Object;function Ct(Bt,Dt){if(Dt!==void 0&&(typeof Dt!="object"||!wt(Dt)))throw new TypeError("Options should be object or undefined");return Object.assign(Bt,Dt)}a.checkOpts=Ct;function Pt(Bt){const Dt=Ot=>Bt().update(ut(Ot)).digest(),zt=Bt();return Dt.outputLen=zt.outputLen,Dt.blockLen=zt.blockLen,Dt.create=()=>Bt(),Dt}a.wrapConstructor=Pt;function $t(Bt){const Dt=(Ot,It)=>Bt(It).update(ut(Ot)).digest(),zt=Bt({});return Dt.outputLen=zt.outputLen,Dt.blockLen=zt.blockLen,Dt.create=Ot=>Bt(Ot),Dt}a.wrapConstructorWithOpts=$t;function Mt(Bt=32){if(_.crypto&&typeof _.crypto.getRandomValues=="function")return _.crypto.getRandomValues(new Uint8Array(Bt));throw new Error("crypto.getRandomValues must be defined")}a.randomBytes=Mt})(utils$e);Object.defineProperty(_sha2,"__esModule",{value:!0});_sha2.SHA2=void 0;const _assert_js_1$2=_assert,utils_js_1$4=utils$e;function setBigUint64(a,_,$,j){if(typeof a.setBigUint64=="function")return a.setBigUint64(_,$,j);const et=BigInt(32),tt=BigInt(4294967295),rt=Number($>>et&tt),nt=Number($&tt),it=j?4:0,st=j?0:4;a.setUint32(_+it,rt,j),a.setUint32(_+st,nt,j)}class SHA2 extends utils_js_1$4.Hash{constructor(_,$,j,et){super(),this.blockLen=_,this.outputLen=$,this.padOffset=j,this.isLE=et,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(_),this.view=(0,utils_js_1$4.createView)(this.buffer)}update(_){_assert_js_1$2.default.exists(this);const{view:$,buffer:j,blockLen:et}=this;_=(0,utils_js_1$4.toBytes)(_);const tt=_.length;for(let rt=0;rtet-rt&&(this.process(j,0),rt=0);for(let at=rt;atot.length)throw new Error("_sha2: outputLen bigger than state");for(let at=0;ata&_^~a&$,Maj=(a,_,$)=>a&_^a&$^_&$,SHA256_K=new Uint32Array([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]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends _sha2_js_1$1.SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:_,B:$,C:j,D:et,E:tt,F:rt,G:nt,H:it}=this;return[_,$,j,et,tt,rt,nt,it]}set(_,$,j,et,tt,rt,nt,it){this.A=_|0,this.B=$|0,this.C=j|0,this.D=et|0,this.E=tt|0,this.F=rt|0,this.G=nt|0,this.H=it|0}process(_,$){for(let at=0;at<16;at++,$+=4)SHA256_W[at]=_.getUint32($,!1);for(let at=16;at<64;at++){const ut=SHA256_W[at-15],ht=SHA256_W[at-2],yt=(0,utils_js_1$3.rotr)(ut,7)^(0,utils_js_1$3.rotr)(ut,18)^ut>>>3,wt=(0,utils_js_1$3.rotr)(ht,17)^(0,utils_js_1$3.rotr)(ht,19)^ht>>>10;SHA256_W[at]=wt+SHA256_W[at-7]+yt+SHA256_W[at-16]|0}let{A:j,B:et,C:tt,D:rt,E:nt,F:it,G:st,H:ot}=this;for(let at=0;at<64;at++){const ut=(0,utils_js_1$3.rotr)(nt,6)^(0,utils_js_1$3.rotr)(nt,11)^(0,utils_js_1$3.rotr)(nt,25),ht=ot+ut+Chi(nt,it,st)+SHA256_K[at]+SHA256_W[at]|0,wt=((0,utils_js_1$3.rotr)(j,2)^(0,utils_js_1$3.rotr)(j,13)^(0,utils_js_1$3.rotr)(j,22))+Maj(j,et,tt)|0;ot=st,st=it,it=nt,nt=rt+ht|0,rt=tt,tt=et,et=j,j=ht+wt|0}j=j+this.A|0,et=et+this.B|0,tt=tt+this.C|0,rt=rt+this.D|0,nt=nt+this.E|0,it=it+this.F|0,st=st+this.G|0,ot=ot+this.H|0,this.set(j,et,tt,rt,nt,it,st,ot)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}sha256$2.sha256=(0,utils_js_1$3.wrapConstructor)(()=>new SHA256);sha256$2.sha224=(0,utils_js_1$3.wrapConstructor)(()=>new SHA224);function base$2(a){if(a.length>=255)throw new TypeError("Alphabet too long");for(var _=new Uint8Array(256),$=0;$<_.length;$++)_[$]=255;for(var j=0;j>>0,Mt=new Uint8Array($t);Ct!==Pt;){for(var Bt=ht[Ct],Dt=0,zt=$t-1;(Bt!==0||Dt>>0,Mt[zt]=Bt%rt>>>0,Bt=Bt/rt>>>0;if(Bt!==0)throw new Error("Non-zero carry");wt=Dt,Ct++}for(var Ot=$t-wt;Ot!==$t&&Mt[Ot]===0;)Ot++;for(var It=nt.repeat(yt);Ot<$t;++Ot)It+=a.charAt(Mt[Ot]);return It}function at(ht){if(typeof ht!="string")throw new TypeError("Expected String");if(ht.length===0)return new Uint8Array;for(var yt=0,wt=0,Ct=0;ht[yt]===nt;)wt++,yt++;for(var Pt=(ht.length-yt)*it+1>>>0,$t=new Uint8Array(Pt);ht[yt];){var Mt=_[ht.charCodeAt(yt)];if(Mt===255)return;for(var Bt=0,Dt=Pt-1;(Mt!==0||Bt>>0,$t[Dt]=Mt%256>>>0,Mt=Mt/256>>>0;if(Mt!==0)throw new Error("Non-zero carry");Ct=Bt,yt++}for(var zt=Pt-Ct;zt!==Pt&&$t[zt]===0;)zt++;for(var Ot=new Uint8Array(wt+(Pt-zt)),It=wt;zt!==Pt;)Ot[It++]=$t[zt++];return Ot}function ut(ht){var yt=at(ht);if(yt)return yt;throw new Error("Non-base"+rt+" character")}return{encode:ot,decodeUnsafe:at,decode:ut}}var src$1=base$2;const basex=src$1,ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var bs58=basex(ALPHABET),base58=bs58,base$1=function(a){function _(tt){var rt=Uint8Array.from(tt),nt=a(rt),it=rt.length+4,st=new Uint8Array(it);return st.set(rt,0),st.set(nt.subarray(0,4),rt.length),base58.encode(st,it)}function $(tt){var rt=tt.slice(0,-4),nt=tt.slice(-4),it=a(rt);if(!(nt[0]^it[0]|nt[1]^it[1]|nt[2]^it[2]|nt[3]^it[3]))return rt}function j(tt){var rt=base58.decodeUnsafe(tt);if(rt)return $(rt)}function et(tt){var rt=base58.decode(tt),nt=$(rt);if(!nt)throw new Error("Invalid checksum");return nt}return{encode:_,decode:et,decodeUnsafe:j}},{sha256:sha256$1}=sha256$2,bs58checkBase=base$1;function sha256x2(a){return sha256$1(sha256$1(a))}var bs58check=bs58checkBase(sha256x2);const bs58check$1=getDefaultExportFromCjs$1(bs58check);class TaquitoError extends Error{}class ParameterValidationError extends TaquitoError{}class RpcError extends TaquitoError{}class TezosToolkitConfigError extends TaquitoError{}class UnsupportedActionError extends TaquitoError{}class NetworkError extends TaquitoError{}class InvalidAddressError extends ParameterValidationError{constructor(_,$){super(),this.address=_,this.errorDetail=$,this.name="InvalidAddressError",this.message=`Invalid address "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidBlockHashError extends ParameterValidationError{constructor(_,$){super(),this.blockHash=_,this.errorDetail=$,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidAmountError extends ParameterValidationError{constructor(_){super(),this.amount=_,this.name="InvalidAmountError",this.message=`Invalid amount "${_}"`}}class InvalidDerivationPathError extends ParameterValidationError{constructor(_,$){super(),this.derivationPath=_,this.errorDetail=$,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidHexStringError extends ParameterValidationError{constructor(_,$){super(),this.hexString=_,this.errorDetail=$,this.name="InvalidHexStringError",this.message=`Invalid hex string "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidMessageError extends ParameterValidationError{constructor(_,$){super(),this.msg=_,this.errorDetail=$,this.name="InvalidMessageError",this.message=`Invalid message "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidViewParameterError extends ParameterValidationError{constructor(_,$,j,et){super(),this.viewName=_,this.sigs=$,this.args=j,this.cause=et,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(j)} received for name "${_}" expecting one of the following signatures ${JSON.stringify($)}.`}}class InvalidKeyError extends ParameterValidationError{constructor(_){super(),this.errorDetail=_,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=_?` ${_}.`:"."}}class InvalidPublicKeyError extends ParameterValidationError{constructor(_,$){super(),this.publicKey=_,this.errorDetail=$,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidContractAddressError extends ParameterValidationError{constructor(_,$){super(),this.contractAddress=_,this.errorDetail=$,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidChainIdError extends ParameterValidationError{constructor(_,$){super(),this.chainId=_,this.errorDetail=$,this.name="InvalidChainIdError",this.message=`Invalid chain id "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidKeyHashError extends ParameterValidationError{constructor(_,$){super(),this.keyHash=_,this.errorDetail=$,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidOperationHashError extends ParameterValidationError{constructor(_,$){super(),this.operationHash=_,this.errorDetail=$,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${_}"`,this.message+=$?` ${$}.`:"."}}class InvalidOperationKindError extends ParameterValidationError{constructor(_,$){super(),this.operationKind=_,this.errorDetail=$,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${_}"`,this.message+=$?` ${$}.`:"."}}class DeprecationError extends UnsupportedActionError{constructor(_){super(),this.message=_,this.name="DeprecationError"}}class ProhibitedActionError extends UnsupportedActionError{constructor(_){super(),this.message=_,this.name="ProhibitedActionError"}}class PublicKeyNotFoundError extends TaquitoError{constructor(_,$){super(),this.pkh=_,this.cause=$,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${_}" in either wallet or contract API.`}}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$2=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX$1=1e9;function clone(a){var _,$,j,et=$t.prototype={constructor:$t,toString:null,valueOf:null},tt=new $t(1),rt=20,nt=4,it=-7,st=21,ot=-1e7,at=1e7,ut=!1,ht=1,yt=0,wt={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Ct="0123456789abcdefghijklmnopqrstuvwxyz",Pt=!0;function $t(It,Lt){var Ft,jt,bt,vt,ct,dt,mt,xt,At=this;if(!(At instanceof $t))return new $t(It,Lt);if(Lt==null){if(It&&It._isBigNumber===!0){At.s=It.s,!It.c||It.e>at?At.c=At.e=null:It.e=10;ct/=10,vt++);vt>at?At.c=At.e=null:(At.e=vt,At.c=[It]);return}xt=String(It)}else{if(!isNumeric.test(xt=String(It)))return j(At,xt,dt);At.s=xt.charCodeAt(0)==45?(xt=xt.slice(1),-1):1}(vt=xt.indexOf("."))>-1&&(xt=xt.replace(".","")),(ct=xt.search(/e/i))>0?(vt<0&&(vt=ct),vt+=+xt.slice(ct+1),xt=xt.substring(0,ct)):vt<0&&(vt=xt.length)}else{if(intCheck(Lt,2,Ct.length,"Base"),Lt==10&&Pt)return At=new $t(It),zt(At,rt+At.e+1,nt);if(xt=String(It),dt=typeof It=="number"){if(It*0!=0)return j(At,xt,dt,Lt);if(At.s=1/It<0?(xt=xt.slice(1),-1):1,$t.DEBUG&&xt.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+It)}else At.s=xt.charCodeAt(0)===45?(xt=xt.slice(1),-1):1;for(Ft=Ct.slice(0,Lt),vt=ct=0,mt=xt.length;ctvt){vt=mt;continue}}else if(!bt&&(xt==xt.toUpperCase()&&(xt=xt.toLowerCase())||xt==xt.toLowerCase()&&(xt=xt.toUpperCase()))){bt=!0,ct=-1,vt=0;continue}return j(At,String(It),dt,Lt)}dt=!1,xt=$(xt,Lt,10,At.s),(vt=xt.indexOf("."))>-1?xt=xt.replace(".",""):vt=xt.length}for(ct=0;xt.charCodeAt(ct)===48;ct++);for(mt=xt.length;xt.charCodeAt(--mt)===48;);if(xt=xt.slice(ct,++mt)){if(mt-=ct,dt&&$t.DEBUG&&mt>15&&(It>MAX_SAFE_INTEGER$2||It!==mathfloor(It)))throw Error(tooManyDigits+At.s*It);if((vt=vt-ct-1)>at)At.c=At.e=null;else if(vt=-MAX$1&&bt<=MAX$1&&bt===mathfloor(bt)){if(jt[0]===0){if(bt===0&&jt.length===1)return!0;break e}if(Lt=(bt+1)%LOG_BASE,Lt<1&&(Lt+=LOG_BASE),String(jt[0]).length==Lt){for(Lt=0;Lt=BASE||Ft!==mathfloor(Ft))break e;if(Ft!==0)return!0}}}else if(jt===null&&bt===null&&(vt===null||vt===1||vt===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+It)},$t.maximum=$t.max=function(){return Bt(arguments,-1)},$t.minimum=$t.min=function(){return Bt(arguments,1)},$t.random=function(){var It=9007199254740992,Lt=Math.random()*It&2097151?function(){return mathfloor(Math.random()*It)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(Ft){var jt,bt,vt,ct,dt,mt=0,xt=[],At=new $t(tt);if(Ft==null?Ft=rt:intCheck(Ft,0,MAX$1),ct=mathceil(Ft/LOG_BASE),ut)if(crypto.getRandomValues){for(jt=crypto.getRandomValues(new Uint32Array(ct*=2));mt>>11),dt>=9e15?(bt=crypto.getRandomValues(new Uint32Array(2)),jt[mt]=bt[0],jt[mt+1]=bt[1]):(xt.push(dt%1e14),mt+=2);mt=ct/2}else if(crypto.randomBytes){for(jt=crypto.randomBytes(ct*=7);mt=9e15?crypto.randomBytes(7).copy(jt,mt):(xt.push(dt%1e14),mt+=7);mt=ct/7}else throw ut=!1,Error(bignumberError+"crypto unavailable");if(!ut)for(;mt=10;dt/=10,mt++);mtbt-1&&(dt[ct+1]==null&&(dt[ct+1]=0),dt[ct+1]+=dt[ct]/bt|0,dt[ct]%=bt)}return dt.reverse()}return function(Ft,jt,bt,vt,ct){var dt,mt,xt,At,Rt,St,Tt,Et,Nt=Ft.indexOf("."),tr=rt,ir=nt;for(Nt>=0&&(At=yt,yt=0,Ft=Ft.replace(".",""),Et=new $t(jt),St=Et.pow(Ft.length-Nt),yt=At,Et.c=Lt(toFixedPoint(coeffToString(St.c),St.e,"0"),10,bt,It),Et.e=Et.c.length),Tt=Lt(Ft,jt,bt,ct?(dt=Ct,It):(dt=It,Ct)),xt=At=Tt.length;Tt[--At]==0;Tt.pop());if(!Tt[0])return dt.charAt(0);if(Nt<0?--xt:(St.c=Tt,St.e=xt,St.s=vt,St=_(St,Et,tr,ir,bt),Tt=St.c,Rt=St.r,xt=St.e),mt=xt+tr+1,Nt=Tt[mt],At=bt/2,Rt=Rt||mt<0||Tt[mt+1]!=null,Rt=ir<4?(Nt!=null||Rt)&&(ir==0||ir==(St.s<0?3:2)):Nt>At||Nt==At&&(ir==4||Rt||ir==6&&Tt[mt-1]&1||ir==(St.s<0?8:7)),mt<1||!Tt[0])Ft=Rt?toFixedPoint(dt.charAt(1),-tr,dt.charAt(0)):dt.charAt(0);else{if(Tt.length=mt,Rt)for(--bt;++Tt[--mt]>bt;)Tt[mt]=0,mt||(++xt,Tt=[1].concat(Tt));for(At=Tt.length;!Tt[--At];);for(Nt=0,Ft="";Nt<=At;Ft+=dt.charAt(Tt[Nt++]));Ft=toFixedPoint(Ft,xt,dt.charAt(0))}return Ft}}(),_=function(){function It(jt,bt,vt){var ct,dt,mt,xt,At=0,Rt=jt.length,St=bt%SQRT_BASE,Tt=bt/SQRT_BASE|0;for(jt=jt.slice();Rt--;)mt=jt[Rt]%SQRT_BASE,xt=jt[Rt]/SQRT_BASE|0,ct=Tt*mt+xt*St,dt=St*mt+ct%SQRT_BASE*SQRT_BASE+At,At=(dt/vt|0)+(ct/SQRT_BASE|0)+Tt*xt,jt[Rt]=dt%vt;return At&&(jt=[At].concat(jt)),jt}function Lt(jt,bt,vt,ct){var dt,mt;if(vt!=ct)mt=vt>ct?1:-1;else for(dt=mt=0;dtbt[dt]?1:-1;break}return mt}function Ft(jt,bt,vt,ct){for(var dt=0;vt--;)jt[vt]-=dt,dt=jt[vt]1;jt.splice(0,1));}return function(jt,bt,vt,ct,dt){var mt,xt,At,Rt,St,Tt,Et,Nt,tr,ir,nr,Zt,Kt,Qt,Ht,qt,Jt,ur=jt.s==bt.s?1:-1,xr=jt.c,pr=bt.c;if(!xr||!xr[0]||!pr||!pr[0])return new $t(!jt.s||!bt.s||(xr?pr&&xr[0]==pr[0]:!pr)?NaN:xr&&xr[0]==0||!pr?ur*0:ur/0);for(Nt=new $t(ur),tr=Nt.c=[],xt=jt.e-bt.e,ur=vt+xt+1,dt||(dt=BASE,xt=bitFloor(jt.e/LOG_BASE)-bitFloor(bt.e/LOG_BASE),ur=ur/LOG_BASE|0),At=0;pr[At]==(xr[At]||0);At++);if(pr[At]>(xr[At]||0)&&xt--,ur<0)tr.push(1),Rt=!0;else{for(Qt=xr.length,qt=pr.length,At=0,ur+=2,St=mathfloor(dt/(pr[0]+1)),St>1&&(pr=It(pr,St,dt),xr=It(xr,St,dt),qt=pr.length,Qt=xr.length),Kt=qt,ir=xr.slice(0,qt),nr=ir.length;nr=dt/2&&Ht++;do{if(St=0,mt=Lt(pr,ir,qt,nr),mt<0){if(Zt=ir[0],qt!=nr&&(Zt=Zt*dt+(ir[1]||0)),St=mathfloor(Zt/Ht),St>1)for(St>=dt&&(St=dt-1),Tt=It(pr,St,dt),Et=Tt.length,nr=ir.length;Lt(Tt,ir,Et,nr)==1;)St--,Ft(Tt,qt=10;ur/=10,At++);zt(Nt,vt+(Nt.e=At+xt*LOG_BASE-1)+1,ct,Rt)}else Nt.e=xt,Nt.r=+Rt;return Nt}}();function Mt(It,Lt,Ft,jt){var bt,vt,ct,dt,mt;if(Ft==null?Ft=nt:intCheck(Ft,0,8),!It.c)return It.toString();if(bt=It.c[0],ct=It.e,Lt==null)mt=coeffToString(It.c),mt=jt==1||jt==2&&(ct<=it||ct>=st)?toExponential(mt,ct):toFixedPoint(mt,ct,"0");else if(It=zt(new $t(It),Lt,Ft),vt=It.e,mt=coeffToString(It.c),dt=mt.length,jt==1||jt==2&&(Lt<=vt||vt<=it)){for(;dtdt){if(--Lt>0)for(mt+=".";Lt--;mt+="0");}else if(Lt+=vt-dt,Lt>0)for(vt+1==dt&&(mt+=".");Lt--;mt+="0");return It.s<0&&bt?"-"+mt:mt}function Bt(It,Lt){for(var Ft,jt,bt=1,vt=new $t(It[0]);bt=10;bt/=10,jt++);return(Ft=jt+Ft*LOG_BASE-1)>at?It.c=It.e=null:Ft=10;dt/=10,bt++);if(vt=Lt-bt,vt<0)vt+=LOG_BASE,ct=Lt,mt=Rt[xt=0],At=mathfloor(mt/St[bt-ct-1]%10);else if(xt=mathceil((vt+1)/LOG_BASE),xt>=Rt.length)if(jt){for(;Rt.length<=xt;Rt.push(0));mt=At=0,bt=1,vt%=LOG_BASE,ct=vt-LOG_BASE+1}else break e;else{for(mt=dt=Rt[xt],bt=1;dt>=10;dt/=10,bt++);vt%=LOG_BASE,ct=vt-LOG_BASE+bt,At=ct<0?0:mathfloor(mt/St[bt-ct-1]%10)}if(jt=jt||Lt<0||Rt[xt+1]!=null||(ct<0?mt:mt%St[bt-ct-1]),jt=Ft<4?(At||jt)&&(Ft==0||Ft==(It.s<0?3:2)):At>5||At==5&&(Ft==4||jt||Ft==6&&(vt>0?ct>0?mt/St[bt-ct]:0:Rt[xt-1])%10&1||Ft==(It.s<0?8:7)),Lt<1||!Rt[0])return Rt.length=0,jt?(Lt-=It.e+1,Rt[0]=St[(LOG_BASE-Lt%LOG_BASE)%LOG_BASE],It.e=-Lt||0):Rt[0]=It.e=0,It;if(vt==0?(Rt.length=xt,dt=1,xt--):(Rt.length=xt+1,dt=St[LOG_BASE-vt],Rt[xt]=ct>0?mathfloor(mt/St[bt-ct]%St[ct])*dt:0),jt)for(;;)if(xt==0){for(vt=1,ct=Rt[0];ct>=10;ct/=10,vt++);for(ct=Rt[0]+=dt,dt=1;ct>=10;ct/=10,dt++);vt!=dt&&(It.e++,Rt[0]==BASE&&(Rt[0]=1));break}else{if(Rt[xt]+=dt,Rt[xt]!=BASE)break;Rt[xt--]=0,dt=1}for(vt=Rt.length;Rt[--vt]===0;Rt.pop());}It.e>at?It.c=It.e=null:It.e=st?toExponential(Lt,Ft):toFixedPoint(Lt,Ft,"0"),It.s<0?"-"+Lt:Lt)}return et.absoluteValue=et.abs=function(){var It=new $t(this);return It.s<0&&(It.s=1),It},et.comparedTo=function(It,Lt){return compare$c(this,new $t(It,Lt))},et.decimalPlaces=et.dp=function(It,Lt){var Ft,jt,bt,vt=this;if(It!=null)return intCheck(It,0,MAX$1),Lt==null?Lt=nt:intCheck(Lt,0,8),zt(new $t(vt),It+vt.e+1,Lt);if(!(Ft=vt.c))return null;if(jt=((bt=Ft.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,bt=Ft[bt])for(;bt%10==0;bt/=10,jt--);return jt<0&&(jt=0),jt},et.dividedBy=et.div=function(It,Lt){return _(this,new $t(It,Lt),rt,nt)},et.dividedToIntegerBy=et.idiv=function(It,Lt){return _(this,new $t(It,Lt),0,1)},et.exponentiatedBy=et.pow=function(It,Lt){var Ft,jt,bt,vt,ct,dt,mt,xt,At,Rt=this;if(It=new $t(It),It.c&&!It.isInteger())throw Error(bignumberError+"Exponent not an integer: "+Ot(It));if(Lt!=null&&(Lt=new $t(Lt)),dt=It.e>14,!Rt.c||!Rt.c[0]||Rt.c[0]==1&&!Rt.e&&Rt.c.length==1||!It.c||!It.c[0])return At=new $t(Math.pow(+Ot(Rt),dt?It.s*(2-isOdd(It)):+Ot(It))),Lt?At.mod(Lt):At;if(mt=It.s<0,Lt){if(Lt.c?!Lt.c[0]:!Lt.s)return new $t(NaN);jt=!mt&&Rt.isInteger()&&Lt.isInteger(),jt&&(Rt=Rt.mod(Lt))}else{if(It.e>9&&(Rt.e>0||Rt.e<-1||(Rt.e==0?Rt.c[0]>1||dt&&Rt.c[1]>=24e7:Rt.c[0]<8e13||dt&&Rt.c[0]<=9999975e7)))return vt=Rt.s<0&&isOdd(It)?-0:0,Rt.e>-1&&(vt=1/vt),new $t(mt?1/vt:vt);yt&&(vt=mathceil(yt/LOG_BASE+2))}for(dt?(Ft=new $t(.5),mt&&(It.s=1),xt=isOdd(It)):(bt=Math.abs(+Ot(It)),xt=bt%2),At=new $t(tt);;){if(xt){if(At=At.times(Rt),!At.c)break;vt?At.c.length>vt&&(At.c.length=vt):jt&&(At=At.mod(Lt))}if(bt){if(bt=mathfloor(bt/2),bt===0)break;xt=bt%2}else if(It=It.times(Ft),zt(It,It.e+1,1),It.e>14)xt=isOdd(It);else{if(bt=+Ot(It),bt===0)break;xt=bt%2}Rt=Rt.times(Rt),vt?Rt.c&&Rt.c.length>vt&&(Rt.c.length=vt):jt&&(Rt=Rt.mod(Lt))}return jt?At:(mt&&(At=tt.div(At)),Lt?At.mod(Lt):vt?zt(At,yt,nt,ct):At)},et.integerValue=function(It){var Lt=new $t(this);return It==null?It=nt:intCheck(It,0,8),zt(Lt,Lt.e+1,It)},et.isEqualTo=et.eq=function(It,Lt){return compare$c(this,new $t(It,Lt))===0},et.isFinite=function(){return!!this.c},et.isGreaterThan=et.gt=function(It,Lt){return compare$c(this,new $t(It,Lt))>0},et.isGreaterThanOrEqualTo=et.gte=function(It,Lt){return(Lt=compare$c(this,new $t(It,Lt)))===1||Lt===0},et.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},et.isLessThan=et.lt=function(It,Lt){return compare$c(this,new $t(It,Lt))<0},et.isLessThanOrEqualTo=et.lte=function(It,Lt){return(Lt=compare$c(this,new $t(It,Lt)))===-1||Lt===0},et.isNaN=function(){return!this.s},et.isNegative=function(){return this.s<0},et.isPositive=function(){return this.s>0},et.isZero=function(){return!!this.c&&this.c[0]==0},et.minus=function(It,Lt){var Ft,jt,bt,vt,ct=this,dt=ct.s;if(It=new $t(It,Lt),Lt=It.s,!dt||!Lt)return new $t(NaN);if(dt!=Lt)return It.s=-Lt,ct.plus(It);var mt=ct.e/LOG_BASE,xt=It.e/LOG_BASE,At=ct.c,Rt=It.c;if(!mt||!xt){if(!At||!Rt)return At?(It.s=-Lt,It):new $t(Rt?ct:NaN);if(!At[0]||!Rt[0])return Rt[0]?(It.s=-Lt,It):new $t(At[0]?ct:nt==3?-0:0)}if(mt=bitFloor(mt),xt=bitFloor(xt),At=At.slice(),dt=mt-xt){for((vt=dt<0)?(dt=-dt,bt=At):(xt=mt,bt=Rt),bt.reverse(),Lt=dt;Lt--;bt.push(0));bt.reverse()}else for(jt=(vt=(dt=At.length)<(Lt=Rt.length))?dt:Lt,dt=Lt=0;Lt0)for(;Lt--;At[Ft++]=0);for(Lt=BASE-1;jt>dt;){if(At[--jt]=0;){for(Ft=0,St=Zt[bt]%tr,Tt=Zt[bt]/tr|0,ct=mt,vt=bt+ct;vt>bt;)xt=nr[--ct]%tr,At=nr[ct]/tr|0,dt=Tt*xt+At*St,xt=St*xt+dt%tr*tr+Et[vt]+Ft,Ft=(xt/Nt|0)+(dt/tr|0)+Tt*At,Et[vt--]=xt%Nt;Et[vt]=Ft}return Ft?++jt:Et.splice(0,1),Dt(It,Et,jt)},et.negated=function(){var It=new $t(this);return It.s=-It.s||null,It},et.plus=function(It,Lt){var Ft,jt=this,bt=jt.s;if(It=new $t(It,Lt),Lt=It.s,!bt||!Lt)return new $t(NaN);if(bt!=Lt)return It.s=-Lt,jt.minus(It);var vt=jt.e/LOG_BASE,ct=It.e/LOG_BASE,dt=jt.c,mt=It.c;if(!vt||!ct){if(!dt||!mt)return new $t(bt/0);if(!dt[0]||!mt[0])return mt[0]?It:new $t(dt[0]?jt:bt*0)}if(vt=bitFloor(vt),ct=bitFloor(ct),dt=dt.slice(),bt=vt-ct){for(bt>0?(ct=vt,Ft=mt):(bt=-bt,Ft=dt),Ft.reverse();bt--;Ft.push(0));Ft.reverse()}for(bt=dt.length,Lt=mt.length,bt-Lt<0&&(Ft=mt,mt=dt,dt=Ft,Lt=bt),bt=0;Lt;)bt=(dt[--Lt]=dt[Lt]+mt[Lt]+bt)/BASE|0,dt[Lt]=BASE===dt[Lt]?0:dt[Lt]%BASE;return bt&&(dt=[bt].concat(dt),++ct),Dt(It,dt,ct)},et.precision=et.sd=function(It,Lt){var Ft,jt,bt,vt=this;if(It!=null&&It!==!!It)return intCheck(It,1,MAX$1),Lt==null?Lt=nt:intCheck(Lt,0,8),zt(new $t(vt),It,Lt);if(!(Ft=vt.c))return null;if(bt=Ft.length-1,jt=bt*LOG_BASE+1,bt=Ft[bt]){for(;bt%10==0;bt/=10,jt--);for(bt=Ft[0];bt>=10;bt/=10,jt++);}return It&&vt.e+1>jt&&(jt=vt.e+1),jt},et.shiftedBy=function(It){return intCheck(It,-MAX_SAFE_INTEGER$2,MAX_SAFE_INTEGER$2),this.times("1e"+It)},et.squareRoot=et.sqrt=function(){var It,Lt,Ft,jt,bt,vt=this,ct=vt.c,dt=vt.s,mt=vt.e,xt=rt+4,At=new $t("0.5");if(dt!==1||!ct||!ct[0])return new $t(!dt||dt<0&&(!ct||ct[0])?NaN:ct?vt:1/0);if(dt=Math.sqrt(+Ot(vt)),dt==0||dt==1/0?(Lt=coeffToString(ct),(Lt.length+mt)%2==0&&(Lt+="0"),dt=Math.sqrt(+Lt),mt=bitFloor((mt+1)/2)-(mt<0||mt%2),dt==1/0?Lt="5e"+mt:(Lt=dt.toExponential(),Lt=Lt.slice(0,Lt.indexOf("e")+1)+mt),Ft=new $t(Lt)):Ft=new $t(dt+""),Ft.c[0]){for(mt=Ft.e,dt=mt+xt,dt<3&&(dt=0);;)if(bt=Ft,Ft=At.times(bt.plus(_(vt,bt,xt,1))),coeffToString(bt.c).slice(0,dt)===(Lt=coeffToString(Ft.c)).slice(0,dt))if(Ft.e0&&Et>0){for(vt=Et%dt||dt,At=Tt.substr(0,vt);vt0&&(At+=xt+Tt.slice(vt)),St&&(At="-"+At)}jt=Rt?At+(Ft.decimalSeparator||"")+((mt=+Ft.fractionGroupSize)?Rt.replace(new RegExp("\\d{"+mt+"}\\B","g"),"$&"+(Ft.fractionGroupSeparator||"")):Rt):At}return(Ft.prefix||"")+jt+(Ft.suffix||"")},et.toFraction=function(It){var Lt,Ft,jt,bt,vt,ct,dt,mt,xt,At,Rt,St,Tt=this,Et=Tt.c;if(It!=null&&(dt=new $t(It),!dt.isInteger()&&(dt.c||dt.s!==1)||dt.lt(tt)))throw Error(bignumberError+"Argument "+(dt.isInteger()?"out of range: ":"not an integer: ")+Ot(dt));if(!Et)return new $t(Tt);for(Lt=new $t(tt),xt=Ft=new $t(tt),jt=mt=new $t(tt),St=coeffToString(Et),vt=Lt.e=St.length-Tt.e-1,Lt.c[0]=POWS_TEN[(ct=vt%LOG_BASE)<0?LOG_BASE+ct:ct],It=!It||dt.comparedTo(Lt)>0?vt>0?Lt:xt:dt,ct=at,at=1/0,dt=new $t(St),mt.c[0]=0;At=_(dt,Lt,0,1),bt=Ft.plus(At.times(jt)),bt.comparedTo(It)!=1;)Ft=jt,jt=bt,xt=mt.plus(At.times(bt=xt)),mt=bt,Lt=dt.minus(At.times(bt=Lt)),dt=bt;return bt=_(It.minus(Ft),jt,0,1),mt=mt.plus(bt.times(xt)),Ft=Ft.plus(bt.times(jt)),mt.s=xt.s=Tt.s,vt=vt*2,Rt=_(xt,jt,vt,nt).minus(Tt).abs().comparedTo(_(mt,Ft,vt,nt).minus(Tt).abs())<1?[xt,jt]:[mt,Ft],at=ct,Rt},et.toNumber=function(){return+Ot(this)},et.toPrecision=function(It,Lt){return It!=null&&intCheck(It,1,MAX$1),Mt(this,It,Lt,2)},et.toString=function(It){var Lt,Ft=this,jt=Ft.s,bt=Ft.e;return bt===null?jt?(Lt="Infinity",jt<0&&(Lt="-"+Lt)):Lt="NaN":(It==null?Lt=bt<=it||bt>=st?toExponential(coeffToString(Ft.c),bt):toFixedPoint(coeffToString(Ft.c),bt,"0"):It===10&&Pt?(Ft=zt(new $t(Ft),rt+bt+1,nt),Lt=toFixedPoint(coeffToString(Ft.c),Ft.e,"0")):(intCheck(It,2,Ct.length,"Base"),Lt=$(toFixedPoint(coeffToString(Ft.c),bt,"0"),10,It,jt,!0)),jt<0&&Ft.c[0]&&(Lt="-"+Lt)),Lt},et.valueOf=et.toJSON=function(){return Ot(this)},et._isBigNumber=!0,et[Symbol.toStringTag]="BigNumber",et[Symbol.for("nodejs.util.inspect.custom")]=et.valueOf,a!=null&&$t.set(a),$t}function bitFloor(a){var _=a|0;return a>0||a===_?_:_-1}function coeffToString(a){for(var _,$,j=1,et=a.length,tt=a[0]+"";jst^$?1:-1;for(nt=(it=et.length)<(st=tt.length)?it:st,rt=0;rttt[rt]^$?1:-1;return it==st?0:it>st^$?1:-1}function intCheck(a,_,$,j){if(a<_||a>$||a!==mathfloor(a))throw Error(bignumberError+(j||"Argument")+(typeof a=="number"?a<_||a>$?" out of range: ":" not an integer: ":" not a primitive number: ")+String(a))}function isOdd(a){var _=a.c.length-1;return bitFloor(a.e/LOG_BASE)==_&&a.c[_]%2!=0}function toExponential(a,_){return(a.length>1?a.charAt(0)+"."+a.slice(1):a)+(_<0?"e":"e+")+_}function toFixedPoint(a,_,$){var j,et;if(_<0){for(et=$+".";++_;et+=$);a=et+a}else if(j=a.length,++_>j){for(et=$,_-=j;--_;et+=$);a+=et}else _",license$1="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage$1="https://github.com/indutny/elliptic",devDependencies$1={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies$1={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0$1={name:name$1,version:version$1,description:description$1,main:main$1,files,scripts:scripts$1,repository:repository$1,keywords,author:author$1,license:license$1,bugs,homepage:homepage$1,devDependencies:devDependencies$1,dependencies:dependencies$1};var utils$d={};(function(a){var _=a,$=bnExports$1,j=minimalisticAssert,et=utils$v;_.assert=j,_.toArray=et.toArray,_.zero2=et.zero2,_.toHex=et.toHex,_.encode=et.encode;function tt(ot,at,ut){var ht=new Array(Math.max(ot.bitLength(),ut)+1);ht.fill(0);for(var yt=1<(yt>>1)-1?Pt=(yt>>1)-$t:Pt=$t,wt.isubn(Pt)):Pt=0,ht[Ct]=Pt,wt.iushrn(1)}return ht}_.getNAF=tt;function rt(ot,at){var ut=[[],[]];ot=ot.clone(),at=at.clone();for(var ht=0,yt=0,wt;ot.cmpn(-ht)>0||at.cmpn(-yt)>0;){var Ct=ot.andln(3)+ht&3,Pt=at.andln(3)+yt&3;Ct===3&&(Ct=-1),Pt===3&&(Pt=-1);var $t;Ct&1?(wt=ot.andln(7)+ht&7,(wt===3||wt===5)&&Pt===2?$t=-Ct:$t=Ct):$t=0,ut[0].push($t);var Mt;Pt&1?(wt=at.andln(7)+yt&7,(wt===3||wt===5)&&Ct===2?Mt=-Pt:Mt=Pt):Mt=0,ut[1].push(Mt),2*ht===$t+1&&(ht=1-ht),2*yt===Mt+1&&(yt=1-yt),ot.iushrn(1),at.iushrn(1)}return ut}_.getJSF=rt;function nt(ot,at,ut){var ht="_"+at;ot.prototype[at]=function(){return this[ht]!==void 0?this[ht]:this[ht]=ut.call(this)}}_.cachedProperty=nt;function it(ot){return typeof ot=="string"?_.toArray(ot,"hex"):ot}_.parseBytes=it;function st(ot){return new $(ot,"hex","le")}_.intFromLE=st})(utils$d);var curve={},BN$8=bnExports$1,utils$c=utils$d,getNAF=utils$c.getNAF,getJSF=utils$c.getJSF,assert$9=utils$c.assert;function BaseCurve(a,_){this.type=a,this.p=new BN$8(_.p,16),this.red=_.prime?BN$8.red(_.prime):BN$8.mont(this.p),this.zero=new BN$8(0).toRed(this.red),this.one=new BN$8(1).toRed(this.red),this.two=new BN$8(2).toRed(this.red),this.n=_.n&&new BN$8(_.n,16),this.g=_.g&&this.pointFromJSON(_.g,_.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var $=this.n&&this.p.div(this.n);!$||$.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base=BaseCurve;BaseCurve.prototype.point=function a(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function a(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function a(_,$){assert$9(_.precomputed);var j=_._getDoubles(),et=getNAF($,1,this._bitLength),tt=(1<=nt;st--)it=(it<<1)+et[st];rt.push(it)}for(var ot=this.jpoint(null,null,null),at=this.jpoint(null,null,null),ut=tt;ut>0;ut--){for(nt=0;nt=0;it--){for(var st=0;it>=0&&rt[it]===0;it--)st++;if(it>=0&&st++,nt=nt.dblp(st),it<0)break;var ot=rt[it];assert$9(ot!==0),_.type==="affine"?ot>0?nt=nt.mixedAdd(tt[ot-1>>1]):nt=nt.mixedAdd(tt[-ot-1>>1].neg()):ot>0?nt=nt.add(tt[ot-1>>1]):nt=nt.add(tt[-ot-1>>1].neg())}return _.type==="affine"?nt.toP():nt};BaseCurve.prototype._wnafMulAdd=function a(_,$,j,et,tt){var rt=this._wnafT1,nt=this._wnafT2,it=this._wnafT3,st=0,ot,at,ut;for(ot=0;ot=1;ot-=2){var yt=ot-1,wt=ot;if(rt[yt]!==1||rt[wt]!==1){it[yt]=getNAF(j[yt],rt[yt],this._bitLength),it[wt]=getNAF(j[wt],rt[wt],this._bitLength),st=Math.max(it[yt].length,st),st=Math.max(it[wt].length,st);continue}var Ct=[$[yt],null,null,$[wt]];$[yt].y.cmp($[wt].y)===0?(Ct[1]=$[yt].add($[wt]),Ct[2]=$[yt].toJ().mixedAdd($[wt].neg())):$[yt].y.cmp($[wt].y.redNeg())===0?(Ct[1]=$[yt].toJ().mixedAdd($[wt]),Ct[2]=$[yt].add($[wt].neg())):(Ct[1]=$[yt].toJ().mixedAdd($[wt]),Ct[2]=$[yt].toJ().mixedAdd($[wt].neg()));var Pt=[-3,-1,-5,-7,0,7,5,1,3],$t=getJSF(j[yt],j[wt]);for(st=Math.max($t[0].length,st),it[yt]=new Array(st),it[wt]=new Array(st),at=0;at=0;ot--){for(var Ot=0;ot>=0;){var It=!0;for(at=0;at=0&&Ot++,Dt=Dt.dblp(Ot),ot<0)break;for(at=0;at0?ut=nt[at][Lt-1>>1]:Lt<0&&(ut=nt[at][-Lt-1>>1].neg()),ut.type==="affine"?Dt=Dt.mixedAdd(ut):Dt=Dt.add(ut))}}for(ot=0;ot=Math.ceil((_.bitLength()+1)/$.step):!1};BasePoint.prototype._getDoubles=function a(_,$){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var j=[this],et=this,tt=0;tt<$;tt+=_){for(var rt=0;rt<_;rt++)et=et.dbl();j.push(et)}return{step:_,points:j}};BasePoint.prototype._getNAFPoints=function a(_){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var $=[this],j=(1<<_)-1,et=j===1?null:this.dbl(),tt=1;tt=0&&(ht=st,yt=ot),at.negative&&(at=at.neg(),ut=ut.neg()),ht.negative&&(ht=ht.neg(),yt=yt.neg()),[{a:at,b:ut},{a:ht,b:yt}]};ShortCurve.prototype._endoSplit=function a(_){var $=this.endo.basis,j=$[0],et=$[1],tt=et.b.mul(_).divRound(this.n),rt=j.b.neg().mul(_).divRound(this.n),nt=tt.mul(j.a),it=rt.mul(et.a),st=tt.mul(j.b),ot=rt.mul(et.b),at=_.sub(nt).sub(it),ut=st.add(ot).neg();return{k1:at,k2:ut}};ShortCurve.prototype.pointFromX=function a(_,$){_=new BN$7(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr().redMul(_).redIAdd(_.redMul(this.a)).redIAdd(this.b),et=j.redSqrt();if(et.redSqr().redSub(j).cmp(this.zero)!==0)throw new Error("invalid point");var tt=et.fromRed().isOdd();return($&&!tt||!$&&tt)&&(et=et.redNeg()),this.point(_,et)};ShortCurve.prototype.validate=function a(_){if(_.inf)return!0;var $=_.x,j=_.y,et=this.a.redMul($),tt=$.redSqr().redMul($).redIAdd(et).redIAdd(this.b);return j.redSqr().redISub(tt).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function a(_,$,j){for(var et=this._endoWnafT1,tt=this._endoWnafT2,rt=0;rt<_.length;rt++){var nt=this._endoSplit($[rt]),it=_[rt],st=it._getBeta();nt.k1.negative&&(nt.k1.ineg(),it=it.neg(!0)),nt.k2.negative&&(nt.k2.ineg(),st=st.neg(!0)),et[rt*2]=it,et[rt*2+1]=st,tt[rt*2]=nt.k1,tt[rt*2+1]=nt.k2}for(var ot=this._wnafMulAdd(1,et,tt,rt*2,j),at=0;at":""};Point$2.prototype.isInfinity=function a(){return this.inf};Point$2.prototype.add=function a(_){if(this.inf)return _;if(_.inf)return this;if(this.eq(_))return this.dbl();if(this.neg().eq(_))return this.curve.point(null,null);if(this.x.cmp(_.x)===0)return this.curve.point(null,null);var $=this.y.redSub(_.y);$.cmpn(0)!==0&&($=$.redMul(this.x.redSub(_.x).redInvm()));var j=$.redSqr().redISub(this.x).redISub(_.x),et=$.redMul(this.x.redSub(j)).redISub(this.y);return this.curve.point(j,et)};Point$2.prototype.dbl=function a(){if(this.inf)return this;var _=this.y.redAdd(this.y);if(_.cmpn(0)===0)return this.curve.point(null,null);var $=this.curve.a,j=this.x.redSqr(),et=_.redInvm(),tt=j.redAdd(j).redIAdd(j).redIAdd($).redMul(et),rt=tt.redSqr().redISub(this.x.redAdd(this.x)),nt=tt.redMul(this.x.redSub(rt)).redISub(this.y);return this.curve.point(rt,nt)};Point$2.prototype.getX=function a(){return this.x.fromRed()};Point$2.prototype.getY=function a(){return this.y.fromRed()};Point$2.prototype.mul=function a(_){return _=new BN$7(_,16),this.isInfinity()?this:this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve.endo?this.curve._endoWnafMulAdd([this],[_]):this.curve._wnafMul(this,_)};Point$2.prototype.mulAdd=function a(_,$,j){var et=[this,$],tt=[_,j];return this.curve.endo?this.curve._endoWnafMulAdd(et,tt):this.curve._wnafMulAdd(1,et,tt,2)};Point$2.prototype.jmulAdd=function a(_,$,j){var et=[this,$],tt=[_,j];return this.curve.endo?this.curve._endoWnafMulAdd(et,tt,!0):this.curve._wnafMulAdd(1,et,tt,2,!0)};Point$2.prototype.eq=function a(_){return this===_||this.inf===_.inf&&(this.inf||this.x.cmp(_.x)===0&&this.y.cmp(_.y)===0)};Point$2.prototype.neg=function a(_){if(this.inf)return this;var $=this.curve.point(this.x,this.y.redNeg());if(_&&this.precomputed){var j=this.precomputed,et=function(tt){return tt.neg()};$.precomputed={naf:j.naf&&{wnd:j.naf.wnd,points:j.naf.points.map(et)},doubles:j.doubles&&{step:j.doubles.step,points:j.doubles.points.map(et)}}}return $};Point$2.prototype.toJ=function a(){if(this.inf)return this.curve.jpoint(null,null,null);var _=this.curve.jpoint(this.x,this.y,this.curve.one);return _};function JPoint(a,_,$,j){Base$2.BasePoint.call(this,a,"jacobian"),_===null&&$===null&&j===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$7(0)):(this.x=new BN$7(_,16),this.y=new BN$7($,16),this.z=new BN$7(j,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$2(JPoint,Base$2.BasePoint);ShortCurve.prototype.jpoint=function a(_,$,j){return new JPoint(this,_,$,j)};JPoint.prototype.toP=function a(){if(this.isInfinity())return this.curve.point(null,null);var _=this.z.redInvm(),$=_.redSqr(),j=this.x.redMul($),et=this.y.redMul($).redMul(_);return this.curve.point(j,et)};JPoint.prototype.neg=function a(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function a(_){if(this.isInfinity())return _;if(_.isInfinity())return this;var $=_.z.redSqr(),j=this.z.redSqr(),et=this.x.redMul($),tt=_.x.redMul(j),rt=this.y.redMul($.redMul(_.z)),nt=_.y.redMul(j.redMul(this.z)),it=et.redSub(tt),st=rt.redSub(nt);if(it.cmpn(0)===0)return st.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ot=it.redSqr(),at=ot.redMul(it),ut=et.redMul(ot),ht=st.redSqr().redIAdd(at).redISub(ut).redISub(ut),yt=st.redMul(ut.redISub(ht)).redISub(rt.redMul(at)),wt=this.z.redMul(_.z).redMul(it);return this.curve.jpoint(ht,yt,wt)};JPoint.prototype.mixedAdd=function a(_){if(this.isInfinity())return _.toJ();if(_.isInfinity())return this;var $=this.z.redSqr(),j=this.x,et=_.x.redMul($),tt=this.y,rt=_.y.redMul($).redMul(this.z),nt=j.redSub(et),it=tt.redSub(rt);if(nt.cmpn(0)===0)return it.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var st=nt.redSqr(),ot=st.redMul(nt),at=j.redMul(st),ut=it.redSqr().redIAdd(ot).redISub(at).redISub(at),ht=it.redMul(at.redISub(ut)).redISub(tt.redMul(ot)),yt=this.z.redMul(nt);return this.curve.jpoint(ut,ht,yt)};JPoint.prototype.dblp=function a(_){if(_===0)return this;if(this.isInfinity())return this;if(!_)return this.dbl();var $;if(this.curve.zeroA||this.curve.threeA){var j=this;for($=0;$<_;$++)j=j.dbl();return j}var et=this.curve.a,tt=this.curve.tinv,rt=this.x,nt=this.y,it=this.z,st=it.redSqr().redSqr(),ot=nt.redAdd(nt);for($=0;$<_;$++){var at=rt.redSqr(),ut=ot.redSqr(),ht=ut.redSqr(),yt=at.redAdd(at).redIAdd(at).redIAdd(et.redMul(st)),wt=rt.redMul(ut),Ct=yt.redSqr().redISub(wt.redAdd(wt)),Pt=wt.redISub(Ct),$t=yt.redMul(Pt);$t=$t.redIAdd($t).redISub(ht);var Mt=ot.redMul(it);$+1<_&&(st=st.redMul(ht)),rt=Ct,it=Mt,ot=$t}return this.curve.jpoint(rt,ot.redMul(tt),it)};JPoint.prototype.dbl=function a(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};JPoint.prototype._zeroDbl=function a(){var _,$,j;if(this.zOne){var et=this.x.redSqr(),tt=this.y.redSqr(),rt=tt.redSqr(),nt=this.x.redAdd(tt).redSqr().redISub(et).redISub(rt);nt=nt.redIAdd(nt);var it=et.redAdd(et).redIAdd(et),st=it.redSqr().redISub(nt).redISub(nt),ot=rt.redIAdd(rt);ot=ot.redIAdd(ot),ot=ot.redIAdd(ot),_=st,$=it.redMul(nt.redISub(st)).redISub(ot),j=this.y.redAdd(this.y)}else{var at=this.x.redSqr(),ut=this.y.redSqr(),ht=ut.redSqr(),yt=this.x.redAdd(ut).redSqr().redISub(at).redISub(ht);yt=yt.redIAdd(yt);var wt=at.redAdd(at).redIAdd(at),Ct=wt.redSqr(),Pt=ht.redIAdd(ht);Pt=Pt.redIAdd(Pt),Pt=Pt.redIAdd(Pt),_=Ct.redISub(yt).redISub(yt),$=wt.redMul(yt.redISub(_)).redISub(Pt),j=this.y.redMul(this.z),j=j.redIAdd(j)}return this.curve.jpoint(_,$,j)};JPoint.prototype._threeDbl=function a(){var _,$,j;if(this.zOne){var et=this.x.redSqr(),tt=this.y.redSqr(),rt=tt.redSqr(),nt=this.x.redAdd(tt).redSqr().redISub(et).redISub(rt);nt=nt.redIAdd(nt);var it=et.redAdd(et).redIAdd(et).redIAdd(this.curve.a),st=it.redSqr().redISub(nt).redISub(nt);_=st;var ot=rt.redIAdd(rt);ot=ot.redIAdd(ot),ot=ot.redIAdd(ot),$=it.redMul(nt.redISub(st)).redISub(ot),j=this.y.redAdd(this.y)}else{var at=this.z.redSqr(),ut=this.y.redSqr(),ht=this.x.redMul(ut),yt=this.x.redSub(at).redMul(this.x.redAdd(at));yt=yt.redAdd(yt).redIAdd(yt);var wt=ht.redIAdd(ht);wt=wt.redIAdd(wt);var Ct=wt.redAdd(wt);_=yt.redSqr().redISub(Ct),j=this.y.redAdd(this.z).redSqr().redISub(ut).redISub(at);var Pt=ut.redSqr();Pt=Pt.redIAdd(Pt),Pt=Pt.redIAdd(Pt),Pt=Pt.redIAdd(Pt),$=yt.redMul(wt.redISub(_)).redISub(Pt)}return this.curve.jpoint(_,$,j)};JPoint.prototype._dbl=function a(){var _=this.curve.a,$=this.x,j=this.y,et=this.z,tt=et.redSqr().redSqr(),rt=$.redSqr(),nt=j.redSqr(),it=rt.redAdd(rt).redIAdd(rt).redIAdd(_.redMul(tt)),st=$.redAdd($);st=st.redIAdd(st);var ot=st.redMul(nt),at=it.redSqr().redISub(ot.redAdd(ot)),ut=ot.redISub(at),ht=nt.redSqr();ht=ht.redIAdd(ht),ht=ht.redIAdd(ht),ht=ht.redIAdd(ht);var yt=it.redMul(ut).redISub(ht),wt=j.redAdd(j).redMul(et);return this.curve.jpoint(at,yt,wt)};JPoint.prototype.trpl=function a(){if(!this.curve.zeroA)return this.dbl().add(this);var _=this.x.redSqr(),$=this.y.redSqr(),j=this.z.redSqr(),et=$.redSqr(),tt=_.redAdd(_).redIAdd(_),rt=tt.redSqr(),nt=this.x.redAdd($).redSqr().redISub(_).redISub(et);nt=nt.redIAdd(nt),nt=nt.redAdd(nt).redIAdd(nt),nt=nt.redISub(rt);var it=nt.redSqr(),st=et.redIAdd(et);st=st.redIAdd(st),st=st.redIAdd(st),st=st.redIAdd(st);var ot=tt.redIAdd(nt).redSqr().redISub(rt).redISub(it).redISub(st),at=$.redMul(ot);at=at.redIAdd(at),at=at.redIAdd(at);var ut=this.x.redMul(it).redISub(at);ut=ut.redIAdd(ut),ut=ut.redIAdd(ut);var ht=this.y.redMul(ot.redMul(st.redISub(ot)).redISub(nt.redMul(it)));ht=ht.redIAdd(ht),ht=ht.redIAdd(ht),ht=ht.redIAdd(ht);var yt=this.z.redAdd(nt).redSqr().redISub(j).redISub(it);return this.curve.jpoint(ut,ht,yt)};JPoint.prototype.mul=function a(_,$){return _=new BN$7(_,$),this.curve._wnafMul(this,_)};JPoint.prototype.eq=function a(_){if(_.type==="affine")return this.eq(_.toJ());if(this===_)return!0;var $=this.z.redSqr(),j=_.z.redSqr();if(this.x.redMul(j).redISub(_.x.redMul($)).cmpn(0)!==0)return!1;var et=$.redMul(this.z),tt=j.redMul(_.z);return this.y.redMul(tt).redISub(_.y.redMul(et)).cmpn(0)===0};JPoint.prototype.eqXToP=function a(_){var $=this.z.redSqr(),j=_.toRed(this.curve.red).redMul($);if(this.x.cmp(j)===0)return!0;for(var et=_.clone(),tt=this.curve.redN.redMul($);;){if(et.iadd(this.curve.n),et.cmp(this.curve.p)>=0)return!1;if(j.redIAdd(tt),this.x.cmp(j)===0)return!0}};JPoint.prototype.inspect=function a(){return this.isInfinity()?"":""};JPoint.prototype.isInfinity=function a(){return this.z.cmpn(0)===0};var BN$6=bnExports$1,inherits$1=inherits_browserExports,Base$1=base,utils$a=utils$d;function MontCurve(a){Base$1.call(this,"mont",a),this.a=new BN$6(a.a,16).toRed(this.red),this.b=new BN$6(a.b,16).toRed(this.red),this.i4=new BN$6(4).toRed(this.red).redInvm(),this.two=new BN$6(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$1(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function a(_){var $=_.normalize().x,j=$.redSqr(),et=j.redMul($).redAdd(j.redMul(this.a)).redAdd($),tt=et.redSqrt();return tt.redSqr().cmp(et)===0};function Point$1(a,_,$){Base$1.BasePoint.call(this,a,"projective"),_===null&&$===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$6(_,16),this.z=new BN$6($,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$1(Point$1,Base$1.BasePoint);MontCurve.prototype.decodePoint=function a(_,$){return this.point(utils$a.toArray(_,$),1)};MontCurve.prototype.point=function a(_,$){return new Point$1(this,_,$)};MontCurve.prototype.pointFromJSON=function a(_){return Point$1.fromJSON(this,_)};Point$1.prototype.precompute=function a(){};Point$1.prototype._encode=function a(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$1.fromJSON=function a(_,$){return new Point$1(_,$[0],$[1]||_.one)};Point$1.prototype.inspect=function a(){return this.isInfinity()?"":""};Point$1.prototype.isInfinity=function a(){return this.z.cmpn(0)===0};Point$1.prototype.dbl=function a(){var _=this.x.redAdd(this.z),$=_.redSqr(),j=this.x.redSub(this.z),et=j.redSqr(),tt=$.redSub(et),rt=$.redMul(et),nt=tt.redMul(et.redAdd(this.curve.a24.redMul(tt)));return this.curve.point(rt,nt)};Point$1.prototype.add=function a(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.diffAdd=function a(_,$){var j=this.x.redAdd(this.z),et=this.x.redSub(this.z),tt=_.x.redAdd(_.z),rt=_.x.redSub(_.z),nt=rt.redMul(j),it=tt.redMul(et),st=$.z.redMul(nt.redAdd(it).redSqr()),ot=$.x.redMul(nt.redISub(it).redSqr());return this.curve.point(st,ot)};Point$1.prototype.mul=function a(_){for(var $=_.clone(),j=this,et=this.curve.point(null,null),tt=this,rt=[];$.cmpn(0)!==0;$.iushrn(1))rt.push($.andln(1));for(var nt=rt.length-1;nt>=0;nt--)rt[nt]===0?(j=j.diffAdd(et,tt),et=et.dbl()):(et=j.diffAdd(et,tt),j=j.dbl());return et};Point$1.prototype.mulAdd=function a(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.jumlAdd=function a(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.eq=function a(_){return this.getX().cmp(_.getX())===0};Point$1.prototype.normalize=function a(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$1.prototype.getX=function a(){return this.normalize(),this.x.fromRed()};var utils$9=utils$d,BN$5=bnExports$1,inherits=inherits_browserExports,Base=base,assert$7=utils$9.assert;function EdwardsCurve(a){this.twisted=(a.a|0)!==1,this.mOneA=this.twisted&&(a.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",a),this.a=new BN$5(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$5(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$5(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$7(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(a.c|0)===1}inherits(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function a(_){return this.mOneA?_.redNeg():this.a.redMul(_)};EdwardsCurve.prototype._mulC=function a(_){return this.oneC?_:this.c.redMul(_)};EdwardsCurve.prototype.jpoint=function a(_,$,j,et){return this.point(_,$,j,et)};EdwardsCurve.prototype.pointFromX=function a(_,$){_=new BN$5(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr(),et=this.c2.redSub(this.a.redMul(j)),tt=this.one.redSub(this.c2.redMul(this.d).redMul(j)),rt=et.redMul(tt.redInvm()),nt=rt.redSqrt();if(nt.redSqr().redSub(rt).cmp(this.zero)!==0)throw new Error("invalid point");var it=nt.fromRed().isOdd();return($&&!it||!$&&it)&&(nt=nt.redNeg()),this.point(_,nt)};EdwardsCurve.prototype.pointFromY=function a(_,$){_=new BN$5(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr(),et=j.redSub(this.c2),tt=j.redMul(this.d).redMul(this.c2).redSub(this.a),rt=et.redMul(tt.redInvm());if(rt.cmp(this.zero)===0){if($)throw new Error("invalid point");return this.point(this.zero,_)}var nt=rt.redSqrt();if(nt.redSqr().redSub(rt).cmp(this.zero)!==0)throw new Error("invalid point");return nt.fromRed().isOdd()!==$&&(nt=nt.redNeg()),this.point(nt,_)};EdwardsCurve.prototype.validate=function a(_){if(_.isInfinity())return!0;_.normalize();var $=_.x.redSqr(),j=_.y.redSqr(),et=$.redMul(this.a).redAdd(j),tt=this.c2.redMul(this.one.redAdd(this.d.redMul($).redMul(j)));return et.cmp(tt)===0};function Point(a,_,$,j,et){Base.BasePoint.call(this,a,"projective"),_===null&&$===null&&j===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$5(_,16),this.y=new BN$5($,16),this.z=j?new BN$5(j,16):this.curve.one,this.t=et&&new BN$5(et,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits(Point,Base.BasePoint);EdwardsCurve.prototype.pointFromJSON=function a(_){return Point.fromJSON(this,_)};EdwardsCurve.prototype.point=function a(_,$,j,et){return new Point(this,_,$,j,et)};Point.fromJSON=function a(_,$){return new Point(_,$[0],$[1],$[2])};Point.prototype.inspect=function a(){return this.isInfinity()?"":""};Point.prototype.isInfinity=function a(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function a(){var _=this.x.redSqr(),$=this.y.redSqr(),j=this.z.redSqr();j=j.redIAdd(j);var et=this.curve._mulA(_),tt=this.x.redAdd(this.y).redSqr().redISub(_).redISub($),rt=et.redAdd($),nt=rt.redSub(j),it=et.redSub($),st=tt.redMul(nt),ot=rt.redMul(it),at=tt.redMul(it),ut=nt.redMul(rt);return this.curve.point(st,ot,ut,at)};Point.prototype._projDbl=function a(){var _=this.x.redAdd(this.y).redSqr(),$=this.x.redSqr(),j=this.y.redSqr(),et,tt,rt,nt,it,st;if(this.curve.twisted){nt=this.curve._mulA($);var ot=nt.redAdd(j);this.zOne?(et=_.redSub($).redSub(j).redMul(ot.redSub(this.curve.two)),tt=ot.redMul(nt.redSub(j)),rt=ot.redSqr().redSub(ot).redSub(ot)):(it=this.z.redSqr(),st=ot.redSub(it).redISub(it),et=_.redSub($).redISub(j).redMul(st),tt=ot.redMul(nt.redSub(j)),rt=ot.redMul(st))}else nt=$.redAdd(j),it=this.curve._mulC(this.z).redSqr(),st=nt.redSub(it).redSub(it),et=this.curve._mulC(_.redISub(nt)).redMul(st),tt=this.curve._mulC(nt).redMul($.redISub(j)),rt=nt.redMul(st);return this.curve.point(et,tt,rt)};Point.prototype.dbl=function a(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point.prototype._extAdd=function a(_){var $=this.y.redSub(this.x).redMul(_.y.redSub(_.x)),j=this.y.redAdd(this.x).redMul(_.y.redAdd(_.x)),et=this.t.redMul(this.curve.dd).redMul(_.t),tt=this.z.redMul(_.z.redAdd(_.z)),rt=j.redSub($),nt=tt.redSub(et),it=tt.redAdd(et),st=j.redAdd($),ot=rt.redMul(nt),at=it.redMul(st),ut=rt.redMul(st),ht=nt.redMul(it);return this.curve.point(ot,at,ht,ut)};Point.prototype._projAdd=function a(_){var $=this.z.redMul(_.z),j=$.redSqr(),et=this.x.redMul(_.x),tt=this.y.redMul(_.y),rt=this.curve.d.redMul(et).redMul(tt),nt=j.redSub(rt),it=j.redAdd(rt),st=this.x.redAdd(this.y).redMul(_.x.redAdd(_.y)).redISub(et).redISub(tt),ot=$.redMul(nt).redMul(st),at,ut;return this.curve.twisted?(at=$.redMul(it).redMul(tt.redSub(this.curve._mulA(et))),ut=nt.redMul(it)):(at=$.redMul(it).redMul(tt.redSub(et)),ut=this.curve._mulC(nt).redMul(it)),this.curve.point(ot,at,ut)};Point.prototype.add=function a(_){return this.isInfinity()?_:_.isInfinity()?this:this.curve.extended?this._extAdd(_):this._projAdd(_)};Point.prototype.mul=function a(_){return this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve._wnafMul(this,_)};Point.prototype.mulAdd=function a(_,$,j){return this.curve._wnafMulAdd(1,[this,$],[_,j],2,!1)};Point.prototype.jmulAdd=function a(_,$,j){return this.curve._wnafMulAdd(1,[this,$],[_,j],2,!0)};Point.prototype.normalize=function a(){if(this.zOne)return this;var _=this.z.redInvm();return this.x=this.x.redMul(_),this.y=this.y.redMul(_),this.t&&(this.t=this.t.redMul(_)),this.z=this.curve.one,this.zOne=!0,this};Point.prototype.neg=function a(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function a(){return this.normalize(),this.x.fromRed()};Point.prototype.getY=function a(){return this.normalize(),this.y.fromRed()};Point.prototype.eq=function a(_){return this===_||this.getX().cmp(_.getX())===0&&this.getY().cmp(_.getY())===0};Point.prototype.eqXToP=function a(_){var $=_.toRed(this.curve.red).redMul(this.z);if(this.x.cmp($)===0)return!0;for(var j=_.clone(),et=this.curve.redN.redMul(this.z);;){if(j.iadd(this.curve.n),j.cmp(this.curve.p)>=0)return!1;if($.redIAdd(et),this.x.cmp($)===0)return!0}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;(function(a){var _=a;_.base=base,_.short=short,_.mont=mont,_.edwards=edwards})(curve);var curves$2={},secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}(function(a){var _=a,$=hash$4,j=curve,et=utils$d,tt=et.assert;function rt(st){st.type==="short"?this.curve=new j.short(st):st.type==="edwards"?this.curve=new j.edwards(st):this.curve=new j.mont(st),this.g=this.curve.g,this.n=this.curve.n,this.hash=st.hash,tt(this.g.validate(),"Invalid curve"),tt(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}_.PresetCurve=rt;function nt(st,ot){Object.defineProperty(_,st,{configurable:!0,enumerable:!0,get:function(){var at=new rt(ot);return Object.defineProperty(_,st,{configurable:!0,enumerable:!0,value:at}),at}})}nt("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:$.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),nt("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:$.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),nt("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:$.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),nt("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:$.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),nt("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:$.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),nt("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$.sha256,gRed:!1,g:["9"]}),nt("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var it;try{it=requireSecp256k1()}catch{it=void 0}nt("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:$.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",it]})})(curves$2);var BN$4=bnExports$1,utils$8=utils$d,assert$6=utils$8.assert;function KeyPair$3(a,_){this.ec=a,this.priv=null,this.pub=null,_.priv&&this._importPrivate(_.priv,_.privEnc),_.pub&&this._importPublic(_.pub,_.pubEnc)}var key$1=KeyPair$3;KeyPair$3.fromPublic=function a(_,$,j){return $ instanceof KeyPair$3?$:new KeyPair$3(_,{pub:$,pubEnc:j})};KeyPair$3.fromPrivate=function a(_,$,j){return $ instanceof KeyPair$3?$:new KeyPair$3(_,{priv:$,privEnc:j})};KeyPair$3.prototype.validate=function a(){var _=this.getPublic();return _.isInfinity()?{result:!1,reason:"Invalid public key"}:_.validate()?_.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};KeyPair$3.prototype.getPublic=function a(_,$){return typeof _=="string"&&($=_,_=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),$?this.pub.encode($,_):this.pub};KeyPair$3.prototype.getPrivate=function a(_){return _==="hex"?this.priv.toString(16,2):this.priv};KeyPair$3.prototype._importPrivate=function a(_,$){this.priv=new BN$4(_,$||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair$3.prototype._importPublic=function a(_,$){if(_.x||_.y){this.ec.curve.type==="mont"?assert$6(_.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$6(_.x&&_.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(_.x,_.y);return}this.pub=this.ec.curve.decodePoint(_,$)};KeyPair$3.prototype.derive=function a(_){return _.validate()||assert$6(_.validate(),"public point not validated"),_.mul(this.priv).getX()};KeyPair$3.prototype.sign=function a(_,$,j){return this.ec.sign(_,this,$,j)};KeyPair$3.prototype.verify=function a(_,$){return this.ec.verify(_,$,this)};KeyPair$3.prototype.inspect=function a(){return""};var BN$3=bnExports$1,utils$7=utils$d,assert$5=utils$7.assert;function Signature$3(a,_){if(a instanceof Signature$3)return a;this._importDER(a,_)||(assert$5(a.r&&a.s,"Signature without r or s"),this.r=new BN$3(a.r,16),this.s=new BN$3(a.s,16),a.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=a.recoveryParam)}var signature$1=Signature$3;function Position(){this.place=0}function getLength(a,_){var $=a[_.place++];if(!($&128))return $;var j=$&15;if(j===0||j>4)return!1;for(var et=0,tt=0,rt=_.place;tt>>=0;return et<=127?!1:(_.place=rt,et)}function rmPadding(a){for(var _=0,$=a.length-1;!a[_]&&!(a[_+1]&128)&&_<$;)_++;return _===0?a:a.slice(_)}Signature$3.prototype._importDER=function a(_,$){_=utils$7.toArray(_,$);var j=new Position;if(_[j.place++]!==48)return!1;var et=getLength(_,j);if(et===!1||et+j.place!==_.length||_[j.place++]!==2)return!1;var tt=getLength(_,j);if(tt===!1)return!1;var rt=_.slice(j.place,tt+j.place);if(j.place+=tt,_[j.place++]!==2)return!1;var nt=getLength(_,j);if(nt===!1||_.length!==nt+j.place)return!1;var it=_.slice(j.place,nt+j.place);if(rt[0]===0)if(rt[1]&128)rt=rt.slice(1);else return!1;if(it[0]===0)if(it[1]&128)it=it.slice(1);else return!1;return this.r=new BN$3(rt),this.s=new BN$3(it),this.recoveryParam=null,!0};function constructLength(a,_){if(_<128){a.push(_);return}var $=1+(Math.log(_)/Math.LN2>>>3);for(a.push($|128);--$;)a.push(_>>>($<<3)&255);a.push(_)}Signature$3.prototype.toDER=function a(_){var $=this.r.toArray(),j=this.s.toArray();for($[0]&128&&($=[0].concat($)),j[0]&128&&(j=[0].concat(j)),$=rmPadding($),j=rmPadding(j);!j[0]&&!(j[1]&128);)j=j.slice(1);var et=[2];constructLength(et,$.length),et=et.concat($),et.push(2),constructLength(et,j.length);var tt=et.concat(j),rt=[48];return constructLength(rt,tt.length),rt=rt.concat(tt),utils$7.encode(rt,_)};var BN$2=bnExports$1,HmacDRBG=hmacDrbg,utils$6=utils$d,curves$1=curves$2,rand=requireBrorand(),assert$4=utils$6.assert,KeyPair$2=key$1,Signature$2=signature$1;function EC(a){if(!(this instanceof EC))return new EC(a);typeof a=="string"&&(assert$4(Object.prototype.hasOwnProperty.call(curves$1,a),"Unknown curve "+a),a=curves$1[a]),a instanceof curves$1.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),this.hash=a.hash||a.curve.hash}var ec$3=EC;EC.prototype.keyPair=function a(_){return new KeyPair$2(this,_)};EC.prototype.keyFromPrivate=function a(_,$){return KeyPair$2.fromPrivate(this,_,$)};EC.prototype.keyFromPublic=function a(_,$){return KeyPair$2.fromPublic(this,_,$)};EC.prototype.genKeyPair=function a(_){_||(_={});for(var $=new HmacDRBG({hash:this.hash,pers:_.pers,persEnc:_.persEnc||"utf8",entropy:_.entropy||rand(this.hash.hmacStrength),entropyEnc:_.entropy&&_.entropyEnc||"utf8",nonce:this.n.toArray()}),j=this.n.byteLength(),et=this.n.sub(new BN$2(2));;){var tt=new BN$2($.generate(j));if(!(tt.cmp(et)>0))return tt.iaddn(1),this.keyFromPrivate(tt)}};EC.prototype._truncateToN=function a(_,$){var j=_.byteLength()*8-this.n.bitLength();return j>0&&(_=_.ushrn(j)),!$&&_.cmp(this.n)>=0?_.sub(this.n):_};EC.prototype.sign=function a(_,$,j,et){typeof j=="object"&&(et=j,j=null),et||(et={}),$=this.keyFromPrivate($,j),_=this._truncateToN(new BN$2(_,16));for(var tt=this.n.byteLength(),rt=$.getPrivate().toArray("be",tt),nt=_.toArray("be",tt),it=new HmacDRBG({hash:this.hash,entropy:rt,nonce:nt,pers:et.pers,persEnc:et.persEnc||"utf8"}),st=this.n.sub(new BN$2(1)),ot=0;;ot++){var at=et.k?et.k(ot):new BN$2(it.generate(this.n.byteLength()));if(at=this._truncateToN(at,!0),!(at.cmpn(1)<=0||at.cmp(st)>=0)){var ut=this.g.mul(at);if(!ut.isInfinity()){var ht=ut.getX(),yt=ht.umod(this.n);if(yt.cmpn(0)!==0){var wt=at.invm(this.n).mul(yt.mul($.getPrivate()).iadd(_));if(wt=wt.umod(this.n),wt.cmpn(0)!==0){var Ct=(ut.getY().isOdd()?1:0)|(ht.cmp(yt)!==0?2:0);return et.canonical&&wt.cmp(this.nh)>0&&(wt=this.n.sub(wt),Ct^=1),new Signature$2({r:yt,s:wt,recoveryParam:Ct})}}}}}};EC.prototype.verify=function a(_,$,j,et){_=this._truncateToN(new BN$2(_,16)),j=this.keyFromPublic(j,et),$=new Signature$2($,"hex");var tt=$.r,rt=$.s;if(tt.cmpn(1)<0||tt.cmp(this.n)>=0||rt.cmpn(1)<0||rt.cmp(this.n)>=0)return!1;var nt=rt.invm(this.n),it=nt.mul(_).umod(this.n),st=nt.mul(tt).umod(this.n),ot;return this.curve._maxwellTrick?(ot=this.g.jmulAdd(it,j.getPublic(),st),ot.isInfinity()?!1:ot.eqXToP(tt)):(ot=this.g.mulAdd(it,j.getPublic(),st),ot.isInfinity()?!1:ot.getX().umod(this.n).cmp(tt)===0)};EC.prototype.recoverPubKey=function(a,_,$,j){assert$4((3&$)===$,"The recovery param is more than two bits"),_=new Signature$2(_,j);var et=this.n,tt=new BN$2(a),rt=_.r,nt=_.s,it=$&1,st=$>>1;if(rt.cmp(this.curve.p.umod(this.curve.n))>=0&&st)throw new Error("Unable to find sencond key candinate");st?rt=this.curve.pointFromX(rt.add(this.curve.n),it):rt=this.curve.pointFromX(rt,it);var ot=_.r.invm(et),at=et.sub(tt).mul(ot).umod(et),ut=nt.mul(ot).umod(et);return this.g.mulAdd(at,rt,ut)};EC.prototype.getKeyRecoveryParam=function(a,_,$,j){if(_=new Signature$2(_,j),_.recoveryParam!==null)return _.recoveryParam;for(var et=0;et<4;et++){var tt;try{tt=this.recoverPubKey(a,_,et)}catch{continue}if(tt.eq($))return et}throw new Error("Unable to find valid recovery factor")};var utils$5=utils$d,assert$3=utils$5.assert,parseBytes$3=utils$5.parseBytes,cachedProperty$1=utils$5.cachedProperty;function KeyPair$1(a,_){this.eddsa=a,this._secret=parseBytes$3(_.secret),a.isPoint(_.pub)?this._pub=_.pub:this._pubBytes=parseBytes$3(_.pub)}KeyPair$1.fromPublic=function a(_,$){return $ instanceof KeyPair$1?$:new KeyPair$1(_,{pub:$})};KeyPair$1.fromSecret=function a(_,$){return $ instanceof KeyPair$1?$:new KeyPair$1(_,{secret:$})};KeyPair$1.prototype.secret=function a(){return this._secret};cachedProperty$1(KeyPair$1,"pubBytes",function a(){return this.eddsa.encodePoint(this.pub())});cachedProperty$1(KeyPair$1,"pub",function a(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$1(KeyPair$1,"privBytes",function a(){var _=this.eddsa,$=this.hash(),j=_.encodingLength-1,et=$.slice(0,_.encodingLength);return et[0]&=248,et[j]&=127,et[j]|=64,et});cachedProperty$1(KeyPair$1,"priv",function a(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$1(KeyPair$1,"hash",function a(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$1(KeyPair$1,"messagePrefix",function a(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$1.prototype.sign=function a(_){return assert$3(this._secret,"KeyPair can only verify"),this.eddsa.sign(_,this)};KeyPair$1.prototype.verify=function a(_,$){return this.eddsa.verify(_,$,this)};KeyPair$1.prototype.getSecret=function a(_){return assert$3(this._secret,"KeyPair is public only"),utils$5.encode(this.secret(),_)};KeyPair$1.prototype.getPublic=function a(_){return utils$5.encode(this.pubBytes(),_)};var key=KeyPair$1,BN$1=bnExports$1,utils$4=utils$d,assert$2=utils$4.assert,cachedProperty=utils$4.cachedProperty,parseBytes$2=utils$4.parseBytes;function Signature$1(a,_){this.eddsa=a,typeof _!="object"&&(_=parseBytes$2(_)),Array.isArray(_)&&(_={R:_.slice(0,a.encodingLength),S:_.slice(a.encodingLength)}),assert$2(_.R&&_.S,"Signature without R or S"),a.isPoint(_.R)&&(this._R=_.R),_.S instanceof BN$1&&(this._S=_.S),this._Rencoded=Array.isArray(_.R)?_.R:_.Rencoded,this._Sencoded=Array.isArray(_.S)?_.S:_.Sencoded}cachedProperty(Signature$1,"S",function a(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature$1,"R",function a(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature$1,"Rencoded",function a(){return this.eddsa.encodePoint(this.R())});cachedProperty(Signature$1,"Sencoded",function a(){return this.eddsa.encodeInt(this.S())});Signature$1.prototype.toBytes=function a(){return this.Rencoded().concat(this.Sencoded())};Signature$1.prototype.toHex=function a(){return utils$4.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash$1=hash$4,curves=curves$2,utils$3=utils$d,assert$1=utils$3.assert,parseBytes$1=utils$3.parseBytes,KeyPair=key,Signature=signature;function EDDSA(a){if(assert$1(a==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(a);a=curves[a].curve,this.curve=a,this.g=a.g,this.g.precompute(a.n.bitLength()+1),this.pointClass=a.point().constructor,this.encodingLength=Math.ceil(a.n.bitLength()/8),this.hash=hash$1.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function a(_,$){_=parseBytes$1(_);var j=this.keyFromSecret($),et=this.hashInt(j.messagePrefix(),_),tt=this.g.mul(et),rt=this.encodePoint(tt),nt=this.hashInt(rt,j.pubBytes(),_).mul(j.priv()),it=et.add(nt).umod(this.curve.n);return this.makeSignature({R:tt,S:it,Rencoded:rt})};EDDSA.prototype.verify=function a(_,$,j){_=parseBytes$1(_),$=this.makeSignature($);var et=this.keyFromPublic(j),tt=this.hashInt($.Rencoded(),et.pubBytes(),_),rt=this.g.mul($.S()),nt=$.R().add(et.pub().mul(tt));return nt.eq(rt)};EDDSA.prototype.hashInt=function a(){for(var _=this.hash(),$=0;$bs58check$1.decode(a).slice(_.length);function b58decode(a){const _=bs58check$1.decode(a),j={[prefix.tz1.toString()]:"0000",[prefix.tz2.toString()]:"0001",[prefix.tz3.toString()]:"0002"}[new Uint8Array(_.slice(0,3)).toString()];if(j){const et=buf2hex(_.slice(3));return j+et}else return"01"+buf2hex(_.slice(3,42))+"00"}function encodeAddress(a){if(a.substring(0,2)==="0x"&&(a=a.slice(2)),a.substring(0,2)==="00"){const _={"0000":prefix.tz1,"0001":prefix.tz2,"0002":prefix.tz3};return b58cencode(a.substring(4),_[a.substring(0,4)])}return b58cencode(a.substring(2,42),prefix.KT)}function encodeKey(a){if(a[0]==="0"){const _={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return b58cencode(a.substring(2),_[a.substring(0,2)])}}function encodeKeyHash(a){if(a[0]==="0"){const _={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return b58cencode(a.substring(2),_[a.substring(0,2)])}}const hex2buf=a=>{if(a.length%2!==0)throw new InvalidHexStringError(a,": Expecting even number of characters");const _=stripHexPrefix$1(a);if(!_.match(/^([\da-f]{2})*$/gi))throw new InvalidHexStringError(a,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const $=new Uint8Array(_.length/2);let j=0;for(let et=0;et<_.length;et+=2){const tt=parseInt(_.slice(et,et+2),16);if(Number.isNaN(tt))throw new ValueConversionError(a,"Uint8Array");$[j++]=tt}return $},mergebuf=(a,_)=>{const $=new Uint8Array(a.length+_.length);return $.set(a),$.set(_,a.length),$},buf2hex=a=>{const _=[];return a.forEach($=>{const et=`00${$.toString(16)}`.slice(-2);_.push(et)}),_.join("")};function hex2Bytes(a){const _=stripHexPrefix$1(a);if(!_.match(/^(0x)?([\da-f]{2})*$/gi))throw new InvalidHexStringError(a,": Expecting even number of characters: 0-9, a-z, A-Z, optionally prefixed with 0x");return buffer$1.Buffer.from(_,"hex")}function stripHexPrefix$1(a){return a.startsWith("0x")?a.slice(2):a}var util;(function(a){a.assertEqual=et=>et;function _(et){}a.assertIs=_;function $(et){throw new Error}a.assertNever=$,a.arrayToEnum=et=>{const tt={};for(const rt of et)tt[rt]=rt;return tt},a.getValidEnumValues=et=>{const tt=a.objectKeys(et).filter(nt=>typeof et[et[nt]]!="number"),rt={};for(const nt of tt)rt[nt]=et[nt];return a.objectValues(rt)},a.objectValues=et=>a.objectKeys(et).map(function(tt){return et[tt]}),a.objectKeys=typeof Object.keys=="function"?et=>Object.keys(et):et=>{const tt=[];for(const rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&tt.push(rt);return tt},a.find=(et,tt)=>{for(const rt of et)if(tt(rt))return rt},a.isInteger=typeof Number.isInteger=="function"?et=>Number.isInteger(et):et=>typeof et=="number"&&isFinite(et)&&Math.floor(et)===et;function j(et,tt=" | "){return et.map(rt=>typeof rt=="string"?`'${rt}'`:rt).join(tt)}a.joinValues=j,a.jsonStringifyReplacer=(et,tt)=>typeof tt=="bigint"?tt.toString():tt})(util||(util={}));var objectUtil;(function(a){a.mergeShapes=(_,$)=>({..._,...$})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=a=>{switch(typeof a){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(a)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(a)?ZodParsedType.array:a===null?ZodParsedType.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&a instanceof Map?ZodParsedType.map:typeof Set<"u"&&a instanceof Set?ZodParsedType.set:typeof Date<"u"&&a instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.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"]),quotelessJson=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(_){super(),this.issues=[],this.addIssue=j=>{this.issues=[...this.issues,j]},this.addIssues=(j=[])=>{this.issues=[...this.issues,...j]};const $=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,$):this.__proto__=$,this.name="ZodError",this.issues=_}get errors(){return this.issues}format(_){const $=_||function(tt){return tt.message},j={_errors:[]},et=tt=>{for(const rt of tt.issues)if(rt.code==="invalid_union")rt.unionErrors.map(et);else if(rt.code==="invalid_return_type")et(rt.returnTypeError);else if(rt.code==="invalid_arguments")et(rt.argumentsError);else if(rt.path.length===0)j._errors.push($(rt));else{let nt=j,it=0;for(;it$.message){const $={},j=[];for(const et of this.issues)et.path.length>0?($[et.path[0]]=$[et.path[0]]||[],$[et.path[0]].push(_(et))):j.push(_(et));return{formErrors:j,fieldErrors:$}}get formErrors(){return this.flatten()}}ZodError.create=a=>new ZodError(a);const errorMap=(a,_)=>{let $;switch(a.code){case ZodIssueCode.invalid_type:a.received===ZodParsedType.undefined?$="Required":$=`Expected ${a.expected}, received ${a.received}`;break;case ZodIssueCode.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(a.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:$=`Unrecognized key(s) in object: ${util.joinValues(a.keys,", ")}`;break;case ZodIssueCode.invalid_union:$="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${util.joinValues(a.options)}`;break;case ZodIssueCode.invalid_enum_value:$=`Invalid enum value. Expected ${util.joinValues(a.options)}, received '${a.received}'`;break;case ZodIssueCode.invalid_arguments:$="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:$="Invalid function return type";break;case ZodIssueCode.invalid_date:$="Invalid date";break;case ZodIssueCode.invalid_string:typeof a.validation=="object"?"includes"in a.validation?($=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&($=`${$} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?$=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?$=`Invalid input: must end with "${a.validation.endsWith}"`:util.assertNever(a.validation):a.validation!=="regex"?$=`Invalid ${a.validation}`:$="Invalid";break;case ZodIssueCode.too_small:a.type==="array"?$=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?$=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?$=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?$=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:$="Invalid input";break;case ZodIssueCode.too_big:a.type==="array"?$=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?$=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?$=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?$=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?$=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:$="Invalid input";break;case ZodIssueCode.custom:$="Invalid input";break;case ZodIssueCode.invalid_intersection_types:$="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:$=`Number must be a multiple of ${a.multipleOf}`;break;case ZodIssueCode.not_finite:$="Number must be finite";break;default:$=_.defaultError,util.assertNever(a)}return{message:$}};let overrideErrorMap=errorMap;function setErrorMap(a){overrideErrorMap=a}function getErrorMap(){return overrideErrorMap}const makeIssue=a=>{const{data:_,path:$,errorMaps:j,issueData:et}=a,tt=[...$,...et.path||[]],rt={...et,path:tt};if(et.message!==void 0)return{...et,path:tt,message:et.message};let nt="";const it=j.filter(st=>!!st).slice().reverse();for(const st of it)nt=st(rt,{data:_,defaultError:nt}).message;return{...et,path:tt,message:nt}},EMPTY_PATH=[];function addIssueToContext(a,_){const $=getErrorMap(),j=makeIssue({issueData:_,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,$,$===errorMap?void 0:errorMap].filter(et=>!!et)});a.common.issues.push(j)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(_,$){const j=[];for(const et of $){if(et.status==="aborted")return INVALID;et.status==="dirty"&&_.dirty(),j.push(et.value)}return{status:_.value,value:j}}static async mergeObjectAsync(_,$){const j=[];for(const et of $){const tt=await et.key,rt=await et.value;j.push({key:tt,value:rt})}return ParseStatus.mergeObjectSync(_,j)}static mergeObjectSync(_,$){const j={};for(const et of $){const{key:tt,value:rt}=et;if(tt.status==="aborted"||rt.status==="aborted")return INVALID;tt.status==="dirty"&&_.dirty(),rt.status==="dirty"&&_.dirty(),tt.value!=="__proto__"&&(typeof rt.value<"u"||et.alwaysSet)&&(j[tt.value]=rt.value)}return{status:_.value,value:j}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=a=>({status:"dirty",value:a}),OK=a=>({status:"valid",value:a}),isAborted=a=>a.status==="aborted",isDirty=a=>a.status==="dirty",isValid$1=a=>a.status==="valid",isAsync=a=>typeof Promise<"u"&&a instanceof Promise;function __classPrivateFieldGet$1(a,_,$,j){if(typeof _=="function"?a!==_||!j:!_.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return _.get(a)}function __classPrivateFieldSet$1(a,_,$,j,et){if(typeof _=="function"?a!==_||!et:!_.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return _.set(a,$),$}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(a){a.errToObj=_=>typeof _=="string"?{message:_}:_||{},a.toString=_=>typeof _=="string"?_:_==null?void 0:_.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(_,$,j,et){this._cachedPath=[],this.parent=_,this.data=$,this._path=j,this._key=et}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}}const handleResult=(a,_)=>{if(isValid$1(_))return{success:!0,data:_.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const $=new ZodError(a.common.issues);return this._error=$,this._error}}};function processCreateParams(a){if(!a)return{};const{errorMap:_,invalid_type_error:$,required_error:j,description:et}=a;if(_&&($||j))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return _?{errorMap:_,description:et}:{errorMap:(rt,nt)=>{var it,st;const{message:ot}=a;return rt.code==="invalid_enum_value"?{message:ot??nt.defaultError}:typeof nt.data>"u"?{message:(it=ot??j)!==null&&it!==void 0?it:nt.defaultError}:rt.code!=="invalid_type"?{message:nt.defaultError}:{message:(st=ot??$)!==null&&st!==void 0?st:nt.defaultError}},description:et}}class ZodType{constructor(_){this.spa=this.safeParseAsync,this._def=_,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(_){return getParsedType(_.data)}_getOrReturnCtx(_,$){return $||{common:_.parent.common,data:_.data,parsedType:getParsedType(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}_processInputParams(_){return{status:new ParseStatus,ctx:{common:_.parent.common,data:_.data,parsedType:getParsedType(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}}_parseSync(_){const $=this._parse(_);if(isAsync($))throw new Error("Synchronous parse encountered promise.");return $}_parseAsync(_){const $=this._parse(_);return Promise.resolve($)}parse(_,$){const j=this.safeParse(_,$);if(j.success)return j.data;throw j.error}safeParse(_,$){var j;const et={common:{issues:[],async:(j=$==null?void 0:$.async)!==null&&j!==void 0?j:!1,contextualErrorMap:$==null?void 0:$.errorMap},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:getParsedType(_)},tt=this._parseSync({data:_,path:et.path,parent:et});return handleResult(et,tt)}async parseAsync(_,$){const j=await this.safeParseAsync(_,$);if(j.success)return j.data;throw j.error}async safeParseAsync(_,$){const j={common:{issues:[],contextualErrorMap:$==null?void 0:$.errorMap,async:!0},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:getParsedType(_)},et=this._parse({data:_,path:j.path,parent:j}),tt=await(isAsync(et)?et:Promise.resolve(et));return handleResult(j,tt)}refine(_,$){const j=et=>typeof $=="string"||typeof $>"u"?{message:$}:typeof $=="function"?$(et):$;return this._refinement((et,tt)=>{const rt=_(et),nt=()=>tt.addIssue({code:ZodIssueCode.custom,...j(et)});return typeof Promise<"u"&&rt instanceof Promise?rt.then(it=>it?!0:(nt(),!1)):rt?!0:(nt(),!1)})}refinement(_,$){return this._refinement((j,et)=>_(j)?!0:(et.addIssue(typeof $=="function"?$(j,et):$),!1))}_refinement(_){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:_}})}superRefine(_){return this._refinement(_)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(_){return ZodUnion.create([this,_],this._def)}and(_){return ZodIntersection.create(this,_,this._def)}transform(_){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:_}})}default(_){const $=typeof _=="function"?_:()=>_;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:$,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(_){const $=typeof _=="function"?_:()=>_;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:$,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(_){const $=this.constructor;return new $({...this._def,description:_})}pipe(_){return ZodPipeline.create(this,_)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[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,nanoidRegex=/^[a-z0-9_-]{21}$/i,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6Regex=/^(([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})))$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(a){let _="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return a.precision?_=`${_}\\.\\d{${a.precision}}`:a.precision==null&&(_=`${_}(\\.\\d+)?`),_}function timeRegex(a){return new RegExp(`^${timeRegexSource(a)}$`)}function datetimeRegex(a){let _=`${dateRegexSource}T${timeRegexSource(a)}`;const $=[];return $.push(a.local?"Z?":"Z"),a.offset&&$.push("([+-]\\d{2}:?\\d{2})"),_=`${_}(${$.join("|")})`,new RegExp(`^${_}$`)}function isValidIP(a,_){return!!((_==="v4"||!_)&&ipv4Regex.test(a)||(_==="v6"||!_)&&ipv6Regex.test(a))}class ZodString extends ZodType{_parse(_){if(this._def.coerce&&(_.data=String(_.data)),this._getType(_)!==ZodParsedType.string){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:tt.parsedType}),INVALID}const j=new ParseStatus;let et;for(const tt of this._def.checks)if(tt.kind==="min")_.data.lengthtt.value&&(et=this._getOrReturnCtx(_,et),addIssueToContext(et,{code:ZodIssueCode.too_big,maximum:tt.value,type:"string",inclusive:!0,exact:!1,message:tt.message}),j.dirty());else if(tt.kind==="length"){const rt=_.data.length>tt.value,nt=_.data.length_.test(et),{validation:$,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(j)})}_addCheck(_){return new ZodString({...this._def,checks:[...this._def.checks,_]})}email(_){return this._addCheck({kind:"email",...errorUtil.errToObj(_)})}url(_){return this._addCheck({kind:"url",...errorUtil.errToObj(_)})}emoji(_){return this._addCheck({kind:"emoji",...errorUtil.errToObj(_)})}uuid(_){return this._addCheck({kind:"uuid",...errorUtil.errToObj(_)})}nanoid(_){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(_)})}cuid(_){return this._addCheck({kind:"cuid",...errorUtil.errToObj(_)})}cuid2(_){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(_)})}ulid(_){return this._addCheck({kind:"ulid",...errorUtil.errToObj(_)})}base64(_){return this._addCheck({kind:"base64",...errorUtil.errToObj(_)})}ip(_){return this._addCheck({kind:"ip",...errorUtil.errToObj(_)})}datetime(_){var $,j;return typeof _=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:_}):this._addCheck({kind:"datetime",precision:typeof(_==null?void 0:_.precision)>"u"?null:_==null?void 0:_.precision,offset:($=_==null?void 0:_.offset)!==null&&$!==void 0?$:!1,local:(j=_==null?void 0:_.local)!==null&&j!==void 0?j:!1,...errorUtil.errToObj(_==null?void 0:_.message)})}date(_){return this._addCheck({kind:"date",message:_})}time(_){return typeof _=="string"?this._addCheck({kind:"time",precision:null,message:_}):this._addCheck({kind:"time",precision:typeof(_==null?void 0:_.precision)>"u"?null:_==null?void 0:_.precision,...errorUtil.errToObj(_==null?void 0:_.message)})}duration(_){return this._addCheck({kind:"duration",...errorUtil.errToObj(_)})}regex(_,$){return this._addCheck({kind:"regex",regex:_,...errorUtil.errToObj($)})}includes(_,$){return this._addCheck({kind:"includes",value:_,position:$==null?void 0:$.position,...errorUtil.errToObj($==null?void 0:$.message)})}startsWith(_,$){return this._addCheck({kind:"startsWith",value:_,...errorUtil.errToObj($)})}endsWith(_,$){return this._addCheck({kind:"endsWith",value:_,...errorUtil.errToObj($)})}min(_,$){return this._addCheck({kind:"min",value:_,...errorUtil.errToObj($)})}max(_,$){return this._addCheck({kind:"max",value:_,...errorUtil.errToObj($)})}length(_,$){return this._addCheck({kind:"length",value:_,...errorUtil.errToObj($)})}nonempty(_){return this.min(1,errorUtil.errToObj(_))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(_=>_.kind==="datetime")}get isDate(){return!!this._def.checks.find(_=>_.kind==="date")}get isTime(){return!!this._def.checks.find(_=>_.kind==="time")}get isDuration(){return!!this._def.checks.find(_=>_.kind==="duration")}get isEmail(){return!!this._def.checks.find(_=>_.kind==="email")}get isURL(){return!!this._def.checks.find(_=>_.kind==="url")}get isEmoji(){return!!this._def.checks.find(_=>_.kind==="emoji")}get isUUID(){return!!this._def.checks.find(_=>_.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(_=>_.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(_=>_.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(_=>_.kind==="cuid2")}get isULID(){return!!this._def.checks.find(_=>_.kind==="ulid")}get isIP(){return!!this._def.checks.find(_=>_.kind==="ip")}get isBase64(){return!!this._def.checks.find(_=>_.kind==="base64")}get minLength(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxLength(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}}ZodString.create=a=>{var _;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(_=a==null?void 0:a.coerce)!==null&&_!==void 0?_:!1,...processCreateParams(a)})};function floatSafeRemainder(a,_){const $=(a.toString().split(".")[1]||"").length,j=(_.toString().split(".")[1]||"").length,et=$>j?$:j,tt=parseInt(a.toFixed(et).replace(".","")),rt=parseInt(_.toFixed(et).replace(".",""));return tt%rt/Math.pow(10,et)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(_){if(this._def.coerce&&(_.data=Number(_.data)),this._getType(_)!==ZodParsedType.number){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:tt.parsedType}),INVALID}let j;const et=new ParseStatus;for(const tt of this._def.checks)tt.kind==="int"?util.isInteger(_.data)||(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:tt.message}),et.dirty()):tt.kind==="min"?(tt.inclusive?_.datatt.value:_.data>=tt.value)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:tt.value,type:"number",inclusive:tt.inclusive,exact:!1,message:tt.message}),et.dirty()):tt.kind==="multipleOf"?floatSafeRemainder(_.data,tt.value)!==0&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:tt.value,message:tt.message}),et.dirty()):tt.kind==="finite"?Number.isFinite(_.data)||(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_finite,message:tt.message}),et.dirty()):util.assertNever(tt);return{status:et.value,value:_.data}}gte(_,$){return this.setLimit("min",_,!0,errorUtil.toString($))}gt(_,$){return this.setLimit("min",_,!1,errorUtil.toString($))}lte(_,$){return this.setLimit("max",_,!0,errorUtil.toString($))}lt(_,$){return this.setLimit("max",_,!1,errorUtil.toString($))}setLimit(_,$,j,et){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:_,value:$,inclusive:j,message:errorUtil.toString(et)}]})}_addCheck(_){return new ZodNumber({...this._def,checks:[...this._def.checks,_]})}int(_){return this._addCheck({kind:"int",message:errorUtil.toString(_)})}positive(_){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(_)})}negative(_){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(_)})}multipleOf(_,$){return this._addCheck({kind:"multipleOf",value:_,message:errorUtil.toString($)})}finite(_){return this._addCheck({kind:"finite",message:errorUtil.toString(_)})}safe(_){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(_)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(_)})}get minValue(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxValue(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}get isInt(){return!!this._def.checks.find(_=>_.kind==="int"||_.kind==="multipleOf"&&util.isInteger(_.value))}get isFinite(){let _=null,$=null;for(const j of this._def.checks){if(j.kind==="finite"||j.kind==="int"||j.kind==="multipleOf")return!0;j.kind==="min"?($===null||j.value>$)&&($=j.value):j.kind==="max"&&(_===null||j.value<_)&&(_=j.value)}return Number.isFinite($)&&Number.isFinite(_)}}ZodNumber.create=a=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1,...processCreateParams(a)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(_){if(this._def.coerce&&(_.data=BigInt(_.data)),this._getType(_)!==ZodParsedType.bigint){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:tt.parsedType}),INVALID}let j;const et=new ParseStatus;for(const tt of this._def.checks)tt.kind==="min"?(tt.inclusive?_.datatt.value:_.data>=tt.value)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.too_big,type:"bigint",maximum:tt.value,inclusive:tt.inclusive,message:tt.message}),et.dirty()):tt.kind==="multipleOf"?_.data%tt.value!==BigInt(0)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:tt.value,message:tt.message}),et.dirty()):util.assertNever(tt);return{status:et.value,value:_.data}}gte(_,$){return this.setLimit("min",_,!0,errorUtil.toString($))}gt(_,$){return this.setLimit("min",_,!1,errorUtil.toString($))}lte(_,$){return this.setLimit("max",_,!0,errorUtil.toString($))}lt(_,$){return this.setLimit("max",_,!1,errorUtil.toString($))}setLimit(_,$,j,et){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:_,value:$,inclusive:j,message:errorUtil.toString(et)}]})}_addCheck(_){return new ZodBigInt({...this._def,checks:[...this._def.checks,_]})}positive(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(_)})}negative(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(_)})}multipleOf(_,$){return this._addCheck({kind:"multipleOf",value:_,message:errorUtil.toString($)})}get minValue(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxValue(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}}ZodBigInt.create=a=>{var _;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(_=a==null?void 0:a.coerce)!==null&&_!==void 0?_:!1,...processCreateParams(a)})};class ZodBoolean extends ZodType{_parse(_){if(this._def.coerce&&(_.data=!!_.data),this._getType(_)!==ZodParsedType.boolean){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:j.parsedType}),INVALID}return OK(_.data)}}ZodBoolean.create=a=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...processCreateParams(a)});class ZodDate extends ZodType{_parse(_){if(this._def.coerce&&(_.data=new Date(_.data)),this._getType(_)!==ZodParsedType.date){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:tt.parsedType}),INVALID}if(isNaN(_.data.getTime())){const tt=this._getOrReturnCtx(_);return addIssueToContext(tt,{code:ZodIssueCode.invalid_date}),INVALID}const j=new ParseStatus;let et;for(const tt of this._def.checks)tt.kind==="min"?_.data.getTime()tt.value&&(et=this._getOrReturnCtx(_,et),addIssueToContext(et,{code:ZodIssueCode.too_big,message:tt.message,inclusive:!0,exact:!1,maximum:tt.value,type:"date"}),j.dirty()):util.assertNever(tt);return{status:j.value,value:new Date(_.data.getTime())}}_addCheck(_){return new ZodDate({...this._def,checks:[...this._def.checks,_]})}min(_,$){return this._addCheck({kind:"min",value:_.getTime(),message:errorUtil.toString($)})}max(_,$){return this._addCheck({kind:"max",value:_.getTime(),message:errorUtil.toString($)})}get minDate(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _!=null?new Date(_):null}get maxDate(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _!=null?new Date(_):null}}ZodDate.create=a=>new ZodDate({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(a)});class ZodSymbol extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.symbol){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:j.parsedType}),INVALID}return OK(_.data)}}ZodSymbol.create=a=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(a)});class ZodUndefined extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:j.parsedType}),INVALID}return OK(_.data)}}ZodUndefined.create=a=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(a)});class ZodNull extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.null){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:j.parsedType}),INVALID}return OK(_.data)}}ZodNull.create=a=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(a)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(_){return OK(_.data)}}ZodAny.create=a=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(a)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(_){return OK(_.data)}}ZodUnknown.create=a=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(a)});class ZodNever extends ZodType{_parse(_){const $=this._getOrReturnCtx(_);return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:$.parsedType}),INVALID}}ZodNever.create=a=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(a)});class ZodVoid extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:j.parsedType}),INVALID}return OK(_.data)}}ZodVoid.create=a=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(a)});class ZodArray extends ZodType{_parse(_){const{ctx:$,status:j}=this._processInputParams(_),et=this._def;if($.parsedType!==ZodParsedType.array)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:$.parsedType}),INVALID;if(et.exactLength!==null){const rt=$.data.length>et.exactLength.value,nt=$.data.lengthet.maxLength.value&&(addIssueToContext($,{code:ZodIssueCode.too_big,maximum:et.maxLength.value,type:"array",inclusive:!0,exact:!1,message:et.maxLength.message}),j.dirty()),$.common.async)return Promise.all([...$.data].map((rt,nt)=>et.type._parseAsync(new ParseInputLazyPath($,rt,$.path,nt)))).then(rt=>ParseStatus.mergeArray(j,rt));const tt=[...$.data].map((rt,nt)=>et.type._parseSync(new ParseInputLazyPath($,rt,$.path,nt)));return ParseStatus.mergeArray(j,tt)}get element(){return this._def.type}min(_,$){return new ZodArray({...this._def,minLength:{value:_,message:errorUtil.toString($)}})}max(_,$){return new ZodArray({...this._def,maxLength:{value:_,message:errorUtil.toString($)}})}length(_,$){return new ZodArray({...this._def,exactLength:{value:_,message:errorUtil.toString($)}})}nonempty(_){return this.min(1,_)}}ZodArray.create=(a,_)=>new ZodArray({type:a,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(_)});function deepPartialify(a){if(a instanceof ZodObject){const _={};for(const $ in a.shape){const j=a.shape[$];_[$]=ZodOptional.create(deepPartialify(j))}return new ZodObject({...a._def,shape:()=>_})}else return a instanceof ZodArray?new ZodArray({...a._def,type:deepPartialify(a.element)}):a instanceof ZodOptional?ZodOptional.create(deepPartialify(a.unwrap())):a instanceof ZodNullable?ZodNullable.create(deepPartialify(a.unwrap())):a instanceof ZodTuple?ZodTuple.create(a.items.map(_=>deepPartialify(_))):a}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const _=this._def.shape(),$=util.objectKeys(_);return this._cached={shape:_,keys:$}}_parse(_){if(this._getType(_)!==ZodParsedType.object){const st=this._getOrReturnCtx(_);return addIssueToContext(st,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:st.parsedType}),INVALID}const{status:j,ctx:et}=this._processInputParams(_),{shape:tt,keys:rt}=this._getCached(),nt=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const st in et.data)rt.includes(st)||nt.push(st);const it=[];for(const st of rt){const ot=tt[st],at=et.data[st];it.push({key:{status:"valid",value:st},value:ot._parse(new ParseInputLazyPath(et,at,et.path,st)),alwaysSet:st in et.data})}if(this._def.catchall instanceof ZodNever){const st=this._def.unknownKeys;if(st==="passthrough")for(const ot of nt)it.push({key:{status:"valid",value:ot},value:{status:"valid",value:et.data[ot]}});else if(st==="strict")nt.length>0&&(addIssueToContext(et,{code:ZodIssueCode.unrecognized_keys,keys:nt}),j.dirty());else if(st!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const st=this._def.catchall;for(const ot of nt){const at=et.data[ot];it.push({key:{status:"valid",value:ot},value:st._parse(new ParseInputLazyPath(et,at,et.path,ot)),alwaysSet:ot in et.data})}}return et.common.async?Promise.resolve().then(async()=>{const st=[];for(const ot of it){const at=await ot.key,ut=await ot.value;st.push({key:at,value:ut,alwaysSet:ot.alwaysSet})}return st}).then(st=>ParseStatus.mergeObjectSync(j,st)):ParseStatus.mergeObjectSync(j,it)}get shape(){return this._def.shape()}strict(_){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",..._!==void 0?{errorMap:($,j)=>{var et,tt,rt,nt;const it=(rt=(tt=(et=this._def).errorMap)===null||tt===void 0?void 0:tt.call(et,$,j).message)!==null&&rt!==void 0?rt:j.defaultError;return $.code==="unrecognized_keys"?{message:(nt=errorUtil.errToObj(_).message)!==null&&nt!==void 0?nt:it}:{message:it}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(_){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),..._})})}merge(_){return new ZodObject({unknownKeys:_._def.unknownKeys,catchall:_._def.catchall,shape:()=>({...this._def.shape(),..._._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(_,$){return this.augment({[_]:$})}catchall(_){return new ZodObject({...this._def,catchall:_})}pick(_){const $={};return util.objectKeys(_).forEach(j=>{_[j]&&this.shape[j]&&($[j]=this.shape[j])}),new ZodObject({...this._def,shape:()=>$})}omit(_){const $={};return util.objectKeys(this.shape).forEach(j=>{_[j]||($[j]=this.shape[j])}),new ZodObject({...this._def,shape:()=>$})}deepPartial(){return deepPartialify(this)}partial(_){const $={};return util.objectKeys(this.shape).forEach(j=>{const et=this.shape[j];_&&!_[j]?$[j]=et:$[j]=et.optional()}),new ZodObject({...this._def,shape:()=>$})}required(_){const $={};return util.objectKeys(this.shape).forEach(j=>{if(_&&!_[j])$[j]=this.shape[j];else{let tt=this.shape[j];for(;tt instanceof ZodOptional;)tt=tt._def.innerType;$[j]=tt}}),new ZodObject({...this._def,shape:()=>$})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(a,_)=>new ZodObject({shape:()=>a,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});ZodObject.strictCreate=(a,_)=>new ZodObject({shape:()=>a,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});ZodObject.lazycreate=(a,_)=>new ZodObject({shape:a,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});class ZodUnion extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j=this._def.options;function et(tt){for(const nt of tt)if(nt.result.status==="valid")return nt.result;for(const nt of tt)if(nt.result.status==="dirty")return $.common.issues.push(...nt.ctx.common.issues),nt.result;const rt=tt.map(nt=>new ZodError(nt.ctx.common.issues));return addIssueToContext($,{code:ZodIssueCode.invalid_union,unionErrors:rt}),INVALID}if($.common.async)return Promise.all(j.map(async tt=>{const rt={...$,common:{...$.common,issues:[]},parent:null};return{result:await tt._parseAsync({data:$.data,path:$.path,parent:rt}),ctx:rt}})).then(et);{let tt;const rt=[];for(const it of j){const st={...$,common:{...$.common,issues:[]},parent:null},ot=it._parseSync({data:$.data,path:$.path,parent:st});if(ot.status==="valid")return ot;ot.status==="dirty"&&!tt&&(tt={result:ot,ctx:st}),st.common.issues.length&&rt.push(st.common.issues)}if(tt)return $.common.issues.push(...tt.ctx.common.issues),tt.result;const nt=rt.map(it=>new ZodError(it));return addIssueToContext($,{code:ZodIssueCode.invalid_union,unionErrors:nt}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(a,_)=>new ZodUnion({options:a,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(_)});const getDiscriminator=a=>a instanceof ZodLazy?getDiscriminator(a.schema):a instanceof ZodEffects?getDiscriminator(a.innerType()):a instanceof ZodLiteral?[a.value]:a instanceof ZodEnum?a.options:a instanceof ZodNativeEnum?util.objectValues(a.enum):a instanceof ZodDefault?getDiscriminator(a._def.innerType):a instanceof ZodUndefined?[void 0]:a instanceof ZodNull?[null]:a instanceof ZodOptional?[void 0,...getDiscriminator(a.unwrap())]:a instanceof ZodNullable?[null,...getDiscriminator(a.unwrap())]:a instanceof ZodBranded||a instanceof ZodReadonly?getDiscriminator(a.unwrap()):a instanceof ZodCatch?getDiscriminator(a._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_);if($.parsedType!==ZodParsedType.object)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:$.parsedType}),INVALID;const j=this.discriminator,et=$.data[j],tt=this.optionsMap.get(et);return tt?$.common.async?tt._parseAsync({data:$.data,path:$.path,parent:$}):tt._parseSync({data:$.data,path:$.path,parent:$}):(addIssueToContext($,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[j]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(_,$,j){const et=new Map;for(const tt of $){const rt=getDiscriminator(tt.shape[_]);if(!rt.length)throw new Error(`A discriminator value for key \`${_}\` could not be extracted from all schema options`);for(const nt of rt){if(et.has(nt))throw new Error(`Discriminator property ${String(_)} has duplicate value ${String(nt)}`);et.set(nt,tt)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:_,options:$,optionsMap:et,...processCreateParams(j)})}}function mergeValues(a,_){const $=getParsedType(a),j=getParsedType(_);if(a===_)return{valid:!0,data:a};if($===ZodParsedType.object&&j===ZodParsedType.object){const et=util.objectKeys(_),tt=util.objectKeys(a).filter(nt=>et.indexOf(nt)!==-1),rt={...a,..._};for(const nt of tt){const it=mergeValues(a[nt],_[nt]);if(!it.valid)return{valid:!1};rt[nt]=it.data}return{valid:!0,data:rt}}else if($===ZodParsedType.array&&j===ZodParsedType.array){if(a.length!==_.length)return{valid:!1};const et=[];for(let tt=0;tt{if(isAborted(tt)||isAborted(rt))return INVALID;const nt=mergeValues(tt.value,rt.value);return nt.valid?((isDirty(tt)||isDirty(rt))&&$.dirty(),{status:$.value,value:nt.data}):(addIssueToContext(j,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return j.common.async?Promise.all([this._def.left._parseAsync({data:j.data,path:j.path,parent:j}),this._def.right._parseAsync({data:j.data,path:j.path,parent:j})]).then(([tt,rt])=>et(tt,rt)):et(this._def.left._parseSync({data:j.data,path:j.path,parent:j}),this._def.right._parseSync({data:j.data,path:j.path,parent:j}))}}ZodIntersection.create=(a,_,$)=>new ZodIntersection({left:a,right:_,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams($)});class ZodTuple extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.array)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:j.parsedType}),INVALID;if(j.data.lengththis._def.items.length&&(addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty());const tt=[...j.data].map((rt,nt)=>{const it=this._def.items[nt]||this._def.rest;return it?it._parse(new ParseInputLazyPath(j,rt,j.path,nt)):null}).filter(rt=>!!rt);return j.common.async?Promise.all(tt).then(rt=>ParseStatus.mergeArray($,rt)):ParseStatus.mergeArray($,tt)}get items(){return this._def.items}rest(_){return new ZodTuple({...this._def,rest:_})}}ZodTuple.create=(a,_)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:a,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(_)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.object)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:j.parsedType}),INVALID;const et=[],tt=this._def.keyType,rt=this._def.valueType;for(const nt in j.data)et.push({key:tt._parse(new ParseInputLazyPath(j,nt,j.path,nt)),value:rt._parse(new ParseInputLazyPath(j,j.data[nt],j.path,nt)),alwaysSet:nt in j.data});return j.common.async?ParseStatus.mergeObjectAsync($,et):ParseStatus.mergeObjectSync($,et)}get element(){return this._def.valueType}static create(_,$,j){return $ instanceof ZodType?new ZodRecord({keyType:_,valueType:$,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(j)}):new ZodRecord({keyType:ZodString.create(),valueType:_,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams($)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.map)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:j.parsedType}),INVALID;const et=this._def.keyType,tt=this._def.valueType,rt=[...j.data.entries()].map(([nt,it],st)=>({key:et._parse(new ParseInputLazyPath(j,nt,j.path,[st,"key"])),value:tt._parse(new ParseInputLazyPath(j,it,j.path,[st,"value"]))}));if(j.common.async){const nt=new Map;return Promise.resolve().then(async()=>{for(const it of rt){const st=await it.key,ot=await it.value;if(st.status==="aborted"||ot.status==="aborted")return INVALID;(st.status==="dirty"||ot.status==="dirty")&&$.dirty(),nt.set(st.value,ot.value)}return{status:$.value,value:nt}})}else{const nt=new Map;for(const it of rt){const st=it.key,ot=it.value;if(st.status==="aborted"||ot.status==="aborted")return INVALID;(st.status==="dirty"||ot.status==="dirty")&&$.dirty(),nt.set(st.value,ot.value)}return{status:$.value,value:nt}}}}ZodMap.create=(a,_,$)=>new ZodMap({valueType:_,keyType:a,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams($)});class ZodSet extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.set)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:j.parsedType}),INVALID;const et=this._def;et.minSize!==null&&j.data.sizeet.maxSize.value&&(addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:et.maxSize.value,type:"set",inclusive:!0,exact:!1,message:et.maxSize.message}),$.dirty());const tt=this._def.valueType;function rt(it){const st=new Set;for(const ot of it){if(ot.status==="aborted")return INVALID;ot.status==="dirty"&&$.dirty(),st.add(ot.value)}return{status:$.value,value:st}}const nt=[...j.data.values()].map((it,st)=>tt._parse(new ParseInputLazyPath(j,it,j.path,st)));return j.common.async?Promise.all(nt).then(it=>rt(it)):rt(nt)}min(_,$){return new ZodSet({...this._def,minSize:{value:_,message:errorUtil.toString($)}})}max(_,$){return new ZodSet({...this._def,maxSize:{value:_,message:errorUtil.toString($)}})}size(_,$){return this.min(_,$).max(_,$)}nonempty(_){return this.min(1,_)}}ZodSet.create=(a,_)=>new ZodSet({valueType:a,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(_)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(_){const{ctx:$}=this._processInputParams(_);if($.parsedType!==ZodParsedType.function)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:$.parsedType}),INVALID;function j(nt,it){return makeIssue({data:nt,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,getErrorMap(),errorMap].filter(st=>!!st),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:it}})}function et(nt,it){return makeIssue({data:nt,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,getErrorMap(),errorMap].filter(st=>!!st),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:it}})}const tt={errorMap:$.common.contextualErrorMap},rt=$.data;if(this._def.returns instanceof ZodPromise){const nt=this;return OK(async function(...it){const st=new ZodError([]),ot=await nt._def.args.parseAsync(it,tt).catch(ht=>{throw st.addIssue(j(it,ht)),st}),at=await Reflect.apply(rt,this,ot);return await nt._def.returns._def.type.parseAsync(at,tt).catch(ht=>{throw st.addIssue(et(at,ht)),st})})}else{const nt=this;return OK(function(...it){const st=nt._def.args.safeParse(it,tt);if(!st.success)throw new ZodError([j(it,st.error)]);const ot=Reflect.apply(rt,this,st.data),at=nt._def.returns.safeParse(ot,tt);if(!at.success)throw new ZodError([et(ot,at.error)]);return at.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(..._){return new ZodFunction({...this._def,args:ZodTuple.create(_).rest(ZodUnknown.create())})}returns(_){return new ZodFunction({...this._def,returns:_})}implement(_){return this.parse(_)}strictImplement(_){return this.parse(_)}static create(_,$,j){return new ZodFunction({args:_||ZodTuple.create([]).rest(ZodUnknown.create()),returns:$||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(j)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(_){const{ctx:$}=this._processInputParams(_);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}}ZodLazy.create=(a,_)=>new ZodLazy({getter:a,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(_)});class ZodLiteral extends ZodType{_parse(_){if(_.data!==this._def.value){const $=this._getOrReturnCtx(_);return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:_.data}}get value(){return this._def.value}}ZodLiteral.create=(a,_)=>new ZodLiteral({value:a,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(_)});function createZodEnum(a,_){return new ZodEnum({values:a,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(_)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(_){if(typeof _.data!="string"){const $=this._getOrReturnCtx(_),j=this._def.values;return addIssueToContext($,{expected:util.joinValues(j),received:$.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet$1(this,_ZodEnum_cache)||__classPrivateFieldSet$1(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet$1(this,_ZodEnum_cache).has(_.data)){const $=this._getOrReturnCtx(_),j=this._def.values;return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_enum_value,options:j}),INVALID}return OK(_.data)}get options(){return this._def.values}get enum(){const _={};for(const $ of this._def.values)_[$]=$;return _}get Values(){const _={};for(const $ of this._def.values)_[$]=$;return _}get Enum(){const _={};for(const $ of this._def.values)_[$]=$;return _}extract(_,$=this._def){return ZodEnum.create(_,{...this._def,...$})}exclude(_,$=this._def){return ZodEnum.create(this.options.filter(j=>!_.includes(j)),{...this._def,...$})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(_){const $=util.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(_);if(j.parsedType!==ZodParsedType.string&&j.parsedType!==ZodParsedType.number){const et=util.objectValues($);return addIssueToContext(j,{expected:util.joinValues(et),received:j.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet$1(this,_ZodNativeEnum_cache)||__classPrivateFieldSet$1(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet$1(this,_ZodNativeEnum_cache).has(_.data)){const et=util.objectValues($);return addIssueToContext(j,{received:j.data,code:ZodIssueCode.invalid_enum_value,options:et}),INVALID}return OK(_.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(a,_)=>new ZodNativeEnum({values:a,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(_)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(_){const{ctx:$}=this._processInputParams(_);if($.parsedType!==ZodParsedType.promise&&$.common.async===!1)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:$.parsedType}),INVALID;const j=$.parsedType===ZodParsedType.promise?$.data:Promise.resolve($.data);return OK(j.then(et=>this._def.type.parseAsync(et,{path:$.path,errorMap:$.common.contextualErrorMap})))}}ZodPromise.create=(a,_)=>new ZodPromise({type:a,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(_)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(_){const{status:$,ctx:j}=this._processInputParams(_),et=this._def.effect||null,tt={addIssue:rt=>{addIssueToContext(j,rt),rt.fatal?$.abort():$.dirty()},get path(){return j.path}};if(tt.addIssue=tt.addIssue.bind(tt),et.type==="preprocess"){const rt=et.transform(j.data,tt);if(j.common.async)return Promise.resolve(rt).then(async nt=>{if($.value==="aborted")return INVALID;const it=await this._def.schema._parseAsync({data:nt,path:j.path,parent:j});return it.status==="aborted"?INVALID:it.status==="dirty"||$.value==="dirty"?DIRTY(it.value):it});{if($.value==="aborted")return INVALID;const nt=this._def.schema._parseSync({data:rt,path:j.path,parent:j});return nt.status==="aborted"?INVALID:nt.status==="dirty"||$.value==="dirty"?DIRTY(nt.value):nt}}if(et.type==="refinement"){const rt=nt=>{const it=et.refinement(nt,tt);if(j.common.async)return Promise.resolve(it);if(it instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return nt};if(j.common.async===!1){const nt=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});return nt.status==="aborted"?INVALID:(nt.status==="dirty"&&$.dirty(),rt(nt.value),{status:$.value,value:nt.value})}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then(nt=>nt.status==="aborted"?INVALID:(nt.status==="dirty"&&$.dirty(),rt(nt.value).then(()=>({status:$.value,value:nt.value}))))}if(et.type==="transform")if(j.common.async===!1){const rt=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(!isValid$1(rt))return rt;const nt=et.transform(rt.value,tt);if(nt instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$.value,value:nt}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then(rt=>isValid$1(rt)?Promise.resolve(et.transform(rt.value,tt)).then(nt=>({status:$.value,value:nt})):rt);util.assertNever(et)}}ZodEffects.create=(a,_,$)=>new ZodEffects({schema:a,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:_,...processCreateParams($)});ZodEffects.createWithPreprocess=(a,_,$)=>new ZodEffects({schema:_,effect:{type:"preprocess",transform:a},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams($)});class ZodOptional extends ZodType{_parse(_){return this._getType(_)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}ZodOptional.create=(a,_)=>new ZodOptional({innerType:a,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(_)});class ZodNullable extends ZodType{_parse(_){return this._getType(_)===ZodParsedType.null?OK(null):this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}ZodNullable.create=(a,_)=>new ZodNullable({innerType:a,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(_)});class ZodDefault extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_);let j=$.data;return $.parsedType===ZodParsedType.undefined&&(j=this._def.defaultValue()),this._def.innerType._parse({data:j,path:$.path,parent:$})}removeDefault(){return this._def.innerType}}ZodDefault.create=(a,_)=>new ZodDefault({innerType:a,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof _.default=="function"?_.default:()=>_.default,...processCreateParams(_)});class ZodCatch extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j={...$,common:{...$.common,issues:[]}},et=this._def.innerType._parse({data:j.data,path:j.path,parent:{...j}});return isAsync(et)?et.then(tt=>({status:"valid",value:tt.status==="valid"?tt.value:this._def.catchValue({get error(){return new ZodError(j.common.issues)},input:j.data})})):{status:"valid",value:et.status==="valid"?et.value:this._def.catchValue({get error(){return new ZodError(j.common.issues)},input:j.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(a,_)=>new ZodCatch({innerType:a,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof _.catch=="function"?_.catch:()=>_.catch,...processCreateParams(_)});class ZodNaN extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.nan){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:j.parsedType}),INVALID}return{status:"valid",value:_.data}}}ZodNaN.create=a=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(a)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j=$.data;return this._def.type._parse({data:j,path:$.path,parent:$})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.common.async)return(async()=>{const tt=await this._def.in._parseAsync({data:j.data,path:j.path,parent:j});return tt.status==="aborted"?INVALID:tt.status==="dirty"?($.dirty(),DIRTY(tt.value)):this._def.out._parseAsync({data:tt.value,path:j.path,parent:j})})();{const et=this._def.in._parseSync({data:j.data,path:j.path,parent:j});return et.status==="aborted"?INVALID:et.status==="dirty"?($.dirty(),{status:"dirty",value:et.value}):this._def.out._parseSync({data:et.value,path:j.path,parent:j})}}static create(_,$){return new ZodPipeline({in:_,out:$,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(_){const $=this._def.innerType._parse(_),j=et=>(isValid$1(et)&&(et.value=Object.freeze(et.value)),et);return isAsync($)?$.then(et=>j(et)):j($)}unwrap(){return this._def.innerType}}ZodReadonly.create=(a,_)=>new ZodReadonly({innerType:a,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(_)});function custom(a,_={},$){return a?ZodAny.create().superRefine((j,et)=>{var tt,rt;if(!a(j)){const nt=typeof _=="function"?_(j):typeof _=="string"?{message:_}:_,it=(rt=(tt=nt.fatal)!==null&&tt!==void 0?tt:$)!==null&&rt!==void 0?rt:!0,st=typeof nt=="string"?{message:nt}:nt;et.addIssue({code:"custom",...st,fatal:it})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(a,_={message:`Input not instance of ${a.name}`})=>custom($=>$ instanceof a,_),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType$1=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce$2={string:a=>ZodString.create({...a,coerce:!0}),number:a=>ZodNumber.create({...a,coerce:!0}),boolean:a=>ZodBoolean.create({...a,coerce:!0}),bigint:a=>ZodBigInt.create({...a,coerce:!0}),date:a=>ZodDate.create({...a,coerce:!0})},NEVER$1=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid:isValid$1,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce$2,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType$1,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER$1,ZodIssueCode,quotelessJson,ZodError});const Schema$1=z.object({address:z.string()}),parsePkh=a=>{if(isValidContractPkh(a))return parseContractPkh(a);if(isValidImplicitPkh(a))return parseImplicitPkh(a);throw new Error(`Cannot parse address type: ${a}`)},isAddressValid=a=>validateAddress(a)===ValidationResult.VALID,isValidContractPkh=a=>isAddressValid(a)&&a.match(/^KT1\w+/),isValidImplicitPkh=a=>isAddressValid(a)&&a.match(/^tz[1234]\w+/),parseContractPkh=a=>{if(isValidContractPkh(a))return{type:"contract",pkh:a};throw new Error(`Invalid contract address: ${a}`)},parseImplicitPkh=a=>{if(isValidImplicitPkh(a))return{type:"implicit",pkh:a};throw new Error(`Invalid implicit address: ${a}`)},encodeReserved=[encodeURIComponent,encodeURIComponent];function encode$2(a,_=","){const $=(j,et)=>{const tt=a[et%a.length];return typeof j>"u"?"":typeof j=="object"?Array.isArray(j)?j.map(tt).join(_):Object.entries(j).reduce((nt,it)=>[...nt,...it],[]).map(tt).join(_):tt(String(j))};return(j,...et)=>j.reduce((tt,rt,nt)=>`${tt}${rt}${$(et[nt],nt)}`,"")}function delimited(a=","){return(_,$=encodeReserved)=>Object.entries(_).filter(([,j])=>j!==void 0).map(([j,et])=>encode$2($,a)`${j}=${et}`).join("&")}function stripUndefined(a){return a&&JSON.parse(JSON.stringify(a))}function joinUrl(...a){return a.filter(Boolean).map((_,$)=>$===0?_:_.replace(/^\/+/,"")).map((_,$,j)=>$===j.length-1?_:_.replace(/\/+$/,"")).join("/")}function query(...a){const _=a.filter(Boolean).join("&");return _&&`?${_}`}function explode(a,_=encodeReserved){const $=encode$2(_);return Object.entries(a).filter(([,j])=>j!==void 0).map(([j,et])=>Array.isArray(et)?et.map(tt=>$`${j}=${tt}`).join("&"):typeof et=="object"?explode(et,_):$`${j}=${et}`).join("&")}const form=delimited(),SUCCESS_CODES=[200,201,202,204];async function ok(a){const _=await a;if(SUCCESS_CODES.some($=>$==_.status))return _.data;throw new HttpError(_.status,_.data)}class HttpError extends Error{constructor($,j){super(`Error: ${$}`);Yr(this,"status");Yr(this,"data");this.status=$,this.data=j}}function runtime$1(a){async function _(tt,rt){const nt=await et(tt,rt);let it;try{it=await nt.text()}catch{}return{status:nt.status,headers:nt.headers,contentType:nt.headers.get("content-type"),data:it}}async function $(tt,rt={}){const{status:nt,headers:it,contentType:st,data:ot}=await _(tt,{...rt,headers:{Accept:"application/json",...rt.headers}});return(st?st.includes("json"):!1)?{status:nt,headers:it,data:ot?JSON.parse(ot):null}:{status:nt,headers:it,data:ot}}async function j(tt,rt={}){const nt=await et(tt,rt);let it;try{it=await nt.blob()}catch{}return{status:nt.status,headers:nt.headers,data:it}}async function et(tt,rt={}){const{baseUrl:nt,headers:it,fetch:st,...ot}={...a,...rt},at=joinUrl(nt,tt);return await(st||fetch)(at,{...ot,headers:stripUndefined({...a.headers,...it})})}return{ok,fetchText:_,fetchJson:$,fetchBlob:j,json({body:tt,headers:rt,...nt}){return{...nt,...tt!=null&&{body:JSON.stringify(tt)},headers:{...rt,"Content-Type":"application/json"}}},form({body:tt,headers:rt,...nt}){return{...nt,...tt!=null&&{body:form(tt)},headers:{...rt,"Content-Type":"application/x-www-form-urlencoded"}}},multipart({body:tt,...rt}){if(tt==null)return rt;const nt=new(a.formDataConstructor||rt.formDataConstructor||FormData);return Object.entries(tt).forEach(([it,st])=>{nt.append(it,st)}),{...rt,body:nt}}}}const jsonParameter=(a,_)=>{if(!_)return{};const $={};return Object.entries(_).forEach(([j,et])=>{if(!(et instanceof Object))throw new Error(`Expected ${a} value to be object, received ${typeof et}`);const{jsonPath:tt,jsonValue:rt}=et;if(rt==null)throw new Error(`Expected jsonValue in ${a} -> ${j}, found: ${rt}`);const it=[a,tt,j].filter(st=>st!==void 0).join(".");$[it]=rt}),$},anyofParameter=(a,_)=>{if(!_)return{};const{fields:$}=_;(rt=>{if(!Array.isArray(rt))throw new Error(`Expected ${a} fields to be Array. Received ${typeof rt}.`);return rt.forEach(nt=>{if(typeof nt!="string")throw new Error(`Expected ${a} fields to be strings. Received ${typeof nt}`)}),!0})($);const et={},tt=$.join(".");if(_.value){const rt=`${a}.${tt}`;et[rt]=_.value}for(const rt of["in","eq","null"])if(_[rt]){const nt=`${a}.${tt}.${rt}`;return et[nt]=Array.isArray(_[rt])?_[rt].join(","):_[rt],et}return et},queryParameter=(a,_)=>{if(!_)return{};const $={};return Object.entries(_).forEach(([j,et])=>{const tt=`${a}.${j}`;$[tt]=et}),$},parsers={jsonParameter,queryParameter,anyofParameter},defaults={baseUrl:"https://api.tzkt.io"},oazapfts=runtime$1(defaults);function accountsGet({id:a,address:_,$type:$,kind:j,delegate:et,balance:tt,staked:rt,lastActivity:nt,select:it,sort:st,offset:ot,limit:at}={},ut){return oazapfts.ok(oazapfts.fetchJson(`/v1/accounts${query(explode({limit:at,...parsers.queryParameter("id",a),...parsers.queryParameter("address",_),...parsers.queryParameter("type",$),...parsers.queryParameter("kind",j),...parsers.queryParameter("delegate",et),...parsers.queryParameter("balance",tt),...parsers.queryParameter("staked",rt),...parsers.queryParameter("lastActivity",nt),...parsers.queryParameter("select",it),...parsers.queryParameter("sort",st),...parsers.queryParameter("offset",ot)}))}`,{...ut}))}function blocksGetCount(a){return oazapfts.ok(oazapfts.fetchJson("/v1/blocks/count",{...a}))}function contractsGet({address:a,kind:_,tzips:$,creator:j,manager:et,delegate:tt,balance:rt,lastActivity:nt,typeHash:it,codeHash:st,select:ot,sort:at,offset:ut,limit:ht,includeStorage:yt}={},wt){return oazapfts.ok(oazapfts.fetchJson(`/v1/contracts${query(explode({limit:ht,includeStorage:yt,...parsers.queryParameter("address",a),...parsers.queryParameter("kind",_),...parsers.queryParameter("tzips",$),...parsers.queryParameter("creator",j),...parsers.queryParameter("manager",et),...parsers.queryParameter("delegate",tt),...parsers.queryParameter("balance",rt),...parsers.queryParameter("lastActivity",nt),...parsers.queryParameter("typeHash",it),...parsers.queryParameter("codeHash",st),...parsers.queryParameter("select",ot),...parsers.queryParameter("sort",at),...parsers.queryParameter("offset",ut)}))}`,{...wt}))}function delegatesGet({active:a,lastActivity:_,select:$,sort:j,offset:et,limit:tt}={},rt){return oazapfts.ok(oazapfts.fetchJson(`/v1/delegates${query(explode({limit:tt,...parsers.queryParameter("active",a),...parsers.queryParameter("lastActivity",_),...parsers.queryParameter("select",$),...parsers.queryParameter("sort",j),...parsers.queryParameter("offset",et)}))}`,{...rt}))}function operationsGetDelegations({anyof:a,initiator:_,sender:$,prevDelegate:j,newDelegate:et,level:tt,timestamp:rt,senderCodeHash:nt,status:it,select:st,sort:ot,offset:at,limit:ut,quote:ht}={},yt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/delegations${query(explode({limit:ut,quote:ht,...parsers.anyofParameter("anyof",a),...parsers.queryParameter("initiator",_),...parsers.queryParameter("sender",$),...parsers.queryParameter("prevDelegate",j),...parsers.queryParameter("newDelegate",et),...parsers.queryParameter("level",tt),...parsers.queryParameter("timestamp",rt),...parsers.queryParameter("senderCodeHash",nt),...parsers.queryParameter("status",it),...parsers.queryParameter("select",st),...parsers.queryParameter("sort",ot),...parsers.queryParameter("offset",at)}))}`,{...yt}))}function operationsGetOriginations({anyof:a,initiator:_,sender:$,contractManager:j,contractDelegate:et,originatedContract:tt,id:rt,typeHash:nt,codeHash:it,level:st,timestamp:ot,senderCodeHash:at,anyCodeHash:ut,status:ht,select:yt,sort:wt,offset:Ct,limit:Pt,micheline:$t,quote:Mt}={},Bt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/originations${query(explode({limit:Pt,micheline:$t,quote:Mt,...parsers.anyofParameter("anyof",a),...parsers.queryParameter("initiator",_),...parsers.queryParameter("sender",$),...parsers.queryParameter("contractManager",j),...parsers.queryParameter("contractDelegate",et),...parsers.queryParameter("originatedContract",tt),...parsers.queryParameter("id",rt),...parsers.queryParameter("typeHash",nt),...parsers.queryParameter("codeHash",it),...parsers.queryParameter("level",st),...parsers.queryParameter("timestamp",ot),...parsers.queryParameter("senderCodeHash",at),...parsers.queryParameter("anyCodeHash",ut),...parsers.queryParameter("status",ht),...parsers.queryParameter("select",yt),...parsers.queryParameter("sort",wt),...parsers.queryParameter("offset",Ct)}))}`,{...Bt}))}function operationsGetTransactions({anyof:a,initiator:_,sender:$,target:j,amount:et,id:tt,level:rt,timestamp:nt,senderCodeHash:it,targetCodeHash:st,codeHash:ot,entrypoint:at,parameter:ut,hasInternals:ht,status:yt,select:wt,sort:Ct,offset:Pt,limit:$t,micheline:Mt,quote:Bt}={},Dt){return oazapfts.ok(oazapfts.fetchJson(`/v1/operations/transactions${query(explode({limit:$t,micheline:Mt,quote:Bt,...parsers.anyofParameter("anyof",a),...parsers.queryParameter("initiator",_),...parsers.queryParameter("sender",$),...parsers.queryParameter("target",j),...parsers.queryParameter("amount",et),...parsers.queryParameter("id",tt),...parsers.queryParameter("level",rt),...parsers.queryParameter("timestamp",nt),...parsers.queryParameter("senderCodeHash",it),...parsers.queryParameter("targetCodeHash",st),...parsers.queryParameter("codeHash",ot),...parsers.queryParameter("entrypoint",at),...parsers.jsonParameter("parameter",ut),...parsers.queryParameter("hasInternals",ht),...parsers.queryParameter("status",yt),...parsers.queryParameter("select",wt),...parsers.queryParameter("sort",Ct),...parsers.queryParameter("offset",Pt)}))}`,{...Dt}))}function quotesGetLast(a){return oazapfts.ok(oazapfts.fetchJson("/v1/quotes/last",{...a}))}function tokensGetTokenBalances({id:a,account:_,tokenId:$,tokenContract:j,tokenTokenId:et,tokenStandard:tt,tokenMetadata:rt,tokenHasFilters:nt,balance:it,firstLevel:st,firstTime:ot,lastLevel:at,lastTime:ut,indexedAt:ht,sort:yt,offset:wt,limit:Ct,select:Pt}={},$t){return oazapfts.ok(oazapfts.fetchJson(`/v1/tokens/balances${query(explode({"token.HasFilters":nt,limit:Ct,...parsers.queryParameter("id",a),...parsers.queryParameter("account",_),...parsers.queryParameter("token.id",$),...parsers.queryParameter("token.contract",j),...parsers.queryParameter("token.tokenId",et),...parsers.queryParameter("token.standard",tt),...parsers.jsonParameter("token.metadata",rt),...parsers.queryParameter("balance",it),...parsers.queryParameter("firstLevel",st),...parsers.queryParameter("firstTime",ot),...parsers.queryParameter("lastLevel",at),...parsers.queryParameter("lastTime",ut),...parsers.queryParameter("indexedAt",ht),...parsers.queryParameter("sort",yt),...parsers.queryParameter("offset",wt),...parsers.queryParameter("select",Pt)}))}`,{...$t}))}function tokensGetTokenTransfers({id:a,level:_,timestamp:$,tokenId:j,tokenContract:et,tokenTokenId:tt,tokenStandard:rt,tokenMetadata:nt,tokenHasFilters:it,anyof:st,$from:ot,to:at,amount:ut,transactionId:ht,originationId:yt,migrationId:wt,indexedAt:Ct,sort:Pt,offset:$t,limit:Mt,select:Bt}={},Dt){return oazapfts.ok(oazapfts.fetchJson(`/v1/tokens/transfers${query(explode({"token.HasFilters":it,limit:Mt,...parsers.queryParameter("id",a),...parsers.queryParameter("level",_),...parsers.queryParameter("timestamp",$),...parsers.queryParameter("token.id",j),...parsers.queryParameter("token.contract",et),...parsers.queryParameter("token.tokenId",tt),...parsers.queryParameter("token.standard",rt),...parsers.jsonParameter("token.metadata",nt),...parsers.anyofParameter("anyof",st),...parsers.queryParameter("from",ot),...parsers.queryParameter("to",at),...parsers.queryParameter("amount",ut),...parsers.queryParameter("transactionId",ht),...parsers.queryParameter("originationId",yt),...parsers.queryParameter("migrationId",wt),...parsers.queryParameter("indexedAt",Ct),...parsers.queryParameter("sort",Pt),...parsers.queryParameter("offset",$t),...parsers.queryParameter("select",Bt)}))}`,{...Dt}))}let e$1=class{constructor(_){this.queue=void 0,this.maxConcurrent=void 0,this.count=void 0,this.queue=[],this.maxConcurrent=_,this.count=0}get canAcquire(){return this.countthis.queue.push(_))}release(){const _=this.queue.shift();_?setTimeout(_,0):this.count--}};const t$4="_default";class s{constructor(_=1){this.semaphoreInstances=void 0,this.maxConcurrent=void 0,this.semaphoreInstances={},this.maxConcurrent=_}hasSemaphoreInstance(_=t$4){return!!this.semaphoreInstances[_]}getSemaphoreInstance(_=t$4){return this.hasSemaphoreInstance(_)||(this.semaphoreInstances[_]=new e$1(this.maxConcurrent)),this.semaphoreInstances[_]}tidy(_=t$4){this.hasSemaphoreInstance(_)&&this.getSemaphoreInstance(_).count===0&&delete this.semaphoreInstances[_]}canAcquire(_=t$4){return this.getSemaphoreInstance(_).canAcquire}acquire(_=t$4){return this.getSemaphoreInstance(_).acquire()}release(_=t$4){this.getSemaphoreInstance(_).release(),this.tidy(_)}count(_=t$4){return this.hasSemaphoreInstance(_)?this.getSemaphoreInstance(_).count:0}hasTasks(_=t$4){return this.count(_)>0}async request(_,$=t$4){try{return await this.acquire($),await _()}finally{this.release($)}}async requestIfAvailable(_,$=t$4){return this.canAcquire($)?this.request(_,$):null}}function assign$1(a,_){for(const $ in _)Object.defineProperty(a,$,{value:_[$],enumerable:!0,configurable:!0});return a}function createError(a,_,$){if(!a||typeof a=="string")throw new TypeError("Please pass an Error to err-code");$||($={}),typeof _=="object"&&($=_,_=void 0),_!=null&&($.code=_);try{return assign$1(a,$)}catch{$.message=a.message,$.stack=a.stack;const et=function(){};return et.prototype=Object.create(Object.getPrototypeOf(a)),assign$1(new et,$)}}var errCode=createError,retry$3={};function RetryOperation(a,_){typeof _=="boolean"&&(_={forever:_}),this._originalTimeouts=JSON.parse(JSON.stringify(a)),this._timeouts=a,this._options=_||{},this._maxRetryTime=_&&_.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(a){if(this._timeout&&clearTimeout(this._timeout),!a)return!1;var _=new Date().getTime();if(a&&_-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(a);var $=this._timeouts.shift();if($===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),$=this._timeouts.shift();else return!1;var j=this,et=setTimeout(function(){j._attempts++,j._operationTimeoutCb&&(j._timeout=setTimeout(function(){j._operationTimeoutCb(j._attempts)},j._operationTimeout),j._options.unref&&j._timeout.unref()),j._fn(j._attempts)},$);return this._options.unref&&et.unref(),!0};RetryOperation.prototype.attempt=function(a,_){this._fn=a,_&&(_.timeout&&(this._operationTimeout=_.timeout),_.cb&&(this._operationTimeoutCb=_.cb));var $=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){$._operationTimeoutCb()},$._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(a){console.log("Using RetryOperation.try() is deprecated"),this.attempt(a)};RetryOperation.prototype.start=function(a){console.log("Using RetryOperation.start() is deprecated"),this.attempt(a)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var a={},_=null,$=0,j=0;j=$&&(_=et,$=rt)}return _};(function(a){var _=retry_operation;a.operation=function($){var j=a.timeouts($);return new _(j,{forever:$&&$.forever,unref:$&&$.unref,maxRetryTime:$&&$.maxRetryTime})},a.timeouts=function($){if($ instanceof Array)return[].concat($);var j={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var et in $)j[et]=$[et];if(j.minTimeout>j.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var tt=[],rt=0;rttzktRateLimiter.acquire().then(()=>promiseRetry$1(_=>a().catch(_),{retries:3,minTimeout:100})).catch(_=>{throw"status"in _&&"data"in _?new Error(`Fetching data from tzkt failed with: ${_.status}, ${_.data}`):_}).finally(()=>tzktRateLimiter.release()),MULTISIG_FETCH_LIMIT=1e4,TYPE_HASH=1963879877,CODE_HASH=-1890025422,getAllMultiSigContracts=async a=>withRateLimit(async()=>{try{const _=`${a.tzktApiUrl}/v1/contracts?typeHash=${TYPE_HASH}&codeHash=${CODE_HASH}&includeStorage=true&limit=${MULTISIG_FETCH_LIMIT}`,{data:$}=await axios.get(_);return $}catch(_){throw new Error(`Error fetching same contracts from tzkt: ${_.message}`)}}),getExistingContracts=(a,_)=>withRateLimit(()=>contractsGet({address:{in:[a.join(",")]},select:{fields:["address"]},limit:Math.min(1e4,a.length)},{baseUrl:_.tzktApiUrl})),getPendingOperations=async(a,_)=>withRateLimit(async()=>{if(a.length===0)return Promise.resolve([]);const $=`${_.tzktApiUrl}/v1/bigmaps/keys?active=true&bigmap.in=${a.join(",")}&limit=${MULTISIG_FETCH_LIMIT}`,{data:j}=await axios.get($);return j}),parseMultisig=a=>({address:parseContractPkh(a.address),threshold:Number(a.storage.threshold),signers:a.storage.signers.map(parseImplicitPkh),pendingOperationsBigmapId:a.storage.pending_ops}),getRelevantMultisigContracts=async(a,_)=>(await getAllMultiSigContracts(_)).filter(({storage:{signers:j}})=>lodashExports.every(j,isValidImplicitPkh)?j.filter(tt=>a.has(tt)).length>0:!1).map(parseMultisig),getNetworksForContracts=async(a,_)=>{const $=new Map;return _.length===0||(await Promise.all(a.map(async et=>(await getExistingContracts(_,et)).map(tt=>[tt,et.name])))).flat().forEach(([et,tt])=>$.set(et,tt)),$},parseMultisigOperation=a=>{const{bigmap:_,key:$,value:j}=a;if($===null||j===null)throw new Error("parseMultisigOperation failed");return{id:$,bigmapId:_,rawActions:j.actions,approvals:j.approvals.map(parseImplicitPkh)}},getPendingOperationsForMultisigs=async(a,_)=>{if(a.length===0)return[];const $=a.map(et=>et.pendingOperationsBigmapId),j=await getPendingOperations($,_);return lodashExports.compact(j.map(parseMultisigOperation))},VERSION$1=6,mainStoreMigrations={0:a=>produce(a,_=>{_.multisigs.labelsMap={}}),1:a=>produce(a,_=>{_.announcement=initialState$9}),2:lodashExports.identity,3:a=>produce(a,_=>{_.networks.current.name==="ghostnet"&&(_.networks.current.buyTezUrl="https://faucet.ghostnet.teztnets.com/");for(const $ of _.networks.available)if($.name==="ghostnet"){$.buyTezUrl="https://faucet.ghostnet.teztnets.com/";break}}),4:lodashExports.identity,5:a=>produce(a,_=>{delete _.assets.transfers.tez}),6:async a=>{const _=Object.values(a.contacts).filter(tt=>isValidImplicitPkh(tt.pkh)).map(tt=>[tt.pkh,{...tt,network:void 0}]),$=Object.values(a.contacts).filter(tt=>isValidContractPkh(tt.pkh)).map(tt=>tt.pkh),et=[...(await getNetworksForContracts(a.networks.available,$)).entries()].map(([tt,rt])=>[tt,{...a.contacts[tt],network:rt}]);return produce(a,tt=>{tt.contacts=lodashExports.fromPairs([..._,...et])})}},accountsMigrations={0:lodashExports.identity,1:lodashExports.identity,2:a=>produce(a,_=>{_.items.forEach($=>{$.type==="secret_key"&&($.curve="ed25519")})}),3:lodashExports.identity,4:a=>produce(a,_=>{_.items.forEach($=>{$.type==="ledger"&&!$.derivationPathTemplate&&($.derivationPathTemplate=void 0,$.derivationPath==="44'/1729'/0'/0'"?$.derivationPathTemplate="44'/1729'/?'/0'":$.derivationPath==="44'/1729'/0'/0'/0'"&&($.derivationPathTemplate="44'/1729'/?'/0'/0'"))})}),5:lodashExports.identity,6:lodashExports.identity},AES_MODE="AES-GCM",BYTE_TO_BIT=8,KEY_SIZE=32,NUM_ITERATIONS_V2=6e5,NUM_ITERATIONS_V1=1e4,derivePasswordBasedKeyV1=async(a,_)=>derivePasswordBasedKey(Buffer$g.alloc(32,a,"utf-8"),_,NUM_ITERATIONS_V1),derivePasswordBasedKeyV2=async(a,_)=>derivePasswordBasedKey(Buffer$g.from(a,"utf-8"),_,NUM_ITERATIONS_V2),derivePasswordBasedKey=async(a,_,$)=>{const j={name:"PBKDF2",salt:_,iterations:$,hash:"SHA-256"},et=await crypto.subtle.importKey("raw",a,j.name,!1,["deriveKey"]);return await crypto.subtle.deriveKey(j,et,{name:AES_MODE,length:KEY_SIZE*BYTE_TO_BIT},!1,["encrypt","decrypt"])},SALT_SIZE=32,IV_SIZE=12,encrypt$1=async(a,_)=>{const $=crypto.getRandomValues(new Uint8Array(SALT_SIZE)),j=await derivePasswordBasedKeyV2(_,$),et=crypto.getRandomValues(new Uint8Array(IV_SIZE)),tt=await crypto.subtle.encrypt({name:AES_MODE,iv:et},j,Buffer$g.from(a,"utf-8"));return{iv:buf2hex(Buffer$g.from(et)),salt:buf2hex(Buffer$g.from($)),data:buf2hex(Buffer$g.from(tt))}},decrypt$1=async(a,_,$="V2")=>{const{iv:j,salt:et,data:tt}=a;try{const rt=$==="V2"?await derivePasswordBasedKeyV2(_,hex2Bytes(et)):await derivePasswordBasedKeyV1(_,hex2Bytes(et)),nt=await crypto.subtle.decrypt({name:AES_MODE,iv:hex2Bytes(j)},rt,hex2Bytes(tt));return Buffer$g.from(nt).toString("utf-8")}catch{throw new Error("Error decrypting data: Invalid password")}},changeMnemonicPassword=createAsyncThunk("accounts/changeMnemonicPassword",async({currentPassword:a,newPassword:_},{getState:$})=>{if(a===_)throw new Error("New password must be different from the current password");const{items:j,seedPhrases:et}=$().accounts;if(j.filter(rt=>rt.type==="mnemonic").length===0)throw new Error("No mnemonic accounts found");const tt=await Promise.all(Object.entries(et).map(async([rt,nt])=>{if(!nt)throw new Error("No encrypted mnemonic found");try{const it=await decrypt$1(nt,a),st=await encrypt$1(it,_);return[rt,st]}catch(it){throw new Error(it.message)}}));return{newEncryptedMnemonics:lodashExports.fromPairs(tt)}}),initialState$8={items:[],seedPhrases:{},secretKeys:{}},accountsSlice=createSlice({name:"accounts",initialState:initialState$8,extraReducers:a=>{a.addCase(changeMnemonicPassword.fulfilled,(_,$)=>{const{newEncryptedMnemonics:j}=$.payload;_.seedPhrases=j})},reducers:{reset:()=>initialState$8,removeMnemonicAndAccounts:(a,{payload:_})=>{const{fingerPrint:$}=_,j=a.items.filter(et=>!(et.type==="mnemonic"&&et.seedFingerPrint===$));a.items=j,delete a.seedPhrases[$]},removeNonMnemonicAccounts:(a,{payload:_})=>{a.items=lodashExports.remove(a.items,$=>$.type==="mnemonic"||$.type!==_.accountType),_.accountType==="secret_key"&&(a.secretKeys={})},removeAccount:(a,{payload:_})=>{lodashExports.remove(a.items,$=>$.address.pkh===_.address.pkh),_.type==="secret_key"&&delete a.secretKeys[_.address.pkh]},renameAccount:(a,{payload:_})=>{const{account:$,newName:j}=_;if(j.length===0)throw new Error("Cannot rename account to an empty name.");if(a.items.find(tt=>tt.label===j))throw new Error(`Cannot rename account ${$.address.pkh} to ${j} since the name already exists.`);const et=a.items.find(tt=>tt.address.pkh===$.address.pkh&&tt.label===$.label);et&&(et.label=j)},addAccount:(a,{payload:_})=>{a.items=concatUnique(a.items,[_])},addMnemonicAccounts:(a,{payload:{encryptedMnemonic:_,accounts:$,seedFingerprint:j}})=>{a.items=concatUnique(a.items,$),a.seedPhrases[j]=_},addSecretKey:(a,{payload:{pkh:_,encryptedSecretKey:$}})=>{a.secretKeys[_]=$}}}),concatUnique=(a,_)=>(_.forEach($=>{if(a.some(j=>j.address.pkh===$.address.pkh))throw new Error(`Can't add account with address ${$.address.pkh} because it already exists.`)}),[...a,..._]);accountsSlice.actions;const FA12TokenSchema=z.object({standard:z.string().regex(/^fa1\.2$/i),contract:Schema$1}),FA2TokenSchema=z.object({standard:z.string().regex(/^fa2$/i),tokenId:z.string(),contract:Schema$1}),NFTSchema=z.object({id:z.number(),standard:z.string().regex(/^fa2$/i),tokenId:z.string(),contract:Schema$1,totalSupply:z.string().optional(),metadata:z.object({displayUri:z.string(),decimals:z.void().or(z.string().regex(/^0$/))})}),fromRaw$1=a=>{const _=a.metadata;if(a.standard==="fa1.2"){const et=FA12TokenSchema.safeParse(a);return et.success?{type:"fa1.2",metadata:_,contract:et.data.contract.address,tokenId:"0"}:(console.warn("Invalid FA1 token: "+JSON.stringify(a)),null)}const $=NFTSchema.safeParse(a);if($.success)return{metadata:_,type:"nft",id:$.data.id,contract:$.data.contract.address,tokenId:$.data.tokenId,displayUri:$.data.metadata.displayUri,totalSupply:$.data.totalSupply};const j=FA2TokenSchema.safeParse(a);return j.success?{type:"fa2",metadata:_,contract:j.data.contract.address,tokenId:j.data.tokenId}:(console.warn("Invalid FA2 token: "+JSON.stringify(a)),null)},fullId=a=>`${a.contract}:${a.tokenId}`,defaultTokenName=a=>{switch(a.type){case"fa1.2":return DEFAULT_FA1_NAME;case"fa2":return DEFAULT_FA2_NAME;case"nft":return DEFAULT_NFT_NAME}},tokenNameSafe=a=>tokenName(a)||defaultTokenName(a),tokenName=a=>{var _;return(_=a.metadata)==null?void 0:_.name},defaultTokenSymbol=a=>{switch(a.type){case"fa1.2":return DEFAULT_FA1_SYMBOL;case"fa2":return DEFAULT_FA2_SYMBOL;case"nft":return DEFAULT_NFT_SYMBOL}},tokenSymbolSafe=a=>tokenSymbol(a)||defaultTokenSymbol(a),tokenSymbol=a=>{var _;return(_=a.metadata)==null?void 0:_.symbol},tokenDecimals=a=>{var _;return((_=a.metadata)==null?void 0:_.decimals)??DEFAULT_TOKEN_DECIMALS},getRealAmount=(a,_)=>{const $=new BigNumber(_),j=tokenDecimals(a);return $.multipliedBy(new BigNumber(10).exponentiatedBy(j)).toFixed()},formatTokenAmount=(a,_=DEFAULT_TOKEN_DECIMALS)=>{const $=BigNumber(a).dividedBy(BigNumber(10).pow(_));try{return new Intl.NumberFormat("en-US",{minimumFractionDigits:Number(_),maximumFractionDigits:Number(_)}).format($.toNumber())}catch{return console.warn(`Can't format token amount with decimals = ${_}`),formatTokenAmount(a,"0")}},tokenPrettyAmount=(a,_,$)=>{var nt;if(_.type==="nft")return a;const j=tokenSymbolSafe(_),et=(nt=_.metadata)==null?void 0:nt.decimals,tt=$!=null&&$.showSymbol?` ${j}`:"";return`${formatTokenAmount(a,et)}${tt}`},artifactUri=a=>a.metadata.artifactUri||a.displayUri,thumbnailUri=a=>a.metadata.thumbnailUri||a.displayUri,mimeType=a=>{var _,$;return($=(_=a.metadata.formats)==null?void 0:_.find(j=>j.uri===artifactUri(a)))==null?void 0:$.mimeType},royalties=a=>{const _=a.metadata.royalties;if(!_)return[];const $=Math.pow(10,Number(_.decimals)),j=Object.entries(_.shares).map(([et,tt])=>({address:et,share:Number(tt)*100/$}));return j.sort((et,tt)=>et.share`${tokenUri(a,_)}/metadata`,tokenUri=({contract:a,tokenId:_},$)=>`${$.tzktExplorerUrl}/${a}/tokens/${_}`,DEFAULT_FA1_NAME="FA1.2 token",DEFAULT_FA2_NAME="FA2 token",DEFAULT_NFT_NAME="NFT",DEFAULT_FA1_SYMBOL="FA1.2",DEFAULT_FA2_SYMBOL="FA2",DEFAULT_NFT_SYMBOL="NFT",DEFAULT_TOKEN_DECIMALS="0",fromRaw=a=>{const _=fromRaw$1(a.token);return!_||!a.balance?null:{balance:a.balance,lastLevel:a.lastLevel,..._}},keepNFTs=a=>a.filter(_=>_.type==="nft"),keepFA1s=a=>a.filter(_=>_.type==="fa1.2"),keepFA2s=a=>a.filter(_=>_.type==="fa2"),initialState$7={blockLevel:null,balances:{mutez:{},tokens:{}},transfers:{tokens:{}},delegationLevels:{},bakers:[],conversionRate:void 0,refetchTrigger:0,isLoading:!1,lastTimeUpdated:null},assetsSlice=createSlice({name:"assets",initialState:initialState$7,extraReducers:a=>a.addCase(accountsSlice.actions.reset,()=>initialState$7),reducers:{reset:()=>initialState$7,updateBlockLevel:(a,{payload:_})=>{a.blockLevel=_},updateTokenTransfers:(a,{payload:_})=>{_.forEach($=>{a.transfers.tokens[$.transactionId]=$})},updateTezBalance:(a,{payload:_})=>{a.balances.mutez=_.reduce(($,j)=>({...$,[j.address]:String(j.balance)}),{}),a.delegationLevels=_.reduce(($,j)=>({...$,[j.address]:j.delegationLevel}),{})},updateTokenBalance:(a,{payload:_})=>{const $=lodashExports.groupBy(_,j=>j.account.address);a.balances.tokens=lodashExports.mapValues($,j=>lodashExports.compact(j.map(fromRaw)).map(({balance:et,contract:tt,tokenId:rt,lastLevel:nt})=>({balance:et,contract:tt,tokenId:rt,lastLevel:nt})))},removeAccountsData:(a,{payload:_})=>{_.forEach($=>{delete a.balances.mutez[$],delete a.balances.tokens[$],delete a.delegationLevels[$]})},updateBakers:(a,{payload:_})=>{a.bakers=_},updateConversionRate:(a,{payload:_})=>{a.conversionRate=_},refetch:a=>{a.refetchTrigger+=1},setIsLoading:(a,{payload:_})=>{a.isLoading=_},setLastTimeUpdated:(a,{payload:_})=>{a.lastTimeUpdated=_}}}),assetsActions=assetsSlice.actions,MAINNET={name:"mainnet",rpcUrl:"https://prod.tcinfra.net/rpc/mainnet/",tzktApiUrl:"https://api.mainnet.tzkt.io",tzktExplorerUrl:"https://tzkt.io",buyTezUrl:"https://widget.wert.io"},GHOSTNET={name:"ghostnet",rpcUrl:"https://ghostnet.ecadinfra.com",tzktApiUrl:"https://api.ghostnet.tzkt.io",tzktExplorerUrl:"https://ghostnet.tzkt.io",buyTezUrl:"https://faucet.ghostnet.teztnets.com/"},isDefault=a=>DefaultNetworks.map(_=>_.name).includes(a.name),DefaultNetworks=[MAINNET,GHOSTNET],initialState$6=lodashExports.fromPairs(DefaultNetworks.map(a=>[a.name,[]])),batchesSlice=createSlice({name:"batches",initialState:initialState$6,reducers:{reset:()=>initialState$6,add:(a,{payload:{operations:_,network:$}})=>{$.name in a||(a[$.name]=[]);const j=a[$.name],et=j.find(tt=>tt.sender.address.pkh===_.sender.address.pkh);if(et){et.operations.push(..._.operations);return}j.push(_)},clear:(a,{payload:{pkh:_,network:$}})=>{const j=a[$.name]||[],et=lodashExports.findIndex(j,tt=>tt.sender.address.pkh===_);et!==-1&&j.splice(et,1)},removeItem:(a,{payload:{pkh:_,index:$,network:j}})=>{const et=a[j.name]||[],tt=lodashExports.findIndex(et,nt=>nt.sender.address.pkh===_);if(tt===-1)return;const rt=et[tt];$lodashExports.fromPairs(Object.entries(a).map(([$,j])=>{const et=(j||[]).filter(tt=>!_.includes(tt.sender.address.pkh));return[$,et]}))}}),batchesActions=batchesSlice.actions,initialState$5={},beaconSlice=createSlice({name:"beacon",initialState:initialState$5,reducers:{reset:()=>initialState$5,addConnection:(a,{payload:_})=>{a[_.dAppId]={accountPkh:_.accountPkh,networkType:_.networkType}},removeConnection:(a,{payload:_})=>{delete a[_]},removeConnections:(a,{payload:_})=>lodashExports.fromPairs(Object.entries(a).filter(([$,j])=>!_.includes(j.accountPkh)))}});beaconSlice.actions;const initialState$4={},contactsSlice=createSlice({name:"contacts",initialState:initialState$4,reducers:{reset:()=>initialState$4,upsert:(a,{payload:_})=>{a[_.pkh]=_},remove:(a,{payload:_})=>{delete a[_]}}}),contactsActions=contactsSlice.actions,MAX_ERRORS_LEN=100,initialState$3=[],errorsSlice=createSlice({name:"errors",initialState:initialState$3,reducers:{reset:()=>initialState$3,add(a,{payload:_}){a.length===MAX_ERRORS_LEN&&a.shift(),a.push(_)}}}),initialState$2={items:[],pendingOperations:{},labelsMap:{}},multisigsSlice=createSlice({name:"multisigs",initialState:initialState$2,reducers:{reset:()=>initialState$2,mockAddAccount:(a,{payload:_})=>{a.items.push({label:`Multisig Account ${a.items.length}`,type:"multisig",..._})},setMultisigs:(a,{payload:_})=>{const $=lodashExports.fromPairs(a.items.map(j=>[j.address.pkh,j.label]));a.items=_.map((j,et)=>({...j,label:$[j.address.pkh]||a.labelsMap[j.address.pkh]||`Multisig Account ${et}`,type:"multisig"}))},addMultisigLabel:(a,{payload:{pkh:_,label:$}})=>{a.labelsMap[_]=$},setPendingOperations:(a,{payload:_})=>{a.pendingOperations=lodashExports.groupBy(_,$=>$.bigmapId)},setName:(a,{payload:_})=>{const{account:{address:{pkh:$}},newName:j}=_,et=a.items.find(tt=>tt.address.pkh===$);et&&(et.label=j)},removeMultisigsData:(a,{payload:_})=>{const $=a.items.filter(j=>_.includes(j.address.pkh)).map(j=>String(j.pendingOperationsBigmapId));a.pendingOperations=lodashExports.omit(a.pendingOperations,$),a.labelsMap=lodashExports.omit(a.labelsMap,_)}}}),multisigActions=multisigsSlice.actions,initialState$1={available:DefaultNetworks,current:MAINNET},networksSlice=createSlice({name:"networks",initialState:initialState$1,reducers:{reset:()=>initialState$1,setCurrent:(a,{payload:_})=>{a.current=_},upsertNetwork:(a,{payload:_})=>{if(isDefault(_))return;const $=a.available.findIndex(j=>j.name===_.name);if(a.current.name===_.name&&(a.current=_),$!==-1){a.available[$]=_;return}a.available.push(_)},removeNetwork:(a,{payload:_})=>{isDefault(_)||lodashExports.remove(a.available,$=>$.name===_.name)}}}),networksActions=networksSlice.actions,initialState=lodashExports.fromPairs(DefaultNetworks.map(a=>[a.name,{}])),tokensSlice=createSlice({name:"tokens",initialState,reducers:{reset:()=>initialState,addTokens:(a,{payload:{network:_,tokens:$}})=>{lodashExports.compact($.map(fromRaw$1)).forEach(j=>{lodashExports.setWith(a,[_.name,j.contract,j.tokenId],j,Object)})}}}),tokensActions=tokensSlice.actions,rootPersistConfig={key:"root",version:VERSION$1,storage:default_1,blacklist:["accounts"],migrate:createAsyncMigrate(mainStoreMigrations)},accountsPersistConfig={key:"accounts",version:VERSION$1,storage:default_1,migrate:createAsyncMigrate(accountsMigrations)},rootReducers=combineReducers({accounts:persistReducer(accountsPersistConfig,accountsSlice.reducer),announcement:announcementSlice.reducer,assets:assetsSlice.reducer,batches:batchesSlice.reducer,beacon:beaconSlice.reducer,contacts:contactsSlice.reducer,errors:errorsSlice.reducer,multisigs:multisigsSlice.reducer,networks:networksSlice.reducer,tokens:tokensSlice.reducer}),reducer=persistReducer(rootPersistConfig,rootReducers),store=configureStore({reducer,middleware:a=>a({serializableCheck:{ignoredActions:[FLUSH,REHYDRATE,PAUSE,PERSIST,PURGE,REGISTER]}})}),persistor=persistStore(store),FormErrorMessage=({children:a,..._})=>jsxRuntimeExports.jsxs(FormErrorMessage$1,{color:colors.orange,fontSize:"12px",..._,children:[jsxRuntimeExports.jsx(Icon,{as:ExclamationIcon,marginRight:"6px"}),a]}),CONFIRMATION_CODE="wasabi",reset=()=>WalletClient.destroy().catch(lodashExports.noop).finally(()=>{persistor.pause(),localStorage.clear(),window.location.reload()}),OffboardingForm=()=>{const a=useForm({mode:"onBlur"}),{register:_,handleSubmit:$,formState:{isValid:j,errors:et},getValues:tt}=a,rt=()=>{if(!(!tt("check")||tt("confirmationCode")!==CONFIRMATION_CODE))return reset()};return jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsxs("form",{onSubmit:$(rt),children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalHeader,{marginBottom:"10px",textAlign:"center",children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(WarningIcon,{width:"40px",height:"40px",marginBottom:"20px"}),jsxRuntimeExports.jsx(Heading,{children:"Off-board Wallet"})]})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text,{marginBottom:"8px",color:colors.gray[400],fontWeight:"bold",textAlign:"center",size:"sm",children:"This will permanently remove any data from this computer."}),jsxRuntimeExports.jsxs(Text,{color:colors.gray[400],textAlign:"center",size:"sm",children:["Please enter « ",CONFIRMATION_CODE," » to confirm. The accounts are still available to be imported in the future; in order to regain access to your accounts, please make sure that you keep the recovery phrase."]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Divider,{borderColor:colors.gray[700],marginY:"20px"}),jsxRuntimeExports.jsx(FormControl,{isInvalid:!!et.check,children:jsxRuntimeExports.jsx(Checkbox,{..._("check",{required:!0}),children:jsxRuntimeExports.jsx(Text,{marginLeft:"8px",fontWeight:"bold",children:"I have read the warning and I am certain I want to remove my private keys locally. I also made sure to keep my recovery phrase."})})}),jsxRuntimeExports.jsx(Divider,{borderColor:colors.gray[700],marginY:"20px"}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!et.confirmationCode,paddingY:5,children:[jsxRuntimeExports.jsx(Input,{type:"text",..._("confirmationCode",{required:"Confirmation is required",validate:nt=>nt===CONFIRMATION_CODE||"Confirmation code does not match"}),placeholder:"Enter code word to confirm"}),et.confirmationCode&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.confirmationCode.message})]})]})]}),jsxRuntimeExports.jsx(ModalFooter,{padding:0,children:jsxRuntimeExports.jsx(Button,{width:"100%",marginBottom:"8px",isDisabled:!j,size:"lg",type:"submit",variant:"warning",children:"Confirm"})})]})})},useOffboardingModal=()=>{const{isOpen:a,onOpen:_,onClose:$}=useDisclosure$1();return{modalElement:jsxRuntimeExports.jsxs(Modal,{isCentered:!0,isOpen:a,onClose:$,children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[900],children:jsxRuntimeExports.jsx(OffboardingForm,{})})]}),onOpen:_}},CircleIcon=({icon:a,size:_,onClick:$=()=>{}})=>jsxRuntimeExports.jsx(Box,{width:_,height:_,margin:"auto",background:colors.gray[700],borderRadius:"full",onClick:$,children:jsxRuntimeExports.jsx(Center,{height:"100%",children:a})}),ModalContentWrapper=({children:a,icon:_,title:$,subtitle:j})=>jsxRuntimeExports.jsxs(VStack,{maxHeight:"83vh",spacing:0,children:[jsxRuntimeExports.jsx(Box,{marginBottom:"16px",children:jsxRuntimeExports.jsx(CircleIcon,{icon:_,size:"48px"})}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",width:"340px",marginBottom:"32px",children:[jsxRuntimeExports.jsx(Heading,{lineHeight:"26px",size:"xl",children:$}),j&&jsxRuntimeExports.jsx(Text,{marginTop:"10px",color:colors.gray[400],lineHeight:"18px",textAlign:"center",size:"sm",children:j})]}),a]}),name="umami",productName="umami",version="2.1.0",author="Trilitech ",description="Tezos Wallet",homepage="https://umamiwallet.com",repository="https://github.com/trilitech/umami-v2",license="MIT",engines={node:">=20 <21.0.0"},type$5="commonjs",main="build/electron.js",scripts={build:"vite build",dev:"vite dev",preview:"vite preview","electron:package:linux":"electron-builder -l","electron:package:mac":"electron-builder -m","electron:package:mac:debug":"yarn electron:package:mac -c electron-builder.dev.yml","electron:package:win":"electron-builder -w","electron:start":"electronmon .",docs:"typedoc --tsconfig tsconfig.e2e.json","format:ci":"prettier --check .",format:"prettier --write .","lint:ci":"eslint src --ext .js,.jsx,.ts,.tsx --max-warnings=0",lint:"eslint src --ext .js,.jsx,.ts,.tsx --fix",test:"cross-env TZ=CET jest","test:watch":"yarn test --watch","test:e2e":"cross-env TS_NODE_PROJECT=tsconfig.e2e.json cucumber-js","test:e2e:focus":"yarn test:e2e --tags='@focus'","theme:watch":"chakra-cli tokens src/style/theme.ts --watch",theme:"chakra-cli tokens src/style/theme.ts"},devDependencies={"@airgap/beacon-wallet":"^4.2.2","@babel/core":"^7.24.5","@babel/preset-env":"^7.24.5","@babel/preset-react":"^7.24.1","@babel/preset-typescript":"^7.24.1","@babel/runtime":"^7.24.5","@chakra-ui/anatomy":"2.2.2","@chakra-ui/cli":"^2.4.1","@chakra-ui/icons":"^2.1.1","@chakra-ui/react":"^2.8.2","@chakra-ui/styled-system":"2.9.2","@chakra-ui/system":"^2.6.2","@chriscdn/promise-semaphore":"^2.0.9","@cucumber/cucumber":"^10.7.0","@electron/notarize":"^2.3.2","@emotion/react":"^11.11.4","@emotion/styled":"^11.11.5","@ledgerhq/hw-transport-webusb":"^6.28.6","@playwright/test":"^1.44.0","@reduxjs/toolkit":"^2.2.5","@stylistic/eslint-plugin":"^2.1.0","@tanstack/eslint-plugin-query":"^5.35.6","@tanstack/react-query":"^5.37.1","@tanstack/react-query-devtools":"^5.37.1","@taquito/ledger-signer":"^19.2.1","@taquito/michel-codec":"^19.2.1","@taquito/rpc":"^19.2.1","@taquito/signer":"^19.2.1","@taquito/taquito":"19.2.1","@taquito/utils":"^19.2.1","@testing-library/dom":"^10.1.0","@testing-library/jest-dom":"6.4.5","@testing-library/react":"14.3.0","@testing-library/user-event":"14.5.2","@toruslabs/customauth":"^15.0.5","@types/babel__core":"^7","@types/babel__preset-env":"^7","@types/identity-obj-proxy":"^3","@types/jest":"^29.5.12","@types/md5":"^2.3.5","@types/node":"20.12.12","@types/papaparse":"^5.3.14","@types/pluralize":"^0.0.33","@types/promise-retry":"^1.1.6","@types/react":"18.3.2","@types/react-dom":"18.3.0","@types/react-test-renderer":"^18","@typescript-eslint/eslint-plugin":"^7.10.0","@typescript-eslint/parser":"^7.10.0","@tzkt/sdk-api":"^2.2.1","@vitejs/plugin-react":"^4.2.1",axios:"^1.7.1","babel-jest":"^29.7.0","bignumber.js":"^9.1.2",bip39:"^3.1.0",concurrently:"^8.2.2","cross-env":"^7.0.3","date-fns":"^3.6.0",electron:"^30.0.6","electron-builder":"^24.13.3",electronmon:"^2.0.3",eslint:"^8.57.0","eslint-import-resolver-typescript":"^3.6.1","eslint-plugin-chakra-ui":"^0.11.0","eslint-plugin-deprecation":"^2.0.0","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^28.5.0","eslint-plugin-jest-dom":"^5.4.0","eslint-plugin-react":"^7.34.1","eslint-plugin-react-hooks":"^4.6.2","eslint-plugin-react-redux":"^4.1.0","eslint-plugin-testing-library":"^6.2.2","eslint-plugin-tsdoc":"^0.2.17","eslint-plugin-unused-imports":"^3.2.0","framer-motion":"^11.2.5","http-server":"^14.1.1","identity-obj-proxy":"^3.0.0",immer:"^10.1.1",jest:"29.7.0","jest-canvas-mock":"^2.5.2","jest-environment-jsdom":"^29.7.0","jest-fail-on-console":"^3.3.0","jest-resolve":"29.7.0","jest-watch-typeahead":"^2.2.2",lodash:"^4.17.21",md5:"^2.3.0",mockdate:"^3.0.5",ordinal:"^1.0.3",papaparse:"^5.4.1",pluralize:"^8.0.0",prettier:"^3.2.5","prettier-plugin-gherkin":"^2.2.1",process:"^0.11.10","promise-retry":"^2.0.1",react:"^18.3.1","react-dom":"^18.3.1","react-error-boundary":"^4.0.13","react-hook-form":"^7.51.5","react-hooks-testing-library":"^0.6.0","react-player":"^2.16.0","react-qrcode-logo":"^2.10.0","react-redux":"9.1.2","react-refresh":"^0.14.2","react-remove-scroll":"^2.5.10","react-responsive-carousel":"^3.2.23","react-router-dom":"^6.23.1","react-test-renderer":"^18.3.1",redux:"^5.0.1","redux-persist":"^6.0.0","ts-node":"^10.9.2",typedoc:"^0.25.13","typedoc-plugin-missing-exports":"^2.2.0",typescript:"5.4.5",vite:"^5.2.11","vite-plugin-checker":"^0.6.4","vite-plugin-node-polyfills":"^0.22.0",zipurl:"^0.2.18",zod:"^3.23.8"},packageManager="yarn@4.2.2",dependencies={"electron-updater":"^6.2.1"},resolutions={jsdom:"^23.0.1","@types/jsdom":"^21.1.6"},packageInfo={name,productName,version,author,description,homepage,repository,license,engines,type:type$5,main,scripts,devDependencies,packageManager,dependencies,resolutions};var withSelector={exports:{}},useSyncExternalStoreWithSelector_production_min={};/** * @license React * use-sync-external-store-with-selector.production.min.js * @@ -535,7 +535,7 @@ Please pass a 2048 word array explicitly.`;function normalize(a){return(a||"").n * * @author Feross Aboukhadijeh * @license MIT - */var isBuffer_1=function(a){return a!=null&&(isBuffer(a)||isSlowBuffer(a)||!!a._isBuffer)};function isBuffer(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function isSlowBuffer(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&isBuffer(a.slice(0,0))}(function(){var a=cryptExports,_=charenc_1.utf8,$=isBuffer_1,j=charenc_1.bin,et=function(tt,rt){tt.constructor==String?rt&&rt.encoding==="binary"?tt=j.stringToBytes(tt):tt=_.stringToBytes(tt):$(tt)?tt=Array.prototype.slice.call(tt,0):!Array.isArray(tt)&&tt.constructor!==Uint8Array&&(tt=tt.toString());for(var nt=a.bytesToWords(tt),it=tt.length*8,st=1732584193,ot=-271733879,at=-1732584194,ut=271733878,ht=0;ht>>24)&16711935|(nt[ht]<<24|nt[ht]>>>8)&4278255360;nt[it>>>5]|=128<>>9<<4)+14]=it;for(var yt=et._ff,wt=et._gg,Ct=et._hh,Pt=et._ii,ht=0;ht>>0,ot=ot+Mt>>>0,at=at+Bt>>>0,ut=ut+Dt>>>0}return a.endian([st,ot,at,ut])};et._ff=function(tt,rt,nt,it,st,ot,at){var ut=tt+(rt&nt|~rt&it)+(st>>>0)+at;return(ut<>>32-ot)+rt},et._gg=function(tt,rt,nt,it,st,ot,at){var ut=tt+(rt&it|nt&~it)+(st>>>0)+at;return(ut<>>32-ot)+rt},et._hh=function(tt,rt,nt,it,st,ot,at){var ut=tt+(rt^nt^it)+(st>>>0)+at;return(ut<>>32-ot)+rt},et._ii=function(tt,rt,nt,it,st,ot,at){var ut=tt+(nt^(rt|~it))+(st>>>0)+at;return(ut<>>32-ot)+rt},et._blocksize=16,et._digestsize=16,md5$1.exports=function(tt,rt){if(tt==null)throw new Error("Illegal argument "+tt);var nt=a.wordsToBytes(et(tt,rt));return rt&&rt.asBytes?nt:rt&&rt.asString?j.bytesToString(nt):a.bytesToHex(nt)}})();var md5Exports=md5$1.exports;const md5=getDefaultExportFromCjs$1(md5Exports),ReactIdenticon=React$2.memo(({count:a=5,background:_,string:$,size:j})=>{const et=reactExports.useRef(null);reactExports.useEffect(()=>{tt()});const tt=()=>{const rt=md5($),nt=Math.floor(j/a),it=rt.slice(0,6),st=et.current;st.width=nt*a,st.height=nt*a;const ot=rt.split("").map(ht=>parseInt(ht,16)).map(ht=>ht<8?0:1),at=[];at[0]=at[4]=ot.slice(0,5),at[1]=at[3]=ot.slice(5,10),at[2]=ot.slice(10,15);const ut=st.getContext("2d");ut.imageSmoothingEnabled=!1,ut.clearRect(0,0,st.width,st.height),at.forEach((ht,yt)=>{ht.forEach((wt,Ct)=>{wt?(ut.fillStyle="#"+it,ut.fillRect(nt*yt,nt*Ct,nt,nt)):(ut.fillStyle=_,ut.fillRect(nt*yt,nt*Ct,nt,nt))})})};return jsxRuntimeExports.jsx("canvas",{ref:et,style:{width:j,height:j}})}),color=a=>`#${md5(a).slice(0,6)}`,Identicon=({address:a,identiconSize:_,...$})=>jsxRuntimeExports.jsx(Box,{sx:{canvas:{borderRadius:"4px"}},zIndex:10,background:"white",borderRadius:"4px","data-testid":"identicon",...$,children:jsxRuntimeExports.jsx(ReactIdenticon,{background:"white",size:_,string:a,style:{borderRadius:4}})}),baseIconProps={stroke:colors.gray[400],borderRadius:"4px",padding:"5px",background:colors.gray[500]},AddressTileIcon=({addressKind:a,size:_="sm",identiconSize:$=20})=>{let j;switch(_){case"sm":j="30px";break;case"md":j="38.5px";break;case"lg":j="45.5px";break}switch(a.type){case"secret_key":case"mnemonic":return jsxRuntimeExports.jsx(Identicon,{width:j,height:j,padding:"5px",address:a.pkh,identiconSize:$});case"social":return jsxRuntimeExports.jsx(SocialIcon,{width:j,height:j,...baseIconProps,stroke:"transparent",background:"white"});case"ledger":return jsxRuntimeExports.jsx(LedgerIcon,{width:j,height:j,...baseIconProps});case"multisig":return jsxRuntimeExports.jsx(KeyIcon,{width:j,height:j,...baseIconProps});case"contact":return jsxRuntimeExports.jsx(ContactIcon,{width:j,height:j,...baseIconProps});case"unknown":return jsxRuntimeExports.jsx(UnknownContactIcon,{width:j,height:j,...baseIconProps});case"baker":{const et=`https://services.tzkt.io/v1/avatars/${a.pkh}`;return jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",marginRight:"8px","data-testid":"baker-icon",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{src:et})})}}},useAddressKind$1=a=>{const _=useOwnedAccountAddressKind$1(a),$=useBakerAddressKind(a),j=useContactAddressKind(a);return _||$||j||{pkh:a.pkh,type:"unknown",label:null}},useOwnedAccountAddressKind$1=({pkh:a})=>{const $=useGetOwnedAccountSafe()(a);return $?{type:$.type,pkh:a,label:$.label}:null},useBakerAddressKind=({pkh:a})=>{const $=useGetBaker()(a);return $?{pkh:a,type:"baker",label:$.name}:null},useContactAddressKind=({pkh:a})=>{const $=useGetContactName()(a);return $?{pkh:a,type:"contact",label:$}:null},splitNumber=a=>{const[_,$]=a.split(".");return{integer:_,decimal:$}},PrettyNumber=({number:a,size:_="md",...$})=>{const j=_==="md"?"md":"lg",et=_==="md"?"sm":"md",{integer:tt,decimal:rt}=splitNumber(a);return jsxRuntimeExports.jsxs(Flex,{alignItems:"end","data-testid":"pretty-number",...$,children:[jsxRuntimeExports.jsx(Heading,{size:j,children:tt}),rt&&jsxRuntimeExports.jsxs(Heading,{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",size:et,children:[".",rt]})]})},AccountBalance=({address:a,size:_,numberProps:$,...j})=>{const tt=useGetAccountBalance()(a);if(!tt)return null;const rt=prettyTezAmount(tt);return jsxRuntimeExports.jsx(Box,{overflow:"hidden",textAlign:"right","data-testid":"account-balance",...j,children:jsxRuntimeExports.jsx(PrettyNumber,{number:rt,size:_,...$})})},AddressTile=({address:a,hideBalance:_=!1,...$})=>{const j=useAddressKind$1(a);return jsxRuntimeExports.jsx(Tooltip,{background:colors.white,hasArrow:!0,label:j.label,placement:"left",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",width:"100%",padding:"9px 10px",background:colors.gray[800],borderRadius:"4px","data-testid":"address-tile",...$,children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",width:_?"100%":"calc(100% - 95px)",children:[jsxRuntimeExports.jsx(AddressTileIcon,{addressKind:j}),j.type==="unknown"?jsxRuntimeExports.jsx(Text,{marginLeft:"10px",color:colors.gray[300],size:"sm",children:a.pkh}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{overflow:"hidden",width:"100%",marginLeft:"10px",whiteSpace:"nowrap",children:jsxRuntimeExports.jsx(Heading,{overflow:"hidden",textOverflow:"ellipsis",size:"sm",children:j.label})}),jsxRuntimeExports.jsx(Text,{width:"89px",marginLeft:"10px",color:colors.gray[300],size:"xs",children:formatPkh(j.pkh)})]})]}),!_&&jsxRuntimeExports.jsx(AccountBalance,{overflow:"hidden",marginLeft:"10px",textAlign:"right",address:a.pkh,numberProps:{maxWidth:"85px"}})]})})},Suggestions=({contacts:a,hideBalance:_,onChange:$})=>a.length===0?null:jsxRuntimeExports.jsx(UnorderedList,{position:"absolute",zIndex:2,overflowY:"auto",width:"100%",maxHeight:"300px",marginTop:"8px",marginLeft:0,background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"suggestions-list",listStyleType:"none",children:a.map((j,et)=>jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(ListItem,{marginBottom:et===a.length-1?"5px":0,padding:"5px 15px 0 5px",onMouseDown:()=>{$(j.name)},children:jsxRuntimeExports.jsx(AddressTile,{height:"40px",padding:"10px 8px 10px 5px",background:colors.gray[700],borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",address:parsePkh(j.pkh),hideBalance:_})})},j.pkh))}),getSuggestions=(a,_)=>_.filter($=>!a.trim()||$.name.toLowerCase().includes(a.trim().toLowerCase())),AddressAutocomplete=({contacts:a,isDisabled:_,isLoading:$=!1,allowUnknown:j,inputName:et,onUpdate:tt,validate:rt,label:nt,keepValid:it,style:st,size:ot,hideBalance:at=!1})=>{const{register:ut,setValue:ht,formState:{defaultValues:yt},getValues:wt}=useFormContext(),Ct=ht,Pt=reactExports.useId(),[$t,Mt]=reactExports.useState(()=>{var vt;if(it||!yt)return"";const bt=lodashExports.get(yt,et);return bt?((vt=a.find(ct=>ct.pkh===bt))==null?void 0:vt.name)||bt:""}),[Bt,Dt]=reactExports.useState(!0),[zt,Ot]=reactExports.useState(getSuggestions("",a)),It=wt(et),Lt=bt=>{Mt(bt),Ot(getSuggestions(bt,a));const vt=a.find(dt=>dt.name===bt||dt.pkh===bt);let ct;if(vt!==void 0)ct=vt.pkh,Dt(!0);else if(j&&isAddressValid(bt))ct=bt;else{if(it)return;ct=""}Ct(et,ct,{shouldValidate:!0}),tt&&tt(ct)};let Ft="raw_input";$?Ft="selected_tile":_?Ft="disabled_tile":It&&(Ft="selected_tile");const jt=()=>{Lt(""),Dt(!1)};return jsxRuntimeExports.jsxs(Box,{"data-testid":`address-autocomplete-${et}`,children:[jsxRuntimeExports.jsx(FormLabel,{htmlFor:Pt,children:nt}),Ft==="disabled_tile"&&jsxRuntimeExports.jsx(AddressTile,{address:parsePkh(It)}),Ft==="selected_tile"&&jsxRuntimeExports.jsx(Box,{height:"48px",background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px","data-testid":`selected-address-tile-${It}`,onClick:jt,paddingY:0,children:jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",cursor:"pointer","data-testid":"clear-selected-button",children:[jsxRuntimeExports.jsx(AddressTile,{width:ot==="short"?"338px":"365px",paddingTop:"8px",background:"transparent",address:parsePkh(It)}),it?jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginRight:"12px","data-testid":"chevron-icon"}):jsxRuntimeExports.jsx(CrossButton,{marginRight:"14px"})]})}),Ft==="raw_input"&&jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{...st,"aria-label":et,autoComplete:"off",id:Pt,onBlur:bt=>{if(bt.preventDefault(),Dt(!0),it&&It!==bt.target.value)return Lt(It);Lt(bt.target.value)},onChange:bt=>Lt(bt.target.value),onFocus:()=>Dt(!1),placeholder:"Enter address or contact name",value:$t}),jsxRuntimeExports.jsx(InputRightElement,{children:$t?jsxRuntimeExports.jsx(CrossButton,{marginRight:"0px",onClick:jt}):jsxRuntimeExports.jsx(ChevronDownIcon$1,{"data-testid":"chevron-icon"})})]}),jsxRuntimeExports.jsx(Input,{...ut(et,{required:"Invalid address or contact name",validate:rt}),marginBottom:0,"data-testid":`real-address-input-${et}`,name:et,type:"hidden"}),!Bt&&jsxRuntimeExports.jsx(Suggestions,{contacts:zt,hideBalance:at,onChange:Lt})]})},CrossButton=a=>jsxRuntimeExports.jsx(XMark,{marginRight:"16px",stroke:colors.gray[450],cursor:"pointer","data-testid":"clear-input-button",...a}),KnownAccountsAutocomplete=a=>{const _=useContactsForSelectedNetwork(),$=useAllAccounts().map(j=>({name:j.label,pkh:j.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{...a,contacts:_.concat($)})},OwnedImplicitAccountsAutocomplete=a=>{const _=useImplicitAccounts().map($=>({name:$.label,pkh:$.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{...a,contacts:_})},OwnedAccountsAutocomplete=a=>{const _=useAllAccounts().map($=>({name:$.label,pkh:$.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{...a,contacts:_})},BakersAutocomplete=a=>{const _=useBakerList().map($=>({name:$.name,pkh:$.address}));return jsxRuntimeExports.jsx(AddressAutocomplete,{...a,contacts:_,hideBalance:!0})},AvailableSignersAutocomplete=a=>{const $=useGetOwnedSignersForAccount()(a.account).map(j=>({name:j.label,pkh:j.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{allowUnknown:!1,contacts:$,isDisabled:$.length===1,...a})},getErrorContext=a=>{let _="Something went wrong";typeof a=="object"&&"message"in a?_=a.message:typeof a=="string"&&(_=a);let $="";return typeof a=="object"&&"stack"in a&&($=a.stack),{timestamp:new Date().toISOString(),description:_,stacktrace:$}},useAsyncActionHandler=()=>{const[a,_]=reactExports.useState(!1),$=reactExports.useRef(a),j=useToast(),et=useAppDispatch(),tt=reactExports.useCallback(async(nt,it)=>{if(!$.current){$.current=!0,_(!0);try{return await nt()}catch(st){const ot=getErrorContext(st);throw j({description:ot.description,status:"error",...typeof it=="function"?it(st):it}),et(errorsSlice.actions.add(ot)),st}finally{$.current=!1,_(!1)}}},[et,j]),rt=reactExports.useCallback(async(nt,it)=>tt(nt,it).catch(()=>{}),[tt]);return{isLoading:a,handleAsyncAction:rt,handleAsyncActionUnsafe:tt}},PermissionRequestModal=({request:a})=>{const _=useAddConnection(),$=useGetImplicitAccount(),{onClose:j}=reactExports.useContext(DynamicModalContext),{handleAsyncAction:et}=useAsyncActionHandler(),tt=useForm({mode:"onBlur"}),{getValues:rt,formState:{errors:nt,isValid:it}}=tt,st=()=>et(async()=>{const ot=$(rt().address),at={type:BeaconMessageType.PermissionResponse,network:a.network,scopes:a.scopes,id:a.id,publicKey:ot.pk,walletType:"implicit"};await WalletClient.respond(at),_(a.senderId,ot.address.pkh,a.network.type)}).finally(j);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{marginBottom:"24px",children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"center",children:"Permission Request"}),jsxRuntimeExports.jsxs(Text,{marginTop:"10px",color:colors.gray[400],textAlign:"center",size:"sm",children:[a.appMetadata.name," is requesting permission to sign this operation."]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"center",marginTop:"10px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Network:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:lodashExports.capitalize(a.network.type)})]})]}),jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"beacon-request-body",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"16px",padding:"15px",borderRadius:"4px",backgroundColor:colors.gray[800],children:[jsxRuntimeExports.jsx(AspectRatio,{width:"60px",marginRight:"12px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{borderRadius:"4px",src:a.appMetadata.icon})}),jsxRuntimeExports.jsx(Heading,{size:"sm",children:a.appMetadata.name})]}),jsxRuntimeExports.jsx(Accordion,{marginTop:"16px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],border:"none",borderRadius:"8px",children:[jsxRuntimeExports.jsxs(AccordionButton,{children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",marginY:"10px",size:"md",children:"Request"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(JsValueWrap,{value:a})})]})}),jsxRuntimeExports.jsx(FormProvider,{...tt,children:jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!nt.address,children:[jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!1,inputName:"address",label:"Select Account"}),nt.address&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:nt.address.message})]})})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!it,onClick:st,size:"lg",children:"Allow"})})]})},PAYLOAD_PADDING="0501",getPayloadHexBytes=a=>{let _=0;if(a.startsWith(PAYLOAD_PADDING)){for(_=4;_tt)throw new Error("Invalid payload length");_+=1}}return a.slice(_)},decodePayload$1=a=>{try{return new TextDecoder("utf-8").decode(hex2buf(getPayloadHexBytes(a)))||a}catch{return a}};function _typeof$3(a){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},_typeof$3(a)}function toPrimitive(a,_){if(_typeof$3(a)!="object"||!a)return a;var $=a[Symbol.toPrimitive];if($!==void 0){var j=$.call(a,_||"default");if(_typeof$3(j)!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(a)}function toPropertyKey(a){var _=toPrimitive(a,"string");return _typeof$3(_)=="symbol"?_:_+""}function _defineProperty$4(a,_,$){return _=toPropertyKey(_),_ in a?Object.defineProperty(a,_,{value:$,enumerable:!0,configurable:!0,writable:!0}):a[_]=$,a}var lodash_merge={exports:{}};lodash_merge.exports;(function(a,_){var $=200,j="__lodash_hash_undefined__",et=800,tt=16,rt=9007199254740991,nt="[object Arguments]",it="[object Array]",st="[object AsyncFunction]",ot="[object Boolean]",at="[object Date]",ut="[object Error]",ht="[object Function]",yt="[object GeneratorFunction]",wt="[object Map]",Ct="[object Number]",Pt="[object Null]",$t="[object Object]",Mt="[object Proxy]",Bt="[object RegExp]",Dt="[object Set]",zt="[object String]",Ot="[object Undefined]",It="[object WeakMap]",Lt="[object ArrayBuffer]",Ft="[object DataView]",jt="[object Float32Array]",bt="[object Float64Array]",vt="[object Int8Array]",ct="[object Int16Array]",dt="[object Int32Array]",mt="[object Uint8Array]",xt="[object Uint8ClampedArray]",At="[object Uint16Array]",Rt="[object Uint32Array]",St=/[\\^$.*+?()[\]{}|]/g,Tt=/^\[object .+?Constructor\]$/,Et=/^(?:0|[1-9]\d*)$/,Nt={};Nt[jt]=Nt[bt]=Nt[vt]=Nt[ct]=Nt[dt]=Nt[mt]=Nt[xt]=Nt[At]=Nt[Rt]=!0,Nt[nt]=Nt[it]=Nt[Lt]=Nt[ot]=Nt[Ft]=Nt[at]=Nt[ut]=Nt[ht]=Nt[wt]=Nt[Ct]=Nt[$t]=Nt[Bt]=Nt[Dt]=Nt[zt]=Nt[It]=!1;var tr=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ir=typeof self=="object"&&self&&self.Object===Object&&self,nr=tr||ir||Function("return this")(),Zt=_&&!_.nodeType&&_,Kt=Zt&&!0&&a&&!a.nodeType&&a,Qt=Kt&&Kt.exports===Zt,Ht=Qt&&tr.process,qt=function(){try{var Xt=Kt&&Kt.require&&Kt.require("util").types;return Xt||Ht&&Ht.binding&&Ht.binding("util")}catch{}}(),Jt=qt&&qt.isTypedArray;function ur(Xt,cr,gr){switch(gr.length){case 0:return Xt.call(cr);case 1:return Xt.call(cr,gr[0]);case 2:return Xt.call(cr,gr[0],gr[1]);case 3:return Xt.call(cr,gr[0],gr[1],gr[2])}return Xt.apply(cr,gr)}function xr(Xt,cr){for(var gr=-1,Dr=Array(Xt);++gr-1}function Gr(Xt,cr){var gr=this.__data__,Dr=Jn(gr,Xt);return Dr<0?(++this.size,gr.push([Xt,cr])):gr[Dr][1]=cr,this}hn.prototype.clear=fn,hn.prototype.delete=Kr,hn.prototype.get=Rn,hn.prototype.has=dn,hn.prototype.set=Gr;function gn(Xt){var cr=-1,gr=Xt==null?0:Xt.length;for(this.clear();++cr1?gr[rn-1]:void 0,Tn=rn>2?gr[2]:void 0;for(xn=Xt.length>3&&typeof xn=="function"?(rn--,xn):void 0,Tn&&Yl(gr[0],gr[1],Tn)&&(xn=rn<3?void 0:xn,rn=1),cr=Object(cr);++Dr-1&&Xt%1==0&&Xt0){if(++cr>=et)return arguments[0]}else cr=0;return Xt.apply(void 0,arguments)}}function $l(Xt){if(Xt!=null){try{return kr.call(Xt)}catch{}try{return Xt+""}catch{}}return""}function Xs(Xt,cr){return Xt===cr||Xt!==Xt&&cr!==cr}var Ao=es(function(){return arguments}())?es:function(Xt){return Is(Xt)&&Ar.call(Xt,"callee")&&!ar.call(Xt,"callee")},Bs=Array.isArray;function uo(Xt){return Xt!=null&&To(Xt.length)&&!$o(Xt)}function Tl(Xt){return Is(Xt)&&uo(Xt)}var fo=Wr||wr;function $o(Xt){if(!Ps(Xt))return!1;var cr=Qn(Xt);return cr==ht||cr==yt||cr==st||cr==Mt}function To(Xt){return typeof Xt=="number"&&Xt>-1&&Xt%1==0&&Xt<=rt}function Ps(Xt){var cr=typeof Xt;return Xt!=null&&(cr=="object"||cr=="function")}function Is(Xt){return Xt!=null&&typeof Xt=="object"}function Pl(Xt){if(!Is(Xt)||Qn(Xt)!=$t)return!1;var cr=Vt(Xt);if(cr===null)return!0;var gr=Ar.call(cr,"constructor")&&cr.constructor;return typeof gr=="function"&&gr instanceof gr&&kr.call(gr)==Br}var No=Jt?pr(Jt):us;function Po(Xt){return wo(Xt,Lo(Xt))}function Lo(Xt){return uo(Xt)?ps(Xt):Wn(Xt)}var Xl=Go(function(Xt,cr,gr){as(Xt,cr,gr)});function rs(Xt){return function(){return Xt}}function Xn(Xt){return Xt}function wr(){return!1}a.exports=Xl})(lodash_merge,lodash_merge.exports);var lodash_mergeExports=lodash_merge.exports;const deepmerge$1=getDefaultExportFromCjs$1(lodash_mergeExports);var loglevel={exports:{}};(function(a){(function(_,$){a.exports?a.exports=$():_.log=$()})(commonjsGlobal,function(){var _=function(){},$="undefined",j=typeof window!==$&&typeof window.navigator!==$&&/Trident\/|MSIE /.test(window.navigator.userAgent),et=["trace","debug","info","warn","error"];function tt(wt,Ct){var Pt=wt[Ct];if(typeof Pt.bind=="function")return Pt.bind(wt);try{return Function.prototype.bind.call(Pt,wt)}catch{return function(){return Function.prototype.apply.apply(Pt,[wt,arguments])}}}function rt(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function nt(wt){return wt==="debug"&&(wt="log"),typeof console===$?!1:wt==="trace"&&j?rt:console[wt]!==void 0?tt(console,wt):console.log!==void 0?tt(console,"log"):_}function it(wt,Ct){for(var Pt=0;Pt=0&&Lt<=$t.levels.SILENT){if(Mt=Lt,Ft!==!1&&Dt(Lt),it.call($t,Lt,wt),typeof console===$&&Lt<$t.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+Lt},$t.setDefaultLevel=function(Lt){Ct=Lt,zt()||$t.setLevel(Lt,!1)},$t.resetLevel=function(){$t.setLevel(Ct,!1),Ot()},$t.enableAll=function(Lt){$t.setLevel($t.levels.TRACE,Lt)},$t.disableAll=function(Lt){$t.setLevel($t.levels.SILENT,Lt)};var It=zt();It==null&&(It=Ct),$t.setLevel(It,!1)}var ut=new at,ht={};ut.getLogger=function(Ct){if(typeof Ct!="symbol"&&typeof Ct!="string"||Ct==="")throw new TypeError("You must supply a name when creating a logger.");var Pt=ht[Ct];return Pt||(Pt=ht[Ct]=new at(Ct,ut.getLevel(),ut.methodFactory)),Pt};var yt=typeof window!==$?window.log:void 0;return ut.noConflict=function(){return typeof window!==$&&window.log===ut&&(window.log=yt),ut},ut.getLoggers=function(){return ht},ut.default=ut,ut})})(loglevel);var loglevelExports=loglevel.exports;const log$1$1=getDefaultExportFromCjs$1(loglevelExports);function ownKeys$5(a,_){var $=Object.keys(a);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(a);_&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(a,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$5(a){for(var _=1;_{const $=new Promise((j,et)=>{const tt=setTimeout(()=>{clearTimeout(tt),et(new Error(`Timed out in ${a}ms`))},a)});return Promise.race([_,$])},get=async function(a){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const j={mode:"cors",headers:{}};$.useAPIKey&&(j.headers=_objectSpread$5(_objectSpread$5({},j.headers),getApiKeyHeaders()));const et=deepmerge$1(j,_,{method:"GET"}),tt=await fetchAndTrace(a,et);if(tt.ok)return tt.json();throw debugLogResponse(tt),tt},post=function(a){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const et={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};j.useAPIKey&&(et.headers=_objectSpread$5(_objectSpread$5({},et.headers),getApiKeyHeaders()));const tt=deepmerge$1(et,$,{method:"POST"});return j.isUrlEncodedData?(tt.body=_,tt.headers["Content-Type"]==="application/json; charset=utf-8"&&delete tt.headers["Content-Type"]):tt.body=JSON.stringify(_),promiseTimeout(j.timeout||6e4,fetchAndTrace(a,tt).then(rt=>{if(j.logTracingHeader&&logTracingHeader(rt),rt.ok)return rt.json();throw debugLogResponse(rt),rt}))},generateJsonRPCObject=(a,_)=>({jsonrpc:"2.0",method:a,id:10,params:_});function _objectWithoutPropertiesLoose(a,_){if(a==null)return{};var $={};for(var j in a)if(Object.prototype.hasOwnProperty.call(a,j)){if(_.indexOf(j)>=0)continue;$[j]=a[j]}return $}function _objectWithoutProperties(a,_){if(a==null)return{};var $=_objectWithoutPropertiesLoose(a,_),j,et;if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(a);for(et=0;et=0)&&Object.prototype.propertyIsEnumerable.call(a,j)&&($[j]=a[j])}return $}const BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Utils{static getFirstMatch(_,$){const j=$.match(_);return j&&j.length>0&&j[1]||""}static getSecondMatch(_,$){const j=$.match(_);return j&&j.length>1&&j[2]||""}static matchAndReturnConst(_,$,j){if(_.test($))return j}static getWindowsVersionName(_){switch(_){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(_){const $=_.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),$[0]===10)switch($[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(_){const $=_.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),!($[0]===1&&$[1]<5)){if($[0]===1&&$[1]<6)return"Cupcake";if($[0]===1&&$[1]>=6)return"Donut";if($[0]===2&&$[1]<2)return"Eclair";if($[0]===2&&$[1]===2)return"Froyo";if($[0]===2&&$[1]>2)return"Gingerbread";if($[0]===3)return"Honeycomb";if($[0]===4&&$[1]<1)return"Ice Cream Sandwich";if($[0]===4&&$[1]<4)return"Jelly Bean";if($[0]===4&&$[1]>=4)return"KitKat";if($[0]===5)return"Lollipop";if($[0]===6)return"Marshmallow";if($[0]===7)return"Nougat";if($[0]===8)return"Oreo";if($[0]===9)return"Pie"}}static getVersionPrecision(_){return _.split(".").length}static compareVersions(_,$,j=!1){const et=Utils.getVersionPrecision(_),tt=Utils.getVersionPrecision($);let rt=Math.max(et,tt),nt=0;const it=Utils.map([_,$],st=>{const ot=rt-Utils.getVersionPrecision(st),at=st+new Array(ot+1).join(".0");return Utils.map(at.split("."),ut=>new Array(20-ut.length).join("0")+ut).reverse()});for(j&&(nt=rt-Math.min(et,tt)),rt-=1;rt>=nt;){if(it[0][rt]>it[1][rt])return 1;if(it[0][rt]===it[1][rt]){if(rt===nt)return 0;rt-=1}else if(it[0][rt]{j[it]=rt[it]})}return _}static getBrowserAlias(_){return BROWSER_ALIASES_MAP[_]}static getBrowserTypeByAlias(_){return BROWSER_MAP[_]||""}}const commonVersionIdentifier=/version\/(\d+(\.?_?\d+)+)/i,browsersList=[{test:[/googlebot/i],describe(a){const _={name:"Googlebot"},$=Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/opera/i],describe(a){const _={name:"Opera"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/opr\/|opios/i],describe(a){const _={name:"Opera"},$=Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/SamsungBrowser/i],describe(a){const _={name:"Samsung Internet for Android"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/Whale/i],describe(a){const _={name:"NAVER Whale Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/MZBrowser/i],describe(a){const _={name:"MZ Browser"},$=Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/focus/i],describe(a){const _={name:"Focus"},$=Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/swing/i],describe(a){const _={name:"Swing"},$=Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/coast/i],describe(a){const _={name:"Opera Coast"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(a){const _={name:"Opera Touch"},$=Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/yabrowser/i],describe(a){const _={name:"Yandex Browser"},$=Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/ucbrowser/i],describe(a){const _={name:"UC Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/Maxthon|mxios/i],describe(a){const _={name:"Maxthon"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/epiphany/i],describe(a){const _={name:"Epiphany"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/puffin/i],describe(a){const _={name:"Puffin"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/sleipnir/i],describe(a){const _={name:"Sleipnir"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/k-meleon/i],describe(a){const _={name:"K-Meleon"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/micromessenger/i],describe(a){const _={name:"WeChat"},$=Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/qqbrowser/i],describe(a){const _={name:/qqbrowserlite/i.test(a)?"QQ Browser Lite":"QQ Browser"},$=Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/msie|trident/i],describe(a){const _={name:"Internet Explorer"},$=Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/\sedg\//i],describe(a){const _={name:"Microsoft Edge"},$=Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/edg([ea]|ios)/i],describe(a){const _={name:"Microsoft Edge"},$=Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/vivaldi/i],describe(a){const _={name:"Vivaldi"},$=Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/seamonkey/i],describe(a){const _={name:"SeaMonkey"},$=Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/sailfish/i],describe(a){const _={name:"Sailfish"},$=Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,a);return $&&(_.version=$),_}},{test:[/silk/i],describe(a){const _={name:"Amazon Silk"},$=Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/phantom/i],describe(a){const _={name:"PhantomJS"},$=Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/slimerjs/i],describe(a){const _={name:"SlimerJS"},$=Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(a){const _={name:"BlackBerry"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/(web|hpw)[o0]s/i],describe(a){const _={name:"WebOS Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/bada/i],describe(a){const _={name:"Bada"},$=Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/tizen/i],describe(a){const _={name:"Tizen"},$=Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/qupzilla/i],describe(a){const _={name:"QupZilla"},$=Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/firefox|iceweasel|fxios/i],describe(a){const _={name:"Firefox"},$=Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/electron/i],describe(a){const _={name:"Electron"},$=Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/MiuiBrowser/i],describe(a){const _={name:"Miui"},$=Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/chromium/i],describe(a){const _={name:"Chromium"},$=Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/chrome|crios|crmo/i],describe(a){const _={name:"Chrome"},$=Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/GSA/i],describe(a){const _={name:"Google Search"},$=Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test(a){const _=!a.test(/like android/i),$=a.test(/android/i);return _&&$},describe(a){const _={name:"Android Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/playstation 4/i],describe(a){const _={name:"PlayStation 4"},$=Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/safari|applewebkit/i],describe(a){const _={name:"Safari"},$=Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/.*/i],describe(a){const _=/^(.*)\/(.*) /,$=/^(.*)\/(.*)[ \t]\((.*)/,et=a.search("\\(")!==-1?$:_;return{name:Utils.getFirstMatch(et,a),version:Utils.getSecondMatch(et,a)}}}],osParsersList=[{test:[/Roku\/DVP/],describe(a){const _=Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,a);return{name:OS_MAP.Roku,version:_}}},{test:[/windows phone/i],describe(a){const _=Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,a);return{name:OS_MAP.WindowsPhone,version:_}}},{test:[/windows /i],describe(a){const _=Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,a),$=Utils.getWindowsVersionName(_);return{name:OS_MAP.Windows,version:_,versionName:$}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(a){const _={name:OS_MAP.iOS},$=Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/,a);return $&&(_.version=$),_}},{test:[/macintosh/i],describe(a){const _=Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,a).replace(/[_\s]/g,"."),$=Utils.getMacOSVersionName(_),j={name:OS_MAP.MacOS,version:_};return $&&(j.versionName=$),j}},{test:[/(ipod|iphone|ipad)/i],describe(a){const _=Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,a).replace(/[_\s]/g,".");return{name:OS_MAP.iOS,version:_}}},{test(a){const _=!a.test(/like android/i),$=a.test(/android/i);return _&&$},describe(a){const _=Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,a),$=Utils.getAndroidVersionName(_),j={name:OS_MAP.Android,version:_};return $&&(j.versionName=$),j}},{test:[/(web|hpw)[o0]s/i],describe(a){const _=Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,a),$={name:OS_MAP.WebOS};return _&&_.length&&($.version=_),$}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(a){const _=Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,a)||Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,a)||Utils.getFirstMatch(/\bbb(\d+)/i,a);return{name:OS_MAP.BlackBerry,version:_}}},{test:[/bada/i],describe(a){const _=Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,a);return{name:OS_MAP.Bada,version:_}}},{test:[/tizen/i],describe(a){const _=Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,a);return{name:OS_MAP.Tizen,version:_}}},{test:[/linux/i],describe(){return{name:OS_MAP.Linux}}},{test:[/CrOS/],describe(){return{name:OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe(a){const _=Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,a);return{name:OS_MAP.PlayStation4,version:_}}}],platformParsersList=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(a){const _=Utils.getFirstMatch(/(can-l01)/i,a)&&"Nova",$={type:PLATFORMS_MAP.mobile,vendor:"Huawei"};return _&&($.model=_),$}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:PLATFORMS_MAP.tablet}}},{test(a){const _=a.test(/ipod|iphone/i),$=a.test(/like (ipod|iphone)/i);return _&&!$},describe(a){const _=Utils.getFirstMatch(/(ipod|iphone)/i,a);return{type:PLATFORMS_MAP.mobile,vendor:"Apple",model:_}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:PLATFORMS_MAP.mobile}}},{test(a){return a.getBrowserName(!0)==="blackberry"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test(a){return a.getBrowserName(!0)==="bada"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(a){return a.getBrowserName()==="windows phone"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test(a){const _=Number(String(a.getOSVersion()).split(".")[0]);return a.getOSName(!0)==="android"&&_>=3},describe(){return{type:PLATFORMS_MAP.tablet}}},{test(a){return a.getOSName(!0)==="android"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(a){return a.getOSName(!0)==="macos"},describe(){return{type:PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test(a){return a.getOSName(!0)==="windows"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(a){return a.getOSName(!0)==="linux"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(a){return a.getOSName(!0)==="playstation 4"},describe(){return{type:PLATFORMS_MAP.tv}}},{test(a){return a.getOSName(!0)==="roku"},describe(){return{type:PLATFORMS_MAP.tv}}}],enginesParsersList=[{test(a){return a.getBrowserName(!0)==="microsoft edge"},describe(a){if(/\sedg\//i.test(a))return{name:ENGINE_MAP.Blink};const $=Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,a);return{name:ENGINE_MAP.EdgeHTML,version:$}}},{test:[/trident/i],describe(a){const _={name:ENGINE_MAP.Trident},$=Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test(a){return a.test(/presto/i)},describe(a){const _={name:ENGINE_MAP.Presto},$=Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test(a){const _=a.test(/gecko/i),$=a.test(/like gecko/i);return _&&!$},describe(a){const _={name:ENGINE_MAP.Gecko},$=Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe(a){const _={name:ENGINE_MAP.WebKit},$=Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}}];class Parser{constructor(_,$=!1){if(_==null||_==="")throw new Error("UserAgent parameter can't be empty");this._ua=_,this.parsedResult={},$!==!0&&this.parse()}getUA(){return this._ua}test(_){return _.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const _=Utils.find(browsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.browser=_.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(_){return _?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const _=Utils.find(osParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.os=_.describe(this.getUA())),this.parsedResult.os}getOSName(_){const{name:$}=this.getOS();return _?String($).toLowerCase()||"":$||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(_=!1){const{type:$}=this.getPlatform();return _?String($).toLowerCase()||"":$||""}parsePlatform(){this.parsedResult.platform={};const _=Utils.find(platformParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.platform=_.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(_){return _?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const _=Utils.find(enginesParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.engine=_.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Utils.assign({},this.parsedResult)}satisfies(_){const $={};let j=0;const et={};let tt=0;if(Object.keys(_).forEach(nt=>{const it=_[nt];typeof it=="string"?(et[nt]=it,tt+=1):typeof it=="object"&&($[nt]=it,j+=1)}),j>0){const nt=Object.keys($),it=Utils.find(nt,ot=>this.isOS(ot));if(it){const ot=this.satisfies($[it]);if(ot!==void 0)return ot}const st=Utils.find(nt,ot=>this.isPlatform(ot));if(st){const ot=this.satisfies($[st]);if(ot!==void 0)return ot}}if(tt>0){const nt=Object.keys(et),it=Utils.find(nt,st=>this.isBrowser(st,!0));if(it!==void 0)return this.compareVersion(et[it])}}isBrowser(_,$=!1){const j=this.getBrowserName().toLowerCase();let et=_.toLowerCase();const tt=Utils.getBrowserTypeByAlias(et);return $&&tt&&(et=tt.toLowerCase()),et===j}compareVersion(_){let $=[0],j=_,et=!1;const tt=this.getBrowserVersion();if(typeof tt=="string")return _[0]===">"||_[0]==="<"?(j=_.substr(1),_[1]==="="?(et=!0,j=_.substr(2)):$=[],_[0]===">"?$.push(1):$.push(-1)):_[0]==="="?j=_.substr(1):_[0]==="~"&&(et=!0,j=_.substr(1)),$.indexOf(Utils.compareVersions(tt,j,et))>-1}isOS(_){return this.getOSName(!0)===String(_).toLowerCase()}isPlatform(_){return this.getPlatformType(!0)===String(_).toLowerCase()}isEngine(_){return this.getEngineName(!0)===String(_).toLowerCase()}is(_,$=!1){return this.isBrowser(_,$)||this.isOS(_)||this.isPlatform(_)}some(_=[]){return _.some($=>this.is($))}}/*! + */var isBuffer_1=function(a){return a!=null&&(isBuffer(a)||isSlowBuffer(a)||!!a._isBuffer)};function isBuffer(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function isSlowBuffer(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&isBuffer(a.slice(0,0))}(function(){var a=cryptExports,_=charenc_1.utf8,$=isBuffer_1,j=charenc_1.bin,et=function(tt,rt){tt.constructor==String?rt&&rt.encoding==="binary"?tt=j.stringToBytes(tt):tt=_.stringToBytes(tt):$(tt)?tt=Array.prototype.slice.call(tt,0):!Array.isArray(tt)&&tt.constructor!==Uint8Array&&(tt=tt.toString());for(var nt=a.bytesToWords(tt),it=tt.length*8,st=1732584193,ot=-271733879,at=-1732584194,ut=271733878,ht=0;ht>>24)&16711935|(nt[ht]<<24|nt[ht]>>>8)&4278255360;nt[it>>>5]|=128<>>9<<4)+14]=it;for(var yt=et._ff,wt=et._gg,Ct=et._hh,Pt=et._ii,ht=0;ht>>0,ot=ot+Mt>>>0,at=at+Bt>>>0,ut=ut+Dt>>>0}return a.endian([st,ot,at,ut])};et._ff=function(tt,rt,nt,it,st,ot,at){var ut=tt+(rt&nt|~rt&it)+(st>>>0)+at;return(ut<>>32-ot)+rt},et._gg=function(tt,rt,nt,it,st,ot,at){var ut=tt+(rt&it|nt&~it)+(st>>>0)+at;return(ut<>>32-ot)+rt},et._hh=function(tt,rt,nt,it,st,ot,at){var ut=tt+(rt^nt^it)+(st>>>0)+at;return(ut<>>32-ot)+rt},et._ii=function(tt,rt,nt,it,st,ot,at){var ut=tt+(nt^(rt|~it))+(st>>>0)+at;return(ut<>>32-ot)+rt},et._blocksize=16,et._digestsize=16,md5$1.exports=function(tt,rt){if(tt==null)throw new Error("Illegal argument "+tt);var nt=a.wordsToBytes(et(tt,rt));return rt&&rt.asBytes?nt:rt&&rt.asString?j.bytesToString(nt):a.bytesToHex(nt)}})();var md5Exports=md5$1.exports;const md5=getDefaultExportFromCjs$1(md5Exports),ReactIdenticon=React$2.memo(({count:a=5,background:_,string:$,size:j})=>{const et=reactExports.useRef(null);reactExports.useEffect(()=>{tt()});const tt=()=>{const rt=md5($),nt=Math.floor(j/a),it=rt.slice(0,6),st=et.current;st.width=nt*a,st.height=nt*a;const ot=rt.split("").map(ht=>parseInt(ht,16)).map(ht=>ht<8?0:1),at=[];at[0]=at[4]=ot.slice(0,5),at[1]=at[3]=ot.slice(5,10),at[2]=ot.slice(10,15);const ut=st.getContext("2d");ut.imageSmoothingEnabled=!1,ut.clearRect(0,0,st.width,st.height),at.forEach((ht,yt)=>{ht.forEach((wt,Ct)=>{wt?(ut.fillStyle="#"+it,ut.fillRect(nt*yt,nt*Ct,nt,nt)):(ut.fillStyle=_,ut.fillRect(nt*yt,nt*Ct,nt,nt))})})};return jsxRuntimeExports.jsx("canvas",{ref:et,style:{width:j,height:j}})}),color=a=>`#${md5(a).slice(0,6)}`,Identicon=({address:a,identiconSize:_,...$})=>jsxRuntimeExports.jsx(Box,{sx:{canvas:{borderRadius:"4px"}},zIndex:10,background:"white",borderRadius:"4px","data-testid":"identicon",...$,children:jsxRuntimeExports.jsx(ReactIdenticon,{background:"white",size:_,string:a,style:{borderRadius:4}})}),baseIconProps={stroke:colors.gray[400],borderRadius:"4px",padding:"5px",background:colors.gray[500]},AddressTileIcon=({addressKind:a,size:_="sm",identiconSize:$=20})=>{let j;switch(_){case"sm":j="30px";break;case"md":j="38.5px";break;case"lg":j="45.5px";break}switch(a.type){case"secret_key":case"mnemonic":return jsxRuntimeExports.jsx(Identicon,{width:j,height:j,padding:"5px",address:a.pkh,identiconSize:$});case"social":return jsxRuntimeExports.jsx(SocialIcon,{width:j,height:j,...baseIconProps,stroke:"transparent",background:"white"});case"ledger":return jsxRuntimeExports.jsx(LedgerIcon,{width:j,height:j,...baseIconProps});case"multisig":return jsxRuntimeExports.jsx(KeyIcon,{width:j,height:j,...baseIconProps});case"contact":return jsxRuntimeExports.jsx(ContactIcon,{width:j,height:j,...baseIconProps});case"unknown":return jsxRuntimeExports.jsx(UnknownContactIcon,{width:j,height:j,...baseIconProps});case"baker":{const et=`https://services.tzkt.io/v1/avatars/${a.pkh}`;return jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",marginRight:"8px","data-testid":"baker-icon",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{src:et})})}}},useAddressKind$1=a=>{const _=useOwnedAccountAddressKind$1(a),$=useBakerAddressKind(a),j=useContactAddressKind(a);return _||$||j||{pkh:a.pkh,type:"unknown",label:null}},useOwnedAccountAddressKind$1=({pkh:a})=>{const $=useGetOwnedAccountSafe()(a);return $?{type:$.type,pkh:a,label:$.label}:null},useBakerAddressKind=({pkh:a})=>{const $=useGetBaker()(a);return $?{pkh:a,type:"baker",label:$.name}:null},useContactAddressKind=({pkh:a})=>{const $=useGetContactName()(a);return $?{pkh:a,type:"contact",label:$}:null},splitNumber=a=>{const[_,$]=a.split(".");return{integer:_,decimal:$}},PrettyNumber=({number:a,size:_="md",...$})=>{const j=_==="md"?"md":"lg",et=_==="md"?"sm":"md",{integer:tt,decimal:rt}=splitNumber(a);return jsxRuntimeExports.jsxs(Flex,{alignItems:"end","data-testid":"pretty-number",...$,children:[jsxRuntimeExports.jsx(Heading,{size:j,children:tt}),rt&&jsxRuntimeExports.jsxs(Heading,{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",size:et,children:[".",rt]})]})},AccountBalance=({address:a,size:_,numberProps:$,...j})=>{const tt=useGetAccountBalance()(a);if(!tt)return null;const rt=prettyTezAmount(tt);return jsxRuntimeExports.jsx(Box,{overflow:"hidden",textAlign:"right","data-testid":"account-balance",...j,children:jsxRuntimeExports.jsx(PrettyNumber,{number:rt,size:_,...$})})},AddressTile=({address:a,hideBalance:_=!1,...$})=>{const j=useAddressKind$1(a);return jsxRuntimeExports.jsx(Tooltip,{background:colors.white,hasArrow:!0,label:j.label,placement:"left",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",width:"100%",padding:"9px 10px",background:colors.gray[800],borderRadius:"4px","data-testid":"address-tile",...$,children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",width:_?"100%":"calc(100% - 95px)",children:[jsxRuntimeExports.jsx(AddressTileIcon,{addressKind:j}),j.type==="unknown"?jsxRuntimeExports.jsx(Text,{marginLeft:"10px",color:colors.gray[300],size:"sm",children:a.pkh}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{overflow:"hidden",width:"100%",marginLeft:"10px",whiteSpace:"nowrap",children:jsxRuntimeExports.jsx(Heading,{overflow:"hidden",textOverflow:"ellipsis",size:"sm",children:j.label})}),jsxRuntimeExports.jsx(Text,{width:"89px",marginLeft:"10px",color:colors.gray[300],size:"xs",children:formatPkh(j.pkh)})]})]}),!_&&jsxRuntimeExports.jsx(AccountBalance,{overflow:"hidden",marginLeft:"10px",textAlign:"right",address:a.pkh,numberProps:{maxWidth:"85px"}})]})})},Suggestions=({contacts:a,hideBalance:_,onChange:$})=>a.length===0?null:jsxRuntimeExports.jsx(UnorderedList,{position:"absolute",zIndex:2,overflowY:"auto",width:"100%",maxHeight:"300px",marginTop:"8px",marginLeft:0,background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"suggestions-list",listStyleType:"none",children:a.map((j,et)=>jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(ListItem,{marginBottom:et===a.length-1?"5px":0,padding:"5px 15px 0 5px",onMouseDown:()=>{$(j.name)},children:jsxRuntimeExports.jsx(AddressTile,{height:"40px",padding:"10px 8px 10px 5px",background:colors.gray[700],borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",address:parsePkh(j.pkh),hideBalance:_})})},j.pkh))}),getSuggestions=(a,_)=>_.filter($=>!a.trim()||$.name.toLowerCase().includes(a.trim().toLowerCase())),AddressAutocomplete=({contacts:a,isDisabled:_,isLoading:$=!1,allowUnknown:j,inputName:et,onUpdate:tt,validate:rt,label:nt,keepValid:it,style:st,size:ot,hideBalance:at=!1})=>{const{register:ut,setValue:ht,formState:{defaultValues:yt},getValues:wt}=useFormContext(),Ct=ht,Pt=reactExports.useId(),[$t,Mt]=reactExports.useState(()=>{var vt;if(it||!yt)return"";const bt=lodashExports.get(yt,et);return bt?((vt=a.find(ct=>ct.pkh===bt))==null?void 0:vt.name)||bt:""}),[Bt,Dt]=reactExports.useState(!0),[zt,Ot]=reactExports.useState(getSuggestions("",a)),It=wt(et),Lt=bt=>{Mt(bt),Ot(getSuggestions(bt,a));const vt=a.find(dt=>dt.name===bt||dt.pkh===bt);let ct;if(vt!==void 0)ct=vt.pkh,Dt(!0);else if(j&&isAddressValid(bt))ct=bt;else{if(it)return;ct=""}Ct(et,ct,{shouldValidate:!0}),tt&&tt(ct)};let Ft="raw_input";$?Ft="selected_tile":_?Ft="disabled_tile":It&&(Ft="selected_tile");const jt=()=>{Lt(""),Dt(!1)};return jsxRuntimeExports.jsxs(Box,{"data-testid":`address-autocomplete-${et}`,children:[jsxRuntimeExports.jsx(FormLabel,{htmlFor:Pt,children:nt}),Ft==="disabled_tile"&&jsxRuntimeExports.jsx(AddressTile,{address:parsePkh(It)}),Ft==="selected_tile"&&jsxRuntimeExports.jsx(Box,{height:"48px",background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px","data-testid":`selected-address-tile-${It}`,onClick:jt,paddingY:0,children:jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",cursor:"pointer","data-testid":"clear-selected-button",children:[jsxRuntimeExports.jsx(AddressTile,{width:ot==="short"?"338px":"365px",paddingTop:"8px",background:"transparent",address:parsePkh(It)}),it?jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginRight:"12px","data-testid":"chevron-icon"}):jsxRuntimeExports.jsx(CrossButton,{marginRight:"14px"})]})}),Ft==="raw_input"&&jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{...st,"aria-label":et,autoComplete:"off",id:Pt,onBlur:bt=>{if(bt.preventDefault(),Dt(!0),it&&It!==bt.target.value)return Lt(It);Lt(bt.target.value)},onChange:bt=>Lt(bt.target.value),onFocus:()=>Dt(!1),placeholder:"Enter address or contact name",value:$t}),jsxRuntimeExports.jsx(InputRightElement,{children:$t?jsxRuntimeExports.jsx(CrossButton,{marginRight:"0px",onClick:jt}):jsxRuntimeExports.jsx(ChevronDownIcon$1,{"data-testid":"chevron-icon"})})]}),jsxRuntimeExports.jsx(Input,{...ut(et,{required:"Invalid address or contact name",validate:rt}),marginBottom:0,"data-testid":`real-address-input-${et}`,name:et,type:"hidden"}),!Bt&&jsxRuntimeExports.jsx(Suggestions,{contacts:zt,hideBalance:at,onChange:Lt})]})},CrossButton=a=>jsxRuntimeExports.jsx(XMark,{marginRight:"16px",stroke:colors.gray[450],cursor:"pointer","data-testid":"clear-input-button",...a}),KnownAccountsAutocomplete=a=>{const _=useContactsForSelectedNetwork(),$=useAllAccounts().map(j=>({name:j.label,pkh:j.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{...a,contacts:_.concat($)})},OwnedImplicitAccountsAutocomplete=a=>{const _=useImplicitAccounts().map($=>({name:$.label,pkh:$.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{...a,contacts:_})},OwnedAccountsAutocomplete=a=>{const _=useAllAccounts().map($=>({name:$.label,pkh:$.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{...a,contacts:_})},BakersAutocomplete=a=>{const _=useBakerList().map($=>({name:$.name,pkh:$.address}));return jsxRuntimeExports.jsx(AddressAutocomplete,{...a,contacts:_,hideBalance:!0})},AvailableSignersAutocomplete=a=>{const $=useGetOwnedSignersForAccount()(a.account).map(j=>({name:j.label,pkh:j.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{allowUnknown:!1,contacts:$,isDisabled:$.length===1,...a})},getErrorContext=a=>{let _="Something went wrong";typeof a=="object"&&"message"in a?_=a.message:typeof a=="string"&&(_=a);let $="";return typeof a=="object"&&"stack"in a&&($=a.stack),{timestamp:new Date().toISOString(),description:_,stacktrace:$}},useAsyncActionHandler=()=>{const[a,_]=reactExports.useState(!1),$=reactExports.useRef(a),j=useToast(),et=useAppDispatch(),tt=reactExports.useCallback(async(nt,it)=>{if(!$.current){$.current=!0,_(!0);try{return await nt()}catch(st){const ot=getErrorContext(st);throw j({description:ot.description,status:"error",...typeof it=="function"?it(st):it}),et(errorsSlice.actions.add(ot)),st}finally{$.current=!1,_(!1)}}},[et,j]),rt=reactExports.useCallback(async(nt,it)=>tt(nt,it).catch(()=>{}),[tt]);return{isLoading:a,handleAsyncAction:rt,handleAsyncActionUnsafe:tt}},PermissionRequestModal=({request:a})=>{const _=useAddConnection(),$=useGetImplicitAccount(),{onClose:j}=reactExports.useContext(DynamicModalContext),{handleAsyncAction:et}=useAsyncActionHandler(),tt=useForm({mode:"onBlur"}),{getValues:rt,formState:{errors:nt,isValid:it}}=tt,st=()=>et(async()=>{const ot=$(rt().address),at={type:BeaconMessageType.PermissionResponse,network:a.network,scopes:a.scopes,id:a.id,publicKey:ot.pk,walletType:"implicit"};await WalletClient.respond(at),_(a.senderId,ot.address.pkh,a.network.type)}).finally(j);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{marginBottom:"24px",children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"center",children:"Permission Request"}),jsxRuntimeExports.jsxs(Text,{marginTop:"10px",color:colors.gray[400],textAlign:"center",size:"sm",children:[a.appMetadata.name," is requesting permission to sign this operation."]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"center",marginTop:"10px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Network:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:lodashExports.capitalize(a.network.type)})]})]}),jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"beacon-request-body",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"16px",padding:"15px",borderRadius:"4px",backgroundColor:colors.gray[800],children:[jsxRuntimeExports.jsx(AspectRatio,{width:"60px",marginRight:"12px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{borderRadius:"4px",src:a.appMetadata.icon})}),jsxRuntimeExports.jsx(Heading,{size:"sm",children:a.appMetadata.name})]}),jsxRuntimeExports.jsx(Accordion,{marginTop:"16px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],border:"none",borderRadius:"8px",children:[jsxRuntimeExports.jsxs(AccordionButton,{children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",marginY:"10px",size:"md",children:"Request"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(JsValueWrap,{value:a})})]})}),jsxRuntimeExports.jsx(FormProvider,{...tt,children:jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!nt.address,children:[jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!1,inputName:"address",label:"Select Account"}),nt.address&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:nt.address.message})]})})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!it,onClick:st,size:"lg",children:"Allow"})})]})},PAYLOAD_PADDING="0501",getPayloadHexBytes=a=>{let _=0;if(a.startsWith(PAYLOAD_PADDING)){for(_=4;_tt)throw new Error("Invalid payload length");_+=1}}return a.slice(_)},decodePayload$1=a=>{try{return new TextDecoder("utf-8").decode(hex2buf(getPayloadHexBytes(a)))||a}catch{return a}};function _typeof$3(a){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},_typeof$3(a)}function toPrimitive(a,_){if(_typeof$3(a)!="object"||!a)return a;var $=a[Symbol.toPrimitive];if($!==void 0){var j=$.call(a,_||"default");if(_typeof$3(j)!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(a)}function toPropertyKey(a){var _=toPrimitive(a,"string");return _typeof$3(_)=="symbol"?_:_+""}function _defineProperty$4(a,_,$){return _=toPropertyKey(_),_ in a?Object.defineProperty(a,_,{value:$,enumerable:!0,configurable:!0,writable:!0}):a[_]=$,a}var lodash_merge={exports:{}};lodash_merge.exports;(function(a,_){var $=200,j="__lodash_hash_undefined__",et=800,tt=16,rt=9007199254740991,nt="[object Arguments]",it="[object Array]",st="[object AsyncFunction]",ot="[object Boolean]",at="[object Date]",ut="[object Error]",ht="[object Function]",yt="[object GeneratorFunction]",wt="[object Map]",Ct="[object Number]",Pt="[object Null]",$t="[object Object]",Mt="[object Proxy]",Bt="[object RegExp]",Dt="[object Set]",zt="[object String]",Ot="[object Undefined]",It="[object WeakMap]",Lt="[object ArrayBuffer]",Ft="[object DataView]",jt="[object Float32Array]",bt="[object Float64Array]",vt="[object Int8Array]",ct="[object Int16Array]",dt="[object Int32Array]",mt="[object Uint8Array]",xt="[object Uint8ClampedArray]",At="[object Uint16Array]",Rt="[object Uint32Array]",St=/[\\^$.*+?()[\]{}|]/g,Tt=/^\[object .+?Constructor\]$/,Et=/^(?:0|[1-9]\d*)$/,Nt={};Nt[jt]=Nt[bt]=Nt[vt]=Nt[ct]=Nt[dt]=Nt[mt]=Nt[xt]=Nt[At]=Nt[Rt]=!0,Nt[nt]=Nt[it]=Nt[Lt]=Nt[ot]=Nt[Ft]=Nt[at]=Nt[ut]=Nt[ht]=Nt[wt]=Nt[Ct]=Nt[$t]=Nt[Bt]=Nt[Dt]=Nt[zt]=Nt[It]=!1;var tr=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ir=typeof self=="object"&&self&&self.Object===Object&&self,nr=tr||ir||Function("return this")(),Zt=_&&!_.nodeType&&_,Kt=Zt&&!0&&a&&!a.nodeType&&a,Qt=Kt&&Kt.exports===Zt,Ht=Qt&&tr.process,qt=function(){try{var Xt=Kt&&Kt.require&&Kt.require("util").types;return Xt||Ht&&Ht.binding&&Ht.binding("util")}catch{}}(),Jt=qt&&qt.isTypedArray;function ur(Xt,cr,gr){switch(gr.length){case 0:return Xt.call(cr);case 1:return Xt.call(cr,gr[0]);case 2:return Xt.call(cr,gr[0],gr[1]);case 3:return Xt.call(cr,gr[0],gr[1],gr[2])}return Xt.apply(cr,gr)}function xr(Xt,cr){for(var gr=-1,Dr=Array(Xt);++gr-1}function Gr(Xt,cr){var gr=this.__data__,Dr=Jn(gr,Xt);return Dr<0?(++this.size,gr.push([Xt,cr])):gr[Dr][1]=cr,this}hn.prototype.clear=fn,hn.prototype.delete=Kr,hn.prototype.get=Rn,hn.prototype.has=dn,hn.prototype.set=Gr;function gn(Xt){var cr=-1,gr=Xt==null?0:Xt.length;for(this.clear();++cr1?gr[rn-1]:void 0,Tn=rn>2?gr[2]:void 0;for(xn=Xt.length>3&&typeof xn=="function"?(rn--,xn):void 0,Tn&&Yl(gr[0],gr[1],Tn)&&(xn=rn<3?void 0:xn,rn=1),cr=Object(cr);++Dr-1&&Xt%1==0&&Xt0){if(++cr>=et)return arguments[0]}else cr=0;return Xt.apply(void 0,arguments)}}function $l(Xt){if(Xt!=null){try{return kr.call(Xt)}catch{}try{return Xt+""}catch{}}return""}function Xs(Xt,cr){return Xt===cr||Xt!==Xt&&cr!==cr}var Ao=es(function(){return arguments}())?es:function(Xt){return Is(Xt)&&Ar.call(Xt,"callee")&&!ar.call(Xt,"callee")},Bs=Array.isArray;function uo(Xt){return Xt!=null&&To(Xt.length)&&!$o(Xt)}function Tl(Xt){return Is(Xt)&&uo(Xt)}var fo=Wr||wr;function $o(Xt){if(!Ps(Xt))return!1;var cr=Qn(Xt);return cr==ht||cr==yt||cr==st||cr==Mt}function To(Xt){return typeof Xt=="number"&&Xt>-1&&Xt%1==0&&Xt<=rt}function Ps(Xt){var cr=typeof Xt;return Xt!=null&&(cr=="object"||cr=="function")}function Is(Xt){return Xt!=null&&typeof Xt=="object"}function Pl(Xt){if(!Is(Xt)||Qn(Xt)!=$t)return!1;var cr=Vt(Xt);if(cr===null)return!0;var gr=Ar.call(cr,"constructor")&&cr.constructor;return typeof gr=="function"&&gr instanceof gr&&kr.call(gr)==Br}var No=Jt?pr(Jt):us;function Po(Xt){return wo(Xt,Lo(Xt))}function Lo(Xt){return uo(Xt)?ps(Xt):Wn(Xt)}var Xl=Go(function(Xt,cr,gr){as(Xt,cr,gr)});function rs(Xt){return function(){return Xt}}function Xn(Xt){return Xt}function wr(){return!1}a.exports=Xl})(lodash_merge,lodash_merge.exports);var lodash_mergeExports=lodash_merge.exports;const deepmerge$1=getDefaultExportFromCjs$1(lodash_mergeExports);var loglevel={exports:{}};(function(a){(function(_,$){a.exports?a.exports=$():_.log=$()})(commonjsGlobal,function(){var _=function(){},$="undefined",j=typeof window!==$&&typeof window.navigator!==$&&/Trident\/|MSIE /.test(window.navigator.userAgent),et=["trace","debug","info","warn","error"];function tt(wt,Ct){var Pt=wt[Ct];if(typeof Pt.bind=="function")return Pt.bind(wt);try{return Function.prototype.bind.call(Pt,wt)}catch{return function(){return Function.prototype.apply.apply(Pt,[wt,arguments])}}}function rt(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function nt(wt){return wt==="debug"&&(wt="log"),typeof console===$?!1:wt==="trace"&&j?rt:console[wt]!==void 0?tt(console,wt):console.log!==void 0?tt(console,"log"):_}function it(wt,Ct){for(var Pt=0;Pt=0&&Lt<=$t.levels.SILENT){if(Mt=Lt,Ft!==!1&&Dt(Lt),it.call($t,Lt,wt),typeof console===$&&Lt<$t.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+Lt},$t.setDefaultLevel=function(Lt){Ct=Lt,zt()||$t.setLevel(Lt,!1)},$t.resetLevel=function(){$t.setLevel(Ct,!1),Ot()},$t.enableAll=function(Lt){$t.setLevel($t.levels.TRACE,Lt)},$t.disableAll=function(Lt){$t.setLevel($t.levels.SILENT,Lt)};var It=zt();It==null&&(It=Ct),$t.setLevel(It,!1)}var ut=new at,ht={};ut.getLogger=function(Ct){if(typeof Ct!="symbol"&&typeof Ct!="string"||Ct==="")throw new TypeError("You must supply a name when creating a logger.");var Pt=ht[Ct];return Pt||(Pt=ht[Ct]=new at(Ct,ut.getLevel(),ut.methodFactory)),Pt};var yt=typeof window!==$?window.log:void 0;return ut.noConflict=function(){return typeof window!==$&&window.log===ut&&(window.log=yt),ut},ut.getLoggers=function(){return ht},ut.default=ut,ut})})(loglevel);var loglevelExports=loglevel.exports;const log$1$1=getDefaultExportFromCjs$1(loglevelExports);function ownKeys$5(a,_){var $=Object.keys(a);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(a);_&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(a,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$5(a){for(var _=1;_{const $=new Promise((j,et)=>{const tt=setTimeout(()=>{clearTimeout(tt),et(new Error(`Timed out in ${a}ms`))},a)});return Promise.race([_,$])},get=async function(a){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const j={mode:"cors",headers:{}};$.useAPIKey&&(j.headers=_objectSpread$5(_objectSpread$5({},j.headers),getApiKeyHeaders()));const et=deepmerge$1(j,_,{method:"GET"}),tt=await fetchAndTrace(a,et);if(tt.ok)return tt.json();throw debugLogResponse(tt),tt},post=function(a){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const et={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};j.useAPIKey&&(et.headers=_objectSpread$5(_objectSpread$5({},et.headers),getApiKeyHeaders()));const tt=deepmerge$1(et,$,{method:"POST"});return j.isUrlEncodedData?(tt.body=_,tt.headers["Content-Type"]==="application/json; charset=utf-8"&&delete tt.headers["Content-Type"]):tt.body=JSON.stringify(_),promiseTimeout(j.timeout||6e4,fetchAndTrace(a,tt).then(rt=>{if(j.logTracingHeader&&logTracingHeader(rt),rt.ok)return rt.json();throw debugLogResponse(rt),rt}))},generateJsonRPCObject=(a,_)=>({jsonrpc:"2.0",method:a,id:10,params:_});function _objectWithoutPropertiesLoose(a,_){if(a==null)return{};var $={};for(var j in a)if(Object.prototype.hasOwnProperty.call(a,j)){if(_.indexOf(j)>=0)continue;$[j]=a[j]}return $}function _objectWithoutProperties(a,_){if(a==null)return{};var $=_objectWithoutPropertiesLoose(a,_),j,et;if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(a);for(et=0;et=0)&&Object.prototype.propertyIsEnumerable.call(a,j)&&($[j]=a[j])}return $}const BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Utils{static getFirstMatch(_,$){const j=$.match(_);return j&&j.length>0&&j[1]||""}static getSecondMatch(_,$){const j=$.match(_);return j&&j.length>1&&j[2]||""}static matchAndReturnConst(_,$,j){if(_.test($))return j}static getWindowsVersionName(_){switch(_){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(_){const $=_.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),$[0]===10)switch($[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(_){const $=_.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),!($[0]===1&&$[1]<5)){if($[0]===1&&$[1]<6)return"Cupcake";if($[0]===1&&$[1]>=6)return"Donut";if($[0]===2&&$[1]<2)return"Eclair";if($[0]===2&&$[1]===2)return"Froyo";if($[0]===2&&$[1]>2)return"Gingerbread";if($[0]===3)return"Honeycomb";if($[0]===4&&$[1]<1)return"Ice Cream Sandwich";if($[0]===4&&$[1]<4)return"Jelly Bean";if($[0]===4&&$[1]>=4)return"KitKat";if($[0]===5)return"Lollipop";if($[0]===6)return"Marshmallow";if($[0]===7)return"Nougat";if($[0]===8)return"Oreo";if($[0]===9)return"Pie"}}static getVersionPrecision(_){return _.split(".").length}static compareVersions(_,$,j=!1){const et=Utils.getVersionPrecision(_),tt=Utils.getVersionPrecision($);let rt=Math.max(et,tt),nt=0;const it=Utils.map([_,$],st=>{const ot=rt-Utils.getVersionPrecision(st),at=st+new Array(ot+1).join(".0");return Utils.map(at.split("."),ut=>new Array(20-ut.length).join("0")+ut).reverse()});for(j&&(nt=rt-Math.min(et,tt)),rt-=1;rt>=nt;){if(it[0][rt]>it[1][rt])return 1;if(it[0][rt]===it[1][rt]){if(rt===nt)return 0;rt-=1}else if(it[0][rt]{j[it]=rt[it]})}return _}static getBrowserAlias(_){return BROWSER_ALIASES_MAP[_]}static getBrowserTypeByAlias(_){return BROWSER_MAP[_]||""}}const commonVersionIdentifier=/version\/(\d+(\.?_?\d+)+)/i,browsersList=[{test:[/googlebot/i],describe(a){const _={name:"Googlebot"},$=Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/opera/i],describe(a){const _={name:"Opera"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/opr\/|opios/i],describe(a){const _={name:"Opera"},$=Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/SamsungBrowser/i],describe(a){const _={name:"Samsung Internet for Android"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/Whale/i],describe(a){const _={name:"NAVER Whale Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/MZBrowser/i],describe(a){const _={name:"MZ Browser"},$=Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/focus/i],describe(a){const _={name:"Focus"},$=Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/swing/i],describe(a){const _={name:"Swing"},$=Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/coast/i],describe(a){const _={name:"Opera Coast"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(a){const _={name:"Opera Touch"},$=Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/yabrowser/i],describe(a){const _={name:"Yandex Browser"},$=Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/ucbrowser/i],describe(a){const _={name:"UC Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/Maxthon|mxios/i],describe(a){const _={name:"Maxthon"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/epiphany/i],describe(a){const _={name:"Epiphany"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/puffin/i],describe(a){const _={name:"Puffin"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/sleipnir/i],describe(a){const _={name:"Sleipnir"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/k-meleon/i],describe(a){const _={name:"K-Meleon"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/micromessenger/i],describe(a){const _={name:"WeChat"},$=Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/qqbrowser/i],describe(a){const _={name:/qqbrowserlite/i.test(a)?"QQ Browser Lite":"QQ Browser"},$=Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/msie|trident/i],describe(a){const _={name:"Internet Explorer"},$=Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/\sedg\//i],describe(a){const _={name:"Microsoft Edge"},$=Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/edg([ea]|ios)/i],describe(a){const _={name:"Microsoft Edge"},$=Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/vivaldi/i],describe(a){const _={name:"Vivaldi"},$=Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/seamonkey/i],describe(a){const _={name:"SeaMonkey"},$=Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/sailfish/i],describe(a){const _={name:"Sailfish"},$=Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,a);return $&&(_.version=$),_}},{test:[/silk/i],describe(a){const _={name:"Amazon Silk"},$=Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/phantom/i],describe(a){const _={name:"PhantomJS"},$=Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/slimerjs/i],describe(a){const _={name:"SlimerJS"},$=Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(a){const _={name:"BlackBerry"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/(web|hpw)[o0]s/i],describe(a){const _={name:"WebOS Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,a)||Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/bada/i],describe(a){const _={name:"Bada"},$=Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/tizen/i],describe(a){const _={name:"Tizen"},$=Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/qupzilla/i],describe(a){const _={name:"QupZilla"},$=Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/firefox|iceweasel|fxios/i],describe(a){const _={name:"Firefox"},$=Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/electron/i],describe(a){const _={name:"Electron"},$=Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/MiuiBrowser/i],describe(a){const _={name:"Miui"},$=Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/chromium/i],describe(a){const _={name:"Chromium"},$=Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,a)||Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/chrome|crios|crmo/i],describe(a){const _={name:"Chrome"},$=Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/GSA/i],describe(a){const _={name:"Google Search"},$=Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test(a){const _=!a.test(/like android/i),$=a.test(/android/i);return _&&$},describe(a){const _={name:"Android Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/playstation 4/i],describe(a){const _={name:"PlayStation 4"},$=Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/safari|applewebkit/i],describe(a){const _={name:"Safari"},$=Utils.getFirstMatch(commonVersionIdentifier,a);return $&&(_.version=$),_}},{test:[/.*/i],describe(a){const _=/^(.*)\/(.*) /,$=/^(.*)\/(.*)[ \t]\((.*)/,et=a.search("\\(")!==-1?$:_;return{name:Utils.getFirstMatch(et,a),version:Utils.getSecondMatch(et,a)}}}],osParsersList=[{test:[/Roku\/DVP/],describe(a){const _=Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,a);return{name:OS_MAP.Roku,version:_}}},{test:[/windows phone/i],describe(a){const _=Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,a);return{name:OS_MAP.WindowsPhone,version:_}}},{test:[/windows /i],describe(a){const _=Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,a),$=Utils.getWindowsVersionName(_);return{name:OS_MAP.Windows,version:_,versionName:$}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(a){const _={name:OS_MAP.iOS},$=Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/,a);return $&&(_.version=$),_}},{test:[/macintosh/i],describe(a){const _=Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,a).replace(/[_\s]/g,"."),$=Utils.getMacOSVersionName(_),j={name:OS_MAP.MacOS,version:_};return $&&(j.versionName=$),j}},{test:[/(ipod|iphone|ipad)/i],describe(a){const _=Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,a).replace(/[_\s]/g,".");return{name:OS_MAP.iOS,version:_}}},{test(a){const _=!a.test(/like android/i),$=a.test(/android/i);return _&&$},describe(a){const _=Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,a),$=Utils.getAndroidVersionName(_),j={name:OS_MAP.Android,version:_};return $&&(j.versionName=$),j}},{test:[/(web|hpw)[o0]s/i],describe(a){const _=Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,a),$={name:OS_MAP.WebOS};return _&&_.length&&($.version=_),$}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(a){const _=Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,a)||Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,a)||Utils.getFirstMatch(/\bbb(\d+)/i,a);return{name:OS_MAP.BlackBerry,version:_}}},{test:[/bada/i],describe(a){const _=Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,a);return{name:OS_MAP.Bada,version:_}}},{test:[/tizen/i],describe(a){const _=Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,a);return{name:OS_MAP.Tizen,version:_}}},{test:[/linux/i],describe(){return{name:OS_MAP.Linux}}},{test:[/CrOS/],describe(){return{name:OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe(a){const _=Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,a);return{name:OS_MAP.PlayStation4,version:_}}}],platformParsersList=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(a){const _=Utils.getFirstMatch(/(can-l01)/i,a)&&"Nova",$={type:PLATFORMS_MAP.mobile,vendor:"Huawei"};return _&&($.model=_),$}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:PLATFORMS_MAP.tablet}}},{test(a){const _=a.test(/ipod|iphone/i),$=a.test(/like (ipod|iphone)/i);return _&&!$},describe(a){const _=Utils.getFirstMatch(/(ipod|iphone)/i,a);return{type:PLATFORMS_MAP.mobile,vendor:"Apple",model:_}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:PLATFORMS_MAP.mobile}}},{test(a){return a.getBrowserName(!0)==="blackberry"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test(a){return a.getBrowserName(!0)==="bada"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(a){return a.getBrowserName()==="windows phone"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test(a){const _=Number(String(a.getOSVersion()).split(".")[0]);return a.getOSName(!0)==="android"&&_>=3},describe(){return{type:PLATFORMS_MAP.tablet}}},{test(a){return a.getOSName(!0)==="android"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(a){return a.getOSName(!0)==="macos"},describe(){return{type:PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test(a){return a.getOSName(!0)==="windows"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(a){return a.getOSName(!0)==="linux"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(a){return a.getOSName(!0)==="playstation 4"},describe(){return{type:PLATFORMS_MAP.tv}}},{test(a){return a.getOSName(!0)==="roku"},describe(){return{type:PLATFORMS_MAP.tv}}}],enginesParsersList=[{test(a){return a.getBrowserName(!0)==="microsoft edge"},describe(a){if(/\sedg\//i.test(a))return{name:ENGINE_MAP.Blink};const $=Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,a);return{name:ENGINE_MAP.EdgeHTML,version:$}}},{test:[/trident/i],describe(a){const _={name:ENGINE_MAP.Trident},$=Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test(a){return a.test(/presto/i)},describe(a){const _={name:ENGINE_MAP.Presto},$=Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test(a){const _=a.test(/gecko/i),$=a.test(/like gecko/i);return _&&!$},describe(a){const _={name:ENGINE_MAP.Gecko},$=Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe(a){const _={name:ENGINE_MAP.WebKit},$=Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,a);return $&&(_.version=$),_}}];class Parser{constructor(_,$=!1){if(_==null||_==="")throw new Error("UserAgent parameter can't be empty");this._ua=_,this.parsedResult={},$!==!0&&this.parse()}getUA(){return this._ua}test(_){return _.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const _=Utils.find(browsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.browser=_.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(_){return _?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const _=Utils.find(osParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.os=_.describe(this.getUA())),this.parsedResult.os}getOSName(_){const{name:$}=this.getOS();return _?String($).toLowerCase()||"":$||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(_=!1){const{type:$}=this.getPlatform();return _?String($).toLowerCase()||"":$||""}parsePlatform(){this.parsedResult.platform={};const _=Utils.find(platformParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.platform=_.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(_){return _?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const _=Utils.find(enginesParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.engine=_.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Utils.assign({},this.parsedResult)}satisfies(_){const $={};let j=0;const et={};let tt=0;if(Object.keys(_).forEach(nt=>{const it=_[nt];typeof it=="string"?(et[nt]=it,tt+=1):typeof it=="object"&&($[nt]=it,j+=1)}),j>0){const nt=Object.keys($),it=Utils.find(nt,ot=>this.isOS(ot));if(it){const ot=this.satisfies($[it]);if(ot!==void 0)return ot}const st=Utils.find(nt,ot=>this.isPlatform(ot));if(st){const ot=this.satisfies($[st]);if(ot!==void 0)return ot}}if(tt>0){const nt=Object.keys(et),it=Utils.find(nt,st=>this.isBrowser(st,!0));if(it!==void 0)return this.compareVersion(et[it])}}isBrowser(_,$=!1){const j=this.getBrowserName().toLowerCase();let et=_.toLowerCase();const tt=Utils.getBrowserTypeByAlias(et);return $&&tt&&(et=tt.toLowerCase()),et===j}compareVersion(_){let $=[0],j=_,et=!1;const tt=this.getBrowserVersion();if(typeof tt=="string")return _[0]===">"||_[0]==="<"?(j=_.substr(1),_[1]==="="?(et=!0,j=_.substr(2)):$=[],_[0]===">"?$.push(1):$.push(-1)):_[0]==="="?j=_.substr(1):_[0]==="~"&&(et=!0,j=_.substr(1)),$.indexOf(Utils.compareVersions(tt,j,et))>-1}isOS(_){return this.getOSName(!0)===String(_).toLowerCase()}isPlatform(_){return this.getPlatformType(!0)===String(_).toLowerCase()}isEngine(_){return this.getEngineName(!0)===String(_).toLowerCase()}is(_,$=!1){return this.isBrowser(_,$)||this.isOS(_)||this.isPlatform(_)}some(_=[]){return _.some($=>this.is($))}}/*! * Bowser - a browser detector * https://github.com/lancedikson/bowser * MIT License | (c) Dustin Diaz 2012-2015 @@ -548,9 +548,9 @@ Please pass a 2048 word array explicitly.`;function normalize(a){return(a||"").n `+_+yt.join(`, `+_)+` `+ht+"}":"{"+yt.join(",")+"}",_=ht,at}}return stringify$1=function(nt,it,st){var ot;if(_="",$="",typeof st=="number")for(ot=0;ot>_7n)*_0x71n)%_256n,_&_2n&&(et^=_1n<<(_1n<$>32?_u64_js_1.default.rotlBH(a,_,$):_u64_js_1.default.rotlSH(a,_,$),rotlL=(a,_,$)=>$>32?_u64_js_1.default.rotlBL(a,_,$):_u64_js_1.default.rotlSL(a,_,$);function keccakP(a,_=24){const $=new Uint32Array(10);for(let j=24-_;j<24;j++){for(let rt=0;rt<10;rt++)$[rt]=a[rt]^a[rt+10]^a[rt+20]^a[rt+30]^a[rt+40];for(let rt=0;rt<10;rt+=2){const nt=(rt+8)%10,it=(rt+2)%10,st=$[it],ot=$[it+1],at=rotlH(st,ot,1)^$[nt],ut=rotlL(st,ot,1)^$[nt+1];for(let ht=0;ht<50;ht+=10)a[rt+ht]^=at,a[rt+ht+1]^=ut}let et=a[2],tt=a[3];for(let rt=0;rt<24;rt++){const nt=SHA3_ROTL[rt],it=rotlH(et,tt,nt),st=rotlL(et,tt,nt),ot=SHA3_PI[rt];et=a[ot],tt=a[ot+1],a[ot]=it,a[ot+1]=st}for(let rt=0;rt<50;rt+=10){for(let nt=0;nt<10;nt++)$[nt]=a[rt+nt];for(let nt=0;nt<10;nt++)a[rt+nt]^=~$[(nt+2)%10]&$[(nt+4)%10]}a[0]^=SHA3_IOTA_H[j],a[1]^=SHA3_IOTA_L[j]}$.fill(0)}sha3.keccakP=keccakP;class Keccak extends utils_js_1.Hash{constructor(_,$,j,et=!1,tt=24){if(super(),this.blockLen=_,this.suffix=$,this.outputLen=j,this.enableXOF=et,this.rounds=tt,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,_assert_js_1.default.number(j),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,utils_js_1.u32)(this.state)}keccak(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(_){_assert_js_1.default.exists(this);const{blockLen:$,state:j}=this;_=(0,utils_js_1.toBytes)(_);const et=_.length;for(let tt=0;tt=j&&this.keccak();const rt=Math.min(j-this.posOut,tt-et);_.set($.subarray(this.posOut,this.posOut+rt),et),this.posOut+=rt,et+=rt}return _}xofInto(_){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(_)}xof(_){return _assert_js_1.default.number(_),this.xofInto(new Uint8Array(_))}digestInto(_){if(_assert_js_1.default.output(_,this),this.finished)throw new Error("digest() was already called");return this.writeInto(_),this.destroy(),_}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(_){const{blockLen:$,suffix:j,outputLen:et,rounds:tt,enableXOF:rt}=this;return _||(_=new Keccak($,j,et,rt,tt)),_.state32.set(this.state32),_.pos=this.pos,_.posOut=this.posOut,_.finished=this.finished,_.rounds=tt,_.suffix=j,_.outputLen=et,_.enableXOF=rt,_.destroyed=this.destroyed,_}}sha3.Keccak=Keccak;const gen=(a,_,$)=>(0,utils_js_1.wrapConstructor)(()=>new Keccak(_,a,$));sha3.sha3_224=gen(6,144,224/8);sha3.sha3_256=gen(6,136,256/8);sha3.sha3_384=gen(6,104,384/8);sha3.sha3_512=gen(6,72,512/8);sha3.keccak_224=gen(1,144,224/8);sha3.keccak_256=gen(1,136,256/8);sha3.keccak_384=gen(1,104,384/8);sha3.keccak_512=gen(1,72,512/8);const genShake=(a,_,$)=>(0,utils_js_1.wrapConstructorWithOpts)((j={})=>new Keccak(_,a,j.dkLen===void 0?$:j.dkLen,!0));sha3.shake128=genShake(31,168,128/8);sha3.shake256=genShake(31,136,256/8);var utils$2={exports:{}};utils$2.exports;(function(a,_){var $=commonjsGlobal&&commonjsGlobal.__importDefault||function(ut){return ut&&ut.__esModule?ut:{default:ut}};Object.defineProperty(_,"__esModule",{value:!0}),_.crypto=_.wrapHash=_.equalsBytes=_.hexToBytes=_.bytesToUtf8=_.utf8ToBytes=_.createView=_.concatBytes=_.toHex=_.bytesToHex=_.assertBytes=_.assertBool=void 0;const j=$(_assert),et=utils$e,tt=j.default.bool;_.assertBool=tt;const rt=j.default.bytes;_.assertBytes=rt;var nt=utils$e;Object.defineProperty(_,"bytesToHex",{enumerable:!0,get:function(){return nt.bytesToHex}}),Object.defineProperty(_,"toHex",{enumerable:!0,get:function(){return nt.bytesToHex}}),Object.defineProperty(_,"concatBytes",{enumerable:!0,get:function(){return nt.concatBytes}}),Object.defineProperty(_,"createView",{enumerable:!0,get:function(){return nt.createView}}),Object.defineProperty(_,"utf8ToBytes",{enumerable:!0,get:function(){return nt.utf8ToBytes}});function it(ut){if(!(ut instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof ut}`);return new TextDecoder().decode(ut)}_.bytesToUtf8=it;function st(ut){const ht=ut.startsWith("0x")?ut.substring(2):ut;return(0,et.hexToBytes)(ht)}_.hexToBytes=st;function ot(ut,ht){if(ut.length!==ht.length)return!1;for(let yt=0;yt(j.default.bytes(ht),ut(ht))}_.wrapHash=at,_.crypto=(()=>{const ut=typeof self=="object"&&"crypto"in self?self.crypto:void 0,ht=typeof commonjsRequire=="function"&&commonjsRequire.bind(a);return{node:ht&&!ut?ht("crypto"):void 0,web:ut}})()})(utils$2,utils$2.exports);var utilsExports=utils$2.exports;Object.defineProperty(keccak,"__esModule",{value:!0});keccak.keccak512=keccak.keccak384=keccak256$3=keccak.keccak256=keccak.keccak224=void 0;const sha3_1=sha3,utils_1=utilsExports;keccak.keccak224=(0,utils_1.wrapHash)(sha3_1.keccak_224);var keccak256$3=keccak.keccak256=(()=>{const a=(0,utils_1.wrapHash)(sha3_1.keccak_256);return a.create=sha3_1.keccak_256.create,a})();keccak.keccak384=(0,utils_1.wrapHash)(sha3_1.keccak_384);keccak.keccak512=(0,utils_1.wrapHash)(sha3_1.keccak_512);function keccak256$2(a){return Buffer$g.from(keccak256$3(a))}const ec$1=new elliptic$1.ec("secp256k1");function encParamsHexToBuf$2(a){return{iv:Buffer$g.from(a.iv,"hex"),ephemPublicKey:Buffer$g.from(a.ephemPublicKey,"hex"),ciphertext:Buffer$g.from(a.ciphertext,"hex"),mac:Buffer$g.from(a.mac,"hex")}}function encParamsBufToHex$2(a){return{iv:Buffer$g.from(a.iv).toString("hex"),ephemPublicKey:Buffer$g.from(a.ephemPublicKey).toString("hex"),ciphertext:Buffer$g.from(a.ciphertext).toString("hex"),mac:Buffer$g.from(a.mac).toString("hex")}}async function encryptData$1(a,_){const $=JSON.stringify(_),j=Buffer$g.from($,"utf-8"),et=await encrypt(getPublic(Buffer$g.from(a,"hex")),j),tt=encParamsBufToHex$2(et);return JSON.stringify(tt)}async function decryptData$1(a,_){const $=JSON.parse(_),j=encParamsHexToBuf$2($),et=ec$1.keyFromPrivate(a),rt=(await decrypt(Buffer$g.from(et.getPrivate().toString("hex",64),"hex"),j)).toString("utf-8");return JSON.parse(rt)}var microSeconds$1=microSeconds$5,KEY_PREFIX="pubkey.broadcastChannel-",type$1="server",SOCKET_CONN_INSTANCE=null,runningChannels=new Set;function storageKey(a){return KEY_PREFIX+a}function postMessage$1(a,_){return new Promise(function($,j){sleep().then(_asyncToGenerator(_regeneratorRuntime.mark(function et(){var tt,rt,nt,it;return _regeneratorRuntime.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return tt=storageKey(a.channelName),rt=keccak256$2(Buffer$g.from(tt,"utf8")),ot.next=4,encryptData$1(rt.toString("hex"),{token:randomToken(),time:new Date().getTime(),data:_,uuid:a.uuid});case 4:return nt=ot.sent,ot.t0=getPublic(rt).toString("hex"),ot.t1=nt,ot.next=9,sign(rt,keccak256$2(Buffer$g.from(nt,"utf8")));case 9:return ot.t2=ot.sent.toString("hex"),it={key:ot.t0,data:ot.t1,signature:ot.t2},a.timeout&&(it.timeout=a.timeout),ot.abrupt("return",fetch(a.serverUrl+"/channel/set",{method:"POST",body:JSON.stringify(it),headers:{"Content-Type":"application/json; charset=utf-8"}}).then($).catch(j));case 13:case"end":return ot.stop()}},et)})))})}function getSocketInstance(a){if(SOCKET_CONN_INSTANCE)return SOCKET_CONN_INSTANCE;var _=lookup(a,{transports:["websocket","polling"],withCredentials:!0,reconnectionDelayMax:1e4,reconnectionAttempts:10});return _.on("connect_error",function($){_.io.opts.transports=["polling","websocket"],log$4.error("connect error",$)}),_.on("connect",_asyncToGenerator(_regeneratorRuntime.mark(function $(){var j;return _regeneratorRuntime.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:j=_.io.engine,log$4.debug("initially connected to",j.transport.name),j.once("upgrade",function(){log$4.debug("upgraded",j.transport.name)}),j.once("close",function(rt){log$4.debug("connection closed",rt)});case 4:case"end":return tt.stop()}},$)}))),_.on("error",function($){log$4.error("socket errored",$),_.disconnect()}),SOCKET_CONN_INSTANCE=_,_}function setupSocketConnection(a,_,$){var j=getSocketInstance(a),et=storageKey(_),tt=keccak256$2(Buffer$g.from(et,"utf8")),rt=getPublic(tt).toString("hex");j.connected?j.emit("check_auth_status",rt):j.once("connect",function(){log$4.debug("connected with socket"),j.emit("check_auth_status",rt)});var nt=function(){j.once("connect",_asyncToGenerator(_regeneratorRuntime.mark(function at(){return _regeneratorRuntime.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:j.emit("check_auth_status",rt);case 1:case"end":return ht.stop()}},at)})))},it=function ot(){if(!j){document.removeEventListener("visibilitychange",ot);return}!j.connected&&document.visibilityState==="visible"&&nt()},st=function(){var ot=_asyncToGenerator(_regeneratorRuntime.mark(function at(ut){var ht;return _regeneratorRuntime.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.prev=0,wt.next=3,decryptData$1(tt.toString("hex"),ut);case 3:ht=wt.sent,log$4.info(ht),$(ht),wt.next=11;break;case 8:wt.prev=8,wt.t0=wt.catch(0),log$4.error(wt.t0);case 11:case"end":return wt.stop()}},at,null,[[0,8]])}));return function(ut){return ot.apply(this,arguments)}}();return j.on("disconnect",function(){log$4.debug("socket disconnected"),runningChannels.has(_)&&(log$4.error("socket disconnected unexpectedly, reconnecting socket"),nt())}),j.on(rt+"_success",st),typeof document<"u"&&document.addEventListener("visibilitychange",it),j}function create$1(a,_){_=fillOptionsWithDefaults(_);var $=randomToken(),j=new ObliviousSet(_.server.removeTimeout),et={channelName:a,uuid:$,eMIs:j,serverUrl:_.server.url};return _.server.timeout&&(et.timeout=_.server.timeout),setupSocketConnection(_.server.url,a,function(tt){et.messagesCallback&&tt.uuid!==et.uuid&&(!tt.token||et.eMIs.has(tt.token)||(et.eMIs.add(tt.token),et.messagesCallback(tt.data)))}),runningChannels.add(a),et}function close$1(a){runningChannels.delete(a.channelName)}function onMessage$1(a,_,$){a.messagesCallbackTime=$,a.messagesCallback=_}function canBeUsed$1(){return!0}function averageResponseTime$1(){var a=500;return a}const ServerMethod={create:create$1,close:close$1,onMessage:onMessage$1,postMessage:postMessage$1,canBeUsed:canBeUsed$1,type:type$1,averageResponseTime:averageResponseTime$1,microSeconds:microSeconds$1};var microSeconds=microSeconds$5,type="simulate",SIMULATE_CHANNELS=new Set;function create(a){var _={name:a,messagesCallback:null};return SIMULATE_CHANNELS.add(_),_}function close(a){SIMULATE_CHANNELS.delete(a)}function postMessage(a,_){return new Promise(function($){return setTimeout(function(){var j=Array.from(SIMULATE_CHANNELS);j.filter(function(et){return et.name===a.name}).filter(function(et){return et!==a}).filter(function(et){return!!et.messagesCallback}).forEach(function(et){return et.messagesCallback(_)}),$()},5)})}function onMessage(a,_){a.messagesCallback=_}function canBeUsed(){return!0}function averageResponseTime(){return 5}const SimulateMethod={create,close,onMessage,postMessage,canBeUsed,type,averageResponseTime,microSeconds};var METHODS=[NativeMethod,IndexeDbMethod,LocalstorageMethod,ServerMethod];function chooseMethod(a){var _=[].concat(a.methods,METHODS).filter(Boolean);if(a.type){if(a.type==="simulate")return SimulateMethod;var $=_.find(function(et){return et.type===a.type});if($)return $;throw new Error("method-type "+a.type+" not found")}a.webWorkerSupport||(_=_.filter(function(et){return et.type!=="idb"}));var j=_.find(function(et){return et.canBeUsed(a)});if(j)return j;throw new Error("No useable method found in "+JSON.stringify(METHODS.map(function(et){return et.type})))}var OPEN_BROADCAST_CHANNELS=new Set,lastId=0,BroadcastChannel$1=function a(_,$){this.id=lastId++,OPEN_BROADCAST_CHANNELS.add(this),this.name=_,ENFORCED_OPTIONS&&($=ENFORCED_OPTIONS),this.options=fillOptionsWithDefaults($),this.method=chooseMethod(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,_prepareChannel(this)};BroadcastChannel$1._pubkey=!0;var ENFORCED_OPTIONS;BroadcastChannel$1.prototype={postMessage:function a(_){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(_));return _post(this,"message",_)},postInternal:function a(_){return _post(this,"internal",_)},set onmessage(a){var _=this.method.microSeconds(),$={time:_,fn:a};_removeListenerObject(this,"message",this._onML),a&&typeof a=="function"?(this._onML=$,_addListenerObject(this,"message",$)):this._onML=null},addEventListener:function a(_,$){var j=this.method.microSeconds(),et={time:j,fn:$};_addListenerObject(this,_,et)},removeEventListener:function a(_,$){var j=this._addEL[_].find(function(et){return et.fn===$});_removeListenerObject(this,_,j)},close:function a(){var _=this;if(!this.closed){OPEN_BROADCAST_CHANNELS.delete(this),this.closed=!0;var $=this._prepP?this._prepP:PROMISE_RESOLVED_VOID;return this._onML=null,this._addEL.message=[],$.then(function(){return Promise.all(Array.from(_._uMP))}).then(function(){return Promise.all(_._befC.map(function(j){return j()}))}).then(function(){return _.method.close(_._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function _post(a,_,$){var j=a.method.microSeconds(),et={time:j,type:_,data:$},tt=a._prepP?a._prepP:PROMISE_RESOLVED_VOID;return tt.then(function(){var rt=a.method.postMessage(a._state,et);return a._uMP.add(rt),rt.catch().then(function(){return a._uMP.delete(rt)}),rt})}function _prepareChannel(a){var _=a.method.create(a.name,a.options);isPromise(_)?(a._prepP=_,_.then(function($){a._state=$})):a._state=_}function _hasMessageListeners(a){return a._addEL.message.length>0||a._addEL.internal.length>0}function _addListenerObject(a,_,$){a._addEL[_].push($),_startListening(a)}function _removeListenerObject(a,_,$){a._addEL[_]=a._addEL[_].filter(function(j){return j!==$}),_stopListening(a)}function _startListening(a){if(!a._iL&&_hasMessageListeners(a)){var _=function(et){a._addEL[et.type].forEach(function(tt){var rt=1e5,nt=tt.time-rt;(et.time>=nt||a.method.type==="server")&&tt.fn(et.data)})},$=a.method.microSeconds();a._prepP?a._prepP.then(function(){a._iL=!0,a.method.onMessage(a._state,_,$)}):(a._iL=!0,a.method.onMessage(a._state,_,$))}}function _stopListening(a){if(a._iL&&!_hasMessageListeners(a)){a._iL=!1;var _=a.method.microSeconds();a.method.onMessage(a._state,null,_)}}function e(a){this.message=a}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(a){var _=String(a).replace(/=+$/,"");if(_.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var $,j,et=0,tt=0,rt="";j=_.charAt(tt++);~j&&($=et%4?64*$+j:j,et++%4)?rt+=String.fromCharCode(255&$>>(-2*et&6)):0)j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(j);return rt};function t(a){var _=a.replace(/-/g,"+").replace(/_/g,"/");switch(_.length%4){case 0:break;case 2:_+="==";break;case 3:_+="=";break;default:throw"Illegal base64url string!"}try{return function($){return decodeURIComponent(r($).replace(/(.)/g,function(j,et){var tt=et.charCodeAt(0).toString(16).toUpperCase();return tt.length<2&&(tt="0"+tt),"%"+tt}))}(_)}catch{return r(_)}}function n(a){this.message=a}function o(a,_){if(typeof a!="string")throw new n("Invalid token specified");var $=(_=_||{}).header===!0?0:1;try{return JSON.parse(t(a.split(".")[$]))}catch(j){throw new n("Invalid token specified: "+j.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const TORUS_LEGACY_NETWORK={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},TORUS_SAPPHIRE_NETWORK={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_TESTNET:"sapphire_testnet",SAPPHIRE_MAINNET:"sapphire_mainnet"},MULTI_CLUSTER_NETWORKS=[TORUS_LEGACY_NETWORK.AQUA,TORUS_LEGACY_NETWORK.CELESTE,TORUS_LEGACY_NETWORK.CYAN],LEGACY_NETWORKS_ROUTE_MAP={[TORUS_LEGACY_NETWORK.AQUA]:{migrationCompleted:!1,networkIdentifier:"aqua",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.CELESTE]:{migrationCompleted:!1,networkIdentifier:"celeste",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.CYAN]:{migrationCompleted:!1,networkIdentifier:"cyan",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.MAINNET]:{migrationCompleted:!1,networkIdentifier:"mainnet",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.TESTNET]:{migrationCompleted:!0,networkIdentifier:"teal",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_TESTNET}},SIGNER_MAP={[TORUS_LEGACY_NETWORK.MAINNET]:"https://signer.tor.us",[TORUS_LEGACY_NETWORK.TESTNET]:"https://signer.tor.us",[TORUS_LEGACY_NETWORK.CYAN]:"https://signer-polygon.tor.us",[TORUS_LEGACY_NETWORK.AQUA]:"https://signer-polygon.tor.us",[TORUS_LEGACY_NETWORK.CELESTE]:"https://signer-polygon.tor.us"},SAPPHIRE_NETWORK_URLS={[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET]:["https://sapphire-dev-2-1.authnetwork.dev","https://sapphire-dev-2-2.authnetwork.dev","https://sapphire-dev-2-3.authnetwork.dev","https://sapphire-dev-2-4.authnetwork.dev","https://sapphire-dev-2-5.authnetwork.dev"],[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_TESTNET]:["https://sapphire-dev-2-1.authnetwork.dev","https://sapphire-dev-2-2.authnetwork.dev","https://sapphire-dev-2-3.authnetwork.dev","https://sapphire-dev-2-4.authnetwork.dev","https://sapphire-dev-2-5.authnetwork.dev"],[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET]:["https://sapphire-1.auth.network","https://sapphire-2.auth.network","https://sapphire-3.auth.network","https://sapphire-4.auth.network","https://sapphire-5.auth.network"]},getSSSEndpoints=(a,_)=>{const $=SAPPHIRE_NETWORK_URLS[a];if(!$||$.length===0)throw new Error(`Unsupported network: ${a}`);const j=LEGACY_NETWORKS_ROUTE_MAP[_];return $.map(et=>j&&j.networkIdentifier?`${et}/sss/${j.networkIdentifier}/jrpc`:`${et}/sss/jrpc`)},getRSSEndpoints=(a,_)=>{const $=SAPPHIRE_NETWORK_URLS[a];if(!$||$.length===0)throw new Error(`Unsupported network: ${a}`);const j=LEGACY_NETWORKS_ROUTE_MAP[_];return $.map(et=>j&&j.networkIdentifier?`${et}/rss/${j.networkIdentifier}`:`${et}/rss`)},getTSSEndpoints=(a,_)=>{const $=SAPPHIRE_NETWORK_URLS[a];if(!$||$.length===0)throw new Error(`Unsupported network: ${a}`);const j=LEGACY_NETWORKS_ROUTE_MAP[_];return $.map(et=>j&&j.networkIdentifier?`${et}/tss/${j.networkIdentifier}`:`${et}/tss`)},NODE_DETAILS_MAINNET={currentEpoch:"19",torusNodeEndpoints:["https://torus-19.torusnode.com/jrpc","https://torus-node.ens.domains/jrpc","https://torus-node.matic.network/jrpc","https://torus.zilliqa.network/jrpc","https://torus-mainnet.cosmos.network/jrpc","https://torus2.etherscan.com/jrpc","https://torus-node-v2.skalelabs.com/jrpc","https://torus-node.binancex.dev/jrpc","https://torusnode.ont.io/jrpc"],torusIndexes:[1,2,3,4,5,6,7,8,9],torusNodePub:[{X:"bbe83c64177c3775550e6ba6ac2bc059f6847d644c9e4894e42c60d7974d8c2b",Y:"82b49a7caf70def38cdad2740af45c1e4f969650105c5019a29bb18b21a9acb5"},{X:"c208cac4ef9a47d386097a9c915b28e9cb89213abee8d26a17198ee261201b0d",Y:"c7db2fe4631109f40833de9dc78d07e35706549ee48fa557b33e4e75e1047873"},{X:"ca1766bb426d4ca5582818a0c5439d560ea64f5baa060793ab29dd3d0ceacfe",Y:"d46c1d08c40e1306e1bca328c2287b8268166b11a1ba4b8442ea2ad0c5e32152"},{X:"c3934dd2f6f4b3d2e1e398cc501e143c1e1a381b52feb6d1525af34d16253768",Y:"71f5141a5035799099f5ea3e241e66946bc55dc857ac3bd7d6fcdb8dcd3eeeef"},{X:"22e66f1929631d00bf026227581597f085fd94fd952fc0dca9f0833398b5c064",Y:"6088b3912e10a1e9d50355a609c10db7d188f16a2e2fd7357e51bf4f6a74f0a1"},{X:"9dc9fa410f3ce9eb70df70cdea00a49f2c4cc7a31c08c0dab5f863ed35ff5139",Y:"627a291cb87a75c61da3f65d6818e1e05e360217179817ed27e8c73bca7ec122"},{X:"118b9fc07e97b096d899b9f6658463ce6a8caa64038e37fc969df4e6023dd8c6",Y:"baf9fa4e51770f4796ea165dd03a769b8606681a38954a0a92c4cbffd6609ce9"},{X:"8a6d8b925da15a273dec3d8f8395ec35cd6878f274b2b180e4e106999db64043",Y:"96f67f870c157743da0b1eb84d89bf30500d74dc84c11f501ee1cb013acc8c46"},{X:"39cecb62e863729f572f7dfc46c24867981bf04bb405fed0df39e33984bfade5",Y:"61c2364434012e68a2be2e9952805037e52629d7762fafc8e10e9fb5bad8f790"}]},SAPPHIRE_NODE_PUB_KEYS={[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET]:[{X:"e0925898fee0e9e941fdca7ee88deec99939ae9407e923535c4d4a3a3ff8b052",Y:"54b9fea924e3f3e40791f9987f4234ae4222412d65b74068032fa5d8b63375c1"},{X:"9124cf1e280aab32ba50dffd2de81cecabc13d82d2c1fe9de82f3b3523f9b637",Y:"fca939a1ceb42ce745c55b21ef094f543b457630cb63a94ef4f1afeee2b1f107"},{X:"555f681a63d469cc6c3a58a97e29ebd277425f0e6159708e7c7bf05f18f89476",Y:"606f2bcc0884fa5b64366fc3e8362e4939841b56acd60d5f4553cf36b891ac4e"},{X:"2b5f58d8e340f1ab922e89b3a69a68930edfe51364644a456335e179bc130128",Y:"4b4daa05939426e3cbe7d08f0e773d2bf36f64c00d04620ee6df2a7af4d2247"},{X:"3ecbb6a68afe72cf34ec6c0a12b5cb78a0d2e83ba402983b6adbc5f36219861a",Y:"dc1031c5cc8f0472bd521a62a64ebca9e163902c247bf05937daf4ae835091e4"}],[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_TESTNET]:[{X:"f74389b0a4c8d10d2a687ae575f69b20f412d41ab7f1fe6b358aa14871327247",Y:"54e3a73098ed9bced3ef8821736e9794f9264a1420c0c7ad15d2fa617ba35ef7"},{X:"bc38813a6873e526087918507c78fc3a61624670ee851ecfb4f3bef55d027b5a",Y:"ac4b21229f662a0aefdfdac21cf17c3261a392c74a8790db218b34e3e4c1d56a"},{X:"b56541684ea5fa40c8337b7688d502f0e9e092098962ad344c34e94f06d293fb",Y:"759a998cef79d389082f9a75061a29190eec0cac99b8c25ddcf6b58569dad55c"},{X:"7bcb058d4c6ffc6ba4bfdfd93d141af35a66338a62c7c27cdad2ae3f8289b767",Y:"336ab1935e41ed4719e162587f0ab55518db4207a1eb36cc72303f1b86689d2b"},{X:"bf12a136ef94399ea098f926f04e26a4ec4ac70f69cce274e8893704c4951773",Y:"bdd44828020f52ce510e026338216ada184a6867eb4e19fb4c2d495d4a7e15e4"}],[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET]:[{X:"f74389b0a4c8d10d2a687ae575f69b20f412d41ab7f1fe6b358aa14871327247",Y:"54e3a73098ed9bced3ef8821736e9794f9264a1420c0c7ad15d2fa617ba35ef7"},{X:"bc38813a6873e526087918507c78fc3a61624670ee851ecfb4f3bef55d027b5a",Y:"ac4b21229f662a0aefdfdac21cf17c3261a392c74a8790db218b34e3e4c1d56a"},{X:"b56541684ea5fa40c8337b7688d502f0e9e092098962ad344c34e94f06d293fb",Y:"759a998cef79d389082f9a75061a29190eec0cac99b8c25ddcf6b58569dad55c"},{X:"7bcb058d4c6ffc6ba4bfdfd93d141af35a66338a62c7c27cdad2ae3f8289b767",Y:"336ab1935e41ed4719e162587f0ab55518db4207a1eb36cc72303f1b86689d2b"},{X:"bf12a136ef94399ea098f926f04e26a4ec4ac70f69cce274e8893704c4951773",Y:"bdd44828020f52ce510e026338216ada184a6867eb4e19fb4c2d495d4a7e15e4"}]},getSapphireNodeDetails=(a,_)=>({currentEpoch:"1",torusNodeEndpoints:getSSSEndpoints(a,_),torusNodeSSSEndpoints:getSSSEndpoints(a,_),torusNodeRSSEndpoints:getRSSEndpoints(a,_),torusNodeTSSEndpoints:getTSSEndpoints(a,_),torusIndexes:[1,2,3,4,5],torusNodePub:SAPPHIRE_NODE_PUB_KEYS[a]});function fetchLocalConfig(a){if(Object.values(TORUS_SAPPHIRE_NETWORK).includes(a))return getSapphireNodeDetails(a);if(Object.values(TORUS_LEGACY_NETWORK).includes(a)){const _=LEGACY_NETWORKS_ROUTE_MAP[a];if(_.migrationCompleted)return getSapphireNodeDetails(_.networkMigratedTo,a);if(a===TORUS_LEGACY_NETWORK.MAINNET)return NODE_DETAILS_MAINNET}}const log$2=log$1$1.getLogger("fnd");class NodeDetailManager{constructor(){let{network:_=TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET,fndServerEndpoint:$,enableLogging:j=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_defineProperty$4(this,"fndServerEndpoint","https://fnd.tor.us/node-details"),_defineProperty$4(this,"_currentEpoch","1"),_defineProperty$4(this,"_torusNodeEndpoints",[]),_defineProperty$4(this,"_torusNodeRSSEndpoints",[]),_defineProperty$4(this,"_torusNodeSSSEndpoints",[]),_defineProperty$4(this,"_torusNodeTSSEndpoints",[]),_defineProperty$4(this,"_torusNodePub",[]),_defineProperty$4(this,"_torusIndexes",[]),_defineProperty$4(this,"updated",void 0),_defineProperty$4(this,"network",void 0),this.network=_,this.updated=!1,$&&(this.fndServerEndpoint=$),j?log$2.enableAll():log$2.disableAll()}get _nodeDetails(){return{currentEpoch:this._currentEpoch,torusNodeEndpoints:this._torusNodeEndpoints,torusNodeSSSEndpoints:this._torusNodeSSSEndpoints,torusNodeRSSEndpoints:this._torusNodeRSSEndpoints,torusNodeTSSEndpoints:this._torusNodeTSSEndpoints,torusNodePub:this._torusNodePub,torusIndexes:this._torusIndexes,updated:this.updated}}async getNodeDetails(_){let{verifier:$,verifierId:j}=_;try{if(this.updated&&!MULTI_CLUSTER_NETWORKS.includes(this.network))return this._nodeDetails;try{const{nodeDetails:tt}=await get(`${this.fndServerEndpoint}?network=${this.network}&verifier=${$}&verifierId=${j}`);return this.setNodeDetails(tt),this._nodeDetails}catch(tt){log$2.error("Failed to fetch node details from server, using local.",tt)}const et=fetchLocalConfig(this.network);if(!et)throw new Error("Failed to fetch node details");return this.setNodeDetails(et),this._nodeDetails}catch(et){throw log$2.error("Failed to fetch node details",et),et}}setNodeDetails(_){const{currentEpoch:$,torusNodeEndpoints:j,torusNodeSSSEndpoints:et,torusNodeRSSEndpoints:tt,torusNodeTSSEndpoints:rt,torusNodePub:nt,torusIndexes:it}=_;this._torusNodeEndpoints=j,this._torusNodeSSSEndpoints=et||[],this._torusNodeRSSEndpoints=tt||[],this._torusNodeTSSEndpoints=rt||[],this._torusNodePub=nt,this._torusIndexes=it,this._currentEpoch=$,this.updated=!0}}var bn={exports:{}};bn.exports;(function(a){(function(_,$){function j(vt,ct){if(!vt)throw new Error(ct||"Assertion failed")}function et(vt,ct){vt.super_=ct;var dt=function(){};dt.prototype=ct.prototype,vt.prototype=new dt,vt.prototype.constructor=vt}function tt(vt,ct,dt){if(tt.isBN(vt))return vt;this.negative=0,this.words=null,this.length=0,this.red=null,vt!==null&&((ct==="le"||ct==="be")&&(dt=ct,ct=10),this._init(vt||0,ct||10,dt||"be"))}typeof _=="object"?_.exports=tt:$.BN=tt,tt.BN=tt,tt.wordSize=26;var rt;try{typeof window<"u"&&typeof window.Buffer<"u"?rt=window.Buffer:rt=require$$0$4.Buffer}catch{}tt.isBN=function(ct){return ct instanceof tt?!0:ct!==null&&typeof ct=="object"&&ct.constructor.wordSize===tt.wordSize&&Array.isArray(ct.words)},tt.max=function(ct,dt){return ct.cmp(dt)>0?ct:dt},tt.min=function(ct,dt){return ct.cmp(dt)<0?ct:dt},tt.prototype._init=function(ct,dt,mt){if(typeof ct=="number")return this._initNumber(ct,dt,mt);if(typeof ct=="object")return this._initArray(ct,dt,mt);dt==="hex"&&(dt=16),j(dt===(dt|0)&&dt>=2&&dt<=36),ct=ct.toString().replace(/\s+/g,"");var xt=0;ct[0]==="-"&&(xt++,this.negative=1),xt=0;xt-=3)Rt=ct[xt]|ct[xt-1]<<8|ct[xt-2]<<16,this.words[At]|=Rt<>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);else if(mt==="le")for(xt=0,At=0;xt>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);return this._strip()};function nt(vt,ct){var dt=vt.charCodeAt(ct);if(dt>=48&&dt<=57)return dt-48;if(dt>=65&&dt<=70)return dt-55;if(dt>=97&&dt<=102)return dt-87;j(!1,"Invalid character in "+vt)}function it(vt,ct,dt){var mt=nt(vt,dt);return dt-1>=ct&&(mt|=nt(vt,dt-1)<<4),mt}tt.prototype._parseHex=function(ct,dt,mt){this.length=Math.ceil((ct.length-dt)/6),this.words=new Array(this.length);for(var xt=0;xt=dt;xt-=2)St=it(ct,dt,xt)<=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8;else{var Tt=ct.length-dt;for(xt=Tt%2===0?dt+1:dt;xt=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8}this._strip()};function st(vt,ct,dt,mt){for(var xt=0,At=0,Rt=Math.min(vt.length,dt),St=ct;St=49?At=Tt-49+10:Tt>=17?At=Tt-17+10:At=Tt,j(Tt>=0&&At1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=at}catch{tt.prototype.inspect=at}else tt.prototype.inspect=at;function at(){return(this.red?""}var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],yt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(ct,dt){ct=ct||10,dt=dt|0||1;var mt;if(ct===16||ct==="hex"){mt="";for(var xt=0,At=0,Rt=0;Rt>>24-xt&16777215,xt+=2,xt>=26&&(xt-=26,Rt--),At!==0||Rt!==this.length-1?mt=ut[6-Tt.length]+Tt+mt:mt=Tt+mt}for(At!==0&&(mt=At.toString(16)+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}if(ct===(ct|0)&&ct>=2&&ct<=36){var Et=ht[ct],Nt=yt[ct];mt="";var tr=this.clone();for(tr.negative=0;!tr.isZero();){var ir=tr.modrn(Nt).toString(ct);tr=tr.idivn(Nt),tr.isZero()?mt=ir+mt:mt=ut[Et-ir.length]+ir+mt}for(this.isZero()&&(mt="0"+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var ct=this.words[0];return this.length===2?ct+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ct+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ct:ct},tt.prototype.toJSON=function(){return this.toString(16,2)},rt&&(tt.prototype.toBuffer=function(ct,dt){return this.toArrayLike(rt,ct,dt)}),tt.prototype.toArray=function(ct,dt){return this.toArrayLike(Array,ct,dt)};var wt=function(ct,dt){return ct.allocUnsafe?ct.allocUnsafe(dt):new ct(dt)};tt.prototype.toArrayLike=function(ct,dt,mt){this._strip();var xt=this.byteLength(),At=mt||Math.max(1,xt);j(xt<=At,"byte array longer than desired length"),j(At>0,"Requested array length <= 0");var Rt=wt(ct,At),St=dt==="le"?"LE":"BE";return this["_toArrayLike"+St](Rt,xt),Rt},tt.prototype._toArrayLikeLE=function(ct,dt){for(var mt=0,xt=0,At=0,Rt=0;At>8&255),mt>16&255),Rt===6?(mt>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt=0&&(ct[mt--]=St>>8&255),mt>=0&&(ct[mt--]=St>>16&255),Rt===6?(mt>=0&&(ct[mt--]=St>>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt>=0)for(ct[mt--]=xt;mt>=0;)ct[mt--]=0},Math.clz32?tt.prototype._countBits=function(ct){return 32-Math.clz32(ct)}:tt.prototype._countBits=function(ct){var dt=ct,mt=0;return dt>=4096&&(mt+=13,dt>>>=13),dt>=64&&(mt+=7,dt>>>=7),dt>=8&&(mt+=4,dt>>>=4),dt>=2&&(mt+=2,dt>>>=2),mt+dt},tt.prototype._zeroBits=function(ct){if(ct===0)return 26;var dt=ct,mt=0;return dt&8191||(mt+=13,dt>>>=13),dt&127||(mt+=7,dt>>>=7),dt&15||(mt+=4,dt>>>=4),dt&3||(mt+=2,dt>>>=2),dt&1||mt++,mt},tt.prototype.bitLength=function(){var ct=this.words[this.length-1],dt=this._countBits(ct);return(this.length-1)*26+dt};function Ct(vt){for(var ct=new Array(vt.bitLength()),dt=0;dt>>xt&1}return ct}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ct=0,dt=0;dtct.length?this.clone().ior(ct):ct.clone().ior(this)},tt.prototype.uor=function(ct){return this.length>ct.length?this.clone().iuor(ct):ct.clone().iuor(this)},tt.prototype.iuand=function(ct){var dt;this.length>ct.length?dt=ct:dt=this;for(var mt=0;mtct.length?this.clone().iand(ct):ct.clone().iand(this)},tt.prototype.uand=function(ct){return this.length>ct.length?this.clone().iuand(ct):ct.clone().iuand(this)},tt.prototype.iuxor=function(ct){var dt,mt;this.length>ct.length?(dt=this,mt=ct):(dt=ct,mt=this);for(var xt=0;xtct.length?this.clone().ixor(ct):ct.clone().ixor(this)},tt.prototype.uxor=function(ct){return this.length>ct.length?this.clone().iuxor(ct):ct.clone().iuxor(this)},tt.prototype.inotn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=Math.ceil(ct/26)|0,mt=ct%26;this._expand(dt),mt>0&&dt--;for(var xt=0;xt0&&(this.words[xt]=~this.words[xt]&67108863>>26-mt),this._strip()},tt.prototype.notn=function(ct){return this.clone().inotn(ct)},tt.prototype.setn=function(ct,dt){j(typeof ct=="number"&&ct>=0);var mt=ct/26|0,xt=ct%26;return this._expand(mt+1),dt?this.words[mt]=this.words[mt]|1<ct.length?(mt=this,xt=ct):(mt=ct,xt=this);for(var At=0,Rt=0;Rt>>26;for(;At!==0&&Rt>>26;if(this.length=mt.length,At!==0)this.words[this.length]=At,this.length++;else if(mt!==this)for(;Rtct.length?this.clone().iadd(ct):ct.clone().iadd(this)},tt.prototype.isub=function(ct){if(ct.negative!==0){ct.negative=0;var dt=this.iadd(ct);return ct.negative=1,dt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ct),this.negative=1,this._normSign();var mt=this.cmp(ct);if(mt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var xt,At;mt>0?(xt=this,At=ct):(xt=ct,At=this);for(var Rt=0,St=0;St>26,this.words[St]=dt&67108863;for(;Rt!==0&&St>26,this.words[St]=dt&67108863;if(Rt===0&&St>>26,tr=Tt&67108863,ir=Math.min(Et,ct.length-1),nr=Math.max(0,Et-vt.length+1);nr<=ir;nr++){var Zt=Et-nr|0;xt=vt.words[Zt]|0,At=ct.words[nr]|0,Rt=xt*At+tr,Nt+=Rt/67108864|0,tr=Rt&67108863}dt.words[Et]=tr|0,Tt=Nt|0}return Tt!==0?dt.words[Et]=Tt|0:dt.length--,dt._strip()}var $t=function(ct,dt,mt){var xt=ct.words,At=dt.words,Rt=mt.words,St=0,Tt,Et,Nt,tr=xt[0]|0,ir=tr&8191,nr=tr>>>13,Zt=xt[1]|0,Kt=Zt&8191,Qt=Zt>>>13,Ht=xt[2]|0,qt=Ht&8191,Jt=Ht>>>13,ur=xt[3]|0,xr=ur&8191,pr=ur>>>13,Cr=xt[4]|0,Mr=Cr&8191,lr=Cr>>>13,fr=xt[5]|0,_r=fr&8191,Rr=fr>>>13,kr=xt[6]|0,Ar=kr&8191,Pr=kr>>>13,Or=xt[7]|0,Br=Or&8191,or=Or>>>13,Yt=xt[8]|0,er=Yt&8191,Gt=Yt>>>13,Vt=xt[9]|0,Wt=Vt&8191,ar=Vt>>>13,yr=At[0]|0,Er=yr&8191,Sr=yr>>>13,Wr=At[1]|0,Hr=Wr&8191,Fr=Wr>>>13,pn=At[2]|0,Jr=pn&8191,Qr=pn>>>13,mn=At[3]|0,ln=mn&8191,qr=mn>>>13,En=At[4]|0,un=En&8191,Vr=En>>>13,hn=At[5]|0,fn=hn&8191,Kr=hn>>>13,Rn=At[6]|0,dn=Rn&8191,Gr=Rn>>>13,gn=At[7]|0,an=gn&8191,Zr=gn>>>13,An=At[8]|0,Sn=An&8191,nn=An>>>13,Pn=At[9]|0,yn=Pn&8191,_n=Pn>>>13;mt.negative=ct.negative^dt.negative,mt.length=19,Tt=Math.imul(ir,Er),Et=Math.imul(ir,Sr),Et=Et+Math.imul(nr,Er)|0,Nt=Math.imul(nr,Sr);var ds=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ds>>>26)|0,ds&=67108863,Tt=Math.imul(Kt,Er),Et=Math.imul(Kt,Sr),Et=Et+Math.imul(Qt,Er)|0,Nt=Math.imul(Qt,Sr),Tt=Tt+Math.imul(ir,Hr)|0,Et=Et+Math.imul(ir,Fr)|0,Et=Et+Math.imul(nr,Hr)|0,Nt=Nt+Math.imul(nr,Fr)|0;var fs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(fs>>>26)|0,fs&=67108863,Tt=Math.imul(qt,Er),Et=Math.imul(qt,Sr),Et=Et+Math.imul(Jt,Er)|0,Nt=Math.imul(Jt,Sr),Tt=Tt+Math.imul(Kt,Hr)|0,Et=Et+Math.imul(Kt,Fr)|0,Et=Et+Math.imul(Qt,Hr)|0,Nt=Nt+Math.imul(Qt,Fr)|0,Tt=Tt+Math.imul(ir,Jr)|0,Et=Et+Math.imul(ir,Qr)|0,Et=Et+Math.imul(nr,Jr)|0,Nt=Nt+Math.imul(nr,Qr)|0;var hs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(hs>>>26)|0,hs&=67108863,Tt=Math.imul(xr,Er),Et=Math.imul(xr,Sr),Et=Et+Math.imul(pr,Er)|0,Nt=Math.imul(pr,Sr),Tt=Tt+Math.imul(qt,Hr)|0,Et=Et+Math.imul(qt,Fr)|0,Et=Et+Math.imul(Jt,Hr)|0,Nt=Nt+Math.imul(Jt,Fr)|0,Tt=Tt+Math.imul(Kt,Jr)|0,Et=Et+Math.imul(Kt,Qr)|0,Et=Et+Math.imul(Qt,Jr)|0,Nt=Nt+Math.imul(Qt,Qr)|0,Tt=Tt+Math.imul(ir,ln)|0,Et=Et+Math.imul(ir,qr)|0,Et=Et+Math.imul(nr,ln)|0,Nt=Nt+Math.imul(nr,qr)|0;var ps=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ps>>>26)|0,ps&=67108863,Tt=Math.imul(Mr,Er),Et=Math.imul(Mr,Sr),Et=Et+Math.imul(lr,Er)|0,Nt=Math.imul(lr,Sr),Tt=Tt+Math.imul(xr,Hr)|0,Et=Et+Math.imul(xr,Fr)|0,Et=Et+Math.imul(pr,Hr)|0,Nt=Nt+Math.imul(pr,Fr)|0,Tt=Tt+Math.imul(qt,Jr)|0,Et=Et+Math.imul(qt,Qr)|0,Et=Et+Math.imul(Jt,Jr)|0,Nt=Nt+Math.imul(Jt,Qr)|0,Tt=Tt+Math.imul(Kt,ln)|0,Et=Et+Math.imul(Kt,qr)|0,Et=Et+Math.imul(Qt,ln)|0,Nt=Nt+Math.imul(Qt,qr)|0,Tt=Tt+Math.imul(ir,un)|0,Et=Et+Math.imul(ir,Vr)|0,Et=Et+Math.imul(nr,un)|0,Nt=Nt+Math.imul(nr,Vr)|0;var Vn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Tt=Math.imul(_r,Er),Et=Math.imul(_r,Sr),Et=Et+Math.imul(Rr,Er)|0,Nt=Math.imul(Rr,Sr),Tt=Tt+Math.imul(Mr,Hr)|0,Et=Et+Math.imul(Mr,Fr)|0,Et=Et+Math.imul(lr,Hr)|0,Nt=Nt+Math.imul(lr,Fr)|0,Tt=Tt+Math.imul(xr,Jr)|0,Et=Et+Math.imul(xr,Qr)|0,Et=Et+Math.imul(pr,Jr)|0,Nt=Nt+Math.imul(pr,Qr)|0,Tt=Tt+Math.imul(qt,ln)|0,Et=Et+Math.imul(qt,qr)|0,Et=Et+Math.imul(Jt,ln)|0,Nt=Nt+Math.imul(Jt,qr)|0,Tt=Tt+Math.imul(Kt,un)|0,Et=Et+Math.imul(Kt,Vr)|0,Et=Et+Math.imul(Qt,un)|0,Nt=Nt+Math.imul(Qt,Vr)|0,Tt=Tt+Math.imul(ir,fn)|0,Et=Et+Math.imul(ir,Kr)|0,Et=Et+Math.imul(nr,fn)|0,Nt=Nt+Math.imul(nr,Kr)|0;var ss=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ss>>>26)|0,ss&=67108863,Tt=Math.imul(Ar,Er),Et=Math.imul(Ar,Sr),Et=Et+Math.imul(Pr,Er)|0,Nt=Math.imul(Pr,Sr),Tt=Tt+Math.imul(_r,Hr)|0,Et=Et+Math.imul(_r,Fr)|0,Et=Et+Math.imul(Rr,Hr)|0,Nt=Nt+Math.imul(Rr,Fr)|0,Tt=Tt+Math.imul(Mr,Jr)|0,Et=Et+Math.imul(Mr,Qr)|0,Et=Et+Math.imul(lr,Jr)|0,Nt=Nt+Math.imul(lr,Qr)|0,Tt=Tt+Math.imul(xr,ln)|0,Et=Et+Math.imul(xr,qr)|0,Et=Et+Math.imul(pr,ln)|0,Nt=Nt+Math.imul(pr,qr)|0,Tt=Tt+Math.imul(qt,un)|0,Et=Et+Math.imul(qt,Vr)|0,Et=Et+Math.imul(Jt,un)|0,Nt=Nt+Math.imul(Jt,Vr)|0,Tt=Tt+Math.imul(Kt,fn)|0,Et=Et+Math.imul(Kt,Kr)|0,Et=Et+Math.imul(Qt,fn)|0,Nt=Nt+Math.imul(Qt,Kr)|0,Tt=Tt+Math.imul(ir,dn)|0,Et=Et+Math.imul(ir,Gr)|0,Et=Et+Math.imul(nr,dn)|0,Nt=Nt+Math.imul(nr,Gr)|0;var Jn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Tt=Math.imul(Br,Er),Et=Math.imul(Br,Sr),Et=Et+Math.imul(or,Er)|0,Nt=Math.imul(or,Sr),Tt=Tt+Math.imul(Ar,Hr)|0,Et=Et+Math.imul(Ar,Fr)|0,Et=Et+Math.imul(Pr,Hr)|0,Nt=Nt+Math.imul(Pr,Fr)|0,Tt=Tt+Math.imul(_r,Jr)|0,Et=Et+Math.imul(_r,Qr)|0,Et=Et+Math.imul(Rr,Jr)|0,Nt=Nt+Math.imul(Rr,Qr)|0,Tt=Tt+Math.imul(Mr,ln)|0,Et=Et+Math.imul(Mr,qr)|0,Et=Et+Math.imul(lr,ln)|0,Nt=Nt+Math.imul(lr,qr)|0,Tt=Tt+Math.imul(xr,un)|0,Et=Et+Math.imul(xr,Vr)|0,Et=Et+Math.imul(pr,un)|0,Nt=Nt+Math.imul(pr,Vr)|0,Tt=Tt+Math.imul(qt,fn)|0,Et=Et+Math.imul(qt,Kr)|0,Et=Et+Math.imul(Jt,fn)|0,Nt=Nt+Math.imul(Jt,Kr)|0,Tt=Tt+Math.imul(Kt,dn)|0,Et=Et+Math.imul(Kt,Gr)|0,Et=Et+Math.imul(Qt,dn)|0,Nt=Nt+Math.imul(Qt,Gr)|0,Tt=Tt+Math.imul(ir,an)|0,Et=Et+Math.imul(ir,Zr)|0,Et=Et+Math.imul(nr,an)|0,Nt=Nt+Math.imul(nr,Zr)|0;var Yn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Tt=Math.imul(er,Er),Et=Math.imul(er,Sr),Et=Et+Math.imul(Gt,Er)|0,Nt=Math.imul(Gt,Sr),Tt=Tt+Math.imul(Br,Hr)|0,Et=Et+Math.imul(Br,Fr)|0,Et=Et+Math.imul(or,Hr)|0,Nt=Nt+Math.imul(or,Fr)|0,Tt=Tt+Math.imul(Ar,Jr)|0,Et=Et+Math.imul(Ar,Qr)|0,Et=Et+Math.imul(Pr,Jr)|0,Nt=Nt+Math.imul(Pr,Qr)|0,Tt=Tt+Math.imul(_r,ln)|0,Et=Et+Math.imul(_r,qr)|0,Et=Et+Math.imul(Rr,ln)|0,Nt=Nt+Math.imul(Rr,qr)|0,Tt=Tt+Math.imul(Mr,un)|0,Et=Et+Math.imul(Mr,Vr)|0,Et=Et+Math.imul(lr,un)|0,Nt=Nt+Math.imul(lr,Vr)|0,Tt=Tt+Math.imul(xr,fn)|0,Et=Et+Math.imul(xr,Kr)|0,Et=Et+Math.imul(pr,fn)|0,Nt=Nt+Math.imul(pr,Kr)|0,Tt=Tt+Math.imul(qt,dn)|0,Et=Et+Math.imul(qt,Gr)|0,Et=Et+Math.imul(Jt,dn)|0,Nt=Nt+Math.imul(Jt,Gr)|0,Tt=Tt+Math.imul(Kt,an)|0,Et=Et+Math.imul(Kt,Zr)|0,Et=Et+Math.imul(Qt,an)|0,Nt=Nt+Math.imul(Qt,Zr)|0,Tt=Tt+Math.imul(ir,Sn)|0,Et=Et+Math.imul(ir,nn)|0,Et=Et+Math.imul(nr,Sn)|0,Nt=Nt+Math.imul(nr,nn)|0;var ms=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ms>>>26)|0,ms&=67108863,Tt=Math.imul(Wt,Er),Et=Math.imul(Wt,Sr),Et=Et+Math.imul(ar,Er)|0,Nt=Math.imul(ar,Sr),Tt=Tt+Math.imul(er,Hr)|0,Et=Et+Math.imul(er,Fr)|0,Et=Et+Math.imul(Gt,Hr)|0,Nt=Nt+Math.imul(Gt,Fr)|0,Tt=Tt+Math.imul(Br,Jr)|0,Et=Et+Math.imul(Br,Qr)|0,Et=Et+Math.imul(or,Jr)|0,Nt=Nt+Math.imul(or,Qr)|0,Tt=Tt+Math.imul(Ar,ln)|0,Et=Et+Math.imul(Ar,qr)|0,Et=Et+Math.imul(Pr,ln)|0,Nt=Nt+Math.imul(Pr,qr)|0,Tt=Tt+Math.imul(_r,un)|0,Et=Et+Math.imul(_r,Vr)|0,Et=Et+Math.imul(Rr,un)|0,Nt=Nt+Math.imul(Rr,Vr)|0,Tt=Tt+Math.imul(Mr,fn)|0,Et=Et+Math.imul(Mr,Kr)|0,Et=Et+Math.imul(lr,fn)|0,Nt=Nt+Math.imul(lr,Kr)|0,Tt=Tt+Math.imul(xr,dn)|0,Et=Et+Math.imul(xr,Gr)|0,Et=Et+Math.imul(pr,dn)|0,Nt=Nt+Math.imul(pr,Gr)|0,Tt=Tt+Math.imul(qt,an)|0,Et=Et+Math.imul(qt,Zr)|0,Et=Et+Math.imul(Jt,an)|0,Nt=Nt+Math.imul(Jt,Zr)|0,Tt=Tt+Math.imul(Kt,Sn)|0,Et=Et+Math.imul(Kt,nn)|0,Et=Et+Math.imul(Qt,Sn)|0,Nt=Nt+Math.imul(Qt,nn)|0,Tt=Tt+Math.imul(ir,yn)|0,Et=Et+Math.imul(ir,_n)|0,Et=Et+Math.imul(nr,yn)|0,Nt=Nt+Math.imul(nr,_n)|0;var Qn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Tt=Math.imul(Wt,Hr),Et=Math.imul(Wt,Fr),Et=Et+Math.imul(ar,Hr)|0,Nt=Math.imul(ar,Fr),Tt=Tt+Math.imul(er,Jr)|0,Et=Et+Math.imul(er,Qr)|0,Et=Et+Math.imul(Gt,Jr)|0,Nt=Nt+Math.imul(Gt,Qr)|0,Tt=Tt+Math.imul(Br,ln)|0,Et=Et+Math.imul(Br,qr)|0,Et=Et+Math.imul(or,ln)|0,Nt=Nt+Math.imul(or,qr)|0,Tt=Tt+Math.imul(Ar,un)|0,Et=Et+Math.imul(Ar,Vr)|0,Et=Et+Math.imul(Pr,un)|0,Nt=Nt+Math.imul(Pr,Vr)|0,Tt=Tt+Math.imul(_r,fn)|0,Et=Et+Math.imul(_r,Kr)|0,Et=Et+Math.imul(Rr,fn)|0,Nt=Nt+Math.imul(Rr,Kr)|0,Tt=Tt+Math.imul(Mr,dn)|0,Et=Et+Math.imul(Mr,Gr)|0,Et=Et+Math.imul(lr,dn)|0,Nt=Nt+Math.imul(lr,Gr)|0,Tt=Tt+Math.imul(xr,an)|0,Et=Et+Math.imul(xr,Zr)|0,Et=Et+Math.imul(pr,an)|0,Nt=Nt+Math.imul(pr,Zr)|0,Tt=Tt+Math.imul(qt,Sn)|0,Et=Et+Math.imul(qt,nn)|0,Et=Et+Math.imul(Jt,Sn)|0,Nt=Nt+Math.imul(Jt,nn)|0,Tt=Tt+Math.imul(Kt,yn)|0,Et=Et+Math.imul(Kt,_n)|0,Et=Et+Math.imul(Qt,yn)|0,Nt=Nt+Math.imul(Qt,_n)|0;var es=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(es>>>26)|0,es&=67108863,Tt=Math.imul(Wt,Jr),Et=Math.imul(Wt,Qr),Et=Et+Math.imul(ar,Jr)|0,Nt=Math.imul(ar,Qr),Tt=Tt+Math.imul(er,ln)|0,Et=Et+Math.imul(er,qr)|0,Et=Et+Math.imul(Gt,ln)|0,Nt=Nt+Math.imul(Gt,qr)|0,Tt=Tt+Math.imul(Br,un)|0,Et=Et+Math.imul(Br,Vr)|0,Et=Et+Math.imul(or,un)|0,Nt=Nt+Math.imul(or,Vr)|0,Tt=Tt+Math.imul(Ar,fn)|0,Et=Et+Math.imul(Ar,Kr)|0,Et=Et+Math.imul(Pr,fn)|0,Nt=Nt+Math.imul(Pr,Kr)|0,Tt=Tt+Math.imul(_r,dn)|0,Et=Et+Math.imul(_r,Gr)|0,Et=Et+Math.imul(Rr,dn)|0,Nt=Nt+Math.imul(Rr,Gr)|0,Tt=Tt+Math.imul(Mr,an)|0,Et=Et+Math.imul(Mr,Zr)|0,Et=Et+Math.imul(lr,an)|0,Nt=Nt+Math.imul(lr,Zr)|0,Tt=Tt+Math.imul(xr,Sn)|0,Et=Et+Math.imul(xr,nn)|0,Et=Et+Math.imul(pr,Sn)|0,Nt=Nt+Math.imul(pr,nn)|0,Tt=Tt+Math.imul(qt,yn)|0,Et=Et+Math.imul(qt,_n)|0,Et=Et+Math.imul(Jt,yn)|0,Nt=Nt+Math.imul(Jt,_n)|0;var ls=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ls>>>26)|0,ls&=67108863,Tt=Math.imul(Wt,ln),Et=Math.imul(Wt,qr),Et=Et+Math.imul(ar,ln)|0,Nt=Math.imul(ar,qr),Tt=Tt+Math.imul(er,un)|0,Et=Et+Math.imul(er,Vr)|0,Et=Et+Math.imul(Gt,un)|0,Nt=Nt+Math.imul(Gt,Vr)|0,Tt=Tt+Math.imul(Br,fn)|0,Et=Et+Math.imul(Br,Kr)|0,Et=Et+Math.imul(or,fn)|0,Nt=Nt+Math.imul(or,Kr)|0,Tt=Tt+Math.imul(Ar,dn)|0,Et=Et+Math.imul(Ar,Gr)|0,Et=Et+Math.imul(Pr,dn)|0,Nt=Nt+Math.imul(Pr,Gr)|0,Tt=Tt+Math.imul(_r,an)|0,Et=Et+Math.imul(_r,Zr)|0,Et=Et+Math.imul(Rr,an)|0,Nt=Nt+Math.imul(Rr,Zr)|0,Tt=Tt+Math.imul(Mr,Sn)|0,Et=Et+Math.imul(Mr,nn)|0,Et=Et+Math.imul(lr,Sn)|0,Nt=Nt+Math.imul(lr,nn)|0,Tt=Tt+Math.imul(xr,yn)|0,Et=Et+Math.imul(xr,_n)|0,Et=Et+Math.imul(pr,yn)|0,Nt=Nt+Math.imul(pr,_n)|0;var us=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(us>>>26)|0,us&=67108863,Tt=Math.imul(Wt,un),Et=Math.imul(Wt,Vr),Et=Et+Math.imul(ar,un)|0,Nt=Math.imul(ar,Vr),Tt=Tt+Math.imul(er,fn)|0,Et=Et+Math.imul(er,Kr)|0,Et=Et+Math.imul(Gt,fn)|0,Nt=Nt+Math.imul(Gt,Kr)|0,Tt=Tt+Math.imul(Br,dn)|0,Et=Et+Math.imul(Br,Gr)|0,Et=Et+Math.imul(or,dn)|0,Nt=Nt+Math.imul(or,Gr)|0,Tt=Tt+Math.imul(Ar,an)|0,Et=Et+Math.imul(Ar,Zr)|0,Et=Et+Math.imul(Pr,an)|0,Nt=Nt+Math.imul(Pr,Zr)|0,Tt=Tt+Math.imul(_r,Sn)|0,Et=Et+Math.imul(_r,nn)|0,Et=Et+Math.imul(Rr,Sn)|0,Nt=Nt+Math.imul(Rr,nn)|0,Tt=Tt+Math.imul(Mr,yn)|0,Et=Et+Math.imul(Mr,_n)|0,Et=Et+Math.imul(lr,yn)|0,Nt=Nt+Math.imul(lr,_n)|0;var Wn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Tt=Math.imul(Wt,fn),Et=Math.imul(Wt,Kr),Et=Et+Math.imul(ar,fn)|0,Nt=Math.imul(ar,Kr),Tt=Tt+Math.imul(er,dn)|0,Et=Et+Math.imul(er,Gr)|0,Et=Et+Math.imul(Gt,dn)|0,Nt=Nt+Math.imul(Gt,Gr)|0,Tt=Tt+Math.imul(Br,an)|0,Et=Et+Math.imul(Br,Zr)|0,Et=Et+Math.imul(or,an)|0,Nt=Nt+Math.imul(or,Zr)|0,Tt=Tt+Math.imul(Ar,Sn)|0,Et=Et+Math.imul(Ar,nn)|0,Et=Et+Math.imul(Pr,Sn)|0,Nt=Nt+Math.imul(Pr,nn)|0,Tt=Tt+Math.imul(_r,yn)|0,Et=Et+Math.imul(_r,_n)|0,Et=Et+Math.imul(Rr,yn)|0,Nt=Nt+Math.imul(Rr,_n)|0;var as=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(as>>>26)|0,as&=67108863,Tt=Math.imul(Wt,dn),Et=Math.imul(Wt,Gr),Et=Et+Math.imul(ar,dn)|0,Nt=Math.imul(ar,Gr),Tt=Tt+Math.imul(er,an)|0,Et=Et+Math.imul(er,Zr)|0,Et=Et+Math.imul(Gt,an)|0,Nt=Nt+Math.imul(Gt,Zr)|0,Tt=Tt+Math.imul(Br,Sn)|0,Et=Et+Math.imul(Br,nn)|0,Et=Et+Math.imul(or,Sn)|0,Nt=Nt+Math.imul(or,nn)|0,Tt=Tt+Math.imul(Ar,yn)|0,Et=Et+Math.imul(Ar,_n)|0,Et=Et+Math.imul(Pr,yn)|0,Nt=Nt+Math.imul(Pr,_n)|0;var gs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(gs>>>26)|0,gs&=67108863,Tt=Math.imul(Wt,an),Et=Math.imul(Wt,Zr),Et=Et+Math.imul(ar,an)|0,Nt=Math.imul(ar,Zr),Tt=Tt+Math.imul(er,Sn)|0,Et=Et+Math.imul(er,nn)|0,Et=Et+Math.imul(Gt,Sn)|0,Nt=Nt+Math.imul(Gt,nn)|0,Tt=Tt+Math.imul(Br,yn)|0,Et=Et+Math.imul(Br,_n)|0,Et=Et+Math.imul(or,yn)|0,Nt=Nt+Math.imul(or,_n)|0;var vs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(vs>>>26)|0,vs&=67108863,Tt=Math.imul(Wt,Sn),Et=Math.imul(Wt,nn),Et=Et+Math.imul(ar,Sn)|0,Nt=Math.imul(ar,nn),Tt=Tt+Math.imul(er,yn)|0,Et=Et+Math.imul(er,_n)|0,Et=Et+Math.imul(Gt,yn)|0,Nt=Nt+Math.imul(Gt,_n)|0;var Ts=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Tt=Math.imul(Wt,yn),Et=Math.imul(Wt,_n),Et=Et+Math.imul(ar,yn)|0,Nt=Math.imul(ar,_n);var $s=(St+Tt|0)+((Et&8191)<<13)|0;return St=(Nt+(Et>>>13)|0)+($s>>>26)|0,$s&=67108863,Rt[0]=ds,Rt[1]=fs,Rt[2]=hs,Rt[3]=ps,Rt[4]=Vn,Rt[5]=ss,Rt[6]=Jn,Rt[7]=Yn,Rt[8]=ms,Rt[9]=Qn,Rt[10]=es,Rt[11]=ls,Rt[12]=us,Rt[13]=Wn,Rt[14]=as,Rt[15]=gs,Rt[16]=vs,Rt[17]=Ts,Rt[18]=$s,St!==0&&(Rt[19]=St,mt.length++),mt};Math.imul||($t=Pt);function Mt(vt,ct,dt){dt.negative=ct.negative^vt.negative,dt.length=vt.length+ct.length;for(var mt=0,xt=0,At=0;At>>26)|0,xt+=Rt>>>26,Rt&=67108863}dt.words[At]=St,mt=Rt,Rt=xt}return mt!==0?dt.words[At]=mt:dt.length--,dt._strip()}function Bt(vt,ct,dt){return Mt(vt,ct,dt)}tt.prototype.mulTo=function(ct,dt){var mt,xt=this.length+ct.length;return this.length===10&&ct.length===10?mt=$t(this,ct,dt):xt<63?mt=Pt(this,ct,dt):xt<1024?mt=Mt(this,ct,dt):mt=Bt(this,ct,dt),mt},tt.prototype.mul=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),this.mulTo(ct,dt)},tt.prototype.mulf=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),Bt(this,ct,dt)},tt.prototype.imul=function(ct){return this.clone().mulTo(ct,this)},tt.prototype.imuln=function(ct){var dt=ct<0;dt&&(ct=-ct),j(typeof ct=="number"),j(ct<67108864);for(var mt=0,xt=0;xt>=26,mt+=At/67108864|0,mt+=Rt>>>26,this.words[xt]=Rt&67108863}return mt!==0&&(this.words[xt]=mt,this.length++),dt?this.ineg():this},tt.prototype.muln=function(ct){return this.clone().imuln(ct)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(ct){var dt=Ct(ct);if(dt.length===0)return new tt(1);for(var mt=this,xt=0;xt=0);var dt=ct%26,mt=(ct-dt)/26,xt=67108863>>>26-dt<<26-dt,At;if(dt!==0){var Rt=0;for(At=0;At>>26-dt}Rt&&(this.words[At]=Rt,this.length++)}if(mt!==0){for(At=this.length-1;At>=0;At--)this.words[At+mt]=this.words[At];for(At=0;At=0);var xt;dt?xt=(dt-dt%26)/26:xt=0;var At=ct%26,Rt=Math.min((ct-At)/26,this.length),St=67108863^67108863>>>At<Rt)for(this.length-=Rt,Et=0;Et=0&&(Nt!==0||Et>=xt);Et--){var tr=this.words[Et]|0;this.words[Et]=Nt<<26-At|tr>>>At,Nt=tr&St}return Tt&&Nt!==0&&(Tt.words[Tt.length++]=Nt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},tt.prototype.ishrn=function(ct,dt,mt){return j(this.negative===0),this.iushrn(ct,dt,mt)},tt.prototype.shln=function(ct){return this.clone().ishln(ct)},tt.prototype.ushln=function(ct){return this.clone().iushln(ct)},tt.prototype.shrn=function(ct){return this.clone().ishrn(ct)},tt.prototype.ushrn=function(ct){return this.clone().iushrn(ct)},tt.prototype.testn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=ct%26,mt=(ct-dt)/26,xt=1<=0);var dt=ct%26,mt=(ct-dt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=mt)return this;if(dt!==0&&mt++,this.length=Math.min(mt,this.length),dt!==0){var xt=67108863^67108863>>>dt<=67108864;dt++)this.words[dt]-=67108864,dt===this.length-1?this.words[dt+1]=1:this.words[dt+1]++;return this.length=Math.max(this.length,dt+1),this},tt.prototype.isubn=function(ct){if(j(typeof ct=="number"),j(ct<67108864),ct<0)return this.iaddn(-ct);if(this.negative!==0)return this.negative=0,this.iaddn(ct),this.negative=1,this;if(this.words[0]-=ct,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var dt=0;dt>26)-(Tt/67108864|0),this.words[At+mt]=Rt&67108863}for(;At>26,this.words[At+mt]=Rt&67108863;if(St===0)return this._strip();for(j(St===-1),St=0,At=0;At>26,this.words[At]=Rt&67108863;return this.negative=1,this._strip()},tt.prototype._wordDiv=function(ct,dt){var mt=this.length-ct.length,xt=this.clone(),At=ct,Rt=At.words[At.length-1]|0,St=this._countBits(Rt);mt=26-St,mt!==0&&(At=At.ushln(mt),xt.iushln(mt),Rt=At.words[At.length-1]|0);var Tt=xt.length-At.length,Et;if(dt!=="mod"){Et=new tt(null),Et.length=Tt+1,Et.words=new Array(Et.length);for(var Nt=0;Nt=0;ir--){var nr=(xt.words[At.length+ir]|0)*67108864+(xt.words[At.length+ir-1]|0);for(nr=Math.min(nr/Rt|0,67108863),xt._ishlnsubmul(At,nr,ir);xt.negative!==0;)nr--,xt.negative=0,xt._ishlnsubmul(At,1,ir),xt.isZero()||(xt.negative^=1);Et&&(Et.words[ir]=nr)}return Et&&Et._strip(),xt._strip(),dt!=="div"&&mt!==0&&xt.iushrn(mt),{div:Et||null,mod:xt}},tt.prototype.divmod=function(ct,dt,mt){if(j(!ct.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var xt,At,Rt;return this.negative!==0&&ct.negative===0?(Rt=this.neg().divmod(ct,dt),dt!=="mod"&&(xt=Rt.div.neg()),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.iadd(ct)),{div:xt,mod:At}):this.negative===0&&ct.negative!==0?(Rt=this.divmod(ct.neg(),dt),dt!=="mod"&&(xt=Rt.div.neg()),{div:xt,mod:Rt.mod}):this.negative&ct.negative?(Rt=this.neg().divmod(ct.neg(),dt),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.isub(ct)),{div:Rt.div,mod:At}):ct.length>this.length||this.cmp(ct)<0?{div:new tt(0),mod:this}:ct.length===1?dt==="div"?{div:this.divn(ct.words[0]),mod:null}:dt==="mod"?{div:null,mod:new tt(this.modrn(ct.words[0]))}:{div:this.divn(ct.words[0]),mod:new tt(this.modrn(ct.words[0]))}:this._wordDiv(ct,dt)},tt.prototype.div=function(ct){return this.divmod(ct,"div",!1).div},tt.prototype.mod=function(ct){return this.divmod(ct,"mod",!1).mod},tt.prototype.umod=function(ct){return this.divmod(ct,"mod",!0).mod},tt.prototype.divRound=function(ct){var dt=this.divmod(ct);if(dt.mod.isZero())return dt.div;var mt=dt.div.negative!==0?dt.mod.isub(ct):dt.mod,xt=ct.ushrn(1),At=ct.andln(1),Rt=mt.cmp(xt);return Rt<0||At===1&&Rt===0?dt.div:dt.div.negative!==0?dt.div.isubn(1):dt.div.iaddn(1)},tt.prototype.modrn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=(1<<26)%ct,xt=0,At=this.length-1;At>=0;At--)xt=(mt*xt+(this.words[At]|0))%ct;return dt?-xt:xt},tt.prototype.modn=function(ct){return this.modrn(ct)},tt.prototype.idivn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=0,xt=this.length-1;xt>=0;xt--){var At=(this.words[xt]|0)+mt*67108864;this.words[xt]=At/ct|0,mt=At%ct}return this._strip(),dt?this.ineg():this},tt.prototype.divn=function(ct){return this.clone().idivn(ct)},tt.prototype.egcd=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=new tt(0),St=new tt(1),Tt=0;dt.isEven()&&mt.isEven();)dt.iushrn(1),mt.iushrn(1),++Tt;for(var Et=mt.clone(),Nt=dt.clone();!dt.isZero();){for(var tr=0,ir=1;!(dt.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(dt.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(Et),At.isub(Nt)),xt.iushrn(1),At.iushrn(1);for(var nr=0,Zt=1;!(mt.words[0]&Zt)&&nr<26;++nr,Zt<<=1);if(nr>0)for(mt.iushrn(nr);nr-- >0;)(Rt.isOdd()||St.isOdd())&&(Rt.iadd(Et),St.isub(Nt)),Rt.iushrn(1),St.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(Rt),At.isub(St)):(mt.isub(dt),Rt.isub(xt),St.isub(At))}return{a:Rt,b:St,gcd:mt.iushln(Tt)}},tt.prototype._invmp=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=mt.clone();dt.cmpn(1)>0&&mt.cmpn(1)>0;){for(var St=0,Tt=1;!(dt.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(dt.iushrn(St);St-- >0;)xt.isOdd()&&xt.iadd(Rt),xt.iushrn(1);for(var Et=0,Nt=1;!(mt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(mt.iushrn(Et);Et-- >0;)At.isOdd()&&At.iadd(Rt),At.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(At)):(mt.isub(dt),At.isub(xt))}var tr;return dt.cmpn(1)===0?tr=xt:tr=At,tr.cmpn(0)<0&&tr.iadd(ct),tr},tt.prototype.gcd=function(ct){if(this.isZero())return ct.abs();if(ct.isZero())return this.abs();var dt=this.clone(),mt=ct.clone();dt.negative=0,mt.negative=0;for(var xt=0;dt.isEven()&&mt.isEven();xt++)dt.iushrn(1),mt.iushrn(1);do{for(;dt.isEven();)dt.iushrn(1);for(;mt.isEven();)mt.iushrn(1);var At=dt.cmp(mt);if(At<0){var Rt=dt;dt=mt,mt=Rt}else if(At===0||mt.cmpn(1)===0)break;dt.isub(mt)}while(!0);return mt.iushln(xt)},tt.prototype.invm=function(ct){return this.egcd(ct).a.umod(ct)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(ct){return this.words[0]&ct},tt.prototype.bincn=function(ct){j(typeof ct=="number");var dt=ct%26,mt=(ct-dt)/26,xt=1<>>26,St&=67108863,this.words[Rt]=St}return At!==0&&(this.words[Rt]=At,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(ct){var dt=ct<0;if(this.negative!==0&&!dt)return-1;if(this.negative===0&&dt)return 1;this._strip();var mt;if(this.length>1)mt=1;else{dt&&(ct=-ct),j(ct<=67108863,"Number is too big");var xt=this.words[0]|0;mt=xt===ct?0:xtct.length)return 1;if(this.length=0;mt--){var xt=this.words[mt]|0,At=ct.words[mt]|0;if(xt!==At){xtAt&&(dt=1);break}}return dt},tt.prototype.gtn=function(ct){return this.cmpn(ct)===1},tt.prototype.gt=function(ct){return this.cmp(ct)===1},tt.prototype.gten=function(ct){return this.cmpn(ct)>=0},tt.prototype.gte=function(ct){return this.cmp(ct)>=0},tt.prototype.ltn=function(ct){return this.cmpn(ct)===-1},tt.prototype.lt=function(ct){return this.cmp(ct)===-1},tt.prototype.lten=function(ct){return this.cmpn(ct)<=0},tt.prototype.lte=function(ct){return this.cmp(ct)<=0},tt.prototype.eqn=function(ct){return this.cmpn(ct)===0},tt.prototype.eq=function(ct){return this.cmp(ct)===0},tt.red=function(ct){return new jt(ct)},tt.prototype.toRed=function(ct){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),ct.convertTo(this)._forceRed(ct)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(ct){return this.red=ct,this},tt.prototype.forceRed=function(ct){return j(!this.red,"Already a number in reduction context"),this._forceRed(ct)},tt.prototype.redAdd=function(ct){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,ct)},tt.prototype.redIAdd=function(ct){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ct)},tt.prototype.redSub=function(ct){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,ct)},tt.prototype.redISub=function(ct){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,ct)},tt.prototype.redShl=function(ct){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,ct)},tt.prototype.redMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.mul(this,ct)},tt.prototype.redIMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.imul(this,ct)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(ct){return j(this.red&&!ct.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ct)};var Dt={k256:null,p224:null,p192:null,p25519:null};function zt(vt,ct){this.name=vt,this.p=new tt(ct,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}zt.prototype._tmp=function(){var ct=new tt(null);return ct.words=new Array(Math.ceil(this.n/13)),ct},zt.prototype.ireduce=function(ct){var dt=ct,mt;do this.split(dt,this.tmp),dt=this.imulK(dt),dt=dt.iadd(this.tmp),mt=dt.bitLength();while(mt>this.n);var xt=mt0?dt.isub(this.p):dt.strip!==void 0?dt.strip():dt._strip(),dt},zt.prototype.split=function(ct,dt){ct.iushrn(this.n,0,dt)},zt.prototype.imulK=function(ct){return ct.imul(this.k)};function Ot(){zt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Ot,zt),Ot.prototype.split=function(ct,dt){for(var mt=4194303,xt=Math.min(ct.length,9),At=0;At>>22,Rt=St}Rt>>>=22,ct.words[At-10]=Rt,Rt===0&&ct.length>10?ct.length-=10:ct.length-=9},Ot.prototype.imulK=function(ct){ct.words[ct.length]=0,ct.words[ct.length+1]=0,ct.length+=2;for(var dt=0,mt=0;mt>>=26,ct.words[mt]=At,dt=xt}return dt!==0&&(ct.words[ct.length++]=dt),ct},tt._prime=function(ct){if(Dt[ct])return Dt[ct];var dt;if(ct==="k256")dt=new Ot;else if(ct==="p224")dt=new It;else if(ct==="p192")dt=new Lt;else if(ct==="p25519")dt=new Ft;else throw new Error("Unknown prime "+ct);return Dt[ct]=dt,dt};function jt(vt){if(typeof vt=="string"){var ct=tt._prime(vt);this.m=ct.p,this.prime=ct}else j(vt.gtn(1),"modulus must be greater than 1"),this.m=vt,this.prime=null}jt.prototype._verify1=function(ct){j(ct.negative===0,"red works only with positives"),j(ct.red,"red works only with red numbers")},jt.prototype._verify2=function(ct,dt){j((ct.negative|dt.negative)===0,"red works only with positives"),j(ct.red&&ct.red===dt.red,"red works only with red numbers")},jt.prototype.imod=function(ct){return this.prime?this.prime.ireduce(ct)._forceRed(this):(ot(ct,ct.umod(this.m)._forceRed(this)),ct)},jt.prototype.neg=function(ct){return ct.isZero()?ct.clone():this.m.sub(ct)._forceRed(this)},jt.prototype.add=function(ct,dt){this._verify2(ct,dt);var mt=ct.add(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt._forceRed(this)},jt.prototype.iadd=function(ct,dt){this._verify2(ct,dt);var mt=ct.iadd(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt},jt.prototype.sub=function(ct,dt){this._verify2(ct,dt);var mt=ct.sub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt._forceRed(this)},jt.prototype.isub=function(ct,dt){this._verify2(ct,dt);var mt=ct.isub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt},jt.prototype.shl=function(ct,dt){return this._verify1(ct),this.imod(ct.ushln(dt))},jt.prototype.imul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.imul(dt))},jt.prototype.mul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.mul(dt))},jt.prototype.isqr=function(ct){return this.imul(ct,ct.clone())},jt.prototype.sqr=function(ct){return this.mul(ct,ct)},jt.prototype.sqrt=function(ct){if(ct.isZero())return ct.clone();var dt=this.m.andln(3);if(j(dt%2===1),dt===3){var mt=this.m.add(new tt(1)).iushrn(2);return this.pow(ct,mt)}for(var xt=this.m.subn(1),At=0;!xt.isZero()&&xt.andln(1)===0;)At++,xt.iushrn(1);j(!xt.isZero());var Rt=new tt(1).toRed(this),St=Rt.redNeg(),Tt=this.m.subn(1).iushrn(1),Et=this.m.bitLength();for(Et=new tt(2*Et*Et).toRed(this);this.pow(Et,Tt).cmp(St)!==0;)Et.redIAdd(St);for(var Nt=this.pow(Et,xt),tr=this.pow(ct,xt.addn(1).iushrn(1)),ir=this.pow(ct,xt),nr=At;ir.cmp(Rt)!==0;){for(var Zt=ir,Kt=0;Zt.cmp(Rt)!==0;Kt++)Zt=Zt.redSqr();j(Kt=0;At--){for(var Nt=dt.words[At],tr=Et-1;tr>=0;tr--){var ir=Nt>>tr&1;if(Rt!==xt[0]&&(Rt=this.sqr(Rt)),ir===0&&St===0){Tt=0;continue}St<<=1,St|=ir,Tt++,!(Tt!==mt&&(At!==0||tr!==0))&&(Rt=this.mul(Rt,xt[St]),Tt=0,St=0)}Et=26}return Rt},jt.prototype.convertTo=function(ct){var dt=ct.umod(this.m);return dt===ct?dt.clone():dt},jt.prototype.convertFrom=function(ct){var dt=ct.clone();return dt.red=null,dt},tt.mont=function(ct){return new bt(ct)};function bt(vt){jt.call(this,vt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(bt,jt),bt.prototype.convertTo=function(ct){return this.imod(ct.ushln(this.shift))},bt.prototype.convertFrom=function(ct){var dt=this.imod(ct.mul(this.rinv));return dt.red=null,dt},bt.prototype.imul=function(ct,dt){if(ct.isZero()||dt.isZero())return ct.words[0]=0,ct.length=1,ct;var mt=ct.imul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.mul=function(ct,dt){if(ct.isZero()||dt.isZero())return new tt(0)._forceRed(this);var mt=ct.mul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.invm=function(ct){var dt=this.imod(ct._invmp(this.m).mul(this.r2));return dt._forceRed(this)}})(a,commonjsGlobal)})(bn);var bnExports=bn.exports;const BN=getDefaultExportFromCjs$1(bnExports),JRPC_METHODS={GET_OR_SET_KEY:"GetPubKeyOrKeyAssign",COMMITMENT_REQUEST:"CommitmentRequest",IMPORT_SHARE:"ImportShare",GET_SHARE_OR_KEY_ASSIGN:"GetShareOrKeyAssign"},LEGACY_METADATA_HOST="https://metadata.tor.us",normalizeKeysResult=a=>{const _={keys:[],is_new_key:a.is_new_key};return a&&a.keys&&a.keys.length>0&&(_.keys=a.keys.map($=>({pub_key_X:$.pub_key_X,pub_key_Y:$.pub_key_Y,address:$.address}))),_},kCombinations=(a,_)=>{let $=a;if(typeof $=="number"&&($=Array.from({length:$},(tt,rt)=>rt)),_>$.length||_<=0)return[];if(_===$.length)return[$];if(_===1)return $.reduce((tt,rt)=>[...tt,[rt]],[]);const j=[];let et=[];for(let tt=0;tt<=$.length-_+1;tt+=1){et=kCombinations($.slice(tt+1),_-1);for(let rt=0;rt{const $={};for(let j=0;j=8?et+=_[tt].toUpperCase():et+=_[tt];return et}function generateAddressFromPrivKey(a,_){const j=a.keyFromPrivate(_.toString("hex",64),"hex").getPublic().encode("hex",!1).slice(2);log$1.info(j,"public key");const et=`0x${keccak256$1(Buffer$g.from(j,"hex")).slice(26)}`;return toChecksumAddress(et)}function generateAddressFromPubKey(a,_,$){const j=a.keyFromPublic({x:_.toString("hex",64),y:$.toString("hex",64)}),et=j.getPublic().encode("hex",!1).slice(2);log$1.info(j.getPublic().encode("hex",!1),"public key");const tt=`0x${keccak256$1(Buffer$g.from(et,"hex")).slice(26)}`;return toChecksumAddress(tt)}class Share{constructor(_,$){_defineProperty$4(this,"share",void 0),_defineProperty$4(this,"shareIndex",void 0),this.share=new BN($,"hex"),this.shareIndex=new BN(_,"hex")}static fromJSON(_){const{share:$,shareIndex:j}=_;return new Share(j,$)}toJSON(){return{share:this.share.toString("hex"),shareIndex:this.shareIndex.toString("hex")}}}class Polynomial{constructor(_,$){_defineProperty$4(this,"polynomial",void 0),_defineProperty$4(this,"ecCurve",void 0),this.polynomial=_,this.ecCurve=$}getThreshold(){return this.polynomial.length}polyEval(_){const $=new BN(_,"hex");let j=new BN($),et=new BN(0);et=et.add(this.polynomial[0]);for(let tt=1;tttypeof et=="number"?new BN(et):et instanceof BN?et:typeof et=="string"?new BN(et,"hex"):et),j={};for(let et=0;et<$.length;et+=1)j[$[et].toString("hex",64)]=new Share($[et],this.polyEval($[et]));return j}}function generatePrivateExcludingIndexes(a){const _=new BN(generatePrivate());return a.find($=>$.eq(_))?generatePrivateExcludingIndexes(a):_}function lagrangeInterpolation(a,_,$){if(_.length!==$.length)throw new Error("shares not equal to nodeIndex length in lagrangeInterpolation");let j=new BN(0);for(let et=0;et<_.length;et+=1){let tt=new BN(1),rt=new BN(1);for(let it=0;it<_.length;it+=1)if(et!==it){tt=tt.mul($[it].neg()),tt=tt.umod(a.curve.n);let st=$[et].sub($[it]);st=st.umod(a.curve.n),rt=rt.mul(st).umod(a.curve.n)}let nt=tt.mul(rt.invm(a.curve.n)).umod(a.curve.n);nt=nt.mul(_[et]).umod(a.curve.n),j=j.add(nt)}return j.umod(a.curve.n)}function generateRandomPolynomial(a,_,$,j){let et=$;$||(et=generatePrivateExcludingIndexes([new BN(0)]));{const tt=[et];for(let rt=0;rt<_;rt+=1){const nt=generatePrivateExcludingIndexes(tt);tt.push(nt)}return new Polynomial(tt,a)}}function ownKeys$2$1(a,_){var $=Object.keys(a);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(a);_&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(a,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$2$1(a){for(var _=1;_2&&arguments[2]!==void 0?arguments[2]:{};try{const j=await post(`${a}/get`,_,$,{useAPIKey:!0});return!j||!j.message?new BN(0):new BN(j.message,16)}catch(j){return log$1$1.error("get metadata error",j),new BN(0)}}async function getOrSetNonce(a,_,$,j,et,tt){let rt=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,nt;const it=rt?"getNonce":"getOrSetNonce";return tt?nt=generateMetadataParams(_,$,it,tt):nt={pub_key_X:j,pub_key_Y:et,set_data:{data:it}},post(`${a}/get_or_set_nonce`,nt,void 0,{useAPIKey:!0})}async function getNonce(a,_,$,j,et,tt){return getOrSetNonce(a,_,$,j,et,tt,!0)}const config={logRequestTracing:!1};function capitalizeFirstLetter(a){return a.charAt(0).toUpperCase()+a.slice(1)}class SomeError extends Error{constructor(_){let{errors:$,responses:j,predicate:et}=_;super("Unable to resolve enough promises."),_defineProperty$4(this,"errors",void 0),_defineProperty$4(this,"responses",void 0),_defineProperty$4(this,"predicate",void 0),this.errors=$,this.responses=j,this.predicate=et}get message(){return`${super.message}. ${this.errors.length} errors: ${this.errors.map(_=>_.message||_).join(", ")} and ${this.responses.length} responses: ${JSON.stringify(this.responses)}`}toString(){return this.message}}const Some=(a,_)=>new Promise(($,j)=>{let et=0;const tt={resolved:!1},rt=new Array(a.length).fill(void 0),nt=new Array(a.length).fill(void 0);let it;return a.forEach((st,ot)=>st.then(at=>{nt[ot]=at}).catch(at=>{rt[ot]=at}).finally(()=>{if(!tt.resolved)return _(nt.slice(0),tt).then(at=>{tt.resolved=!0,$(at)}).catch(at=>{it=at}).finally(()=>{if(et+=1,et===a.length){const ut=Object.values(nt.reduce((ht,yt)=>{if(yt){var wt;const{id:Ct,error:Pt}=yt;(Pt==null||(wt=Pt.data)===null||wt===void 0?void 0:wt.length)>0&&(Pt.data.startsWith("Error occurred while verifying params")?ht[Ct]=capitalizeFirstLetter(Pt.data):ht[Ct]=Pt.data)}return ht},{}));if(ut.length>0){const ht=ut.length>1?` +`+new Array(at+1).join($):"",ht=$?": ":":";if(ot&&ot.toJSON&&typeof ot.toJSON=="function"&&(ot=ot.toJSON()),ot=et.call(it,st,ot),ot!==void 0){if(typeof ot!="object"||ot===null)return json.stringify(ot);if(isArray(ot)){for(var Pt=[],yt=0;yt>_7n)*_0x71n)%_256n,_&_2n&&(et^=_1n<<(_1n<$>32?_u64_js_1.default.rotlBH(a,_,$):_u64_js_1.default.rotlSH(a,_,$),rotlL=(a,_,$)=>$>32?_u64_js_1.default.rotlBL(a,_,$):_u64_js_1.default.rotlSL(a,_,$);function keccakP(a,_=24){const $=new Uint32Array(10);for(let j=24-_;j<24;j++){for(let rt=0;rt<10;rt++)$[rt]=a[rt]^a[rt+10]^a[rt+20]^a[rt+30]^a[rt+40];for(let rt=0;rt<10;rt+=2){const nt=(rt+8)%10,it=(rt+2)%10,st=$[it],ot=$[it+1],at=rotlH(st,ot,1)^$[nt],ut=rotlL(st,ot,1)^$[nt+1];for(let ht=0;ht<50;ht+=10)a[rt+ht]^=at,a[rt+ht+1]^=ut}let et=a[2],tt=a[3];for(let rt=0;rt<24;rt++){const nt=SHA3_ROTL[rt],it=rotlH(et,tt,nt),st=rotlL(et,tt,nt),ot=SHA3_PI[rt];et=a[ot],tt=a[ot+1],a[ot]=it,a[ot+1]=st}for(let rt=0;rt<50;rt+=10){for(let nt=0;nt<10;nt++)$[nt]=a[rt+nt];for(let nt=0;nt<10;nt++)a[rt+nt]^=~$[(nt+2)%10]&$[(nt+4)%10]}a[0]^=SHA3_IOTA_H[j],a[1]^=SHA3_IOTA_L[j]}$.fill(0)}sha3.keccakP=keccakP;class Keccak extends utils_js_1.Hash{constructor(_,$,j,et=!1,tt=24){if(super(),this.blockLen=_,this.suffix=$,this.outputLen=j,this.enableXOF=et,this.rounds=tt,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,_assert_js_1.default.number(j),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,utils_js_1.u32)(this.state)}keccak(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(_){_assert_js_1.default.exists(this);const{blockLen:$,state:j}=this;_=(0,utils_js_1.toBytes)(_);const et=_.length;for(let tt=0;tt=j&&this.keccak();const rt=Math.min(j-this.posOut,tt-et);_.set($.subarray(this.posOut,this.posOut+rt),et),this.posOut+=rt,et+=rt}return _}xofInto(_){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(_)}xof(_){return _assert_js_1.default.number(_),this.xofInto(new Uint8Array(_))}digestInto(_){if(_assert_js_1.default.output(_,this),this.finished)throw new Error("digest() was already called");return this.writeInto(_),this.destroy(),_}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(_){const{blockLen:$,suffix:j,outputLen:et,rounds:tt,enableXOF:rt}=this;return _||(_=new Keccak($,j,et,rt,tt)),_.state32.set(this.state32),_.pos=this.pos,_.posOut=this.posOut,_.finished=this.finished,_.rounds=tt,_.suffix=j,_.outputLen=et,_.enableXOF=rt,_.destroyed=this.destroyed,_}}sha3.Keccak=Keccak;const gen=(a,_,$)=>(0,utils_js_1.wrapConstructor)(()=>new Keccak(_,a,$));sha3.sha3_224=gen(6,144,224/8);sha3.sha3_256=gen(6,136,256/8);sha3.sha3_384=gen(6,104,384/8);sha3.sha3_512=gen(6,72,512/8);sha3.keccak_224=gen(1,144,224/8);sha3.keccak_256=gen(1,136,256/8);sha3.keccak_384=gen(1,104,384/8);sha3.keccak_512=gen(1,72,512/8);const genShake=(a,_,$)=>(0,utils_js_1.wrapConstructorWithOpts)((j={})=>new Keccak(_,a,j.dkLen===void 0?$:j.dkLen,!0));sha3.shake128=genShake(31,168,128/8);sha3.shake256=genShake(31,136,256/8);var utils$2={exports:{}};utils$2.exports;(function(a,_){var $=commonjsGlobal&&commonjsGlobal.__importDefault||function(ut){return ut&&ut.__esModule?ut:{default:ut}};Object.defineProperty(_,"__esModule",{value:!0}),_.crypto=_.wrapHash=_.equalsBytes=_.hexToBytes=_.bytesToUtf8=_.utf8ToBytes=_.createView=_.concatBytes=_.toHex=_.bytesToHex=_.assertBytes=_.assertBool=void 0;const j=$(_assert),et=utils$e,tt=j.default.bool;_.assertBool=tt;const rt=j.default.bytes;_.assertBytes=rt;var nt=utils$e;Object.defineProperty(_,"bytesToHex",{enumerable:!0,get:function(){return nt.bytesToHex}}),Object.defineProperty(_,"toHex",{enumerable:!0,get:function(){return nt.bytesToHex}}),Object.defineProperty(_,"concatBytes",{enumerable:!0,get:function(){return nt.concatBytes}}),Object.defineProperty(_,"createView",{enumerable:!0,get:function(){return nt.createView}}),Object.defineProperty(_,"utf8ToBytes",{enumerable:!0,get:function(){return nt.utf8ToBytes}});function it(ut){if(!(ut instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof ut}`);return new TextDecoder().decode(ut)}_.bytesToUtf8=it;function st(ut){const ht=ut.startsWith("0x")?ut.substring(2):ut;return(0,et.hexToBytes)(ht)}_.hexToBytes=st;function ot(ut,ht){if(ut.length!==ht.length)return!1;for(let yt=0;yt(j.default.bytes(ht),ut(ht))}_.wrapHash=at,_.crypto=(()=>{const ut=typeof self=="object"&&"crypto"in self?self.crypto:void 0,ht=typeof commonjsRequire=="function"&&commonjsRequire.bind(a);return{node:ht&&!ut?ht("crypto"):void 0,web:ut}})()})(utils$2,utils$2.exports);var utilsExports=utils$2.exports;Object.defineProperty(keccak,"__esModule",{value:!0});keccak.keccak512=keccak.keccak384=keccak256$3=keccak.keccak256=keccak.keccak224=void 0;const sha3_1=sha3,utils_1=utilsExports;keccak.keccak224=(0,utils_1.wrapHash)(sha3_1.keccak_224);var keccak256$3=keccak.keccak256=(()=>{const a=(0,utils_1.wrapHash)(sha3_1.keccak_256);return a.create=sha3_1.keccak_256.create,a})();keccak.keccak384=(0,utils_1.wrapHash)(sha3_1.keccak_384);keccak.keccak512=(0,utils_1.wrapHash)(sha3_1.keccak_512);function keccak256$2(a){return Buffer$g.from(keccak256$3(a))}const ec$1=new elliptic$1.ec("secp256k1");function encParamsHexToBuf$2(a){return{iv:Buffer$g.from(a.iv,"hex"),ephemPublicKey:Buffer$g.from(a.ephemPublicKey,"hex"),ciphertext:Buffer$g.from(a.ciphertext,"hex"),mac:Buffer$g.from(a.mac,"hex")}}function encParamsBufToHex$2(a){return{iv:Buffer$g.from(a.iv).toString("hex"),ephemPublicKey:Buffer$g.from(a.ephemPublicKey).toString("hex"),ciphertext:Buffer$g.from(a.ciphertext).toString("hex"),mac:Buffer$g.from(a.mac).toString("hex")}}async function encryptData$1(a,_){const $=JSON.stringify(_),j=Buffer$g.from($,"utf-8"),et=await encrypt(getPublic(Buffer$g.from(a,"hex")),j),tt=encParamsBufToHex$2(et);return JSON.stringify(tt)}async function decryptData$1(a,_){const $=JSON.parse(_),j=encParamsHexToBuf$2($),et=ec$1.keyFromPrivate(a),rt=(await decrypt(Buffer$g.from(et.getPrivate().toString("hex",64),"hex"),j)).toString("utf-8");return JSON.parse(rt)}var microSeconds$1=microSeconds$5,KEY_PREFIX="pubkey.broadcastChannel-",type$1="server",SOCKET_CONN_INSTANCE=null,runningChannels=new Set;function storageKey(a){return KEY_PREFIX+a}function postMessage$1(a,_){return new Promise(function($,j){sleep().then(_asyncToGenerator(_regeneratorRuntime.mark(function et(){var tt,rt,nt,it;return _regeneratorRuntime.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return tt=storageKey(a.channelName),rt=keccak256$2(Buffer$g.from(tt,"utf8")),ot.next=4,encryptData$1(rt.toString("hex"),{token:randomToken(),time:new Date().getTime(),data:_,uuid:a.uuid});case 4:return nt=ot.sent,ot.t0=getPublic(rt).toString("hex"),ot.t1=nt,ot.next=9,sign(rt,keccak256$2(Buffer$g.from(nt,"utf8")));case 9:return ot.t2=ot.sent.toString("hex"),it={key:ot.t0,data:ot.t1,signature:ot.t2},a.timeout&&(it.timeout=a.timeout),ot.abrupt("return",fetch(a.serverUrl+"/channel/set",{method:"POST",body:JSON.stringify(it),headers:{"Content-Type":"application/json; charset=utf-8"}}).then($).catch(j));case 13:case"end":return ot.stop()}},et)})))})}function getSocketInstance(a){if(SOCKET_CONN_INSTANCE)return SOCKET_CONN_INSTANCE;var _=lookup(a,{transports:["websocket","polling"],withCredentials:!0,reconnectionDelayMax:1e4,reconnectionAttempts:10});return _.on("connect_error",function($){_.io.opts.transports=["polling","websocket"],log$4.error("connect error",$)}),_.on("connect",_asyncToGenerator(_regeneratorRuntime.mark(function $(){var j;return _regeneratorRuntime.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:j=_.io.engine,log$4.debug("initially connected to",j.transport.name),j.once("upgrade",function(){log$4.debug("upgraded",j.transport.name)}),j.once("close",function(rt){log$4.debug("connection closed",rt)});case 4:case"end":return tt.stop()}},$)}))),_.on("error",function($){log$4.error("socket errored",$),_.disconnect()}),SOCKET_CONN_INSTANCE=_,_}function setupSocketConnection(a,_,$){var j=getSocketInstance(a),et=storageKey(_),tt=keccak256$2(Buffer$g.from(et,"utf8")),rt=getPublic(tt).toString("hex");j.connected?j.emit("check_auth_status",rt):j.once("connect",function(){log$4.debug("connected with socket"),j.emit("check_auth_status",rt)});var nt=function(){j.once("connect",_asyncToGenerator(_regeneratorRuntime.mark(function at(){return _regeneratorRuntime.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:j.emit("check_auth_status",rt);case 1:case"end":return ht.stop()}},at)})))},it=function ot(){if(!j){document.removeEventListener("visibilitychange",ot);return}!j.connected&&document.visibilityState==="visible"&&nt()},st=function(){var ot=_asyncToGenerator(_regeneratorRuntime.mark(function at(ut){var ht;return _regeneratorRuntime.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.prev=0,wt.next=3,decryptData$1(tt.toString("hex"),ut);case 3:ht=wt.sent,log$4.info(ht),$(ht),wt.next=11;break;case 8:wt.prev=8,wt.t0=wt.catch(0),log$4.error(wt.t0);case 11:case"end":return wt.stop()}},at,null,[[0,8]])}));return function(ut){return ot.apply(this,arguments)}}();return j.on("disconnect",function(){log$4.debug("socket disconnected"),runningChannels.has(_)&&(log$4.error("socket disconnected unexpectedly, reconnecting socket"),nt())}),j.on(rt+"_success",st),typeof document<"u"&&document.addEventListener("visibilitychange",it),j}function create$1(a,_){_=fillOptionsWithDefaults(_);var $=randomToken(),j=new ObliviousSet(_.server.removeTimeout),et={channelName:a,uuid:$,eMIs:j,serverUrl:_.server.url};return _.server.timeout&&(et.timeout=_.server.timeout),setupSocketConnection(_.server.url,a,function(tt){et.messagesCallback&&tt.uuid!==et.uuid&&(!tt.token||et.eMIs.has(tt.token)||(et.eMIs.add(tt.token),et.messagesCallback(tt.data)))}),runningChannels.add(a),et}function close$1(a){runningChannels.delete(a.channelName)}function onMessage$1(a,_,$){a.messagesCallbackTime=$,a.messagesCallback=_}function canBeUsed$1(){return!0}function averageResponseTime$1(){var a=500;return a}const ServerMethod={create:create$1,close:close$1,onMessage:onMessage$1,postMessage:postMessage$1,canBeUsed:canBeUsed$1,type:type$1,averageResponseTime:averageResponseTime$1,microSeconds:microSeconds$1};var microSeconds=microSeconds$5,type="simulate",SIMULATE_CHANNELS=new Set;function create(a){var _={name:a,messagesCallback:null};return SIMULATE_CHANNELS.add(_),_}function close(a){SIMULATE_CHANNELS.delete(a)}function postMessage(a,_){return new Promise(function($){return setTimeout(function(){var j=Array.from(SIMULATE_CHANNELS);j.filter(function(et){return et.name===a.name}).filter(function(et){return et!==a}).filter(function(et){return!!et.messagesCallback}).forEach(function(et){return et.messagesCallback(_)}),$()},5)})}function onMessage(a,_){a.messagesCallback=_}function canBeUsed(){return!0}function averageResponseTime(){return 5}const SimulateMethod={create,close,onMessage,postMessage,canBeUsed,type,averageResponseTime,microSeconds};var METHODS=[NativeMethod,IndexeDbMethod,LocalstorageMethod,ServerMethod];function chooseMethod(a){var _=[].concat(a.methods,METHODS).filter(Boolean);if(a.type){if(a.type==="simulate")return SimulateMethod;var $=_.find(function(et){return et.type===a.type});if($)return $;throw new Error("method-type "+a.type+" not found")}a.webWorkerSupport||(_=_.filter(function(et){return et.type!=="idb"}));var j=_.find(function(et){return et.canBeUsed(a)});if(j)return j;throw new Error("No useable method found in "+JSON.stringify(METHODS.map(function(et){return et.type})))}var OPEN_BROADCAST_CHANNELS=new Set,lastId=0,BroadcastChannel$1=function a(_,$){this.id=lastId++,OPEN_BROADCAST_CHANNELS.add(this),this.name=_,ENFORCED_OPTIONS&&($=ENFORCED_OPTIONS),this.options=fillOptionsWithDefaults($),this.method=chooseMethod(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,_prepareChannel(this)};BroadcastChannel$1._pubkey=!0;var ENFORCED_OPTIONS;BroadcastChannel$1.prototype={postMessage:function a(_){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(_));return _post(this,"message",_)},postInternal:function a(_){return _post(this,"internal",_)},set onmessage(a){var _=this.method.microSeconds(),$={time:_,fn:a};_removeListenerObject(this,"message",this._onML),a&&typeof a=="function"?(this._onML=$,_addListenerObject(this,"message",$)):this._onML=null},addEventListener:function a(_,$){var j=this.method.microSeconds(),et={time:j,fn:$};_addListenerObject(this,_,et)},removeEventListener:function a(_,$){var j=this._addEL[_].find(function(et){return et.fn===$});_removeListenerObject(this,_,j)},close:function a(){var _=this;if(!this.closed){OPEN_BROADCAST_CHANNELS.delete(this),this.closed=!0;var $=this._prepP?this._prepP:PROMISE_RESOLVED_VOID;return this._onML=null,this._addEL.message=[],$.then(function(){return Promise.all(Array.from(_._uMP))}).then(function(){return Promise.all(_._befC.map(function(j){return j()}))}).then(function(){return _.method.close(_._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function _post(a,_,$){var j=a.method.microSeconds(),et={time:j,type:_,data:$},tt=a._prepP?a._prepP:PROMISE_RESOLVED_VOID;return tt.then(function(){var rt=a.method.postMessage(a._state,et);return a._uMP.add(rt),rt.catch().then(function(){return a._uMP.delete(rt)}),rt})}function _prepareChannel(a){var _=a.method.create(a.name,a.options);isPromise(_)?(a._prepP=_,_.then(function($){a._state=$})):a._state=_}function _hasMessageListeners(a){return a._addEL.message.length>0||a._addEL.internal.length>0}function _addListenerObject(a,_,$){a._addEL[_].push($),_startListening(a)}function _removeListenerObject(a,_,$){a._addEL[_]=a._addEL[_].filter(function(j){return j!==$}),_stopListening(a)}function _startListening(a){if(!a._iL&&_hasMessageListeners(a)){var _=function(et){a._addEL[et.type].forEach(function(tt){var rt=1e5,nt=tt.time-rt;(et.time>=nt||a.method.type==="server")&&tt.fn(et.data)})},$=a.method.microSeconds();a._prepP?a._prepP.then(function(){a._iL=!0,a.method.onMessage(a._state,_,$)}):(a._iL=!0,a.method.onMessage(a._state,_,$))}}function _stopListening(a){if(a._iL&&!_hasMessageListeners(a)){a._iL=!1;var _=a.method.microSeconds();a.method.onMessage(a._state,null,_)}}function e(a){this.message=a}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(a){var _=String(a).replace(/=+$/,"");if(_.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var $,j,et=0,tt=0,rt="";j=_.charAt(tt++);~j&&($=et%4?64*$+j:j,et++%4)?rt+=String.fromCharCode(255&$>>(-2*et&6)):0)j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(j);return rt};function t(a){var _=a.replace(/-/g,"+").replace(/_/g,"/");switch(_.length%4){case 0:break;case 2:_+="==";break;case 3:_+="=";break;default:throw"Illegal base64url string!"}try{return function($){return decodeURIComponent(r($).replace(/(.)/g,function(j,et){var tt=et.charCodeAt(0).toString(16).toUpperCase();return tt.length<2&&(tt="0"+tt),"%"+tt}))}(_)}catch{return r(_)}}function n(a){this.message=a}function o(a,_){if(typeof a!="string")throw new n("Invalid token specified");var $=(_=_||{}).header===!0?0:1;try{return JSON.parse(t(a.split(".")[$]))}catch(j){throw new n("Invalid token specified: "+j.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const TORUS_LEGACY_NETWORK={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},TORUS_SAPPHIRE_NETWORK={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_TESTNET:"sapphire_testnet",SAPPHIRE_MAINNET:"sapphire_mainnet"},MULTI_CLUSTER_NETWORKS=[TORUS_LEGACY_NETWORK.AQUA,TORUS_LEGACY_NETWORK.CELESTE,TORUS_LEGACY_NETWORK.CYAN],LEGACY_NETWORKS_ROUTE_MAP={[TORUS_LEGACY_NETWORK.AQUA]:{migrationCompleted:!1,networkIdentifier:"aqua",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.CELESTE]:{migrationCompleted:!1,networkIdentifier:"celeste",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.CYAN]:{migrationCompleted:!1,networkIdentifier:"cyan",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.MAINNET]:{migrationCompleted:!1,networkIdentifier:"mainnet",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.TESTNET]:{migrationCompleted:!0,networkIdentifier:"teal",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_TESTNET}},SIGNER_MAP={[TORUS_LEGACY_NETWORK.MAINNET]:"https://signer.tor.us",[TORUS_LEGACY_NETWORK.TESTNET]:"https://signer.tor.us",[TORUS_LEGACY_NETWORK.CYAN]:"https://signer-polygon.tor.us",[TORUS_LEGACY_NETWORK.AQUA]:"https://signer-polygon.tor.us",[TORUS_LEGACY_NETWORK.CELESTE]:"https://signer-polygon.tor.us"},SAPPHIRE_NETWORK_URLS={[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET]:["https://sapphire-dev-2-1.authnetwork.dev","https://sapphire-dev-2-2.authnetwork.dev","https://sapphire-dev-2-3.authnetwork.dev","https://sapphire-dev-2-4.authnetwork.dev","https://sapphire-dev-2-5.authnetwork.dev"],[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_TESTNET]:["https://sapphire-dev-2-1.authnetwork.dev","https://sapphire-dev-2-2.authnetwork.dev","https://sapphire-dev-2-3.authnetwork.dev","https://sapphire-dev-2-4.authnetwork.dev","https://sapphire-dev-2-5.authnetwork.dev"],[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET]:["https://sapphire-1.auth.network","https://sapphire-2.auth.network","https://sapphire-3.auth.network","https://sapphire-4.auth.network","https://sapphire-5.auth.network"]},getSSSEndpoints=(a,_)=>{const $=SAPPHIRE_NETWORK_URLS[a];if(!$||$.length===0)throw new Error(`Unsupported network: ${a}`);const j=LEGACY_NETWORKS_ROUTE_MAP[_];return $.map(et=>j&&j.networkIdentifier?`${et}/sss/${j.networkIdentifier}/jrpc`:`${et}/sss/jrpc`)},getRSSEndpoints=(a,_)=>{const $=SAPPHIRE_NETWORK_URLS[a];if(!$||$.length===0)throw new Error(`Unsupported network: ${a}`);const j=LEGACY_NETWORKS_ROUTE_MAP[_];return $.map(et=>j&&j.networkIdentifier?`${et}/rss/${j.networkIdentifier}`:`${et}/rss`)},getTSSEndpoints=(a,_)=>{const $=SAPPHIRE_NETWORK_URLS[a];if(!$||$.length===0)throw new Error(`Unsupported network: ${a}`);const j=LEGACY_NETWORKS_ROUTE_MAP[_];return $.map(et=>j&&j.networkIdentifier?`${et}/tss/${j.networkIdentifier}`:`${et}/tss`)},NODE_DETAILS_MAINNET={currentEpoch:"19",torusNodeEndpoints:["https://torus-19.torusnode.com/jrpc","https://torus-node.ens.domains/jrpc","https://torus-node.matic.network/jrpc","https://torus.zilliqa.network/jrpc","https://torus-mainnet.cosmos.network/jrpc","https://torus2.etherscan.com/jrpc","https://torus-node-v2.skalelabs.com/jrpc","https://torus-node.binancex.dev/jrpc","https://torusnode.ont.io/jrpc"],torusIndexes:[1,2,3,4,5,6,7,8,9],torusNodePub:[{X:"bbe83c64177c3775550e6ba6ac2bc059f6847d644c9e4894e42c60d7974d8c2b",Y:"82b49a7caf70def38cdad2740af45c1e4f969650105c5019a29bb18b21a9acb5"},{X:"c208cac4ef9a47d386097a9c915b28e9cb89213abee8d26a17198ee261201b0d",Y:"c7db2fe4631109f40833de9dc78d07e35706549ee48fa557b33e4e75e1047873"},{X:"ca1766bb426d4ca5582818a0c5439d560ea64f5baa060793ab29dd3d0ceacfe",Y:"d46c1d08c40e1306e1bca328c2287b8268166b11a1ba4b8442ea2ad0c5e32152"},{X:"c3934dd2f6f4b3d2e1e398cc501e143c1e1a381b52feb6d1525af34d16253768",Y:"71f5141a5035799099f5ea3e241e66946bc55dc857ac3bd7d6fcdb8dcd3eeeef"},{X:"22e66f1929631d00bf026227581597f085fd94fd952fc0dca9f0833398b5c064",Y:"6088b3912e10a1e9d50355a609c10db7d188f16a2e2fd7357e51bf4f6a74f0a1"},{X:"9dc9fa410f3ce9eb70df70cdea00a49f2c4cc7a31c08c0dab5f863ed35ff5139",Y:"627a291cb87a75c61da3f65d6818e1e05e360217179817ed27e8c73bca7ec122"},{X:"118b9fc07e97b096d899b9f6658463ce6a8caa64038e37fc969df4e6023dd8c6",Y:"baf9fa4e51770f4796ea165dd03a769b8606681a38954a0a92c4cbffd6609ce9"},{X:"8a6d8b925da15a273dec3d8f8395ec35cd6878f274b2b180e4e106999db64043",Y:"96f67f870c157743da0b1eb84d89bf30500d74dc84c11f501ee1cb013acc8c46"},{X:"39cecb62e863729f572f7dfc46c24867981bf04bb405fed0df39e33984bfade5",Y:"61c2364434012e68a2be2e9952805037e52629d7762fafc8e10e9fb5bad8f790"}]},SAPPHIRE_NODE_PUB_KEYS={[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET]:[{X:"e0925898fee0e9e941fdca7ee88deec99939ae9407e923535c4d4a3a3ff8b052",Y:"54b9fea924e3f3e40791f9987f4234ae4222412d65b74068032fa5d8b63375c1"},{X:"9124cf1e280aab32ba50dffd2de81cecabc13d82d2c1fe9de82f3b3523f9b637",Y:"fca939a1ceb42ce745c55b21ef094f543b457630cb63a94ef4f1afeee2b1f107"},{X:"555f681a63d469cc6c3a58a97e29ebd277425f0e6159708e7c7bf05f18f89476",Y:"606f2bcc0884fa5b64366fc3e8362e4939841b56acd60d5f4553cf36b891ac4e"},{X:"2b5f58d8e340f1ab922e89b3a69a68930edfe51364644a456335e179bc130128",Y:"4b4daa05939426e3cbe7d08f0e773d2bf36f64c00d04620ee6df2a7af4d2247"},{X:"3ecbb6a68afe72cf34ec6c0a12b5cb78a0d2e83ba402983b6adbc5f36219861a",Y:"dc1031c5cc8f0472bd521a62a64ebca9e163902c247bf05937daf4ae835091e4"}],[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_TESTNET]:[{X:"f74389b0a4c8d10d2a687ae575f69b20f412d41ab7f1fe6b358aa14871327247",Y:"54e3a73098ed9bced3ef8821736e9794f9264a1420c0c7ad15d2fa617ba35ef7"},{X:"bc38813a6873e526087918507c78fc3a61624670ee851ecfb4f3bef55d027b5a",Y:"ac4b21229f662a0aefdfdac21cf17c3261a392c74a8790db218b34e3e4c1d56a"},{X:"b56541684ea5fa40c8337b7688d502f0e9e092098962ad344c34e94f06d293fb",Y:"759a998cef79d389082f9a75061a29190eec0cac99b8c25ddcf6b58569dad55c"},{X:"7bcb058d4c6ffc6ba4bfdfd93d141af35a66338a62c7c27cdad2ae3f8289b767",Y:"336ab1935e41ed4719e162587f0ab55518db4207a1eb36cc72303f1b86689d2b"},{X:"bf12a136ef94399ea098f926f04e26a4ec4ac70f69cce274e8893704c4951773",Y:"bdd44828020f52ce510e026338216ada184a6867eb4e19fb4c2d495d4a7e15e4"}],[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET]:[{X:"f74389b0a4c8d10d2a687ae575f69b20f412d41ab7f1fe6b358aa14871327247",Y:"54e3a73098ed9bced3ef8821736e9794f9264a1420c0c7ad15d2fa617ba35ef7"},{X:"bc38813a6873e526087918507c78fc3a61624670ee851ecfb4f3bef55d027b5a",Y:"ac4b21229f662a0aefdfdac21cf17c3261a392c74a8790db218b34e3e4c1d56a"},{X:"b56541684ea5fa40c8337b7688d502f0e9e092098962ad344c34e94f06d293fb",Y:"759a998cef79d389082f9a75061a29190eec0cac99b8c25ddcf6b58569dad55c"},{X:"7bcb058d4c6ffc6ba4bfdfd93d141af35a66338a62c7c27cdad2ae3f8289b767",Y:"336ab1935e41ed4719e162587f0ab55518db4207a1eb36cc72303f1b86689d2b"},{X:"bf12a136ef94399ea098f926f04e26a4ec4ac70f69cce274e8893704c4951773",Y:"bdd44828020f52ce510e026338216ada184a6867eb4e19fb4c2d495d4a7e15e4"}]},getSapphireNodeDetails=(a,_)=>({currentEpoch:"1",torusNodeEndpoints:getSSSEndpoints(a,_),torusNodeSSSEndpoints:getSSSEndpoints(a,_),torusNodeRSSEndpoints:getRSSEndpoints(a,_),torusNodeTSSEndpoints:getTSSEndpoints(a,_),torusIndexes:[1,2,3,4,5],torusNodePub:SAPPHIRE_NODE_PUB_KEYS[a]});function fetchLocalConfig(a){if(Object.values(TORUS_SAPPHIRE_NETWORK).includes(a))return getSapphireNodeDetails(a);if(Object.values(TORUS_LEGACY_NETWORK).includes(a)){const _=LEGACY_NETWORKS_ROUTE_MAP[a];if(_.migrationCompleted)return getSapphireNodeDetails(_.networkMigratedTo,a);if(a===TORUS_LEGACY_NETWORK.MAINNET)return NODE_DETAILS_MAINNET}}const log$2=log$1$1.getLogger("fnd");class NodeDetailManager{constructor(){let{network:_=TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET,fndServerEndpoint:$,enableLogging:j=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_defineProperty$4(this,"fndServerEndpoint","https://fnd.tor.us/node-details"),_defineProperty$4(this,"_currentEpoch","1"),_defineProperty$4(this,"_torusNodeEndpoints",[]),_defineProperty$4(this,"_torusNodeRSSEndpoints",[]),_defineProperty$4(this,"_torusNodeSSSEndpoints",[]),_defineProperty$4(this,"_torusNodeTSSEndpoints",[]),_defineProperty$4(this,"_torusNodePub",[]),_defineProperty$4(this,"_torusIndexes",[]),_defineProperty$4(this,"updated",void 0),_defineProperty$4(this,"network",void 0),this.network=_,this.updated=!1,$&&(this.fndServerEndpoint=$),j?log$2.enableAll():log$2.disableAll()}get _nodeDetails(){return{currentEpoch:this._currentEpoch,torusNodeEndpoints:this._torusNodeEndpoints,torusNodeSSSEndpoints:this._torusNodeSSSEndpoints,torusNodeRSSEndpoints:this._torusNodeRSSEndpoints,torusNodeTSSEndpoints:this._torusNodeTSSEndpoints,torusNodePub:this._torusNodePub,torusIndexes:this._torusIndexes,updated:this.updated}}async getNodeDetails(_){let{verifier:$,verifierId:j}=_;try{if(this.updated&&!MULTI_CLUSTER_NETWORKS.includes(this.network))return this._nodeDetails;try{const{nodeDetails:tt}=await get(`${this.fndServerEndpoint}?network=${this.network}&verifier=${$}&verifierId=${j}`);return this.setNodeDetails(tt),this._nodeDetails}catch(tt){log$2.error("Failed to fetch node details from server, using local.",tt)}const et=fetchLocalConfig(this.network);if(!et)throw new Error("Failed to fetch node details");return this.setNodeDetails(et),this._nodeDetails}catch(et){throw log$2.error("Failed to fetch node details",et),et}}setNodeDetails(_){const{currentEpoch:$,torusNodeEndpoints:j,torusNodeSSSEndpoints:et,torusNodeRSSEndpoints:tt,torusNodeTSSEndpoints:rt,torusNodePub:nt,torusIndexes:it}=_;this._torusNodeEndpoints=j,this._torusNodeSSSEndpoints=et||[],this._torusNodeRSSEndpoints=tt||[],this._torusNodeTSSEndpoints=rt||[],this._torusNodePub=nt,this._torusIndexes=it,this._currentEpoch=$,this.updated=!0}}var bn={exports:{}};bn.exports;(function(a){(function(_,$){function j(vt,ct){if(!vt)throw new Error(ct||"Assertion failed")}function et(vt,ct){vt.super_=ct;var dt=function(){};dt.prototype=ct.prototype,vt.prototype=new dt,vt.prototype.constructor=vt}function tt(vt,ct,dt){if(tt.isBN(vt))return vt;this.negative=0,this.words=null,this.length=0,this.red=null,vt!==null&&((ct==="le"||ct==="be")&&(dt=ct,ct=10),this._init(vt||0,ct||10,dt||"be"))}typeof _=="object"?_.exports=tt:$.BN=tt,tt.BN=tt,tt.wordSize=26;var rt;try{typeof window<"u"&&typeof window.Buffer<"u"?rt=window.Buffer:rt=require$$0$4.Buffer}catch{}tt.isBN=function(ct){return ct instanceof tt?!0:ct!==null&&typeof ct=="object"&&ct.constructor.wordSize===tt.wordSize&&Array.isArray(ct.words)},tt.max=function(ct,dt){return ct.cmp(dt)>0?ct:dt},tt.min=function(ct,dt){return ct.cmp(dt)<0?ct:dt},tt.prototype._init=function(ct,dt,mt){if(typeof ct=="number")return this._initNumber(ct,dt,mt);if(typeof ct=="object")return this._initArray(ct,dt,mt);dt==="hex"&&(dt=16),j(dt===(dt|0)&&dt>=2&&dt<=36),ct=ct.toString().replace(/\s+/g,"");var xt=0;ct[0]==="-"&&(xt++,this.negative=1),xt=0;xt-=3)Rt=ct[xt]|ct[xt-1]<<8|ct[xt-2]<<16,this.words[At]|=Rt<>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);else if(mt==="le")for(xt=0,At=0;xt>>26-St&67108863,St+=24,St>=26&&(St-=26,At++);return this._strip()};function nt(vt,ct){var dt=vt.charCodeAt(ct);if(dt>=48&&dt<=57)return dt-48;if(dt>=65&&dt<=70)return dt-55;if(dt>=97&&dt<=102)return dt-87;j(!1,"Invalid character in "+vt)}function it(vt,ct,dt){var mt=nt(vt,dt);return dt-1>=ct&&(mt|=nt(vt,dt-1)<<4),mt}tt.prototype._parseHex=function(ct,dt,mt){this.length=Math.ceil((ct.length-dt)/6),this.words=new Array(this.length);for(var xt=0;xt=dt;xt-=2)St=it(ct,dt,xt)<=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8;else{var Tt=ct.length-dt;for(xt=Tt%2===0?dt+1:dt;xt=18?(At-=18,Rt+=1,this.words[Rt]|=St>>>26):At+=8}this._strip()};function st(vt,ct,dt,mt){for(var xt=0,At=0,Rt=Math.min(vt.length,dt),St=ct;St=49?At=Tt-49+10:Tt>=17?At=Tt-17+10:At=Tt,j(Tt>=0&&At1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},tt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=at}catch{tt.prototype.inspect=at}else tt.prototype.inspect=at;function at(){return(this.red?""}var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],yt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];tt.prototype.toString=function(ct,dt){ct=ct||10,dt=dt|0||1;var mt;if(ct===16||ct==="hex"){mt="";for(var xt=0,At=0,Rt=0;Rt>>24-xt&16777215,xt+=2,xt>=26&&(xt-=26,Rt--),At!==0||Rt!==this.length-1?mt=ut[6-Tt.length]+Tt+mt:mt=Tt+mt}for(At!==0&&(mt=At.toString(16)+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}if(ct===(ct|0)&&ct>=2&&ct<=36){var Et=ht[ct],Nt=yt[ct];mt="";var tr=this.clone();for(tr.negative=0;!tr.isZero();){var ir=tr.modrn(Nt).toString(ct);tr=tr.idivn(Nt),tr.isZero()?mt=ir+mt:mt=ut[Et-ir.length]+ir+mt}for(this.isZero()&&(mt="0"+mt);mt.length%dt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}j(!1,"Base should be between 2 and 36")},tt.prototype.toNumber=function(){var ct=this.words[0];return this.length===2?ct+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ct+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ct:ct},tt.prototype.toJSON=function(){return this.toString(16,2)},rt&&(tt.prototype.toBuffer=function(ct,dt){return this.toArrayLike(rt,ct,dt)}),tt.prototype.toArray=function(ct,dt){return this.toArrayLike(Array,ct,dt)};var wt=function(ct,dt){return ct.allocUnsafe?ct.allocUnsafe(dt):new ct(dt)};tt.prototype.toArrayLike=function(ct,dt,mt){this._strip();var xt=this.byteLength(),At=mt||Math.max(1,xt);j(xt<=At,"byte array longer than desired length"),j(At>0,"Requested array length <= 0");var Rt=wt(ct,At),St=dt==="le"?"LE":"BE";return this["_toArrayLike"+St](Rt,xt),Rt},tt.prototype._toArrayLikeLE=function(ct,dt){for(var mt=0,xt=0,At=0,Rt=0;At>8&255),mt>16&255),Rt===6?(mt>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt=0&&(ct[mt--]=St>>8&255),mt>=0&&(ct[mt--]=St>>16&255),Rt===6?(mt>=0&&(ct[mt--]=St>>24&255),xt=0,Rt=0):(xt=St>>>24,Rt+=2)}if(mt>=0)for(ct[mt--]=xt;mt>=0;)ct[mt--]=0},Math.clz32?tt.prototype._countBits=function(ct){return 32-Math.clz32(ct)}:tt.prototype._countBits=function(ct){var dt=ct,mt=0;return dt>=4096&&(mt+=13,dt>>>=13),dt>=64&&(mt+=7,dt>>>=7),dt>=8&&(mt+=4,dt>>>=4),dt>=2&&(mt+=2,dt>>>=2),mt+dt},tt.prototype._zeroBits=function(ct){if(ct===0)return 26;var dt=ct,mt=0;return dt&8191||(mt+=13,dt>>>=13),dt&127||(mt+=7,dt>>>=7),dt&15||(mt+=4,dt>>>=4),dt&3||(mt+=2,dt>>>=2),dt&1||mt++,mt},tt.prototype.bitLength=function(){var ct=this.words[this.length-1],dt=this._countBits(ct);return(this.length-1)*26+dt};function Ct(vt){for(var ct=new Array(vt.bitLength()),dt=0;dt>>xt&1}return ct}tt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ct=0,dt=0;dtct.length?this.clone().ior(ct):ct.clone().ior(this)},tt.prototype.uor=function(ct){return this.length>ct.length?this.clone().iuor(ct):ct.clone().iuor(this)},tt.prototype.iuand=function(ct){var dt;this.length>ct.length?dt=ct:dt=this;for(var mt=0;mtct.length?this.clone().iand(ct):ct.clone().iand(this)},tt.prototype.uand=function(ct){return this.length>ct.length?this.clone().iuand(ct):ct.clone().iuand(this)},tt.prototype.iuxor=function(ct){var dt,mt;this.length>ct.length?(dt=this,mt=ct):(dt=ct,mt=this);for(var xt=0;xtct.length?this.clone().ixor(ct):ct.clone().ixor(this)},tt.prototype.uxor=function(ct){return this.length>ct.length?this.clone().iuxor(ct):ct.clone().iuxor(this)},tt.prototype.inotn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=Math.ceil(ct/26)|0,mt=ct%26;this._expand(dt),mt>0&&dt--;for(var xt=0;xt0&&(this.words[xt]=~this.words[xt]&67108863>>26-mt),this._strip()},tt.prototype.notn=function(ct){return this.clone().inotn(ct)},tt.prototype.setn=function(ct,dt){j(typeof ct=="number"&&ct>=0);var mt=ct/26|0,xt=ct%26;return this._expand(mt+1),dt?this.words[mt]=this.words[mt]|1<ct.length?(mt=this,xt=ct):(mt=ct,xt=this);for(var At=0,Rt=0;Rt>>26;for(;At!==0&&Rt>>26;if(this.length=mt.length,At!==0)this.words[this.length]=At,this.length++;else if(mt!==this)for(;Rtct.length?this.clone().iadd(ct):ct.clone().iadd(this)},tt.prototype.isub=function(ct){if(ct.negative!==0){ct.negative=0;var dt=this.iadd(ct);return ct.negative=1,dt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ct),this.negative=1,this._normSign();var mt=this.cmp(ct);if(mt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var xt,At;mt>0?(xt=this,At=ct):(xt=ct,At=this);for(var Rt=0,St=0;St>26,this.words[St]=dt&67108863;for(;Rt!==0&&St>26,this.words[St]=dt&67108863;if(Rt===0&&St>>26,tr=Tt&67108863,ir=Math.min(Et,ct.length-1),nr=Math.max(0,Et-vt.length+1);nr<=ir;nr++){var Zt=Et-nr|0;xt=vt.words[Zt]|0,At=ct.words[nr]|0,Rt=xt*At+tr,Nt+=Rt/67108864|0,tr=Rt&67108863}dt.words[Et]=tr|0,Tt=Nt|0}return Tt!==0?dt.words[Et]=Tt|0:dt.length--,dt._strip()}var $t=function(ct,dt,mt){var xt=ct.words,At=dt.words,Rt=mt.words,St=0,Tt,Et,Nt,tr=xt[0]|0,ir=tr&8191,nr=tr>>>13,Zt=xt[1]|0,Kt=Zt&8191,Qt=Zt>>>13,Ht=xt[2]|0,qt=Ht&8191,Jt=Ht>>>13,ur=xt[3]|0,xr=ur&8191,pr=ur>>>13,Cr=xt[4]|0,Mr=Cr&8191,lr=Cr>>>13,fr=xt[5]|0,_r=fr&8191,Sr=fr>>>13,kr=xt[6]|0,Ar=kr&8191,$r=kr>>>13,Or=xt[7]|0,Br=Or&8191,or=Or>>>13,Yt=xt[8]|0,er=Yt&8191,Gt=Yt>>>13,Vt=xt[9]|0,Wt=Vt&8191,ar=Vt>>>13,yr=At[0]|0,Er=yr&8191,Rr=yr>>>13,Wr=At[1]|0,Hr=Wr&8191,Fr=Wr>>>13,pn=At[2]|0,Jr=pn&8191,Qr=pn>>>13,mn=At[3]|0,ln=mn&8191,qr=mn>>>13,En=At[4]|0,un=En&8191,Vr=En>>>13,hn=At[5]|0,fn=hn&8191,Kr=hn>>>13,Rn=At[6]|0,dn=Rn&8191,Gr=Rn>>>13,gn=At[7]|0,an=gn&8191,Zr=gn>>>13,An=At[8]|0,Sn=An&8191,nn=An>>>13,Pn=At[9]|0,yn=Pn&8191,_n=Pn>>>13;mt.negative=ct.negative^dt.negative,mt.length=19,Tt=Math.imul(ir,Er),Et=Math.imul(ir,Rr),Et=Et+Math.imul(nr,Er)|0,Nt=Math.imul(nr,Rr);var ds=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ds>>>26)|0,ds&=67108863,Tt=Math.imul(Kt,Er),Et=Math.imul(Kt,Rr),Et=Et+Math.imul(Qt,Er)|0,Nt=Math.imul(Qt,Rr),Tt=Tt+Math.imul(ir,Hr)|0,Et=Et+Math.imul(ir,Fr)|0,Et=Et+Math.imul(nr,Hr)|0,Nt=Nt+Math.imul(nr,Fr)|0;var fs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(fs>>>26)|0,fs&=67108863,Tt=Math.imul(qt,Er),Et=Math.imul(qt,Rr),Et=Et+Math.imul(Jt,Er)|0,Nt=Math.imul(Jt,Rr),Tt=Tt+Math.imul(Kt,Hr)|0,Et=Et+Math.imul(Kt,Fr)|0,Et=Et+Math.imul(Qt,Hr)|0,Nt=Nt+Math.imul(Qt,Fr)|0,Tt=Tt+Math.imul(ir,Jr)|0,Et=Et+Math.imul(ir,Qr)|0,Et=Et+Math.imul(nr,Jr)|0,Nt=Nt+Math.imul(nr,Qr)|0;var hs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(hs>>>26)|0,hs&=67108863,Tt=Math.imul(xr,Er),Et=Math.imul(xr,Rr),Et=Et+Math.imul(pr,Er)|0,Nt=Math.imul(pr,Rr),Tt=Tt+Math.imul(qt,Hr)|0,Et=Et+Math.imul(qt,Fr)|0,Et=Et+Math.imul(Jt,Hr)|0,Nt=Nt+Math.imul(Jt,Fr)|0,Tt=Tt+Math.imul(Kt,Jr)|0,Et=Et+Math.imul(Kt,Qr)|0,Et=Et+Math.imul(Qt,Jr)|0,Nt=Nt+Math.imul(Qt,Qr)|0,Tt=Tt+Math.imul(ir,ln)|0,Et=Et+Math.imul(ir,qr)|0,Et=Et+Math.imul(nr,ln)|0,Nt=Nt+Math.imul(nr,qr)|0;var ps=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ps>>>26)|0,ps&=67108863,Tt=Math.imul(Mr,Er),Et=Math.imul(Mr,Rr),Et=Et+Math.imul(lr,Er)|0,Nt=Math.imul(lr,Rr),Tt=Tt+Math.imul(xr,Hr)|0,Et=Et+Math.imul(xr,Fr)|0,Et=Et+Math.imul(pr,Hr)|0,Nt=Nt+Math.imul(pr,Fr)|0,Tt=Tt+Math.imul(qt,Jr)|0,Et=Et+Math.imul(qt,Qr)|0,Et=Et+Math.imul(Jt,Jr)|0,Nt=Nt+Math.imul(Jt,Qr)|0,Tt=Tt+Math.imul(Kt,ln)|0,Et=Et+Math.imul(Kt,qr)|0,Et=Et+Math.imul(Qt,ln)|0,Nt=Nt+Math.imul(Qt,qr)|0,Tt=Tt+Math.imul(ir,un)|0,Et=Et+Math.imul(ir,Vr)|0,Et=Et+Math.imul(nr,un)|0,Nt=Nt+Math.imul(nr,Vr)|0;var Vn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,Tt=Math.imul(_r,Er),Et=Math.imul(_r,Rr),Et=Et+Math.imul(Sr,Er)|0,Nt=Math.imul(Sr,Rr),Tt=Tt+Math.imul(Mr,Hr)|0,Et=Et+Math.imul(Mr,Fr)|0,Et=Et+Math.imul(lr,Hr)|0,Nt=Nt+Math.imul(lr,Fr)|0,Tt=Tt+Math.imul(xr,Jr)|0,Et=Et+Math.imul(xr,Qr)|0,Et=Et+Math.imul(pr,Jr)|0,Nt=Nt+Math.imul(pr,Qr)|0,Tt=Tt+Math.imul(qt,ln)|0,Et=Et+Math.imul(qt,qr)|0,Et=Et+Math.imul(Jt,ln)|0,Nt=Nt+Math.imul(Jt,qr)|0,Tt=Tt+Math.imul(Kt,un)|0,Et=Et+Math.imul(Kt,Vr)|0,Et=Et+Math.imul(Qt,un)|0,Nt=Nt+Math.imul(Qt,Vr)|0,Tt=Tt+Math.imul(ir,fn)|0,Et=Et+Math.imul(ir,Kr)|0,Et=Et+Math.imul(nr,fn)|0,Nt=Nt+Math.imul(nr,Kr)|0;var ss=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ss>>>26)|0,ss&=67108863,Tt=Math.imul(Ar,Er),Et=Math.imul(Ar,Rr),Et=Et+Math.imul($r,Er)|0,Nt=Math.imul($r,Rr),Tt=Tt+Math.imul(_r,Hr)|0,Et=Et+Math.imul(_r,Fr)|0,Et=Et+Math.imul(Sr,Hr)|0,Nt=Nt+Math.imul(Sr,Fr)|0,Tt=Tt+Math.imul(Mr,Jr)|0,Et=Et+Math.imul(Mr,Qr)|0,Et=Et+Math.imul(lr,Jr)|0,Nt=Nt+Math.imul(lr,Qr)|0,Tt=Tt+Math.imul(xr,ln)|0,Et=Et+Math.imul(xr,qr)|0,Et=Et+Math.imul(pr,ln)|0,Nt=Nt+Math.imul(pr,qr)|0,Tt=Tt+Math.imul(qt,un)|0,Et=Et+Math.imul(qt,Vr)|0,Et=Et+Math.imul(Jt,un)|0,Nt=Nt+Math.imul(Jt,Vr)|0,Tt=Tt+Math.imul(Kt,fn)|0,Et=Et+Math.imul(Kt,Kr)|0,Et=Et+Math.imul(Qt,fn)|0,Nt=Nt+Math.imul(Qt,Kr)|0,Tt=Tt+Math.imul(ir,dn)|0,Et=Et+Math.imul(ir,Gr)|0,Et=Et+Math.imul(nr,dn)|0,Nt=Nt+Math.imul(nr,Gr)|0;var Jn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Tt=Math.imul(Br,Er),Et=Math.imul(Br,Rr),Et=Et+Math.imul(or,Er)|0,Nt=Math.imul(or,Rr),Tt=Tt+Math.imul(Ar,Hr)|0,Et=Et+Math.imul(Ar,Fr)|0,Et=Et+Math.imul($r,Hr)|0,Nt=Nt+Math.imul($r,Fr)|0,Tt=Tt+Math.imul(_r,Jr)|0,Et=Et+Math.imul(_r,Qr)|0,Et=Et+Math.imul(Sr,Jr)|0,Nt=Nt+Math.imul(Sr,Qr)|0,Tt=Tt+Math.imul(Mr,ln)|0,Et=Et+Math.imul(Mr,qr)|0,Et=Et+Math.imul(lr,ln)|0,Nt=Nt+Math.imul(lr,qr)|0,Tt=Tt+Math.imul(xr,un)|0,Et=Et+Math.imul(xr,Vr)|0,Et=Et+Math.imul(pr,un)|0,Nt=Nt+Math.imul(pr,Vr)|0,Tt=Tt+Math.imul(qt,fn)|0,Et=Et+Math.imul(qt,Kr)|0,Et=Et+Math.imul(Jt,fn)|0,Nt=Nt+Math.imul(Jt,Kr)|0,Tt=Tt+Math.imul(Kt,dn)|0,Et=Et+Math.imul(Kt,Gr)|0,Et=Et+Math.imul(Qt,dn)|0,Nt=Nt+Math.imul(Qt,Gr)|0,Tt=Tt+Math.imul(ir,an)|0,Et=Et+Math.imul(ir,Zr)|0,Et=Et+Math.imul(nr,an)|0,Nt=Nt+Math.imul(nr,Zr)|0;var Yn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,Tt=Math.imul(er,Er),Et=Math.imul(er,Rr),Et=Et+Math.imul(Gt,Er)|0,Nt=Math.imul(Gt,Rr),Tt=Tt+Math.imul(Br,Hr)|0,Et=Et+Math.imul(Br,Fr)|0,Et=Et+Math.imul(or,Hr)|0,Nt=Nt+Math.imul(or,Fr)|0,Tt=Tt+Math.imul(Ar,Jr)|0,Et=Et+Math.imul(Ar,Qr)|0,Et=Et+Math.imul($r,Jr)|0,Nt=Nt+Math.imul($r,Qr)|0,Tt=Tt+Math.imul(_r,ln)|0,Et=Et+Math.imul(_r,qr)|0,Et=Et+Math.imul(Sr,ln)|0,Nt=Nt+Math.imul(Sr,qr)|0,Tt=Tt+Math.imul(Mr,un)|0,Et=Et+Math.imul(Mr,Vr)|0,Et=Et+Math.imul(lr,un)|0,Nt=Nt+Math.imul(lr,Vr)|0,Tt=Tt+Math.imul(xr,fn)|0,Et=Et+Math.imul(xr,Kr)|0,Et=Et+Math.imul(pr,fn)|0,Nt=Nt+Math.imul(pr,Kr)|0,Tt=Tt+Math.imul(qt,dn)|0,Et=Et+Math.imul(qt,Gr)|0,Et=Et+Math.imul(Jt,dn)|0,Nt=Nt+Math.imul(Jt,Gr)|0,Tt=Tt+Math.imul(Kt,an)|0,Et=Et+Math.imul(Kt,Zr)|0,Et=Et+Math.imul(Qt,an)|0,Nt=Nt+Math.imul(Qt,Zr)|0,Tt=Tt+Math.imul(ir,Sn)|0,Et=Et+Math.imul(ir,nn)|0,Et=Et+Math.imul(nr,Sn)|0,Nt=Nt+Math.imul(nr,nn)|0;var ms=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ms>>>26)|0,ms&=67108863,Tt=Math.imul(Wt,Er),Et=Math.imul(Wt,Rr),Et=Et+Math.imul(ar,Er)|0,Nt=Math.imul(ar,Rr),Tt=Tt+Math.imul(er,Hr)|0,Et=Et+Math.imul(er,Fr)|0,Et=Et+Math.imul(Gt,Hr)|0,Nt=Nt+Math.imul(Gt,Fr)|0,Tt=Tt+Math.imul(Br,Jr)|0,Et=Et+Math.imul(Br,Qr)|0,Et=Et+Math.imul(or,Jr)|0,Nt=Nt+Math.imul(or,Qr)|0,Tt=Tt+Math.imul(Ar,ln)|0,Et=Et+Math.imul(Ar,qr)|0,Et=Et+Math.imul($r,ln)|0,Nt=Nt+Math.imul($r,qr)|0,Tt=Tt+Math.imul(_r,un)|0,Et=Et+Math.imul(_r,Vr)|0,Et=Et+Math.imul(Sr,un)|0,Nt=Nt+Math.imul(Sr,Vr)|0,Tt=Tt+Math.imul(Mr,fn)|0,Et=Et+Math.imul(Mr,Kr)|0,Et=Et+Math.imul(lr,fn)|0,Nt=Nt+Math.imul(lr,Kr)|0,Tt=Tt+Math.imul(xr,dn)|0,Et=Et+Math.imul(xr,Gr)|0,Et=Et+Math.imul(pr,dn)|0,Nt=Nt+Math.imul(pr,Gr)|0,Tt=Tt+Math.imul(qt,an)|0,Et=Et+Math.imul(qt,Zr)|0,Et=Et+Math.imul(Jt,an)|0,Nt=Nt+Math.imul(Jt,Zr)|0,Tt=Tt+Math.imul(Kt,Sn)|0,Et=Et+Math.imul(Kt,nn)|0,Et=Et+Math.imul(Qt,Sn)|0,Nt=Nt+Math.imul(Qt,nn)|0,Tt=Tt+Math.imul(ir,yn)|0,Et=Et+Math.imul(ir,_n)|0,Et=Et+Math.imul(nr,yn)|0,Nt=Nt+Math.imul(nr,_n)|0;var Qn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Tt=Math.imul(Wt,Hr),Et=Math.imul(Wt,Fr),Et=Et+Math.imul(ar,Hr)|0,Nt=Math.imul(ar,Fr),Tt=Tt+Math.imul(er,Jr)|0,Et=Et+Math.imul(er,Qr)|0,Et=Et+Math.imul(Gt,Jr)|0,Nt=Nt+Math.imul(Gt,Qr)|0,Tt=Tt+Math.imul(Br,ln)|0,Et=Et+Math.imul(Br,qr)|0,Et=Et+Math.imul(or,ln)|0,Nt=Nt+Math.imul(or,qr)|0,Tt=Tt+Math.imul(Ar,un)|0,Et=Et+Math.imul(Ar,Vr)|0,Et=Et+Math.imul($r,un)|0,Nt=Nt+Math.imul($r,Vr)|0,Tt=Tt+Math.imul(_r,fn)|0,Et=Et+Math.imul(_r,Kr)|0,Et=Et+Math.imul(Sr,fn)|0,Nt=Nt+Math.imul(Sr,Kr)|0,Tt=Tt+Math.imul(Mr,dn)|0,Et=Et+Math.imul(Mr,Gr)|0,Et=Et+Math.imul(lr,dn)|0,Nt=Nt+Math.imul(lr,Gr)|0,Tt=Tt+Math.imul(xr,an)|0,Et=Et+Math.imul(xr,Zr)|0,Et=Et+Math.imul(pr,an)|0,Nt=Nt+Math.imul(pr,Zr)|0,Tt=Tt+Math.imul(qt,Sn)|0,Et=Et+Math.imul(qt,nn)|0,Et=Et+Math.imul(Jt,Sn)|0,Nt=Nt+Math.imul(Jt,nn)|0,Tt=Tt+Math.imul(Kt,yn)|0,Et=Et+Math.imul(Kt,_n)|0,Et=Et+Math.imul(Qt,yn)|0,Nt=Nt+Math.imul(Qt,_n)|0;var es=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(es>>>26)|0,es&=67108863,Tt=Math.imul(Wt,Jr),Et=Math.imul(Wt,Qr),Et=Et+Math.imul(ar,Jr)|0,Nt=Math.imul(ar,Qr),Tt=Tt+Math.imul(er,ln)|0,Et=Et+Math.imul(er,qr)|0,Et=Et+Math.imul(Gt,ln)|0,Nt=Nt+Math.imul(Gt,qr)|0,Tt=Tt+Math.imul(Br,un)|0,Et=Et+Math.imul(Br,Vr)|0,Et=Et+Math.imul(or,un)|0,Nt=Nt+Math.imul(or,Vr)|0,Tt=Tt+Math.imul(Ar,fn)|0,Et=Et+Math.imul(Ar,Kr)|0,Et=Et+Math.imul($r,fn)|0,Nt=Nt+Math.imul($r,Kr)|0,Tt=Tt+Math.imul(_r,dn)|0,Et=Et+Math.imul(_r,Gr)|0,Et=Et+Math.imul(Sr,dn)|0,Nt=Nt+Math.imul(Sr,Gr)|0,Tt=Tt+Math.imul(Mr,an)|0,Et=Et+Math.imul(Mr,Zr)|0,Et=Et+Math.imul(lr,an)|0,Nt=Nt+Math.imul(lr,Zr)|0,Tt=Tt+Math.imul(xr,Sn)|0,Et=Et+Math.imul(xr,nn)|0,Et=Et+Math.imul(pr,Sn)|0,Nt=Nt+Math.imul(pr,nn)|0,Tt=Tt+Math.imul(qt,yn)|0,Et=Et+Math.imul(qt,_n)|0,Et=Et+Math.imul(Jt,yn)|0,Nt=Nt+Math.imul(Jt,_n)|0;var ls=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(ls>>>26)|0,ls&=67108863,Tt=Math.imul(Wt,ln),Et=Math.imul(Wt,qr),Et=Et+Math.imul(ar,ln)|0,Nt=Math.imul(ar,qr),Tt=Tt+Math.imul(er,un)|0,Et=Et+Math.imul(er,Vr)|0,Et=Et+Math.imul(Gt,un)|0,Nt=Nt+Math.imul(Gt,Vr)|0,Tt=Tt+Math.imul(Br,fn)|0,Et=Et+Math.imul(Br,Kr)|0,Et=Et+Math.imul(or,fn)|0,Nt=Nt+Math.imul(or,Kr)|0,Tt=Tt+Math.imul(Ar,dn)|0,Et=Et+Math.imul(Ar,Gr)|0,Et=Et+Math.imul($r,dn)|0,Nt=Nt+Math.imul($r,Gr)|0,Tt=Tt+Math.imul(_r,an)|0,Et=Et+Math.imul(_r,Zr)|0,Et=Et+Math.imul(Sr,an)|0,Nt=Nt+Math.imul(Sr,Zr)|0,Tt=Tt+Math.imul(Mr,Sn)|0,Et=Et+Math.imul(Mr,nn)|0,Et=Et+Math.imul(lr,Sn)|0,Nt=Nt+Math.imul(lr,nn)|0,Tt=Tt+Math.imul(xr,yn)|0,Et=Et+Math.imul(xr,_n)|0,Et=Et+Math.imul(pr,yn)|0,Nt=Nt+Math.imul(pr,_n)|0;var us=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(us>>>26)|0,us&=67108863,Tt=Math.imul(Wt,un),Et=Math.imul(Wt,Vr),Et=Et+Math.imul(ar,un)|0,Nt=Math.imul(ar,Vr),Tt=Tt+Math.imul(er,fn)|0,Et=Et+Math.imul(er,Kr)|0,Et=Et+Math.imul(Gt,fn)|0,Nt=Nt+Math.imul(Gt,Kr)|0,Tt=Tt+Math.imul(Br,dn)|0,Et=Et+Math.imul(Br,Gr)|0,Et=Et+Math.imul(or,dn)|0,Nt=Nt+Math.imul(or,Gr)|0,Tt=Tt+Math.imul(Ar,an)|0,Et=Et+Math.imul(Ar,Zr)|0,Et=Et+Math.imul($r,an)|0,Nt=Nt+Math.imul($r,Zr)|0,Tt=Tt+Math.imul(_r,Sn)|0,Et=Et+Math.imul(_r,nn)|0,Et=Et+Math.imul(Sr,Sn)|0,Nt=Nt+Math.imul(Sr,nn)|0,Tt=Tt+Math.imul(Mr,yn)|0,Et=Et+Math.imul(Mr,_n)|0,Et=Et+Math.imul(lr,yn)|0,Nt=Nt+Math.imul(lr,_n)|0;var Wn=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,Tt=Math.imul(Wt,fn),Et=Math.imul(Wt,Kr),Et=Et+Math.imul(ar,fn)|0,Nt=Math.imul(ar,Kr),Tt=Tt+Math.imul(er,dn)|0,Et=Et+Math.imul(er,Gr)|0,Et=Et+Math.imul(Gt,dn)|0,Nt=Nt+Math.imul(Gt,Gr)|0,Tt=Tt+Math.imul(Br,an)|0,Et=Et+Math.imul(Br,Zr)|0,Et=Et+Math.imul(or,an)|0,Nt=Nt+Math.imul(or,Zr)|0,Tt=Tt+Math.imul(Ar,Sn)|0,Et=Et+Math.imul(Ar,nn)|0,Et=Et+Math.imul($r,Sn)|0,Nt=Nt+Math.imul($r,nn)|0,Tt=Tt+Math.imul(_r,yn)|0,Et=Et+Math.imul(_r,_n)|0,Et=Et+Math.imul(Sr,yn)|0,Nt=Nt+Math.imul(Sr,_n)|0;var as=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(as>>>26)|0,as&=67108863,Tt=Math.imul(Wt,dn),Et=Math.imul(Wt,Gr),Et=Et+Math.imul(ar,dn)|0,Nt=Math.imul(ar,Gr),Tt=Tt+Math.imul(er,an)|0,Et=Et+Math.imul(er,Zr)|0,Et=Et+Math.imul(Gt,an)|0,Nt=Nt+Math.imul(Gt,Zr)|0,Tt=Tt+Math.imul(Br,Sn)|0,Et=Et+Math.imul(Br,nn)|0,Et=Et+Math.imul(or,Sn)|0,Nt=Nt+Math.imul(or,nn)|0,Tt=Tt+Math.imul(Ar,yn)|0,Et=Et+Math.imul(Ar,_n)|0,Et=Et+Math.imul($r,yn)|0,Nt=Nt+Math.imul($r,_n)|0;var gs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(gs>>>26)|0,gs&=67108863,Tt=Math.imul(Wt,an),Et=Math.imul(Wt,Zr),Et=Et+Math.imul(ar,an)|0,Nt=Math.imul(ar,Zr),Tt=Tt+Math.imul(er,Sn)|0,Et=Et+Math.imul(er,nn)|0,Et=Et+Math.imul(Gt,Sn)|0,Nt=Nt+Math.imul(Gt,nn)|0,Tt=Tt+Math.imul(Br,yn)|0,Et=Et+Math.imul(Br,_n)|0,Et=Et+Math.imul(or,yn)|0,Nt=Nt+Math.imul(or,_n)|0;var vs=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(vs>>>26)|0,vs&=67108863,Tt=Math.imul(Wt,Sn),Et=Math.imul(Wt,nn),Et=Et+Math.imul(ar,Sn)|0,Nt=Math.imul(ar,nn),Tt=Tt+Math.imul(er,yn)|0,Et=Et+Math.imul(er,_n)|0,Et=Et+Math.imul(Gt,yn)|0,Nt=Nt+Math.imul(Gt,_n)|0;var Ts=(St+Tt|0)+((Et&8191)<<13)|0;St=(Nt+(Et>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Tt=Math.imul(Wt,yn),Et=Math.imul(Wt,_n),Et=Et+Math.imul(ar,yn)|0,Nt=Math.imul(ar,_n);var $s=(St+Tt|0)+((Et&8191)<<13)|0;return St=(Nt+(Et>>>13)|0)+($s>>>26)|0,$s&=67108863,Rt[0]=ds,Rt[1]=fs,Rt[2]=hs,Rt[3]=ps,Rt[4]=Vn,Rt[5]=ss,Rt[6]=Jn,Rt[7]=Yn,Rt[8]=ms,Rt[9]=Qn,Rt[10]=es,Rt[11]=ls,Rt[12]=us,Rt[13]=Wn,Rt[14]=as,Rt[15]=gs,Rt[16]=vs,Rt[17]=Ts,Rt[18]=$s,St!==0&&(Rt[19]=St,mt.length++),mt};Math.imul||($t=Pt);function Mt(vt,ct,dt){dt.negative=ct.negative^vt.negative,dt.length=vt.length+ct.length;for(var mt=0,xt=0,At=0;At>>26)|0,xt+=Rt>>>26,Rt&=67108863}dt.words[At]=St,mt=Rt,Rt=xt}return mt!==0?dt.words[At]=mt:dt.length--,dt._strip()}function Bt(vt,ct,dt){return Mt(vt,ct,dt)}tt.prototype.mulTo=function(ct,dt){var mt,xt=this.length+ct.length;return this.length===10&&ct.length===10?mt=$t(this,ct,dt):xt<63?mt=Pt(this,ct,dt):xt<1024?mt=Mt(this,ct,dt):mt=Bt(this,ct,dt),mt},tt.prototype.mul=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),this.mulTo(ct,dt)},tt.prototype.mulf=function(ct){var dt=new tt(null);return dt.words=new Array(this.length+ct.length),Bt(this,ct,dt)},tt.prototype.imul=function(ct){return this.clone().mulTo(ct,this)},tt.prototype.imuln=function(ct){var dt=ct<0;dt&&(ct=-ct),j(typeof ct=="number"),j(ct<67108864);for(var mt=0,xt=0;xt>=26,mt+=At/67108864|0,mt+=Rt>>>26,this.words[xt]=Rt&67108863}return mt!==0&&(this.words[xt]=mt,this.length++),dt?this.ineg():this},tt.prototype.muln=function(ct){return this.clone().imuln(ct)},tt.prototype.sqr=function(){return this.mul(this)},tt.prototype.isqr=function(){return this.imul(this.clone())},tt.prototype.pow=function(ct){var dt=Ct(ct);if(dt.length===0)return new tt(1);for(var mt=this,xt=0;xt=0);var dt=ct%26,mt=(ct-dt)/26,xt=67108863>>>26-dt<<26-dt,At;if(dt!==0){var Rt=0;for(At=0;At>>26-dt}Rt&&(this.words[At]=Rt,this.length++)}if(mt!==0){for(At=this.length-1;At>=0;At--)this.words[At+mt]=this.words[At];for(At=0;At=0);var xt;dt?xt=(dt-dt%26)/26:xt=0;var At=ct%26,Rt=Math.min((ct-At)/26,this.length),St=67108863^67108863>>>At<Rt)for(this.length-=Rt,Et=0;Et=0&&(Nt!==0||Et>=xt);Et--){var tr=this.words[Et]|0;this.words[Et]=Nt<<26-At|tr>>>At,Nt=tr&St}return Tt&&Nt!==0&&(Tt.words[Tt.length++]=Nt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},tt.prototype.ishrn=function(ct,dt,mt){return j(this.negative===0),this.iushrn(ct,dt,mt)},tt.prototype.shln=function(ct){return this.clone().ishln(ct)},tt.prototype.ushln=function(ct){return this.clone().iushln(ct)},tt.prototype.shrn=function(ct){return this.clone().ishrn(ct)},tt.prototype.ushrn=function(ct){return this.clone().iushrn(ct)},tt.prototype.testn=function(ct){j(typeof ct=="number"&&ct>=0);var dt=ct%26,mt=(ct-dt)/26,xt=1<=0);var dt=ct%26,mt=(ct-dt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=mt)return this;if(dt!==0&&mt++,this.length=Math.min(mt,this.length),dt!==0){var xt=67108863^67108863>>>dt<=67108864;dt++)this.words[dt]-=67108864,dt===this.length-1?this.words[dt+1]=1:this.words[dt+1]++;return this.length=Math.max(this.length,dt+1),this},tt.prototype.isubn=function(ct){if(j(typeof ct=="number"),j(ct<67108864),ct<0)return this.iaddn(-ct);if(this.negative!==0)return this.negative=0,this.iaddn(ct),this.negative=1,this;if(this.words[0]-=ct,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var dt=0;dt>26)-(Tt/67108864|0),this.words[At+mt]=Rt&67108863}for(;At>26,this.words[At+mt]=Rt&67108863;if(St===0)return this._strip();for(j(St===-1),St=0,At=0;At>26,this.words[At]=Rt&67108863;return this.negative=1,this._strip()},tt.prototype._wordDiv=function(ct,dt){var mt=this.length-ct.length,xt=this.clone(),At=ct,Rt=At.words[At.length-1]|0,St=this._countBits(Rt);mt=26-St,mt!==0&&(At=At.ushln(mt),xt.iushln(mt),Rt=At.words[At.length-1]|0);var Tt=xt.length-At.length,Et;if(dt!=="mod"){Et=new tt(null),Et.length=Tt+1,Et.words=new Array(Et.length);for(var Nt=0;Nt=0;ir--){var nr=(xt.words[At.length+ir]|0)*67108864+(xt.words[At.length+ir-1]|0);for(nr=Math.min(nr/Rt|0,67108863),xt._ishlnsubmul(At,nr,ir);xt.negative!==0;)nr--,xt.negative=0,xt._ishlnsubmul(At,1,ir),xt.isZero()||(xt.negative^=1);Et&&(Et.words[ir]=nr)}return Et&&Et._strip(),xt._strip(),dt!=="div"&&mt!==0&&xt.iushrn(mt),{div:Et||null,mod:xt}},tt.prototype.divmod=function(ct,dt,mt){if(j(!ct.isZero()),this.isZero())return{div:new tt(0),mod:new tt(0)};var xt,At,Rt;return this.negative!==0&&ct.negative===0?(Rt=this.neg().divmod(ct,dt),dt!=="mod"&&(xt=Rt.div.neg()),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.iadd(ct)),{div:xt,mod:At}):this.negative===0&&ct.negative!==0?(Rt=this.divmod(ct.neg(),dt),dt!=="mod"&&(xt=Rt.div.neg()),{div:xt,mod:Rt.mod}):this.negative&ct.negative?(Rt=this.neg().divmod(ct.neg(),dt),dt!=="div"&&(At=Rt.mod.neg(),mt&&At.negative!==0&&At.isub(ct)),{div:Rt.div,mod:At}):ct.length>this.length||this.cmp(ct)<0?{div:new tt(0),mod:this}:ct.length===1?dt==="div"?{div:this.divn(ct.words[0]),mod:null}:dt==="mod"?{div:null,mod:new tt(this.modrn(ct.words[0]))}:{div:this.divn(ct.words[0]),mod:new tt(this.modrn(ct.words[0]))}:this._wordDiv(ct,dt)},tt.prototype.div=function(ct){return this.divmod(ct,"div",!1).div},tt.prototype.mod=function(ct){return this.divmod(ct,"mod",!1).mod},tt.prototype.umod=function(ct){return this.divmod(ct,"mod",!0).mod},tt.prototype.divRound=function(ct){var dt=this.divmod(ct);if(dt.mod.isZero())return dt.div;var mt=dt.div.negative!==0?dt.mod.isub(ct):dt.mod,xt=ct.ushrn(1),At=ct.andln(1),Rt=mt.cmp(xt);return Rt<0||At===1&&Rt===0?dt.div:dt.div.negative!==0?dt.div.isubn(1):dt.div.iaddn(1)},tt.prototype.modrn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=(1<<26)%ct,xt=0,At=this.length-1;At>=0;At--)xt=(mt*xt+(this.words[At]|0))%ct;return dt?-xt:xt},tt.prototype.modn=function(ct){return this.modrn(ct)},tt.prototype.idivn=function(ct){var dt=ct<0;dt&&(ct=-ct),j(ct<=67108863);for(var mt=0,xt=this.length-1;xt>=0;xt--){var At=(this.words[xt]|0)+mt*67108864;this.words[xt]=At/ct|0,mt=At%ct}return this._strip(),dt?this.ineg():this},tt.prototype.divn=function(ct){return this.clone().idivn(ct)},tt.prototype.egcd=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=new tt(0),St=new tt(1),Tt=0;dt.isEven()&&mt.isEven();)dt.iushrn(1),mt.iushrn(1),++Tt;for(var Et=mt.clone(),Nt=dt.clone();!dt.isZero();){for(var tr=0,ir=1;!(dt.words[0]&ir)&&tr<26;++tr,ir<<=1);if(tr>0)for(dt.iushrn(tr);tr-- >0;)(xt.isOdd()||At.isOdd())&&(xt.iadd(Et),At.isub(Nt)),xt.iushrn(1),At.iushrn(1);for(var nr=0,Zt=1;!(mt.words[0]&Zt)&&nr<26;++nr,Zt<<=1);if(nr>0)for(mt.iushrn(nr);nr-- >0;)(Rt.isOdd()||St.isOdd())&&(Rt.iadd(Et),St.isub(Nt)),Rt.iushrn(1),St.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(Rt),At.isub(St)):(mt.isub(dt),Rt.isub(xt),St.isub(At))}return{a:Rt,b:St,gcd:mt.iushln(Tt)}},tt.prototype._invmp=function(ct){j(ct.negative===0),j(!ct.isZero());var dt=this,mt=ct.clone();dt.negative!==0?dt=dt.umod(ct):dt=dt.clone();for(var xt=new tt(1),At=new tt(0),Rt=mt.clone();dt.cmpn(1)>0&&mt.cmpn(1)>0;){for(var St=0,Tt=1;!(dt.words[0]&Tt)&&St<26;++St,Tt<<=1);if(St>0)for(dt.iushrn(St);St-- >0;)xt.isOdd()&&xt.iadd(Rt),xt.iushrn(1);for(var Et=0,Nt=1;!(mt.words[0]&Nt)&&Et<26;++Et,Nt<<=1);if(Et>0)for(mt.iushrn(Et);Et-- >0;)At.isOdd()&&At.iadd(Rt),At.iushrn(1);dt.cmp(mt)>=0?(dt.isub(mt),xt.isub(At)):(mt.isub(dt),At.isub(xt))}var tr;return dt.cmpn(1)===0?tr=xt:tr=At,tr.cmpn(0)<0&&tr.iadd(ct),tr},tt.prototype.gcd=function(ct){if(this.isZero())return ct.abs();if(ct.isZero())return this.abs();var dt=this.clone(),mt=ct.clone();dt.negative=0,mt.negative=0;for(var xt=0;dt.isEven()&&mt.isEven();xt++)dt.iushrn(1),mt.iushrn(1);do{for(;dt.isEven();)dt.iushrn(1);for(;mt.isEven();)mt.iushrn(1);var At=dt.cmp(mt);if(At<0){var Rt=dt;dt=mt,mt=Rt}else if(At===0||mt.cmpn(1)===0)break;dt.isub(mt)}while(!0);return mt.iushln(xt)},tt.prototype.invm=function(ct){return this.egcd(ct).a.umod(ct)},tt.prototype.isEven=function(){return(this.words[0]&1)===0},tt.prototype.isOdd=function(){return(this.words[0]&1)===1},tt.prototype.andln=function(ct){return this.words[0]&ct},tt.prototype.bincn=function(ct){j(typeof ct=="number");var dt=ct%26,mt=(ct-dt)/26,xt=1<>>26,St&=67108863,this.words[Rt]=St}return At!==0&&(this.words[Rt]=At,this.length++),this},tt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},tt.prototype.cmpn=function(ct){var dt=ct<0;if(this.negative!==0&&!dt)return-1;if(this.negative===0&&dt)return 1;this._strip();var mt;if(this.length>1)mt=1;else{dt&&(ct=-ct),j(ct<=67108863,"Number is too big");var xt=this.words[0]|0;mt=xt===ct?0:xtct.length)return 1;if(this.length=0;mt--){var xt=this.words[mt]|0,At=ct.words[mt]|0;if(xt!==At){xtAt&&(dt=1);break}}return dt},tt.prototype.gtn=function(ct){return this.cmpn(ct)===1},tt.prototype.gt=function(ct){return this.cmp(ct)===1},tt.prototype.gten=function(ct){return this.cmpn(ct)>=0},tt.prototype.gte=function(ct){return this.cmp(ct)>=0},tt.prototype.ltn=function(ct){return this.cmpn(ct)===-1},tt.prototype.lt=function(ct){return this.cmp(ct)===-1},tt.prototype.lten=function(ct){return this.cmpn(ct)<=0},tt.prototype.lte=function(ct){return this.cmp(ct)<=0},tt.prototype.eqn=function(ct){return this.cmpn(ct)===0},tt.prototype.eq=function(ct){return this.cmp(ct)===0},tt.red=function(ct){return new jt(ct)},tt.prototype.toRed=function(ct){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),ct.convertTo(this)._forceRed(ct)},tt.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},tt.prototype._forceRed=function(ct){return this.red=ct,this},tt.prototype.forceRed=function(ct){return j(!this.red,"Already a number in reduction context"),this._forceRed(ct)},tt.prototype.redAdd=function(ct){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,ct)},tt.prototype.redIAdd=function(ct){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ct)},tt.prototype.redSub=function(ct){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,ct)},tt.prototype.redISub=function(ct){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,ct)},tt.prototype.redShl=function(ct){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,ct)},tt.prototype.redMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.mul(this,ct)},tt.prototype.redIMul=function(ct){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ct),this.red.imul(this,ct)},tt.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},tt.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},tt.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},tt.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},tt.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},tt.prototype.redPow=function(ct){return j(this.red&&!ct.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ct)};var Dt={k256:null,p224:null,p192:null,p25519:null};function zt(vt,ct){this.name=vt,this.p=new tt(ct,16),this.n=this.p.bitLength(),this.k=new tt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}zt.prototype._tmp=function(){var ct=new tt(null);return ct.words=new Array(Math.ceil(this.n/13)),ct},zt.prototype.ireduce=function(ct){var dt=ct,mt;do this.split(dt,this.tmp),dt=this.imulK(dt),dt=dt.iadd(this.tmp),mt=dt.bitLength();while(mt>this.n);var xt=mt0?dt.isub(this.p):dt.strip!==void 0?dt.strip():dt._strip(),dt},zt.prototype.split=function(ct,dt){ct.iushrn(this.n,0,dt)},zt.prototype.imulK=function(ct){return ct.imul(this.k)};function Ot(){zt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}et(Ot,zt),Ot.prototype.split=function(ct,dt){for(var mt=4194303,xt=Math.min(ct.length,9),At=0;At>>22,Rt=St}Rt>>>=22,ct.words[At-10]=Rt,Rt===0&&ct.length>10?ct.length-=10:ct.length-=9},Ot.prototype.imulK=function(ct){ct.words[ct.length]=0,ct.words[ct.length+1]=0,ct.length+=2;for(var dt=0,mt=0;mt>>=26,ct.words[mt]=At,dt=xt}return dt!==0&&(ct.words[ct.length++]=dt),ct},tt._prime=function(ct){if(Dt[ct])return Dt[ct];var dt;if(ct==="k256")dt=new Ot;else if(ct==="p224")dt=new It;else if(ct==="p192")dt=new Lt;else if(ct==="p25519")dt=new Ft;else throw new Error("Unknown prime "+ct);return Dt[ct]=dt,dt};function jt(vt){if(typeof vt=="string"){var ct=tt._prime(vt);this.m=ct.p,this.prime=ct}else j(vt.gtn(1),"modulus must be greater than 1"),this.m=vt,this.prime=null}jt.prototype._verify1=function(ct){j(ct.negative===0,"red works only with positives"),j(ct.red,"red works only with red numbers")},jt.prototype._verify2=function(ct,dt){j((ct.negative|dt.negative)===0,"red works only with positives"),j(ct.red&&ct.red===dt.red,"red works only with red numbers")},jt.prototype.imod=function(ct){return this.prime?this.prime.ireduce(ct)._forceRed(this):(ot(ct,ct.umod(this.m)._forceRed(this)),ct)},jt.prototype.neg=function(ct){return ct.isZero()?ct.clone():this.m.sub(ct)._forceRed(this)},jt.prototype.add=function(ct,dt){this._verify2(ct,dt);var mt=ct.add(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt._forceRed(this)},jt.prototype.iadd=function(ct,dt){this._verify2(ct,dt);var mt=ct.iadd(dt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt},jt.prototype.sub=function(ct,dt){this._verify2(ct,dt);var mt=ct.sub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt._forceRed(this)},jt.prototype.isub=function(ct,dt){this._verify2(ct,dt);var mt=ct.isub(dt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt},jt.prototype.shl=function(ct,dt){return this._verify1(ct),this.imod(ct.ushln(dt))},jt.prototype.imul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.imul(dt))},jt.prototype.mul=function(ct,dt){return this._verify2(ct,dt),this.imod(ct.mul(dt))},jt.prototype.isqr=function(ct){return this.imul(ct,ct.clone())},jt.prototype.sqr=function(ct){return this.mul(ct,ct)},jt.prototype.sqrt=function(ct){if(ct.isZero())return ct.clone();var dt=this.m.andln(3);if(j(dt%2===1),dt===3){var mt=this.m.add(new tt(1)).iushrn(2);return this.pow(ct,mt)}for(var xt=this.m.subn(1),At=0;!xt.isZero()&&xt.andln(1)===0;)At++,xt.iushrn(1);j(!xt.isZero());var Rt=new tt(1).toRed(this),St=Rt.redNeg(),Tt=this.m.subn(1).iushrn(1),Et=this.m.bitLength();for(Et=new tt(2*Et*Et).toRed(this);this.pow(Et,Tt).cmp(St)!==0;)Et.redIAdd(St);for(var Nt=this.pow(Et,xt),tr=this.pow(ct,xt.addn(1).iushrn(1)),ir=this.pow(ct,xt),nr=At;ir.cmp(Rt)!==0;){for(var Zt=ir,Kt=0;Zt.cmp(Rt)!==0;Kt++)Zt=Zt.redSqr();j(Kt=0;At--){for(var Nt=dt.words[At],tr=Et-1;tr>=0;tr--){var ir=Nt>>tr&1;if(Rt!==xt[0]&&(Rt=this.sqr(Rt)),ir===0&&St===0){Tt=0;continue}St<<=1,St|=ir,Tt++,!(Tt!==mt&&(At!==0||tr!==0))&&(Rt=this.mul(Rt,xt[St]),Tt=0,St=0)}Et=26}return Rt},jt.prototype.convertTo=function(ct){var dt=ct.umod(this.m);return dt===ct?dt.clone():dt},jt.prototype.convertFrom=function(ct){var dt=ct.clone();return dt.red=null,dt},tt.mont=function(ct){return new bt(ct)};function bt(vt){jt.call(this,vt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new tt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}et(bt,jt),bt.prototype.convertTo=function(ct){return this.imod(ct.ushln(this.shift))},bt.prototype.convertFrom=function(ct){var dt=this.imod(ct.mul(this.rinv));return dt.red=null,dt},bt.prototype.imul=function(ct,dt){if(ct.isZero()||dt.isZero())return ct.words[0]=0,ct.length=1,ct;var mt=ct.imul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.mul=function(ct,dt){if(ct.isZero()||dt.isZero())return new tt(0)._forceRed(this);var mt=ct.mul(dt),xt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),At=mt.isub(xt).iushrn(this.shift),Rt=At;return At.cmp(this.m)>=0?Rt=At.isub(this.m):At.cmpn(0)<0&&(Rt=At.iadd(this.m)),Rt._forceRed(this)},bt.prototype.invm=function(ct){var dt=this.imod(ct._invmp(this.m).mul(this.r2));return dt._forceRed(this)}})(a,commonjsGlobal)})(bn);var bnExports=bn.exports;const BN=getDefaultExportFromCjs$1(bnExports),JRPC_METHODS={GET_OR_SET_KEY:"GetPubKeyOrKeyAssign",COMMITMENT_REQUEST:"CommitmentRequest",IMPORT_SHARE:"ImportShare",GET_SHARE_OR_KEY_ASSIGN:"GetShareOrKeyAssign"},LEGACY_METADATA_HOST="https://metadata.tor.us",normalizeKeysResult=a=>{const _={keys:[],is_new_key:a.is_new_key};return a&&a.keys&&a.keys.length>0&&(_.keys=a.keys.map($=>({pub_key_X:$.pub_key_X,pub_key_Y:$.pub_key_Y,address:$.address}))),_},kCombinations=(a,_)=>{let $=a;if(typeof $=="number"&&($=Array.from({length:$},(tt,rt)=>rt)),_>$.length||_<=0)return[];if(_===$.length)return[$];if(_===1)return $.reduce((tt,rt)=>[...tt,[rt]],[]);const j=[];let et=[];for(let tt=0;tt<=$.length-_+1;tt+=1){et=kCombinations($.slice(tt+1),_-1);for(let rt=0;rt{const $={};for(let j=0;j=8?et+=_[tt].toUpperCase():et+=_[tt];return et}function generateAddressFromPrivKey(a,_){const j=a.keyFromPrivate(_.toString("hex",64),"hex").getPublic().encode("hex",!1).slice(2);log$1.info(j,"public key");const et=`0x${keccak256$1(Buffer$g.from(j,"hex")).slice(26)}`;return toChecksumAddress(et)}function generateAddressFromPubKey(a,_,$){const j=a.keyFromPublic({x:_.toString("hex",64),y:$.toString("hex",64)}),et=j.getPublic().encode("hex",!1).slice(2);log$1.info(j.getPublic().encode("hex",!1),"public key");const tt=`0x${keccak256$1(Buffer$g.from(et,"hex")).slice(26)}`;return toChecksumAddress(tt)}class Share{constructor(_,$){_defineProperty$4(this,"share",void 0),_defineProperty$4(this,"shareIndex",void 0),this.share=new BN($,"hex"),this.shareIndex=new BN(_,"hex")}static fromJSON(_){const{share:$,shareIndex:j}=_;return new Share(j,$)}toJSON(){return{share:this.share.toString("hex"),shareIndex:this.shareIndex.toString("hex")}}}class Polynomial{constructor(_,$){_defineProperty$4(this,"polynomial",void 0),_defineProperty$4(this,"ecCurve",void 0),this.polynomial=_,this.ecCurve=$}getThreshold(){return this.polynomial.length}polyEval(_){const $=new BN(_,"hex");let j=new BN($),et=new BN(0);et=et.add(this.polynomial[0]);for(let tt=1;tttypeof et=="number"?new BN(et):et instanceof BN?et:typeof et=="string"?new BN(et,"hex"):et),j={};for(let et=0;et<$.length;et+=1)j[$[et].toString("hex",64)]=new Share($[et],this.polyEval($[et]));return j}}function generatePrivateExcludingIndexes(a){const _=new BN(generatePrivate());return a.find($=>$.eq(_))?generatePrivateExcludingIndexes(a):_}function lagrangeInterpolation(a,_,$){if(_.length!==$.length)throw new Error("shares not equal to nodeIndex length in lagrangeInterpolation");let j=new BN(0);for(let et=0;et<_.length;et+=1){let tt=new BN(1),rt=new BN(1);for(let it=0;it<_.length;it+=1)if(et!==it){tt=tt.mul($[it].neg()),tt=tt.umod(a.curve.n);let st=$[et].sub($[it]);st=st.umod(a.curve.n),rt=rt.mul(st).umod(a.curve.n)}let nt=tt.mul(rt.invm(a.curve.n)).umod(a.curve.n);nt=nt.mul(_[et]).umod(a.curve.n),j=j.add(nt)}return j.umod(a.curve.n)}function generateRandomPolynomial(a,_,$,j){let et=$;$||(et=generatePrivateExcludingIndexes([new BN(0)]));{const tt=[et];for(let rt=0;rt<_;rt+=1){const nt=generatePrivateExcludingIndexes(tt);tt.push(nt)}return new Polynomial(tt,a)}}function ownKeys$2$1(a,_){var $=Object.keys(a);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(a);_&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(a,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$2$1(a){for(var _=1;_2&&arguments[2]!==void 0?arguments[2]:{};try{const j=await post(`${a}/get`,_,$,{useAPIKey:!0});return!j||!j.message?new BN(0):new BN(j.message,16)}catch(j){return log$1$1.error("get metadata error",j),new BN(0)}}async function getOrSetNonce(a,_,$,j,et,tt){let rt=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,nt;const it=rt?"getNonce":"getOrSetNonce";return tt?nt=generateMetadataParams(_,$,it,tt):nt={pub_key_X:j,pub_key_Y:et,set_data:{data:it}},post(`${a}/get_or_set_nonce`,nt,void 0,{useAPIKey:!0})}async function getNonce(a,_,$,j,et,tt){return getOrSetNonce(a,_,$,j,et,tt,!0)}const config={logRequestTracing:!1};function capitalizeFirstLetter(a){return a.charAt(0).toUpperCase()+a.slice(1)}class SomeError extends Error{constructor(_){let{errors:$,responses:j,predicate:et}=_;super("Unable to resolve enough promises."),_defineProperty$4(this,"errors",void 0),_defineProperty$4(this,"responses",void 0),_defineProperty$4(this,"predicate",void 0),this.errors=$,this.responses=j,this.predicate=et}get message(){return`${super.message}. ${this.errors.length} errors: ${this.errors.map(_=>_.message||_).join(", ")} and ${this.responses.length} responses: ${JSON.stringify(this.responses)}`}toString(){return this.message}}const Some=(a,_)=>new Promise(($,j)=>{let et=0;const tt={resolved:!1},rt=new Array(a.length).fill(void 0),nt=new Array(a.length).fill(void 0);let it;return a.forEach((st,ot)=>st.then(at=>{nt[ot]=at}).catch(at=>{rt[ot]=at}).finally(()=>{if(!tt.resolved)return _(nt.slice(0),tt).then(at=>{tt.resolved=!0,$(at)}).catch(at=>{it=at}).finally(()=>{if(et+=1,et===a.length){const ut=Object.values(nt.reduce((ht,yt)=>{if(yt){var wt;const{id:Ct,error:Pt}=yt;(Pt==null||(wt=Pt.data)===null||wt===void 0?void 0:wt.length)>0&&(Pt.data.startsWith("Error occurred while verifying params")?ht[Ct]=capitalizeFirstLetter(Pt.data):ht[Ct]=Pt.data)}return ht},{}));if(ut.length>0){const ht=ut.length>1?` ${ut.map(yt=>`• ${yt}`).join(` -`)}`:ut[0];j(new Error(ht))}else{var at;j(new SomeError({errors:rt,responses:nt,predicate:((at=it)===null||at===void 0?void 0:at.message)||it}))}}})}))});function ownKeys$1$2(a,_){var $=Object.keys(a);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(a);_&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(a,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$1$2(a){for(var _=1;_{const{endpoints:_,network:$,verifier:j,verifierId:et,extendedVerifierId:tt}=a,rt=_.map(ot=>post(ot,generateJsonRPCObject(JRPC_METHODS.GET_OR_SET_KEY,{verifier:j,verifier_id:et.toString(),extended_verifier_id:tt,one_key_flow:!0,fetch_node_index:!0}),null,{logTracingHeader:config.logRequestTracing}).catch(at=>log$1.error(`${JRPC_METHODS.GET_OR_SET_KEY} request failed`,at)));let nt;const it=[];return await Some(rt,ot=>{const at=ot.filter(yt=>{if(yt&&!yt.error){if(!nt){var wt,Ct,Pt;((wt=yt.result)===null||wt===void 0||(Ct=wt.keys[0].nonce_data)===null||Ct===void 0||(Pt=Ct.pubNonce)===null||Pt===void 0?void 0:Pt.x)&&(nt=yt.result.keys[0].nonce_data)}return yt}return!1}),ut=thresholdSame(at.map(yt=>yt&&yt.error),~~(_.length/2)+1),ht=thresholdSame(at.map(yt=>yt&&normalizeKeysResult(yt.result)),~~(_.length/2)+1);return ht&&(nt||tt||LEGACY_NETWORKS_ROUTE_MAP[$])||ut?(ht&&ot.forEach(yt=>{if(yt&&yt.result){const wt=parseInt(yt.result.node_index);wt&&it.push(wt)}}),Promise.resolve({keyResult:ht,nodeIndexes:it,errorResult:ut,nonceResult:nt})):Promise.reject(new Error(`invalid public key result: ${JSON.stringify(ot)} and nonce result:${JSON.stringify(nt||{})} for verifier: ${j}, verifierId: ${et} and extendedVerifierId: ${tt} `))})};async function retrieveOrImportShare(a){const{legacyMetadataHost:_,serverTimeOffset:$,enableOneKey:j,ecCurve:et,allowHost:tt,network:rt,clientId:nt,endpoints:it,verifier:st,verifierParams:ot,idToken:at,importedShares:ut,extraParams:ht}=a;await get(tt,{headers:{verifier:st,verifierId:ot.verifier_id,network:rt,clientId:nt}},{useAPIKey:!0});const yt=[],wt=generatePrivate(),Ct=getPublic(wt).toString("hex"),Pt=Ct.slice(2,66),$t=Ct.slice(66),Mt=keccak256$1(Buffer$g.from(at,"utf8"));let Bt=!1;if(ut&&ut.length>0){if(ut.length!==it.length)throw new Error("Invalid imported shares length");Bt=!0}for(let Dt=0;Dt{log$1.error("commitment error",Ot)});yt.push(zt)}return Some(yt,Dt=>{const zt=Dt.filter(Ot=>!(!Ot||typeof Ot!="object"||Ot.error));return ut.length>0&&zt.length===it.length||ut.length===0&&zt.length>=~~(it.length*3/4)+1&&zt.find(It=>{var Lt;return!!(It&&((Lt=It.result)===null||Lt===void 0?void 0:Lt.nodeindex)==="1")})?Promise.resolve(Dt):Promise.reject(new Error(`invalid ${JSON.stringify(Dt)}`))}).then(Dt=>{const zt=[],Ot=[];for(let Lt=0;Ltlog$1.error("share req",vt));zt.push(bt)}else{const jt=post(it[Lt],generateJsonRPCObject(JRPC_METHODS.GET_SHARE_OR_KEY_ASSIGN,{encrypted:"yes",use_temp:!0,item:[_objectSpread$1$2(_objectSpread$1$2({},ot),{},{idtoken:at,nodesignatures:Ot,verifieridentifier:st},ht)],one_key_flow:!0}),null,{logTracingHeader:config.logRequestTracing}).catch(bt=>log$1.error("share req",bt));zt.push(jt)}}let It;return Some(zt,async(Lt,Ft)=>{const jt=Lt.filter(xt=>!(!xt||typeof xt!="object"||xt.error)),bt=Lt.map(xt=>{if(xt&&xt.result&&xt.result.keys[0].public_key){if(!It&&!ot.extended_verifier_id){var At,Rt;((At=xt.result.keys[0].nonce_data)===null||At===void 0||(Rt=At.pubNonce)===null||Rt===void 0?void 0:Rt.x)&&(It=xt.result.keys[0].nonce_data)}return xt.result.keys[0].public_key}}),vt=thresholdSame(bt,~~(it.length/2)+1);if(!vt)throw new Error("invalid result from nodes, threshold number of public key results are not matching");if(!It&&!ot.extended_verifier_id&&!LEGACY_NETWORKS_ROUTE_MAP[rt])throw new Error(`invalid metadata result from nodes, nonce metadata is empty for verifier: ${st} and verifierId: ${ot.verifier_id}`);const ct=ut.length>0?it.length:~~(it.length/2)+1;if(jt.length>=ct&&vt&&(It||ot.extended_verifier_id||LEGACY_NETWORKS_ROUTE_MAP[rt])){const xt=[],At=[],Rt=[],St=[],Tt=[];for(let Jt=0;Jt0){var dt;Mr&&(dt=Mr[0])!==null&&dt!==void 0&&dt.ephemPublicKey?At.push(decryptNodeData(Mr[0],Cr[0],wt).catch(fr=>log$1.debug("session sig decryption",fr))):At.push(Promise.resolve(Buffer$g.from(Cr[0],"hex")))}else At.push(Promise.resolve(void 0));if((xr==null?void 0:xr.length)>0){var mt;pr&&(mt=pr[0])!==null&&mt!==void 0&&mt.ephemPublicKey?Rt.push(decryptNodeData(pr[0],xr[0],wt).catch(fr=>log$1.debug("session token sig decryption",fr))):Rt.push(Promise.resolve(Buffer$g.from(xr[0],"base64")))}else Rt.push(Promise.resolve(void 0));if((lr==null?void 0:lr.length)>0){const fr=ur.result.keys[0];St.push(new BN(fr.node_index)),fr.share_metadata&&xt.push(decryptNodeData(fr.share_metadata,Buffer$g.from(fr.share,"base64").toString("binary").padStart(64,"0"),wt).catch(_r=>log$1.debug("share decryption",_r)))}else St.push(void 0),xt.push(Promise.resolve(void 0))}const Et=await Promise.all(xt.concat(At).concat(Rt)),Nt=Et.slice(0,xt.length),tr=Et.slice(xt.length,xt.length+At.length),ir=Et.slice(xt.length+At.length,Et.length),nr=tr.filter(Jt=>!!Jt),Zt=~~(it.length/2)+1;if(!ot.extended_verifier_id&&nr.length!!Jt);if(!ot.extended_verifier_id&&Kt.length{Jt?Tt.push({token:Jt.toString("base64"),signature:tr[ur].toString("hex"),node_pubx:jt[ur].result.node_pubx,node_puby:jt[ur].result.node_puby}):Tt.push(void 0)}),Ft.resolved)return;const Qt=Nt.reduce((Jt,ur,xr)=>(ur&&Jt.push({index:St[xr],value:new BN(ur)}),Jt),[]),Ht=kCombinations(Qt.length,~~(it.length/2)+1);let qt=null;for(let Jt=0;Jtur.includes(kr)),pr=xr.map(Rr=>Rr.value),Cr=xr.map(Rr=>Rr.index),Mr=lagrangeInterpolation(et,pr,Cr);if(!Mr)continue;const lr=getPublic(Buffer$g.from(Mr.toString(16,64),"hex")).toString("hex"),fr=lr.slice(2,66),_r=lr.slice(66);if(new BN(fr,16).cmp(new BN(vt.X,16))===0&&new BN(_r,16).cmp(new BN(vt.Y,16))===0){qt=Mr;break}}if(qt==null)throw new Error("could not derive private key");return{privateKey:qt,sessionTokenData:Tt,thresholdNonceData:It,nodeIndexes:St}}throw new Error("Invalid")})}).then(async Dt=>{var zt;const{privateKey:Ot,sessionTokenData:It,thresholdNonceData:Lt,nodeIndexes:Ft}=Dt;let jt=Lt;if(!Ot)throw new Error("Invalid private key returned");const bt=Ot,vt=getPublic(Buffer$g.from(bt.toString(16,64),"hex")).toString("hex"),ct=vt.slice(2,66),dt=vt.slice(66);let mt=new BN((zt=jt)!==null&&zt!==void 0&&zt.nonce?jt.nonce.padStart(64,"0"):"0","hex"),xt,At,Rt="v1";if(ot.extended_verifier_id)Rt="v2",xt=et.keyFromPublic({x:ct,y:dt}).getPublic();else if(LEGACY_NETWORKS_ROUTE_MAP[rt])if(j)jt=await getNonce(_,et,$,ct,dt,bt),mt=new BN(jt.nonce||"0",16),At={X:jt.pubNonce.x,Y:jt.pubNonce.y},Rt=jt.typeOfUser,Rt==="v2"&&(xt=et.keyFromPublic({x:ct,y:dt}).getPublic().add(et.keyFromPublic({x:jt.pubNonce.x,y:jt.pubNonce.y}).getPublic()));else{Rt="v1",mt=await getMetadata(_,{pub_key_X:ct,pub_key_Y:dt});const tr=bt.add(mt).umod(et.curve.n);xt=et.keyFromPrivate(tr.toString(16,64),"hex").getPublic()}else Rt="v2",xt=et.keyFromPublic({x:ct,y:dt}).getPublic().add(et.keyFromPublic({x:jt.pubNonce.x,y:jt.pubNonce.y}).getPublic()),At={X:jt.pubNonce.x,Y:jt.pubNonce.y};const St=generateAddressFromPrivKey(et,bt),Tt=generateAddressFromPubKey(et,xt.getX(),xt.getY());log$1.debug("> torus.js/retrieveShares",{finalEvmAddress:Tt});let Et="";(Rt==="v1"||Rt==="v2"&&mt.gt(new BN(0)))&&(Et=bt.add(mt).umod(et.curve.n).toString("hex",64));let Nt=!1;return Rt==="v1"?Nt=null:Rt==="v2"&&(Nt=mt.eq(new BN("0"))),{finalKeyData:{evmAddress:Tt,X:xt.getX().toString(16,64),Y:xt.getY().toString(16,64),privKey:Et},oAuthKeyData:{evmAddress:St,X:ct,Y:dt,privKey:bt.toString("hex",64).padStart(64,"0")},sessionData:{sessionTokenData:It,sessionAuthKey:wt.toString("hex").padStart(64,"0")},metadata:{pubNonce:At,nonce:mt,typeOfUser:Rt,upgraded:Nt},nodesData:{nodeIndexes:Ft.map(tr=>tr.toNumber())}}})}const legacyKeyLookup=async(a,_,$)=>{const j=a.map(et=>post(et,generateJsonRPCObject("VerifierLookupRequest",{verifier:_,verifier_id:$.toString()})).catch(tt=>log$1.error("lookup request failed",tt)));return Some(j,et=>{const tt=et.filter(it=>it),rt=thresholdSame(tt.map(it=>it&&it.error),~~(a.length/2)+1),nt=thresholdSame(tt.map(it=>it&&it.result),~~(a.length/2)+1);return nt||rt?Promise.resolve({keyResult:nt,errorResult:rt}):Promise.reject(new Error(`invalid results ${JSON.stringify(et)}`))})},legacyKeyAssign=async a=>{let{endpoints:_,torusNodePubs:$,lastPoint:j,firstPoint:et,verifier:tt,verifierId:rt,signerHost:nt,network:it,clientId:st}=a,ot,at;if(j===void 0?(ot=Math.floor(Math.random()*_.length),log$1.info("keyassign",ot,_[ot]),at=ot):ot=j%_.length,ot===et)throw new Error("Looped through all");et!==void 0&&(at=et);const ut=generateJsonRPCObject("KeyAssign",{verifier:tt,verifier_id:rt.toString()});try{const ht=await post(nt,ut,{headers:{pubKeyX:$[ot].X,pubKeyY:$[ot].Y,network:it,clientId:st}},{useAPIKey:!0});return await post(_[ot],_objectSpread$1$2(_objectSpread$1$2({},ut),ht),{headers:{"Content-Type":"application/json; charset=utf-8"}})}catch(ht){log$1.error(ht.status,ht.message,ht,"key assign error");const yt=["Timed out","Failed to fetch","cancelled","NetworkError when attempting to fetch resource.","TypeError: Failed to fetch","TypeError: cancelled","TypeError: NetworkError when attempting to fetch resource."];if((ht==null?void 0:ht.status)===502||(ht==null?void 0:ht.status)===504||(ht==null?void 0:ht.status)===401||yt.includes(ht.message)||yt.some(wt=>ht.message.includes(wt))||ht.message&&ht.message.includes("reason: getaddrinfo EAI_AGAIN"))return legacyKeyAssign({endpoints:_,torusNodePubs:$,lastPoint:ot+1,firstPoint:at,verifier:tt,verifierId:rt,signerHost:nt,network:it,clientId:st});throw new Error(`Sorry, the Torus Network that powers Web3Auth is currently very busy. +`)}`:ut[0];j(new Error(ht))}else{var at;j(new SomeError({errors:rt,responses:nt,predicate:((at=it)===null||at===void 0?void 0:at.message)||it}))}}})}))});function ownKeys$1$2(a,_){var $=Object.keys(a);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(a);_&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(a,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$1$2(a){for(var _=1;_{const{endpoints:_,network:$,verifier:j,verifierId:et,extendedVerifierId:tt}=a,rt=_.map(ot=>post(ot,generateJsonRPCObject(JRPC_METHODS.GET_OR_SET_KEY,{verifier:j,verifier_id:et.toString(),extended_verifier_id:tt,one_key_flow:!0,fetch_node_index:!0}),null,{logTracingHeader:config.logRequestTracing}).catch(at=>log$1.error(`${JRPC_METHODS.GET_OR_SET_KEY} request failed`,at)));let nt;const it=[];return await Some(rt,ot=>{const at=ot.filter(yt=>{if(yt&&!yt.error){if(!nt){var wt,Ct,Pt;((wt=yt.result)===null||wt===void 0||(Ct=wt.keys[0].nonce_data)===null||Ct===void 0||(Pt=Ct.pubNonce)===null||Pt===void 0?void 0:Pt.x)&&(nt=yt.result.keys[0].nonce_data)}return yt}return!1}),ut=thresholdSame(at.map(yt=>yt&&yt.error),~~(_.length/2)+1),ht=thresholdSame(at.map(yt=>yt&&normalizeKeysResult(yt.result)),~~(_.length/2)+1);return ht&&(nt||tt||LEGACY_NETWORKS_ROUTE_MAP[$])||ut?(ht&&ot.forEach(yt=>{if(yt&&yt.result){const wt=parseInt(yt.result.node_index);wt&&it.push(wt)}}),Promise.resolve({keyResult:ht,nodeIndexes:it,errorResult:ut,nonceResult:nt})):Promise.reject(new Error(`invalid public key result: ${JSON.stringify(ot)} and nonce result:${JSON.stringify(nt||{})} for verifier: ${j}, verifierId: ${et} and extendedVerifierId: ${tt} `))})};async function retrieveOrImportShare(a){const{legacyMetadataHost:_,serverTimeOffset:$,enableOneKey:j,ecCurve:et,allowHost:tt,network:rt,clientId:nt,endpoints:it,verifier:st,verifierParams:ot,idToken:at,importedShares:ut,extraParams:ht}=a;await get(tt,{headers:{verifier:st,verifierId:ot.verifier_id,network:rt,clientId:nt}},{useAPIKey:!0});const yt=[],wt=generatePrivate(),Ct=getPublic(wt).toString("hex"),Pt=Ct.slice(2,66),$t=Ct.slice(66),Mt=keccak256$1(Buffer$g.from(at,"utf8"));let Bt=!1;if(ut&&ut.length>0){if(ut.length!==it.length)throw new Error("Invalid imported shares length");Bt=!0}for(let Dt=0;Dt{log$1.error("commitment error",Ot)});yt.push(zt)}return Some(yt,Dt=>{const zt=Dt.filter(Ot=>!(!Ot||typeof Ot!="object"||Ot.error));return ut.length>0&&zt.length===it.length||ut.length===0&&zt.length>=~~(it.length*3/4)+1&&zt.find(It=>{var Lt;return!!(It&&((Lt=It.result)===null||Lt===void 0?void 0:Lt.nodeindex)==="1")})?Promise.resolve(Dt):Promise.reject(new Error(`invalid ${JSON.stringify(Dt)}`))}).then(Dt=>{const zt=[],Ot=[];for(let Lt=0;Ltlog$1.error("share req",vt));zt.push(bt)}else{const jt=post(it[Lt],generateJsonRPCObject(JRPC_METHODS.GET_SHARE_OR_KEY_ASSIGN,{encrypted:"yes",use_temp:!0,item:[_objectSpread$1$2(_objectSpread$1$2({},ot),{},{idtoken:at,nodesignatures:Ot,verifieridentifier:st},ht)],one_key_flow:!0}),null,{logTracingHeader:config.logRequestTracing}).catch(bt=>log$1.error("share req",bt));zt.push(jt)}}let It;return Some(zt,async(Lt,Ft)=>{const jt=Lt.filter(xt=>!(!xt||typeof xt!="object"||xt.error)),bt=Lt.map(xt=>{if(xt&&xt.result&&xt.result.keys[0].public_key){if(!It&&!ot.extended_verifier_id){var At,Rt;((At=xt.result.keys[0].nonce_data)===null||At===void 0||(Rt=At.pubNonce)===null||Rt===void 0?void 0:Rt.x)&&(It=xt.result.keys[0].nonce_data)}return xt.result.keys[0].public_key}}),vt=thresholdSame(bt,~~(it.length/2)+1);if(!vt)throw new Error("invalid result from nodes, threshold number of public key results are not matching");if(!It&&!ot.extended_verifier_id&&!LEGACY_NETWORKS_ROUTE_MAP[rt])throw new Error(`invalid metadata result from nodes, nonce metadata is empty for verifier: ${st} and verifierId: ${ot.verifier_id}`);const ct=ut.length>0?it.length:~~(it.length/2)+1;if(jt.length>=ct&&vt&&(It||ot.extended_verifier_id||LEGACY_NETWORKS_ROUTE_MAP[rt])){const xt=[],At=[],Rt=[],St=[],Tt=[];for(let Jt=0;Jt0){var dt;Mr&&(dt=Mr[0])!==null&&dt!==void 0&&dt.ephemPublicKey?At.push(decryptNodeData(Mr[0],Cr[0],wt).catch(fr=>log$1.debug("session sig decryption",fr))):At.push(Promise.resolve(Buffer$g.from(Cr[0],"hex")))}else At.push(Promise.resolve(void 0));if((xr==null?void 0:xr.length)>0){var mt;pr&&(mt=pr[0])!==null&&mt!==void 0&&mt.ephemPublicKey?Rt.push(decryptNodeData(pr[0],xr[0],wt).catch(fr=>log$1.debug("session token sig decryption",fr))):Rt.push(Promise.resolve(Buffer$g.from(xr[0],"base64")))}else Rt.push(Promise.resolve(void 0));if((lr==null?void 0:lr.length)>0){const fr=ur.result.keys[0];St.push(new BN(fr.node_index)),fr.share_metadata&&xt.push(decryptNodeData(fr.share_metadata,Buffer$g.from(fr.share,"base64").toString("binary").padStart(64,"0"),wt).catch(_r=>log$1.debug("share decryption",_r)))}else St.push(void 0),xt.push(Promise.resolve(void 0))}const Et=await Promise.all(xt.concat(At).concat(Rt)),Nt=Et.slice(0,xt.length),tr=Et.slice(xt.length,xt.length+At.length),ir=Et.slice(xt.length+At.length,Et.length),nr=tr.filter(Jt=>!!Jt),Zt=~~(it.length/2)+1;if(!ot.extended_verifier_id&&nr.length!!Jt);if(!ot.extended_verifier_id&&Kt.length{Jt?Tt.push({token:Jt.toString("base64"),signature:tr[ur].toString("hex"),node_pubx:jt[ur].result.node_pubx,node_puby:jt[ur].result.node_puby}):Tt.push(void 0)}),Ft.resolved)return;const Qt=Nt.reduce((Jt,ur,xr)=>(ur&&Jt.push({index:St[xr],value:new BN(ur)}),Jt),[]),Ht=kCombinations(Qt.length,~~(it.length/2)+1);let qt=null;for(let Jt=0;Jtur.includes(kr)),pr=xr.map(Sr=>Sr.value),Cr=xr.map(Sr=>Sr.index),Mr=lagrangeInterpolation(et,pr,Cr);if(!Mr)continue;const lr=getPublic(Buffer$g.from(Mr.toString(16,64),"hex")).toString("hex"),fr=lr.slice(2,66),_r=lr.slice(66);if(new BN(fr,16).cmp(new BN(vt.X,16))===0&&new BN(_r,16).cmp(new BN(vt.Y,16))===0){qt=Mr;break}}if(qt==null)throw new Error("could not derive private key");return{privateKey:qt,sessionTokenData:Tt,thresholdNonceData:It,nodeIndexes:St}}throw new Error("Invalid")})}).then(async Dt=>{var zt;const{privateKey:Ot,sessionTokenData:It,thresholdNonceData:Lt,nodeIndexes:Ft}=Dt;let jt=Lt;if(!Ot)throw new Error("Invalid private key returned");const bt=Ot,vt=getPublic(Buffer$g.from(bt.toString(16,64),"hex")).toString("hex"),ct=vt.slice(2,66),dt=vt.slice(66);let mt=new BN((zt=jt)!==null&&zt!==void 0&&zt.nonce?jt.nonce.padStart(64,"0"):"0","hex"),xt,At,Rt="v1";if(ot.extended_verifier_id)Rt="v2",xt=et.keyFromPublic({x:ct,y:dt}).getPublic();else if(LEGACY_NETWORKS_ROUTE_MAP[rt])if(j)jt=await getNonce(_,et,$,ct,dt,bt),mt=new BN(jt.nonce||"0",16),At={X:jt.pubNonce.x,Y:jt.pubNonce.y},Rt=jt.typeOfUser,Rt==="v2"&&(xt=et.keyFromPublic({x:ct,y:dt}).getPublic().add(et.keyFromPublic({x:jt.pubNonce.x,y:jt.pubNonce.y}).getPublic()));else{Rt="v1",mt=await getMetadata(_,{pub_key_X:ct,pub_key_Y:dt});const tr=bt.add(mt).umod(et.curve.n);xt=et.keyFromPrivate(tr.toString(16,64),"hex").getPublic()}else Rt="v2",xt=et.keyFromPublic({x:ct,y:dt}).getPublic().add(et.keyFromPublic({x:jt.pubNonce.x,y:jt.pubNonce.y}).getPublic()),At={X:jt.pubNonce.x,Y:jt.pubNonce.y};const St=generateAddressFromPrivKey(et,bt),Tt=generateAddressFromPubKey(et,xt.getX(),xt.getY());log$1.debug("> torus.js/retrieveShares",{finalEvmAddress:Tt});let Et="";(Rt==="v1"||Rt==="v2"&&mt.gt(new BN(0)))&&(Et=bt.add(mt).umod(et.curve.n).toString("hex",64));let Nt=!1;return Rt==="v1"?Nt=null:Rt==="v2"&&(Nt=mt.eq(new BN("0"))),{finalKeyData:{evmAddress:Tt,X:xt.getX().toString(16,64),Y:xt.getY().toString(16,64),privKey:Et},oAuthKeyData:{evmAddress:St,X:ct,Y:dt,privKey:bt.toString("hex",64).padStart(64,"0")},sessionData:{sessionTokenData:It,sessionAuthKey:wt.toString("hex").padStart(64,"0")},metadata:{pubNonce:At,nonce:mt,typeOfUser:Rt,upgraded:Nt},nodesData:{nodeIndexes:Ft.map(tr=>tr.toNumber())}}})}const legacyKeyLookup=async(a,_,$)=>{const j=a.map(et=>post(et,generateJsonRPCObject("VerifierLookupRequest",{verifier:_,verifier_id:$.toString()})).catch(tt=>log$1.error("lookup request failed",tt)));return Some(j,et=>{const tt=et.filter(it=>it),rt=thresholdSame(tt.map(it=>it&&it.error),~~(a.length/2)+1),nt=thresholdSame(tt.map(it=>it&&it.result),~~(a.length/2)+1);return nt||rt?Promise.resolve({keyResult:nt,errorResult:rt}):Promise.reject(new Error(`invalid results ${JSON.stringify(et)}`))})},legacyKeyAssign=async a=>{let{endpoints:_,torusNodePubs:$,lastPoint:j,firstPoint:et,verifier:tt,verifierId:rt,signerHost:nt,network:it,clientId:st}=a,ot,at;if(j===void 0?(ot=Math.floor(Math.random()*_.length),log$1.info("keyassign",ot,_[ot]),at=ot):ot=j%_.length,ot===et)throw new Error("Looped through all");et!==void 0&&(at=et);const ut=generateJsonRPCObject("KeyAssign",{verifier:tt,verifier_id:rt.toString()});try{const ht=await post(nt,ut,{headers:{pubKeyX:$[ot].X,pubKeyY:$[ot].Y,network:it,clientId:st}},{useAPIKey:!0});return await post(_[ot],_objectSpread$1$2(_objectSpread$1$2({},ut),ht),{headers:{"Content-Type":"application/json; charset=utf-8"}})}catch(ht){log$1.error(ht.status,ht.message,ht,"key assign error");const yt=["Timed out","Failed to fetch","cancelled","NetworkError when attempting to fetch resource.","TypeError: Failed to fetch","TypeError: cancelled","TypeError: NetworkError when attempting to fetch resource."];if((ht==null?void 0:ht.status)===502||(ht==null?void 0:ht.status)===504||(ht==null?void 0:ht.status)===401||yt.includes(ht.message)||yt.some(wt=>ht.message.includes(wt))||ht.message&&ht.message.includes("reason: getaddrinfo EAI_AGAIN"))return legacyKeyAssign({endpoints:_,torusNodePubs:$,lastPoint:ot+1,firstPoint:at,verifier:tt,verifierId:rt,signerHost:nt,network:it,clientId:st});throw new Error(`Sorry, the Torus Network that powers Web3Auth is currently very busy. We will generate your key in time. Pls try again later. ${ht.message||""}`)}},legacyWaitKeyLookup=(a,_,$,j)=>new Promise((et,tt)=>{setTimeout(()=>{legacyKeyLookup(a,_,$).then(et).catch(tt)},j)});function ownKeys$4(a,_){var $=Object.keys(a);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(a);_&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(a,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread$4(a){for(var _=1;_0&&arguments[0]!==void 0?arguments[0]:!0)?(log$1.enableAll(),config.logRequestTracing=!0):log$1.disableAll()}static setAPIKey(_){setAPIKey(_)}static setEmbedHost(_){setEmbedHost(_)}static isGetOrSetNonceError(_){return _ instanceof GetOrSetNonceError}static getPostboxKey(_){return _.metadata.typeOfUser==="v1"&&_.finalKeyData.privKey||_.oAuthKeyData.privKey}async retrieveShares(_,$,j,et,tt){let rt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return this.isLegacyNetwork?this.legacyRetrieveShares(_,$,j,et,tt,rt):retrieveOrImportShare({legacyMetadataHost:this.legacyMetadataHost,serverTimeOffset:this.serverTimeOffset,enableOneKey:this.enableOneKey,ecCurve:this.ec,allowHost:this.allowHost,network:this.network,clientId:this.clientId,endpoints:_,verifier:j,verifierParams:et,idToken:tt,importedShares:[],extraParams:rt})}async getPublicAddress(_,$,j){let{verifier:et,verifierId:tt,extendedVerifierId:rt}=j;return this.isLegacyNetwork?this.getLegacyPublicAddress(_,$,{verifier:et,verifierId:tt},this.enableOneKey):this.getNewPublicAddress(_,{verifier:et,verifierId:tt,extendedVerifierId:rt},this.enableOneKey)}async importPrivateKey(_,$,j,et,tt,rt,nt){let it=arguments.length>7&&arguments[7]!==void 0?arguments[7]:{};if(this.isLegacyNetwork)throw new Error("This function is not supported on legacy networks");if(_.length!==$.length)throw new Error("length of endpoints array must be same as length of nodeIndexes array");const ot=~~(_.length/2)+1-1,at=[],ut=this.ec.keyFromPrivate(nt.padStart(64,"0"),"hex");for(const It of $)at.push(new BN(It));const ht=ut.getPrivate(),yt=new BN(generatePrivate()),wt=ht.sub(yt).umod(this.ec.curve.n),Ct=this.ec.keyFromPrivate(wt.toString("hex").padStart(64,"0")).getPublic(),$t=generateRandomPolynomial(this.ec,ot,wt).generateShares(at),Mt=this.generateNonceMetadataParams("getOrSetNonce",wt,yt),Bt=Buffer$g.from(stringify(Mt.set_data),"utf8").toString("base64"),Dt=[],zt=[];for(let It=0;It5&&arguments[5]!==void 0?arguments[5]:{};const nt=[];await get(this.allowHost,{headers:{verifier:j,verifierId:et.verifier_id,network:this.network,clientId:this.clientId}},{useAPIKey:!0});const it=generatePrivate(),st=getPublic(it).toString("hex"),ot=st.slice(2,66),at=st.slice(66),ut=keccak256$1(Buffer$g.from(tt,"utf8"));for(let ht=0;ht<_.length;ht+=1){const yt=post(_[ht],generateJsonRPCObject("CommitmentRequest",{messageprefix:"mug00",tokencommitment:ut.slice(2),temppubx:ot,temppuby:at,verifieridentifier:j})).catch(wt=>{log$1.error("commitment",wt)});nt.push(yt)}return Some(nt,ht=>ht.filter(wt=>!(!wt||typeof wt!="object"||wt.error)).length>=~~(_.length/4)*3+1?Promise.resolve(ht):Promise.reject(new Error(`invalid ${JSON.stringify(ht)}`))).then(ht=>{const yt=[],wt=[];for(let Ct=0;Ctlog$1.error("share req",$t));yt.push(Pt)}return Some(yt,async(Ct,Pt)=>{const $t=Ct.filter(zt=>zt),Mt=thresholdSame(Ct.map(zt=>zt&&zt.result&&zt.result.keys[0].PublicKey),~~(_.length/2)+1);if($t.length>=~~(_.length/2)+1&&Mt){const zt=[],Ot=[];for(let bt=0;bt0){vt.result.keys.sort((dt,mt)=>new BN(dt.Index,16).cmp(new BN(mt.Index,16)));const ct=vt.result.keys[0];if(ct.Metadata){const dt={ephemPublicKey:Buffer$g.from(ct.Metadata.ephemPublicKey,"hex"),iv:Buffer$g.from(ct.Metadata.iv,"hex"),mac:Buffer$g.from(ct.Metadata.mac,"hex")};zt.push(decrypt(it,_objectSpread$4(_objectSpread$4({},dt),{},{ciphertext:Buffer$g.from(Buffer$g.from(ct.Share,"base64").toString("binary").padStart(64,"0"),"hex")})).catch(mt=>log$1.debug("share decryption",mt)))}else zt.push(Promise.resolve(Buffer$g.from(ct.Share.padStart(64,"0"),"hex")))}else zt.push(Promise.resolve(void 0));Ot.push(new BN($[bt],16))}const It=await Promise.all(zt);if(Pt.resolved)return;const Lt=It.reduce((bt,vt,ct)=>(vt&&bt.push({index:Ot[ct],value:new BN(vt)}),bt),[]),Ft=kCombinations(Lt.length,~~(_.length/2)+1);let jt=null;for(let bt=0;btvt.includes(Et)),dt=ct.map(Tt=>Tt.value),mt=ct.map(Tt=>Tt.index),xt=lagrangeInterpolation(this.ec,dt,mt);if(!xt)continue;const At=getPublic(Buffer$g.from(xt.toString(16,64),"hex")).toString("hex"),Rt=At.slice(2,66),St=At.slice(66);if(new BN(Rt,16).cmp(new BN(Mt.X,16))===0&&new BN(St,16).cmp(new BN(Mt.Y,16))===0){jt=xt;break}}if(jt==null)throw new Error("could not derive private key");return jt}throw new Error("invalid")})}).then(async ht=>{const yt=ht;if(!yt)throw new Error("Invalid private key returned");const wt=getPublic(Buffer$g.from(yt.toString(16,64),"hex")).toString("hex"),Ct=wt.slice(2,66),Pt=wt.slice(66);let $t,Mt,Bt="v1",Dt;if(this.enableOneKey){const Ft=await getNonce(this.legacyMetadataHost,this.ec,this.serverTimeOffset,Ct,Pt,yt);$t=new BN(Ft.nonce||"0",16),Bt=Ft.typeOfUser,Ft.typeOfUser==="v2"&&(Mt=this.ec.keyFromPublic({x:Ct,y:Pt}).getPublic().add(this.ec.keyFromPublic({x:Ft.pubNonce.x,y:Ft.pubNonce.y}).getPublic()),Dt={X:Ft.pubNonce.x,Y:Ft.pubNonce.y})}else{$t=await getMetadata(this.legacyMetadataHost,{pub_key_X:Ct,pub_key_Y:Pt});const Ft=yt.add($t).umod(this.ec.curve.n);Mt=this.ec.keyFromPrivate(Ft.toString("hex"),"hex").getPublic()}const zt=generateAddressFromPrivKey(this.ec,yt),Ot=generateAddressFromPubKey(this.ec,Mt.getX(),Mt.getY());log$1.debug("> torus.js/retrieveShares",{finalEvmAddress:Ot});let It="";(Bt==="v1"||Bt==="v2"&&$t.gt(new BN(0)))&&(It=yt.add($t).umod(this.ec.curve.n).toString("hex",64).padStart(64,"0"));let Lt=!1;return Bt==="v1"?Lt=null:Bt==="v2"&&(Lt=$t.eq(new BN("0"))),{finalKeyData:{evmAddress:Ot,X:Mt?Mt.getX().toString(16,64):"",Y:Mt?Mt.getY().toString(16,64):"",privKey:It},oAuthKeyData:{evmAddress:zt,X:Ct,Y:Pt,privKey:yt.toString("hex",64).padStart(64,"0")},sessionData:{sessionTokenData:[],sessionAuthKey:""},metadata:{pubNonce:Dt,nonce:$t,typeOfUser:Bt,upgraded:Lt},nodesData:{nodeIndexes:[]}}})}async getLegacyPublicAddress(_,$,j,et){let{verifier:tt,verifierId:rt}=j;log$1.debug("> torus.js/getPublicAddress",{endpoints:_,torusNodePubs:$,verifier:tt,verifierId:rt});let nt,it=!1;const{keyResult:st,errorResult:ot}=await legacyKeyLookup(_,tt,rt)||{};if(ot&&JSON.stringify(ot).includes("Verifier not supported"))throw new Error(`Verifier not supported. Check if you: @@ -572,18 +572,18 @@ License: MIT `,ct='"',dt=ct+ct,mt=!1,xt=null,At=!1;(function(){if(typeof Lt=="object"){if(typeof Lt.delimiter!="string"||it.BAD_DELIMITERS.filter(function(Et){return Lt.delimiter.indexOf(Et)!==-1}).length||(bt=Lt.delimiter),(typeof Lt.quotes=="boolean"||typeof Lt.quotes=="function"||Array.isArray(Lt.quotes))&&(Ft=Lt.quotes),typeof Lt.skipEmptyLines!="boolean"&&typeof Lt.skipEmptyLines!="string"||(mt=Lt.skipEmptyLines),typeof Lt.newline=="string"&&(vt=Lt.newline),typeof Lt.quoteChar=="string"&&(ct=Lt.quoteChar),typeof Lt.header=="boolean"&&(jt=Lt.header),Array.isArray(Lt.columns)){if(Lt.columns.length===0)throw new Error("Option columns is empty");xt=Lt.columns}Lt.escapeChar!==void 0&&(dt=Lt.escapeChar+ct),(typeof Lt.escapeFormulae=="boolean"||Lt.escapeFormulae instanceof RegExp)&&(At=Lt.escapeFormulae instanceof RegExp?Lt.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var Rt=new RegExp(Ct(ct),"g");if(typeof It=="string"&&(It=JSON.parse(It)),Array.isArray(It)){if(!It.length||Array.isArray(It[0]))return St(null,It,mt);if(typeof It[0]=="object")return St(xt||Object.keys(It[0]),It,mt)}else if(typeof It=="object")return typeof It.data=="string"&&(It.data=JSON.parse(It.data)),Array.isArray(It.data)&&(It.fields||(It.fields=It.meta&&It.meta.fields||xt),It.fields||(It.fields=Array.isArray(It.data[0])?It.fields:typeof It.data[0]=="object"?Object.keys(It.data[0]):[]),Array.isArray(It.data[0])||typeof It.data[0]=="object"||(It.data=[It.data])),St(It.fields||[],It.data||[],mt);throw new Error("Unable to serialize unrecognized input");function St(Et,Nt,tr){var ir="";typeof Et=="string"&&(Et=JSON.parse(Et)),typeof Nt=="string"&&(Nt=JSON.parse(Nt));var nr=Array.isArray(Et)&&0=this._config.preview;if(tt)j.postMessage({results:vt,workerId:it.WORKER_ID,finished:dt});else if(Ot(this._config.chunk)&&!Ft){if(this._config.chunk(vt,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);vt=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(vt.data),this._completeResults.errors=this._completeResults.errors.concat(vt.errors),this._completeResults.meta=vt.meta),this._completed||!dt||!Ot(this._config.complete)||vt&&vt.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),dt||vt&&vt.meta.paused||this._nextChunk(),vt}this._halted=!0},this._sendError=function(Lt){Ot(this._config.error)?this._config.error(Lt):tt&&this._config.error&&j.postMessage({workerId:it.WORKER_ID,error:Lt,finished:!1})}}function at(It){var Lt;(It=It||{}).chunkSize||(It.chunkSize=it.RemoteChunkSize),ot.call(this,It),this._nextChunk=et?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(Ft){this._input=Ft,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(Lt=new XMLHttpRequest,this._config.withCredentials&&(Lt.withCredentials=this._config.withCredentials),et||(Lt.onload=zt(this._chunkLoaded,this),Lt.onerror=zt(this._chunkError,this)),Lt.open(this._config.downloadRequestBody?"POST":"GET",this._input,!et),this._config.downloadRequestHeaders){var Ft=this._config.downloadRequestHeaders;for(var jt in Ft)Lt.setRequestHeader(jt,Ft[jt])}if(this._config.chunkSize){var bt=this._start+this._config.chunkSize-1;Lt.setRequestHeader("Range","bytes="+this._start+"-"+bt)}try{Lt.send(this._config.downloadRequestBody)}catch(vt){this._chunkError(vt.message)}et&&Lt.status===0&&this._chunkError()}},this._chunkLoaded=function(){Lt.readyState===4&&(Lt.status<200||400<=Lt.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:Lt.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(Ft){var jt=Ft.getResponseHeader("Content-Range");return jt===null?-1:parseInt(jt.substring(jt.lastIndexOf("/")+1))}(Lt),this.parseChunk(Lt.responseText)))},this._chunkError=function(Ft){var jt=Lt.statusText||Ft;this._sendError(new Error(jt))}}function ut(It){var Lt,Ft;(It=It||{}).chunkSize||(It.chunkSize=it.LocalChunkSize),ot.call(this,It);var jt=typeof FileReader<"u";this.stream=function(bt){this._input=bt,Ft=bt.slice||bt.webkitSlice||bt.mozSlice,jt?((Lt=new FileReader).onload=zt(this._chunkLoaded,this),Lt.onerror=zt(this._chunkError,this)):Lt=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(bt.target.result)},this._chunkError=function(){this._sendError(Lt.error)}}function ht(It){var Lt;ot.call(this,It=It||{}),this.stream=function(Ft){return Lt=Ft,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var Ft,jt=this._config.chunkSize;return jt?(Ft=Lt.substring(0,jt),Lt=Lt.substring(jt)):(Ft=Lt,Lt=""),this._finished=!Lt,this.parseChunk(Ft)}}}function yt(It){ot.call(this,It=It||{});var Lt=[],Ft=!0,jt=!1;this.pause=function(){ot.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){ot.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(bt){this._input=bt,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){jt&&Lt.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),Lt.length?this.parseChunk(Lt.shift()):Ft=!0},this._streamData=zt(function(bt){try{Lt.push(typeof bt=="string"?bt:bt.toString(this._config.encoding)),Ft&&(Ft=!1,this._checkIsFinished(),this.parseChunk(Lt.shift()))}catch(vt){this._streamError(vt)}},this),this._streamError=zt(function(bt){this._streamCleanUp(),this._sendError(bt)},this),this._streamEnd=zt(function(){this._streamCleanUp(),jt=!0,this._streamData("")},this),this._streamCleanUp=zt(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function wt(It){var Lt,Ft,jt,bt=Math.pow(2,53),vt=-bt,ct=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,dt=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,mt=this,xt=0,At=0,Rt=!1,St=!1,Tt=[],Et={data:[],errors:[],meta:{}};if(Ot(It.step)){var Nt=It.step;It.step=function(Qt){if(Et=Qt,nr())ir();else{if(ir(),Et.data.length===0)return;xt+=Qt.data.length,It.preview&&xt>It.preview?Ft.abort():(Et.data=Et.data[0],Nt(Et,mt))}}}function tr(Qt){return It.skipEmptyLines==="greedy"?Qt.join("").trim()==="":Qt.length===1&&Qt[0].length===0}function ir(){return Et&&jt&&(Kt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+it.DefaultDelimiter+"'"),jt=!1),It.skipEmptyLines&&(Et.data=Et.data.filter(function(Qt){return!tr(Qt)})),nr()&&function(){if(!Et)return;function Qt(qt,Jt){Ot(It.transformHeader)&&(qt=It.transformHeader(qt,Jt)),Tt.push(qt)}if(Array.isArray(Et.data[0])){for(var Ht=0;nr()&&Ht=Tt.length?"__parsed_extra":Tt[ur]),It.transform&&(Cr=It.transform(Cr,pr)),Cr=Zt(pr,Cr),pr==="__parsed_extra"?(xr[pr]=xr[pr]||[],xr[pr].push(Cr)):xr[pr]=Cr}return It.header&&(ur>Tt.length?Kt("FieldMismatch","TooManyFields","Too many fields: expected "+Tt.length+" fields but parsed "+ur,At+Jt):ur=lr.length/2?`\r -`:"\r"}(Qt,Jt)),jt=!1,It.delimiter)Ot(It.delimiter)&&(It.delimiter=It.delimiter(Qt),Et.meta.delimiter=It.delimiter);else{var ur=function(pr,Cr,Mr,lr,fr){var _r,Rr,kr,Ar;fr=fr||[","," ","|",";",it.RECORD_SEP,it.UNIT_SEP];for(var Pr=0;Pr=lr.length/2?`\r +`:"\r"}(Qt,Jt)),jt=!1,It.delimiter)Ot(It.delimiter)&&(It.delimiter=It.delimiter(Qt),Et.meta.delimiter=It.delimiter);else{var ur=function(pr,Cr,Mr,lr,fr){var _r,Sr,kr,Ar;fr=fr||[","," ","|",";",it.RECORD_SEP,it.UNIT_SEP];for(var $r=0;$r=ct)return Wt(!0)}else for(Or=xt,xt++;;){if((Or=Rt.indexOf(Lt,Or+1))===-1)return Tt||Kt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Zt.length,index:xt}),Gt();if(Or===Et-1)return Gt(Rt.substring(xt,Or).replace(Pr,Lt));if(Lt!==mt||Rt[Or+1]!==mt){if(Lt===mt||Or===0||Rt[Or-1]!==mt){kr!==-1&&kr=ct)return Wt(!0);break}Kt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Zt.length,index:xt}),Or++}}else Or++}return Gt();function Yt(yr){Zt.push(yr),Ht=xt}function er(yr){var Er=0;if(yr!==-1){var Sr=Rt.substring(Or+1,yr);Sr&&Sr.trim()===""&&(Er=Sr.length)}return Er}function Gt(yr){return Tt||(yr===void 0&&(yr=Rt.substring(xt)),Qt.push(yr),xt=Et,Yt(Qt),nr&&ar()),Wt()}function Vt(yr){xt=yr,Yt(Qt),Qt=[],Ar=Rt.indexOf(jt,xt)}function Wt(yr){return{data:Zt,errors:Kt,meta:{delimiter:Ft,linebreak:jt,aborted:At,truncated:!!yr,cursor:Ht+(St||0)}}}function ar(){vt(Wt()),Zt=[],Kt=[]}},this.abort=function(){At=!0},this.getCharIndex=function(){return xt}}function $t(It){var Lt=It.data,Ft=rt[Lt.workerId],jt=!1;if(Lt.error)Ft.userError(Lt.error,Lt.file);else if(Lt.results&&Lt.results.data){var bt={abort:function(){jt=!0,Mt(Lt.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:Bt,resume:Bt};if(Ot(Ft.userStep)){for(var vt=0;vt{const j=_.filter(ht=>ht.length>0),et=j.length;if(et<2||4{const a=useSelectedNetwork(),_=useToast(),$=useGetToken(),j=useAppDispatch(),et=useGetOwnedAccount(),tt=useGetBestSignerForAccount(),{onClose:rt}=reactExports.useContext(DynamicModalContext),{isLoading:nt,handleAsyncAction:it}=useAsyncActionHandler(),st=useForm({mode:"onBlur"}),{handleSubmit:ot,formState:{isValid:at,errors:ut}}=st,ht=async({file:yt,sender:wt})=>it(async()=>{const Ct=et(wt),Pt=await new Promise(Mt=>{Papa.parse(yt[0],{skipEmptyLines:!0,complete:Mt})});if(Pt.errors.length>0)throw new Error("Error loading csv file: "+Pt.errors.map(Mt=>Mt.message).join(", "));const $t=[];for(let Mt=0;Mt{const{openWith:a}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(Button,{onClick:()=>a(jsxRuntimeExports.jsx(CSVFileUploadForm,{})),variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",size:"sm",children:"Load CSV file"}),jsxRuntimeExports.jsx(FileArrowDownIcon,{stroke:"currentcolor"})]})},FilterController=({batchPending:a})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"24px",marginBottom:"24px",children:[jsxRuntimeExports.jsxs(Heading,{flex:1,color:colors.orangeL,size:"sm",children:[a," Pending"]}),jsxRuntimeExports.jsx(CSVFileUploader,{}),jsxRuntimeExports.jsx(ExternalLink,{marginLeft:"8px",href:"https://github.com/trilitech/umami-v2/wiki/Batch-file-specification",children:jsxRuntimeExports.jsxs(Button,{paddingRight:"0",variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",size:"sm",children:"See file specs"}),jsxRuntimeExports.jsx(ExternalLinkIcon,{stroke:"currentcolor"})]})})]}),BatchPage=()=>{const a=useBatches();return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Batch"}),jsxRuntimeExports.jsx(FilterController,{batchPending:a.length}),jsxRuntimeExports.jsx(Box,{overflowY:"auto",minHeight:"80%",children:a.length>0?a.map(_=>jsxRuntimeExports.jsx(BatchView,{operations:_},_.sender.address.pkh)):jsxRuntimeExports.jsx(NoItems,{description:"There are no batch transactions to show...",size:"lg",title:"No batches to show"})})]})},ClickableCard=({onClick:a,children:_,isSelected:$,...j})=>jsxRuntimeExports.jsx(Card,{justifyContent:"center",height:"66px",marginBottom:"10px",padding:"24px",border:"1px solid",borderColor:$?` ${colors.orangeL}`:"transparent",borderRadius:"lg",_hover:{border:`1px solid ${colors.gray[500]}`,bg:colors.gray[800]},cursor:a?"pointer":void 0,backgroundColor:colors.gray[900],onClick:a,...j,children:jsxRuntimeExports.jsx(CardBody,{padding:0,children:_})}),SettingsCardWithDrawerIcon=({left:a,isSelected:_,onClick:$})=>jsxRuntimeExports.jsx(ClickableCard,{isSelected:_,onClick:$,children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",height:"100%",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",width:"100%",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:a}),jsxRuntimeExports.jsx(ChevronRightIcon,{})]})})}),HelpView=()=>jsxRuntimeExports.jsxs(Grid,{gridGap:"1",gridTemplateRows:"0fr 1fr 1fr",gridTemplateColumns:"1fr 1fr",gridTemplateAreas:` +`);var xt=0,At=!1;this.parse=function(Rt,St,Tt){if(typeof Rt!="string")throw new Error("Input must be a string");var Et=Rt.length,Nt=Ft.length,tr=jt.length,ir=bt.length,nr=Ot(vt),Zt=[],Kt=[],Qt=[],Ht=xt=0;if(!Rt)return Wt();if(It.header&&!St){var qt=Rt.split(jt)[0].split(Ft),Jt=[],ur={},xr=!1;for(var pr in qt){var Cr=qt[pr];Ot(It.transformHeader)&&(Cr=It.transformHeader(Cr,pr));var Mr=Cr,lr=ur[Cr]||0;for(0=ct)return Wt(!0)}else for(Or=xt,xt++;;){if((Or=Rt.indexOf(Lt,Or+1))===-1)return Tt||Kt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Zt.length,index:xt}),Gt();if(Or===Et-1)return Gt(Rt.substring(xt,Or).replace($r,Lt));if(Lt!==mt||Rt[Or+1]!==mt){if(Lt===mt||Or===0||Rt[Or-1]!==mt){kr!==-1&&kr=ct)return Wt(!0);break}Kt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Zt.length,index:xt}),Or++}}else Or++}return Gt();function Yt(yr){Zt.push(yr),Ht=xt}function er(yr){var Er=0;if(yr!==-1){var Rr=Rt.substring(Or+1,yr);Rr&&Rr.trim()===""&&(Er=Rr.length)}return Er}function Gt(yr){return Tt||(yr===void 0&&(yr=Rt.substring(xt)),Qt.push(yr),xt=Et,Yt(Qt),nr&&ar()),Wt()}function Vt(yr){xt=yr,Yt(Qt),Qt=[],Ar=Rt.indexOf(jt,xt)}function Wt(yr){return{data:Zt,errors:Kt,meta:{delimiter:Ft,linebreak:jt,aborted:At,truncated:!!yr,cursor:Ht+(St||0)}}}function ar(){vt(Wt()),Zt=[],Kt=[]}},this.abort=function(){At=!0},this.getCharIndex=function(){return xt}}function $t(It){var Lt=It.data,Ft=rt[Lt.workerId],jt=!1;if(Lt.error)Ft.userError(Lt.error,Lt.file);else if(Lt.results&&Lt.results.data){var bt={abort:function(){jt=!0,Mt(Lt.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:Bt,resume:Bt};if(Ot(Ft.userStep)){for(var vt=0;vt{const j=_.filter(ht=>ht.length>0),et=j.length;if(et<2||4{const a=useSelectedNetwork(),_=useToast(),$=useGetToken(),j=useAppDispatch(),et=useGetOwnedAccount(),tt=useGetBestSignerForAccount(),{onClose:rt}=reactExports.useContext(DynamicModalContext),{isLoading:nt,handleAsyncAction:it}=useAsyncActionHandler(),st=useForm({mode:"onBlur"}),{handleSubmit:ot,formState:{isValid:at,errors:ut}}=st,ht=async({file:yt,sender:wt})=>it(async()=>{const Ct=et(wt),Pt=await new Promise(Mt=>{Papa.parse(yt[0],{skipEmptyLines:!0,complete:Mt})});if(Pt.errors.length>0)throw new Error("Error loading csv file: "+Pt.errors.map(Mt=>Mt.message).join(", "));const $t=[];for(let Mt=0;Mt{const{openWith:a}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(Button,{onClick:()=>a(jsxRuntimeExports.jsx(CSVFileUploadForm,{})),variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",size:"sm",children:"Load CSV file"}),jsxRuntimeExports.jsx(FileArrowDownIcon,{stroke:"currentcolor"})]})},FilterController=({batchPending:a})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"24px",marginBottom:"24px",children:[jsxRuntimeExports.jsxs(Heading,{flex:1,color:colors.orangeL,size:"sm",children:[a," Pending"]}),jsxRuntimeExports.jsx(CSVFileUploader,{}),jsxRuntimeExports.jsx(ExternalLink,{marginLeft:"8px",href:"https://github.com/trilitech/umami-v2/wiki/Batch-file-specification",children:jsxRuntimeExports.jsxs(Button,{paddingRight:"0",variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",size:"sm",children:"See file specs"}),jsxRuntimeExports.jsx(ExternalLinkIcon,{stroke:"currentcolor"})]})})]}),BatchPage=()=>{const a=useBatches();return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Batch"}),jsxRuntimeExports.jsx(FilterController,{batchPending:a.length}),jsxRuntimeExports.jsx(Box,{overflowY:"auto",minHeight:"80%",children:a.length>0?a.map(_=>jsxRuntimeExports.jsx(BatchView,{operations:_},_.sender.address.pkh)):jsxRuntimeExports.jsx(NoItems,{description:"There are no batch transactions to show...",size:"lg",title:"No batches to show"})})]})},ClickableCard=({onClick:a,children:_,isSelected:$,...j})=>jsxRuntimeExports.jsx(Card,{justifyContent:"center",height:"66px",marginBottom:"10px",padding:"24px",border:"1px solid",borderColor:$?` ${colors.orangeL}`:"transparent",borderRadius:"lg",_hover:{border:`1px solid ${colors.gray[500]}`,bg:colors.gray[800]},cursor:a?"pointer":void 0,backgroundColor:colors.gray[900],onClick:a,...j,children:jsxRuntimeExports.jsx(CardBody,{padding:0,children:_})}),SettingsCardWithDrawerIcon=({left:a,isSelected:_,onClick:$})=>jsxRuntimeExports.jsx(ClickableCard,{isSelected:_,onClick:$,children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",height:"100%",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",width:"100%",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:a}),jsxRuntimeExports.jsx(ChevronRightIcon,{})]})})}),HelpView=()=>jsxRuntimeExports.jsxs(Grid,{gridGap:"1",gridTemplateRows:"0fr 1fr 1fr",gridTemplateColumns:"1fr 1fr",gridTemplateAreas:` "header header" "main main" "main main" - `,height:"100%",children:[jsxRuntimeExports.jsx(GridItem,{gridArea:"header",children:jsxRuntimeExports.jsx(TopBar,{title:"Help"})}),jsxRuntimeExports.jsxs(GridItem,{gridArea:"main",marginTop:1,children:[jsxRuntimeExports.jsx(HelpCard,{title:"Learn More",children:jsxRuntimeExports.jsx(HelpLinkRow,{about:"Browse Articles",externalLink:"https://medium.com/umamiwallet"})}),jsxRuntimeExports.jsxs(HelpCard,{title:"Need Help?",children:[jsxRuntimeExports.jsx(HelpLinkRow,{about:"Contact our Support Team",externalLink:"mailto:umami-support@trili.tech",linkDescription:"umami-support@trili.tech"}),jsxRuntimeExports.jsx(HelpLinkRow,{about:"Get in touch with the Community",externalLink:"https://join.slack.com/t/tezos-dev/shared_invite/zt-1ur1ymxrp-G_X_bFHrvWXwoeiy53J8lg",linkDescription:"Slack #Umami"})]}),jsxRuntimeExports.jsxs(HelpCard,{title:"Terms",children:[jsxRuntimeExports.jsx(HelpLinkRow,{about:"Read Terms of Service",externalLink:"https://umamiwallet.com/tos.html"}),jsxRuntimeExports.jsx(HelpLinkRow,{about:"Read Privacy Policy",externalLink:"https://umamiwallet.com/privacypolicy.html"})]})]})]}),HelpLinkRow=({about:a,externalLink:_,linkDescription:$})=>jsxRuntimeExports.jsx(Link,{rel:"noopener noreferrer",target:"_blank",to:_,children:jsxRuntimeExports.jsx(ClickableCard,{cursor:"pointer",isSelected:!1,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:a}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[$&&jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[400],size:"sm",children:$}),jsxRuntimeExports.jsx(ExternalLinkIcon,{})]})]})})}),HelpCard=({title:a,children:_})=>jsxRuntimeExports.jsx(Box,{"data-testid":"help-card",marginY:"10px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(Box,{width:"550px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"16px",size:"lg",children:a}),_]})})}),ConnectOptions=({goToStep:a})=>{const _=useImplicitAccounts().length>0;return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LinkIcon,{}),title:"Connect or Import Account",children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:"16px",children:[jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>a({type:"restoreMnemonic"}),size:"lg",children:"Import with Seed Phrase"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>a({type:"restoreSecretKey"}),size:"lg",variant:"tertiary",children:"Import with Secret Key"}),!_&&jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>a({type:"restoreBackup"}),size:"lg",variant:"tertiary",children:"Restore from Backup"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>a({type:"nameAccount",account:{type:"ledger"}}),size:"lg",variant:"tertiary",children:"Connect ledger"})]})})},IS_DEV=!1,ConnectOrCreate=({goToStep:a,closeModal:_})=>{const{handleAsyncAction:$}=useAsyncActionHandler(),j=useRestoreSocial(),et=useToast(),tt=(rt,nt)=>$(async()=>{const{pk:it,pkh:st}=await getPublicKeyPairFromSk(rt);j(it,st,nt),et({description:`Successfully added ${nt} account`,status:"success"}),_()});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(WalletPlusIcon,{}),title:"Connect or Create Account",children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:"16px",children:[jsxRuntimeExports.jsx(Button,{width:"100%",onClick:rt=>a({type:"notice"}),size:"lg",children:"Create a new Account"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:rt=>a({type:"connectOptions"}),size:"lg",variant:"tertiary",children:"I already have a wallet"}),IS_DEV,jsxRuntimeExports.jsxs(Flex,{width:"100%",paddingTop:"14px",paddingBottom:"6px",children:[jsxRuntimeExports.jsx(Divider,{marginTop:"11px"}),jsxRuntimeExports.jsx(Text,{minWidth:"160px",color:colors.gray[400],textAlign:"center",noOfLines:1,size:"sm",children:"Continue with Google"}),jsxRuntimeExports.jsx(Divider,{marginTop:"11px"})]}),jsxRuntimeExports.jsx(GoogleAuth,{onAuth:tt})]})})},Select=({selected:a,options:_,onChange:$})=>{const[j,et]=reactExports.useState(a),[tt,rt]=reactExports.useState(!1);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",height:"48px",padding:"12px 15px 15px 15px",color:colors.gray[300],background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px",_hover:{borderColor:colors.gray[450]},cursor:"pointer","data-testid":"select-input",onClick:()=>rt(nt=>!nt),children:[jsxRuntimeExports.jsx(Text,{size:"sm",children:j.label}),jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginTop:"2px"})]}),tt&&jsxRuntimeExports.jsx(UnorderedList,{position:"absolute",zIndex:2,width:"100%",margin:0,marginTop:"8px",padding:"15px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"select-options",listStyleType:"none",children:_.map(nt=>jsxRuntimeExports.jsx(ListItem,{marginBottom:"5px",padding:"11px",color:colors.gray[300],background:"transparent",borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",onClick:()=>{rt(!1),et(nt),$(nt.value)},children:jsxRuntimeExports.jsx(Text,{size:"sm",children:nt.label})},nt.value))})]})},DerivationPath=({goToStep:a,account:_})=>{const[$,j]=reactExports.useState(!1),{handleSubmit:et,register:tt,setValue:rt,formState:{isValid:nt,errors:it}}=useForm({mode:"onBlur",defaultValues:{derivationPathTemplate:defaultDerivationPathTemplate,derivationPath:getDefaultDerivationPath(0)}}),st=async({derivationPathTemplate:ot,derivationPath:at})=>{switch(_.type){case"ledger":return a($?{type:"restoreLedger",account:{..._,derivationPath:normalizeDerivationPath(at)}}:{type:"restoreLedger",account:{..._,derivationPathTemplate:normalizeDerivationPath(ot)}});case"mnemonic":{if($){const ut=await deriveSecretKey(_.mnemonic,at,"ed25519");return a({type:"masterPassword",account:{type:"secret_key",secretKey:ut,label:_.label}})}return a({type:"masterPassword",account:{..._,derivationPathTemplate:ot}})}}};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(SlashIcon,{}),subtitle:"Choose a custom derivation path or select the default derivation path and use the default key.",title:"Derivation Path",children:jsxRuntimeExports.jsxs("form",{onSubmit:et(st),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(Center,{width:"100%",marginBottom:"12px",children:[jsxRuntimeExports.jsx(Text,{fontWeight:$?400:600,size:"sm",children:"Default Path"}),jsxRuntimeExports.jsx(Switch,{"data-testid":"custom-path-switch",marginX:"10px",onChange:()=>j(ot=>!ot),variant:"danger"}),jsxRuntimeExports.jsx(Text,{fontWeight:$?600:400,size:"sm",children:"Custom Path"})]}),$&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Center,{marginTop:"16px",marginBottom:"32px",children:jsxRuntimeExports.jsx(Text,{width:"340px",color:colors.orange,textAlign:"center",size:"xs",children:"Please write down to your derivation path. You may not be able to restore your data if you lose it."})}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"20px",isInvalid:!!it.derivationPath,children:[jsxRuntimeExports.jsx(Input,{fontSize:"sm",textAlign:"center","data-testid":"custom-path-input",...tt("derivationPath",{validate:validateDerivationPath})}),it.derivationPath&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"error-message",children:it.derivationPath.message})]})]}),!$&&jsxRuntimeExports.jsx(FormControl,{marginTop:"32px",marginBottom:"20px",children:jsxRuntimeExports.jsx(Select,{onChange:ot=>rt("derivationPathTemplate",ot),options:AVAILABLE_DERIVATION_PATH_TEMPLATES,selected:DEFAULT_DERIVATION_PATH_TEMPLATE})}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"12px",isDisabled:!nt,size:"lg",type:"submit",children:"Continue"}),jsxRuntimeExports.jsx(ExternalLink,{display:"block",width:"100%",marginTop:"32px",textAlign:"center",href:"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki",children:jsxRuntimeExports.jsx(Tooltip,{backgroundColor:"white",defaultIsOpen:!1,hasArrow:!0,label:"Derivation path is a set of directions that helps create different secret keys; it starts from a master key or seed.",children:jsxRuntimeExports.jsx(Text,{color:colors.blue,fontWeight:600,textDecoration:"underline",_hover:{textDecoration:"underline"},size:"sm",children:"What's a Derivation Path?"})})})]})})},normalizeDerivationPath=a=>a.trim().toLowerCase().replace("m/",""),validateDerivationPath=a=>{const _=normalizeDerivationPath(a);return _.length===0?"Derivation path is required":_.startsWith("44'/1729'/")?_.match(new RegExp("^44'/1729'/([0-9]+'/)*([0-9]+')$"))?!0:"Invalid derivation path":"Derivation path must start with `44'/1729'/`"},Eula=({goToStep:a})=>{const[_,$]=React$2.useState(!1);return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(DocumentIcon,{}),title:"Accept to Continue",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Checkbox,{paddingBottom:"24px",fontWeight:"600",onChange:j=>$(j.target.checked),children:["I confirm that I have read and agreed with the"," ",jsxRuntimeExports.jsx(Link$1,{textDecoration:"underline",_hover:{color:colors.green},href:"https://umamiwallet.com/tos.html",rel:"noopener noreferrer",target:"_blank",children:"Terms of Service"})," ","and the"," ",jsxRuntimeExports.jsx(Link$1,{textDecoration:"underline",_hover:{color:colors.green},href:"https://umamiwallet.com/privacypolicy.html",rel:"noopener noreferrer",target:"_blank",children:"Privacy Policy"})]}),jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!_,onClick:()=>{a({type:"connectOrCreate"})},size:"lg",children:"Continue"})]})})},FakeAccount=({onClose:a})=>{const{register:_,handleSubmit:$,formState:{errors:j}}=useForm({mode:"onBlur"}),et=useRestoreLedger(),tt=async({pkh:rt,name:nt})=>{const st=await new RpcClient(MAINNET.rpcUrl).getManagerKey(rt),ot=typeof st=="string"?st:st.key;et(defaultDerivationPathTemplate,makeDerivationPath(defaultDerivationPathTemplate,0),ot,rt,nt),a()};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(WalletPlusIcon,{}),title:"Add a Fake Account",children:jsxRuntimeExports.jsxs("form",{onSubmit:$(tt),style:{width:"100%"},children:[jsxRuntimeExports.jsx(Text,{children:"It will be restored as a ledger account"}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.pkh,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Address"}),jsxRuntimeExports.jsx(Input,{..._("pkh",{required:!0}),autoComplete:"off",placeholder:"Please enter the account address"})]}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Name"}),jsxRuntimeExports.jsx(Input,{..._("name",{required:!0}),autoComplete:"off",placeholder:"Please enter the account name"})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:2,size:"lg",type:"submit",children:"Add account"})]})})},EnterAndConfirmPassword=({onSubmit:a,isLoading:_})=>{const $=useForm({mode:"onBlur"}),{handleSubmit:j,formState:{errors:et,isValid:tt},getValues:rt}=$,nt=({confirm:it})=>a(it);return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LockIcon,{}),subtitle:"Please choose a master password for Umami. You will need to use this password in order to perform any operations within Umami.",title:"Umami Master Password",children:jsxRuntimeExports.jsx(FormProvider,{...$,children:jsxRuntimeExports.jsxs("form",{onSubmit:j(nt),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!et.password,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password",inputName:"password",placeholder:"Enter master password"}),et.password&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.password.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!et.confirm,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"confirmation",inputName:"confirm",label:"Confirm Password",placeholder:"Confirm your password",required:"Confirmation is required",validate:it=>rt("password")===it||"Your passwords do no match"}),et.confirm&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.confirm.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!tt||_,isLoading:_,size:"lg",type:"submit",children:"Submit"})]})})})},EnterPassword=({onSubmit:a,isLoading:_})=>{const $=useForm({mode:"onBlur"}),{handleSubmit:j,formState:{errors:et,isValid:tt}}=$,rt=nt=>{a(nt.password)};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LockIcon,{}),subtitle:"Enter your master password for Umami.",title:"Umami Master Password",children:jsxRuntimeExports.jsx(FormProvider,{...$,children:jsxRuntimeExports.jsxs("form",{onSubmit:j(rt),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!et.password,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password",inputName:"password"}),et.password&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.password.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!tt,isLoading:_,size:"lg",type:"submit",children:"Submit"})]})})})},MasterPassword=({account:a,onClose:_})=>{const $=useRestoreFromMnemonic(),j=useRestoreFromSecretKey(),et=useValidateMasterPassword(),tt=et!==null,{isLoading:rt,handleAsyncAction:nt}=useAsyncActionHandler(),it=useToast(),st=ot=>nt(async()=>{switch(tt&&await et(ot),a.type){case"secret_key":await j(a.secretKey,ot,a.label);break;case"mnemonic":await $({...a,password:ot})}it({description:"Account successfully created!",status:"success"}),_()});return tt?jsxRuntimeExports.jsx(EnterPassword,{isLoading:rt,onSubmit:st}):jsxRuntimeExports.jsx(EnterAndConfirmPassword,{isLoading:rt,onSubmit:st})},Notice=({goToStep:a})=>{const _=[{content:"Write down your seed phrase and store it in a safe place."},{content:"Make sure there is no one around you or looking over your shoulder."},{content:"Do not copy and paste the Seed Phrase or store it on your device."},{content:"Do not take a screenshot of your Seed Phrase."}];return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(NoticeIcon,{}),subtitle:"Please read the following before you continue to see your secret Seed Phrase.",title:"Important Notice",children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(OrderedList,{spacing:"16px",variant:"onboardingNotice",children:_.map(($,j)=>jsxRuntimeExports.jsx(ListItem,{fontSize:"16px",fontWeight:600,children:$.content},j))}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"28px",onClick:()=>a({type:"showSeedphrase",account:{type:"mnemonic",mnemonic:generate24WordMnemonic()}}),size:"lg",children:"I understand"}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"16px",onClick:()=>a({type:"restoreMnemonic"}),size:"lg",variant:"tertiary",children:"I already have a Seed Phrase"})]})})},RestoreBackupFile=()=>{const a=useForm({mode:"onBlur"}),{handleSubmit:_,register:$,formState:{errors:j,isValid:et}}=a,{handleAsyncAction:tt}=useAsyncActionHandler(),rt=useRestoreV1BackupFile(),nt=({password:it,file:st})=>tt(async()=>{const ot=await st[0].text(),at=JSON.parse(ot);if(at.recoveryPhrases&&at.derivationPaths)await rt(at,it);else if(at["persist:accounts"])await restoreV2BackupFile(at,it),reload();else throw new Error("Invalid backup file.")});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(RotateIcon,{}),subtitle:"Select a JSON backup file and enter the password you used to encrypt it.",title:"Restore from Backup",children:jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx("form",{onSubmit:_(nt),style:{width:"100%"},children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.file,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Upload File"}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Input,{padding:"2px","data-testid":"file-input",...$("file",{required:"File is required"}),accept:".json",type:"file",variant:"unstyled"})}),j.file&&jsxRuntimeExports.jsx(FormErrorMessage$1,{"data-testid":"file-errors",children:j.file.message})]}),jsxRuntimeExports.jsx(FormControl,{marginTop:"24px",children:jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password-input",inputName:"password",label:"Your password (if you have one)",required:!1})}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!et,size:"lg",type:"submit",children:"Import Wallet"})]})})})})},getPk=async a=>{const _=await TransportWebUSB.create(),$=new LedgerSigner(_,a,!0),j=await $.publicKey(),et=await $.publicKeyHash();return await _.close(),{pk:j,pkh:et}},LEDGER_TIMEOUT=60*1e3,RestoreLedger=({closeModal:a,account:_})=>{const $=useRestoreLedger(),j=useToast(),{isLoading:et,handleAsyncAction:tt}=useAsyncActionHandler(),rt=[{content:"Plug your Ledger into your computer using a USB cable."},{content:"Unlock your Ledger."},{content:"Make sure your Ledger has the latest firmware version."},{content:"Install and open the Tezos Wallet app on your Ledger."},{content:"Click the button below and confirm the action on your Ledger."}],nt=()=>tt(()=>withTimeout(async()=>{const it=j({description:"Please open the Tezos app on your Ledger and approve the operation",status:"info"}),st=_.derivationPathTemplate?makeDerivationPath(_.derivationPathTemplate,0):_.derivationPath,{pk:ot,pkh:at}=await getPk(st);$(_.derivationPathTemplate,st,ot,at,_.label),j.close(it),j({description:"Account successfully created!",status:"success"}),a()},LEDGER_TIMEOUT),it=>it.name==="PublicKeyRetrievalError"?{description:"Request rejected. Please unlock your Ledger and open the Tezos app"}:it.name==="InvalidStateError"?{description:"Request pending. Check your ledger..."}:{description:`Ledger error. ${it.message||it.name}`});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(USBIcon,{}),subtitle:"Complete the steps to connect.",title:"Connect Ledger",children:jsxRuntimeExports.jsxs(VStack,{overflowY:"auto",spacing:"24px",children:[jsxRuntimeExports.jsx(OrderedList,{spacing:4,children:rt.map((it,st)=>jsxRuntimeExports.jsx(ListItem,{children:it.content},st))}),jsxRuntimeExports.jsx(Button,{width:"100%",isLoading:et,onClick:nt,size:"lg",children:"Export Public Key"})]})})},MnemonicAutocomplete=({inputName:a,validate:_,inputProps:$,listProps:j})=>{const[et,tt]=reactExports.useState(!0),{register:rt,setValue:nt,watch:it}=useFormContext(),st=it(a),ot=wordlists.EN.filter(ut=>st&&ut.startsWith(st)).sort(),at=!et&&ot.length>0&&(ot.length>1||ot[0]!==st);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Input,{zIndex:0,autoComplete:"off","data-testid":"mnemonic-input",onFocus:()=>tt(!1),placeholder:"Type here...",...rt(a,{required:"Required",validate:_,onChange:()=>tt(!1),onBlur:()=>tt(!0)}),...$}),at&&jsxRuntimeExports.jsx(UnorderedList,{"data-testid":"suggestions",variant:"suggestions",...j,children:ot.map(ut=>jsxRuntimeExports.jsx(ListItem,{paddingTop:"2px",fontSize:"14px",fontWeight:600,"data-testid":"suggestion",onMouseDown:()=>nt(a,ut),paddingX:"7px",children:ut},ut))})]})},mnemonicSizes=[12,15,18,24],RestoreMnemonic=({goToStep:a})=>{const _=useForm({mode:"onBlur"}),{handleSubmit:$,setValue:j,trigger:et,formState:{isValid:tt}}=_,{handleAsyncAction:rt}=useAsyncActionHandler(),[nt,it]=reactExports.useState(24),st=ut=>{const ht=Number(ut);if(mnemonicSizes.includes(ht))return it(yt=>(yt>ht&&lodashExports.range(ht,Math.max(...mnemonicSizes)).forEach(wt=>{j(`word${wt}`,void 0)}),ht)),et()},ot=ut=>rt(async()=>{const ht=ut.split(" ");if(!mnemonicSizes.includes(ht.length))throw new Error(`the mnemonic must be ${mnemonicSizes.join(", ")} words long`);return ht.slice(0,nt).forEach((yt,wt)=>{j(`word${wt}`,yt)}),et()}),at=ut=>rt(async()=>{const ht=Object.values(ut).join(" ").trim();if(!validateMnemonic_1(ht))throw new Error(`Invalid Mnemonic: "${ht}"`);return a({type:"nameAccount",account:{type:"mnemonic",mnemonic:ht}}),Promise.resolve()});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px",stroke:colors.gray[450]}),subtitle:"Please fill in the Seed Phrase in sequence.",title:"Import Seed Phrase",children:jsxRuntimeExports.jsx(Box,{overflowX:"hidden",children:jsxRuntimeExports.jsx(FormProvider,{..._,children:jsxRuntimeExports.jsx("form",{onSubmit:$(at),style:{width:"100%"},children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:4,children:[jsxRuntimeExports.jsx(Select$1,{height:"48px",color:colors.gray[450],"data-testid":"select",icon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),onChange:ut=>st(ut.target.value),value:nt,children:mnemonicSizes.reverse().map(ut=>jsxRuntimeExports.jsxs("option",{value:ut,children:[ut," Words"]},ut))}),jsxRuntimeExports.jsx(Grid,{gridGap:3,gridTemplateColumns:"repeat(3, 1fr)",paddingBottom:"20px",children:lodashExports.range(nt).map(ut=>{const ht=`word${ut}`;return jsxRuntimeExports.jsxs(GridItem,{display:"flex",height:"38px",padding:"4px",fontSize:"sm",background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px",children:[jsxRuntimeExports.jsx(Heading,{width:"19px",marginRight:"6px",paddingTop:"6px",color:colors.gray[400],textAlign:"right",size:"sm",children:ut+1}),jsxRuntimeExports.jsx(MnemonicAutocomplete,{inputName:ht,inputProps:{onPaste:async yt=>{yt.preventDefault();const wt=await navigator.clipboard.readText();return ot(wt)},border:"none",size:"xsmall"},listProps:{width:"126px",marginTop:"38px",marginLeft:"-5px"}})]},ut)})}),jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!tt,size:"lg",type:"submit",children:"Continue"}),IS_DEV]})})})})})},RestoreSecretKey=({goToStep:a})=>{const[_,$]=reactExports.useState(!1),{handleAsyncAction:j}=useAsyncActionHandler(),{register:et,handleSubmit:tt,formState:{errors:rt,isValid:nt}}=useForm({mode:"onBlur",defaultValues:{password:""}}),it=async({secretKey:st,password:ot})=>j(async()=>{try{const ut=await(await InMemorySigner.fromSecretKey(st.trim(),ot)).secretKey();a({type:"nameAccount",account:{type:"secret_key",secretKey:ut}})}catch(at){const ut=at.message||"";throw ut.includes("Cannot read properties of null (reading 'slice')")?new Error("Key-password pair is invalid"):ut.includes("Invalid checksum")?new Error("Invalid secret key: checksum doesn't match"):at}});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px",stroke:colors.gray[450]}),title:"Insert Secret Key",children:jsxRuntimeExports.jsxs("form",{onSubmit:tt(it),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!rt.secretKey,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Secret Key"}),jsxRuntimeExports.jsx(Textarea,{minHeight:"130px","data-testid":"secret-key",...et("secretKey",{required:"Secret key is required",onChange:st=>$(isEncryptedSecretKeyPrefix(st.target.value.trim()))}),placeholder:"Your secret key"}),rt.secretKey&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:rt.secretKey.message})]}),_&&jsxRuntimeExports.jsxs(FormControl,{marginTop:"20px",isInvalid:!!rt.password,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Password"}),jsxRuntimeExports.jsx(Input,{"data-testid":"password",...et("password",{validate:st=>{if(!st.trim())return"Password is required"}})}),rt.password&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:rt.password.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!nt,size:"lg",type:"submit",children:"Continue"})]})})},ShowSeedphrase=({goToStep:a,account:_})=>jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px",stroke:colors.gray[450]}),subtitle:"Please record the following 24 words in sequence in order to restore it in the future.",title:"Record Seed Phrase",children:jsxRuntimeExports.jsxs(VStack,{children:[jsxRuntimeExports.jsx(SimpleGrid,{columns:3,spacing:2,children:_.mnemonic.split(" ").map(($,j)=>jsxRuntimeExports.jsxs(Flex,{width:"126px",padding:"6px",border:"1px dashed",borderColor:colors.gray[500],borderRadius:"4px",children:[jsxRuntimeExports.jsx(Heading,{width:"18px",marginRight:"10px",paddingTop:"2px",color:colors.gray[450],textAlign:"right",size:"sm",children:j+1}),jsxRuntimeExports.jsx(Text,{"data-testid":`mnemonic-word-${j}`,size:"sm",children:$})]},j))}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"20px",onClick:$=>{a({type:"verifySeedphrase",account:_})},size:"lg",children:"OK, I've recorded it"})]})}),VerifySeedphrase=({goToStep:a,account:_})=>{const $=_.mnemonic.split(" "),j=useForm({mode:"onBlur"}),{handleSubmit:et,formState:{errors:tt,isValid:rt}}=j,[nt]=reactExports.useState(selectRandomElements($,5)),it=()=>a({type:"nameAccount",account:_});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(DoubleCheckmarkIcon,{}),subtitle:"To verify, please type in the word that corresponds to each sequence number.",title:"Verify Seed Phrase",children:jsxRuntimeExports.jsx(Box,{overflowX:"hidden",overflowY:"auto",width:"100%",children:jsxRuntimeExports.jsx(FormProvider,{...j,children:jsxRuntimeExports.jsxs("form",{onSubmit:et(it),children:[nt.map((st,ot)=>{const at=`${st.index}`,ut=tt[at];return jsxRuntimeExports.jsxs(FormControl,{marginBottom:"12px",isInvalid:!!ut,children:[jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:1,width:"26px",marginTop:"12px",marginLeft:"4px",textAlign:"right","data-testid":"mnemonic-index",children:st.index+1}),jsxRuntimeExports.jsx(Box,{width:"100%",children:jsxRuntimeExports.jsx(MnemonicAutocomplete,{inputName:at,inputProps:{paddingLeft:"36px",size:"md"},listProps:{marginTop:"6px"},validate:ht=>{if(ht!==st.value)return"Word doesn't match"}})}),(ut==null?void 0:ut.message)&&jsxRuntimeExports.jsx(FormErrorMessage,{children:ut.message})]},ot)}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"20px",isDisabled:!rt,size:"lg",type:"submit",children:"Continue"}),IS_DEV]})})})})},useStepHistory=a=>{const[_,$]=reactExports.useState(a),[j,et]=reactExports.useState([_]),tt=j.length===1;return{reset:()=>{$(a),et([a])},goToStep:rt=>{$(rt),et([...j,rt])},currentStep:_,goBack:()=>{if(tt)return;j.pop();const rt=j[j.length-1];et(j),$(rt)},atInitialStep:tt,fullHistory:j}},useOnboardingModal=a=>{const{isOpen:_,onOpen:$,onClose:j}=useDisclosure$1(),et=useImplicitAccounts().length!==0,tt=useStepHistory({type:et?"connectOrCreate":"eula"}),{currentStep:rt,goToStep:nt}=tt,it=()=>{tt.reset(),a&&a(),j()},st=()=>{switch(rt.type){case"eula":return jsxRuntimeExports.jsx(Eula,{goToStep:nt});case"connectOrCreate":return jsxRuntimeExports.jsx(ConnectOrCreate,{closeModal:it,goToStep:nt});case"connectOptions":return jsxRuntimeExports.jsx(ConnectOptions,{goToStep:nt});case"notice":return jsxRuntimeExports.jsx(Notice,{goToStep:nt});case"restoreMnemonic":return jsxRuntimeExports.jsx(RestoreMnemonic,{goToStep:nt});case"restoreBackup":return jsxRuntimeExports.jsx(RestoreBackupFile,{});case"showSeedphrase":return jsxRuntimeExports.jsx(ShowSeedphrase,{goToStep:nt,...rt});case"verifySeedphrase":return jsxRuntimeExports.jsx(VerifySeedphrase,{goToStep:nt,...rt});case"nameAccount":return jsxRuntimeExports.jsx(NameAccount,{goToStep:nt,...rt});case"derivationPath":return jsxRuntimeExports.jsx(DerivationPath,{goToStep:nt,...rt});case"restoreLedger":return jsxRuntimeExports.jsx(RestoreLedger,{closeModal:it,...rt});case"masterPassword":return jsxRuntimeExports.jsx(MasterPassword,{onClose:it,...rt});case"fakeAccount":return jsxRuntimeExports.jsx(FakeAccount,{onClose:j});case"restoreSecretKey":return jsxRuntimeExports.jsx(RestoreSecretKey,{goToStep:nt})}};return{modalElement:jsxRuntimeExports.jsxs(Modal,{autoFocus:!1,closeOnOverlayClick:!1,isCentered:!0,isOpen:_,onClose:it,children:[et&&jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(ModalContent,{children:[!tt.atInitialStep&&jsxRuntimeExports.jsx(ModalBackButton,{onClick:tt.goBack}),jsxRuntimeExports.jsx(ModalCloseButton,{onClick:it}),st()]})]}),onOpen:$}},AccountListHeader=()=>{const{onOpen:a,modalElement:_}=useOnboardingModal();return jsxRuntimeExports.jsxs(Flex,{flexDirection:"row-reverse",marginTop:"12px",marginBottom:"16px",children:[jsxRuntimeExports.jsxs(Button,{paddingRight:"0",onClick:a,variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(AddAccountIcon,{stroke:"currentcolor"}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:"Add Account"})]}),_]})},AccountGroupPopover=({onRemove:a,onCreate:_})=>jsxRuntimeExports.jsx(PopoverMenu,{children:jsxRuntimeExports.jsxs(Box,{paddingY:"0",children:[jsxRuntimeExports.jsx(Button,{height:_?"24px":"28px","data-testid":"popover-remove",onClick:a,variant:"popover",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Remove"}),jsxRuntimeExports.jsx(TrashIcon,{stroke:"inherit"})]})}),_&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{marginY:"4px"}),jsxRuntimeExports.jsx(Button,{onClick:_,variant:"popover",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Create"}),jsxRuntimeExports.jsx(PlusIcon,{width:"18px",height:"18px",stroke:"inherit"})]})})]})]})}),DeriveMnemonicAccountModal=({onDone:a,fingerPrint:_})=>{const[$,j]=reactExports.useState(),{isLoading:et,handleAsyncAction:tt}=useAsyncActionHandler(),rt=useToast(),nt=useDeriveMnemonicAccount(),it=({name:st,password:ot})=>tt(async()=>{await nt({fingerPrint:_,password:ot,label:st.trim()||DEFAULT_ACCOUNT_LABEL}),a(),rt({description:`New account created! Successfully derived account from ${_}`})},{title:"Failed to derive new account"});return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),$?jsxRuntimeExports.jsx(EnterPassword,{isLoading:et,onSubmit:st=>it({name:$,password:st})}):jsxRuntimeExports.jsx(NameAccountDisplay,{onSubmit:st=>j(st.accountName),subtitle:`Name the new account derived from ${_}`})]})},getAccountGroupLabel=a=>{switch(a.type){case"mnemonic":return`Seedphrase ${a.seedFingerPrint}`;case"social":return"Social Accounts";case"ledger":return"Ledger Accounts";case"secret_key":return"Secret Key Accounts";case"multisig":return"Multisig Accounts"}},AccountGroup=({groupLabel:a,accounts:_,balances:$})=>{const j=_[0],et=j.type==="multisig",tt=j.type==="mnemonic",{openWith:rt,onClose:nt}=reactExports.useContext(DynamicModalContext),it=useRemoveMnemonic(),st=useRemoveNonMnemonic(),ot=useImplicitAccounts().length===_.length,at="Remove All Accounts";let ut,ht="Remove All";const yt=getAccountGroupLabel(j);ot?(ut="Removing all your accounts will off-board you from Umami. This will remove or reset all customized settings to their defaults. Personal data (including saved contacts, password and accounts) won't be affected.",ht="Remove & Off-board"):tt?ut=`Are you sure you want to remove all accounts derived from ${yt}?`:ut=`Are you sure you want to remove all of your ${yt}?`;const wt=()=>rt(jsxRuntimeExports.jsx(ConfirmationModal,{buttonLabel:ht,description:ut,onSubmit:()=>{tt?it(j.seedFingerPrint):et||st(j.type),nt()},title:at})),Ct=()=>{if(!tt)throw new Error("Can't derive a non mnemonic account!");return rt(jsxRuntimeExports.jsx(DeriveMnemonicAccountModal,{fingerPrint:j.seedFingerPrint,onDone:nt}))};return jsxRuntimeExports.jsxs(Box,{"data-testid":`account-group-${a}`,children:[jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",marginTop:"24px",marginBottom:"16px",children:[jsxRuntimeExports.jsx(Heading,{"data-testid":"account-group-title",size:"md",children:a}),!et&&jsxRuntimeExports.jsx(AccountGroupPopover,{onCreate:tt?Ct:void 0,onRemove:wt})]}),_.map(Pt=>jsxRuntimeExports.jsx(Box,{marginBottom:"16px",children:jsxRuntimeExports.jsx(AccountTile,{account:Pt,balance:$[Pt.address.pkh]})},Pt.address.pkh))]})},NestedScroll=a=>jsxRuntimeExports.jsx(Box,{overflowY:"auto",height:"100%",children:a.children});var indicator$1=function a(_){_=Math.abs(_);var $=_%100;if($>=10&&$<=20)return"th";var j=_%10;return j===1?"st":j===2?"nd":j===3?"rd":"th"},indicator=indicator$1;function ordinal(a){if(typeof a!="number")throw new TypeError("Expected Number, got "+typeof a+" "+a);return Number.isFinite(a)?a+indicator(a):a}ordinal.indicator=indicator;var ordinal_1=ordinal;const ordinal$1=getDefaultExportFromCjs$1(ordinal_1),SignTransactionFormPage=a=>{const _=useAppDispatch(),{isLoading:$,handleAsyncAction:j}=useAsyncActionHandler(),{mode:et,operations:tt,fee:rt,data:{threshold:nt,signers:it,name:st}}=a,{fee:ot,operations:at,estimationFailed:ut,isLoading:ht,form:yt,reEstimate:wt,signer:Ct,onSign:Pt}=useSignPageHelpers(rt,tt,et),$t=$||ht,Mt=Bt=>j(async()=>{const Dt=await Pt(Bt);if(!Dt)throw new Error("An error occurred during contract origination");const zt=(await Dt.getOriginatedContractAddresses())[0];_(multisigActions.addMultisigLabel({pkh:zt,label:st}))});return jsxRuntimeExports.jsx(FormProvider,{...yt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,description:"Please review the details and then continue to submit contract.",operationsType:at.type,signer:Ct,title:"Review & Submit"}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Text,{marginBottom:"24px",padding:"14px",color:colors.gray[50],background:colors.gray[800],borderRadius:"6px","data-testid":"contract-name",children:st}),jsxRuntimeExports.jsx(FormLabel,{children:"Approvers"}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column",gap:"12px",marginBottom:"12px","data-testid":"approvers",children:it.map(Bt=>jsxRuntimeExports.jsx(AddressTile,{address:parsePkh(Bt.val),"data-testid":`approver-${Bt.val}`},Bt.val))}),jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",children:jsxRuntimeExports.jsx(Threshold,{signersAmount:it.length,threshold:nt})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(FormControl,{marginTop:"24px",marginBottom:"12px",children:jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!1,inputName:"signer",isLoading:$t,keepValid:!0,label:"Creation Fee Payer",onUpdate:wt})}),jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",children:jsxRuntimeExports.jsx(SignPageFee,{fee:ot})})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:ut,isLoading:$t,onSubmit:Mt,signer:Ct,text:"Submit Contract"})})]})})})},Threshold=({threshold:a,signersAmount:_})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"threshold",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"No. of approvals:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:`${a} out of ${_}`})]}),contract=[{prim:"storage",args:[{prim:"pair",args:[{prim:"address",annots:["%owner"]},{prim:"pair",args:[{prim:"set",args:[{prim:"address"}],annots:["%signers"]},{prim:"pair",args:[{prim:"nat",annots:["%threshold"]},{prim:"pair",args:[{prim:"nat",annots:["%last_op_id"]},{prim:"pair",args:[{prim:"big_map",args:[{prim:"nat"},{prim:"pair",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}],annots:["%actions"]},{prim:"set",args:[{prim:"address"}],annots:["%approvals"]}]}],annots:["%pending_ops"]},{prim:"big_map",args:[{prim:"string"},{prim:"bytes"}],annots:["%metadata"]}]}]}]}]}]}]},{prim:"parameter",args:[{prim:"or",args:[{prim:"or",args:[{prim:"or",args:[{prim:"bytes",annots:["%set_metadata_uri"]},{prim:"unit",annots:["%default"]}]},{prim:"or",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}],annots:["%propose"]},{prim:"nat",annots:["%approve"]}]}]},{prim:"nat",annots:["%execute"]}]}]},{prim:"code",args:[[{prim:"NIL",args:[{prim:"operation"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"UNPAIR"},{prim:"DIP",args:[{int:"1"},[{prim:"UNPAIR",args:[{int:"6"}]}]]},{prim:"IF_LEFT",args:[[{prim:"IF_LEFT",args:[[{prim:"IF_LEFT",args:[[{prim:"DUP",args:[{int:"2"}]},{prim:"SENDER"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID_CALLER"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"SOME"},{prim:"PUSH",args:[{prim:"string"},{string:""}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}],[{prim:"DROP",args:[{int:"1"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"SIZE"},{prim:"COMPARE"},{prim:"GE"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"FUNDING BLOCKED SINCE PARAMS ARE INVALID"}]},{prim:"FAILWITH"}],[]]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}],[{prim:"IF_LEFT",args:[[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"3"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"nat"},{int:"1"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"ADD"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"4"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"4"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"MEM"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"KEY_EXISTS"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[{prim:"DUP",args:[{int:"6"}]},{prim:"EMPTY_SET",args:[{prim:"address"}]},{prim:"PUSH",args:[{prim:"bool"},{prim:"True"}]},{prim:"SENDER"},{prim:"UPDATE"},{prim:"DUP",args:[{int:"3"}]},{prim:"PAIR"},{prim:"SOME"},{prim:"DUP",args:[{int:"7"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"5"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"5"}]}]]},{prim:"DROP",args:[{int:"1"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}],[{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID OP ID"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"4"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP"},{prim:"CDR"},{prim:"SENDER"},{prim:"MEM"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ALREADY APPROVED"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"8"}]},{prim:"DUP",args:[{int:"4"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"UNPAIR"},{prim:"SWAP"},{prim:"DROP",args:[{int:"1"}]},{prim:"DUP",args:[{int:"9"}]},{prim:"DUP",args:[{int:"5"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"CDR"},{prim:"PUSH",args:[{prim:"bool"},{prim:"True"}]},{prim:"SENDER"},{prim:"UPDATE"},{prim:"SWAP"},{prim:"PAIR"},{prim:"SOME"},{prim:"DUP",args:[{int:"4"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"2"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}]]}],[{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID OP ID"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"4"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"5"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"CDR"},{prim:"SIZE"},{prim:"COMPARE"},{prim:"GE"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"NOT YET APPROVED"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"CAR"},{prim:"PUSH",args:[{prim:"unit"},{prim:"Unit"}]},{prim:"EXEC"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"8"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"8"}]},{prim:"DUP",args:[{int:"7"}]},{prim:"NONE",args:[{prim:"pair",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}]},{prim:"set",args:[{prim:"address"}]}]}]},{prim:"DUP",args:[{int:"4"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"2"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}]]}],makeStorageJSON=(a,_,$)=>({owner:a,signers:_,threshold:$,last_op_id:"0",pending_ops:[],metadata:[]}),toOperation$4=a=>({type:"contract_origination",sender:parsePkh(a.sender),code:contract,storage:makeStorageJSON(a.sender,a.signers.map(_=>_.val),String(a.threshold))}),SelectApproversFormPage=a=>{const{goBack:_,sender:$,...j}=a,et=useForm({mode:"onBlur",defaultValues:{sender:$.address.pkh,signers:[{val:""}],threshold:1,...formDefaultValues(j)}}),{formState:{errors:tt,isValid:rt},control:nt,register:it,handleSubmit:st,getValues:ot,watch:at}=et,ut=useFieldArray({control:nt,name:"signers",rules:{minLength:1}}),ht=at("signers").length,yt=useOpenSignPageFormAction({SignPage:SignTransactionFormPage,signPageExtraData:at(),FormPage:SelectApproversFormPage,defaultFormPageProps:a,toOperation:toOperation$4}),{onFormSubmitActionHandlers:[wt],isLoading:Ct}=useHandleOnSubmitFormActions([yt]);return jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalBackButton,{onClick:_}),jsxRuntimeExports.jsxs("form",{onSubmit:st(wt),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Select the participants of the contract and choose the minimum number of approvals.",title:"Select Approvers"}),jsxRuntimeExports.jsxs(ModalBody,{children:[ut.fields.map((Pt,$t)=>{var Ot;const Mt=tt.signers&&tt.signers[$t],Bt=`${$t===0?"Select ":""}${ordinal$1($t+1)} approver`,Dt=ht>1?"short":"default",zt=Dt==="short"?"368px":"100%";return jsxRuntimeExports.jsxs(FormControl,{display:"inline-block",width:zt,marginBottom:"8px","data-testid":`signer-input-${$t}`,isInvalid:!!Mt,children:[jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!0,inputName:`signers.${$t}.val`,label:Bt,size:Dt,style:{width:zt},validate:It=>{if(!isValidImplicitPkh(It))return"Signer must be valid TZ address";const Lt=ot("signers").map(Ft=>Ft.val);if(Lt.length>new Set(Lt).size)return"Duplicate approver"}}),ht>1&&jsxRuntimeExports.jsx(IconButton,{position:"absolute",height:"24px",marginTop:"-36px",marginLeft:"374px",background:colors.gray[500],"aria-label":"Remove","data-testid":`remove-signer-${$t}`,icon:jsxRuntimeExports.jsx(TrashIcon,{width:"12px",height:"14px",stroke:colors.gray[300]}),isRound:!0,onClick:()=>ut.remove($t),size:"xs",variant:"tertiary"}),Mt&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":`signer-${$t}-error`,children:(Ot=Mt.val)==null?void 0:Ot.message})]},Pt.id)}),jsxRuntimeExports.jsx(Button,{paddingLeft:0,onClick:()=>ut.append({val:""}),variant:"specialCTA",children:"+ Add Approver"}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!tt.threshold,children:[jsxRuntimeExports.jsxs(FormLabel,{display:"inline",children:["Min No. of approvals:",jsxRuntimeExports.jsx(InputGroup,{display:"inline",marginLeft:"10px",children:jsxRuntimeExports.jsx(Input,{width:"60px",color:"white","data-testid":"threshold-input",step:1,type:"number",...it("threshold",{valueAsNumber:!0,required:"No. of approvals is required",max:{value:ht,message:`Max no. of approvals is ${ht}`},min:{value:1,message:"Min no. of approvals is 1"}})})})]}),jsxRuntimeExports.jsxs(Text,{display:"inline","data-testid":"max-signers",children:["out of ",ht]}),tt.threshold&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"threshold-error",children:tt.threshold.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!rt,isLoading:Ct,size:"lg",type:"submit",children:"Review"})})]})]})})},NameMultisigFormPage=({name:a})=>{const _=useForm({mode:"onBlur",defaultValues:{name:a||""}}),{formState:{errors:$,isValid:j},register:et,handleSubmit:tt}=_,rt=useImplicitAccounts(),nt=useGetMostFundedImplicitAccount(),{openWith:it}=reactExports.useContext(DynamicModalContext),st=({name:at})=>it(jsxRuntimeExports.jsx(SelectApproversFormPage,{form:{name:at.trim()},goBack:()=>it(jsxRuntimeExports.jsx(NameMultisigFormPage,{name:at})),sender:nt(rt)})),ot=useValidateName();return jsxRuntimeExports.jsx(FormProvider,{..._,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:tt(st),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Name your account. The account name will only appear in your local Umami app.",title:"Account Name"}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!$.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Account Name"}),jsxRuntimeExports.jsx(InputGroup,{children:jsxRuntimeExports.jsx(Input,{"data-testid":"multisig-account-name",type:"text",...et("name",{validate:ot}),placeholder:"Account Name"})}),$.name&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"name-error",children:$.name.message})]})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!j,size:"lg",type:"submit",children:"Continue"})})]})})})},AccountsList=()=>{const a=useAllAccounts(),_=useAppSelector(tt=>tt.assets.balances.mutez),$=lodashExports.groupBy(a,getAccountGroupLabel),{openWith:j}=reactExports.useContext(DynamicModalContext),et=Object.entries($).map(([tt,rt])=>jsxRuntimeExports.jsx(AccountGroup,{accounts:rt,balances:_,groupLabel:tt},tt));return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box,{height:"100%",marginRight:0,children:jsxRuntimeExports.jsxs(NestedScroll,{children:[lodashExports.compact(et),jsxRuntimeExports.jsx(Button,{width:"100%",height:"90px",background:colors.black,border:"1px dashed",borderColor:colors.gray[500],onClick:()=>j(jsxRuntimeExports.jsx(NameMultisigFormPage,{})),variant:"outline",children:jsxRuntimeExports.jsxs(Text,{display:"block",width:"100%",margin:"20px",color:colors.gray[400],textAlign:"center",children:[jsxRuntimeExports.jsx(KeyIcon,{marginRight:"4px",stroke:colors.gray[450]}),"Create New Multisig"]})})]})})})},useGetDelegationPrettyDisplayValues=()=>{const a=useGetAccountBalance();return _=>{const $=a(_.sender),j=new Date,et=prettyTezAmount(_.amount),tt=$&&prettyTezAmount($),rt=`Since ${formatRelative(new Date(_.timestamp),j)}`;return{initialBalance:et,currentBalance:tt,duration:rt}}},SignPage$4=a=>{const{mode:_,operations:$,fee:j}=a,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:st,reEstimate:ot,onSign:at}=useSignPageHelpers(j,$,_),ut=tt.operations[0].recipient;return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:st.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(SignPageFee,{fee:et})})}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:ut}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:ot,sender:tt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:at,signer:st,text:headerText(tt.type,_)})})]})})})},FormPage$3=a=>{var at;const _=(at=a.form)==null?void 0:at.baker,$=useOpenSignPageFormAction({SignPage:SignPage$4,signPageExtraData:void 0,FormPage:FormPage$3,defaultFormPageProps:a,toOperation:toOperation$3}),j=useAddToBatchFormAction(toOperation$3),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(a)}),{formState:{isValid:it,errors:st},handleSubmit:ot}=nt;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{"data-testid":"delegate-form",children:[jsxRuntimeExports.jsxs(HeaderWrapper,{children:[jsxRuntimeExports.jsx(Text,{fontWeight:"600",size:"2xl",children:_?"Change Baker":"Delegate"}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!st.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!!a.sender,label:"From"}),st.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:st.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px","data-testid":"baker",isInvalid:!!st.baker,children:[jsxRuntimeExports.jsx(BakersAutocomplete,{allowUnknown:!0,inputName:"baker",label:"Baker"}),st.baker&&jsxRuntimeExports.jsx(FormErrorMessage,{children:st.baker.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation$3=a=>({type:"delegation",sender:parsePkh(a.sender),recipient:parseImplicitPkh(a.baker)}),SignPage$3=a=>{const{mode:_,operations:$,fee:j}=a,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:st,reEstimate:ot,onSign:at}=useSignPageHelpers(j,$,_);return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:st.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",paddingX:"4px",children:jsxRuntimeExports.jsx(SignPageFee,{fee:et})}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:ot,sender:tt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:at,signer:st,text:headerText(tt.type,_)})})]})})})},FormPage$2=a=>{var ot;const{sender:_}=a,$=(ot=a.form)==null?void 0:ot.baker,j=useOpenSignPageFormAction({SignPage:SignPage$3,signPageExtraData:void 0,FormPage:FormPage$2,defaultFormPageProps:{sender:_},toOperation:toOperation$2}),et=useAddToBatchFormAction(toOperation$2),{onFormSubmitActionHandlers:[tt,rt],isLoading:nt}=useHandleOnSubmitFormActions([j,et]),it=useForm({mode:"onBlur",defaultValues:formDefaultValues({sender:_})}),{handleSubmit:st}=it;return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{"data-testid":"undelegate-form",children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Select preview to end delegation or insert this transaction into a Batch.",title:"End Delegation"}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"})}),jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"Baker"}),$&&jsxRuntimeExports.jsx(AddressTile,{address:parsePkh($)})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:nt,isValid:!0,onAddToBatch:st(rt),onSingleSubmit:st(tt)})})]})})})},toOperation$2=a=>({type:"undelegation",sender:parsePkh(a.sender)}),Row=({label:a,value:_,...$})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"50px",padding:"16px","data-testid":a,...$,children:[jsxRuntimeExports.jsx(Box,{flex:1,children:jsxRuntimeExports.jsx(Heading,{color:colors.gray[400],size:"sm",children:a})}),jsxRuntimeExports.jsx(Box,{flex:1,children:typeof _=="string"?jsxRuntimeExports.jsx(Text,{size:"sm",children:_}):_})]}),DelegationDisplay=({delegation:a,account:_})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext),j=useGetOwnedAccount(),et=useGetDelegationPrettyDisplayValues();if(!a)return jsxRuntimeExports.jsx(NoDelegations,{onDelegate:()=>$(jsxRuntimeExports.jsx(FormPage$3,{sender:_})),size:"md"});const{currentBalance:tt,duration:rt,initialBalance:nt}=et(a),{sender:it,delegate:{address:st}}=a,ot=j(it);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Row,{borderBottom:`1px solid ${colors.gray[700]}`,borderTopRadius:"8px",_odd:{bg:colors.gray[800]},label:"Initial Balance:",value:nt}),tt&&jsxRuntimeExports.jsx(Row,{_odd:{bg:colors.gray[800]},label:"Current Balance:",value:tt}),jsxRuntimeExports.jsx(Row,{borderBottom:`1px solid ${colors.gray[700]}`,_odd:{bg:colors.gray[800]},label:"Duration:",value:rt}),jsxRuntimeExports.jsx(Row,{borderBottomRadius:"8px",_odd:{bg:colors.gray[800]},label:"Baker:",value:jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.delegate.address)})}),jsxRuntimeExports.jsxs(Flex,{marginTop:"24px",children:[jsxRuntimeExports.jsx(Button,{flex:1,marginRight:"16px",onClick:()=>$(jsxRuntimeExports.jsx(FormPage$2,{form:{sender:it,baker:st},sender:ot})),variant:"warning",children:"End Delegation"}),jsxRuntimeExports.jsx(Button,{flex:1,onClick:()=>$(jsxRuntimeExports.jsx(FormPage$3,{form:{sender:it,baker:st},sender:ot})),variant:"tertiary",children:"Change Baker"})]})]})},MultisigDecodedOperation=({operation:a})=>{switch(a.type){case"delegation":return jsxRuntimeExports.jsxs(Box,{"data-testid":"decoded-item-delegate",marginY:6,children:[jsxRuntimeExports.jsx(Text,{marginRight:"3px",color:colors.gray[450],fontSize:"14px",children:"Delegate to:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.recipient})]});case"undelegation":return jsxRuntimeExports.jsx(Box,{"data-testid":"decoded-item-undelegate",marginY:6,children:jsxRuntimeExports.jsx(Text,{color:colors.gray[450],fontSize:"14px",children:"End Delegation"})});case"tez":case"fa1.2":case"fa2":return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MultisigOperationAmount,{operation:a}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"8px",children:[jsxRuntimeExports.jsx(Text,{marginRight:"3px",color:colors.gray[450],fontSize:"14px",children:"Send to:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.recipient})]})]});case"contract_origination":case"contract_call":throw new Error(`${a.type} is not supported yet`)}},MultisigOperationAmount=({operation:a})=>{const _=useGetToken();switch(a.type){case"tez":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"decoded-tez-amount",children:[jsxRuntimeExports.jsx(OutgoingArrow,{}),jsxRuntimeExports.jsxs(Text,{marginLeft:"8px",color:colors.orange,fontSize:"14px",fontWeight:600,textAlign:"center",children:["-",prettyTezAmount(a.amount)]})]});case"fa1.2":case"fa2":{const $=_(a.contract.pkh,a.tokenId);if(!$)return null;const j=tokenNameSafe($),et=$.type==="nft";return jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"decoded-fa-amount",children:[jsxRuntimeExports.jsx(OutgoingArrow,{}),jsxRuntimeExports.jsx(Box,{marginLeft:"8px",color:colors.orange,textAlign:"center",children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Text,{display:"inline",marginRight:"3px",fontSize:"14px",fontWeight:600,children:a.amount}),jsxRuntimeExports.jsx(Text,{display:"inline",color:"white",fontSize:"14px",fontWeight:600,children:j})]}):jsxRuntimeExports.jsxs(Text,{fontSize:"14px",fontWeight:600,children:["-",tokenPrettyAmount(a.amount,$,{showSymbol:!0})]})})]})}case"delegation":case"undelegation":case"contract_origination":case"contract_call":return null}},caseInsensitiveLiteral=a=>z.string().regex(new RegExp(`^${a}$`,"i")),prim=a=>z.object({prim:caseInsensitiveLiteral(a)}),pushKeyHashSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("key_hash")}),z.object({bytes:z.string()})])}),pushAddressSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("address")}),z.object({bytes:z.string()})])}),pair=(a,_)=>z.object({prim:z.literal("Pair"),args:z.tuple([a,_])}),contractZeroTezSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("mutez")}),z.object({int:z.literal("0")})])}),lambdaEndSchema=[prim("TRANSFER_TOKENS"),prim("CONS")],contractHeadSchema=z.object({prim:z.literal("CONTRACT")}),batchHeadSchema=z.tuple([z.object({prim:z.literal("DROP")}),z.object({prim:z.literal("NIL"),args:z.array(z.object({prim:z.literal("operation")}))})]),pushMutezSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("mutez")}),z.object({int:z.string()})])}),tezSchema=z.tuple([pushKeyHashSchema,prim("IMPLICIT_ACCOUNT"),pushMutezSchema,prim("UNIT"),...lambdaEndSchema]),contractTezSchema=z.tuple([pushAddressSchema,contractHeadSchema,prim("IF_NONE"),pushMutezSchema,prim("UNIT"),...lambdaEndSchema]),setDelegateSchema=z.tuple([pushKeyHashSchema,prim("SOME"),prim("SET_DELEGATE"),prim("CONS")]),removeDelegateSchema=z.tuple([z.object({prim:z.literal("NONE"),args:z.tuple([z.object({prim:z.literal("key_hash")})])}),prim("SET_DELEGATE"),prim("CONS")]),fa2Schema=z.tuple([pushAddressSchema,contractHeadSchema,z.tuple([prim("IF_NONE")]),contractZeroTezSchema,z.object({prim:z.literal("PUSH"),args:z.tuple([prim("list"),z.array(pair(z.object({bytes:z.string({description:"from"})}),z.array(pair(z.object({bytes:z.string({description:"to"})}),pair(z.object({int:z.string({description:"token_id"})}),z.object({int:z.string({description:"amount"})}))))))])}),...lambdaEndSchema]),fa1Schema=z.tuple([pushAddressSchema,contractHeadSchema,z.tuple([prim("IF_NONE")]),contractZeroTezSchema,z.object({prim:z.literal("PUSH"),args:z.tuple([prim("Pair"),pair(z.object({bytes:z.string({description:"from"})}),pair(z.object({bytes:z.string({description:"to"})}),z.object({int:z.string({description:"amount"})})))])}),...lambdaEndSchema]);class UnrecognizedMichelsonError extends Error{}const convertToPkh=a=>(a.length===42&&(a="00"+a),encodeAddress(a)),parseTez=a=>{const _=tezSchema.parse(a),$=_[0].args[1].bytes,j=_[2].args[1].int;return{type:"tez",recipient:parseImplicitPkh(convertToPkh($)),amount:j}},parseTezContract=a=>{const _=contractTezSchema.parse(a),$=_[0].args[1].bytes,j=_[3].args[1].int;return{type:"tez",recipient:parseContractPkh(convertToPkh($)),amount:j}},parseFa2=a=>{const _=fa2Schema.parse(a),$=parseContractPkh(convertToPkh(_[0].args[1].bytes));return _[4].args[1].flatMap(et=>{const tt=et.args[0].bytes;return et.args[1].map(rt=>{const nt=rt.args[0].bytes,it=rt.args[1].args[0].int,st=rt.args[1].args[1].int;return{type:"fa2",contract:$,sender:parsePkh(convertToPkh(tt)),recipient:parsePkh(convertToPkh(nt)),tokenId:it,amount:st}})})},parseFa1=a=>{const _=fa1Schema.parse(a),$=_[0],j=_[4].args[1],et=j.args[0].bytes,tt=j.args[1].args[0].bytes;return{type:"fa1.2",amount:j.args[1].args[1].int,contract:parseContractPkh(convertToPkh($.args[1].bytes)),recipient:parsePkh(convertToPkh(tt)),sender:parsePkh(convertToPkh(et)),tokenId:"0"}},parseSetDelegate=(a,_)=>{const $=setDelegateSchema.parse(a);return{type:"delegation",sender:_.address,recipient:parseImplicitPkh(convertToPkh($[0].args[1].bytes))}},parseRemoveDelegate=(a,_)=>({type:"undelegation",sender:_.address}),parsings=[{schema:tezSchema,parsingFn:parseTez},{schema:contractTezSchema,parsingFn:parseTezContract},{schema:fa2Schema,parsingFn:parseFa2},{schema:fa1Schema,parsingFn:parseFa1},{schema:setDelegateSchema,parsingFn:parseSetDelegate},{schema:removeDelegateSchema,parsingFn:parseRemoveDelegate}],parse=(a,_,$=[])=>{if(a.length===0)return $;for(let j=0;j{batchHeadSchema.parse(a.slice(0,2))},decode=(a,_)=>(assertHead(a),parse(a.slice(2),_)),parseRawMichelson=(a,_)=>{const $=JSON.parse(a);return decode($,_)},MultisigDecodedOperations=({rawMichelson:a,sender:_})=>{try{const $=parseRawMichelson(a,_);return jsxRuntimeExports.jsx(Box,{borderRadius:"8px",backgroundColor:colors.gray[900],children:$.map((j,et)=>jsxRuntimeExports.jsxs(Box,{width:"100%",paddingTop:"10px",paddingBottom:et<$.length-1?0:"15px",paddingX:"15px",children:[jsxRuntimeExports.jsx(MultisigDecodedOperation,{operation:j}),et<$.length-1&&jsxRuntimeExports.jsx(Divider,{marginTop:"15px"})]},et))})}catch($){return $ instanceof UnrecognizedMichelsonError?jsxRuntimeExports.jsx(UnrecognizedOperation,{rawMichelson:a}):jsxRuntimeExports.jsxs(Box,{height:"50px",padding:"10px",background:colors.gray[900],borderRadius:"8px",children:["Invalid michelson code: ",$.message]})}},UnrecognizedOperation=({rawMichelson:a})=>jsxRuntimeExports.jsx(Accordion,{width:"100%",marginBottom:"8px",background:colors.gray[900],borderColor:colors.gray[900],borderRadius:"8px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{children:[jsxRuntimeExports.jsxs(AccordionButton,{children:[jsxRuntimeExports.jsx(Heading,{flex:"1",height:"30px",marginTop:"6px",textAlign:"left",size:"md",children:"Unrecognized operation"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{overflowY:"scroll",height:"400px",paddingBottom:"12px",children:jsxRuntimeExports.jsx(JsValueWrap,{space:1,value:JSON.parse(a)})})]})}),MultisigActionButton=({approveOrExecute:a,isLoading:_,signerState:$})=>{switch($){case"awaitingApprovalByExternalSigner":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",alignSelf:"flex-end","data-testid":"multisig-signer-awaiting-approval",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],children:"Awaiting Approval"}),jsxRuntimeExports.jsx(HourglassIcon,{marginTop:"2px"})]});case"approved":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",alignSelf:"flex-end",marginBottom:"8px","data-testid":"multisig-signer-approved",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],children:"Approved"}),jsxRuntimeExports.jsx(CheckmarkIcon,{marginTop:"2px"})]});case"executable":return jsxRuntimeExports.jsx(Button,{"data-testid":"multisig-signer-button",isLoading:_,onClick:a,children:"Execute"});case"approvable":return jsxRuntimeExports.jsx(Button,{"data-testid":"multisig-signer-button",isLoading:_,onClick:a,children:"Approve"})}},SignPage$2=({signer:a,fee:_,operation:$,actionType:j,transactionCount:et})=>{const{handleAsyncAction:tt}=useAsyncActionHandler(),{openWith:rt}=reactExports.useContext(DynamicModalContext),nt=st=>tt(async()=>{const{opHash:ot}=await executeOperations($,st);return rt(jsxRuntimeExports.jsx(SuccessStep,{hash:ot}))},{title:`Failed ${j}`}),it=`${lodashExports.capitalize(j)} transaction`;return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(BatchModalBody,{fee:_,signer:a,title:it,transactionCount:et}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{onSubmit:nt,signer:a,text:it})})]})})},MultisigSignerTile=({pendingApprovals:a,sender:_,operation:$,signerAddress:j})=>{const et=useAddressKind$1(j),tt=useGetImplicitAccountSafe(),{isLoading:rt,handleAsyncAction:nt}=useAsyncActionHandler(),{openWith:it}=reactExports.useContext(DynamicModalContext),st=useSelectedNetwork(),ot=tt(j.pkh),at=a===0,ut=()=>nt(async()=>{if(!ot)throw new Error("Can't approve or execute with an account you don't own");const yt=at?"execute":"approve",wt=makeAccountOperations(ot,ot,[makeMultisigApproveOrExecuteOperation(_.address,yt,$.id)]),Ct=await estimate(wt,st);let Pt;try{Pt=parseRawMichelson($.rawActions,_).length}catch{Pt=1}return it(jsxRuntimeExports.jsx(SignPage$2,{actionType:yt,fee:Ct,operation:wt,signer:ot,transactionCount:Pt}))}),ht=getMultisigSignerState({approvals:$.approvals,signerAddress:j,operationIsExecutable:at,signerAccount:ot});return jsxRuntimeExports.jsx(AccountTileBase,{height:"80px",marginTop:"10px",marginBottom:"0",padding:"15px",borderRadius:"8px",backgroundColor:colors.gray[700],icon:jsxRuntimeExports.jsx(AccountTileIcon,{addressKind:et}),leftElement:jsxRuntimeExports.jsx(LabelAndAddress,{label:et.label,pkh:et.pkh}),rightElement:jsxRuntimeExports.jsx(MultisigActionButton,{approveOrExecute:ut,"data-testid":"multisig-signer-button",isLoading:rt,signerState:ht})})},getMultisigSignerState=({signerAccount:a,operationIsExecutable:_,approvals:$,signerAddress:j})=>{const et=!!$.find(tt=>tt.pkh===j.pkh);return a?et&&!_?"approved":_?"executable":"approvable":et?"approved":"awaitingApprovalByExternalSigner"},MultisigPendingOperation=({operation:a,sender:_})=>{const{signers:$,threshold:j}=_,et=Math.max(j-a.approvals.length,0);return jsxRuntimeExports.jsxs(Box,{marginBottom:"24px",background:colors.gray[800],border:"none",borderRadius:"8px","data-testid":"multisig-pending-operation-"+a.id,paddingX:"16px",paddingY:"15px",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"6px",padding:0,textAlign:"left",children:[jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Pending #",a.id]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginBottom:"6px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Pending Approvals:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"pending-approvals-count",children:et})]})]}),jsxRuntimeExports.jsxs(Box,{padding:"0",children:[jsxRuntimeExports.jsx(MultisigDecodedOperations,{rawMichelson:a.rawActions,sender:_}),$.map(tt=>jsxRuntimeExports.jsx(MultisigSignerTile,{operation:a,pendingApprovals:et,sender:_,signerAddress:tt},tt.pkh))]})]})},MultisigPendingOperations=({account:a})=>{const $=useGetPendingMultisigOperations()(a);return jsxRuntimeExports.jsx(Box,{margin:"0",padding:"0",children:$.map(j=>jsxRuntimeExports.jsx(MultisigPendingOperation,{operation:j,sender:a},j.id))})},ViewAllLink=({to:a,owner:_,...$})=>jsxRuntimeExports.jsx(Center,{...$,children:jsxRuntimeExports.jsxs(Link$1,{as:Link,color:colors.gray[300],stroke:colors.gray[450],_hover:{color:colors.green,stroke:colors.green},to:`${a}?accounts=${_}`,children:[jsxRuntimeExports.jsx(RefreshClockIcon,{display:"inline",stroke:"inherit"}),jsxRuntimeExports.jsx(Text,{display:"inline",size:"sm",children:" View All"})]})}),MAX_NFTS_SIZE=18,NFTsGrid=({owner:a,nfts:_,...$})=>{if(_.length===0)return jsxRuntimeExports.jsx(NoNFTs,{size:"md"});const j=sortedByLastUpdate(_).slice(0,MAX_NFTS_SIZE);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SimpleGrid,{marginBottom:"35px",spacing:"12px",...$,children:j.map(et=>{const tt=getIPFSurl(thumbnailUri(et)),nt={width:"100%",height:40,fallbackSrc:getIPFSurl(et.displayUri),src:tt};return jsxRuntimeExports.jsx(Link,{"data-testid":"nft-link",to:`/home/${a}/${fullId(et)}`,children:jsxRuntimeExports.jsx(Card,{background:colors.gray[800],border:"1px solid transparent",_hover:{background:colors.gray[700],borderColor:colors.gray[500]},children:jsxRuntimeExports.jsxs(CardBody,{overflow:"hidden",padding:"8px",borderRadius:"6px",children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsxs(Box,{position:"relative",width:"100%",height:"100%",children:[jsxRuntimeExports.jsx(AspectRatio,{zIndex:2,width:"100%",opacity:"0",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})}),jsxRuntimeExports.jsx(AspectRatio,{position:"absolute",zIndex:0,top:"0",width:"100%",filter:"blur(20px)",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})}),jsxRuntimeExports.jsx(AspectRatio,{position:"absolute",zIndex:1,top:"0",width:"100%",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})})]})}),Number(et.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"20px",marginTop:"-24px",marginLeft:"4px",padding:"0 8px",borderRadius:"100px",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",size:"xs",children:"x"+et.balance})]})})},`${a}:${fullId(et)}`)})}),_.length>MAX_NFTS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{marginBottom:"40px",owner:a,to:"/nfts"})]})},OperationTileContext=React$2.createContext({mode:"page"}),FEE_FIELDS=["bakerFee","storageFee","allocationFee"],Fee=({operation:a})=>{const _=reactExports.useContext(OperationTileContext),j=useIsOwnedAddress()(a.sender.address);if(_.mode==="drawer"||!j)return null;const et=FEE_FIELDS.reduce((tt,rt)=>rt in a?tt.plus(lodashExports.get(a,rt)||0):tt,BigNumber(0));return et.eq(0)?null:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"md",children:"Fee:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"fee",children:prettyTezAmount(et)})]})},useGetOperationDestination=(a,_)=>{const $=useIsOwnedAddress(),j=$(a),et=$(_);return!j&&!et?"unrelated":j?"outgoing":"incoming"},operationSign=a=>{switch(a){case"incoming":return"+";case"outgoing":return"-";case"unrelated":return""}},operationColor=a=>{switch(a){case"incoming":return colors.green;case"outgoing":return colors.orange;case"unrelated":return"white"}},InternalPrefix=({operation:a})=>{var et,tt,rt;let _,$;switch(a.type){case"transaction":_=(et=a.target)==null?void 0:et.address,$=a.sender.address;break;case"origination":case"delegation":_=null,$=a.sender.address;break;case"token_transfer":_=(tt=a.to)==null?void 0:tt.address,$=(rt=a.from)==null?void 0:rt.address;break}return useGetOperationDestination($,_)!=="unrelated"?null:jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],"data-testid":"internal-prefix",size:"md",children:"Internal:"})},OperationStatus=({level:a,status:_})=>{const $=useIsBlockFinalised(a);return _===void 0||_==="applied"?$?jsxRuntimeExports.jsx(CheckmarkIcon,{"data-testid":"checkmark"}):jsxRuntimeExports.jsx(HourglassIcon,{"data-testid":"hourglass"}):jsxRuntimeExports.jsx(CrossedCircleIcon,{"data-testid":"crossed-circle"})},OperationTypeWrapper=({children:a})=>reactExports.useContext(OperationTileContext).mode==="drawer"?null:jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],"data-testid":"operation-type",size:"sm",children:a}),Timestamp=({timestamp:a})=>a?jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"timestamp",size:"sm",children:getDisplayTimestamp(a)}):null,getDisplayTimestamp=a=>{const _=new Date,$=new Date(a);return differenceInDays(_,$)<2?formatDistance($,_,{addSuffix:!0}):format($,"dd MMM yyyy")},TzktLink$1=({hash:a,counter:_,transactionId:$,originationId:j,migrationId:et,children:tt,...rt})=>{const{tzktExplorerUrl:nt}=useSelectedNetwork();let it=nt;return a?it=lodashExports.compact([nt,a,_]).join("/"):et?it=`${it}/migrations/${et}`:j?it=`${it}/originations/${j}`:$?it=`${it}/transactions/${$}`:console.warn("No id provided to TzktLink"),jsxRuntimeExports.jsx(Link$1,{"data-testid":"tzkt-link",href:it,isExternal:!0,...rt,children:tt})},ContractCallTile=({operation:a})=>{var _;return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-contract-call",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(ContractIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:a.counter,"data-testid":"title",hash:a.hash,children:jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Contract Call: ",(_=a.parameter)==null?void 0:_.entrypoint]})}),jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[a.target&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.target})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.sender})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Contract Call"}),jsxRuntimeExports.jsx(OperationStatus,{...a})]})]})})]})},DelegationTile=({operation:a})=>{const _=a.newDelegate?"Delegate":"Delegation Ended";return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-delegation",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(BakerIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:a.counter,"data-testid":"title",hash:a.hash,children:jsxRuntimeExports.jsx(Heading,{size:"md",children:_})}),jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[a.newDelegate&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.newDelegate})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.sender})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:_}),jsxRuntimeExports.jsx(OperationStatus,{...a})]})]})})]})},OriginationTile=({operation:a})=>{var j;const $=((j=a.originatedContract)==null?void 0:j.codeHash)===CODE_HASH&&a.originatedContract.typeHash===TYPE_HASH?"Multisig Account Created":"Contract Origination";return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-origination",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(ContractIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:a.counter,"data-testid":"title",hash:a.hash,children:jsxRuntimeExports.jsx(Heading,{size:"md",children:$})}),jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.sender})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Contract Origination"}),jsxRuntimeExports.jsx(OperationStatus,{...a})]})]})})]})},TransactionDirectionIcon=({destination:a,..._})=>a==="outgoing"?jsxRuntimeExports.jsx(OutgoingArrow,{"data-testid":"outgoing-arrow",..._}):a==="incoming"?jsxRuntimeExports.jsx(IncomingArrow,{"data-testid":"incoming-arrow",..._}):jsxRuntimeExports.jsx(ContractIcon,{"data-testid":"unrelated-operation-icon",..._}),TokenTransferTile=({operation:a,tokenTransfer:_,token:$})=>{var at,ut;const j=_.amount,et=useGetOperationDestination((at=_.from)==null?void 0:at.address,(ut=_.to)==null?void 0:ut.address),tt=$.type==="nft",rt=tokenPrettyAmount(j,$,{showSymbol:!0}),nt=operationColor(et),it=tt?"white":nt,st=operationSign(et),ot=tt?jsxRuntimeExports.jsx(Tooltip,{padding:"8px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"nft-tooltip",label:jsxRuntimeExports.jsx(AspectRatio,{width:"170px",height:"170px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{src:getIPFSurl(thumbnailUri($))})}),openDelay:300,children:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(InternalPrefix,{operation:a||_}),jsxRuntimeExports.jsxs(TzktLink$1,{marginRight:"8px",color:it,"data-testid":"title",migrationId:_.migrationId,originationId:_.originationId,transactionId:_.transactionId,children:[jsxRuntimeExports.jsxs(Text,{display:"inline",color:nt,fontWeight:"600",children:[st,rt]}),jsxRuntimeExports.jsxs(Text,{display:"inline",fontWeight:"600",children:[" ",tokenNameSafe($)]})]})]})}):jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(InternalPrefix,{operation:a||_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",color:it,"data-testid":"title",migrationId:_.migrationId,originationId:_.originationId,transactionId:_.transactionId,children:jsxRuntimeExports.jsxs(Text,{display:"inline",color:nt,fontWeight:"600",children:[st,rt]})})]});return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-token-transfer",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(TransactionDirectionIcon,{marginRight:"8px",destination:et}),ot,a&&jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:_.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[_.to&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.to})]}),_.from&&jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.from})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Token Transfer"}),jsxRuntimeExports.jsx(OperationStatus,{level:_.level})]})]})})]})},TransactionTile=({operation:a})=>{var tt;const _=useGetOperationDestination(a.sender.address,(tt=a.target)==null?void 0:tt.address),$=prettyTezAmount(String(a.amount)),j=operationColor(_),et=operationSign(_);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-transaction",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(TransactionDirectionIcon,{marginRight:"8px",destination:_}),jsxRuntimeExports.jsx(InternalPrefix,{operation:a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",color:j,counter:a.counter,"data-testid":"title",hash:a.hash,children:jsxRuntimeExports.jsxs(Text,{color:j,fontWeight:"600",children:[et," ",$]})}),jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[a.target&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.target.address)})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.sender.address)})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Transaction"}),jsxRuntimeExports.jsx(OperationStatus,{...a})]})]})})]})},OperationTile=({operation:a})=>{const _=useGetTokenTransfer();switch(a.type){case"token_transfer":{const $=fromRaw$1(a.token);return $?jsxRuntimeExports.jsx(TokenTransferTile,{token:$,tokenTransfer:a}):(console.warn(`Could not parse token transfer ${a.id}`),null)}case"transaction":{const $=!!a.parameter,j=_(a.id);if(j){const et=fromRaw$1(j.token);return et?jsxRuntimeExports.jsx(TokenTransferTile,{operation:a,token:et,tokenTransfer:j}):jsxRuntimeExports.jsx(TransactionTile,{operation:a})}else return $?jsxRuntimeExports.jsx(ContractCallTile,{operation:a}):jsxRuntimeExports.jsx(TransactionTile,{operation:a})}case"delegation":return jsxRuntimeExports.jsx(DelegationTile,{operation:a});case"origination":return jsxRuntimeExports.jsx(OriginationTile,{operation:a})}},MAX_OPERATIONS_SIZE=20,OperationListDisplay=({owner:a,operations:_})=>{if(_.length===0)return jsxRuntimeExports.jsx(NoOperations,{size:"md"});const $=_.slice(0,MAX_OPERATIONS_SIZE);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[$.map((j,et)=>jsxRuntimeExports.jsxs(Box,{height:"90px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:j}),et<$.length-1&&jsxRuntimeExports.jsx(Divider,{marginY:"20px"})]},j.id)),_.length>MAX_OPERATIONS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{owner:a,to:"/operations"})]})},verifiedTokens=["KT1XnTn74bUtxHfDtBmm2bGZAQfhPbvKWR8o","KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1K9gCRgaLRFKTErYt1wVxA3Frb9FjasjTV","KT1Ha4yFVeyzw6KRAdkzq6TxDHB97KG4pZe8","KT1JBNFcB5tiycHNdYGYCtR3kk6JaJysUCi8","KT1Xobej4mc6XgEjDoJoHtTKgbD1ELMvcQuL","KT1JVjgXPMMSaa6FkzeJcgb8q9cUaLmwaJUX","KT193D4vozYnhGJQVtw7CoxxqphqUEEwK6Vb","KT1LN4LPSqTMS7Sd2CJw4bbDGRkMv2t68Fy9","KT1914CUZ7EegAFPbfgQMRkw8Uz5mYkEz2ui","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT19ovJhcsUn4YU8Q5L3BGovKSixfbWcecEA","KT1TgmD7kXQzofpuc9VbTRMdZCS2e6JDuTtc","KT1F1mn2jbqQCJcsNgYKVAQjvenecNMY2oPK","KT1ErKVqEhG9jxXgUG2KGLW3bNM7zXHX8SDF","KT1A5P4ejnLix13jtadsfV9GCnXLMNnab8UT","KT1AM3PV1cwmGRw28DVTgsjjsjHvmL6z4rGh","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT1SjXiUX63QvdNMcM2m492f7kuf8JxXRLp4","KT1MZg99PxMDEENwB4Fi64xkqAVh5d1rv8Z9","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT1XTxpQvo7oRCqp85LikEZgAZ22uDxhbWJv","KT1VaEsVNiBoA56eToEK6n6BcPgh1tdx9eXi"],TokenNameWithIcon=({token:a,..._})=>{const $=verifiedTokens.includes(a.contract);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Text,{..._,marginRight:"4px",children:tokenNameSafe(a)}),$&&jsxRuntimeExports.jsx(VerifiedIcon,{})]})},MAX_TOKENS_SIZE=20,TokenList=({owner:a,tokens:_})=>{if(_.length===0)return jsxRuntimeExports.jsx(NoTokens,{size:"md"});const $=_.slice(0,MAX_TOKENS_SIZE);return jsxRuntimeExports.jsxs(Box,{children:[$.map(j=>jsxRuntimeExports.jsx(TokenTile$1,{token:j},fullId(j))),_.length>MAX_TOKENS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{owner:a,to:"/tokens"})]})},TokenTile$1=({token:a})=>{const _=tokenPrettyAmount(a.balance,a,{showSymbol:!1});return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-around",height:20,borderBottom:`1px solid ${colors.gray[800]}`,"data-testid":"token-tile",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",flex:1,children:[jsxRuntimeExports.jsx(TokenIcon,{width:"38px",background:colors.gray[500],borderRadius:"4px",contract:a.contract}),jsxRuntimeExports.jsx(Box,{marginLeft:"16px",children:jsxRuntimeExports.jsx(TokenNameWithIcon,{fontWeight:600,"data-testid":"token-name",token:a})})]}),jsxRuntimeExports.jsx(Heading,{"data-testid":"token-balance",size:"lg",children:_})]})},buildTzktAddressUrl=(a,_)=>`${a.tzktExplorerUrl}/${_}`,useGetOperations=a=>{const _=useSelectedNetwork(),$=useAppDispatch(),j=useRefetchTrigger(),et=useReactQueryErrorHandler(),{isFetching:tt,data:rt,hasNextPage:nt,isLoading:it,fetchNextPage:st,fetchPreviousPage:ot,error:at}=useInfiniteQuery({queryFn:({pageParam:ut})=>fetchOperationsAndUpdateTokensInfo($,_,a,ut),queryKey:["operations",a,$,_],initialPageParam:{},retry:3,retryDelay:ut=>ut*2e3,gcTime:0,refetchOnWindowFocus:!1,getNextPageParam:ut=>ut.length===0?null:{lastId:ut[ut.length-1].id},getPreviousPageParam:(ut,ht)=>{var wt;const yt=(wt=lodashExports.maxBy(ht.flat(),"id"))==null?void 0:wt.id;return yt?{lastId:yt,sort:"asc"}:{}},select:({pages:ut})=>filterDuplicatedTokenTransfers([[...ut[0]].sort((ht,yt)=>ht.id{const ut=setInterval(()=>void ot(),BLOCK_TIME);return()=>clearInterval(ut)},[ot]),reactExports.useEffect(()=>{ot()},[j,ot]),{operations:rt||[],isFirstLoad:it,isLoading:tt,hasMore:nt,loadMore:st}},fetchOperationsAndUpdateTokensInfo=async(a,_,$,j)=>{const et=await getCombinedOperations($.map(st=>st.address.pkh),_,j),tt=et.filter(st=>st.type==="transaction").map(st=>st.id),rt=await getRelatedTokenTransfers(tt,_),nt=et.filter(st=>st.type==="token_transfer"),it=[...rt,...nt];return a(assetsActions.updateTokenTransfers(it)),a(tokensActions.addTokens({network:_,tokens:it.map(st=>st.token)})),et},filterDuplicatedTokenTransfers=a=>{const _=new Set(a.filter($=>$.type!=="token_transfer").map($=>$.id));return a.filter($=>$.type!=="token_transfer"||!_.has($.transactionId))},SmallTab=({children:a,..._})=>jsxRuntimeExports.jsx(Tab,{..._,fontSize:"sm",paddingX:3,children:a}),AssetsPanel=({tokens:a,nfts:_,account:$,delegation:j})=>{const et=useGetPendingMultisigOperations(),tt=$.type==="multisig"&&et($).length>0,rt=useSelectedNetwork(),{operations:nt,isFirstLoad:it}=useGetOperations([$]);return jsxRuntimeExports.jsxs(Tabs,{flexDirection:"column",display:"flex",width:"100%",marginTop:"60px","data-testid":"asset-panel",children:[jsxRuntimeExports.jsxs(TabList,{justifyContent:"space-between","data-testid":"asset-panel-tablist",children:[jsxRuntimeExports.jsxs(Flex,{children:[tt&&jsxRuntimeExports.jsxs(SmallTab,{"data-testid":"account-card-pending-tab",children:[jsxRuntimeExports.jsx(Text,{children:"Pending"}),jsxRuntimeExports.jsx(Box,{width:"6px",height:"6px",marginTop:"-7px",marginRight:"-3px",marginLeft:"3px",borderRadius:"100%",backgroundColor:colors.orangeL})]}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-operations-tab",children:"Operations"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-delegation-tab",children:"Delegation"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-nfts-tab",children:"NFTs"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-tokens-tab",children:"Tokens"})]}),jsxRuntimeExports.jsx(ExternalLink,{href:buildTzktAddressUrl(rt,$.address.pkh),children:jsxRuntimeExports.jsxs(Button,{paddingRight:0,variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"7px",size:"sm",children:"View on Tzkt"}),jsxRuntimeExports.jsx(ExternalLinkIcon,{stroke:"currentcolor"})]})})]}),jsxRuntimeExports.jsxs(TabPanels,{height:"100%",children:[tt&&jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:"60px","data-testid":"account-card-pending-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(MultisigPendingOperations,{account:$})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:"60px","data-testid":"account-card-operations-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsxs(OperationTileContext.Provider,{value:{mode:"drawer",selectedAddress:$.address},children:[jsxRuntimeExports.jsx(Center,{display:it?"flex":"none",height:"50px",children:jsxRuntimeExports.jsx(Image$1,{width:"150px",height:"75px",src:"./static/media/loading-wheel.gif"})}),!it&&jsxRuntimeExports.jsx(OperationListDisplay,{operations:nt,owner:$.address.pkh})]})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",paddingTop:"24px","data-testid":"account-card-delegation-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(DelegationDisplay,{account:$,delegation:j})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:0,"data-testid":"account-card-nfts-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(NFTsGrid,{columns:3,nfts:_,owner:$.address.pkh})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px","data-testid":"account-card-tokens-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(TokenList,{owner:$.address.pkh,tokens:a})})]})]})},MultisigApprovers=({signers:a})=>jsxRuntimeExports.jsx(Box,{width:"100%",marginTop:"40px",marginBottom:"-20px",background:colors.gray[800],borderRadius:"8px",children:jsxRuntimeExports.jsx(Accordion,{padding:"15px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],border:"none",borderRadius:"8px",children:[jsxRuntimeExports.jsxs(AccordionButton,{as:"span",flex:"1",padding:"0",textAlign:"left",cursor:"pointer",children:[jsxRuntimeExports.jsx(Heading,{width:"100%",size:"md",children:"Approvers"}),jsxRuntimeExports.jsx(AccordionIcon,{cursor:"pointer"})]}),jsxRuntimeExports.jsx(AccordionPanel,{padding:"0",children:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"multisig-tag-section",spacingX:"0",spacingY:"12px",children:a.map(_=>jsxRuntimeExports.jsx(AddressPill,{marginRight:"12px",address:_},_.pkh))})})]})})}),renameAccount=(a,_)=>($,j)=>{const{accounts:et,multisigs:tt,contacts:rt}=j(),nt=a.type==="multisig",it=et.items.map(at=>at.label),st=tt.items.map(at=>at.label),ot=Object.values(rt).map(at=>at.name);[it,st,ot].flat().includes(_)||$(nt?multisigsSlice.actions.setName({newName:_,account:a}):accountsSlice.actions.renameAccount({newName:_,account:a}))},RenameAccountModal=({account:a})=>{const _=useAppDispatch(),{onClose:$}=reactExports.useContext(DynamicModalContext),j=({name:at})=>{_(renameAccount(a,at)),$()},{handleSubmit:et,formState:{isValid:tt,errors:rt},register:nt,reset:it}=useForm({mode:"onBlur",defaultValues:{name:a.label}}),st=({name:at})=>{j({name:at.trim()}),it()},ot=useValidateName(a.label);return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:et(st),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Edit your account name here.",title:"Edit Name"}),jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!rt.name,marginY:"20px",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Account name"}),jsxRuntimeExports.jsx(Input,{type:"text",...nt("name",{required:"Name is required",validate:ot}),placeholder:"Enter contact's name"}),rt.name&&jsxRuntimeExports.jsx(FormErrorMessage$1,{"data-testid":"name-error",children:rt.name.message})]})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",marginBottom:"8px",isDisabled:!tt,size:"lg",type:"submit",children:"Save"})})]})})},RenameRemoveMenuSwitch=({account:a})=>{const{openWith:_,onClose:$}=reactExports.useContext(DynamicModalContext),j=useNavigate(),et=useImplicitAccounts().length===1,tt=useRemoveAccount();let rt;switch(a.type){case"secret_key":case"ledger":case"social":rt=()=>_(jsxRuntimeExports.jsx(ConfirmationModal,{buttonLabel:st,description:it,onSubmit:()=>{tt(a),$(),j("/")},title:nt}));break}const nt="Remove Account";let it="Are you sure you want to remove this account?",st="Remove Account";return et&&(it="Removing your last account will off-board you from Umami. This will remove or reset all customized settings to their defaults. Personal data (including saved contacts, password and accounts) won't be affected.",st="Remove & Off-board"),jsxRuntimeExports.jsx(RenameRemoveMenu,{onRemove:rt,onRename:()=>_(jsxRuntimeExports.jsx(RenameAccountModal,{account:a}))})},makeDelegation=a=>a.newDelegate?{sender:a.sender.address,timestamp:a.timestamp,id:a.id,amount:new BigNumber(a.amount),delegate:{address:a.newDelegate.address,alias:a.newDelegate.alias??void 0}}:null,TezRecapDisplay=a=>jsxRuntimeExports.jsxs(Box,{textAlign:a.center?"center":"initial",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:prettyTezAmount(a.balance)}),a.dollarBalance!==void 0&&jsxRuntimeExports.jsxs(Text,{marginTop:"6px",color:colors.gray[400],size:"sm",children:["$",a.dollarBalance.toFixed(2)]})]}),RoundButton=({icon:a,label:_,onClick:$=()=>{}})=>jsxRuntimeExports.jsxs(Box,{className:"account-drawer-cta-button",color:colors.gray[300],textAlign:"center",_hover:{color:colors.green},cursor:"pointer",marginX:"24px",onClick:$,children:[jsxRuntimeExports.jsx(IconButton,{className:"account-drawer-cta-button-icon",marginBottom:"8px","aria-label":"button",icon:a,size:"lg",variant:"circle_without_color"}),jsxRuntimeExports.jsx(Text,{cursor:"pointer",size:"sm",children:_})]}),AccountDrawerDisplay=({onSend:a,onReceive:_=()=>{},balance:$,dollarBalance:j,tokens:et,nfts:tt,account:rt})=>{const nt=rt.type==="multisig",{openWith:it}=reactExports.useContext(DynamicModalContext),st=useAddressKind$1(rt.address),ot=useSelectedNetwork(),[at,ut]=reactExports.useState(null),{handleAsyncAction:ht}=useAsyncActionHandler();return reactExports.useEffect(()=>{ht(async()=>{const yt=await getLastDelegation(rt.address.pkh,ot);yt&&ut(makeDelegation(yt))}).catch(lodashExports.noop)},[rt.address.pkh,ht,ot]),jsxRuntimeExports.jsxs(Flex,{zIndex:2,alignItems:"center",flexDirection:"column",height:"100%",marginTop:"-86px",paddingTop:"86px",paddingRight:"30px",background:accountIconGradient({account:rt,radius:"350px",opacity:"35",mainBackgroundColor:"transparent",left:"300px",top:"-125px"}),"data-testid":`account-card-${rt.address.pkh}`,children:[jsxRuntimeExports.jsx(AccountTileIcon,{addressKind:st}),jsxRuntimeExports.jsx(Heading,{marginTop:"24px",size:"md",children:rt.label}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"8px",marginBottom:"30px",children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"4px",address:rt.address,mode:{type:"no_icons"}}),jsxRuntimeExports.jsx(RenameRemoveMenuSwitch,{account:rt})]}),$&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:$,center:!0,dollarBalance:j}),jsxRuntimeExports.jsxs(Center,{marginTop:"34px",children:[jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(OutgoingArrow,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Send",onClick:a}),jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(IncomingArrow,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Receive",onClick:_}),!nt&&jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(PlusIcon,{stroke:"currentcolor"}),label:"Buy Tez",onClick:()=>it(jsxRuntimeExports.jsx(BuyTezForm,{recipient:rt.address.pkh}))}),jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(BakerIcon,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Delegate",onClick:()=>it(jsxRuntimeExports.jsx(FormPage$3,{form:at?{baker:at.delegate.address,sender:rt.address.pkh}:void 0,sender:rt}))})]}),nt&&jsxRuntimeExports.jsx(MultisigApprovers,{signers:rt.signers}),jsxRuntimeExports.jsx(AssetsPanel,{account:rt,delegation:at,nfts:tt,tokens:et})]})};var dist={},lodash_isequal={exports:{}};lodash_isequal.exports;(function(a,_){var $=200,j="__lodash_hash_undefined__",et=1,tt=2,rt=9007199254740991,nt="[object Arguments]",it="[object Array]",st="[object AsyncFunction]",ot="[object Boolean]",at="[object Date]",ut="[object Error]",ht="[object Function]",yt="[object GeneratorFunction]",wt="[object Map]",Ct="[object Number]",Pt="[object Null]",$t="[object Object]",Mt="[object Promise]",Bt="[object Proxy]",Dt="[object RegExp]",zt="[object Set]",Ot="[object String]",It="[object Symbol]",Lt="[object Undefined]",Ft="[object WeakMap]",jt="[object ArrayBuffer]",bt="[object DataView]",vt="[object Float32Array]",ct="[object Float64Array]",dt="[object Int8Array]",mt="[object Int16Array]",xt="[object Int32Array]",At="[object Uint8Array]",Rt="[object Uint8ClampedArray]",St="[object Uint16Array]",Tt="[object Uint32Array]",Et=/[\\^$.*+?()[\]{}|]/g,Nt=/^\[object .+?Constructor\]$/,tr=/^(?:0|[1-9]\d*)$/,ir={};ir[vt]=ir[ct]=ir[dt]=ir[mt]=ir[xt]=ir[At]=ir[Rt]=ir[St]=ir[Tt]=!0,ir[nt]=ir[it]=ir[jt]=ir[ot]=ir[bt]=ir[at]=ir[ut]=ir[ht]=ir[wt]=ir[Ct]=ir[$t]=ir[Dt]=ir[zt]=ir[Ot]=ir[Ft]=!1;var nr=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Zt=typeof self=="object"&&self&&self.Object===Object&&self,Kt=nr||Zt||Function("return this")(),Qt=_&&!_.nodeType&&_,Ht=Qt&&!0&&a&&!a.nodeType&&a,qt=Ht&&Ht.exports===Qt,Jt=qt&&nr.process,ur=function(){try{return Jt&&Jt.binding&&Jt.binding("util")}catch{}}(),xr=ur&&ur.isTypedArray;function pr(wr,Xt){for(var cr=-1,gr=wr==null?0:wr.length,Dr=0,rn=[];++cr-1}function ps(wr,Xt){var cr=this.__data__,gr=Eo(cr,wr);return gr<0?(++this.size,cr.push([wr,Xt])):cr[gr][1]=Xt,this}yn.prototype.clear=_n,yn.prototype.delete=ds,yn.prototype.get=fs,yn.prototype.has=hs,yn.prototype.set=ps;function Vn(wr){var Xt=-1,cr=wr==null?0:wr.length;for(this.clear();++XtTn))return!1;var wn=rn.get(wr);if(wn&&rn.get(Xt))return wn==Xt;var Ln=-1,Fn=!0,ts=cr&tt?new es:void 0;for(rn.set(wr,Xt),rn.set(Xt,wr);++Ln-1&&wr%1==0&&wr-1&&wr%1==0&&wr<=rt}function No(wr){var Xt=typeof wr;return wr!=null&&(Xt=="object"||Xt=="function")}function Po(wr){return wr!=null&&typeof wr=="object"}var Lo=xr?fr(xr):xl;function Xl(wr){return $o(wr)?yl(wr):_l(wr)}function rs(){return[]}function Xn(){return!1}a.exports=Ps})(lodash_isequal,lodash_isequal.exports);var lodash_isequalExports=lodash_isequal.exports,qrcode={exports:{}};(function(a,_){var $=function(){var j=function(Dt,zt){var Ot=236,It=17,Lt=Dt,Ft=tt[zt],jt=null,bt=0,vt=null,ct=[],dt={},mt=function(Kt,Qt){bt=Lt*4+17,jt=function(Ht){for(var qt=new Array(Ht),Jt=0;Jt=7&&Tt(Kt),vt==null&&(vt=ir(Lt,Ft,ct)),Nt(vt,Qt)},xt=function(Kt,Qt){for(var Ht=-1;Ht<=7;Ht+=1)if(!(Kt+Ht<=-1||bt<=Kt+Ht))for(var qt=-1;qt<=7;qt+=1)Qt+qt<=-1||bt<=Qt+qt||(0<=Ht&&Ht<=6&&(qt==0||qt==6)||0<=qt&&qt<=6&&(Ht==0||Ht==6)||2<=Ht&&Ht<=4&&2<=qt&&qt<=4?jt[Kt+Ht][Qt+qt]=!0:jt[Kt+Ht][Qt+qt]=!1)},At=function(){for(var Kt=0,Qt=0,Ht=0;Ht<8;Ht+=1){mt(!0,Ht);var qt=nt.getLostPoint(dt);(Ht==0||Kt>qt)&&(Kt=qt,Qt=Ht)}return Qt},Rt=function(){for(var Kt=8;Kt>Ht&1)==1;jt[Math.floor(Ht/3)][Ht%3+bt-8-3]=qt}for(var Ht=0;Ht<18;Ht+=1){var qt=!Kt&&(Qt>>Ht&1)==1;jt[Ht%3+bt-8-3][Math.floor(Ht/3)]=qt}},Et=function(Kt,Qt){for(var Ht=Ft<<3|Qt,qt=nt.getBCHTypeInfo(Ht),Jt=0;Jt<15;Jt+=1){var ur=!Kt&&(qt>>Jt&1)==1;Jt<6?jt[Jt][8]=ur:Jt<8?jt[Jt+1][8]=ur:jt[bt-15+Jt][8]=ur}for(var Jt=0;Jt<15;Jt+=1){var ur=!Kt&&(qt>>Jt&1)==1;Jt<8?jt[8][bt-Jt-1]=ur:Jt<9?jt[8][15-Jt-1+1]=ur:jt[8][15-Jt-1]=ur}jt[bt-8][8]=!Kt},Nt=function(Kt,Qt){for(var Ht=-1,qt=bt-1,Jt=7,ur=0,xr=nt.getMaskFunction(Qt),pr=bt-1;pr>0;pr-=2)for(pr==6&&(pr-=1);;){for(var Cr=0;Cr<2;Cr+=1)if(jt[qt][pr-Cr]==null){var Mr=!1;ur>>Jt&1)==1);var lr=xr(qt,pr-Cr);lr&&(Mr=!Mr),jt[qt][pr-Cr]=Mr,Jt-=1,Jt==-1&&(ur+=1,Jt=7)}if(qt+=Ht,qt<0||bt<=qt){qt-=Ht,Ht=-Ht;break}}},tr=function(Kt,Qt){for(var Ht=0,qt=0,Jt=0,ur=new Array(Qt.length),xr=new Array(Qt.length),pr=0;pr=0?Rr.getAt(kr):0}}for(var Ar=0,lr=0;lrpr*8)throw"code length overflow. ("+Jt.getLengthInBits()+">"+pr*8+")";for(Jt.getLengthInBits()+4<=pr*8&&Jt.put(0,4);Jt.getLengthInBits()%8!=0;)Jt.putBit(!1);for(;!(Jt.getLengthInBits()>=pr*8||(Jt.put(Ot,8),Jt.getLengthInBits()>=pr*8));)Jt.put(It,8);return tr(Jt,qt)};dt.addData=function(Kt,Qt){Qt=Qt||"Byte";var Ht=null;switch(Qt){case"Numeric":Ht=ut(Kt);break;case"Alphanumeric":Ht=ht(Kt);break;case"Byte":Ht=yt(Kt);break;case"Kanji":Ht=wt(Kt);break;default:throw"mode:"+Qt}ct.push(Ht),vt=null},dt.isDark=function(Kt,Qt){if(Kt<0||bt<=Kt||Qt<0||bt<=Qt)throw Kt+","+Qt;return jt[Kt][Qt]},dt.getModuleCount=function(){return bt},dt.make=function(){if(Lt<1){for(var Kt=1;Kt<40;Kt++){for(var Qt=ot.getRSBlocks(Kt,Ft),Ht=at(),qt=0;qt"u"?Kt*4:Qt;var Ht="";Ht+='
";for(var Jt=0;Jt';Ht+=""}return Ht+="",Ht+="
",Ht},dt.createSvgTag=function(Kt,Qt,Ht,qt){var Jt={};typeof arguments[0]=="object"&&(Jt=arguments[0],Kt=Jt.cellSize,Qt=Jt.margin,Ht=Jt.alt,qt=Jt.title),Kt=Kt||2,Qt=typeof Qt>"u"?Kt*4:Qt,Ht=typeof Ht=="string"?{text:Ht}:Ht||{},Ht.text=Ht.text||null,Ht.id=Ht.text?Ht.id||"qrcode-description":null,qt=typeof qt=="string"?{text:qt}:qt||{},qt.text=qt.text||null,qt.id=qt.text?qt.id||"qrcode-title":null;var ur=dt.getModuleCount()*Kt+Qt*2,xr,pr,Cr,Mr,lr="",fr;for(fr="l"+Kt+",0 0,"+Kt+" -"+Kt+",0 0,-"+Kt+"z ",lr+=''+nr(qt.text)+"":"",lr+=Ht.text?''+nr(Ht.text)+"":"",lr+='',lr+='"u"?Kt*4:Qt;var Ht=dt.getModuleCount()*Kt+Qt*2,qt=Qt,Jt=Ht-Qt;return Bt(Ht,Ht,function(ur,xr){if(qt<=ur&&ur"u"?Kt*4:Qt;var qt=dt.getModuleCount()*Kt+Qt*2,Jt="";return Jt+="",Jt};var nr=function(Kt){for(var Qt="",Ht=0;Ht":Qt+=">";break;case"&":Qt+="&";break;case'"':Qt+=""";break;default:Qt+=qt;break}}return Qt},Zt=function(Kt){var Qt=1;Kt=typeof Kt>"u"?Qt*2:Kt;var Ht=dt.getModuleCount()*Qt+Kt*2,qt=Kt,Jt=Ht-Kt,ur,xr,pr,Cr,Mr,lr={"██":"█","█ ":"▀"," █":"▄"," ":" "},fr={"██":"▀","█ ":"▀"," █":" "," ":" "},_r="";for(ur=0;ur=Jt?fr[Mr]:lr[Mr];_r+=` + `,height:"100%",children:[jsxRuntimeExports.jsx(GridItem,{gridArea:"header",children:jsxRuntimeExports.jsx(TopBar,{title:"Help"})}),jsxRuntimeExports.jsxs(GridItem,{gridArea:"main",marginTop:1,children:[jsxRuntimeExports.jsx(HelpCard,{title:"Learn More",children:jsxRuntimeExports.jsx(HelpLinkRow,{about:"Browse Articles",externalLink:"https://medium.com/umamiwallet"})}),jsxRuntimeExports.jsxs(HelpCard,{title:"Need Help?",children:[jsxRuntimeExports.jsx(HelpLinkRow,{about:"Contact our Support Team",externalLink:"mailto:umami-support@trili.tech",linkDescription:"umami-support@trili.tech"}),jsxRuntimeExports.jsx(HelpLinkRow,{about:"Get in touch with the Community",externalLink:"https://join.slack.com/t/tezos-dev/shared_invite/zt-1ur1ymxrp-G_X_bFHrvWXwoeiy53J8lg",linkDescription:"Slack #Umami"})]}),jsxRuntimeExports.jsxs(HelpCard,{title:"Terms",children:[jsxRuntimeExports.jsx(HelpLinkRow,{about:"Read Terms of Service",externalLink:"https://umamiwallet.com/tos.html"}),jsxRuntimeExports.jsx(HelpLinkRow,{about:"Read Privacy Policy",externalLink:"https://umamiwallet.com/privacypolicy.html"})]})]})]}),HelpLinkRow=({about:a,externalLink:_,linkDescription:$})=>jsxRuntimeExports.jsx(Link,{rel:"noopener noreferrer",target:"_blank",to:_,children:jsxRuntimeExports.jsx(ClickableCard,{cursor:"pointer",isSelected:!1,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:a}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[$&&jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[400],size:"sm",children:$}),jsxRuntimeExports.jsx(ExternalLinkIcon,{})]})]})})}),HelpCard=({title:a,children:_})=>jsxRuntimeExports.jsx(Box,{"data-testid":"help-card",marginY:"10px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(Box,{width:"550px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"16px",size:"lg",children:a}),_]})})}),ConnectOptions=({goToStep:a})=>{const _=useImplicitAccounts().length>0;return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LinkIcon,{}),title:"Connect or Import Account",children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:"16px",children:[jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>a({type:"restoreMnemonic"}),size:"lg",children:"Import with Seed Phrase"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>a({type:"restoreSecretKey"}),size:"lg",variant:"tertiary",children:"Import with Secret Key"}),!_&&jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>a({type:"restoreBackup"}),size:"lg",variant:"tertiary",children:"Restore from Backup"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>a({type:"nameAccount",account:{type:"ledger"}}),size:"lg",variant:"tertiary",children:"Connect ledger"})]})})},IS_DEV=!1,ConnectOrCreate=({goToStep:a,closeModal:_})=>{const{handleAsyncAction:$}=useAsyncActionHandler(),j=useRestoreSocial(),et=useToast(),tt=(rt,nt)=>$(async()=>{const{pk:it,pkh:st}=await getPublicKeyPairFromSk(rt);j(it,st,nt),et({description:`Successfully added ${nt} account`,status:"success"}),_()});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(WalletPlusIcon,{}),title:"Connect or Create Account",children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:"16px",children:[jsxRuntimeExports.jsx(Button,{width:"100%",onClick:rt=>a({type:"notice"}),size:"lg",children:"Create a new Account"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:rt=>a({type:"connectOptions"}),size:"lg",variant:"tertiary",children:"I already have a wallet"}),IS_DEV,jsxRuntimeExports.jsxs(Flex,{width:"100%",paddingTop:"14px",paddingBottom:"6px",children:[jsxRuntimeExports.jsx(Divider,{marginTop:"11px"}),jsxRuntimeExports.jsx(Text,{minWidth:"160px",color:colors.gray[400],textAlign:"center",noOfLines:1,size:"sm",children:"Continue with Google"}),jsxRuntimeExports.jsx(Divider,{marginTop:"11px"})]}),jsxRuntimeExports.jsx(GoogleAuth,{onAuth:tt})]})})},Select=({selected:a,options:_,onChange:$})=>{const[j,et]=reactExports.useState(a),[tt,rt]=reactExports.useState(!1);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",height:"48px",padding:"12px 15px 15px 15px",color:colors.gray[300],background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px",_hover:{borderColor:colors.gray[450]},cursor:"pointer","data-testid":"select-input",onClick:()=>rt(nt=>!nt),children:[jsxRuntimeExports.jsx(Text,{size:"sm",children:j.label}),jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginTop:"2px"})]}),tt&&jsxRuntimeExports.jsx(UnorderedList,{position:"absolute",zIndex:2,width:"100%",margin:0,marginTop:"8px",padding:"15px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"select-options",listStyleType:"none",children:_.map(nt=>jsxRuntimeExports.jsx(ListItem,{marginBottom:"5px",padding:"11px",color:colors.gray[300],background:"transparent",borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",onClick:()=>{rt(!1),et(nt),$(nt.value)},children:jsxRuntimeExports.jsx(Text,{size:"sm",children:nt.label})},nt.value))})]})},DerivationPath=({goToStep:a,account:_})=>{const[$,j]=reactExports.useState(!1),{handleSubmit:et,register:tt,setValue:rt,formState:{isValid:nt,errors:it}}=useForm({mode:"onBlur",defaultValues:{derivationPathTemplate:defaultDerivationPathTemplate,derivationPath:getDefaultDerivationPath(0)}}),st=async({derivationPathTemplate:ot,derivationPath:at})=>{switch(_.type){case"ledger":return a($?{type:"restoreLedger",account:{..._,derivationPath:normalizeDerivationPath(at)}}:{type:"restoreLedger",account:{..._,derivationPathTemplate:normalizeDerivationPath(ot)}});case"mnemonic":{if($){const ut=await deriveSecretKey(_.mnemonic,at,"ed25519");return a({type:"masterPassword",account:{type:"secret_key",secretKey:ut,label:_.label}})}return a({type:"masterPassword",account:{..._,derivationPathTemplate:ot}})}}};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(SlashIcon,{}),subtitle:"Choose a custom derivation path or select the default derivation path and use the default key.",title:"Derivation Path",children:jsxRuntimeExports.jsxs("form",{onSubmit:et(st),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(Center,{width:"100%",marginBottom:"12px",children:[jsxRuntimeExports.jsx(Text,{fontWeight:$?400:600,size:"sm",children:"Default Path"}),jsxRuntimeExports.jsx(Switch,{"data-testid":"custom-path-switch",marginX:"10px",onChange:()=>j(ot=>!ot),variant:"danger"}),jsxRuntimeExports.jsx(Text,{fontWeight:$?600:400,size:"sm",children:"Custom Path"})]}),$&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Center,{marginTop:"16px",marginBottom:"32px",children:jsxRuntimeExports.jsx(Text,{width:"340px",color:colors.orange,textAlign:"center",size:"xs",children:"Please write down to your derivation path. You may not be able to restore your data if you lose it."})}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"20px",isInvalid:!!it.derivationPath,children:[jsxRuntimeExports.jsx(Input,{fontSize:"sm",textAlign:"center","data-testid":"custom-path-input",...tt("derivationPath",{validate:validateDerivationPath})}),it.derivationPath&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"error-message",children:it.derivationPath.message})]})]}),!$&&jsxRuntimeExports.jsx(FormControl,{marginTop:"32px",marginBottom:"20px",children:jsxRuntimeExports.jsx(Select,{onChange:ot=>rt("derivationPathTemplate",ot),options:AVAILABLE_DERIVATION_PATH_TEMPLATES,selected:DEFAULT_DERIVATION_PATH_TEMPLATE})}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"12px",isDisabled:!nt,size:"lg",type:"submit",children:"Continue"}),jsxRuntimeExports.jsx(ExternalLink,{display:"block",width:"100%",marginTop:"32px",textAlign:"center",href:"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki",children:jsxRuntimeExports.jsx(Tooltip,{backgroundColor:"white",defaultIsOpen:!1,hasArrow:!0,label:"Derivation path is a set of directions that helps create different secret keys; it starts from a master key or seed.",children:jsxRuntimeExports.jsx(Text,{color:colors.blue,fontWeight:600,textDecoration:"underline",_hover:{textDecoration:"underline"},size:"sm",children:"What's a Derivation Path?"})})})]})})},normalizeDerivationPath=a=>a.trim().toLowerCase().replace("m/",""),validateDerivationPath=a=>{const _=normalizeDerivationPath(a);return _.length===0?"Derivation path is required":_.startsWith("44'/1729'/")?_.match(new RegExp("^44'/1729'/([0-9]+'/)*([0-9]+')$"))?!0:"Invalid derivation path":"Derivation path must start with `44'/1729'/`"},Eula=({goToStep:a})=>{const[_,$]=React$2.useState(!1);return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(DocumentIcon,{}),title:"Accept to Continue",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Checkbox,{paddingBottom:"24px",fontWeight:"600",onChange:j=>$(j.target.checked),children:["I confirm that I have read and agreed with the"," ",jsxRuntimeExports.jsx(Link$1,{textDecoration:"underline",_hover:{color:colors.green},href:"https://umamiwallet.com/tos.html",rel:"noopener noreferrer",target:"_blank",children:"Terms of Service"})," ","and the"," ",jsxRuntimeExports.jsx(Link$1,{textDecoration:"underline",_hover:{color:colors.green},href:"https://umamiwallet.com/privacypolicy.html",rel:"noopener noreferrer",target:"_blank",children:"Privacy Policy"})]}),jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!_,onClick:()=>{a({type:"connectOrCreate"})},size:"lg",children:"Continue"})]})})},FakeAccount=({onClose:a})=>{const{register:_,handleSubmit:$,formState:{errors:j}}=useForm({mode:"onBlur"}),et=useRestoreLedger(),tt=async({pkh:rt,name:nt})=>{const st=await new RpcClient(MAINNET.rpcUrl).getManagerKey(rt),ot=typeof st=="string"?st:st.key;et(defaultDerivationPathTemplate,makeDerivationPath(defaultDerivationPathTemplate,0),ot,rt,nt),a()};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(WalletPlusIcon,{}),title:"Add a Fake Account",children:jsxRuntimeExports.jsxs("form",{onSubmit:$(tt),style:{width:"100%"},children:[jsxRuntimeExports.jsx(Text,{children:"It will be restored as a ledger account"}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.pkh,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Address"}),jsxRuntimeExports.jsx(Input,{..._("pkh",{required:!0}),autoComplete:"off",placeholder:"Please enter the account address"})]}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Name"}),jsxRuntimeExports.jsx(Input,{..._("name",{required:!0}),autoComplete:"off",placeholder:"Please enter the account name"})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:2,size:"lg",type:"submit",children:"Add account"})]})})},EnterAndConfirmPassword=({onSubmit:a,isLoading:_})=>{const $=useForm({mode:"onBlur"}),{handleSubmit:j,formState:{errors:et,isValid:tt},getValues:rt}=$,nt=({confirm:it})=>a(it);return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LockIcon,{}),subtitle:"Please choose a master password for Umami. You will need to use this password in order to perform any operations within Umami.",title:"Umami Master Password",children:jsxRuntimeExports.jsx(FormProvider,{...$,children:jsxRuntimeExports.jsxs("form",{onSubmit:j(nt),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!et.password,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password",inputName:"password",placeholder:"Enter master password"}),et.password&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.password.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!et.confirm,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"confirmation",inputName:"confirm",label:"Confirm Password",placeholder:"Confirm your password",required:"Confirmation is required",validate:it=>rt("password")===it||"Your passwords do no match"}),et.confirm&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.confirm.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!tt||_,isLoading:_,size:"lg",type:"submit",children:"Submit"})]})})})},EnterPassword=({onSubmit:a,isLoading:_})=>{const $=useForm({mode:"onBlur"}),{handleSubmit:j,formState:{errors:et,isValid:tt}}=$,rt=nt=>{a(nt.password)};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LockIcon,{}),subtitle:"Enter your master password for Umami.",title:"Umami Master Password",children:jsxRuntimeExports.jsx(FormProvider,{...$,children:jsxRuntimeExports.jsxs("form",{onSubmit:j(rt),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!et.password,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password",inputName:"password"}),et.password&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.password.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!tt,isLoading:_,size:"lg",type:"submit",children:"Submit"})]})})})},MasterPassword=({account:a,onClose:_})=>{const $=useRestoreFromMnemonic(),j=useRestoreFromSecretKey(),et=useValidateMasterPassword(),tt=et!==null,{isLoading:rt,handleAsyncAction:nt}=useAsyncActionHandler(),it=useToast(),st=ot=>nt(async()=>{switch(tt&&await et(ot),a.type){case"secret_key":await j(a.secretKey,ot,a.label);break;case"mnemonic":await $({...a,password:ot})}it({description:"Account successfully created!",status:"success"}),_()});return tt?jsxRuntimeExports.jsx(EnterPassword,{isLoading:rt,onSubmit:st}):jsxRuntimeExports.jsx(EnterAndConfirmPassword,{isLoading:rt,onSubmit:st})},Notice=({goToStep:a})=>{const _=[{content:"Write down your seed phrase and store it in a safe place."},{content:"Make sure there is no one around you or looking over your shoulder."},{content:"Do not copy and paste the Seed Phrase or store it on your device."},{content:"Do not take a screenshot of your Seed Phrase."}];return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(NoticeIcon,{}),subtitle:"Please read the following before you continue to see your secret Seed Phrase.",title:"Important Notice",children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(OrderedList,{spacing:"16px",variant:"onboardingNotice",children:_.map(($,j)=>jsxRuntimeExports.jsx(ListItem,{fontSize:"16px",fontWeight:600,children:$.content},j))}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"28px",onClick:()=>a({type:"showSeedphrase",account:{type:"mnemonic",mnemonic:generate24WordMnemonic()}}),size:"lg",children:"I understand"}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"16px",onClick:()=>a({type:"restoreMnemonic"}),size:"lg",variant:"tertiary",children:"I already have a Seed Phrase"})]})})},RestoreBackupFile=()=>{const a=useForm({mode:"onBlur"}),{handleSubmit:_,register:$,formState:{errors:j,isValid:et}}=a,{handleAsyncAction:tt}=useAsyncActionHandler(),rt=useRestoreV1BackupFile(),nt=({password:it,file:st})=>tt(async()=>{const ot=await st[0].text(),at=JSON.parse(ot);if(at.recoveryPhrases&&at.derivationPaths)await rt(at,it);else if(at["persist:accounts"])await restoreV2BackupFile(at,it),reload();else throw new Error("Invalid backup file.")});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(RotateIcon,{}),subtitle:"Select a JSON backup file and enter the password you used to encrypt it.",title:"Restore from Backup",children:jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx("form",{onSubmit:_(nt),style:{width:"100%"},children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.file,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Upload File"}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Input,{padding:"2px","data-testid":"file-input",...$("file",{required:"File is required"}),accept:".json",type:"file",variant:"unstyled"})}),j.file&&jsxRuntimeExports.jsx(FormErrorMessage$1,{"data-testid":"file-errors",children:j.file.message})]}),jsxRuntimeExports.jsx(FormControl,{marginTop:"24px",children:jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password-input",inputName:"password",label:"Your password (if you have one)",required:!1})}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!et,size:"lg",type:"submit",children:"Import Wallet"})]})})})})},getPk=async a=>{const _=await TransportWebUSB.create(),$=new LedgerSigner(_,a,!0),j=await $.publicKey(),et=await $.publicKeyHash();return await _.close(),{pk:j,pkh:et}},LEDGER_TIMEOUT=60*1e3,RestoreLedger=({closeModal:a,account:_})=>{const $=useRestoreLedger(),j=useToast(),{isLoading:et,handleAsyncAction:tt}=useAsyncActionHandler(),rt=[{content:"Plug your Ledger into your computer using a USB cable."},{content:"Unlock your Ledger."},{content:"Make sure your Ledger has the latest firmware version."},{content:"Install and open the Tezos Wallet app on your Ledger."},{content:"Click the button below and confirm the action on your Ledger."}],nt=()=>tt(()=>withTimeout(async()=>{const it=j({description:"Please open the Tezos app on your Ledger and approve the operation",status:"info"}),st=_.derivationPathTemplate?makeDerivationPath(_.derivationPathTemplate,0):_.derivationPath,{pk:ot,pkh:at}=await getPk(st);$(_.derivationPathTemplate,st,ot,at,_.label),j.close(it),j({description:"Account successfully created!",status:"success"}),a()},LEDGER_TIMEOUT),it=>it.name==="PublicKeyRetrievalError"?{description:"Request rejected. Please unlock your Ledger and open the Tezos app"}:it.name==="InvalidStateError"?{description:"Request pending. Check your ledger..."}:{description:`Ledger error. ${it.message||it.name}`});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(USBIcon,{}),subtitle:"Complete the steps to connect.",title:"Connect Ledger",children:jsxRuntimeExports.jsxs(VStack,{overflowY:"auto",spacing:"24px",children:[jsxRuntimeExports.jsx(OrderedList,{spacing:4,children:rt.map((it,st)=>jsxRuntimeExports.jsx(ListItem,{children:it.content},st))}),jsxRuntimeExports.jsx(Button,{width:"100%",isLoading:et,onClick:nt,size:"lg",children:"Export Public Key"})]})})},MnemonicAutocomplete=({inputName:a,validate:_,inputProps:$,listProps:j})=>{const[et,tt]=reactExports.useState(!0),{register:rt,setValue:nt,watch:it}=useFormContext(),st=it(a),ot=wordlists.EN.filter(ut=>st&&ut.startsWith(st)).sort(),at=!et&&ot.length>0&&(ot.length>1||ot[0]!==st);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Input,{zIndex:0,autoComplete:"off","data-testid":"mnemonic-input",onFocus:()=>tt(!1),placeholder:"Type here...",...rt(a,{required:"Required",validate:_,onChange:()=>tt(!1),onBlur:()=>tt(!0)}),...$}),at&&jsxRuntimeExports.jsx(UnorderedList,{"data-testid":"suggestions",variant:"suggestions",...j,children:ot.map(ut=>jsxRuntimeExports.jsx(ListItem,{paddingTop:"2px",fontSize:"14px",fontWeight:600,"data-testid":"suggestion",onMouseDown:()=>nt(a,ut),paddingX:"7px",children:ut},ut))})]})},mnemonicSizes=[12,15,18,24],RestoreMnemonic=({goToStep:a})=>{const _=useForm({mode:"onBlur"}),{handleSubmit:$,setValue:j,trigger:et,formState:{isValid:tt}}=_,{handleAsyncAction:rt}=useAsyncActionHandler(),[nt,it]=reactExports.useState(24),st=ut=>{const ht=Number(ut);if(mnemonicSizes.includes(ht))return it(yt=>(yt>ht&&lodashExports.range(ht,Math.max(...mnemonicSizes)).forEach(wt=>{j(`word${wt}`,void 0)}),ht)),et()},ot=ut=>rt(async()=>{const ht=ut.split(" ");if(!mnemonicSizes.includes(ht.length))throw new Error(`the mnemonic must be ${mnemonicSizes.join(", ")} words long`);return ht.slice(0,nt).forEach((yt,wt)=>{j(`word${wt}`,yt)}),et()}),at=ut=>rt(async()=>{const ht=Object.values(ut).join(" ").trim();if(!validateMnemonic_1(ht))throw new Error(`Invalid Mnemonic: "${ht}"`);return a({type:"nameAccount",account:{type:"mnemonic",mnemonic:ht}}),Promise.resolve()});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px",stroke:colors.gray[450]}),subtitle:"Please fill in the Seed Phrase in sequence.",title:"Import Seed Phrase",children:jsxRuntimeExports.jsx(Box,{overflowX:"hidden",children:jsxRuntimeExports.jsx(FormProvider,{..._,children:jsxRuntimeExports.jsx("form",{onSubmit:$(at),style:{width:"100%"},children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:4,children:[jsxRuntimeExports.jsx(Select$1,{height:"48px",color:colors.gray[450],"data-testid":"select",icon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),onChange:ut=>st(ut.target.value),value:nt,children:mnemonicSizes.reverse().map(ut=>jsxRuntimeExports.jsxs("option",{value:ut,children:[ut," Words"]},ut))}),jsxRuntimeExports.jsx(Grid,{gridGap:3,gridTemplateColumns:"repeat(3, 1fr)",paddingBottom:"20px",children:lodashExports.range(nt).map(ut=>{const ht=`word${ut}`;return jsxRuntimeExports.jsxs(GridItem,{display:"flex",height:"38px",padding:"4px",fontSize:"sm",background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px",children:[jsxRuntimeExports.jsx(Heading,{width:"19px",marginRight:"6px",paddingTop:"6px",color:colors.gray[400],textAlign:"right",size:"sm",children:ut+1}),jsxRuntimeExports.jsx(MnemonicAutocomplete,{inputName:ht,inputProps:{onPaste:async yt=>{yt.preventDefault();const wt=await navigator.clipboard.readText();return ot(wt)},border:"none",size:"xsmall"},listProps:{width:"126px",marginTop:"38px",marginLeft:"-5px"}})]},ut)})}),jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!tt,size:"lg",type:"submit",children:"Continue"}),IS_DEV]})})})})})},RestoreSecretKey=({goToStep:a})=>{const[_,$]=reactExports.useState(!1),{handleAsyncAction:j}=useAsyncActionHandler(),{register:et,handleSubmit:tt,formState:{errors:rt,isValid:nt}}=useForm({mode:"onBlur",defaultValues:{password:""}}),it=async({secretKey:st,password:ot})=>j(async()=>{try{const ut=await(await InMemorySigner.fromSecretKey(st.trim(),ot)).secretKey();a({type:"nameAccount",account:{type:"secret_key",secretKey:ut}})}catch(at){const ut=at.message||"";throw ut.includes("Cannot read properties of null (reading 'slice')")?new Error("Key-password pair is invalid"):ut.includes("Invalid checksum")?new Error("Invalid secret key: checksum doesn't match"):at}});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px",stroke:colors.gray[450]}),title:"Insert Secret Key",children:jsxRuntimeExports.jsxs("form",{onSubmit:tt(it),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!rt.secretKey,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Secret Key"}),jsxRuntimeExports.jsx(Textarea,{minHeight:"130px","data-testid":"secret-key",...et("secretKey",{required:"Secret key is required",onChange:st=>$(isEncryptedSecretKeyPrefix(st.target.value.trim()))}),placeholder:"Your secret key"}),rt.secretKey&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:rt.secretKey.message})]}),_&&jsxRuntimeExports.jsxs(FormControl,{marginTop:"20px",isInvalid:!!rt.password,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Password"}),jsxRuntimeExports.jsx(Input,{"data-testid":"password",...et("password",{validate:st=>{if(!st.trim())return"Password is required"}})}),rt.password&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:rt.password.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!nt,size:"lg",type:"submit",children:"Continue"})]})})},ShowSeedphrase=({goToStep:a,account:_})=>jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px",stroke:colors.gray[450]}),subtitle:"Please record the following 24 words in sequence in order to restore it in the future.",title:"Record Seed Phrase",children:jsxRuntimeExports.jsxs(VStack,{children:[jsxRuntimeExports.jsx(SimpleGrid,{columns:3,spacing:2,children:_.mnemonic.split(" ").map(($,j)=>jsxRuntimeExports.jsxs(Flex,{width:"126px",padding:"6px",border:"1px dashed",borderColor:colors.gray[500],borderRadius:"4px",children:[jsxRuntimeExports.jsx(Heading,{width:"18px",marginRight:"10px",paddingTop:"2px",color:colors.gray[450],textAlign:"right",size:"sm",children:j+1}),jsxRuntimeExports.jsx(Text,{"data-testid":`mnemonic-word-${j}`,size:"sm",children:$})]},j))}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"20px",onClick:$=>{a({type:"verifySeedphrase",account:_})},size:"lg",children:"OK, I've recorded it"})]})}),VerifySeedphrase=({goToStep:a,account:_})=>{const $=_.mnemonic.split(" "),j=useForm({mode:"onBlur"}),{handleSubmit:et,formState:{errors:tt,isValid:rt}}=j,[nt]=reactExports.useState(selectRandomElements($,5)),it=()=>a({type:"nameAccount",account:_});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(DoubleCheckmarkIcon,{}),subtitle:"To verify, please type in the word that corresponds to each sequence number.",title:"Verify Seed Phrase",children:jsxRuntimeExports.jsx(Box,{overflowX:"hidden",overflowY:"auto",width:"100%",children:jsxRuntimeExports.jsx(FormProvider,{...j,children:jsxRuntimeExports.jsxs("form",{onSubmit:et(it),children:[nt.map((st,ot)=>{const at=`${st.index}`,ut=tt[at];return jsxRuntimeExports.jsxs(FormControl,{marginBottom:"12px",isInvalid:!!ut,children:[jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:1,width:"26px",marginTop:"12px",marginLeft:"4px",textAlign:"right","data-testid":"mnemonic-index",children:st.index+1}),jsxRuntimeExports.jsx(Box,{width:"100%",children:jsxRuntimeExports.jsx(MnemonicAutocomplete,{inputName:at,inputProps:{paddingLeft:"36px",size:"md"},listProps:{marginTop:"6px"},validate:ht=>{if(ht!==st.value)return"Word doesn't match"}})}),(ut==null?void 0:ut.message)&&jsxRuntimeExports.jsx(FormErrorMessage,{children:ut.message})]},ot)}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"20px",isDisabled:!rt,size:"lg",type:"submit",children:"Continue"}),IS_DEV]})})})})},useStepHistory=a=>{const[_,$]=reactExports.useState(a),[j,et]=reactExports.useState([_]),tt=j.length===1;return{reset:()=>{$(a),et([a])},goToStep:rt=>{$(rt),et([...j,rt])},currentStep:_,goBack:()=>{if(tt)return;j.pop();const rt=j[j.length-1];et(j),$(rt)},atInitialStep:tt,fullHistory:j}},useOnboardingModal=a=>{const{isOpen:_,onOpen:$,onClose:j}=useDisclosure$1(),et=useImplicitAccounts().length!==0,tt=useStepHistory({type:et?"connectOrCreate":"eula"}),{currentStep:rt,goToStep:nt}=tt,it=()=>{tt.reset(),a&&a(),j()},st=()=>{switch(rt.type){case"eula":return jsxRuntimeExports.jsx(Eula,{goToStep:nt});case"connectOrCreate":return jsxRuntimeExports.jsx(ConnectOrCreate,{closeModal:it,goToStep:nt});case"connectOptions":return jsxRuntimeExports.jsx(ConnectOptions,{goToStep:nt});case"notice":return jsxRuntimeExports.jsx(Notice,{goToStep:nt});case"restoreMnemonic":return jsxRuntimeExports.jsx(RestoreMnemonic,{goToStep:nt});case"restoreBackup":return jsxRuntimeExports.jsx(RestoreBackupFile,{});case"showSeedphrase":return jsxRuntimeExports.jsx(ShowSeedphrase,{goToStep:nt,...rt});case"verifySeedphrase":return jsxRuntimeExports.jsx(VerifySeedphrase,{goToStep:nt,...rt});case"nameAccount":return jsxRuntimeExports.jsx(NameAccount,{goToStep:nt,...rt});case"derivationPath":return jsxRuntimeExports.jsx(DerivationPath,{goToStep:nt,...rt});case"restoreLedger":return jsxRuntimeExports.jsx(RestoreLedger,{closeModal:it,...rt});case"masterPassword":return jsxRuntimeExports.jsx(MasterPassword,{onClose:it,...rt});case"fakeAccount":return jsxRuntimeExports.jsx(FakeAccount,{onClose:j});case"restoreSecretKey":return jsxRuntimeExports.jsx(RestoreSecretKey,{goToStep:nt})}};return{modalElement:jsxRuntimeExports.jsxs(Modal,{autoFocus:!1,closeOnOverlayClick:!1,isCentered:!0,isOpen:_,onClose:it,children:[et&&jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(ModalContent,{children:[!tt.atInitialStep&&jsxRuntimeExports.jsx(ModalBackButton,{onClick:tt.goBack}),jsxRuntimeExports.jsx(ModalCloseButton,{onClick:it}),st()]})]}),onOpen:$}},AccountListHeader=()=>{const{onOpen:a,modalElement:_}=useOnboardingModal();return jsxRuntimeExports.jsxs(Flex,{flexDirection:"row-reverse",marginTop:"12px",marginBottom:"16px",children:[jsxRuntimeExports.jsxs(Button,{paddingRight:"0",onClick:a,variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(AddAccountIcon,{stroke:"currentcolor"}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:"Add Account"})]}),_]})},AccountGroupPopover=({onRemove:a,onCreate:_})=>jsxRuntimeExports.jsx(PopoverMenu,{children:jsxRuntimeExports.jsxs(Box,{paddingY:"0",children:[jsxRuntimeExports.jsx(Button,{height:_?"24px":"28px","data-testid":"popover-remove",onClick:a,variant:"popover",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Remove"}),jsxRuntimeExports.jsx(TrashIcon,{stroke:"inherit"})]})}),_&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{marginY:"4px"}),jsxRuntimeExports.jsx(Button,{onClick:_,variant:"popover",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Create"}),jsxRuntimeExports.jsx(PlusIcon,{width:"18px",height:"18px",stroke:"inherit"})]})})]})]})}),DeriveMnemonicAccountModal=({onDone:a,fingerPrint:_})=>{const[$,j]=reactExports.useState(),{isLoading:et,handleAsyncAction:tt}=useAsyncActionHandler(),rt=useToast(),nt=useDeriveMnemonicAccount(),it=({name:st,password:ot})=>tt(async()=>{await nt({fingerPrint:_,password:ot,label:st.trim()||DEFAULT_ACCOUNT_LABEL}),a(),rt({description:`New account created! Successfully derived account from ${_}`})},{title:"Failed to derive new account"});return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),$?jsxRuntimeExports.jsx(EnterPassword,{isLoading:et,onSubmit:st=>it({name:$,password:st})}):jsxRuntimeExports.jsx(NameAccountDisplay,{onSubmit:st=>j(st.accountName),subtitle:`Name the new account derived from ${_}`})]})},getAccountGroupLabel=a=>{switch(a.type){case"mnemonic":return`Seedphrase ${a.seedFingerPrint}`;case"social":return"Social Accounts";case"ledger":return"Ledger Accounts";case"secret_key":return"Secret Key Accounts";case"multisig":return"Multisig Accounts"}},AccountGroup=({groupLabel:a,accounts:_,balances:$})=>{const j=_[0],et=j.type==="multisig",tt=j.type==="mnemonic",{openWith:rt,onClose:nt}=reactExports.useContext(DynamicModalContext),it=useRemoveMnemonic(),st=useRemoveNonMnemonic(),ot=useImplicitAccounts().length===_.length,at="Remove All Accounts";let ut,ht="Remove All";const yt=getAccountGroupLabel(j);ot?(ut="Removing all your accounts will off-board you from Umami. This will remove or reset all customized settings to their defaults. Personal data (including saved contacts, password and accounts) won't be affected.",ht="Remove & Off-board"):tt?ut=`Are you sure you want to remove all accounts derived from ${yt}?`:ut=`Are you sure you want to remove all of your ${yt}?`;const wt=()=>rt(jsxRuntimeExports.jsx(ConfirmationModal,{buttonLabel:ht,description:ut,onSubmit:()=>{tt?it(j.seedFingerPrint):et||st(j.type),nt()},title:at})),Ct=()=>{if(!tt)throw new Error("Can't derive a non mnemonic account!");return rt(jsxRuntimeExports.jsx(DeriveMnemonicAccountModal,{fingerPrint:j.seedFingerPrint,onDone:nt}))};return jsxRuntimeExports.jsxs(Box,{"data-testid":`account-group-${a}`,children:[jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",marginTop:"24px",marginBottom:"16px",children:[jsxRuntimeExports.jsx(Heading,{"data-testid":"account-group-title",size:"md",children:a}),!et&&jsxRuntimeExports.jsx(AccountGroupPopover,{onCreate:tt?Ct:void 0,onRemove:wt})]}),_.map(Pt=>jsxRuntimeExports.jsx(Box,{marginBottom:"16px",children:jsxRuntimeExports.jsx(AccountTile,{account:Pt,balance:$[Pt.address.pkh]})},Pt.address.pkh))]})},NestedScroll=a=>jsxRuntimeExports.jsx(Box,{overflowY:"auto",height:"100%",children:a.children});var indicator$1=function a(_){_=Math.abs(_);var $=_%100;if($>=10&&$<=20)return"th";var j=_%10;return j===1?"st":j===2?"nd":j===3?"rd":"th"},indicator=indicator$1;function ordinal(a){if(typeof a!="number")throw new TypeError("Expected Number, got "+typeof a+" "+a);return Number.isFinite(a)?a+indicator(a):a}ordinal.indicator=indicator;var ordinal_1=ordinal;const ordinal$1=getDefaultExportFromCjs$1(ordinal_1),SignTransactionFormPage=a=>{const _=useAppDispatch(),{isLoading:$,handleAsyncAction:j}=useAsyncActionHandler(),{mode:et,operations:tt,fee:rt,data:{threshold:nt,signers:it,name:st}}=a,{fee:ot,operations:at,estimationFailed:ut,isLoading:ht,form:yt,reEstimate:wt,signer:Ct,onSign:Pt}=useSignPageHelpers(rt,tt,et),$t=$||ht,Mt=Bt=>j(async()=>{const Dt=await Pt(Bt);if(!Dt)throw new Error("An error occurred during contract origination");const zt=(await Dt.getOriginatedContractAddresses())[0];_(multisigActions.addMultisigLabel({pkh:zt,label:st}))});return jsxRuntimeExports.jsx(FormProvider,{...yt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,description:"Please review the details and then continue to submit contract.",operationsType:at.type,signer:Ct,title:"Review & Submit"}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Text,{marginBottom:"24px",padding:"14px",color:colors.gray[50],background:colors.gray[800],borderRadius:"6px","data-testid":"contract-name",children:st}),jsxRuntimeExports.jsx(FormLabel,{children:"Approvers"}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column",gap:"12px",marginBottom:"12px","data-testid":"approvers",children:it.map(Bt=>jsxRuntimeExports.jsx(AddressTile,{address:parsePkh(Bt.val),"data-testid":`approver-${Bt.val}`},Bt.val))}),jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",children:jsxRuntimeExports.jsx(Threshold,{signersAmount:it.length,threshold:nt})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(FormControl,{marginTop:"24px",marginBottom:"12px",children:jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!1,inputName:"signer",isLoading:$t,keepValid:!0,label:"Creation Fee Payer",onUpdate:wt})}),jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",children:jsxRuntimeExports.jsx(SignPageFee,{fee:ot})})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:ut,isLoading:$t,onSubmit:Mt,signer:Ct,text:"Submit Contract"})})]})})})},Threshold=({threshold:a,signersAmount:_})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"threshold",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"No. of approvals:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:`${a} out of ${_}`})]}),contract=[{prim:"storage",args:[{prim:"pair",args:[{prim:"address",annots:["%owner"]},{prim:"pair",args:[{prim:"set",args:[{prim:"address"}],annots:["%signers"]},{prim:"pair",args:[{prim:"nat",annots:["%threshold"]},{prim:"pair",args:[{prim:"nat",annots:["%last_op_id"]},{prim:"pair",args:[{prim:"big_map",args:[{prim:"nat"},{prim:"pair",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}],annots:["%actions"]},{prim:"set",args:[{prim:"address"}],annots:["%approvals"]}]}],annots:["%pending_ops"]},{prim:"big_map",args:[{prim:"string"},{prim:"bytes"}],annots:["%metadata"]}]}]}]}]}]}]},{prim:"parameter",args:[{prim:"or",args:[{prim:"or",args:[{prim:"or",args:[{prim:"bytes",annots:["%set_metadata_uri"]},{prim:"unit",annots:["%default"]}]},{prim:"or",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}],annots:["%propose"]},{prim:"nat",annots:["%approve"]}]}]},{prim:"nat",annots:["%execute"]}]}]},{prim:"code",args:[[{prim:"NIL",args:[{prim:"operation"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"UNPAIR"},{prim:"DIP",args:[{int:"1"},[{prim:"UNPAIR",args:[{int:"6"}]}]]},{prim:"IF_LEFT",args:[[{prim:"IF_LEFT",args:[[{prim:"IF_LEFT",args:[[{prim:"DUP",args:[{int:"2"}]},{prim:"SENDER"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID_CALLER"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"SOME"},{prim:"PUSH",args:[{prim:"string"},{string:""}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}],[{prim:"DROP",args:[{int:"1"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"SIZE"},{prim:"COMPARE"},{prim:"GE"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"FUNDING BLOCKED SINCE PARAMS ARE INVALID"}]},{prim:"FAILWITH"}],[]]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}],[{prim:"IF_LEFT",args:[[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"3"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"nat"},{int:"1"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"ADD"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"4"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"4"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"MEM"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"KEY_EXISTS"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[{prim:"DUP",args:[{int:"6"}]},{prim:"EMPTY_SET",args:[{prim:"address"}]},{prim:"PUSH",args:[{prim:"bool"},{prim:"True"}]},{prim:"SENDER"},{prim:"UPDATE"},{prim:"DUP",args:[{int:"3"}]},{prim:"PAIR"},{prim:"SOME"},{prim:"DUP",args:[{int:"7"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"5"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"5"}]}]]},{prim:"DROP",args:[{int:"1"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}],[{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID OP ID"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"4"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP"},{prim:"CDR"},{prim:"SENDER"},{prim:"MEM"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ALREADY APPROVED"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"8"}]},{prim:"DUP",args:[{int:"4"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"UNPAIR"},{prim:"SWAP"},{prim:"DROP",args:[{int:"1"}]},{prim:"DUP",args:[{int:"9"}]},{prim:"DUP",args:[{int:"5"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"CDR"},{prim:"PUSH",args:[{prim:"bool"},{prim:"True"}]},{prim:"SENDER"},{prim:"UPDATE"},{prim:"SWAP"},{prim:"PAIR"},{prim:"SOME"},{prim:"DUP",args:[{int:"4"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"2"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}]]}],[{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID OP ID"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"4"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"5"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"CDR"},{prim:"SIZE"},{prim:"COMPARE"},{prim:"GE"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"NOT YET APPROVED"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"CAR"},{prim:"PUSH",args:[{prim:"unit"},{prim:"Unit"}]},{prim:"EXEC"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"8"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"8"}]},{prim:"DUP",args:[{int:"7"}]},{prim:"NONE",args:[{prim:"pair",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}]},{prim:"set",args:[{prim:"address"}]}]}]},{prim:"DUP",args:[{int:"4"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"2"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}]]}],makeStorageJSON=(a,_,$)=>({owner:a,signers:_,threshold:$,last_op_id:"0",pending_ops:[],metadata:[]}),toOperation$4=a=>({type:"contract_origination",sender:parsePkh(a.sender),code:contract,storage:makeStorageJSON(a.sender,a.signers.map(_=>_.val),String(a.threshold))}),SelectApproversFormPage=a=>{const{goBack:_,sender:$,...j}=a,et=useForm({mode:"onBlur",defaultValues:{sender:$.address.pkh,signers:[{val:""}],threshold:1,...formDefaultValues(j)}}),{formState:{errors:tt,isValid:rt},control:nt,register:it,handleSubmit:st,getValues:ot,watch:at}=et,ut=useFieldArray({control:nt,name:"signers",rules:{minLength:1}}),ht=at("signers").length,yt=useOpenSignPageFormAction({SignPage:SignTransactionFormPage,signPageExtraData:at(),FormPage:SelectApproversFormPage,defaultFormPageProps:a,toOperation:toOperation$4}),{onFormSubmitActionHandlers:[wt],isLoading:Ct}=useHandleOnSubmitFormActions([yt]);return jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalBackButton,{onClick:_}),jsxRuntimeExports.jsxs("form",{onSubmit:st(wt),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Select the participants of the contract and choose the minimum number of approvals.",title:"Select Approvers"}),jsxRuntimeExports.jsxs(ModalBody,{children:[ut.fields.map((Pt,$t)=>{var Ot;const Mt=tt.signers&&tt.signers[$t],Bt=`${$t===0?"Select ":""}${ordinal$1($t+1)} approver`,Dt=ht>1?"short":"default",zt=Dt==="short"?"368px":"100%";return jsxRuntimeExports.jsxs(FormControl,{display:"inline-block",width:zt,marginBottom:"8px","data-testid":`signer-input-${$t}`,isInvalid:!!Mt,children:[jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!0,inputName:`signers.${$t}.val`,label:Bt,size:Dt,style:{width:zt},validate:It=>{if(!isValidImplicitPkh(It))return"Signer must be valid TZ address";const Lt=ot("signers").map(Ft=>Ft.val);if(Lt.length>new Set(Lt).size)return"Duplicate approver"}}),ht>1&&jsxRuntimeExports.jsx(IconButton,{position:"absolute",height:"24px",marginTop:"-36px",marginLeft:"374px",background:colors.gray[500],"aria-label":"Remove","data-testid":`remove-signer-${$t}`,icon:jsxRuntimeExports.jsx(TrashIcon,{width:"12px",height:"14px",stroke:colors.gray[300]}),isRound:!0,onClick:()=>ut.remove($t),size:"xs",variant:"tertiary"}),Mt&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":`signer-${$t}-error`,children:(Ot=Mt.val)==null?void 0:Ot.message})]},Pt.id)}),jsxRuntimeExports.jsx(Button,{paddingLeft:0,onClick:()=>ut.append({val:""}),variant:"specialCTA",children:"+ Add Approver"}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!tt.threshold,children:[jsxRuntimeExports.jsxs(FormLabel,{display:"inline",children:["Min No. of approvals:",jsxRuntimeExports.jsx(InputGroup,{display:"inline",marginLeft:"10px",children:jsxRuntimeExports.jsx(Input,{width:"60px",color:"white","data-testid":"threshold-input",step:1,type:"number",...it("threshold",{valueAsNumber:!0,required:"No. of approvals is required",max:{value:ht,message:`Max no. of approvals is ${ht}`},min:{value:1,message:"Min no. of approvals is 1"}})})})]}),jsxRuntimeExports.jsxs(Text,{display:"inline","data-testid":"max-signers",children:["out of ",ht]}),tt.threshold&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"threshold-error",children:tt.threshold.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!rt,isLoading:Ct,size:"lg",type:"submit",children:"Review"})})]})]})})},NameMultisigFormPage=({name:a})=>{const _=useForm({mode:"onBlur",defaultValues:{name:a||""}}),{formState:{errors:$,isValid:j},register:et,handleSubmit:tt}=_,rt=useImplicitAccounts(),nt=useGetMostFundedImplicitAccount(),{openWith:it}=reactExports.useContext(DynamicModalContext),st=({name:at})=>it(jsxRuntimeExports.jsx(SelectApproversFormPage,{form:{name:at.trim()},goBack:()=>it(jsxRuntimeExports.jsx(NameMultisigFormPage,{name:at})),sender:nt(rt)})),ot=useValidateName();return jsxRuntimeExports.jsx(FormProvider,{..._,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:tt(st),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Name your account. The account name will only appear in your local Umami app.",title:"Account Name"}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!$.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Account Name"}),jsxRuntimeExports.jsx(InputGroup,{children:jsxRuntimeExports.jsx(Input,{"data-testid":"multisig-account-name",type:"text",...et("name",{validate:ot}),placeholder:"Account Name"})}),$.name&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"name-error",children:$.name.message})]})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!j,size:"lg",type:"submit",children:"Continue"})})]})})})},AccountsList=()=>{const a=useAllAccounts(),_=useAppSelector(tt=>tt.assets.balances.mutez),$=lodashExports.groupBy(a,getAccountGroupLabel),{openWith:j}=reactExports.useContext(DynamicModalContext),et=Object.entries($).map(([tt,rt])=>jsxRuntimeExports.jsx(AccountGroup,{accounts:rt,balances:_,groupLabel:tt},tt));return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box,{height:"100%",marginRight:0,children:jsxRuntimeExports.jsxs(NestedScroll,{children:[lodashExports.compact(et),jsxRuntimeExports.jsx(Button,{width:"100%",height:"90px",background:colors.black,border:"1px dashed",borderColor:colors.gray[500],onClick:()=>j(jsxRuntimeExports.jsx(NameMultisigFormPage,{})),variant:"outline",children:jsxRuntimeExports.jsxs(Text,{display:"block",width:"100%",margin:"20px",color:colors.gray[400],textAlign:"center",children:[jsxRuntimeExports.jsx(KeyIcon,{marginRight:"4px",stroke:colors.gray[450]}),"Create New Multisig"]})})]})})})},useGetDelegationPrettyDisplayValues=()=>{const a=useGetAccountBalance();return _=>{const $=a(_.sender),j=new Date,et=prettyTezAmount(_.amount),tt=$&&prettyTezAmount($),rt=`Since ${formatRelative(new Date(_.timestamp),j)}`;return{initialBalance:et,currentBalance:tt,duration:rt}}},SignPage$4=a=>{const{mode:_,operations:$,fee:j}=a,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:st,reEstimate:ot,onSign:at}=useSignPageHelpers(j,$,_),ut=tt.operations[0].recipient;return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:st.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(SignPageFee,{fee:et})})}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:ut}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:ot,sender:tt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:at,signer:st,text:headerText(tt.type,_)})})]})})})},FormPage$3=a=>{var at;const _=(at=a.form)==null?void 0:at.baker,$=useOpenSignPageFormAction({SignPage:SignPage$4,signPageExtraData:void 0,FormPage:FormPage$3,defaultFormPageProps:a,toOperation:toOperation$3}),j=useAddToBatchFormAction(toOperation$3),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(a)}),{formState:{isValid:it,errors:st},handleSubmit:ot}=nt;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{"data-testid":"delegate-form",children:[jsxRuntimeExports.jsxs(HeaderWrapper,{children:[jsxRuntimeExports.jsx(Text,{fontWeight:"600",size:"2xl",children:_?"Change Baker":"Delegate"}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!st.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!!a.sender,label:"From"}),st.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:st.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px","data-testid":"baker",isInvalid:!!st.baker,children:[jsxRuntimeExports.jsx(BakersAutocomplete,{allowUnknown:!0,inputName:"baker",label:"Baker"}),st.baker&&jsxRuntimeExports.jsx(FormErrorMessage,{children:st.baker.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation$3=a=>({type:"delegation",sender:parsePkh(a.sender),recipient:parseImplicitPkh(a.baker)}),SignPage$3=a=>{const{mode:_,operations:$,fee:j}=a,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:st,reEstimate:ot,onSign:at}=useSignPageHelpers(j,$,_);return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:st.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",paddingX:"4px",children:jsxRuntimeExports.jsx(SignPageFee,{fee:et})}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:ot,sender:tt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:at,signer:st,text:headerText(tt.type,_)})})]})})})},FormPage$2=a=>{var ot;const{sender:_}=a,$=(ot=a.form)==null?void 0:ot.baker,j=useOpenSignPageFormAction({SignPage:SignPage$3,signPageExtraData:void 0,FormPage:FormPage$2,defaultFormPageProps:{sender:_},toOperation:toOperation$2}),et=useAddToBatchFormAction(toOperation$2),{onFormSubmitActionHandlers:[tt,rt],isLoading:nt}=useHandleOnSubmitFormActions([j,et]),it=useForm({mode:"onBlur",defaultValues:formDefaultValues({sender:_})}),{handleSubmit:st}=it;return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{"data-testid":"undelegate-form",children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Select preview to end delegation or insert this transaction into a Batch.",title:"End Delegation"}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"})}),jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"Baker"}),$&&jsxRuntimeExports.jsx(AddressTile,{address:parsePkh($)})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:nt,isValid:!0,onAddToBatch:st(rt),onSingleSubmit:st(tt)})})]})})})},toOperation$2=a=>({type:"undelegation",sender:parsePkh(a.sender)}),Row=({label:a,value:_,...$})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"50px",padding:"16px","data-testid":a,...$,children:[jsxRuntimeExports.jsx(Box,{flex:1,children:jsxRuntimeExports.jsx(Heading,{color:colors.gray[400],size:"sm",children:a})}),jsxRuntimeExports.jsx(Box,{flex:1,children:typeof _=="string"?jsxRuntimeExports.jsx(Text,{size:"sm",children:_}):_})]}),DelegationDisplay=({delegation:a,account:_})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext),j=useGetOwnedAccount(),et=useGetDelegationPrettyDisplayValues();if(!a)return jsxRuntimeExports.jsx(NoDelegations,{onDelegate:()=>$(jsxRuntimeExports.jsx(FormPage$3,{sender:_})),size:"md"});const{currentBalance:tt,duration:rt,initialBalance:nt}=et(a),{sender:it,delegate:{address:st}}=a,ot=j(it);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Row,{borderBottom:`1px solid ${colors.gray[700]}`,borderTopRadius:"8px",_odd:{bg:colors.gray[800]},label:"Initial Balance:",value:nt}),tt&&jsxRuntimeExports.jsx(Row,{_odd:{bg:colors.gray[800]},label:"Current Balance:",value:tt}),jsxRuntimeExports.jsx(Row,{borderBottom:`1px solid ${colors.gray[700]}`,_odd:{bg:colors.gray[800]},label:"Duration:",value:rt}),jsxRuntimeExports.jsx(Row,{borderBottomRadius:"8px",_odd:{bg:colors.gray[800]},label:"Baker:",value:jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.delegate.address)})}),jsxRuntimeExports.jsxs(Flex,{marginTop:"24px",children:[jsxRuntimeExports.jsx(Button,{flex:1,marginRight:"16px",onClick:()=>$(jsxRuntimeExports.jsx(FormPage$2,{form:{sender:it,baker:st},sender:ot})),variant:"warning",children:"End Delegation"}),jsxRuntimeExports.jsx(Button,{flex:1,onClick:()=>$(jsxRuntimeExports.jsx(FormPage$3,{form:{sender:it,baker:st},sender:ot})),variant:"tertiary",children:"Change Baker"})]})]})},MultisigDecodedOperation=({operation:a})=>{switch(a.type){case"delegation":return jsxRuntimeExports.jsxs(Box,{"data-testid":"decoded-item-delegate",marginY:6,children:[jsxRuntimeExports.jsx(Text,{marginRight:"3px",color:colors.gray[450],fontSize:"14px",children:"Delegate to:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.recipient})]});case"undelegation":return jsxRuntimeExports.jsx(Box,{"data-testid":"decoded-item-undelegate",marginY:6,children:jsxRuntimeExports.jsx(Text,{color:colors.gray[450],fontSize:"14px",children:"End Delegation"})});case"tez":case"fa1.2":case"fa2":return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MultisigOperationAmount,{operation:a}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"8px",children:[jsxRuntimeExports.jsx(Text,{marginRight:"3px",color:colors.gray[450],fontSize:"14px",children:"Send to:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.recipient})]})]});case"contract_origination":case"contract_call":throw new Error(`${a.type} is not supported yet`)}},MultisigOperationAmount=({operation:a})=>{const _=useGetToken();switch(a.type){case"tez":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"decoded-tez-amount",children:[jsxRuntimeExports.jsx(OutgoingArrow,{}),jsxRuntimeExports.jsxs(Text,{marginLeft:"8px",color:colors.orange,fontSize:"14px",fontWeight:600,textAlign:"center",children:["-",prettyTezAmount(a.amount)]})]});case"fa1.2":case"fa2":{const $=_(a.contract.pkh,a.tokenId);if(!$)return null;const j=tokenNameSafe($),et=$.type==="nft";return jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"decoded-fa-amount",children:[jsxRuntimeExports.jsx(OutgoingArrow,{}),jsxRuntimeExports.jsx(Box,{marginLeft:"8px",color:colors.orange,textAlign:"center",children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Text,{display:"inline",marginRight:"3px",fontSize:"14px",fontWeight:600,children:a.amount}),jsxRuntimeExports.jsx(Text,{display:"inline",color:"white",fontSize:"14px",fontWeight:600,children:j})]}):jsxRuntimeExports.jsxs(Text,{fontSize:"14px",fontWeight:600,children:["-",tokenPrettyAmount(a.amount,$,{showSymbol:!0})]})})]})}case"delegation":case"undelegation":case"contract_origination":case"contract_call":return null}},caseInsensitiveLiteral=a=>z.string().regex(new RegExp(`^${a}$`,"i")),prim=a=>z.object({prim:caseInsensitiveLiteral(a)}),pushKeyHashSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("key_hash")}),z.object({bytes:z.string()})])}),pushAddressSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("address")}),z.object({bytes:z.string()})])}),pair=(a,_)=>z.object({prim:z.literal("Pair"),args:z.tuple([a,_])}),contractZeroTezSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("mutez")}),z.object({int:z.literal("0")})])}),lambdaEndSchema=[prim("TRANSFER_TOKENS"),prim("CONS")],contractHeadSchema=z.object({prim:z.literal("CONTRACT")}),batchHeadSchema=z.tuple([z.object({prim:z.literal("DROP")}),z.object({prim:z.literal("NIL"),args:z.array(z.object({prim:z.literal("operation")}))})]),pushMutezSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("mutez")}),z.object({int:z.string()})])}),tezSchema=z.tuple([pushKeyHashSchema,prim("IMPLICIT_ACCOUNT"),pushMutezSchema,prim("UNIT"),...lambdaEndSchema]),contractTezSchema=z.tuple([pushAddressSchema,contractHeadSchema,prim("IF_NONE"),pushMutezSchema,prim("UNIT"),...lambdaEndSchema]),setDelegateSchema=z.tuple([pushKeyHashSchema,prim("SOME"),prim("SET_DELEGATE"),prim("CONS")]),removeDelegateSchema=z.tuple([z.object({prim:z.literal("NONE"),args:z.tuple([z.object({prim:z.literal("key_hash")})])}),prim("SET_DELEGATE"),prim("CONS")]),fa2Schema=z.tuple([pushAddressSchema,contractHeadSchema,z.tuple([prim("IF_NONE")]),contractZeroTezSchema,z.object({prim:z.literal("PUSH"),args:z.tuple([prim("list"),z.array(pair(z.object({bytes:z.string({description:"from"})}),z.array(pair(z.object({bytes:z.string({description:"to"})}),pair(z.object({int:z.string({description:"token_id"})}),z.object({int:z.string({description:"amount"})}))))))])}),...lambdaEndSchema]),fa1Schema=z.tuple([pushAddressSchema,contractHeadSchema,z.tuple([prim("IF_NONE")]),contractZeroTezSchema,z.object({prim:z.literal("PUSH"),args:z.tuple([prim("Pair"),pair(z.object({bytes:z.string({description:"from"})}),pair(z.object({bytes:z.string({description:"to"})}),z.object({int:z.string({description:"amount"})})))])}),...lambdaEndSchema]);class UnrecognizedMichelsonError extends Error{}const convertToPkh=a=>(a.length===42&&(a="00"+a),encodeAddress(a)),parseTez=a=>{const _=tezSchema.parse(a),$=_[0].args[1].bytes,j=_[2].args[1].int;return{type:"tez",recipient:parseImplicitPkh(convertToPkh($)),amount:j}},parseTezContract=a=>{const _=contractTezSchema.parse(a),$=_[0].args[1].bytes,j=_[3].args[1].int;return{type:"tez",recipient:parseContractPkh(convertToPkh($)),amount:j}},parseFa2=a=>{const _=fa2Schema.parse(a),$=parseContractPkh(convertToPkh(_[0].args[1].bytes));return _[4].args[1].flatMap(et=>{const tt=et.args[0].bytes;return et.args[1].map(rt=>{const nt=rt.args[0].bytes,it=rt.args[1].args[0].int,st=rt.args[1].args[1].int;return{type:"fa2",contract:$,sender:parsePkh(convertToPkh(tt)),recipient:parsePkh(convertToPkh(nt)),tokenId:it,amount:st}})})},parseFa1=a=>{const _=fa1Schema.parse(a),$=_[0],j=_[4].args[1],et=j.args[0].bytes,tt=j.args[1].args[0].bytes;return{type:"fa1.2",amount:j.args[1].args[1].int,contract:parseContractPkh(convertToPkh($.args[1].bytes)),recipient:parsePkh(convertToPkh(tt)),sender:parsePkh(convertToPkh(et)),tokenId:"0"}},parseSetDelegate=(a,_)=>{const $=setDelegateSchema.parse(a);return{type:"delegation",sender:_.address,recipient:parseImplicitPkh(convertToPkh($[0].args[1].bytes))}},parseRemoveDelegate=(a,_)=>({type:"undelegation",sender:_.address}),parsings=[{schema:tezSchema,parsingFn:parseTez},{schema:contractTezSchema,parsingFn:parseTezContract},{schema:fa2Schema,parsingFn:parseFa2},{schema:fa1Schema,parsingFn:parseFa1},{schema:setDelegateSchema,parsingFn:parseSetDelegate},{schema:removeDelegateSchema,parsingFn:parseRemoveDelegate}],parse=(a,_,$=[])=>{if(a.length===0)return $;for(let j=0;j{batchHeadSchema.parse(a.slice(0,2))},decode=(a,_)=>(assertHead(a),parse(a.slice(2),_)),parseRawMichelson=(a,_)=>{const $=JSON.parse(a);return decode($,_)},MultisigDecodedOperations=({rawMichelson:a,sender:_})=>{try{const $=parseRawMichelson(a,_);return jsxRuntimeExports.jsx(Box,{borderRadius:"8px",backgroundColor:colors.gray[900],children:$.map((j,et)=>jsxRuntimeExports.jsxs(Box,{width:"100%",paddingTop:"10px",paddingBottom:et<$.length-1?0:"15px",paddingX:"15px",children:[jsxRuntimeExports.jsx(MultisigDecodedOperation,{operation:j}),et<$.length-1&&jsxRuntimeExports.jsx(Divider,{marginTop:"15px"})]},et))})}catch($){return $ instanceof UnrecognizedMichelsonError?jsxRuntimeExports.jsx(UnrecognizedOperation,{rawMichelson:a}):jsxRuntimeExports.jsxs(Box,{height:"50px",padding:"10px",background:colors.gray[900],borderRadius:"8px",children:["Invalid michelson code: ",$.message]})}},UnrecognizedOperation=({rawMichelson:a})=>jsxRuntimeExports.jsx(Accordion,{width:"100%",marginBottom:"8px",background:colors.gray[900],borderColor:colors.gray[900],borderRadius:"8px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{children:[jsxRuntimeExports.jsxs(AccordionButton,{children:[jsxRuntimeExports.jsx(Heading,{flex:"1",height:"30px",marginTop:"6px",textAlign:"left",size:"md",children:"Unrecognized operation"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{overflowY:"scroll",height:"400px",paddingBottom:"12px",children:jsxRuntimeExports.jsx(JsValueWrap,{space:1,value:JSON.parse(a)})})]})}),MultisigActionButton=({approveOrExecute:a,isLoading:_,signerState:$})=>{switch($){case"awaitingApprovalByExternalSigner":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",alignSelf:"flex-end","data-testid":"multisig-signer-awaiting-approval",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],children:"Awaiting Approval"}),jsxRuntimeExports.jsx(HourglassIcon,{marginTop:"2px"})]});case"approved":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",alignSelf:"flex-end",marginBottom:"8px","data-testid":"multisig-signer-approved",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],children:"Approved"}),jsxRuntimeExports.jsx(CheckmarkIcon,{marginTop:"2px"})]});case"executable":return jsxRuntimeExports.jsx(Button,{"data-testid":"multisig-signer-button",isLoading:_,onClick:a,children:"Execute"});case"approvable":return jsxRuntimeExports.jsx(Button,{"data-testid":"multisig-signer-button",isLoading:_,onClick:a,children:"Approve"})}},SignPage$2=({signer:a,fee:_,operation:$,actionType:j,transactionCount:et})=>{const{handleAsyncAction:tt}=useAsyncActionHandler(),{openWith:rt}=reactExports.useContext(DynamicModalContext),nt=st=>tt(async()=>{const{opHash:ot}=await executeOperations($,st);return rt(jsxRuntimeExports.jsx(SuccessStep,{hash:ot}))},{title:`Failed ${j}`}),it=`${lodashExports.capitalize(j)} transaction`;return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(BatchModalBody,{fee:_,signer:a,title:it,transactionCount:et}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{onSubmit:nt,signer:a,text:it})})]})})},MultisigSignerTile=({pendingApprovals:a,sender:_,operation:$,signerAddress:j})=>{const et=useAddressKind$1(j),tt=useGetImplicitAccountSafe(),{isLoading:rt,handleAsyncAction:nt}=useAsyncActionHandler(),{openWith:it}=reactExports.useContext(DynamicModalContext),st=useSelectedNetwork(),ot=tt(j.pkh),at=a===0,ut=()=>nt(async()=>{if(!ot)throw new Error("Can't approve or execute with an account you don't own");const yt=at?"execute":"approve",wt=makeAccountOperations(ot,ot,[makeMultisigApproveOrExecuteOperation(_.address,yt,$.id)]),Ct=await estimate(wt,st);let Pt;try{Pt=parseRawMichelson($.rawActions,_).length}catch{Pt=1}return it(jsxRuntimeExports.jsx(SignPage$2,{actionType:yt,fee:Ct,operation:wt,signer:ot,transactionCount:Pt}))}),ht=getMultisigSignerState({approvals:$.approvals,signerAddress:j,operationIsExecutable:at,signerAccount:ot});return jsxRuntimeExports.jsx(AccountTileBase,{height:"80px",marginTop:"10px",marginBottom:"0",padding:"15px",borderRadius:"8px",backgroundColor:colors.gray[700],icon:jsxRuntimeExports.jsx(AccountTileIcon,{addressKind:et}),leftElement:jsxRuntimeExports.jsx(LabelAndAddress,{label:et.label,pkh:et.pkh}),rightElement:jsxRuntimeExports.jsx(MultisigActionButton,{approveOrExecute:ut,"data-testid":"multisig-signer-button",isLoading:rt,signerState:ht})})},getMultisigSignerState=({signerAccount:a,operationIsExecutable:_,approvals:$,signerAddress:j})=>{const et=!!$.find(tt=>tt.pkh===j.pkh);return a?et&&!_?"approved":_?"executable":"approvable":et?"approved":"awaitingApprovalByExternalSigner"},MultisigPendingOperation=({operation:a,sender:_})=>{const{signers:$,threshold:j}=_,et=Math.max(j-a.approvals.length,0);return jsxRuntimeExports.jsxs(Box,{marginBottom:"24px",background:colors.gray[800],border:"none",borderRadius:"8px","data-testid":"multisig-pending-operation-"+a.id,paddingX:"16px",paddingY:"15px",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"6px",padding:0,textAlign:"left",children:[jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Pending #",a.id]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginBottom:"6px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Pending Approvals:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"pending-approvals-count",children:et})]})]}),jsxRuntimeExports.jsxs(Box,{padding:"0",children:[jsxRuntimeExports.jsx(MultisigDecodedOperations,{rawMichelson:a.rawActions,sender:_}),$.map(tt=>jsxRuntimeExports.jsx(MultisigSignerTile,{operation:a,pendingApprovals:et,sender:_,signerAddress:tt},tt.pkh))]})]})},MultisigPendingOperations=({account:a})=>{const $=useGetPendingMultisigOperations()(a);return jsxRuntimeExports.jsx(Box,{margin:"0",padding:"0",children:$.map(j=>jsxRuntimeExports.jsx(MultisigPendingOperation,{operation:j,sender:a},j.id))})},ViewAllLink=({to:a,owner:_,...$})=>jsxRuntimeExports.jsx(Center,{...$,children:jsxRuntimeExports.jsxs(Link$1,{as:Link,color:colors.gray[300],stroke:colors.gray[450],_hover:{color:colors.green,stroke:colors.green},to:`${a}?accounts=${_}`,children:[jsxRuntimeExports.jsx(RefreshClockIcon,{display:"inline",stroke:"inherit"}),jsxRuntimeExports.jsx(Text,{display:"inline",size:"sm",children:" View All"})]})}),MAX_NFTS_SIZE=18,NFTsGrid=({owner:a,nfts:_,...$})=>{if(_.length===0)return jsxRuntimeExports.jsx(NoNFTs,{size:"md"});const j=sortedByLastUpdate(_).slice(0,MAX_NFTS_SIZE);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SimpleGrid,{marginBottom:"35px",spacing:"12px",...$,children:j.map(et=>{const tt=getIPFSurl(thumbnailUri(et)),nt={width:"100%",height:40,fallbackSrc:getIPFSurl(et.displayUri),src:tt};return jsxRuntimeExports.jsx(Link,{"data-testid":"nft-link",to:`/home/${a}/${fullId(et)}`,children:jsxRuntimeExports.jsx(Card,{background:colors.gray[800],border:"1px solid transparent",_hover:{background:colors.gray[700],borderColor:colors.gray[500]},children:jsxRuntimeExports.jsxs(CardBody,{overflow:"hidden",padding:"8px",borderRadius:"6px",children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsxs(Box,{position:"relative",width:"100%",height:"100%",children:[jsxRuntimeExports.jsx(AspectRatio,{zIndex:2,width:"100%",opacity:"0",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})}),jsxRuntimeExports.jsx(AspectRatio,{position:"absolute",zIndex:0,top:"0",width:"100%",filter:"blur(20px)",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})}),jsxRuntimeExports.jsx(AspectRatio,{position:"absolute",zIndex:1,top:"0",width:"100%",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})})]})}),Number(et.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"20px",marginTop:"-24px",marginLeft:"4px",padding:"0 8px",borderRadius:"100px",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",size:"xs",children:"x"+et.balance})]})})},`${a}:${fullId(et)}`)})}),_.length>MAX_NFTS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{marginBottom:"40px",owner:a,to:"/nfts"})]})},OperationTileContext=React$2.createContext({mode:"page"}),FEE_FIELDS=["bakerFee","storageFee","allocationFee"],Fee=({operation:a})=>{const _=reactExports.useContext(OperationTileContext),j=useIsOwnedAddress()(a.sender.address);if(_.mode==="drawer"||!j)return null;const et=FEE_FIELDS.reduce((tt,rt)=>rt in a?tt.plus(lodashExports.get(a,rt)||0):tt,BigNumber(0));return et.eq(0)?null:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"md",children:"Fee:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"fee",children:prettyTezAmount(et)})]})},useGetOperationDestination=(a,_)=>{const $=useIsOwnedAddress(),j=$(a),et=$(_);return!j&&!et?"unrelated":j?"outgoing":"incoming"},operationSign=a=>{switch(a){case"incoming":return"+";case"outgoing":return"-";case"unrelated":return""}},operationColor=a=>{switch(a){case"incoming":return colors.green;case"outgoing":return colors.orange;case"unrelated":return"white"}},InternalPrefix=({operation:a})=>{var et,tt,rt;let _,$;switch(a.type){case"transaction":_=(et=a.target)==null?void 0:et.address,$=a.sender.address;break;case"origination":case"delegation":_=null,$=a.sender.address;break;case"token_transfer":_=(tt=a.to)==null?void 0:tt.address,$=(rt=a.from)==null?void 0:rt.address;break}return useGetOperationDestination($,_)!=="unrelated"?null:jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],"data-testid":"internal-prefix",size:"md",children:"Internal:"})},OperationStatus=({level:a,status:_})=>{const $=useIsBlockFinalised(a);return _===void 0||_==="applied"?$?jsxRuntimeExports.jsx(CheckmarkIcon,{"data-testid":"checkmark"}):jsxRuntimeExports.jsx(HourglassIcon,{"data-testid":"hourglass"}):jsxRuntimeExports.jsx(CrossedCircleIcon,{"data-testid":"crossed-circle"})},OperationTypeWrapper=({children:a})=>reactExports.useContext(OperationTileContext).mode==="drawer"?null:jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],"data-testid":"operation-type",size:"sm",children:a}),Timestamp=({timestamp:a})=>a?jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"timestamp",size:"sm",children:getDisplayTimestamp(a)}):null,getDisplayTimestamp=a=>{const _=new Date,$=new Date(a);return differenceInDays(_,$)<2?formatDistance($,_,{addSuffix:!0}):format($,"dd MMM yyyy")},TzktLink$1=({hash:a,counter:_,transactionId:$,originationId:j,migrationId:et,children:tt,...rt})=>{const{tzktExplorerUrl:nt}=useSelectedNetwork();let it=nt;return a?it=lodashExports.compact([nt,a,_]).join("/"):et?it=`${it}/migrations/${et}`:j?it=`${it}/originations/${j}`:$?it=`${it}/transactions/${$}`:console.warn("No id provided to TzktLink"),jsxRuntimeExports.jsx(Link$1,{"data-testid":"tzkt-link",href:it,isExternal:!0,...rt,children:tt})},ContractCallTile=({operation:a})=>{var _;return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-contract-call",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(ContractIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:a.counter,"data-testid":"title",hash:a.hash,children:jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Contract Call: ",(_=a.parameter)==null?void 0:_.entrypoint]})}),jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[a.target&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.target})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.sender})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Contract Call"}),jsxRuntimeExports.jsx(OperationStatus,{...a})]})]})})]})},DelegationTile=({operation:a})=>{const _=a.newDelegate?"Delegate":"Delegation Ended";return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-delegation",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(BakerIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:a.counter,"data-testid":"title",hash:a.hash,children:jsxRuntimeExports.jsx(Heading,{size:"md",children:_})}),jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[a.newDelegate&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.newDelegate})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.sender})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:_}),jsxRuntimeExports.jsx(OperationStatus,{...a})]})]})})]})},OriginationTile=({operation:a})=>{var j;const $=((j=a.originatedContract)==null?void 0:j.codeHash)===CODE_HASH&&a.originatedContract.typeHash===TYPE_HASH?"Multisig Account Created":"Contract Origination";return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-origination",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(ContractIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:a.counter,"data-testid":"title",hash:a.hash,children:jsxRuntimeExports.jsx(Heading,{size:"md",children:$})}),jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.sender})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Contract Origination"}),jsxRuntimeExports.jsx(OperationStatus,{...a})]})]})})]})},TransactionDirectionIcon=({destination:a,..._})=>a==="outgoing"?jsxRuntimeExports.jsx(OutgoingArrow,{"data-testid":"outgoing-arrow",..._}):a==="incoming"?jsxRuntimeExports.jsx(IncomingArrow,{"data-testid":"incoming-arrow",..._}):jsxRuntimeExports.jsx(ContractIcon,{"data-testid":"unrelated-operation-icon",..._}),TokenTransferTile=({operation:a,tokenTransfer:_,token:$})=>{var at,ut;const j=_.amount,et=useGetOperationDestination((at=_.from)==null?void 0:at.address,(ut=_.to)==null?void 0:ut.address),tt=$.type==="nft",rt=tokenPrettyAmount(j,$,{showSymbol:!0}),nt=operationColor(et),it=tt?"white":nt,st=operationSign(et),ot=tt?jsxRuntimeExports.jsx(Tooltip,{padding:"8px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"nft-tooltip",label:jsxRuntimeExports.jsx(AspectRatio,{width:"170px",height:"170px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{src:getIPFSurl(thumbnailUri($))})}),openDelay:300,children:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(InternalPrefix,{operation:a||_}),jsxRuntimeExports.jsxs(TzktLink$1,{marginRight:"8px",color:it,"data-testid":"title",migrationId:_.migrationId,originationId:_.originationId,transactionId:_.transactionId,children:[jsxRuntimeExports.jsxs(Text,{display:"inline",color:nt,fontWeight:"600",children:[st,rt]}),jsxRuntimeExports.jsxs(Text,{display:"inline",fontWeight:"600",children:[" ",tokenNameSafe($)]})]})]})}):jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(InternalPrefix,{operation:a||_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",color:it,"data-testid":"title",migrationId:_.migrationId,originationId:_.originationId,transactionId:_.transactionId,children:jsxRuntimeExports.jsxs(Text,{display:"inline",color:nt,fontWeight:"600",children:[st,rt]})})]});return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-token-transfer",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(TransactionDirectionIcon,{marginRight:"8px",destination:et}),ot,a&&jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:_.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[_.to&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.to})]}),_.from&&jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.from})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Token Transfer"}),jsxRuntimeExports.jsx(OperationStatus,{level:_.level})]})]})})]})},TransactionTile=({operation:a})=>{var tt;const _=useGetOperationDestination(a.sender.address,(tt=a.target)==null?void 0:tt.address),$=prettyTezAmount(String(a.amount)),j=operationColor(_),et=operationSign(_);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-transaction",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(TransactionDirectionIcon,{marginRight:"8px",destination:_}),jsxRuntimeExports.jsx(InternalPrefix,{operation:a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",color:j,counter:a.counter,"data-testid":"title",hash:a.hash,children:jsxRuntimeExports.jsxs(Text,{color:j,fontWeight:"600",children:[et," ",$]})}),jsxRuntimeExports.jsx(Fee,{operation:a})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[a.target&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.target.address)})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.sender.address)})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Transaction"}),jsxRuntimeExports.jsx(OperationStatus,{...a})]})]})})]})},OperationTile=({operation:a})=>{const _=useGetTokenTransfer();switch(a.type){case"token_transfer":{const $=fromRaw$1(a.token);return $?jsxRuntimeExports.jsx(TokenTransferTile,{token:$,tokenTransfer:a}):(console.warn(`Could not parse token transfer ${a.id}`),null)}case"transaction":{const $=!!a.parameter,j=_(a.id);if(j){const et=fromRaw$1(j.token);return et?jsxRuntimeExports.jsx(TokenTransferTile,{operation:a,token:et,tokenTransfer:j}):jsxRuntimeExports.jsx(TransactionTile,{operation:a})}else return $?jsxRuntimeExports.jsx(ContractCallTile,{operation:a}):jsxRuntimeExports.jsx(TransactionTile,{operation:a})}case"delegation":return jsxRuntimeExports.jsx(DelegationTile,{operation:a});case"origination":return jsxRuntimeExports.jsx(OriginationTile,{operation:a})}},MAX_OPERATIONS_SIZE=20,OperationListDisplay=({owner:a,operations:_})=>{if(_.length===0)return jsxRuntimeExports.jsx(NoOperations,{size:"md"});const $=_.slice(0,MAX_OPERATIONS_SIZE);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[$.map((j,et)=>jsxRuntimeExports.jsxs(Box,{height:"90px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:j}),et<$.length-1&&jsxRuntimeExports.jsx(Divider,{marginY:"20px"})]},j.id)),_.length>MAX_OPERATIONS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{owner:a,to:"/operations"})]})},verifiedTokens=["KT1XnTn74bUtxHfDtBmm2bGZAQfhPbvKWR8o","KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1K9gCRgaLRFKTErYt1wVxA3Frb9FjasjTV","KT1Ha4yFVeyzw6KRAdkzq6TxDHB97KG4pZe8","KT1JBNFcB5tiycHNdYGYCtR3kk6JaJysUCi8","KT1Xobej4mc6XgEjDoJoHtTKgbD1ELMvcQuL","KT1JVjgXPMMSaa6FkzeJcgb8q9cUaLmwaJUX","KT193D4vozYnhGJQVtw7CoxxqphqUEEwK6Vb","KT1LN4LPSqTMS7Sd2CJw4bbDGRkMv2t68Fy9","KT1914CUZ7EegAFPbfgQMRkw8Uz5mYkEz2ui","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT19ovJhcsUn4YU8Q5L3BGovKSixfbWcecEA","KT1TgmD7kXQzofpuc9VbTRMdZCS2e6JDuTtc","KT1F1mn2jbqQCJcsNgYKVAQjvenecNMY2oPK","KT1ErKVqEhG9jxXgUG2KGLW3bNM7zXHX8SDF","KT1A5P4ejnLix13jtadsfV9GCnXLMNnab8UT","KT1AM3PV1cwmGRw28DVTgsjjsjHvmL6z4rGh","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT1SjXiUX63QvdNMcM2m492f7kuf8JxXRLp4","KT1MZg99PxMDEENwB4Fi64xkqAVh5d1rv8Z9","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT1XTxpQvo7oRCqp85LikEZgAZ22uDxhbWJv","KT1VaEsVNiBoA56eToEK6n6BcPgh1tdx9eXi"],TokenNameWithIcon=({token:a,..._})=>{const $=verifiedTokens.includes(a.contract);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Text,{..._,marginRight:"4px",children:tokenNameSafe(a)}),$&&jsxRuntimeExports.jsx(VerifiedIcon,{})]})},MAX_TOKENS_SIZE=20,TokenList=({owner:a,tokens:_})=>{if(_.length===0)return jsxRuntimeExports.jsx(NoTokens,{size:"md"});const $=_.slice(0,MAX_TOKENS_SIZE);return jsxRuntimeExports.jsxs(Box,{children:[$.map(j=>jsxRuntimeExports.jsx(TokenTile$1,{token:j},fullId(j))),_.length>MAX_TOKENS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{owner:a,to:"/tokens"})]})},TokenTile$1=({token:a})=>{const _=tokenPrettyAmount(a.balance,a,{showSymbol:!1});return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-around",height:20,borderBottom:`1px solid ${colors.gray[800]}`,"data-testid":"token-tile",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",flex:1,children:[jsxRuntimeExports.jsx(TokenIcon,{width:"38px",background:colors.gray[500],borderRadius:"4px",contract:a.contract}),jsxRuntimeExports.jsx(Box,{marginLeft:"16px",children:jsxRuntimeExports.jsx(TokenNameWithIcon,{fontWeight:600,"data-testid":"token-name",token:a})})]}),jsxRuntimeExports.jsx(Heading,{"data-testid":"token-balance",size:"lg",children:_})]})},buildTzktAddressUrl=(a,_)=>`${a.tzktExplorerUrl}/${_}`,useGetOperations=a=>{const _=useSelectedNetwork(),$=useAppDispatch(),j=useRefetchTrigger(),et=useReactQueryErrorHandler(),{isFetching:tt,data:rt,hasNextPage:nt,isLoading:it,fetchNextPage:st,fetchPreviousPage:ot,error:at}=useInfiniteQuery({queryFn:({pageParam:ut})=>fetchOperationsAndUpdateTokensInfo($,_,a,ut),queryKey:["operations",a,$,_],initialPageParam:{},retry:3,retryDelay:ut=>ut*2e3,gcTime:0,refetchOnWindowFocus:!1,getNextPageParam:ut=>ut.length===0?null:{lastId:ut[ut.length-1].id},getPreviousPageParam:(ut,ht)=>{var wt;const yt=(wt=lodashExports.maxBy(ht.flat(),"id"))==null?void 0:wt.id;return yt?{lastId:yt,sort:"asc"}:{}},select:({pages:ut})=>filterDuplicatedTokenTransfers([[...ut[0]].sort((ht,yt)=>ht.id{const ut=setInterval(()=>void ot(),BLOCK_TIME);return()=>clearInterval(ut)},[ot]),reactExports.useEffect(()=>{ot()},[j,ot]),{operations:rt||[],isFirstLoad:it,isLoading:tt,hasMore:nt,loadMore:st}},fetchOperationsAndUpdateTokensInfo=async(a,_,$,j)=>{const et=await getCombinedOperations($.map(st=>st.address.pkh),_,j),tt=et.filter(st=>st.type==="transaction").map(st=>st.id),rt=await getRelatedTokenTransfers(tt,_),nt=et.filter(st=>st.type==="token_transfer"),it=[...rt,...nt];return a(assetsActions.updateTokenTransfers(it)),a(tokensActions.addTokens({network:_,tokens:it.map(st=>st.token)})),et},filterDuplicatedTokenTransfers=a=>{const _=new Set(a.filter($=>$.type!=="token_transfer").map($=>$.id));return a.filter($=>$.type!=="token_transfer"||!_.has($.transactionId))},SmallTab=({children:a,..._})=>jsxRuntimeExports.jsx(Tab,{..._,fontSize:"sm",paddingX:3,children:a}),AssetsPanel=({tokens:a,nfts:_,account:$,delegation:j})=>{const et=useGetPendingMultisigOperations(),tt=$.type==="multisig"&&et($).length>0,rt=useSelectedNetwork(),{operations:nt,isFirstLoad:it}=useGetOperations([$]);return jsxRuntimeExports.jsxs(Tabs,{flexDirection:"column",display:"flex",width:"100%",marginTop:"60px","data-testid":"asset-panel",children:[jsxRuntimeExports.jsxs(TabList,{justifyContent:"space-between","data-testid":"asset-panel-tablist",children:[jsxRuntimeExports.jsxs(Flex,{children:[tt&&jsxRuntimeExports.jsxs(SmallTab,{"data-testid":"account-card-pending-tab",children:[jsxRuntimeExports.jsx(Text,{children:"Pending"}),jsxRuntimeExports.jsx(Box,{width:"6px",height:"6px",marginTop:"-7px",marginRight:"-3px",marginLeft:"3px",borderRadius:"100%",backgroundColor:colors.orangeL})]}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-operations-tab",children:"Operations"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-delegation-tab",children:"Delegation"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-nfts-tab",children:"NFTs"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-tokens-tab",children:"Tokens"})]}),jsxRuntimeExports.jsx(ExternalLink,{href:buildTzktAddressUrl(rt,$.address.pkh),children:jsxRuntimeExports.jsxs(Button,{paddingRight:0,variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"7px",size:"sm",children:"View on Tzkt"}),jsxRuntimeExports.jsx(ExternalLinkIcon,{stroke:"currentcolor"})]})})]}),jsxRuntimeExports.jsxs(TabPanels,{height:"100%",children:[tt&&jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:"60px","data-testid":"account-card-pending-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(MultisigPendingOperations,{account:$})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:"60px","data-testid":"account-card-operations-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsxs(OperationTileContext.Provider,{value:{mode:"drawer",selectedAddress:$.address},children:[jsxRuntimeExports.jsx(Center,{display:it?"flex":"none",height:"50px",children:jsxRuntimeExports.jsx(Image$1,{width:"150px",height:"75px",src:"./static/media/loading-wheel.gif"})}),!it&&jsxRuntimeExports.jsx(OperationListDisplay,{operations:nt,owner:$.address.pkh})]})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",paddingTop:"24px","data-testid":"account-card-delegation-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(DelegationDisplay,{account:$,delegation:j})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:0,"data-testid":"account-card-nfts-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(NFTsGrid,{columns:3,nfts:_,owner:$.address.pkh})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px","data-testid":"account-card-tokens-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(TokenList,{owner:$.address.pkh,tokens:a})})]})]})},MultisigApprovers=({signers:a})=>jsxRuntimeExports.jsx(Box,{width:"100%",marginTop:"40px",marginBottom:"-20px",background:colors.gray[800],borderRadius:"8px",children:jsxRuntimeExports.jsx(Accordion,{padding:"15px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],border:"none",borderRadius:"8px",children:[jsxRuntimeExports.jsxs(AccordionButton,{as:"span",flex:"1",padding:"0",textAlign:"left",cursor:"pointer",children:[jsxRuntimeExports.jsx(Heading,{width:"100%",size:"md",children:"Approvers"}),jsxRuntimeExports.jsx(AccordionIcon,{cursor:"pointer"})]}),jsxRuntimeExports.jsx(AccordionPanel,{padding:"0",children:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"multisig-tag-section",spacingX:"0",spacingY:"12px",children:a.map(_=>jsxRuntimeExports.jsx(AddressPill,{marginRight:"12px",address:_},_.pkh))})})]})})}),renameAccount=(a,_)=>($,j)=>{const{accounts:et,multisigs:tt,contacts:rt}=j(),nt=a.type==="multisig",it=et.items.map(at=>at.label),st=tt.items.map(at=>at.label),ot=Object.values(rt).map(at=>at.name);[it,st,ot].flat().includes(_)||$(nt?multisigsSlice.actions.setName({newName:_,account:a}):accountsSlice.actions.renameAccount({newName:_,account:a}))},RenameAccountModal=({account:a})=>{const _=useAppDispatch(),{onClose:$}=reactExports.useContext(DynamicModalContext),j=({name:at})=>{_(renameAccount(a,at)),$()},{handleSubmit:et,formState:{isValid:tt,errors:rt},register:nt,reset:it}=useForm({mode:"onBlur",defaultValues:{name:a.label}}),st=({name:at})=>{j({name:at.trim()}),it()},ot=useValidateName(a.label);return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:et(st),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Edit your account name here.",title:"Edit Name"}),jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!rt.name,marginY:"20px",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Account name"}),jsxRuntimeExports.jsx(Input,{type:"text",...nt("name",{required:"Name is required",validate:ot}),placeholder:"Enter contact's name"}),rt.name&&jsxRuntimeExports.jsx(FormErrorMessage$1,{"data-testid":"name-error",children:rt.name.message})]})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",marginBottom:"8px",isDisabled:!tt,size:"lg",type:"submit",children:"Save"})})]})})},RenameRemoveMenuSwitch=({account:a})=>{const{openWith:_,onClose:$}=reactExports.useContext(DynamicModalContext),j=useNavigate(),et=useImplicitAccounts().length===1,tt=useRemoveAccount();let rt;switch(a.type){case"secret_key":case"ledger":case"social":rt=()=>_(jsxRuntimeExports.jsx(ConfirmationModal,{buttonLabel:st,description:it,onSubmit:()=>{tt(a),$(),j("/")},title:nt}));break}const nt="Remove Account";let it="Are you sure you want to remove this account?",st="Remove Account";return et&&(it="Removing your last account will off-board you from Umami. This will remove or reset all customized settings to their defaults. Personal data (including saved contacts, password and accounts) won't be affected.",st="Remove & Off-board"),jsxRuntimeExports.jsx(RenameRemoveMenu,{onRemove:rt,onRename:()=>_(jsxRuntimeExports.jsx(RenameAccountModal,{account:a}))})},makeDelegation=a=>a.newDelegate?{sender:a.sender.address,timestamp:a.timestamp,id:a.id,amount:new BigNumber(a.amount),delegate:{address:a.newDelegate.address,alias:a.newDelegate.alias??void 0}}:null,TezRecapDisplay=a=>jsxRuntimeExports.jsxs(Box,{textAlign:a.center?"center":"initial",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:prettyTezAmount(a.balance)}),a.dollarBalance!==void 0&&jsxRuntimeExports.jsxs(Text,{marginTop:"6px",color:colors.gray[400],size:"sm",children:["$",a.dollarBalance.toFixed(2)]})]}),RoundButton=({icon:a,label:_,onClick:$=()=>{}})=>jsxRuntimeExports.jsxs(Box,{className:"account-drawer-cta-button",color:colors.gray[300],textAlign:"center",_hover:{color:colors.green},cursor:"pointer",marginX:"24px",onClick:$,children:[jsxRuntimeExports.jsx(IconButton,{className:"account-drawer-cta-button-icon",marginBottom:"8px","aria-label":"button",icon:a,size:"lg",variant:"circle_without_color"}),jsxRuntimeExports.jsx(Text,{cursor:"pointer",size:"sm",children:_})]}),AccountDrawerDisplay=({onSend:a,onReceive:_=()=>{},balance:$,dollarBalance:j,tokens:et,nfts:tt,account:rt})=>{const nt=rt.type==="multisig",{openWith:it}=reactExports.useContext(DynamicModalContext),st=useAddressKind$1(rt.address),ot=useSelectedNetwork(),[at,ut]=reactExports.useState(null),{handleAsyncAction:ht}=useAsyncActionHandler();return reactExports.useEffect(()=>{ht(async()=>{const yt=await getLastDelegation(rt.address.pkh,ot);yt&&ut(makeDelegation(yt))}).catch(lodashExports.noop)},[rt.address.pkh,ht,ot]),jsxRuntimeExports.jsxs(Flex,{zIndex:2,alignItems:"center",flexDirection:"column",height:"100%",marginTop:"-86px",paddingTop:"86px",paddingRight:"30px",background:accountIconGradient({account:rt,radius:"350px",opacity:"35",mainBackgroundColor:"transparent",left:"300px",top:"-125px"}),"data-testid":`account-card-${rt.address.pkh}`,children:[jsxRuntimeExports.jsx(AccountTileIcon,{addressKind:st}),jsxRuntimeExports.jsx(Heading,{marginTop:"24px",size:"md",children:rt.label}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"8px",marginBottom:"30px",children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"4px",address:rt.address,mode:{type:"no_icons"}}),jsxRuntimeExports.jsx(RenameRemoveMenuSwitch,{account:rt})]}),$&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:$,center:!0,dollarBalance:j}),jsxRuntimeExports.jsxs(Center,{marginTop:"34px",children:[jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(OutgoingArrow,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Send",onClick:a}),jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(IncomingArrow,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Receive",onClick:_}),!nt&&jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(PlusIcon,{stroke:"currentcolor"}),label:"Buy Tez",onClick:()=>it(jsxRuntimeExports.jsx(BuyTezForm,{recipient:rt.address.pkh}))}),jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(BakerIcon,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Delegate",onClick:()=>it(jsxRuntimeExports.jsx(FormPage$3,{form:at?{baker:at.delegate.address,sender:rt.address.pkh}:void 0,sender:rt}))})]}),nt&&jsxRuntimeExports.jsx(MultisigApprovers,{signers:rt.signers}),jsxRuntimeExports.jsx(AssetsPanel,{account:rt,delegation:at,nfts:tt,tokens:et})]})};var dist={},lodash_isequal={exports:{}};lodash_isequal.exports;(function(a,_){var $=200,j="__lodash_hash_undefined__",et=1,tt=2,rt=9007199254740991,nt="[object Arguments]",it="[object Array]",st="[object AsyncFunction]",ot="[object Boolean]",at="[object Date]",ut="[object Error]",ht="[object Function]",yt="[object GeneratorFunction]",wt="[object Map]",Ct="[object Number]",Pt="[object Null]",$t="[object Object]",Mt="[object Promise]",Bt="[object Proxy]",Dt="[object RegExp]",zt="[object Set]",Ot="[object String]",It="[object Symbol]",Lt="[object Undefined]",Ft="[object WeakMap]",jt="[object ArrayBuffer]",bt="[object DataView]",vt="[object Float32Array]",ct="[object Float64Array]",dt="[object Int8Array]",mt="[object Int16Array]",xt="[object Int32Array]",At="[object Uint8Array]",Rt="[object Uint8ClampedArray]",St="[object Uint16Array]",Tt="[object Uint32Array]",Et=/[\\^$.*+?()[\]{}|]/g,Nt=/^\[object .+?Constructor\]$/,tr=/^(?:0|[1-9]\d*)$/,ir={};ir[vt]=ir[ct]=ir[dt]=ir[mt]=ir[xt]=ir[At]=ir[Rt]=ir[St]=ir[Tt]=!0,ir[nt]=ir[it]=ir[jt]=ir[ot]=ir[bt]=ir[at]=ir[ut]=ir[ht]=ir[wt]=ir[Ct]=ir[$t]=ir[Dt]=ir[zt]=ir[Ot]=ir[Ft]=!1;var nr=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Zt=typeof self=="object"&&self&&self.Object===Object&&self,Kt=nr||Zt||Function("return this")(),Qt=_&&!_.nodeType&&_,Ht=Qt&&!0&&a&&!a.nodeType&&a,qt=Ht&&Ht.exports===Qt,Jt=qt&&nr.process,ur=function(){try{return Jt&&Jt.binding&&Jt.binding("util")}catch{}}(),xr=ur&&ur.isTypedArray;function pr(wr,Xt){for(var cr=-1,gr=wr==null?0:wr.length,Dr=0,rn=[];++cr-1}function ps(wr,Xt){var cr=this.__data__,gr=Eo(cr,wr);return gr<0?(++this.size,cr.push([wr,Xt])):cr[gr][1]=Xt,this}yn.prototype.clear=_n,yn.prototype.delete=ds,yn.prototype.get=fs,yn.prototype.has=hs,yn.prototype.set=ps;function Vn(wr){var Xt=-1,cr=wr==null?0:wr.length;for(this.clear();++XtTn))return!1;var wn=rn.get(wr);if(wn&&rn.get(Xt))return wn==Xt;var Ln=-1,Fn=!0,ts=cr&tt?new es:void 0;for(rn.set(wr,Xt),rn.set(Xt,wr);++Ln-1&&wr%1==0&&wr-1&&wr%1==0&&wr<=rt}function No(wr){var Xt=typeof wr;return wr!=null&&(Xt=="object"||Xt=="function")}function Po(wr){return wr!=null&&typeof wr=="object"}var Lo=xr?fr(xr):xl;function Xl(wr){return $o(wr)?yl(wr):_l(wr)}function rs(){return[]}function Xn(){return!1}a.exports=Ps})(lodash_isequal,lodash_isequal.exports);var lodash_isequalExports=lodash_isequal.exports,qrcode={exports:{}};(function(a,_){var $=function(){var j=function(Dt,zt){var Ot=236,It=17,Lt=Dt,Ft=tt[zt],jt=null,bt=0,vt=null,ct=[],dt={},mt=function(Kt,Qt){bt=Lt*4+17,jt=function(Ht){for(var qt=new Array(Ht),Jt=0;Jt=7&&Tt(Kt),vt==null&&(vt=ir(Lt,Ft,ct)),Nt(vt,Qt)},xt=function(Kt,Qt){for(var Ht=-1;Ht<=7;Ht+=1)if(!(Kt+Ht<=-1||bt<=Kt+Ht))for(var qt=-1;qt<=7;qt+=1)Qt+qt<=-1||bt<=Qt+qt||(0<=Ht&&Ht<=6&&(qt==0||qt==6)||0<=qt&&qt<=6&&(Ht==0||Ht==6)||2<=Ht&&Ht<=4&&2<=qt&&qt<=4?jt[Kt+Ht][Qt+qt]=!0:jt[Kt+Ht][Qt+qt]=!1)},At=function(){for(var Kt=0,Qt=0,Ht=0;Ht<8;Ht+=1){mt(!0,Ht);var qt=nt.getLostPoint(dt);(Ht==0||Kt>qt)&&(Kt=qt,Qt=Ht)}return Qt},Rt=function(){for(var Kt=8;Kt>Ht&1)==1;jt[Math.floor(Ht/3)][Ht%3+bt-8-3]=qt}for(var Ht=0;Ht<18;Ht+=1){var qt=!Kt&&(Qt>>Ht&1)==1;jt[Ht%3+bt-8-3][Math.floor(Ht/3)]=qt}},Et=function(Kt,Qt){for(var Ht=Ft<<3|Qt,qt=nt.getBCHTypeInfo(Ht),Jt=0;Jt<15;Jt+=1){var ur=!Kt&&(qt>>Jt&1)==1;Jt<6?jt[Jt][8]=ur:Jt<8?jt[Jt+1][8]=ur:jt[bt-15+Jt][8]=ur}for(var Jt=0;Jt<15;Jt+=1){var ur=!Kt&&(qt>>Jt&1)==1;Jt<8?jt[8][bt-Jt-1]=ur:Jt<9?jt[8][15-Jt-1+1]=ur:jt[8][15-Jt-1]=ur}jt[bt-8][8]=!Kt},Nt=function(Kt,Qt){for(var Ht=-1,qt=bt-1,Jt=7,ur=0,xr=nt.getMaskFunction(Qt),pr=bt-1;pr>0;pr-=2)for(pr==6&&(pr-=1);;){for(var Cr=0;Cr<2;Cr+=1)if(jt[qt][pr-Cr]==null){var Mr=!1;ur>>Jt&1)==1);var lr=xr(qt,pr-Cr);lr&&(Mr=!Mr),jt[qt][pr-Cr]=Mr,Jt-=1,Jt==-1&&(ur+=1,Jt=7)}if(qt+=Ht,qt<0||bt<=qt){qt-=Ht,Ht=-Ht;break}}},tr=function(Kt,Qt){for(var Ht=0,qt=0,Jt=0,ur=new Array(Qt.length),xr=new Array(Qt.length),pr=0;pr=0?Sr.getAt(kr):0}}for(var Ar=0,lr=0;lrpr*8)throw"code length overflow. ("+Jt.getLengthInBits()+">"+pr*8+")";for(Jt.getLengthInBits()+4<=pr*8&&Jt.put(0,4);Jt.getLengthInBits()%8!=0;)Jt.putBit(!1);for(;!(Jt.getLengthInBits()>=pr*8||(Jt.put(Ot,8),Jt.getLengthInBits()>=pr*8));)Jt.put(It,8);return tr(Jt,qt)};dt.addData=function(Kt,Qt){Qt=Qt||"Byte";var Ht=null;switch(Qt){case"Numeric":Ht=ut(Kt);break;case"Alphanumeric":Ht=ht(Kt);break;case"Byte":Ht=yt(Kt);break;case"Kanji":Ht=wt(Kt);break;default:throw"mode:"+Qt}ct.push(Ht),vt=null},dt.isDark=function(Kt,Qt){if(Kt<0||bt<=Kt||Qt<0||bt<=Qt)throw Kt+","+Qt;return jt[Kt][Qt]},dt.getModuleCount=function(){return bt},dt.make=function(){if(Lt<1){for(var Kt=1;Kt<40;Kt++){for(var Qt=ot.getRSBlocks(Kt,Ft),Ht=at(),qt=0;qt"u"?Kt*4:Qt;var Ht="";Ht+='";for(var Jt=0;Jt';Ht+=""}return Ht+="",Ht+="
",Ht},dt.createSvgTag=function(Kt,Qt,Ht,qt){var Jt={};typeof arguments[0]=="object"&&(Jt=arguments[0],Kt=Jt.cellSize,Qt=Jt.margin,Ht=Jt.alt,qt=Jt.title),Kt=Kt||2,Qt=typeof Qt>"u"?Kt*4:Qt,Ht=typeof Ht=="string"?{text:Ht}:Ht||{},Ht.text=Ht.text||null,Ht.id=Ht.text?Ht.id||"qrcode-description":null,qt=typeof qt=="string"?{text:qt}:qt||{},qt.text=qt.text||null,qt.id=qt.text?qt.id||"qrcode-title":null;var ur=dt.getModuleCount()*Kt+Qt*2,xr,pr,Cr,Mr,lr="",fr;for(fr="l"+Kt+",0 0,"+Kt+" -"+Kt+",0 0,-"+Kt+"z ",lr+=''+nr(qt.text)+"":"",lr+=Ht.text?''+nr(Ht.text)+"":"",lr+='',lr+='"u"?Kt*4:Qt;var Ht=dt.getModuleCount()*Kt+Qt*2,qt=Qt,Jt=Ht-Qt;return Bt(Ht,Ht,function(ur,xr){if(qt<=ur&&ur"u"?Kt*4:Qt;var qt=dt.getModuleCount()*Kt+Qt*2,Jt="";return Jt+="",Jt};var nr=function(Kt){for(var Qt="",Ht=0;Ht":Qt+=">";break;case"&":Qt+="&";break;case'"':Qt+=""";break;default:Qt+=qt;break}}return Qt},Zt=function(Kt){var Qt=1;Kt=typeof Kt>"u"?Qt*2:Kt;var Ht=dt.getModuleCount()*Qt+Kt*2,qt=Kt,Jt=Ht-Kt,ur,xr,pr,Cr,Mr,lr={"██":"█","█ ":"▀"," █":"▄"," ":" "},fr={"██":"▀","█ ":"▀"," █":" "," ":" "},_r="";for(ur=0;ur=Jt?fr[Mr]:lr[Mr];_r+=` `}return Ht%2&&Kt>0?_r.substring(0,_r.length-Ht-1)+Array(Ht+1).join("▀"):_r.substring(0,_r.length-1)};return dt.createASCII=function(Kt,Qt){if(Kt=Kt||1,Kt<2)return Zt(Qt);Kt-=1,Qt=typeof Qt>"u"?Kt*2:Qt;var Ht=dt.getModuleCount()*Kt+Qt*2,qt=Qt,Jt=Ht-Qt,ur,xr,pr,Cr,Mr=Array(Kt+1).join("██"),lr=Array(Kt+1).join(" "),fr="",_r="";for(ur=0;ur>>8),Ft.push(vt&255)):Ft.push(It)}}return Ft}};var et={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},tt={L:1,M:0,Q:3,H:2},rt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},nt=function(){var Dt=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],zt=1335,Ot=7973,It=21522,Lt={},Ft=function(jt){for(var bt=0;jt!=0;)bt+=1,jt>>>=1;return bt};return Lt.getBCHTypeInfo=function(jt){for(var bt=jt<<10;Ft(bt)-Ft(zt)>=0;)bt^=zt<=0;)bt^=Ot<5&&(vt+=3+mt-5)}for(var ct=0;ct=256;)Lt-=255;return Dt[Lt]},It}();function st(Dt,zt){if(typeof Dt.length>"u")throw Dt.length+"/"+zt;var Ot=function(){for(var Lt=0;Lt"u")throw"bad rs block @ typeNumber:"+Lt+"/errorCorrectionLevel:"+Ft;for(var bt=jt.length/3,vt=[],ct=0;ct>>7-It%8&1)==1},Ot.put=function(It,Lt){for(var Ft=0;Ft>>Lt-Ft-1&1)==1)},Ot.getLengthInBits=function(){return zt},Ot.putBit=function(It){var Lt=Math.floor(zt/8);Dt.length<=Lt&&Dt.push(0),It&&(Dt[Lt]|=128>>>zt%8),zt+=1},Ot},ut=function(Dt){var zt=et.MODE_NUMBER,Ot=Dt,It={};It.getMode=function(){return zt},It.getLength=function(jt){return Ot.length},It.write=function(jt){for(var bt=Ot,vt=0;vt+2>>8&255)*192+(vt&255),Ft.put(vt,13),bt+=2}if(bt>>8)},zt.writeBytes=function(Ot,It,Lt){It=It||0,Lt=Lt||Ot.length;for(var Ft=0;Ft0&&(Ot+=","),Ot+=Dt[It];return Ot+="]",Ot},zt},Pt=function(){var Dt=0,zt=0,Ot=0,It="",Lt={},Ft=function(bt){It+=String.fromCharCode(jt(bt&63))},jt=function(bt){if(!(bt<0)){if(bt<26)return 65+bt;if(bt<52)return 97+(bt-26);if(bt<62)return 48+(bt-52);if(bt==62)return 43;if(bt==63)return 47}throw"n:"+bt};return Lt.writeByte=function(bt){for(Dt=Dt<<8|bt&255,zt+=8,Ot+=1;zt>=6;)Ft(Dt>>>zt-6),zt-=6},Lt.flush=function(){if(zt>0&&(Ft(Dt<<6-zt),Dt=0,zt=0),Ot%3!=0)for(var bt=3-Ot%3,vt=0;vt=zt.length){if(Lt==0)return-1;throw"unexpected end of file./"+Lt}var bt=zt.charAt(Ot);if(Ot+=1,bt=="=")return Lt=0,-1;if(bt.match(/^\s$/))continue;It=It<<6|jt(bt.charCodeAt(0)),Lt+=6}var vt=It>>>Lt-8&255;return Lt-=8,vt};var jt=function(bt){if(65<=bt&&bt<=90)return bt-65;if(97<=bt&&bt<=122)return bt-97+26;if(48<=bt&&bt<=57)return bt-48+52;if(bt==43)return 62;if(bt==47)return 63;throw"c:"+bt};return Ft},Mt=function(Dt,zt){var Ot=Dt,It=zt,Lt=new Array(Dt*zt),Ft={};Ft.setPixel=function(ct,dt,mt){Lt[dt*Ot+ct]=mt},Ft.write=function(ct){ct.writeString("GIF87a"),ct.writeShort(Ot),ct.writeShort(It),ct.writeByte(128),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(255),ct.writeByte(255),ct.writeByte(255),ct.writeString(","),ct.writeShort(0),ct.writeShort(0),ct.writeShort(Ot),ct.writeShort(It),ct.writeByte(0);var dt=2,mt=bt(dt);ct.writeByte(dt);for(var xt=0;mt.length-xt>255;)ct.writeByte(255),ct.writeBytes(mt,xt,255),xt+=255;ct.writeByte(mt.length-xt),ct.writeBytes(mt,xt,mt.length-xt),ct.writeByte(0),ct.writeString(";")};var jt=function(ct){var dt=ct,mt=0,xt=0,At={};return At.write=function(Rt,St){if(Rt>>>St)throw"length over";for(;mt+St>=8;)dt.writeByte(255&(Rt<>>=8-mt,xt=0,mt=0;xt=Rt<0&&dt.writeByte(xt)},At},bt=function(ct){for(var dt=1<>6,128|it&63):it<55296||it>=57344?rt.push(224|it>>12,128|it>>6&63,128|it&63):(nt++,it=65536+((it&1023)<<10|tt.charCodeAt(nt)&1023),rt.push(240|it>>18,128|it>>12&63,128|it>>6&63,128|it&63))}return rt}return et(j)}})(),function(j){a.exports=j()}(function(){return $})})(qrcode);var qrcodeExports=qrcode.exports,__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var a=function(_,$){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,et){j.__proto__=et}||function(j,et){for(var tt in et)et.hasOwnProperty(tt)&&(j[tt]=et[tt])},a(_,$)};return function(_,$){a(_,$);function j(){this.constructor=_}_.prototype=$===null?Object.create($):(j.prototype=$.prototype,new j)}}();Object.defineProperty(dist,"__esModule",{value:!0});var QRCode_1=dist.QRCode=void 0,isEqual$1=lodash_isequalExports,qrGenerator=qrcodeExports,React=reactExports,ReactDOM=reactDomExports,QRCode=function(a){__extends(_,a);function _($){var j=a.call(this,$)||this;return j.canvas=React.createRef(),j}return _.utf16to8=function($){var j="",et,tt,rt=$.length;for(et=0;et=1&&tt<=127?j+=$.charAt(et):tt>2047?(j+=String.fromCharCode(224|tt>>12&15),j+=String.fromCharCode(128|tt>>6&63),j+=String.fromCharCode(128|tt>>0&63)):(j+=String.fromCharCode(192|tt>>6&31),j+=String.fromCharCode(128|tt>>0&63));return j},_.prototype.drawRoundedSquare=function($,j,et,tt,rt,nt,it,st){st.lineWidth=$,st.fillStyle=rt,st.strokeStyle=rt,et+=$/2,j+=$/2,tt-=$,Array.isArray(nt)||(nt=[nt,nt,nt,nt]),nt=nt.map(function(yt){return yt=Math.min(yt,tt/2),yt<0?0:yt});var ot=nt[0]||0,at=nt[1]||0,ut=nt[2]||0,ht=nt[3]||0;st.beginPath(),st.moveTo(j+ot,et),st.lineTo(j+tt-at,et),at&&st.quadraticCurveTo(j+tt,et,j+tt,et+at),st.lineTo(j+tt,et+tt-ut),ut&&st.quadraticCurveTo(j+tt,et+tt,j+tt-ut,et+tt),st.lineTo(j+ht,et+tt),ht&&st.quadraticCurveTo(j,et+tt,j,et+tt-ht),st.lineTo(j,et+ot),ot&&st.quadraticCurveTo(j,et,j+ot,et),st.closePath(),st.stroke(),it&&st.fill()},_.prototype.drawPositioningPattern=function($,j,et,tt,rt,nt,it){it===void 0&&(it=[0,0,0,0]);var st=Math.ceil(j),ot,at;typeof it!="number"&&!Array.isArray(it)?(ot=it.outer||0,at=it.inner||0):(ot=it,at=ot);var ut,ht;typeof nt!="string"?(ut=nt.outer,ht=nt.inner):(ut=nt,ht=nt);var yt=tt*j+et,wt=rt*j+et,Ct=j*7;this.drawRoundedSquare(st,wt,yt,Ct,ut,ot,!1,$),Ct=j*3,yt+=j*2,wt+=j*2,this.drawRoundedSquare(st,wt,yt,Ct,ht,at,!0,$)},_.prototype.isInPositioninZone=function($,j,et){return et.some(function(tt){return j>=tt.row&&j<=tt.row+7&&$>=tt.col&&$<=tt.col+7})},_.prototype.transformPixelLengthIntoNumberOfCells=function($,j){return $/j},_.prototype.isCoordinateInImage=function($,j,et,tt,rt,nt,it,st){if(st){var ot=2,at=this.transformPixelLengthIntoNumberOfCells(rt,it),ut=this.transformPixelLengthIntoNumberOfCells(nt,it),ht=this.transformPixelLengthIntoNumberOfCells(et,it)-1,yt=this.transformPixelLengthIntoNumberOfCells(tt,it)-1;return j>=at-ot&&j<=at+ht+ot&&$>=ut-ot&&$<=ut+yt+ot}else return!1},_.prototype.shouldComponentUpdate=function($){return!isEqual$1(this.props,$)},_.prototype.componentDidMount=function(){this.update()},_.prototype.componentDidUpdate=function(){this.update()},_.prototype.update=function(){var $=this.props,j=$.value,et=$.ecLevel,tt=$.enableCORS,rt=$.bgColor,nt=$.fgColor,it=$.logoImage,st=$.logoOpacity,ot=$.logoOnLoad,at=$.removeQrCodeBehindLogo,ut=$.qrStyle,ht=$.eyeRadius,yt=$.eyeColor,wt=$.logoPaddingStyle,Ct=+this.props.size,Pt=+this.props.quietZone,$t=this.props.logoWidth?+this.props.logoWidth:0,Mt=this.props.logoHeight?+this.props.logoHeight:0,Bt=this.props.logoPadding?+this.props.logoPadding:0,Dt=qrGenerator(0,et);Dt.addData(_.utf16to8(j)),Dt.make();var zt=ReactDOM.findDOMNode(this.canvas.current),Ot=zt.getContext("2d"),It=Ct+2*Pt,Lt=Dt.getModuleCount(),Ft=Ct/Lt,jt=window.devicePixelRatio||1;zt.height=zt.width=It*jt,Ot.scale(jt,jt),Ot.fillStyle=rt,Ot.fillRect(0,0,It,It);var bt=Pt,vt=[{row:0,col:0},{row:0,col:Lt-7},{row:Lt-7,col:0}];if(Ot.strokeStyle=nt,ut==="dots"){Ot.fillStyle=nt;for(var ct=Ft/2,dt=0;dt0&&!Dt.isDark(dt-1,mt)&&mt>0&&!Dt.isDark(dt,mt-1)&&(xt[0]=!0),dt>0&&!Dt.isDark(dt-1,mt)&&mt0&&!Dt.isDark(dt,mt-1)&&(xt[3]=!0);var At=Math.ceil((mt+1)*Ft)-Math.floor(mt*Ft),Rt=Math.ceil((dt+1)*Ft)-Math.floor(dt*Ft);Ot.fillStyle=nt,Ot.beginPath(),Ot.arc(Math.round(mt*Ft)+ct+bt,Math.round(dt*Ft)+ct+bt,ct,0,2*Math.PI,!1),Ot.closePath(),Ot.fill(),xt[0]||Ot.fillRect(Math.round(mt*Ft)+bt,Math.round(dt*Ft)+bt,At/2,Rt/2),xt[1]||Ot.fillRect(Math.round(mt*Ft)+bt+Math.floor(At/2),Math.round(dt*Ft)+bt,At/2,Rt/2),xt[2]||Ot.fillRect(Math.round(mt*Ft)+bt+Math.floor(At/2),Math.round(dt*Ft)+bt+Math.floor(Rt/2),At/2,Rt/2),xt[3]||Ot.fillRect(Math.round(mt*Ft)+bt,Math.round(dt*Ft)+bt+Math.floor(Rt/2),At/2,Rt/2)}}else for(var dt=0;dt{const $=useGetOwnedAccountSafe()(a);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"You can receive tez or other digital assets by scanning or sharing this QR code",title:"Receive"}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",flexDirection:"column",children:jsxRuntimeExports.jsx(Box,{padding:"8px",background:"white",borderRadius:"8px",children:jsxRuntimeExports.jsx(QRCode_1,{size:232,value:a})})})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsxs(Box,{width:"100%",children:[$&&jsxRuntimeExports.jsx(Heading,{textAlign:"center",marginY:2,children:$.label}),jsxRuntimeExports.jsx(Flex,{justifyContent:"center",width:"100%",children:jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a),mode:{type:"no_icons"}})})]})})]})},AccountCard=({accountPkh:a})=>{const _=useGetOwnedAccount(),$=useGetAccountBalance(),j=useGetDollarBalance(),et=useGetAccountAllTokens(),tt=useGetAccountNFTs(),{openWith:rt}=reactExports.useContext(DynamicModalContext),nt=_(a),it=$(a),st=j(a),ot=et(a),at=sortedByLastUpdate(tt(a));return jsxRuntimeExports.jsx(AccountDrawerDisplay,{account:nt,balance:it,dollarBalance:st,nfts:at,onReceive:()=>rt(jsxRuntimeExports.jsx(ReceiveModal,{pkh:a})),onSend:()=>rt(jsxRuntimeExports.jsx(FormPage$4,{sender:nt})),tokens:ot})},InfoModal=({account:a})=>{const _=[{title:"Template",content:a.derivationPathTemplate},{title:"Path",content:a.derivationPath},{title:"Type (Curve)",content:a.curve}];return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(CircleIcon,{icon:jsxRuntimeExports.jsx(SlashIcon,{}),size:"48px"}),jsxRuntimeExports.jsx(Center,{marginBottom:"8px",children:jsxRuntimeExports.jsx(Heading,{marginTop:"16px",children:"Derivation Info"})}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsx(ModalBody,{children:_.map(({title:$,content:j})=>j?jsxRuntimeExports.jsxs(Box,{marginTop:"24px",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:$}),jsxRuntimeExports.jsx(Center,{justifyContent:"flex-start",marginTop:"12px",padding:"15px",borderRadius:"4px",backgroundColor:colors.gray[800],children:jsxRuntimeExports.jsx(Text,{size:"sm",children:j})})]},j):null)})]})},DerivationInfoButton=({account:a,..._})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);switch(a.type){case"multisig":case"secret_key":case"social":return null;case"ledger":case"mnemonic":return jsxRuntimeExports.jsx(Button,{"data-testid":"derivation-info-button",onClick:()=>$(jsxRuntimeExports.jsx(InfoModal,{account:a})),variant:"CTAWithIcon",..._,children:jsxRuntimeExports.jsx(FolderInfoIcon,{stroke:"currentcolor"})})}},CloseDrawerButton=({onClose:a})=>jsxRuntimeExports.jsx(Button,{minWidth:"24px",padding:"0",onClick:a,variant:"CTAWithIcon",children:jsxRuntimeExports.jsx(ExitArrowIcon,{stroke:"currentcolor"})}),scriptRel="modulepreload",assetsURL=function(a,_){return new URL(a,_).href},seen={},__vitePreload=function a(_,$,j){let et=Promise.resolve();if($&&$.length>0){const tt=document.getElementsByTagName("link"),rt=document.querySelector("meta[property=csp-nonce]"),nt=(rt==null?void 0:rt.nonce)||(rt==null?void 0:rt.getAttribute("nonce"));et=Promise.all($.map(it=>{if(it=assetsURL(it,j),it in seen)return;seen[it]=!0;const st=it.endsWith(".css"),ot=st?'[rel="stylesheet"]':"";if(!!j)for(let ht=tt.length-1;ht>=0;ht--){const yt=tt[ht];if(yt.href===it&&(!st||yt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${it}"]${ot}`))return;const ut=document.createElement("link");if(ut.rel=st?"stylesheet":scriptRel,st||(ut.as="script",ut.crossOrigin=""),ut.href=it,nt&&ut.setAttribute("nonce",nt),document.head.appendChild(ut),st)return new Promise((ht,yt)=>{ut.addEventListener("load",ht),ut.addEventListener("error",()=>yt(new Error(`Unable to preload CSS for ${it}`)))})}))}return et.then(()=>_()).catch(tt=>{const rt=new Event("vite:preloadError",{cancelable:!0});if(rt.payload=tt,window.dispatchEvent(rt),!rt.defaultPrevented)throw tt})};var loadScript=function a(_,$,j){var et=document.head||document.getElementsByTagName("head")[0],tt=document.createElement("script");typeof $=="function"&&(j=$,$={}),$=$||{},j=j||function(){},tt.type=$.type||"text/javascript",tt.charset=$.charset||"utf8",tt.async="async"in $?!!$.async:!0,tt.src=_,$.attrs&&setAttributes(tt,$.attrs),$.text&&(tt.text=""+$.text);var rt="onload"in tt?stdOnEnd:ieOnEnd;rt(tt,j),tt.onload||stdOnEnd(tt,j),et.appendChild(tt)};function setAttributes(a,_){for(var $ in _)a.setAttribute($,_[$])}function stdOnEnd(a,_){a.onload=function(){this.onerror=this.onload=null,_(null,a)},a.onerror=function(){this.onerror=this.onload=null,_(new Error("Failed to load "+this.src),a)}}function ieOnEnd(a,_){a.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,_(null,a))}}var isMergeableObject=function a(_){return isNonNullObject(_)&&!isSpecial(_)};function isNonNullObject(a){return!!a&&typeof a=="object"}function isSpecial(a){var _=Object.prototype.toString.call(a);return _==="[object RegExp]"||_==="[object Date]"||isReactElement(a)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(a){return a.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(a){return Array.isArray(a)?[]:{}}function cloneUnlessOtherwiseSpecified(a,_){return _.clone!==!1&&_.isMergeableObject(a)?deepmerge(emptyTarget(a),a,_):a}function defaultArrayMerge(a,_,$){return a.concat(_).map(function(j){return cloneUnlessOtherwiseSpecified(j,$)})}function getMergeFunction(a,_){if(!_.customMerge)return deepmerge;var $=_.customMerge(a);return typeof $=="function"?$:deepmerge}function getEnumerableOwnPropertySymbols(a){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(a).filter(function(_){return Object.propertyIsEnumerable.call(a,_)}):[]}function getKeys(a){return Object.keys(a).concat(getEnumerableOwnPropertySymbols(a))}function propertyIsOnObject(a,_){try{return _ in a}catch{return!1}}function propertyIsUnsafe(a,_){return propertyIsOnObject(a,_)&&!(Object.hasOwnProperty.call(a,_)&&Object.propertyIsEnumerable.call(a,_))}function mergeObject(a,_,$){var j={};return $.isMergeableObject(a)&&getKeys(a).forEach(function(et){j[et]=cloneUnlessOtherwiseSpecified(a[et],$)}),getKeys(_).forEach(function(et){propertyIsUnsafe(a,et)||(propertyIsOnObject(a,et)&&$.isMergeableObject(_[et])?j[et]=getMergeFunction(et,$)(a[et],_[et],$):j[et]=cloneUnlessOtherwiseSpecified(_[et],$))}),j}function deepmerge(a,_,$){$=$||{},$.arrayMerge=$.arrayMerge||defaultArrayMerge,$.isMergeableObject=$.isMergeableObject||isMergeableObject,$.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var j=Array.isArray(_),et=Array.isArray(a),tt=j===et;return tt?j?$.arrayMerge(a,_,$):mergeObject(a,_,$):cloneUnlessOtherwiseSpecified(_,$)}deepmerge.all=function a(_,$){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(j,et){return deepmerge(j,et,$)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1,__create$4=Object.create,__defProp$6=Object.defineProperty,__getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__getOwnPropNames$6=Object.getOwnPropertyNames,__getProtoOf$4=Object.getPrototypeOf,__hasOwnProp$6=Object.prototype.hasOwnProperty,__export$6=(a,_)=>{for(var $ in _)__defProp$6(a,$,{get:_[$],enumerable:!0})},__copyProps$6=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$6(_))!__hasOwnProp$6.call(a,et)&&et!==$&&__defProp$6(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$6(_,et))||j.enumerable});return a},__toESM$4=(a,_,$)=>($=a!=null?__create$4(__getProtoOf$4(a)):{},__copyProps$6(!a||!a.__esModule?__defProp$6($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS$6=a=>__copyProps$6(__defProp$6({},"__esModule",{value:!0}),a),utils_exports={};__export$6(utils_exports,{callPlayer:()=>callPlayer,getConfig:()=>getConfig,getSDK:()=>getSDK,isBlobUrl:()=>isBlobUrl,isMediaStream:()=>isMediaStream,lazy:()=>lazy,omit:()=>omit,parseEndTime:()=>parseEndTime,parseStartTime:()=>parseStartTime,queryString:()=>queryString,randomString:()=>randomString,supportsWebKitPresentationMode:()=>supportsWebKitPresentationMode});var utils$1=__toCommonJS$6(utils_exports),import_react$2=__toESM$4(reactExports),import_load_script=__toESM$4(loadScript),import_deepmerge$1=__toESM$4(cjs);const lazy=a=>import_react$2.default.lazy(async()=>{const _=await a();return typeof _.default=="function"?_:_.default}),MATCH_START_QUERY=/[?&#](?:start|t)=([0-9hms]+)/,MATCH_END_QUERY=/[?&#]end=([0-9hms]+)/,MATCH_START_STAMP=/(\d+)(h|m|s)/g,MATCH_NUMERIC=/^\d+$/;function parseTimeParam(a,_){if(a instanceof Array)return;const $=a.match(_);if($){const j=$[1];if(j.match(MATCH_START_STAMP))return parseTimeString(j);if(MATCH_NUMERIC.test(j))return parseInt(j)}}function parseTimeString(a){let _=0,$=MATCH_START_STAMP.exec(a);for(;$!==null;){const[,j,et]=$;et==="h"&&(_+=parseInt(j,10)*60*60),et==="m"&&(_+=parseInt(j,10)*60),et==="s"&&(_+=parseInt(j,10)),$=MATCH_START_STAMP.exec(a)}return _}function parseStartTime(a){return parseTimeParam(a,MATCH_START_QUERY)}function parseEndTime(a){return parseTimeParam(a,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(a){return Object.keys(a).map(_=>`${_}=${a[_]}`).join("&")}function getGlobal(a){return window[a]?window[a]:window.exports&&window.exports[a]?window.exports[a]:window.module&&window.module.exports&&window.module.exports[a]?window.module.exports[a]:null}const requests={},getSDK=function a(_,$,j=null,et=()=>!0,tt=import_load_script.default){const rt=getGlobal($);return rt&&et(rt)?Promise.resolve(rt):new Promise((nt,it)=>{if(requests[_]){requests[_].push({resolve:nt,reject:it});return}requests[_]=[{resolve:nt,reject:it}];const st=ot=>{requests[_].forEach(at=>at.resolve(ot))};if(j){const ot=window[j];window[j]=function(){ot&&ot(),st(getGlobal($))}}tt(_,ot=>{ot?(requests[_].forEach(at=>at.reject(ot)),requests[_]=null):j||st(getGlobal($))})})};function getConfig(a,_){return(0,import_deepmerge$1.default)(_.config,a.config)}function omit(a,..._){const $=[].concat(..._),j={},et=Object.keys(a);for(const tt of et)$.indexOf(tt)===-1&&(j[tt]=a[tt]);return j}function callPlayer(a,..._){if(!this.player||!this.player[a]){let $=`ReactPlayer: ${this.constructor.displayName} player could not call %c${a}%c – `;return this.player?this.player[a]||($+="The method was not available"):$+="The player was not available",console.warn($,"font-weight: bold",""),null}return this.player[a](..._)}function isMediaStream(a){return typeof window<"u"&&typeof window.MediaStream<"u"&&a instanceof window.MediaStream}function isBlobUrl(a){return/^blob:/.test(a)}function supportsWebKitPresentationMode(a=document.createElement("video")){const _=/iPhone|iPod/.test(navigator.userAgent)===!1;return a.webkitSupportsPresentationMode&&typeof a.webkitSetPresentationMode=="function"&&_}function enableStubOn(a){return a}var __defProp$5=Object.defineProperty,__getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__getOwnPropNames$5=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__export$5=(a,_)=>{for(var $ in _)__defProp$5(a,$,{get:_[$],enumerable:!0})},__copyProps$5=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$5(_))!__hasOwnProp$5.call(a,et)&&et!==$&&__defProp$5(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$5(_,et))||j.enumerable});return a},__toCommonJS$5=a=>__copyProps$5(__defProp$5({},"__esModule",{value:!0}),a),patterns_exports={};__export$5(patterns_exports,{AUDIO_EXTENSIONS:()=>AUDIO_EXTENSIONS,DASH_EXTENSIONS:()=>DASH_EXTENSIONS,FLV_EXTENSIONS:()=>FLV_EXTENSIONS,HLS_EXTENSIONS:()=>HLS_EXTENSIONS,MATCH_URL_DAILYMOTION:()=>MATCH_URL_DAILYMOTION,MATCH_URL_FACEBOOK:()=>MATCH_URL_FACEBOOK,MATCH_URL_FACEBOOK_WATCH:()=>MATCH_URL_FACEBOOK_WATCH,MATCH_URL_KALTURA:()=>MATCH_URL_KALTURA,MATCH_URL_MIXCLOUD:()=>MATCH_URL_MIXCLOUD,MATCH_URL_MUX:()=>MATCH_URL_MUX,MATCH_URL_SOUNDCLOUD:()=>MATCH_URL_SOUNDCLOUD,MATCH_URL_STREAMABLE:()=>MATCH_URL_STREAMABLE,MATCH_URL_TWITCH_CHANNEL:()=>MATCH_URL_TWITCH_CHANNEL,MATCH_URL_TWITCH_VIDEO:()=>MATCH_URL_TWITCH_VIDEO,MATCH_URL_VIDYARD:()=>MATCH_URL_VIDYARD,MATCH_URL_VIMEO:()=>MATCH_URL_VIMEO,MATCH_URL_WISTIA:()=>MATCH_URL_WISTIA,MATCH_URL_YOUTUBE:()=>MATCH_URL_YOUTUBE,VIDEO_EXTENSIONS:()=>VIDEO_EXTENSIONS,canPlay:()=>canPlay});var patterns=__toCommonJS$5(patterns_exports),import_utils$3=utils$1;const MATCH_URL_YOUTUBE=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,MATCH_URL_SOUNDCLOUD=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,MATCH_URL_VIMEO=/vimeo\.com\/(?!progressive_redirect).+/,MATCH_URL_MUX=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,MATCH_URL_FACEBOOK=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,MATCH_URL_FACEBOOK_WATCH=/^https?:\/\/fb\.watch\/.+$/,MATCH_URL_STREAMABLE=/streamable\.com\/([a-z0-9]+)$/,MATCH_URL_WISTIA=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,MATCH_URL_TWITCH_VIDEO=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,MATCH_URL_TWITCH_CHANNEL=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,MATCH_URL_DAILYMOTION=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,MATCH_URL_MIXCLOUD=/mixcloud\.com\/([^/]+\/[^/]+)/,MATCH_URL_VIDYARD=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,MATCH_URL_KALTURA=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,AUDIO_EXTENSIONS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,VIDEO_EXTENSIONS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,HLS_EXTENSIONS=/\.(m3u8)($|\?)/i,DASH_EXTENSIONS=/\.(mpd)($|\?)/i,FLV_EXTENSIONS=/\.(flv)($|\?)/i,canPlayFile=a=>{if(a instanceof Array){for(const _ of a)if(typeof _=="string"&&canPlayFile(_)||canPlayFile(_.src))return!0;return!1}return(0,import_utils$3.isMediaStream)(a)||(0,import_utils$3.isBlobUrl)(a)?!0:AUDIO_EXTENSIONS.test(a)||VIDEO_EXTENSIONS.test(a)||HLS_EXTENSIONS.test(a)||DASH_EXTENSIONS.test(a)||FLV_EXTENSIONS.test(a)},canPlay={youtube:a=>a instanceof Array?a.every(_=>MATCH_URL_YOUTUBE.test(_)):MATCH_URL_YOUTUBE.test(a),soundcloud:a=>MATCH_URL_SOUNDCLOUD.test(a)&&!AUDIO_EXTENSIONS.test(a),vimeo:a=>MATCH_URL_VIMEO.test(a)&&!VIDEO_EXTENSIONS.test(a)&&!HLS_EXTENSIONS.test(a),mux:a=>MATCH_URL_MUX.test(a),facebook:a=>MATCH_URL_FACEBOOK.test(a)||MATCH_URL_FACEBOOK_WATCH.test(a),streamable:a=>MATCH_URL_STREAMABLE.test(a),wistia:a=>MATCH_URL_WISTIA.test(a),twitch:a=>MATCH_URL_TWITCH_VIDEO.test(a)||MATCH_URL_TWITCH_CHANNEL.test(a),dailymotion:a=>MATCH_URL_DAILYMOTION.test(a),mixcloud:a=>MATCH_URL_MIXCLOUD.test(a),vidyard:a=>MATCH_URL_VIDYARD.test(a),kaltura:a=>MATCH_URL_KALTURA.test(a),file:canPlayFile};var __defProp$4=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__getOwnPropNames$4=Object.getOwnPropertyNames,__hasOwnProp$4=Object.prototype.hasOwnProperty,__export$4=(a,_)=>{for(var $ in _)__defProp$4(a,$,{get:_[$],enumerable:!0})},__copyProps$4=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$4(_))!__hasOwnProp$4.call(a,et)&&et!==$&&__defProp$4(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$4(_,et))||j.enumerable});return a},__toCommonJS$4=a=>__copyProps$4(__defProp$4({},"__esModule",{value:!0}),a),players_exports={};__export$4(players_exports,{default:()=>players_default});var players=__toCommonJS$4(players_exports),import_utils$2=utils$1,import_patterns=patterns,players_default=[{key:"youtube",name:"YouTube",canPlay:import_patterns.canPlay.youtube,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./YouTube-D7Fg3hwi.js").then(a=>a.Y),[],import.meta.url))},{key:"soundcloud",name:"SoundCloud",canPlay:import_patterns.canPlay.soundcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./SoundCloud-DIxM4yf7.js").then(a=>a.S),[],import.meta.url))},{key:"vimeo",name:"Vimeo",canPlay:import_patterns.canPlay.vimeo,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vimeo-Dwcn2a-4.js").then(a=>a.V),[],import.meta.url))},{key:"mux",name:"Mux",canPlay:import_patterns.canPlay.mux,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mux-BB3adfLv.js").then(a=>a.M),[],import.meta.url))},{key:"facebook",name:"Facebook",canPlay:import_patterns.canPlay.facebook,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Facebook-v7IG1Iu_.js").then(a=>a.F),[],import.meta.url))},{key:"streamable",name:"Streamable",canPlay:import_patterns.canPlay.streamable,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Streamable-BIg498SH.js").then(a=>a.S),[],import.meta.url))},{key:"wistia",name:"Wistia",canPlay:import_patterns.canPlay.wistia,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Wistia-Cafs9unk.js").then(a=>a.W),[],import.meta.url))},{key:"twitch",name:"Twitch",canPlay:import_patterns.canPlay.twitch,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Twitch-_F8av3qg.js").then(a=>a.T),[],import.meta.url))},{key:"dailymotion",name:"DailyMotion",canPlay:import_patterns.canPlay.dailymotion,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./DailyMotion-F8__rn9f.js").then(a=>a.D),[],import.meta.url))},{key:"mixcloud",name:"Mixcloud",canPlay:import_patterns.canPlay.mixcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mixcloud-DMn3HFhR.js").then(a=>a.M),[],import.meta.url))},{key:"vidyard",name:"Vidyard",canPlay:import_patterns.canPlay.vidyard,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vidyard-DyExc8oi.js").then(a=>a.V),[],import.meta.url))},{key:"kaltura",name:"Kaltura",canPlay:import_patterns.canPlay.kaltura,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Kaltura-B7_0hU-9.js").then(a=>a.K),[],import.meta.url))},{key:"file",name:"FilePlayer",canPlay:import_patterns.canPlay.file,canEnablePIP:a=>import_patterns.canPlay.file(a)&&(document.pictureInPictureEnabled||(0,import_utils$2.supportsWebKitPresentationMode)())&&!import_patterns.AUDIO_EXTENSIONS.test(a),lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./FilePlayer-CkYzVQql.js").then(a=>a.F),[],import.meta.url))}],safeIsNaN=Number.isNaN||function a(_){return typeof _=="number"&&_!==_};function isEqual(a,_){return!!(a===_||safeIsNaN(a)&&safeIsNaN(_))}function areInputsEqual(a,_){if(a.length!==_.length)return!1;for(var $=0;${for(var $ in _)__defProp$3(a,$,{get:_[$],enumerable:!0})},__copyProps$3=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$3(_))!__hasOwnProp$3.call(a,et)&&et!==$&&__defProp$3(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$3(_,et))||j.enumerable});return a},__toESM$3=(a,_,$)=>($=a!=null?__create$3(__getProtoOf$3(a)):{},__copyProps$3(!a||!a.__esModule?__defProp$3($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS$3=a=>__copyProps$3(__defProp$3({},"__esModule",{value:!0}),a),props_exports={};__export$3(props_exports,{defaultProps:()=>defaultProps,propTypes:()=>propTypes});var props=__toCommonJS$3(props_exports),import_prop_types=__toESM$3(propTypesExports);const{string,bool,number,array,oneOfType,shape,object,func,node}=import_prop_types.default,propTypes={url:oneOfType([string,array,object]),playing:bool,loop:bool,controls:bool,volume:number,muted:bool,playbackRate:number,width:oneOfType([string,number]),height:oneOfType([string,number]),style:object,progressInterval:number,playsinline:bool,pip:bool,stopOnUnmount:bool,light:oneOfType([bool,string,object]),playIcon:node,previewTabIndex:number,previewAriaLabel:string,fallback:node,oEmbedUrl:string,wrapper:oneOfType([string,func,shape({render:func.isRequired})]),config:shape({soundcloud:shape({options:object}),youtube:shape({playerVars:object,embedOptions:object,onUnstarted:func}),facebook:shape({appId:string,version:string,playerId:string,attributes:object}),dailymotion:shape({params:object}),vimeo:shape({playerOptions:object,title:string}),mux:shape({attributes:object,version:string}),file:shape({attributes:object,tracks:array,forceVideo:bool,forceAudio:bool,forceHLS:bool,forceSafariHLS:bool,forceDisableHls:bool,forceDASH:bool,forceFLV:bool,hlsOptions:object,hlsVersion:string,dashVersion:string,flvVersion:string}),wistia:shape({options:object,playerId:string,customControls:array}),mixcloud:shape({options:object}),twitch:shape({options:object,playerId:string}),vidyard:shape({options:object})}),onReady:func,onStart:func,onPlay:func,onPause:func,onBuffer:func,onBufferEnd:func,onEnded:func,onError:func,onDuration:func,onSeek:func,onPlaybackRateChange:func,onPlaybackQualityChange:func,onProgress:func,onClickPreview:func,onEnablePIP:func,onDisablePIP:func},noop$1=()=>{},defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:noop$1},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},mux:{attributes:{},version:"2"},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:noop$1,onStart:noop$1,onPlay:noop$1,onPause:noop$1,onBuffer:noop$1,onBufferEnd:noop$1,onEnded:noop$1,onError:noop$1,onDuration:noop$1,onSeek:noop$1,onPlaybackRateChange:noop$1,onPlaybackQualityChange:noop$1,onProgress:noop$1,onClickPreview:noop$1,onEnablePIP:noop$1,onDisablePIP:noop$1};var __create$2=Object.create,__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__getOwnPropNames$2=Object.getOwnPropertyNames,__getProtoOf$2=Object.getPrototypeOf,__hasOwnProp$2=Object.prototype.hasOwnProperty,__defNormalProp$1=(a,_,$)=>_ in a?__defProp$2(a,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[_]=$,__export$2=(a,_)=>{for(var $ in _)__defProp$2(a,$,{get:_[$],enumerable:!0})},__copyProps$2=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$2(_))!__hasOwnProp$2.call(a,et)&&et!==$&&__defProp$2(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$2(_,et))||j.enumerable});return a},__toESM$2=(a,_,$)=>($=a!=null?__create$2(__getProtoOf$2(a)):{},__copyProps$2(!a||!a.__esModule?__defProp$2($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS$2=a=>__copyProps$2(__defProp$2({},"__esModule",{value:!0}),a),__publicField$1=(a,_,$)=>(__defNormalProp$1(a,typeof _!="symbol"?_+"":_,$),$),Player_exports={};__export$2(Player_exports,{default:()=>Player});var Player_1=__toCommonJS$2(Player_exports),import_react$1=__toESM$2(reactExports),import_react_fast_compare$1=__toESM$2(reactFastCompare),import_props$1=props,import_utils$1=utils$1;const SEEK_ON_PLAY_EXPIRY=5e3;class Player extends import_react$1.Component{constructor(){super(...arguments),__publicField$1(this,"mounted",!1),__publicField$1(this,"isReady",!1),__publicField$1(this,"isPlaying",!1),__publicField$1(this,"isLoading",!0),__publicField$1(this,"loadOnReady",null),__publicField$1(this,"startOnPlay",!0),__publicField$1(this,"seekOnPlay",null),__publicField$1(this,"onDurationCalled",!1),__publicField$1(this,"handlePlayerMount",_=>{if(this.player){this.progress();return}this.player=_,this.player.load(this.props.url),this.progress()}),__publicField$1(this,"getInternalPlayer",_=>this.player?this.player[_]:null),__publicField$1(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const _=this.getCurrentTime()||0,$=this.getSecondsLoaded(),j=this.getDuration();if(j){const et={playedSeconds:_,played:_/j};$!==null&&(et.loadedSeconds=$,et.loaded=$/j),(et.playedSeconds!==this.prevPlayed||et.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(et),this.prevPlayed=et.playedSeconds,this.prevLoaded=et.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),__publicField$1(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:_,playing:$,volume:j,muted:et}=this.props;_(),!et&&j!==null&&this.player.setVolume(j),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):$&&this.player.play(),this.handleDurationCheck()}),__publicField$1(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:_,onPlay:$,playbackRate:j}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&j!==1&&this.player.setPlaybackRate(j),_(),this.startOnPlay=!1),$(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),__publicField$1(this,"handlePause",_=>{this.isPlaying=!1,this.isLoading||this.props.onPause(_)}),__publicField$1(this,"handleEnded",()=>{const{activePlayer:_,loop:$,onEnded:j}=this.props;_.loopOnEnded&&$&&this.seekTo(0),$||(this.isPlaying=!1,j())}),__publicField$1(this,"handleError",(..._)=>{this.isLoading=!1,this.props.onError(..._)}),__publicField$1(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const _=this.getDuration();_?this.onDurationCalled||(this.props.onDuration(_),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),__publicField$1(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(_){if(!this.player)return;const{url:$,playing:j,volume:et,muted:tt,playbackRate:rt,pip:nt,loop:it,activePlayer:st,disableDeferredLoading:ot}=this.props;if(!(0,import_react_fast_compare$1.default)(_.url,$)){if(this.isLoading&&!st.forceLoad&&!ot&&!(0,import_utils$1.isMediaStream)($)){console.warn(`ReactPlayer: the attempt to load ${$} is being deferred until the player has loaded`),this.loadOnReady=$;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load($,this.isReady)}!_.playing&&j&&!this.isPlaying&&this.player.play(),_.playing&&!j&&this.isPlaying&&this.player.pause(),!_.pip&&nt&&this.player.enablePIP&&this.player.enablePIP(),_.pip&&!nt&&this.player.disablePIP&&this.player.disablePIP(),_.volume!==et&&et!==null&&this.player.setVolume(et),_.muted!==tt&&(tt?this.player.mute():(this.player.unmute(),et!==null&&setTimeout(()=>this.player.setVolume(et)))),_.playbackRate!==rt&&this.player.setPlaybackRate&&this.player.setPlaybackRate(rt),_.loop!==it&&this.player.setLoop&&this.player.setLoop(it)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(_,$,j){if(!this.isReady){_!==0&&(this.seekOnPlay=_,setTimeout(()=>{this.seekOnPlay=null},SEEK_ON_PLAY_EXPIRY));return}if($?$==="fraction":_>0&&_<1){const tt=this.player.getDuration();if(!tt){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(tt*_,j);return}this.player.seekTo(_,j)}render(){const _=this.props.activePlayer;return _?import_react$1.default.createElement(_,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}__publicField$1(Player,"displayName","Player");__publicField$1(Player,"propTypes",import_props$1.propTypes);__publicField$1(Player,"defaultProps",import_props$1.defaultProps);var __create$1=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__getProtoOf$1=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__defNormalProp=(a,_,$)=>_ in a?__defProp$1(a,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[_]=$,__export$1=(a,_)=>{for(var $ in _)__defProp$1(a,$,{get:_[$],enumerable:!0})},__copyProps$1=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$1(_))!__hasOwnProp$1.call(a,et)&&et!==$&&__defProp$1(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$1(_,et))||j.enumerable});return a},__toESM$1=(a,_,$)=>($=a!=null?__create$1(__getProtoOf$1(a)):{},__copyProps$1(!a||!a.__esModule?__defProp$1($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS$1=a=>__copyProps$1(__defProp$1({},"__esModule",{value:!0}),a),__publicField=(a,_,$)=>(__defNormalProp(a,typeof _!="symbol"?_+"":_,$),$),ReactPlayer_exports={};__export$1(ReactPlayer_exports,{createReactPlayer:()=>createReactPlayer});var ReactPlayer$1=__toCommonJS$1(ReactPlayer_exports),import_react=__toESM$1(reactExports),import_deepmerge=__toESM$1(cjs),import_memoize_one=__toESM$1(require$$2),import_react_fast_compare=__toESM$1(reactFastCompare),import_props=props,import_utils=utils$1,import_Player=__toESM$1(Player_1);const Preview=(0,import_utils.lazy)(()=>__vitePreload(()=>import("./Preview-BNWDONTD.js").then(a=>a.P),[],import.meta.url)),IS_BROWSER=typeof window<"u"&&window.document&&typeof document<"u",IS_GLOBAL=typeof commonjsGlobal<"u"&&commonjsGlobal.window&&commonjsGlobal.window.document,SUPPORTED_PROPS=Object.keys(import_props.propTypes),UniversalSuspense=IS_BROWSER||IS_GLOBAL?import_react.Suspense:()=>null,customPlayers=[],createReactPlayer=(a,_)=>{var $;return $=class extends import_react.Component{constructor(){super(...arguments),__publicField(this,"state",{showPreview:!!this.props.light}),__publicField(this,"references",{wrapper:j=>{this.wrapper=j},player:j=>{this.player=j}}),__publicField(this,"handleClickPreview",j=>{this.setState({showPreview:!1}),this.props.onClickPreview(j)}),__publicField(this,"showPreview",()=>{this.setState({showPreview:!0})}),__publicField(this,"getDuration",()=>this.player?this.player.getDuration():null),__publicField(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),__publicField(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),__publicField(this,"getInternalPlayer",(j="player")=>this.player?this.player.getInternalPlayer(j):null),__publicField(this,"seekTo",(j,et,tt)=>{if(!this.player)return null;this.player.seekTo(j,et,tt)}),__publicField(this,"handleReady",()=>{this.props.onReady(this)}),__publicField(this,"getActivePlayer",(0,import_memoize_one.default)(j=>{for(const et of[...customPlayers,...a])if(et.canPlay(j))return et;return _||null})),__publicField(this,"getConfig",(0,import_memoize_one.default)((j,et)=>{const{config:tt}=this.props;return import_deepmerge.default.all([import_props.defaultProps.config,import_props.defaultProps.config[et]||{},tt,tt[et]||{}])})),__publicField(this,"getAttributes",(0,import_memoize_one.default)(j=>(0,import_utils.omit)(this.props,SUPPORTED_PROPS))),__publicField(this,"renderActivePlayer",j=>{if(!j)return null;const et=this.getActivePlayer(j);if(!et)return null;const tt=this.getConfig(j,et.key);return import_react.default.createElement(import_Player.default,{...this.props,key:et.key,ref:this.references.player,config:tt,activePlayer:et.lazyPlayer||et,onReady:this.handleReady})})}shouldComponentUpdate(j,et){return!(0,import_react_fast_compare.default)(this.props,j)||!(0,import_react_fast_compare.default)(this.state,et)}componentDidUpdate(j){const{light:et}=this.props;!j.light&&et&&this.setState({showPreview:!0}),j.light&&!et&&this.setState({showPreview:!1})}renderPreview(j){if(!j)return null;const{light:et,playIcon:tt,previewTabIndex:rt,oEmbedUrl:nt,previewAriaLabel:it}=this.props;return import_react.default.createElement(Preview,{url:j,light:et,playIcon:tt,previewTabIndex:rt,previewAriaLabel:it,oEmbedUrl:nt,onClick:this.handleClickPreview})}render(){const{url:j,style:et,width:tt,height:rt,fallback:nt,wrapper:it}=this.props,{showPreview:st}=this.state,ot=this.getAttributes(j),at=typeof it=="string"?this.references.wrapper:void 0;return import_react.default.createElement(it,{ref:at,style:{...et,width:tt,height:rt},...ot},import_react.default.createElement(UniversalSuspense,{fallback:nt},st?this.renderPreview(j):this.renderActivePlayer(j)))}},__publicField($,"displayName","ReactPlayer"),__publicField($,"propTypes",import_props.propTypes),__publicField($,"defaultProps",import_props.defaultProps),__publicField($,"addCustomPlayer",j=>{customPlayers.push(j)}),__publicField($,"removeCustomPlayers",()=>{customPlayers.length=0}),__publicField($,"canPlay",j=>{for(const et of[...customPlayers,...a])if(et.canPlay(j))return!0;return!1}),__publicField($,"canEnablePIP",j=>{for(const et of[...customPlayers,...a])if(et.canEnablePIP&&et.canEnablePIP(j))return!0;return!1}),$};var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(a,_)=>{for(var $ in _)__defProp(a,$,{get:_[$],enumerable:!0})},__copyProps=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames(_))!__hasOwnProp.call(a,et)&&et!==$&&__defProp(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc(_,et))||j.enumerable});return a},__toESM=(a,_,$)=>($=a!=null?__create(__getProtoOf(a)):{},__copyProps(!a||!a.__esModule?__defProp($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS=a=>__copyProps(__defProp({},"__esModule",{value:!0}),a),src_exports={};__export(src_exports,{default:()=>src_default});var lib$1=__toCommonJS(src_exports),import_players=__toESM(players),import_ReactPlayer=ReactPlayer$1;const fallback=import_players.default[import_players.default.length-1];var src_default=(0,import_ReactPlayer.createReactPlayer)(import_players.default,fallback);const ReactPlayer=getDefaultExportFromCjs$1(lib$1),AttributesAccordionItem=({nft:a,style:_})=>{const $=a.metadata.attributes;return!$||$.length===0?null:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],"data-testid":"attributes-section",style:_,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"Attributes"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(Wrap,{marginLeft:"0",spacing:"10px",children:$.map(j=>jsxRuntimeExports.jsx(WrapItem,{flex:"1","data-testid":"nft-attribute",children:jsxRuntimeExports.jsx(Card,{width:"160px",height:"128px",marginBottom:"2px",background:colors.gray[700],children:jsxRuntimeExports.jsxs(CardBody,{padding:"16px",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:j.name}),jsxRuntimeExports.jsx(Heading,{size:"md",children:j.value})]})})},j.name))})})]})},TruncatedTextWithTooltip=({text:a,maxLength:_})=>a.length<=_?jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:a}):jsxRuntimeExports.jsx(Tooltip,{label:a,children:jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:truncate(a,_)})}),TzktLink=({url:a,..._})=>jsxRuntimeExports.jsx("a",{"data-testid":"tzkt-link",href:a,rel:"noopener noreferrer",target:"_blank",children:jsxRuntimeExports.jsx(WindowLinkIcon,{..._})}),CreatorElement=({nft:a})=>{if(!a.metadata.creators||a.metadata.creators.length===0)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"-"});const _=a.metadata.creators[0];return _.startsWith("tz")?jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(_)}):jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:_})},PropertiesAccordionItem=({nft:a,style:_})=>{const $=royalties(a),j=$.reduce((tt,rt)=>tt+rt.share,0).toFixed(2),et=useSelectedNetwork();return jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:_,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"Properties"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(TableContainer,{children:jsxRuntimeExports.jsx(Table,{variant:"stripped",children:jsxRuntimeExports.jsxs(Tbody,{fontSize:"14px",children:[jsxRuntimeExports.jsxs(Tr,{background:colors.gray[900],borderColor:colors.gray[700],borderBottomWidth:"1px",borderRadius:"8px",children:[jsxRuntimeExports.jsx(Td,{width:"20%",padding:"16px 0 16px 15px",paddingRight:"0",color:colors.gray[400],borderTopLeftRadius:"8px","data-testid":"nft-editions",children:"Editions:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-editions-value",children:a.totalSupply||"?"}),jsxRuntimeExports.jsx(Td,{width:"20%",padding:"16px 0 16px 15px",color:colors.gray[400],children:"Token ID:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",borderTopRightRadius:"8px",children:a.tokenId})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[800],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsxs(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-royalty",children:["Royalties",$.length>1?" ("+$.length+")":"",":"]}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-royalty-value",children:$.length>0?j+"%":"-"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-mime",children:"MIME type:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px","data-testid":"nft-mime-value",children:mimeType(a)||"-"})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[900],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"Contract:"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px",children:jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(a.contract)})}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"Metadata:"}),jsxRuntimeExports.jsxs(Td,{width:"30%",padding:"16px 0 16px 5px",children:["TzKT ",jsxRuntimeExports.jsx(TzktLink,{url:metadataUri(a,et)})]})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[800],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-creator",children:"Creator:"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-creator-value",children:jsxRuntimeExports.jsx(CreatorElement,{nft:a})}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"License:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",children:jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:a.metadata.rights||"-"})})]})]})})})})]})},TagsSection=({nft:a})=>{const _=a.metadata.tags;return!_||_.length===0?null:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"tags-section",children:_.map($=>jsxRuntimeExports.jsx(WrapItem,{padding:"3px 8px",background:colors.gray[600],borderRadius:"100px",children:jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-tag",children:$})},$))})},SendNFTRecapTile=({nft:a})=>{const _=getIPFSurl(thumbnailUri(a)),$=getIPFSurl(a.displayUri);return jsxRuntimeExports.jsx(Box,{width:"100%","aria-label":"nft",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"60px",padding:3,background:colors.gray[800],borderRadius:"4px","data-testid":"nft-name",children:[jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{fallbackSrc:$,src:_})}),a.metadata.name&&jsxRuntimeExports.jsx(Heading,{marginLeft:4,size:"sm",children:truncate(a.metadata.name,45)})]})})},SignPage$1=a=>{const{mode:_,operations:$,fee:j,data:{nft:et}}=a,{fee:tt,operations:rt,estimationFailed:nt,isLoading:it,form:st,signer:ot,reEstimate:at,onSign:ut}=useSignPageHelpers(j,$,_),{recipient:ht}=rt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...st,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,operationsType:rt.type,signer:rt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:et})}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",marginY:"12px",paddingX:"4px",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Owned:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-owned",size:"sm",children:et.balance})]}),jsxRuntimeExports.jsx(SignPageFee,{fee:tt})]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"12px",marginBottom:"24px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"12px",size:"md",children:"Quantity:"}),jsxRuntimeExports.jsx(Center,{width:"100px",height:"48px",background:colors.gray[800],borderRadius:"4px",children:jsxRuntimeExports.jsxs(Text,{textAlign:"center",children:[rt.operations[0].amount," out of ",et.balance]})})]}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:rt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:ht}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:it,operationType:rt.type,reEstimate:at,sender:rt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:nt,isLoading:it,onSubmit:ut,signer:ot,text:headerText(rt.type,_)})})]})})})},FormPage$1=a=>{const{nft:_}=a,$=useOpenSignPageFormAction({SignPage:SignPage$1,signPageExtraData:{nft:_},FormPage:FormPage$1,defaultFormPageProps:a,toOperation:toOperation$1(_)}),j=useAddToBatchFormAction(toOperation$1(_)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:{quantity:1,...formDefaultValues(a)}}),{formState:{isValid:it,errors:st},register:ot,handleSubmit:at}=nt;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(FormPageHeader,{}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:a.nft})}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Owned:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-owned",size:"sm",children:_.balance})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.quantity,children:[jsxRuntimeExports.jsx(FormLabel,{children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"8px",size:"md",children:"Quantity:"}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(InputGroup,{width:"75px",children:jsxRuntimeExports.jsx(Input,{width:"60px",color:"white","data-testid":"quantity-input",step:1,type:"number",...ot("quantity",{required:"Quantity is required",max:{value:_.balance,message:`Max quantity is ${_.balance}`},min:{value:1,message:"Min quantity is 1"}})})}),jsxRuntimeExports.jsxs(Text,{"data-testid":"out-of-nft",children:["out of ",_.balance]})]})]})}),st.quantity&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"quantity-error",children:st.quantity.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),st.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:st.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),st.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:st.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:at(tt),onSingleSubmit:at(et)})})]})})})},toOperation$1=a=>_=>({type:"fa2",sender:parsePkh(_.sender),recipient:parsePkh(_.recipient),contract:parseContractPkh(a.contract),tokenId:a.tokenId,amount:_.quantity.toString()}),NFTDrawerCard=({nft:a})=>{var it;const _=getIPFSurl(artifactUri(a)),$=getIPFSurl(a.displayUri),j=useGetOwnedAccount(),{openWith:et}=reactExports.useContext(DynamicModalContext),tt=(it=mimeType(a))==null?void 0:it.startsWith("video/"),rt=tokenName(a),nt={border:"none",borderRadius:"8px",marginBottom:"20px"};return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Card,{width:"534px",height:"534px",background:colors.gray[800],children:jsxRuntimeExports.jsxs(CardBody,{padding:"24px",children:[jsxRuntimeExports.jsx(Box,{position:"relative",width:"486px",height:"486px",children:tt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{position:"absolute",zIndex:1,width:"486px",height:"486px",children:jsxRuntimeExports.jsx(ReactPlayer,{width:"100%",height:"100%",loop:!0,playing:!0,url:_})}),jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:0,top:"0",width:"486px",height:"486px",objectFit:"contain",alt:rt,filter:"blur(20px)",src:$})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:1,width:"486px",height:"486px",objectFit:"contain",alt:rt,fallbackSrc:$,src:_}),jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:0,top:"0",width:"486px",height:"486px",objectFit:"contain",alt:rt,"data-testid":"nft-image",fallbackSrc:$,filter:"blur(20px)",src:_})]})}),Number(a.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"24px",marginTop:"-38px",marginLeft:"16px",borderRadius:"100px",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",paddingX:"8px",children:"x"+a.balance})]})}),jsxRuntimeExports.jsx(TagsSection,{nft:a}),rt&&jsxRuntimeExports.jsx(Heading,{marginTop:"16px",marginBottom:"14px","data-testid":"nft-name",size:"lg",children:rt}),a.metadata.description&&jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-description",size:"sm",children:a.metadata.description}),jsxRuntimeExports.jsx(Button,{marginTop:"20px",onClick:()=>et(jsxRuntimeExports.jsx(FormPage$1,{nft:a,sender:j(a.owner)})),children:"Send"}),jsxRuntimeExports.jsxs(Accordion,{marginTop:"32px",allowMultiple:!0,children:[jsxRuntimeExports.jsx(AttributesAccordionItem,{nft:a,style:nt}),jsxRuntimeExports.jsx(PropertiesAccordionItem,{nft:a,style:nt}),jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:nt,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"JSON"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(JsValueWrap,{value:a})})]})]})]})},NFTDrawerBody=({nft:a,onCloseDrawer:_})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",paddingBottom:"22px",color:colors.gray[400],"data-testid":"nft-drawer-body",children:[jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.owner)}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:_})]}),jsxRuntimeExports.jsx(NFTDrawerCard,{nft:a})]}),AccountListWithDrawer=()=>{const[a,_]=reactExports.useState(null),{ownerPkh:$,nftId:j}=useParams(),et=useAllNfts(),tt=$&&lodashExports.get(et,[$],[]).find(ht=>fullId(ht)===j),rt=!!tt,{isOpen:nt,onOpen:it,onClose:st}=useDisclosure$1({defaultIsOpen:rt}),ot=useNavigate(),at=reactExports.useCallback(()=>{_(null),st(),ot("/home")},[st,ot]);reactExports.useEffect(()=>{const ht=yt=>{yt.key==="Escape"&&at()};return document.addEventListener("keydown",ht),()=>document.removeEventListener("keydown",ht)},[at]);const ut=reactExports.useMemo(()=>({selectedAccount:a,selectAccount:ht=>{_(ht),it()}}),[a,it]);return jsxRuntimeExports.jsxs(SelectedAccountContext.Provider,{value:ut,children:[jsxRuntimeExports.jsx(AccountsList,{}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:nt,onClose:at,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(DrawerContent,{children:[rt&&jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(NFTDrawerBody,{nft:{...tt,owner:$},onCloseDrawer:at})}),!rt&&a&&jsxRuntimeExports.jsxs(ModalBody,{overflow:"hidden",overflowY:"scroll",paddingRight:"0",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"flex-end",width:"100%",paddingRight:"24px",children:[jsxRuntimeExports.jsx(DerivationInfoButton,{marginRight:"5px",account:a}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:at})]}),jsxRuntimeExports.jsx(AccountCard,{accountPkh:a.address.pkh})]})]})]})]})},HomeView=()=>jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Accounts"}),jsxRuntimeExports.jsx(Flex,{flex:1,minHeight:1,children:jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",flex:1,marginRight:"12px",paddingBottom:"12px",children:[jsxRuntimeExports.jsx(AccountListHeader,{}),jsxRuntimeExports.jsx(Box,{flex:1,overflow:"hidden",borderRadius:"8px",children:jsxRuntimeExports.jsx(AccountListWithDrawer,{})})]})})]}),SelectedNFTContext=reactExports.createContext({selectedNFT:void 0,setSelectedNFT:a=>{}}),NFTCard=({nft:a})=>{const{selectedNFT:_,setSelectedNFT:$}=reactExports.useContext(SelectedNFTContext),j=getIPFSurl(thumbnailUri(a)),et=getIPFSurl(a.displayUri),tt=a.metadata.name,rt={width:"100%",minWidth:"242px",minHeight:"242px",objectFit:"contain",aspectRatio:"1",fallbackSrc:et,src:j},nt=_&&fullId(_)===fullId(a)&&_.owner===a.owner;return jsxRuntimeExports.jsx(Card,{minWidth:"274px",borderRadius:"8px",cursor:"pointer","data-testid":`nft-card${nt?"-selected":""}`,onClick:()=>$(a),children:jsxRuntimeExports.jsxs(CardBody,{padding:"16px",background:colors.gray[900],border:"1px solid",borderColor:nt?colors.orangeL:"transparent",borderRadius:"8px",_hover:{background:colors.gray[700],borderColor:colors.gray[500]},children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsxs(Box,{position:"relative",width:"100%",children:[jsxRuntimeExports.jsx(Image$1,{...rt,zIndex:2,opacity:"0"}),jsxRuntimeExports.jsx(Image$1,{...rt,position:"absolute",zIndex:0,top:"0",filter:"blur(20px)"}),jsxRuntimeExports.jsx(Image$1,{...rt,position:"absolute",zIndex:1,top:"0","data-testid":"nft-image"})]})}),Number(a.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"24px",marginTop:"-36px",marginLeft:"10px",paddingTop:"1px",fontSize:"14px",borderRadius:"full",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",paddingX:"8px",children:"x"+a.balance}),jsxRuntimeExports.jsx(Box,{overflow:"hidden","data-testid":"nft-card-name",children:jsxRuntimeExports.jsx(Heading,{overflow:"hidden",marginTop:"15px",marginBottom:"8px",fontSize:"sm",whiteSpace:"nowrap",textOverflow:"ellipsis",children:tt})}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.owner)})]})})},NFTGallery=({nftsByOwner:a})=>{const _=Object.entries(a).flatMap(([j,et])=>(et||[]).map(tt=>({owner:j,...tt})));let $="repeat(auto-fit, minmax(min(100%/2, max(274px, 100%/7)), 1fr))";return _.length<3&&($=`repeat(auto-fit, min(100% / ${_.length} - 16px, 450px))`),jsxRuntimeExports.jsx(SimpleGrid,{gridTemplateColumns:$,marginBottom:"16px",minChildWidth:"340px",spacing:"16px",children:sortedByLastUpdate(_).map(j=>jsxRuntimeExports.jsx(NFTCard,{nft:j},`${j.owner}:${fullId(j)}`))})},AccountListDisplay=({accounts:a,onSelect:_})=>jsxRuntimeExports.jsx(MenuList,{zIndex:"docked",overflowY:"scroll",maxHeight:"300px",padding:0,background:colors.gray[900],children:a.map($=>jsxRuntimeExports.jsx(MenuItem$1,{width:"100%",minHeight:"48px",padding:"5px",background:colors.gray[700],"aria-label":$.label,onClick:()=>{_($)},value:$.address.pkh,children:jsxRuntimeExports.jsx(AddressTile,{width:"370px",height:"40px",padding:"5px",background:colors.gray[700],borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",address:$.address})},$.address.pkh))}),useAccountsFilter=()=>{const a=useAllAccounts(),[_]=reactExports.useState(a),[$,j]=useSearchParams(),et=$.getAll("accounts"),[tt,rt]=reactExports.useState(et.length===0),[nt,it]=reactExports.useState(a.filter(at=>et.includes(at.address.pkh))),st=lodashExports.differenceBy(a,nt,at=>at.address.pkh),ot=nt.length===a.length;return reactExports.useEffect(()=>{j(at=>({...at,accounts:nt.map(ut=>ut.address.pkh)}))},[nt,j]),{selectedAccounts:tt?_:nt,accountsFilter:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(Box,{alignSelf:"flex-start",children:jsxRuntimeExports.jsxs(Menu,{children:[jsxRuntimeExports.jsx(MenuButton,{as:Button,maxHeight:"26px",paddingLeft:0,fontWeight:"normal",_hover:{bg:"none"},_active:{bg:"none"},"data-testid":"account-filter",isDisabled:ot,marginY:"16px",rightIcon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),variant:"ghost",children:"Filter by Account"}),jsxRuntimeExports.jsx(AccountListDisplay,{accounts:st,onSelect:at=>{rt(!1),it(ut=>[...ut,at])}})]})}),jsxRuntimeExports.jsx(Wrap,{width:"100%",children:nt.map(at=>jsxRuntimeExports.jsx(AddressPill,{address:at.address,"data-testid":"account-pill",mode:{type:"removable",onRemove:()=>{rt(nt.length===1),it(ut=>ut.filter(ht=>ht.address.pkh!==at.address.pkh))}}},at.address.pkh))})]})}},NFTsView=()=>{const a=useAllNfts(),{accountsFilter:_,selectedAccounts:$}=useAccountsFilter(),[j,et]=reactExports.useState(void 0);reactExports.useEffect(()=>{const it=st=>{st.key==="Escape"&&et(void 0)};return document.addEventListener("keydown",it),()=>document.removeEventListener("keydown",it)},[]);const tt=lodashExports.pick(a,$.map(it=>it.address.pkh)),rt=lodashExports.sumBy(Object.values(tt).flat(),it=>Number((it==null?void 0:it.balance)||0)),nt=lodashExports.every(tt,it=>!it||it.length===0);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{subtitle:`(${rt})`,title:"NFTs"}),_,nt?jsxRuntimeExports.jsx(NoNFTs,{size:"lg"}):jsxRuntimeExports.jsxs(SelectedNFTContext.Provider,{value:{setSelectedNFT:et,selectedNFT:j},children:[jsxRuntimeExports.jsx(Box,{overflowY:"scroll",children:jsxRuntimeExports.jsx(NFTGallery,{nftsByOwner:tt})}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:!!j,onClose:()=>et(void 0),placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsx(ModalBody,{children:j&&jsxRuntimeExports.jsx(NFTDrawerBody,{nft:j,onCloseDrawer:()=>et(void 0)})})})]})]})]})},OperationsView=()=>{const{accountsFilter:a,selectedAccounts:_}=useAccountsFilter(),{operations:$,loadMore:j,hasMore:et,isLoading:tt,isFirstLoad:rt}=useGetOperations(_),nt=reactExports.useRef(!1),it=st=>{if(nt.current||!et||tt)return;const ot=st.target;if(ot.scrollHeight-ot.scrollTop-ot.clientHeight<100)return nt.current=!0,j().finally(()=>{nt.current=!1})};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Operations"}),a,jsxRuntimeExports.jsx(Center,{display:tt&&rt?"flex":"none",height:"100%",children:jsxRuntimeExports.jsx(Image$1,{width:"150px",height:"75px",marginBottom:"136px",src:"./static/media/loading-wheel.gif"})}),$.length===0&&!tt&&jsxRuntimeExports.jsx(NoOperations,{size:"lg"}),$.length>0&&jsxRuntimeExports.jsxs(Box,{overflowY:"scroll",marginBottom:"20px",background:colors.gray[900],borderRadius:"8px",onScroll:it,paddingX:"20px",children:[jsxRuntimeExports.jsx(OperationTileContext.Provider,{value:{mode:"page"},children:$.map((st,ot)=>{const at=ot===$.length-1;return jsxRuntimeExports.jsxs(Box,{height:"90px",marginBottom:at?"10px":0,paddingY:"20px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:st}),!at&&jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Divider,{marginTop:"20px"})})]},st.id)})}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",display:tt&&!rt?"flex":"none",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Image$1,{width:"100px",height:"50px",src:"./static/media/loading-dots.gif"})]})]})]})},DrawerTopButtons=({onClose:a,..._})=>jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",paddingBottom:"30px",cursor:"pointer",..._,children:jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:a})}),BeaconPeers=()=>{const{data:a}=usePeers(),_=useRemovePeer(),[$,j]=reactExports.useState([]);return reactExports.useEffect(()=>{const et=(a||[]).map(async tt=>({...tt,senderId:tt.senderId||await getSenderId(tt.publicKey)}));Promise.all(et).then(j).catch(lodashExports.noop)},[a]),$.length===0?jsxRuntimeExports.jsxs(Box,{"data-testid":"beacon-peers-empty",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Text,{marginTop:"31px",color:colors.gray[400],size:"lg",children:"Your dApps will appear here"})]}):jsxRuntimeExports.jsx(PeersDisplay,{"data-testid":"beacon-peers",peerInfos:$,removePeer:_})},PeersDisplay=({peerInfos:a,removePeer:_})=>jsxRuntimeExports.jsx(Box,{children:a.map($=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(PeerRow,{onRemove:()=>_($),peerInfo:$})]},$.senderId))}),PeerRow=({peerInfo:a,onRemove:_})=>jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",height:"106px","data-testid":"peer-row",paddingY:"30px",children:[jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AspectRatio,{width:"48px",marginRight:"16px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{width:"100%",src:a.icon})}),jsxRuntimeExports.jsxs(Center,{alignItems:"flex-start",flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"6px",size:"md",children:a.name}),jsxRuntimeExports.jsx(StoredPeerInfo,{peerInfo:a})]})]}),jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(IconButton,{"aria-label":"Remove Peer",icon:jsxRuntimeExports.jsx(TrashIcon,{}),onClick:_,size:"xs",variant:"circle"})})]}),StoredPeerInfo=({peerInfo:a})=>{const _=useGetConnectionInfo(a.senderId);return _?jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"10px",address:parsePkh(_.accountPkh)}),jsxRuntimeExports.jsx(Divider,{marginRight:"10px",orientation:"vertical"}),jsxRuntimeExports.jsx(Text,{marginTop:"2px",marginRight:"4px",color:colors.gray[450],fontWeight:650,size:"sm",children:"Network:"}),jsxRuntimeExports.jsx(Text,{marginTop:"2px",color:colors.white,"data-testid":"dapp-connection-network",size:"sm",children:lodashExports.capitalize(_.networkType)})]}):null},DAppsDrawerCard=()=>{const{isOpen:a,onClose:_,onOpen:$}=useDisclosure$1(),j=useAddPeer();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"dApps",isSelected:a,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:a,onClose:_,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"drawer-body",children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:_}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"96px",children:jsxRuntimeExports.jsx(Heading,{children:"dApps"})}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.readText().then(et=>j(et)),children:"Connect with Pairing Request"}),jsxRuntimeExports.jsx(Text,{marginTop:"16px",marginBottom:"32px",color:colors.gray[400],children:"or open a deeplink from inside the dApp..."}),jsxRuntimeExports.jsx(BeaconPeers,{})]})]})})]})]})},ErrorLogsDrawerCard=()=>{const{isOpen:a,onClose:_,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Error Logs",isSelected:a,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:a,onClose:_,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:_}),jsxRuntimeExports.jsx(ErrorLogsDrawerBody,{})]})})]})]})},ErrorLogsDrawerBody=()=>{const a=[...useAppSelector(j=>j.errors)].reverse(),_=useDispatch(),$=()=>{_(errorsSlice.actions.reset())};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",height:"50px",marginBottom:"20px",children:[jsxRuntimeExports.jsx(Heading,{size:"xl",children:"Error Logs"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx("a",{download:"UmamiErrorLogs.json",href:`data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(a))}`,children:jsxRuntimeExports.jsx(Button,{variant:"tertiary",children:"Download error logs"})}),jsxRuntimeExports.jsx(Button,{marginLeft:"8px",onClick:$,variant:"warning",children:"Clear All"})]})]}),a.map(j=>jsxRuntimeExports.jsx(ErrorLogRow,{errorLog:j},nanoid()))]})},ErrorLogRow=({errorLog:a})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{marginY:1}),jsxRuntimeExports.jsx(Flex,{justifyContent:"space-between",paddingY:"12px",children:jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(OutlineExclamationCircleIcon,{marginTop:"1px",marginRight:"8px"}),jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{wordBreak:"break-all",size:"sm",children:a.description}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:a.timestamp})]})]})})]}),removeTrailingSlashes=a=>a.replace(/\/+$/g,""),UpsertNetworkModal=({network:a})=>{const _=a?"edit":"create",{onClose:$}=reactExports.useContext(DynamicModalContext),j=useDispatch(),et=useAvailableNetworks(),{formState:{errors:tt,isValid:rt},register:nt,handleSubmit:it}=useForm({mode:"onBlur",defaultValues:a}),st=ot=>{j(networksActions.upsertNetwork(ot)),$()};return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:it(st),children:[jsxRuntimeExports.jsxs(ModalHeader,{textAlign:"center",children:[_==="edit"?"Edit":"Add"," Network",jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[_==="create"&&jsxRuntimeExports.jsxs(FormControl,{marginTop:"32px",marginBottom:"24px",isInvalid:!!tt.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Name"}),jsxRuntimeExports.jsx(Input,{placeholder:"mainnet",...nt("name",{required:"Name is required",validate:ot=>{if(et.find(at=>at.name===ot))return"Network with this name already exists"}})}),tt.name&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.name.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.rpcUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"RPC URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://prod.tcinfra.net/rpc/mainnet",...nt("rpcUrl",{required:"RPC URL is required",setValueAs:removeTrailingSlashes})}),tt.rpcUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.rpcUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.tzktApiUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Tzkt API URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://api.ghostnet.tzkt.io",...nt("tzktApiUrl",{required:"Tzkt API URL is required",setValueAs:removeTrailingSlashes})}),tt.tzktApiUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.tzktApiUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.tzktExplorerUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Tzkt Explorer URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://ghostnet.tzkt.io",...nt("tzktExplorerUrl",{required:"Tzkt Explorer URL is required",setValueAs:removeTrailingSlashes})}),tt.tzktExplorerUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.tzktExplorerUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Buy Tez URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://faucet.ghostnet.teztnets.com",...nt("buyTezUrl")})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!rt,onClick:()=>{},type:"submit",children:_==="edit"?"Save changes":"Add network"})})]})]})})},NetworkSettingsDrawerBody=()=>{const{openWith:a}=reactExports.useContext(DynamicModalContext),_=useSelectedNetwork(),$=useSelectNetwork(),j=useAvailableNetworks(),et=useAppDispatch(),tt=rt=>{et(networksActions.removeNetwork(rt))};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",children:[jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{children:"Network Settings"}),jsxRuntimeExports.jsxs(Button,{paddingRight:"0",onClick:()=>a(jsxRuntimeExports.jsx(UpsertNetworkModal,{})),variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{size:"sm",children:"Add Network"}),jsxRuntimeExports.jsx(PlusIcon,{width:"18px",height:"18px",marginLeft:"4px",stroke:"currentcolor"})]})]}),jsxRuntimeExports.jsx(RadioGroup,{marginTop:"60px",onChange:$,value:_.name,children:jsxRuntimeExports.jsx(Stack,{children:j.map(rt=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{borderColor:colors.gray[700]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between","data-testid":`network-${rt.name}`,children:[jsxRuntimeExports.jsx(Radio,{height:"100px",value:rt.name,variant:"primary",children:jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",marginLeft:"16px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"4px",size:"sm",children:rt.name}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],children:rt.rpcUrl})]})}),!isDefault(rt)&&jsxRuntimeExports.jsx(Center,{"data-testid":"popover-menu",children:jsxRuntimeExports.jsxs(PopoverMenu,{children:[jsxRuntimeExports.jsxs(Button,{onClick:()=>a(jsxRuntimeExports.jsx(UpsertNetworkModal,{network:rt})),variant:"popover",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Edit"}),jsxRuntimeExports.jsx(PenIcon,{stroke:"inherit"})]}),jsxRuntimeExports.jsx(Divider,{marginTop:"4px"}),jsxRuntimeExports.jsxs(Button,{onClick:()=>tt(rt),variant:"popover",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Remove"}),jsxRuntimeExports.jsx(TrashIcon,{stroke:"inherit"})]})]})})]})]},rt.name))})})]})},NetworkSettingsDrawerCard=()=>{const{isOpen:a,onClose:_,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Network Settings",isSelected:a,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:a,onClose:_,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:_}),jsxRuntimeExports.jsx(NetworkSettingsDrawerBody,{})]})})]})]})},ChangePasswordForm=()=>{const{onClose:a}=reactExports.useContext(DynamicModalContext),_=useForm({mode:"onBlur"}),$=useToast(),j=useAppDispatch(),{handleAsyncAction:et,isLoading:tt}=useAsyncActionHandler(),{handleSubmit:rt,formState:{isValid:nt,errors:it},getValues:st}=_,ot=async({currentPassword:at,newPassword:ut,newPasswordConfirmation:ht})=>{if(!(at===ut||ut!==ht))return et(async()=>{await j(changeMnemonicPassword({currentPassword:at,newPassword:ut})).unwrap(),$({description:"Password updated",status:"success"}),a()})};return jsxRuntimeExports.jsx(FormProvider,{..._,children:jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[700],"data-testid":"change-password-modal",children:jsxRuntimeExports.jsxs("form",{onSubmit:rt(ot),children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalHeader,{textAlign:"center",children:jsxRuntimeExports.jsx(Heading,{children:"Change Password"})}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{marginTop:"32px",isInvalid:!!it.currentPassword,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"current-password",inputName:"currentPassword",label:"Current Password",placeholder:"Enter your current password",required:"Current password is required"}),it.currentPassword&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"current-password-error",children:it.currentPassword.message})]}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!it.newPassword,marginY:6,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"new-password",inputName:"newPassword",label:"New Password",placeholder:"Enter new password",required:"New password is required",validate:at=>st("currentPassword")!==at||"Cannot be the same as old password"}),it.newPassword&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"new-password-error",children:it.newPassword.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:3,isInvalid:!!it.newPasswordConfirmation,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"new-password-confirmation",inputName:"newPasswordConfirmation",label:"Confirm New Password",placeholder:"Confirm new password",required:"Confirmation is required",validate:at=>st("newPassword")===at||"Your new passwords do no match"}),it.newPasswordConfirmation&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"new-password-confirmation-error",children:it.newPasswordConfirmation.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!nt,isLoading:tt,size:"lg",type:"submit",children:"Update Password"})})]})})})},SettingsView=()=>jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Settings"}),jsxRuntimeExports.jsxs(Box,{overflowY:"scroll",children:[jsxRuntimeExports.jsx(Box,{marginTop:"16px",children:jsxRuntimeExports.jsx(GeneralSection,{})}),jsxRuntimeExports.jsx(BackupSection,{}),jsxRuntimeExports.jsx(AdvancedSection,{})]})]}),GeneralSection=()=>jsxRuntimeExports.jsxs(SectionContainer,{title:"General",children:[jsxRuntimeExports.jsx(NetworkSettingsDrawerCard,{}),jsxRuntimeExports.jsx(ErrorLogsDrawerCard,{})]}),BackupSection=()=>jsxRuntimeExports.jsx(SectionContainer,{title:"Backup",children:jsxRuntimeExports.jsx(ClickableCard,{isSelected:!1,onClick:downloadBackupFile,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:"Download backup file"}),jsxRuntimeExports.jsx(Button,{onClick:downloadBackupFile,variant:"unstyled",children:jsxRuntimeExports.jsx(DownloadIcon,{cursor:"pointer"})})]})})}),AdvancedSection=()=>{const{modalElement:a,onOpen:_}=useOffboardingModal(),{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(SectionContainer,{title:"Advanced Settings",children:[jsxRuntimeExports.jsx(DAppsDrawerCard,{}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Off-board Wallet",isSelected:!1,onClick:_}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Change Password",isSelected:!1,onClick:()=>$(jsxRuntimeExports.jsx(ChangePasswordForm,{}))}),a]})},SectionContainer=({title:a,children:_})=>jsxRuntimeExports.jsx(Box,{marginTop:"8px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(Box,{width:"550px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"16px",size:"lg",children:a}),_]})})}),TokenTile=({token:a,amount:_,...$})=>{const{contract:j}=a,et=tokenPrettyAmount(_,a),tt=tokenSymbolSafe(a);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"start",width:"400px",padding:"15px",background:colors.gray[800],borderRadius:"4px","data-testid":"token-tile",...$,children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",marginRight:"12px",ratio:1,children:jsxRuntimeExports.jsx(TokenIcon,{padding:"6.25px",background:colors.gray[500],borderRadius:"4px",contract:j})})}),jsxRuntimeExports.jsx(PrettyNumber,{number:et}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:tt})]})},SignPage=a=>{const{mode:_,operations:$,fee:j,data:{token:et}}=a,{fee:tt,operations:rt,estimationFailed:nt,isLoading:it,form:st,signer:ot,reEstimate:at,onSign:ut}=useSignPageHelpers(j,$,_),{amount:ht,recipient:yt}=rt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...st,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,operationsType:rt.type,signer:rt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(TokenTile,{amount:ht,token:et}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(SignPageFee,{fee:tt})})}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:rt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:yt}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:it,operationType:rt.type,reEstimate:at,sender:rt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:nt,isLoading:it,onSubmit:ut,signer:ot,text:headerText(rt.type,_)})})]})})})},FormPage=a=>{const{token:_}=a,$=useOpenSignPageFormAction({SignPage,signPageExtraData:{token:_},FormPage,defaultFormPageProps:a,toOperation:toOperation(_)}),j=useAddToBatchFormAction(toOperation(_)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(a)}),{formState:{isValid:it,errors:st},register:ot,handleSubmit:at}=nt,ut=tokenDecimals(_),ht=formatTokenAmount(_.balance,ut),yt=getSmallestUnit(Number(ut));return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(FormPageHeader,{}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!st.prettyAmount,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Amount"}),jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{isDisabled:rt,step:yt,type:"number",...ot("prettyAmount",{required:"Amount is required",max:{value:ht.toString(),message:`Max amount is ${ht}`},validate:makeValidateDecimals(Number(ut))}),placeholder:yt}),jsxRuntimeExports.jsx(InputRightElement,{paddingRight:"12px","data-testid":"token-symbol",children:tokenSymbolSafe(_)})]}),st.prettyAmount&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"amount-error",children:st.prettyAmount.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),st.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:st.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),st.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:st.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:at(tt),onSingleSubmit:at(et)})})]})})})},toOperation=a=>_=>{const $={type:"fa2",sender:parsePkh(_.sender),recipient:parsePkh(_.recipient),contract:parseContractPkh(a.contract),tokenId:a.tokenId,amount:getRealAmount(a,_.prettyAmount)};return a.type==="fa2"?$:{...$,type:"fa1.2",tokenId:"0"}},Header=({account:a})=>{const{address:_,label:$}=a,j=useAddressKind$1(_);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"78px",background:accountIconGradient({left:"-10px",top:"-10px",account:a,radius:"100px",mainBackgroundColor:colors.gray[800]}),borderTopRadius:"8px","data-testid":"header",paddingX:"30px",children:[jsxRuntimeExports.jsx(AddressTileIcon,{addressKind:j,identiconSize:35,size:"lg"}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsxs(Box,{marginLeft:"16px","data-testid":"account-identifier",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"4px",size:"md",children:$}),jsxRuntimeExports.jsx(Text,{color:colors.gray[300],size:"sm",children:formatPkh(_.pkh)})]}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column-reverse",children:jsxRuntimeExports.jsx(AccountBalance,{verticalAlign:"bottom",address:a.address.pkh})})]})]})},AccountTokens=({account:a,tokens:_})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(Card,{overflowX:"auto",marginBottom:"16px",borderBottomRadius:"8px",backgroundColor:colors.gray[900],children:[jsxRuntimeExports.jsx(Header,{account:a}),jsxRuntimeExports.jsx(TableContainer,{paddingX:"30px",children:jsxRuntimeExports.jsx(Table,{children:jsxRuntimeExports.jsx(Tbody,{children:_.map((j,et)=>{const tt=et===_.length-1?"transparent":colors.gray[700];return jsxRuntimeExports.jsxs(Tr,{"data-testid":"token-tile",children:[jsxRuntimeExports.jsx(Td,{width:"20%",minWidth:"240px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(TokenIcon,{display:"inline-block",width:"38px",contract:j.contract}),jsxRuntimeExports.jsx(Heading,{display:"inline-block",marginLeft:"16px",size:"sm",children:jsxRuntimeExports.jsx(TokenNameWithIcon,{token:j})})]})}),jsxRuntimeExports.jsx(Td,{width:"20%",minWidth:"200px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(AddressPill,{address:parseContractPkh(j.contract)})}),jsxRuntimeExports.jsx(Td,{width:"15%",minWidth:"160px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(Heading,{size:"sm",children:tokenPrettyAmount(j.balance,j,{showSymbol:!1})})}),jsxRuntimeExports.jsx(Td,{textAlign:"right",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(SendButton,{onClick:()=>$(jsxRuntimeExports.jsx(FormPage,{sender:a,token:j}))})})]},fullId(j))})})})})]})},TokensPage=()=>{const{accountsFilter:a,selectedAccounts:_}=useAccountsFilter(),$=useGetAccountAllTokens(),j=_.map(et=>[et,$(et.address.pkh)]).filter(([,et])=>et.length>0);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Tokens"}),a,j.length===0?jsxRuntimeExports.jsx(NoTokens,{size:"lg"}):jsxRuntimeExports.jsx(Box,{overflowY:"auto",children:j.map(([et,tt])=>jsxRuntimeExports.jsx(AccountTokens,{account:et,tokens:tt},et.address.pkh))})]})},AppVersion=({isCollapsed:a,..._})=>{const $=a?packageInfo.version:`Umami v${packageInfo.version}`;return jsxRuntimeExports.jsx(Text,{color:colors.gray[450],..._,children:$})},CollapseMenuButton=({toggle:a,..._})=>jsxRuntimeExports.jsx(Center,{width:"44px",height:"44px",marginRight:"-14px",borderRadius:"4px",_hover:{background:colors.gray[800]},cursor:"pointer","data-testid":"collapse-menu-button",onClick:a,..._,children:jsxRuntimeExports.jsx(BurgerMenuIcon,{})}),useCollapseMenu=()=>{const[a,_]=reactExports.useState(!1),$=reactExports.useCallback(()=>{_(j=>!j)},[]);return{isCollapsed:a,toggle:$}},ORANGE="#F74F18",MakiLogo=a=>{const _=useSelectedNetwork();return jsxRuntimeExports.jsx(MakiIcon,{background:"white",borderRadius:"8px","data-testid":"maki-logo",fishColor:_.name==="mainnet"?ORANGE:"black",...a})},NetworkSelector=()=>{const a=useSelectedNetwork(),_=useAvailableNetworks(),$=useSelectNetwork(),{onOpen:j,onClose:et,isOpen:tt}=useDisclosure$1();return jsxRuntimeExports.jsxs(Popover,{isOpen:tt,onClose:et,onOpen:j,placement:"bottom-end",children:[jsxRuntimeExports.jsx(PopoverTrigger,{children:jsxRuntimeExports.jsxs(Button,{marginTop:"4px",color:colors.green,"data-testid":"network-selector",variant:"unstyled",children:[lodashExports.capitalize(a.name),tt?jsxRuntimeExports.jsx(ChevronUpIcon,{marginTop:"-2px",stroke:"currentcolor"}):jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginTop:"-2px",stroke:"currentcolor"})]})}),jsxRuntimeExports.jsx(PopoverContent,{width:"100px",marginTop:"-10px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],children:jsxRuntimeExports.jsx(PopoverBody,{padding:"4px 12px",children:jsxRuntimeExports.jsx(Flex,{flexDirection:"column",children:_.map((rt,nt)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{height:"34px",color:rt.name===a.name?colors.green:colors.gray[300],fontSize:"14px",fontWeight:400,textAlign:"right",_hover:{color:colors.greenL},onClick:()=>{$(rt.name),et()},variant:"unstyled",children:lodashExports.capitalize(rt.name)}),nt<_.length-1&&jsxRuntimeExports.jsx(Divider,{})]},rt.name))})})})]})},UpdateAppButton=()=>{const[a,_]=reactExports.useState(!1),$=window;reactExports.useEffect(()=>{$&&$.electronAPI&&$.electronAPI.onAppUpdateDownloaded(et=>_(!0))},[$]);const j=()=>{$&&$.electronAPI&&$.electronAPI.installAppUpdateAndQuit()};return a?jsxRuntimeExports.jsx(Box,{marginTop:"24px",marginBottom:"6px",children:jsxRuntimeExports.jsxs(Button,{justifyContent:"flex-start",width:"100%",height:"32px",paddingTop:"7px",paddingRight:"8px",paddingBottom:"7px",paddingLeft:"8px",color:colors.black,background:colors.green,_hover:{color:colors.black,background:colors.greenL},onClick:j,children:[jsxRuntimeExports.jsx(FlipForwardEnergy,{}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:"Update Umami"})]})}):null},SideNavbar=()=>{const{isCollapsed:a,toggle:_}=useCollapseMenu(),$=jsxRuntimeExports.jsx(CollapseMenuButton,{marginTop:a?0:"2px",marginRight:a?0:"-14px",toggle:_});return jsxRuntimeExports.jsxs(Flex,{alignItems:a?"center":"normal",flexDirection:"column",width:a?"80px":"236px",padding:a?"30px 20px":"30px",background:colors.gray[900],"data-testid":`side-navbar${a?"-collapsed":""}`,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"30px",children:a?$:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(MakiLogo,{width:"38px",height:"38px"}),jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(NetworkSelector,{}),$]})]})}),jsxRuntimeExports.jsx(Divider,{marginTop:"28px"})]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",flexDirection:"column",flex:1,children:[jsxRuntimeExports.jsxs(Box,{alignItems:a?"center":"normal",justifyContent:a?"space-around":"normal",display:a?"flex":"block",height:"100%",children:[!a&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(UpdateAppButton,{}),jsxRuntimeExports.jsx(TotalBalance,{})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(AccountsIcon,{}),isCollapsed:a,label:"Accounts",to:"/home"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(DiamondIcon,{}),isCollapsed:a,label:"NFTs",to:"/nfts"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(RefreshClockIcon,{width:"24px",height:"24px"}),isCollapsed:a,label:"Operations",to:"/operations"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(CoinIcon,{}),isCollapsed:a,label:"Tokens",to:"/tokens"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(BatchIcon,{}),isCollapsed:a,label:"Batch",to:"/batch"})]})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(MenuItem,{marginTop:"22px",icon:jsxRuntimeExports.jsx(AddressBookIcon,{}),isCollapsed:a,label:"Address Book",to:"/address-book"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(GearIcon,{}),isCollapsed:a,label:"Settings",to:"/settings"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(HelpIcon,{}),isCollapsed:a,label:"Help",to:"/help"}),jsxRuntimeExports.jsx(AppVersion,{marginTop:"24px",fontSize:"14px",textAlign:a?"center":"left",isCollapsed:a})]})]})]})},MenuItem=({icon:a,label:_,to:$,isCollapsed:j,...et})=>{const rt=useLocation().pathname.startsWith($);return jsxRuntimeExports.jsx(Link,{to:$,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"flex-start",width:j?"44px":"176px",marginBottom:"8px",padding:"10px",background:rt?colors.gray[600]:"transparent",borderRadius:"4px",_hover:{background:rt?colors.gray[600]:colors.gray[800]},cursor:"pointer",...et,children:[a,!j&&jsxRuntimeExports.jsx(Text,{marginLeft:"10px",size:"sm",children:_})]})})},TotalBalance=()=>{const a=useTotalBalance(),[_]=useMediaQuery("(max-height: 900px)");return jsxRuntimeExports.jsxs(Box,{marginTop:"24px",marginBottom:_?"30px":"100px","data-testid":"total-balance",children:[jsxRuntimeExports.jsx(Text,{marginBottom:"4px",size:"sm",children:"Balance"}),a&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:a.mutez,dollarBalance:a.usd})]})},withSideMenu=a=>jsxRuntimeExports.jsxs(Flex,{height:"100vh",children:[jsxRuntimeExports.jsx(SideNavbar,{}),jsxRuntimeExports.jsx(Box,{flex:1,overflowX:"hidden",height:"100%",background:"linear-gradient(180deg, rgba(0, 231, 182, 0.35) -41.53%, rgba(0, 231, 182, 0.00) 34.71%)",paddingX:"24px",children:a})]}),AccountsImage=""+new URL("accounts-DTYOez9Q.png",import.meta.url).href,BatchImage=""+new URL("batch-CoYFN9ox.png",import.meta.url).href,MultisigImage=""+new URL("multisig-GRRIvmJS.png",import.meta.url).href;var js={},Carousel$1={},lib={},reactSwipe={},hasRequiredReactSwipe;function requireReactSwipe(){return hasRequiredReactSwipe||(hasRequiredReactSwipe=1,function(a){(function(_,$){$(a,reactExports,propTypesExports)})(commonjsGlobal,function(_,$,j){Object.defineProperty(_,"__esModule",{value:!0}),_.setHasSupportToCaptureOption=yt;var et=rt($),tt=rt(j);function rt($t){return $t&&$t.__esModule?$t:{default:$t}}var nt=Object.assign||function($t){for(var Mt=1;Mt=0||Object.prototype.hasOwnProperty.call($t,Dt)&&(Bt[Dt]=$t[Dt]);return Bt}function st($t,Mt){if(!($t instanceof Mt))throw new TypeError("Cannot call a class as a function")}var ot=function(){function $t(Mt,Bt){for(var Dt=0;Dt0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return ht?$t:$t.capture}function Ct($t){if("touches"in $t){var Mt=$t.touches[0],Bt=Mt.pageX,Dt=Mt.pageY;return{x:Bt,y:Dt}}var zt=$t.screenX,Ot=$t.screenY;return{x:zt,y:Ot}}var Pt=function($t){ut(Mt,$t);function Mt(){var Bt;st(this,Mt);for(var Dt=arguments.length,zt=Array(Dt),Ot=0;Otzt&&this.props.onSwipeRight(1,Dt),this.movePosition.deltaY<-zt?this.props.onSwipeUp(1,Dt):this.movePosition.deltaY>zt&&this.props.onSwipeDown(1,Dt)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(Dt){this.swiper=Dt,this.props.innerRef(Dt)}},{key:"render",value:function(){var Dt=this.props;Dt.tagName;var zt=Dt.className,Ot=Dt.style,It=Dt.children;Dt.allowMouseEvents,Dt.onSwipeUp,Dt.onSwipeDown,Dt.onSwipeLeft,Dt.onSwipeRight,Dt.onSwipeStart,Dt.onSwipeMove,Dt.onSwipeEnd,Dt.innerRef,Dt.tolerance;var Lt=it(Dt,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return et.default.createElement(this.props.tagName,nt({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:zt,style:Ot},Lt),It)}}]),Mt}($.Component);Pt.displayName="ReactSwipe",Pt.propTypes={tagName:tt.default.string,className:tt.default.string,style:tt.default.object,children:tt.default.node,allowMouseEvents:tt.default.bool,onSwipeUp:tt.default.func,onSwipeDown:tt.default.func,onSwipeLeft:tt.default.func,onSwipeRight:tt.default.func,onSwipeStart:tt.default.func,onSwipeMove:tt.default.func,onSwipeEnd:tt.default.func,innerRef:tt.default.func,tolerance:tt.default.number.isRequired},Pt.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},_.default=Pt})}(reactSwipe)),reactSwipe}(function(a){(function(_,$){$(a,requireReactSwipe())})(commonjsGlobal,function(_,$){Object.defineProperty(_,"__esModule",{value:!0});var j=et($);function et(tt){return tt&&tt.__esModule?tt:{default:tt}}_.default=j.default})})(lib);var cssClasses={},classnames={exports:{}};/*! +`}return fr.substring(0,fr.length-1)},dt.renderTo2dContext=function(Kt,Qt){Qt=Qt||2;for(var Ht=dt.getModuleCount(),qt=0;qt>>8),Ft.push(vt&255)):Ft.push(It)}}return Ft}};var et={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},tt={L:1,M:0,Q:3,H:2},rt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},nt=function(){var Dt=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],zt=1335,Ot=7973,It=21522,Lt={},Ft=function(jt){for(var bt=0;jt!=0;)bt+=1,jt>>>=1;return bt};return Lt.getBCHTypeInfo=function(jt){for(var bt=jt<<10;Ft(bt)-Ft(zt)>=0;)bt^=zt<=0;)bt^=Ot<5&&(vt+=3+mt-5)}for(var ct=0;ct=256;)Lt-=255;return Dt[Lt]},It}();function st(Dt,zt){if(typeof Dt.length>"u")throw Dt.length+"/"+zt;var Ot=function(){for(var Lt=0;Lt"u")throw"bad rs block @ typeNumber:"+Lt+"/errorCorrectionLevel:"+Ft;for(var bt=jt.length/3,vt=[],ct=0;ct>>7-It%8&1)==1},Ot.put=function(It,Lt){for(var Ft=0;Ft>>Lt-Ft-1&1)==1)},Ot.getLengthInBits=function(){return zt},Ot.putBit=function(It){var Lt=Math.floor(zt/8);Dt.length<=Lt&&Dt.push(0),It&&(Dt[Lt]|=128>>>zt%8),zt+=1},Ot},ut=function(Dt){var zt=et.MODE_NUMBER,Ot=Dt,It={};It.getMode=function(){return zt},It.getLength=function(jt){return Ot.length},It.write=function(jt){for(var bt=Ot,vt=0;vt+2>>8&255)*192+(vt&255),Ft.put(vt,13),bt+=2}if(bt>>8)},zt.writeBytes=function(Ot,It,Lt){It=It||0,Lt=Lt||Ot.length;for(var Ft=0;Ft0&&(Ot+=","),Ot+=Dt[It];return Ot+="]",Ot},zt},Pt=function(){var Dt=0,zt=0,Ot=0,It="",Lt={},Ft=function(bt){It+=String.fromCharCode(jt(bt&63))},jt=function(bt){if(!(bt<0)){if(bt<26)return 65+bt;if(bt<52)return 97+(bt-26);if(bt<62)return 48+(bt-52);if(bt==62)return 43;if(bt==63)return 47}throw"n:"+bt};return Lt.writeByte=function(bt){for(Dt=Dt<<8|bt&255,zt+=8,Ot+=1;zt>=6;)Ft(Dt>>>zt-6),zt-=6},Lt.flush=function(){if(zt>0&&(Ft(Dt<<6-zt),Dt=0,zt=0),Ot%3!=0)for(var bt=3-Ot%3,vt=0;vt=zt.length){if(Lt==0)return-1;throw"unexpected end of file./"+Lt}var bt=zt.charAt(Ot);if(Ot+=1,bt=="=")return Lt=0,-1;if(bt.match(/^\s$/))continue;It=It<<6|jt(bt.charCodeAt(0)),Lt+=6}var vt=It>>>Lt-8&255;return Lt-=8,vt};var jt=function(bt){if(65<=bt&&bt<=90)return bt-65;if(97<=bt&&bt<=122)return bt-97+26;if(48<=bt&&bt<=57)return bt-48+52;if(bt==43)return 62;if(bt==47)return 63;throw"c:"+bt};return Ft},Mt=function(Dt,zt){var Ot=Dt,It=zt,Lt=new Array(Dt*zt),Ft={};Ft.setPixel=function(ct,dt,mt){Lt[dt*Ot+ct]=mt},Ft.write=function(ct){ct.writeString("GIF87a"),ct.writeShort(Ot),ct.writeShort(It),ct.writeByte(128),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(255),ct.writeByte(255),ct.writeByte(255),ct.writeString(","),ct.writeShort(0),ct.writeShort(0),ct.writeShort(Ot),ct.writeShort(It),ct.writeByte(0);var dt=2,mt=bt(dt);ct.writeByte(dt);for(var xt=0;mt.length-xt>255;)ct.writeByte(255),ct.writeBytes(mt,xt,255),xt+=255;ct.writeByte(mt.length-xt),ct.writeBytes(mt,xt,mt.length-xt),ct.writeByte(0),ct.writeString(";")};var jt=function(ct){var dt=ct,mt=0,xt=0,At={};return At.write=function(Rt,St){if(Rt>>>St)throw"length over";for(;mt+St>=8;)dt.writeByte(255&(Rt<>>=8-mt,xt=0,mt=0;xt=Rt<0&&dt.writeByte(xt)},At},bt=function(ct){for(var dt=1<>6,128|it&63):it<55296||it>=57344?rt.push(224|it>>12,128|it>>6&63,128|it&63):(nt++,it=65536+((it&1023)<<10|tt.charCodeAt(nt)&1023),rt.push(240|it>>18,128|it>>12&63,128|it>>6&63,128|it&63))}return rt}return et(j)}})(),function(j){a.exports=j()}(function(){return $})})(qrcode);var qrcodeExports=qrcode.exports,__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var a=function(_,$){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,et){j.__proto__=et}||function(j,et){for(var tt in et)et.hasOwnProperty(tt)&&(j[tt]=et[tt])},a(_,$)};return function(_,$){a(_,$);function j(){this.constructor=_}_.prototype=$===null?Object.create($):(j.prototype=$.prototype,new j)}}();Object.defineProperty(dist,"__esModule",{value:!0});var QRCode_1=dist.QRCode=void 0,isEqual$1=lodash_isequalExports,qrGenerator=qrcodeExports,React=reactExports,ReactDOM=reactDomExports,QRCode=function(a){__extends(_,a);function _($){var j=a.call(this,$)||this;return j.canvas=React.createRef(),j}return _.utf16to8=function($){var j="",et,tt,rt=$.length;for(et=0;et=1&&tt<=127?j+=$.charAt(et):tt>2047?(j+=String.fromCharCode(224|tt>>12&15),j+=String.fromCharCode(128|tt>>6&63),j+=String.fromCharCode(128|tt>>0&63)):(j+=String.fromCharCode(192|tt>>6&31),j+=String.fromCharCode(128|tt>>0&63));return j},_.prototype.drawRoundedSquare=function($,j,et,tt,rt,nt,it,st){st.lineWidth=$,st.fillStyle=rt,st.strokeStyle=rt,et+=$/2,j+=$/2,tt-=$,Array.isArray(nt)||(nt=[nt,nt,nt,nt]),nt=nt.map(function(yt){return yt=Math.min(yt,tt/2),yt<0?0:yt});var ot=nt[0]||0,at=nt[1]||0,ut=nt[2]||0,ht=nt[3]||0;st.beginPath(),st.moveTo(j+ot,et),st.lineTo(j+tt-at,et),at&&st.quadraticCurveTo(j+tt,et,j+tt,et+at),st.lineTo(j+tt,et+tt-ut),ut&&st.quadraticCurveTo(j+tt,et+tt,j+tt-ut,et+tt),st.lineTo(j+ht,et+tt),ht&&st.quadraticCurveTo(j,et+tt,j,et+tt-ht),st.lineTo(j,et+ot),ot&&st.quadraticCurveTo(j,et,j+ot,et),st.closePath(),st.stroke(),it&&st.fill()},_.prototype.drawPositioningPattern=function($,j,et,tt,rt,nt,it){it===void 0&&(it=[0,0,0,0]);var st=Math.ceil(j),ot,at;typeof it!="number"&&!Array.isArray(it)?(ot=it.outer||0,at=it.inner||0):(ot=it,at=ot);var ut,ht;typeof nt!="string"?(ut=nt.outer,ht=nt.inner):(ut=nt,ht=nt);var yt=tt*j+et,wt=rt*j+et,Ct=j*7;this.drawRoundedSquare(st,wt,yt,Ct,ut,ot,!1,$),Ct=j*3,yt+=j*2,wt+=j*2,this.drawRoundedSquare(st,wt,yt,Ct,ht,at,!0,$)},_.prototype.isInPositioninZone=function($,j,et){return et.some(function(tt){return j>=tt.row&&j<=tt.row+7&&$>=tt.col&&$<=tt.col+7})},_.prototype.transformPixelLengthIntoNumberOfCells=function($,j){return $/j},_.prototype.isCoordinateInImage=function($,j,et,tt,rt,nt,it,st){if(st){var ot=2,at=this.transformPixelLengthIntoNumberOfCells(rt,it),ut=this.transformPixelLengthIntoNumberOfCells(nt,it),ht=this.transformPixelLengthIntoNumberOfCells(et,it)-1,yt=this.transformPixelLengthIntoNumberOfCells(tt,it)-1;return j>=at-ot&&j<=at+ht+ot&&$>=ut-ot&&$<=ut+yt+ot}else return!1},_.prototype.shouldComponentUpdate=function($){return!isEqual$1(this.props,$)},_.prototype.componentDidMount=function(){this.update()},_.prototype.componentDidUpdate=function(){this.update()},_.prototype.update=function(){var $=this.props,j=$.value,et=$.ecLevel,tt=$.enableCORS,rt=$.bgColor,nt=$.fgColor,it=$.logoImage,st=$.logoOpacity,ot=$.logoOnLoad,at=$.removeQrCodeBehindLogo,ut=$.qrStyle,ht=$.eyeRadius,yt=$.eyeColor,wt=$.logoPaddingStyle,Ct=+this.props.size,Pt=+this.props.quietZone,$t=this.props.logoWidth?+this.props.logoWidth:0,Mt=this.props.logoHeight?+this.props.logoHeight:0,Bt=this.props.logoPadding?+this.props.logoPadding:0,Dt=qrGenerator(0,et);Dt.addData(_.utf16to8(j)),Dt.make();var zt=ReactDOM.findDOMNode(this.canvas.current),Ot=zt.getContext("2d"),It=Ct+2*Pt,Lt=Dt.getModuleCount(),Ft=Ct/Lt,jt=window.devicePixelRatio||1;zt.height=zt.width=It*jt,Ot.scale(jt,jt),Ot.fillStyle=rt,Ot.fillRect(0,0,It,It);var bt=Pt,vt=[{row:0,col:0},{row:0,col:Lt-7},{row:Lt-7,col:0}];if(Ot.strokeStyle=nt,ut==="dots"){Ot.fillStyle=nt;for(var ct=Ft/2,dt=0;dt0&&!Dt.isDark(dt-1,mt)&&mt>0&&!Dt.isDark(dt,mt-1)&&(xt[0]=!0),dt>0&&!Dt.isDark(dt-1,mt)&&mt0&&!Dt.isDark(dt,mt-1)&&(xt[3]=!0);var At=Math.ceil((mt+1)*Ft)-Math.floor(mt*Ft),Rt=Math.ceil((dt+1)*Ft)-Math.floor(dt*Ft);Ot.fillStyle=nt,Ot.beginPath(),Ot.arc(Math.round(mt*Ft)+ct+bt,Math.round(dt*Ft)+ct+bt,ct,0,2*Math.PI,!1),Ot.closePath(),Ot.fill(),xt[0]||Ot.fillRect(Math.round(mt*Ft)+bt,Math.round(dt*Ft)+bt,At/2,Rt/2),xt[1]||Ot.fillRect(Math.round(mt*Ft)+bt+Math.floor(At/2),Math.round(dt*Ft)+bt,At/2,Rt/2),xt[2]||Ot.fillRect(Math.round(mt*Ft)+bt+Math.floor(At/2),Math.round(dt*Ft)+bt+Math.floor(Rt/2),At/2,Rt/2),xt[3]||Ot.fillRect(Math.round(mt*Ft)+bt,Math.round(dt*Ft)+bt+Math.floor(Rt/2),At/2,Rt/2)}}else for(var dt=0;dt{const $=useGetOwnedAccountSafe()(a);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"You can receive tez or other digital assets by scanning or sharing this QR code",title:"Receive"}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",flexDirection:"column",children:jsxRuntimeExports.jsx(Box,{padding:"8px",background:"white",borderRadius:"8px",children:jsxRuntimeExports.jsx(QRCode_1,{size:232,value:a})})})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsxs(Box,{width:"100%",children:[$&&jsxRuntimeExports.jsx(Heading,{textAlign:"center",marginY:2,children:$.label}),jsxRuntimeExports.jsx(Flex,{justifyContent:"center",width:"100%",children:jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a),mode:{type:"no_icons"}})})]})})]})},AccountCard=({accountPkh:a})=>{const _=useGetOwnedAccount(),$=useGetAccountBalance(),j=useGetDollarBalance(),et=useGetAccountAllTokens(),tt=useGetAccountNFTs(),{openWith:rt}=reactExports.useContext(DynamicModalContext),nt=_(a),it=$(a),st=j(a),ot=et(a),at=sortedByLastUpdate(tt(a));return jsxRuntimeExports.jsx(AccountDrawerDisplay,{account:nt,balance:it,dollarBalance:st,nfts:at,onReceive:()=>rt(jsxRuntimeExports.jsx(ReceiveModal,{pkh:a})),onSend:()=>rt(jsxRuntimeExports.jsx(FormPage$4,{sender:nt})),tokens:ot})},InfoModal=({account:a})=>{const _=[{title:"Template",content:a.derivationPathTemplate},{title:"Path",content:a.derivationPath},{title:"Type (Curve)",content:a.curve}];return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(CircleIcon,{icon:jsxRuntimeExports.jsx(SlashIcon,{}),size:"48px"}),jsxRuntimeExports.jsx(Center,{marginBottom:"8px",children:jsxRuntimeExports.jsx(Heading,{marginTop:"16px",children:"Derivation Info"})}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsx(ModalBody,{children:_.map(({title:$,content:j})=>j?jsxRuntimeExports.jsxs(Box,{marginTop:"24px",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:$}),jsxRuntimeExports.jsx(Center,{justifyContent:"flex-start",marginTop:"12px",padding:"15px",borderRadius:"4px",backgroundColor:colors.gray[800],children:jsxRuntimeExports.jsx(Text,{size:"sm",children:j})})]},j):null)})]})},DerivationInfoButton=({account:a,..._})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);switch(a.type){case"multisig":case"secret_key":case"social":return null;case"ledger":case"mnemonic":return jsxRuntimeExports.jsx(Button,{"data-testid":"derivation-info-button",onClick:()=>$(jsxRuntimeExports.jsx(InfoModal,{account:a})),variant:"CTAWithIcon",..._,children:jsxRuntimeExports.jsx(FolderInfoIcon,{stroke:"currentcolor"})})}},CloseDrawerButton=({onClose:a})=>jsxRuntimeExports.jsx(Button,{minWidth:"24px",padding:"0",onClick:a,variant:"CTAWithIcon",children:jsxRuntimeExports.jsx(ExitArrowIcon,{stroke:"currentcolor"})}),scriptRel="modulepreload",assetsURL=function(a,_){return new URL(a,_).href},seen={},__vitePreload=function a(_,$,j){let et=Promise.resolve();if($&&$.length>0){const tt=document.getElementsByTagName("link"),rt=document.querySelector("meta[property=csp-nonce]"),nt=(rt==null?void 0:rt.nonce)||(rt==null?void 0:rt.getAttribute("nonce"));et=Promise.all($.map(it=>{if(it=assetsURL(it,j),it in seen)return;seen[it]=!0;const st=it.endsWith(".css"),ot=st?'[rel="stylesheet"]':"";if(!!j)for(let ht=tt.length-1;ht>=0;ht--){const yt=tt[ht];if(yt.href===it&&(!st||yt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${it}"]${ot}`))return;const ut=document.createElement("link");if(ut.rel=st?"stylesheet":scriptRel,st||(ut.as="script",ut.crossOrigin=""),ut.href=it,nt&&ut.setAttribute("nonce",nt),document.head.appendChild(ut),st)return new Promise((ht,yt)=>{ut.addEventListener("load",ht),ut.addEventListener("error",()=>yt(new Error(`Unable to preload CSS for ${it}`)))})}))}return et.then(()=>_()).catch(tt=>{const rt=new Event("vite:preloadError",{cancelable:!0});if(rt.payload=tt,window.dispatchEvent(rt),!rt.defaultPrevented)throw tt})};var loadScript=function a(_,$,j){var et=document.head||document.getElementsByTagName("head")[0],tt=document.createElement("script");typeof $=="function"&&(j=$,$={}),$=$||{},j=j||function(){},tt.type=$.type||"text/javascript",tt.charset=$.charset||"utf8",tt.async="async"in $?!!$.async:!0,tt.src=_,$.attrs&&setAttributes(tt,$.attrs),$.text&&(tt.text=""+$.text);var rt="onload"in tt?stdOnEnd:ieOnEnd;rt(tt,j),tt.onload||stdOnEnd(tt,j),et.appendChild(tt)};function setAttributes(a,_){for(var $ in _)a.setAttribute($,_[$])}function stdOnEnd(a,_){a.onload=function(){this.onerror=this.onload=null,_(null,a)},a.onerror=function(){this.onerror=this.onload=null,_(new Error("Failed to load "+this.src),a)}}function ieOnEnd(a,_){a.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,_(null,a))}}var isMergeableObject=function a(_){return isNonNullObject(_)&&!isSpecial(_)};function isNonNullObject(a){return!!a&&typeof a=="object"}function isSpecial(a){var _=Object.prototype.toString.call(a);return _==="[object RegExp]"||_==="[object Date]"||isReactElement(a)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(a){return a.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(a){return Array.isArray(a)?[]:{}}function cloneUnlessOtherwiseSpecified(a,_){return _.clone!==!1&&_.isMergeableObject(a)?deepmerge(emptyTarget(a),a,_):a}function defaultArrayMerge(a,_,$){return a.concat(_).map(function(j){return cloneUnlessOtherwiseSpecified(j,$)})}function getMergeFunction(a,_){if(!_.customMerge)return deepmerge;var $=_.customMerge(a);return typeof $=="function"?$:deepmerge}function getEnumerableOwnPropertySymbols(a){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(a).filter(function(_){return Object.propertyIsEnumerable.call(a,_)}):[]}function getKeys(a){return Object.keys(a).concat(getEnumerableOwnPropertySymbols(a))}function propertyIsOnObject(a,_){try{return _ in a}catch{return!1}}function propertyIsUnsafe(a,_){return propertyIsOnObject(a,_)&&!(Object.hasOwnProperty.call(a,_)&&Object.propertyIsEnumerable.call(a,_))}function mergeObject(a,_,$){var j={};return $.isMergeableObject(a)&&getKeys(a).forEach(function(et){j[et]=cloneUnlessOtherwiseSpecified(a[et],$)}),getKeys(_).forEach(function(et){propertyIsUnsafe(a,et)||(propertyIsOnObject(a,et)&&$.isMergeableObject(_[et])?j[et]=getMergeFunction(et,$)(a[et],_[et],$):j[et]=cloneUnlessOtherwiseSpecified(_[et],$))}),j}function deepmerge(a,_,$){$=$||{},$.arrayMerge=$.arrayMerge||defaultArrayMerge,$.isMergeableObject=$.isMergeableObject||isMergeableObject,$.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var j=Array.isArray(_),et=Array.isArray(a),tt=j===et;return tt?j?$.arrayMerge(a,_,$):mergeObject(a,_,$):cloneUnlessOtherwiseSpecified(_,$)}deepmerge.all=function a(_,$){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(j,et){return deepmerge(j,et,$)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1,__create$4=Object.create,__defProp$6=Object.defineProperty,__getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__getOwnPropNames$6=Object.getOwnPropertyNames,__getProtoOf$4=Object.getPrototypeOf,__hasOwnProp$6=Object.prototype.hasOwnProperty,__export$6=(a,_)=>{for(var $ in _)__defProp$6(a,$,{get:_[$],enumerable:!0})},__copyProps$6=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$6(_))!__hasOwnProp$6.call(a,et)&&et!==$&&__defProp$6(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$6(_,et))||j.enumerable});return a},__toESM$4=(a,_,$)=>($=a!=null?__create$4(__getProtoOf$4(a)):{},__copyProps$6(!a||!a.__esModule?__defProp$6($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS$6=a=>__copyProps$6(__defProp$6({},"__esModule",{value:!0}),a),utils_exports={};__export$6(utils_exports,{callPlayer:()=>callPlayer,getConfig:()=>getConfig,getSDK:()=>getSDK,isBlobUrl:()=>isBlobUrl,isMediaStream:()=>isMediaStream,lazy:()=>lazy,omit:()=>omit,parseEndTime:()=>parseEndTime,parseStartTime:()=>parseStartTime,queryString:()=>queryString,randomString:()=>randomString,supportsWebKitPresentationMode:()=>supportsWebKitPresentationMode});var utils$1=__toCommonJS$6(utils_exports),import_react$2=__toESM$4(reactExports),import_load_script=__toESM$4(loadScript),import_deepmerge$1=__toESM$4(cjs);const lazy=a=>import_react$2.default.lazy(async()=>{const _=await a();return typeof _.default=="function"?_:_.default}),MATCH_START_QUERY=/[?&#](?:start|t)=([0-9hms]+)/,MATCH_END_QUERY=/[?&#]end=([0-9hms]+)/,MATCH_START_STAMP=/(\d+)(h|m|s)/g,MATCH_NUMERIC=/^\d+$/;function parseTimeParam(a,_){if(a instanceof Array)return;const $=a.match(_);if($){const j=$[1];if(j.match(MATCH_START_STAMP))return parseTimeString(j);if(MATCH_NUMERIC.test(j))return parseInt(j)}}function parseTimeString(a){let _=0,$=MATCH_START_STAMP.exec(a);for(;$!==null;){const[,j,et]=$;et==="h"&&(_+=parseInt(j,10)*60*60),et==="m"&&(_+=parseInt(j,10)*60),et==="s"&&(_+=parseInt(j,10)),$=MATCH_START_STAMP.exec(a)}return _}function parseStartTime(a){return parseTimeParam(a,MATCH_START_QUERY)}function parseEndTime(a){return parseTimeParam(a,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(a){return Object.keys(a).map(_=>`${_}=${a[_]}`).join("&")}function getGlobal(a){return window[a]?window[a]:window.exports&&window.exports[a]?window.exports[a]:window.module&&window.module.exports&&window.module.exports[a]?window.module.exports[a]:null}const requests={},getSDK=function a(_,$,j=null,et=()=>!0,tt=import_load_script.default){const rt=getGlobal($);return rt&&et(rt)?Promise.resolve(rt):new Promise((nt,it)=>{if(requests[_]){requests[_].push({resolve:nt,reject:it});return}requests[_]=[{resolve:nt,reject:it}];const st=ot=>{requests[_].forEach(at=>at.resolve(ot))};if(j){const ot=window[j];window[j]=function(){ot&&ot(),st(getGlobal($))}}tt(_,ot=>{ot?(requests[_].forEach(at=>at.reject(ot)),requests[_]=null):j||st(getGlobal($))})})};function getConfig(a,_){return(0,import_deepmerge$1.default)(_.config,a.config)}function omit(a,..._){const $=[].concat(..._),j={},et=Object.keys(a);for(const tt of et)$.indexOf(tt)===-1&&(j[tt]=a[tt]);return j}function callPlayer(a,..._){if(!this.player||!this.player[a]){let $=`ReactPlayer: ${this.constructor.displayName} player could not call %c${a}%c – `;return this.player?this.player[a]||($+="The method was not available"):$+="The player was not available",console.warn($,"font-weight: bold",""),null}return this.player[a](..._)}function isMediaStream(a){return typeof window<"u"&&typeof window.MediaStream<"u"&&a instanceof window.MediaStream}function isBlobUrl(a){return/^blob:/.test(a)}function supportsWebKitPresentationMode(a=document.createElement("video")){const _=/iPhone|iPod/.test(navigator.userAgent)===!1;return a.webkitSupportsPresentationMode&&typeof a.webkitSetPresentationMode=="function"&&_}function enableStubOn(a){return a}var __defProp$5=Object.defineProperty,__getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__getOwnPropNames$5=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__export$5=(a,_)=>{for(var $ in _)__defProp$5(a,$,{get:_[$],enumerable:!0})},__copyProps$5=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$5(_))!__hasOwnProp$5.call(a,et)&&et!==$&&__defProp$5(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$5(_,et))||j.enumerable});return a},__toCommonJS$5=a=>__copyProps$5(__defProp$5({},"__esModule",{value:!0}),a),patterns_exports={};__export$5(patterns_exports,{AUDIO_EXTENSIONS:()=>AUDIO_EXTENSIONS,DASH_EXTENSIONS:()=>DASH_EXTENSIONS,FLV_EXTENSIONS:()=>FLV_EXTENSIONS,HLS_EXTENSIONS:()=>HLS_EXTENSIONS,MATCH_URL_DAILYMOTION:()=>MATCH_URL_DAILYMOTION,MATCH_URL_FACEBOOK:()=>MATCH_URL_FACEBOOK,MATCH_URL_FACEBOOK_WATCH:()=>MATCH_URL_FACEBOOK_WATCH,MATCH_URL_KALTURA:()=>MATCH_URL_KALTURA,MATCH_URL_MIXCLOUD:()=>MATCH_URL_MIXCLOUD,MATCH_URL_MUX:()=>MATCH_URL_MUX,MATCH_URL_SOUNDCLOUD:()=>MATCH_URL_SOUNDCLOUD,MATCH_URL_STREAMABLE:()=>MATCH_URL_STREAMABLE,MATCH_URL_TWITCH_CHANNEL:()=>MATCH_URL_TWITCH_CHANNEL,MATCH_URL_TWITCH_VIDEO:()=>MATCH_URL_TWITCH_VIDEO,MATCH_URL_VIDYARD:()=>MATCH_URL_VIDYARD,MATCH_URL_VIMEO:()=>MATCH_URL_VIMEO,MATCH_URL_WISTIA:()=>MATCH_URL_WISTIA,MATCH_URL_YOUTUBE:()=>MATCH_URL_YOUTUBE,VIDEO_EXTENSIONS:()=>VIDEO_EXTENSIONS,canPlay:()=>canPlay});var patterns=__toCommonJS$5(patterns_exports),import_utils$3=utils$1;const MATCH_URL_YOUTUBE=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,MATCH_URL_SOUNDCLOUD=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,MATCH_URL_VIMEO=/vimeo\.com\/(?!progressive_redirect).+/,MATCH_URL_MUX=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,MATCH_URL_FACEBOOK=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,MATCH_URL_FACEBOOK_WATCH=/^https?:\/\/fb\.watch\/.+$/,MATCH_URL_STREAMABLE=/streamable\.com\/([a-z0-9]+)$/,MATCH_URL_WISTIA=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,MATCH_URL_TWITCH_VIDEO=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,MATCH_URL_TWITCH_CHANNEL=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,MATCH_URL_DAILYMOTION=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,MATCH_URL_MIXCLOUD=/mixcloud\.com\/([^/]+\/[^/]+)/,MATCH_URL_VIDYARD=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,MATCH_URL_KALTURA=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,AUDIO_EXTENSIONS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,VIDEO_EXTENSIONS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,HLS_EXTENSIONS=/\.(m3u8)($|\?)/i,DASH_EXTENSIONS=/\.(mpd)($|\?)/i,FLV_EXTENSIONS=/\.(flv)($|\?)/i,canPlayFile=a=>{if(a instanceof Array){for(const _ of a)if(typeof _=="string"&&canPlayFile(_)||canPlayFile(_.src))return!0;return!1}return(0,import_utils$3.isMediaStream)(a)||(0,import_utils$3.isBlobUrl)(a)?!0:AUDIO_EXTENSIONS.test(a)||VIDEO_EXTENSIONS.test(a)||HLS_EXTENSIONS.test(a)||DASH_EXTENSIONS.test(a)||FLV_EXTENSIONS.test(a)},canPlay={youtube:a=>a instanceof Array?a.every(_=>MATCH_URL_YOUTUBE.test(_)):MATCH_URL_YOUTUBE.test(a),soundcloud:a=>MATCH_URL_SOUNDCLOUD.test(a)&&!AUDIO_EXTENSIONS.test(a),vimeo:a=>MATCH_URL_VIMEO.test(a)&&!VIDEO_EXTENSIONS.test(a)&&!HLS_EXTENSIONS.test(a),mux:a=>MATCH_URL_MUX.test(a),facebook:a=>MATCH_URL_FACEBOOK.test(a)||MATCH_URL_FACEBOOK_WATCH.test(a),streamable:a=>MATCH_URL_STREAMABLE.test(a),wistia:a=>MATCH_URL_WISTIA.test(a),twitch:a=>MATCH_URL_TWITCH_VIDEO.test(a)||MATCH_URL_TWITCH_CHANNEL.test(a),dailymotion:a=>MATCH_URL_DAILYMOTION.test(a),mixcloud:a=>MATCH_URL_MIXCLOUD.test(a),vidyard:a=>MATCH_URL_VIDYARD.test(a),kaltura:a=>MATCH_URL_KALTURA.test(a),file:canPlayFile};var __defProp$4=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__getOwnPropNames$4=Object.getOwnPropertyNames,__hasOwnProp$4=Object.prototype.hasOwnProperty,__export$4=(a,_)=>{for(var $ in _)__defProp$4(a,$,{get:_[$],enumerable:!0})},__copyProps$4=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$4(_))!__hasOwnProp$4.call(a,et)&&et!==$&&__defProp$4(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$4(_,et))||j.enumerable});return a},__toCommonJS$4=a=>__copyProps$4(__defProp$4({},"__esModule",{value:!0}),a),players_exports={};__export$4(players_exports,{default:()=>players_default});var players=__toCommonJS$4(players_exports),import_utils$2=utils$1,import_patterns=patterns,players_default=[{key:"youtube",name:"YouTube",canPlay:import_patterns.canPlay.youtube,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./YouTube-CGwc54Dj.js").then(a=>a.Y),[],import.meta.url))},{key:"soundcloud",name:"SoundCloud",canPlay:import_patterns.canPlay.soundcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./SoundCloud-Cs4BWDQl.js").then(a=>a.S),[],import.meta.url))},{key:"vimeo",name:"Vimeo",canPlay:import_patterns.canPlay.vimeo,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vimeo-CPBZZjfF.js").then(a=>a.V),[],import.meta.url))},{key:"mux",name:"Mux",canPlay:import_patterns.canPlay.mux,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mux-CB3UXor1.js").then(a=>a.M),[],import.meta.url))},{key:"facebook",name:"Facebook",canPlay:import_patterns.canPlay.facebook,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Facebook-Dfq544d0.js").then(a=>a.F),[],import.meta.url))},{key:"streamable",name:"Streamable",canPlay:import_patterns.canPlay.streamable,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Streamable-gqvUkMSw.js").then(a=>a.S),[],import.meta.url))},{key:"wistia",name:"Wistia",canPlay:import_patterns.canPlay.wistia,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Wistia-DGQ5ZOW3.js").then(a=>a.W),[],import.meta.url))},{key:"twitch",name:"Twitch",canPlay:import_patterns.canPlay.twitch,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Twitch-C1YmLvSl.js").then(a=>a.T),[],import.meta.url))},{key:"dailymotion",name:"DailyMotion",canPlay:import_patterns.canPlay.dailymotion,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./DailyMotion-h6PJ7FdU.js").then(a=>a.D),[],import.meta.url))},{key:"mixcloud",name:"Mixcloud",canPlay:import_patterns.canPlay.mixcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mixcloud-CXsvkXxx.js").then(a=>a.M),[],import.meta.url))},{key:"vidyard",name:"Vidyard",canPlay:import_patterns.canPlay.vidyard,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vidyard-Del0Hja2.js").then(a=>a.V),[],import.meta.url))},{key:"kaltura",name:"Kaltura",canPlay:import_patterns.canPlay.kaltura,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Kaltura-hZEG8-AX.js").then(a=>a.K),[],import.meta.url))},{key:"file",name:"FilePlayer",canPlay:import_patterns.canPlay.file,canEnablePIP:a=>import_patterns.canPlay.file(a)&&(document.pictureInPictureEnabled||(0,import_utils$2.supportsWebKitPresentationMode)())&&!import_patterns.AUDIO_EXTENSIONS.test(a),lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./FilePlayer-C_cf59eq.js").then(a=>a.F),[],import.meta.url))}],safeIsNaN=Number.isNaN||function a(_){return typeof _=="number"&&_!==_};function isEqual(a,_){return!!(a===_||safeIsNaN(a)&&safeIsNaN(_))}function areInputsEqual(a,_){if(a.length!==_.length)return!1;for(var $=0;${for(var $ in _)__defProp$3(a,$,{get:_[$],enumerable:!0})},__copyProps$3=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$3(_))!__hasOwnProp$3.call(a,et)&&et!==$&&__defProp$3(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$3(_,et))||j.enumerable});return a},__toESM$3=(a,_,$)=>($=a!=null?__create$3(__getProtoOf$3(a)):{},__copyProps$3(!a||!a.__esModule?__defProp$3($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS$3=a=>__copyProps$3(__defProp$3({},"__esModule",{value:!0}),a),props_exports={};__export$3(props_exports,{defaultProps:()=>defaultProps,propTypes:()=>propTypes});var props=__toCommonJS$3(props_exports),import_prop_types=__toESM$3(propTypesExports);const{string,bool,number,array,oneOfType,shape,object,func,node}=import_prop_types.default,propTypes={url:oneOfType([string,array,object]),playing:bool,loop:bool,controls:bool,volume:number,muted:bool,playbackRate:number,width:oneOfType([string,number]),height:oneOfType([string,number]),style:object,progressInterval:number,playsinline:bool,pip:bool,stopOnUnmount:bool,light:oneOfType([bool,string,object]),playIcon:node,previewTabIndex:number,previewAriaLabel:string,fallback:node,oEmbedUrl:string,wrapper:oneOfType([string,func,shape({render:func.isRequired})]),config:shape({soundcloud:shape({options:object}),youtube:shape({playerVars:object,embedOptions:object,onUnstarted:func}),facebook:shape({appId:string,version:string,playerId:string,attributes:object}),dailymotion:shape({params:object}),vimeo:shape({playerOptions:object,title:string}),mux:shape({attributes:object,version:string}),file:shape({attributes:object,tracks:array,forceVideo:bool,forceAudio:bool,forceHLS:bool,forceSafariHLS:bool,forceDisableHls:bool,forceDASH:bool,forceFLV:bool,hlsOptions:object,hlsVersion:string,dashVersion:string,flvVersion:string}),wistia:shape({options:object,playerId:string,customControls:array}),mixcloud:shape({options:object}),twitch:shape({options:object,playerId:string}),vidyard:shape({options:object})}),onReady:func,onStart:func,onPlay:func,onPause:func,onBuffer:func,onBufferEnd:func,onEnded:func,onError:func,onDuration:func,onSeek:func,onPlaybackRateChange:func,onPlaybackQualityChange:func,onProgress:func,onClickPreview:func,onEnablePIP:func,onDisablePIP:func},noop$1=()=>{},defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:noop$1},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},mux:{attributes:{},version:"2"},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:noop$1,onStart:noop$1,onPlay:noop$1,onPause:noop$1,onBuffer:noop$1,onBufferEnd:noop$1,onEnded:noop$1,onError:noop$1,onDuration:noop$1,onSeek:noop$1,onPlaybackRateChange:noop$1,onPlaybackQualityChange:noop$1,onProgress:noop$1,onClickPreview:noop$1,onEnablePIP:noop$1,onDisablePIP:noop$1};var __create$2=Object.create,__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__getOwnPropNames$2=Object.getOwnPropertyNames,__getProtoOf$2=Object.getPrototypeOf,__hasOwnProp$2=Object.prototype.hasOwnProperty,__defNormalProp$1=(a,_,$)=>_ in a?__defProp$2(a,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[_]=$,__export$2=(a,_)=>{for(var $ in _)__defProp$2(a,$,{get:_[$],enumerable:!0})},__copyProps$2=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$2(_))!__hasOwnProp$2.call(a,et)&&et!==$&&__defProp$2(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$2(_,et))||j.enumerable});return a},__toESM$2=(a,_,$)=>($=a!=null?__create$2(__getProtoOf$2(a)):{},__copyProps$2(!a||!a.__esModule?__defProp$2($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS$2=a=>__copyProps$2(__defProp$2({},"__esModule",{value:!0}),a),__publicField$1=(a,_,$)=>(__defNormalProp$1(a,typeof _!="symbol"?_+"":_,$),$),Player_exports={};__export$2(Player_exports,{default:()=>Player});var Player_1=__toCommonJS$2(Player_exports),import_react$1=__toESM$2(reactExports),import_react_fast_compare$1=__toESM$2(reactFastCompare),import_props$1=props,import_utils$1=utils$1;const SEEK_ON_PLAY_EXPIRY=5e3;class Player extends import_react$1.Component{constructor(){super(...arguments),__publicField$1(this,"mounted",!1),__publicField$1(this,"isReady",!1),__publicField$1(this,"isPlaying",!1),__publicField$1(this,"isLoading",!0),__publicField$1(this,"loadOnReady",null),__publicField$1(this,"startOnPlay",!0),__publicField$1(this,"seekOnPlay",null),__publicField$1(this,"onDurationCalled",!1),__publicField$1(this,"handlePlayerMount",_=>{if(this.player){this.progress();return}this.player=_,this.player.load(this.props.url),this.progress()}),__publicField$1(this,"getInternalPlayer",_=>this.player?this.player[_]:null),__publicField$1(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const _=this.getCurrentTime()||0,$=this.getSecondsLoaded(),j=this.getDuration();if(j){const et={playedSeconds:_,played:_/j};$!==null&&(et.loadedSeconds=$,et.loaded=$/j),(et.playedSeconds!==this.prevPlayed||et.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(et),this.prevPlayed=et.playedSeconds,this.prevLoaded=et.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),__publicField$1(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:_,playing:$,volume:j,muted:et}=this.props;_(),!et&&j!==null&&this.player.setVolume(j),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):$&&this.player.play(),this.handleDurationCheck()}),__publicField$1(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:_,onPlay:$,playbackRate:j}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&j!==1&&this.player.setPlaybackRate(j),_(),this.startOnPlay=!1),$(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),__publicField$1(this,"handlePause",_=>{this.isPlaying=!1,this.isLoading||this.props.onPause(_)}),__publicField$1(this,"handleEnded",()=>{const{activePlayer:_,loop:$,onEnded:j}=this.props;_.loopOnEnded&&$&&this.seekTo(0),$||(this.isPlaying=!1,j())}),__publicField$1(this,"handleError",(..._)=>{this.isLoading=!1,this.props.onError(..._)}),__publicField$1(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const _=this.getDuration();_?this.onDurationCalled||(this.props.onDuration(_),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),__publicField$1(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(_){if(!this.player)return;const{url:$,playing:j,volume:et,muted:tt,playbackRate:rt,pip:nt,loop:it,activePlayer:st,disableDeferredLoading:ot}=this.props;if(!(0,import_react_fast_compare$1.default)(_.url,$)){if(this.isLoading&&!st.forceLoad&&!ot&&!(0,import_utils$1.isMediaStream)($)){console.warn(`ReactPlayer: the attempt to load ${$} is being deferred until the player has loaded`),this.loadOnReady=$;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load($,this.isReady)}!_.playing&&j&&!this.isPlaying&&this.player.play(),_.playing&&!j&&this.isPlaying&&this.player.pause(),!_.pip&&nt&&this.player.enablePIP&&this.player.enablePIP(),_.pip&&!nt&&this.player.disablePIP&&this.player.disablePIP(),_.volume!==et&&et!==null&&this.player.setVolume(et),_.muted!==tt&&(tt?this.player.mute():(this.player.unmute(),et!==null&&setTimeout(()=>this.player.setVolume(et)))),_.playbackRate!==rt&&this.player.setPlaybackRate&&this.player.setPlaybackRate(rt),_.loop!==it&&this.player.setLoop&&this.player.setLoop(it)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(_,$,j){if(!this.isReady){_!==0&&(this.seekOnPlay=_,setTimeout(()=>{this.seekOnPlay=null},SEEK_ON_PLAY_EXPIRY));return}if($?$==="fraction":_>0&&_<1){const tt=this.player.getDuration();if(!tt){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(tt*_,j);return}this.player.seekTo(_,j)}render(){const _=this.props.activePlayer;return _?import_react$1.default.createElement(_,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}__publicField$1(Player,"displayName","Player");__publicField$1(Player,"propTypes",import_props$1.propTypes);__publicField$1(Player,"defaultProps",import_props$1.defaultProps);var __create$1=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__getProtoOf$1=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__defNormalProp=(a,_,$)=>_ in a?__defProp$1(a,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[_]=$,__export$1=(a,_)=>{for(var $ in _)__defProp$1(a,$,{get:_[$],enumerable:!0})},__copyProps$1=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames$1(_))!__hasOwnProp$1.call(a,et)&&et!==$&&__defProp$1(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc$1(_,et))||j.enumerable});return a},__toESM$1=(a,_,$)=>($=a!=null?__create$1(__getProtoOf$1(a)):{},__copyProps$1(!a||!a.__esModule?__defProp$1($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS$1=a=>__copyProps$1(__defProp$1({},"__esModule",{value:!0}),a),__publicField=(a,_,$)=>(__defNormalProp(a,typeof _!="symbol"?_+"":_,$),$),ReactPlayer_exports={};__export$1(ReactPlayer_exports,{createReactPlayer:()=>createReactPlayer});var ReactPlayer$1=__toCommonJS$1(ReactPlayer_exports),import_react=__toESM$1(reactExports),import_deepmerge=__toESM$1(cjs),import_memoize_one=__toESM$1(require$$2),import_react_fast_compare=__toESM$1(reactFastCompare),import_props=props,import_utils=utils$1,import_Player=__toESM$1(Player_1);const Preview=(0,import_utils.lazy)(()=>__vitePreload(()=>import("./Preview-eFqEJmvp.js").then(a=>a.P),[],import.meta.url)),IS_BROWSER=typeof window<"u"&&window.document&&typeof document<"u",IS_GLOBAL=typeof commonjsGlobal<"u"&&commonjsGlobal.window&&commonjsGlobal.window.document,SUPPORTED_PROPS=Object.keys(import_props.propTypes),UniversalSuspense=IS_BROWSER||IS_GLOBAL?import_react.Suspense:()=>null,customPlayers=[],createReactPlayer=(a,_)=>{var $;return $=class extends import_react.Component{constructor(){super(...arguments),__publicField(this,"state",{showPreview:!!this.props.light}),__publicField(this,"references",{wrapper:j=>{this.wrapper=j},player:j=>{this.player=j}}),__publicField(this,"handleClickPreview",j=>{this.setState({showPreview:!1}),this.props.onClickPreview(j)}),__publicField(this,"showPreview",()=>{this.setState({showPreview:!0})}),__publicField(this,"getDuration",()=>this.player?this.player.getDuration():null),__publicField(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),__publicField(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),__publicField(this,"getInternalPlayer",(j="player")=>this.player?this.player.getInternalPlayer(j):null),__publicField(this,"seekTo",(j,et,tt)=>{if(!this.player)return null;this.player.seekTo(j,et,tt)}),__publicField(this,"handleReady",()=>{this.props.onReady(this)}),__publicField(this,"getActivePlayer",(0,import_memoize_one.default)(j=>{for(const et of[...customPlayers,...a])if(et.canPlay(j))return et;return _||null})),__publicField(this,"getConfig",(0,import_memoize_one.default)((j,et)=>{const{config:tt}=this.props;return import_deepmerge.default.all([import_props.defaultProps.config,import_props.defaultProps.config[et]||{},tt,tt[et]||{}])})),__publicField(this,"getAttributes",(0,import_memoize_one.default)(j=>(0,import_utils.omit)(this.props,SUPPORTED_PROPS))),__publicField(this,"renderActivePlayer",j=>{if(!j)return null;const et=this.getActivePlayer(j);if(!et)return null;const tt=this.getConfig(j,et.key);return import_react.default.createElement(import_Player.default,{...this.props,key:et.key,ref:this.references.player,config:tt,activePlayer:et.lazyPlayer||et,onReady:this.handleReady})})}shouldComponentUpdate(j,et){return!(0,import_react_fast_compare.default)(this.props,j)||!(0,import_react_fast_compare.default)(this.state,et)}componentDidUpdate(j){const{light:et}=this.props;!j.light&&et&&this.setState({showPreview:!0}),j.light&&!et&&this.setState({showPreview:!1})}renderPreview(j){if(!j)return null;const{light:et,playIcon:tt,previewTabIndex:rt,oEmbedUrl:nt,previewAriaLabel:it}=this.props;return import_react.default.createElement(Preview,{url:j,light:et,playIcon:tt,previewTabIndex:rt,previewAriaLabel:it,oEmbedUrl:nt,onClick:this.handleClickPreview})}render(){const{url:j,style:et,width:tt,height:rt,fallback:nt,wrapper:it}=this.props,{showPreview:st}=this.state,ot=this.getAttributes(j),at=typeof it=="string"?this.references.wrapper:void 0;return import_react.default.createElement(it,{ref:at,style:{...et,width:tt,height:rt},...ot},import_react.default.createElement(UniversalSuspense,{fallback:nt},st?this.renderPreview(j):this.renderActivePlayer(j)))}},__publicField($,"displayName","ReactPlayer"),__publicField($,"propTypes",import_props.propTypes),__publicField($,"defaultProps",import_props.defaultProps),__publicField($,"addCustomPlayer",j=>{customPlayers.push(j)}),__publicField($,"removeCustomPlayers",()=>{customPlayers.length=0}),__publicField($,"canPlay",j=>{for(const et of[...customPlayers,...a])if(et.canPlay(j))return!0;return!1}),__publicField($,"canEnablePIP",j=>{for(const et of[...customPlayers,...a])if(et.canEnablePIP&&et.canEnablePIP(j))return!0;return!1}),$};var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(a,_)=>{for(var $ in _)__defProp(a,$,{get:_[$],enumerable:!0})},__copyProps=(a,_,$,j)=>{if(_&&typeof _=="object"||typeof _=="function")for(let et of __getOwnPropNames(_))!__hasOwnProp.call(a,et)&&et!==$&&__defProp(a,et,{get:()=>_[et],enumerable:!(j=__getOwnPropDesc(_,et))||j.enumerable});return a},__toESM=(a,_,$)=>($=a!=null?__create(__getProtoOf(a)):{},__copyProps(!a||!a.__esModule?__defProp($,"default",{value:a,enumerable:!0}):$,a)),__toCommonJS=a=>__copyProps(__defProp({},"__esModule",{value:!0}),a),src_exports={};__export(src_exports,{default:()=>src_default});var lib$1=__toCommonJS(src_exports),import_players=__toESM(players),import_ReactPlayer=ReactPlayer$1;const fallback=import_players.default[import_players.default.length-1];var src_default=(0,import_ReactPlayer.createReactPlayer)(import_players.default,fallback);const ReactPlayer=getDefaultExportFromCjs$1(lib$1),AttributesAccordionItem=({nft:a,style:_})=>{const $=a.metadata.attributes;return!$||$.length===0?null:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],"data-testid":"attributes-section",style:_,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"Attributes"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(Wrap,{marginLeft:"0",spacing:"10px",children:$.map(j=>jsxRuntimeExports.jsx(WrapItem,{flex:"1","data-testid":"nft-attribute",children:jsxRuntimeExports.jsx(Card,{width:"160px",height:"128px",marginBottom:"2px",background:colors.gray[700],children:jsxRuntimeExports.jsxs(CardBody,{padding:"16px",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:j.name}),jsxRuntimeExports.jsx(Heading,{size:"md",children:j.value})]})})},j.name))})})]})},TruncatedTextWithTooltip=({text:a,maxLength:_})=>a.length<=_?jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:a}):jsxRuntimeExports.jsx(Tooltip,{label:a,children:jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:truncate(a,_)})}),TzktLink=({url:a,..._})=>jsxRuntimeExports.jsx("a",{"data-testid":"tzkt-link",href:a,rel:"noopener noreferrer",target:"_blank",children:jsxRuntimeExports.jsx(WindowLinkIcon,{..._})}),CreatorElement=({nft:a})=>{if(!a.metadata.creators||a.metadata.creators.length===0)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"-"});const _=a.metadata.creators[0];return _.startsWith("tz")?jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(_)}):jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:_})},PropertiesAccordionItem=({nft:a,style:_})=>{const $=royalties(a),j=$.reduce((tt,rt)=>tt+rt.share,0).toFixed(2),et=useSelectedNetwork();return jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:_,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"Properties"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(TableContainer,{children:jsxRuntimeExports.jsx(Table,{variant:"stripped",children:jsxRuntimeExports.jsxs(Tbody,{fontSize:"14px",children:[jsxRuntimeExports.jsxs(Tr,{background:colors.gray[900],borderColor:colors.gray[700],borderBottomWidth:"1px",borderRadius:"8px",children:[jsxRuntimeExports.jsx(Td,{width:"20%",padding:"16px 0 16px 15px",paddingRight:"0",color:colors.gray[400],borderTopLeftRadius:"8px","data-testid":"nft-editions",children:"Editions:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-editions-value",children:a.totalSupply||"?"}),jsxRuntimeExports.jsx(Td,{width:"20%",padding:"16px 0 16px 15px",color:colors.gray[400],children:"Token ID:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",borderTopRightRadius:"8px",children:a.tokenId})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[800],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsxs(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-royalty",children:["Royalties",$.length>1?" ("+$.length+")":"",":"]}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-royalty-value",children:$.length>0?j+"%":"-"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-mime",children:"MIME type:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px","data-testid":"nft-mime-value",children:mimeType(a)||"-"})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[900],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"Contract:"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px",children:jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(a.contract)})}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"Metadata:"}),jsxRuntimeExports.jsxs(Td,{width:"30%",padding:"16px 0 16px 5px",children:["TzKT ",jsxRuntimeExports.jsx(TzktLink,{url:metadataUri(a,et)})]})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[800],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-creator",children:"Creator:"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-creator-value",children:jsxRuntimeExports.jsx(CreatorElement,{nft:a})}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"License:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",children:jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:a.metadata.rights||"-"})})]})]})})})})]})},TagsSection=({nft:a})=>{const _=a.metadata.tags;return!_||_.length===0?null:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"tags-section",children:_.map($=>jsxRuntimeExports.jsx(WrapItem,{padding:"3px 8px",background:colors.gray[600],borderRadius:"100px",children:jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-tag",children:$})},$))})},SendNFTRecapTile=({nft:a})=>{const _=getIPFSurl(thumbnailUri(a)),$=getIPFSurl(a.displayUri);return jsxRuntimeExports.jsx(Box,{width:"100%","aria-label":"nft",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"60px",padding:3,background:colors.gray[800],borderRadius:"4px","data-testid":"nft-name",children:[jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{fallbackSrc:$,src:_})}),a.metadata.name&&jsxRuntimeExports.jsx(Heading,{marginLeft:4,size:"sm",children:truncate(a.metadata.name,45)})]})})},SignPage$1=a=>{const{mode:_,operations:$,fee:j,data:{nft:et}}=a,{fee:tt,operations:rt,estimationFailed:nt,isLoading:it,form:st,signer:ot,reEstimate:at,onSign:ut}=useSignPageHelpers(j,$,_),{recipient:ht}=rt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...st,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,operationsType:rt.type,signer:rt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:et})}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",marginY:"12px",paddingX:"4px",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Owned:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-owned",size:"sm",children:et.balance})]}),jsxRuntimeExports.jsx(SignPageFee,{fee:tt})]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"12px",marginBottom:"24px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"12px",size:"md",children:"Quantity:"}),jsxRuntimeExports.jsx(Center,{width:"100px",height:"48px",background:colors.gray[800],borderRadius:"4px",children:jsxRuntimeExports.jsxs(Text,{textAlign:"center",children:[rt.operations[0].amount," out of ",et.balance]})})]}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:rt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:ht}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:it,operationType:rt.type,reEstimate:at,sender:rt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:nt,isLoading:it,onSubmit:ut,signer:ot,text:headerText(rt.type,_)})})]})})})},FormPage$1=a=>{const{nft:_}=a,$=useOpenSignPageFormAction({SignPage:SignPage$1,signPageExtraData:{nft:_},FormPage:FormPage$1,defaultFormPageProps:a,toOperation:toOperation$1(_)}),j=useAddToBatchFormAction(toOperation$1(_)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:{quantity:1,...formDefaultValues(a)}}),{formState:{isValid:it,errors:st},register:ot,handleSubmit:at}=nt;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(FormPageHeader,{}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:a.nft})}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Owned:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-owned",size:"sm",children:_.balance})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.quantity,children:[jsxRuntimeExports.jsx(FormLabel,{children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"8px",size:"md",children:"Quantity:"}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(InputGroup,{width:"75px",children:jsxRuntimeExports.jsx(Input,{width:"60px",color:"white","data-testid":"quantity-input",step:1,type:"number",...ot("quantity",{required:"Quantity is required",max:{value:_.balance,message:`Max quantity is ${_.balance}`},min:{value:1,message:"Min quantity is 1"}})})}),jsxRuntimeExports.jsxs(Text,{"data-testid":"out-of-nft",children:["out of ",_.balance]})]})]})}),st.quantity&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"quantity-error",children:st.quantity.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),st.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:st.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),st.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:st.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:at(tt),onSingleSubmit:at(et)})})]})})})},toOperation$1=a=>_=>({type:"fa2",sender:parsePkh(_.sender),recipient:parsePkh(_.recipient),contract:parseContractPkh(a.contract),tokenId:a.tokenId,amount:_.quantity.toString()}),NFTDrawerCard=({nft:a})=>{var it;const _=getIPFSurl(artifactUri(a)),$=getIPFSurl(a.displayUri),j=useGetOwnedAccount(),{openWith:et}=reactExports.useContext(DynamicModalContext),tt=(it=mimeType(a))==null?void 0:it.startsWith("video/"),rt=tokenName(a),nt={border:"none",borderRadius:"8px",marginBottom:"20px"};return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Card,{width:"534px",height:"534px",background:colors.gray[800],children:jsxRuntimeExports.jsxs(CardBody,{padding:"24px",children:[jsxRuntimeExports.jsx(Box,{position:"relative",width:"486px",height:"486px",children:tt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{position:"absolute",zIndex:1,width:"486px",height:"486px",children:jsxRuntimeExports.jsx(ReactPlayer,{width:"100%",height:"100%",loop:!0,playing:!0,url:_})}),jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:0,top:"0",width:"486px",height:"486px",objectFit:"contain",alt:rt,filter:"blur(20px)",src:$})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:1,width:"486px",height:"486px",objectFit:"contain",alt:rt,fallbackSrc:$,src:_}),jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:0,top:"0",width:"486px",height:"486px",objectFit:"contain",alt:rt,"data-testid":"nft-image",fallbackSrc:$,filter:"blur(20px)",src:_})]})}),Number(a.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"24px",marginTop:"-38px",marginLeft:"16px",borderRadius:"100px",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",paddingX:"8px",children:"x"+a.balance})]})}),jsxRuntimeExports.jsx(TagsSection,{nft:a}),rt&&jsxRuntimeExports.jsx(Heading,{marginTop:"16px",marginBottom:"14px","data-testid":"nft-name",size:"lg",children:rt}),a.metadata.description&&jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-description",size:"sm",children:a.metadata.description}),jsxRuntimeExports.jsx(Button,{marginTop:"20px",onClick:()=>et(jsxRuntimeExports.jsx(FormPage$1,{nft:a,sender:j(a.owner)})),children:"Send"}),jsxRuntimeExports.jsxs(Accordion,{marginTop:"32px",allowMultiple:!0,children:[jsxRuntimeExports.jsx(AttributesAccordionItem,{nft:a,style:nt}),jsxRuntimeExports.jsx(PropertiesAccordionItem,{nft:a,style:nt}),jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:nt,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"JSON"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(JsValueWrap,{value:a})})]})]})]})},NFTDrawerBody=({nft:a,onCloseDrawer:_})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",paddingBottom:"22px",color:colors.gray[400],"data-testid":"nft-drawer-body",children:[jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.owner)}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:_})]}),jsxRuntimeExports.jsx(NFTDrawerCard,{nft:a})]}),AccountListWithDrawer=()=>{const[a,_]=reactExports.useState(null),{ownerPkh:$,nftId:j}=useParams(),et=useAllNfts(),tt=$&&lodashExports.get(et,[$],[]).find(ht=>fullId(ht)===j),rt=!!tt,{isOpen:nt,onOpen:it,onClose:st}=useDisclosure$1({defaultIsOpen:rt}),ot=useNavigate(),at=reactExports.useCallback(()=>{_(null),st(),ot("/home")},[st,ot]);reactExports.useEffect(()=>{const ht=yt=>{yt.key==="Escape"&&at()};return document.addEventListener("keydown",ht),()=>document.removeEventListener("keydown",ht)},[at]);const ut=reactExports.useMemo(()=>({selectedAccount:a,selectAccount:ht=>{_(ht),it()}}),[a,it]);return jsxRuntimeExports.jsxs(SelectedAccountContext.Provider,{value:ut,children:[jsxRuntimeExports.jsx(AccountsList,{}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:nt,onClose:at,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(DrawerContent,{children:[rt&&jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(NFTDrawerBody,{nft:{...tt,owner:$},onCloseDrawer:at})}),!rt&&a&&jsxRuntimeExports.jsxs(ModalBody,{overflow:"hidden",overflowY:"scroll",paddingRight:"0",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"flex-end",width:"100%",paddingRight:"24px",children:[jsxRuntimeExports.jsx(DerivationInfoButton,{marginRight:"5px",account:a}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:at})]}),jsxRuntimeExports.jsx(AccountCard,{accountPkh:a.address.pkh})]})]})]})]})},HomeView=()=>jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Accounts"}),jsxRuntimeExports.jsx(Flex,{flex:1,minHeight:1,children:jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",flex:1,marginRight:"12px",paddingBottom:"12px",children:[jsxRuntimeExports.jsx(AccountListHeader,{}),jsxRuntimeExports.jsx(Box,{flex:1,overflow:"hidden",borderRadius:"8px",children:jsxRuntimeExports.jsx(AccountListWithDrawer,{})})]})})]}),SelectedNFTContext=reactExports.createContext({selectedNFT:void 0,setSelectedNFT:a=>{}}),NFTCard=({nft:a})=>{const{selectedNFT:_,setSelectedNFT:$}=reactExports.useContext(SelectedNFTContext),j=getIPFSurl(thumbnailUri(a)),et=getIPFSurl(a.displayUri),tt=a.metadata.name,rt={width:"100%",minWidth:"242px",minHeight:"242px",objectFit:"contain",aspectRatio:"1",fallbackSrc:et,src:j},nt=_&&fullId(_)===fullId(a)&&_.owner===a.owner;return jsxRuntimeExports.jsx(Card,{minWidth:"274px",borderRadius:"8px",cursor:"pointer","data-testid":`nft-card${nt?"-selected":""}`,onClick:()=>$(a),children:jsxRuntimeExports.jsxs(CardBody,{padding:"16px",background:colors.gray[900],border:"1px solid",borderColor:nt?colors.orangeL:"transparent",borderRadius:"8px",_hover:{background:colors.gray[700],borderColor:colors.gray[500]},children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsxs(Box,{position:"relative",width:"100%",children:[jsxRuntimeExports.jsx(Image$1,{...rt,zIndex:2,opacity:"0"}),jsxRuntimeExports.jsx(Image$1,{...rt,position:"absolute",zIndex:0,top:"0",filter:"blur(20px)"}),jsxRuntimeExports.jsx(Image$1,{...rt,position:"absolute",zIndex:1,top:"0","data-testid":"nft-image"})]})}),Number(a.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"24px",marginTop:"-36px",marginLeft:"10px",paddingTop:"1px",fontSize:"14px",borderRadius:"full",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",paddingX:"8px",children:"x"+a.balance}),jsxRuntimeExports.jsx(Box,{overflow:"hidden","data-testid":"nft-card-name",children:jsxRuntimeExports.jsx(Heading,{overflow:"hidden",marginTop:"15px",marginBottom:"8px",fontSize:"sm",whiteSpace:"nowrap",textOverflow:"ellipsis",children:tt})}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(a.owner)})]})})},NFTGallery=({nftsByOwner:a})=>{const _=Object.entries(a).flatMap(([j,et])=>(et||[]).map(tt=>({owner:j,...tt})));let $="repeat(auto-fit, minmax(min(100%/2, max(274px, 100%/7)), 1fr))";return _.length<3&&($=`repeat(auto-fit, min(100% / ${_.length} - 16px, 450px))`),jsxRuntimeExports.jsx(SimpleGrid,{gridTemplateColumns:$,marginBottom:"16px",minChildWidth:"340px",spacing:"16px",children:sortedByLastUpdate(_).map(j=>jsxRuntimeExports.jsx(NFTCard,{nft:j},`${j.owner}:${fullId(j)}`))})},AccountListDisplay=({accounts:a,onSelect:_})=>jsxRuntimeExports.jsx(MenuList,{zIndex:"docked",overflowY:"scroll",maxHeight:"300px",padding:0,background:colors.gray[900],children:a.map($=>jsxRuntimeExports.jsx(MenuItem$1,{width:"100%",minHeight:"48px",padding:"5px",background:colors.gray[700],"aria-label":$.label,onClick:()=>{_($)},value:$.address.pkh,children:jsxRuntimeExports.jsx(AddressTile,{width:"370px",height:"40px",padding:"5px",background:colors.gray[700],borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",address:$.address})},$.address.pkh))}),useAccountsFilter=()=>{const a=useAllAccounts(),[_]=reactExports.useState(a),[$,j]=useSearchParams(),et=$.getAll("accounts"),[tt,rt]=reactExports.useState(et.length===0),[nt,it]=reactExports.useState(a.filter(at=>et.includes(at.address.pkh))),st=lodashExports.differenceBy(a,nt,at=>at.address.pkh),ot=nt.length===a.length;return reactExports.useEffect(()=>{j(at=>({...at,accounts:nt.map(ut=>ut.address.pkh)}))},[nt,j]),{selectedAccounts:tt?_:nt,accountsFilter:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(Box,{alignSelf:"flex-start",children:jsxRuntimeExports.jsxs(Menu,{children:[jsxRuntimeExports.jsx(MenuButton,{as:Button,maxHeight:"26px",paddingLeft:0,fontWeight:"normal",_hover:{bg:"none"},_active:{bg:"none"},"data-testid":"account-filter",isDisabled:ot,marginY:"16px",rightIcon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),variant:"ghost",children:"Filter by Account"}),jsxRuntimeExports.jsx(AccountListDisplay,{accounts:st,onSelect:at=>{rt(!1),it(ut=>[...ut,at])}})]})}),jsxRuntimeExports.jsx(Wrap,{width:"100%",children:nt.map(at=>jsxRuntimeExports.jsx(AddressPill,{address:at.address,"data-testid":"account-pill",mode:{type:"removable",onRemove:()=>{rt(nt.length===1),it(ut=>ut.filter(ht=>ht.address.pkh!==at.address.pkh))}}},at.address.pkh))})]})}},NFTsView=()=>{const a=useAllNfts(),{accountsFilter:_,selectedAccounts:$}=useAccountsFilter(),[j,et]=reactExports.useState(void 0);reactExports.useEffect(()=>{const it=st=>{st.key==="Escape"&&et(void 0)};return document.addEventListener("keydown",it),()=>document.removeEventListener("keydown",it)},[]);const tt=lodashExports.pick(a,$.map(it=>it.address.pkh)),rt=lodashExports.sumBy(Object.values(tt).flat(),it=>Number((it==null?void 0:it.balance)||0)),nt=lodashExports.every(tt,it=>!it||it.length===0);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{subtitle:`(${rt})`,title:"NFTs"}),_,nt?jsxRuntimeExports.jsx(NoNFTs,{size:"lg"}):jsxRuntimeExports.jsxs(SelectedNFTContext.Provider,{value:{setSelectedNFT:et,selectedNFT:j},children:[jsxRuntimeExports.jsx(Box,{overflowY:"scroll",children:jsxRuntimeExports.jsx(NFTGallery,{nftsByOwner:tt})}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:!!j,onClose:()=>et(void 0),placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsx(ModalBody,{children:j&&jsxRuntimeExports.jsx(NFTDrawerBody,{nft:j,onCloseDrawer:()=>et(void 0)})})})]})]})]})},OperationsView=()=>{const{accountsFilter:a,selectedAccounts:_}=useAccountsFilter(),{operations:$,loadMore:j,hasMore:et,isLoading:tt,isFirstLoad:rt}=useGetOperations(_),nt=reactExports.useRef(!1),it=st=>{if(nt.current||!et||tt)return;const ot=st.target;if(ot.scrollHeight-ot.scrollTop-ot.clientHeight<100)return nt.current=!0,j().finally(()=>{nt.current=!1})};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Operations"}),a,jsxRuntimeExports.jsx(Center,{display:tt&&rt?"flex":"none",height:"100%",children:jsxRuntimeExports.jsx(Image$1,{width:"150px",height:"75px",marginBottom:"136px",src:"./static/media/loading-wheel.gif"})}),$.length===0&&!tt&&jsxRuntimeExports.jsx(NoOperations,{size:"lg"}),$.length>0&&jsxRuntimeExports.jsxs(Box,{overflowY:"scroll",marginBottom:"20px",background:colors.gray[900],borderRadius:"8px",onScroll:it,paddingX:"20px",children:[jsxRuntimeExports.jsx(OperationTileContext.Provider,{value:{mode:"page"},children:$.map((st,ot)=>{const at=ot===$.length-1;return jsxRuntimeExports.jsxs(Box,{height:"90px",marginBottom:at?"10px":0,paddingY:"20px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:st}),!at&&jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Divider,{marginTop:"20px"})})]},st.id)})}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",display:tt&&!rt?"flex":"none",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Image$1,{width:"100px",height:"50px",src:"./static/media/loading-dots.gif"})]})]})]})},DrawerTopButtons=({onClose:a,..._})=>jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",paddingBottom:"30px",cursor:"pointer",..._,children:jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:a})}),BeaconPeers=()=>{const{data:a}=usePeers(),_=useRemovePeer(),[$,j]=reactExports.useState([]);return reactExports.useEffect(()=>{const et=(a||[]).map(async tt=>({...tt,senderId:tt.senderId||await getSenderId(tt.publicKey)}));Promise.all(et).then(j).catch(lodashExports.noop)},[a]),$.length===0?jsxRuntimeExports.jsxs(Box,{"data-testid":"beacon-peers-empty",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Text,{marginTop:"31px",color:colors.gray[400],size:"lg",children:"Your dApps will appear here"})]}):jsxRuntimeExports.jsx(PeersDisplay,{"data-testid":"beacon-peers",peerInfos:$,removePeer:_})},PeersDisplay=({peerInfos:a,removePeer:_})=>jsxRuntimeExports.jsx(Box,{children:a.map($=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(PeerRow,{onRemove:()=>_($),peerInfo:$})]},$.senderId))}),PeerRow=({peerInfo:a,onRemove:_})=>jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",height:"106px","data-testid":"peer-row",paddingY:"30px",children:[jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AspectRatio,{width:"48px",marginRight:"16px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{width:"100%",src:a.icon})}),jsxRuntimeExports.jsxs(Center,{alignItems:"flex-start",flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"6px",size:"md",children:a.name}),jsxRuntimeExports.jsx(StoredPeerInfo,{peerInfo:a})]})]}),jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(IconButton,{"aria-label":"Remove Peer",icon:jsxRuntimeExports.jsx(TrashIcon,{}),onClick:_,size:"xs",variant:"circle"})})]}),StoredPeerInfo=({peerInfo:a})=>{const _=useGetConnectionInfo(a.senderId);return _?jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"10px",address:parsePkh(_.accountPkh)}),jsxRuntimeExports.jsx(Divider,{marginRight:"10px",orientation:"vertical"}),jsxRuntimeExports.jsx(Text,{marginTop:"2px",marginRight:"4px",color:colors.gray[450],fontWeight:650,size:"sm",children:"Network:"}),jsxRuntimeExports.jsx(Text,{marginTop:"2px",color:colors.white,"data-testid":"dapp-connection-network",size:"sm",children:lodashExports.capitalize(_.networkType)})]}):null},DAppsDrawerCard=()=>{const{isOpen:a,onClose:_,onOpen:$}=useDisclosure$1(),j=useAddPeer();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"dApps",isSelected:a,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:a,onClose:_,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"drawer-body",children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:_}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"96px",children:jsxRuntimeExports.jsx(Heading,{children:"dApps"})}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.readText().then(et=>j(et)),children:"Connect with Pairing Request"}),jsxRuntimeExports.jsx(Text,{marginTop:"16px",marginBottom:"32px",color:colors.gray[400],children:"or open a deeplink from inside the dApp..."}),jsxRuntimeExports.jsx(BeaconPeers,{})]})]})})]})]})},ErrorLogsDrawerCard=()=>{const{isOpen:a,onClose:_,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Error Logs",isSelected:a,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:a,onClose:_,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:_}),jsxRuntimeExports.jsx(ErrorLogsDrawerBody,{})]})})]})]})},ErrorLogsDrawerBody=()=>{const a=[...useAppSelector(j=>j.errors)].reverse(),_=useDispatch(),$=()=>{_(errorsSlice.actions.reset())};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",height:"50px",marginBottom:"20px",children:[jsxRuntimeExports.jsx(Heading,{size:"xl",children:"Error Logs"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx("a",{download:"UmamiErrorLogs.json",href:`data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(a))}`,children:jsxRuntimeExports.jsx(Button,{variant:"tertiary",children:"Download error logs"})}),jsxRuntimeExports.jsx(Button,{marginLeft:"8px",onClick:$,variant:"warning",children:"Clear All"})]})]}),a.map(j=>jsxRuntimeExports.jsx(ErrorLogRow,{errorLog:j},nanoid()))]})},ErrorLogRow=({errorLog:a})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{marginY:1}),jsxRuntimeExports.jsx(Flex,{justifyContent:"space-between",paddingY:"12px",children:jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(OutlineExclamationCircleIcon,{marginTop:"1px",marginRight:"8px"}),jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{wordBreak:"break-all",size:"sm",children:a.description}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:a.timestamp})]})]})})]}),removeTrailingSlashes=a=>a.replace(/\/+$/g,""),UpsertNetworkModal=({network:a})=>{const _=a?"edit":"create",{onClose:$}=reactExports.useContext(DynamicModalContext),j=useDispatch(),et=useAvailableNetworks(),{formState:{errors:tt,isValid:rt},register:nt,handleSubmit:it}=useForm({mode:"onBlur",defaultValues:a}),st=ot=>{j(networksActions.upsertNetwork(ot)),$()};return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:it(st),children:[jsxRuntimeExports.jsxs(ModalHeader,{textAlign:"center",children:[_==="edit"?"Edit":"Add"," Network",jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[_==="create"&&jsxRuntimeExports.jsxs(FormControl,{marginTop:"32px",marginBottom:"24px",isInvalid:!!tt.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Name"}),jsxRuntimeExports.jsx(Input,{placeholder:"mainnet",...nt("name",{required:"Name is required",validate:ot=>{if(et.find(at=>at.name===ot))return"Network with this name already exists"}})}),tt.name&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.name.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.rpcUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"RPC URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://prod.tcinfra.net/rpc/mainnet",...nt("rpcUrl",{required:"RPC URL is required",setValueAs:removeTrailingSlashes})}),tt.rpcUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.rpcUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.tzktApiUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Tzkt API URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://api.ghostnet.tzkt.io",...nt("tzktApiUrl",{required:"Tzkt API URL is required",setValueAs:removeTrailingSlashes})}),tt.tzktApiUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.tzktApiUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.tzktExplorerUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Tzkt Explorer URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://ghostnet.tzkt.io",...nt("tzktExplorerUrl",{required:"Tzkt Explorer URL is required",setValueAs:removeTrailingSlashes})}),tt.tzktExplorerUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.tzktExplorerUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Buy Tez URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://faucet.ghostnet.teztnets.com",...nt("buyTezUrl")})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!rt,onClick:()=>{},type:"submit",children:_==="edit"?"Save changes":"Add network"})})]})]})})},NetworkSettingsDrawerBody=()=>{const{openWith:a}=reactExports.useContext(DynamicModalContext),_=useSelectedNetwork(),$=useSelectNetwork(),j=useAvailableNetworks(),et=useAppDispatch(),tt=rt=>{et(networksActions.removeNetwork(rt))};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",children:[jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{children:"Network Settings"}),jsxRuntimeExports.jsxs(Button,{paddingRight:"0",onClick:()=>a(jsxRuntimeExports.jsx(UpsertNetworkModal,{})),variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{size:"sm",children:"Add Network"}),jsxRuntimeExports.jsx(PlusIcon,{width:"18px",height:"18px",marginLeft:"4px",stroke:"currentcolor"})]})]}),jsxRuntimeExports.jsx(RadioGroup,{marginTop:"60px",onChange:$,value:_.name,children:jsxRuntimeExports.jsx(Stack,{children:j.map(rt=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{borderColor:colors.gray[700]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between","data-testid":`network-${rt.name}`,children:[jsxRuntimeExports.jsx(Radio,{height:"100px",value:rt.name,variant:"primary",children:jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",marginLeft:"16px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"4px",size:"sm",children:rt.name}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],children:rt.rpcUrl})]})}),!isDefault(rt)&&jsxRuntimeExports.jsx(Center,{"data-testid":"popover-menu",children:jsxRuntimeExports.jsxs(PopoverMenu,{children:[jsxRuntimeExports.jsxs(Button,{onClick:()=>a(jsxRuntimeExports.jsx(UpsertNetworkModal,{network:rt})),variant:"popover",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Edit"}),jsxRuntimeExports.jsx(PenIcon,{stroke:"inherit"})]}),jsxRuntimeExports.jsx(Divider,{marginTop:"4px"}),jsxRuntimeExports.jsxs(Button,{onClick:()=>tt(rt),variant:"popover",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Remove"}),jsxRuntimeExports.jsx(TrashIcon,{stroke:"inherit"})]})]})})]})]},rt.name))})})]})},NetworkSettingsDrawerCard=()=>{const{isOpen:a,onClose:_,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Network Settings",isSelected:a,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:a,onClose:_,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:_}),jsxRuntimeExports.jsx(NetworkSettingsDrawerBody,{})]})})]})]})},ChangePasswordForm=()=>{const{onClose:a}=reactExports.useContext(DynamicModalContext),_=useForm({mode:"onBlur"}),$=useToast(),j=useAppDispatch(),{handleAsyncAction:et,isLoading:tt}=useAsyncActionHandler(),{handleSubmit:rt,formState:{isValid:nt,errors:it},getValues:st}=_,ot=async({currentPassword:at,newPassword:ut,newPasswordConfirmation:ht})=>{if(!(at===ut||ut!==ht))return et(async()=>{await j(changeMnemonicPassword({currentPassword:at,newPassword:ut})).unwrap(),$({description:"Password updated",status:"success"}),a()})};return jsxRuntimeExports.jsx(FormProvider,{..._,children:jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[700],"data-testid":"change-password-modal",children:jsxRuntimeExports.jsxs("form",{onSubmit:rt(ot),children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalHeader,{textAlign:"center",children:jsxRuntimeExports.jsx(Heading,{children:"Change Password"})}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{marginTop:"32px",isInvalid:!!it.currentPassword,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"current-password",inputName:"currentPassword",label:"Current Password",placeholder:"Enter your current password",required:"Current password is required"}),it.currentPassword&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"current-password-error",children:it.currentPassword.message})]}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!it.newPassword,marginY:6,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"new-password",inputName:"newPassword",label:"New Password",placeholder:"Enter new password",required:"New password is required",validate:at=>st("currentPassword")!==at||"Cannot be the same as old password"}),it.newPassword&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"new-password-error",children:it.newPassword.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:3,isInvalid:!!it.newPasswordConfirmation,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"new-password-confirmation",inputName:"newPasswordConfirmation",label:"Confirm New Password",placeholder:"Confirm new password",required:"Confirmation is required",validate:at=>st("newPassword")===at||"Your new passwords do no match"}),it.newPasswordConfirmation&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"new-password-confirmation-error",children:it.newPasswordConfirmation.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!nt,isLoading:tt,size:"lg",type:"submit",children:"Update Password"})})]})})})},SettingsView=()=>jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Settings"}),jsxRuntimeExports.jsxs(Box,{overflowY:"scroll",children:[jsxRuntimeExports.jsx(Box,{marginTop:"16px",children:jsxRuntimeExports.jsx(GeneralSection,{})}),jsxRuntimeExports.jsx(BackupSection,{}),jsxRuntimeExports.jsx(AdvancedSection,{})]})]}),GeneralSection=()=>jsxRuntimeExports.jsxs(SectionContainer,{title:"General",children:[jsxRuntimeExports.jsx(NetworkSettingsDrawerCard,{}),jsxRuntimeExports.jsx(ErrorLogsDrawerCard,{})]}),BackupSection=()=>jsxRuntimeExports.jsx(SectionContainer,{title:"Backup",children:jsxRuntimeExports.jsx(ClickableCard,{isSelected:!1,onClick:downloadBackupFile,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:"Download backup file"}),jsxRuntimeExports.jsx(Button,{onClick:downloadBackupFile,variant:"unstyled",children:jsxRuntimeExports.jsx(DownloadIcon,{cursor:"pointer"})})]})})}),AdvancedSection=()=>{const{modalElement:a,onOpen:_}=useOffboardingModal(),{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(SectionContainer,{title:"Advanced Settings",children:[jsxRuntimeExports.jsx(DAppsDrawerCard,{}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Off-board Wallet",isSelected:!1,onClick:_}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Change Password",isSelected:!1,onClick:()=>$(jsxRuntimeExports.jsx(ChangePasswordForm,{}))}),a]})},SectionContainer=({title:a,children:_})=>jsxRuntimeExports.jsx(Box,{marginTop:"8px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(Box,{width:"550px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"16px",size:"lg",children:a}),_]})})}),TokenTile=({token:a,amount:_,...$})=>{const{contract:j}=a,et=tokenPrettyAmount(_,a),tt=tokenSymbolSafe(a);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"start",width:"400px",padding:"15px",background:colors.gray[800],borderRadius:"4px","data-testid":"token-tile",...$,children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",marginRight:"12px",ratio:1,children:jsxRuntimeExports.jsx(TokenIcon,{padding:"6.25px",background:colors.gray[500],borderRadius:"4px",contract:j})})}),jsxRuntimeExports.jsx(PrettyNumber,{number:et}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:tt})]})},SignPage=a=>{const{mode:_,operations:$,fee:j,data:{token:et}}=a,{fee:tt,operations:rt,estimationFailed:nt,isLoading:it,form:st,signer:ot,reEstimate:at,onSign:ut}=useSignPageHelpers(j,$,_),{amount:ht,recipient:yt}=rt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...st,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{...a,operationsType:rt.type,signer:rt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(TokenTile,{amount:ht,token:et}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(SignPageFee,{fee:tt})})}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:rt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:yt}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:it,operationType:rt.type,reEstimate:at,sender:rt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:nt,isLoading:it,onSubmit:ut,signer:ot,text:headerText(rt.type,_)})})]})})})},FormPage=a=>{const{token:_}=a,$=useOpenSignPageFormAction({SignPage,signPageExtraData:{token:_},FormPage,defaultFormPageProps:a,toOperation:toOperation(_)}),j=useAddToBatchFormAction(toOperation(_)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(a)}),{formState:{isValid:it,errors:st},register:ot,handleSubmit:at}=nt,ut=tokenDecimals(_),ht=formatTokenAmount(_.balance,ut),yt=getSmallestUnit(Number(ut));return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(FormPageHeader,{}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!st.prettyAmount,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Amount"}),jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{isDisabled:rt,step:yt,type:"number",...ot("prettyAmount",{required:"Amount is required",max:{value:ht.toString(),message:`Max amount is ${ht}`},validate:makeValidateDecimals(Number(ut))}),placeholder:yt}),jsxRuntimeExports.jsx(InputRightElement,{paddingRight:"12px","data-testid":"token-symbol",children:tokenSymbolSafe(_)})]}),st.prettyAmount&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"amount-error",children:st.prettyAmount.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),st.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:st.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!st.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),st.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:st.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:at(tt),onSingleSubmit:at(et)})})]})})})},toOperation=a=>_=>{const $={type:"fa2",sender:parsePkh(_.sender),recipient:parsePkh(_.recipient),contract:parseContractPkh(a.contract),tokenId:a.tokenId,amount:getRealAmount(a,_.prettyAmount)};return a.type==="fa2"?$:{...$,type:"fa1.2",tokenId:"0"}},Header=({account:a})=>{const{address:_,label:$}=a,j=useAddressKind$1(_);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"78px",background:accountIconGradient({left:"-10px",top:"-10px",account:a,radius:"100px",mainBackgroundColor:colors.gray[800]}),borderTopRadius:"8px","data-testid":"header",paddingX:"30px",children:[jsxRuntimeExports.jsx(AddressTileIcon,{addressKind:j,identiconSize:35,size:"lg"}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsxs(Box,{marginLeft:"16px","data-testid":"account-identifier",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"4px",size:"md",children:$}),jsxRuntimeExports.jsx(Text,{color:colors.gray[300],size:"sm",children:formatPkh(_.pkh)})]}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column-reverse",children:jsxRuntimeExports.jsx(AccountBalance,{verticalAlign:"bottom",address:a.address.pkh})})]})]})},AccountTokens=({account:a,tokens:_})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(Card,{overflowX:"auto",marginBottom:"16px",borderBottomRadius:"8px",backgroundColor:colors.gray[900],children:[jsxRuntimeExports.jsx(Header,{account:a}),jsxRuntimeExports.jsx(TableContainer,{paddingX:"30px",children:jsxRuntimeExports.jsx(Table,{children:jsxRuntimeExports.jsx(Tbody,{children:_.map((j,et)=>{const tt=et===_.length-1?"transparent":colors.gray[700];return jsxRuntimeExports.jsxs(Tr,{"data-testid":"token-tile",children:[jsxRuntimeExports.jsx(Td,{width:"20%",minWidth:"240px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(TokenIcon,{display:"inline-block",width:"38px",contract:j.contract}),jsxRuntimeExports.jsx(Heading,{display:"inline-block",marginLeft:"16px",size:"sm",children:jsxRuntimeExports.jsx(TokenNameWithIcon,{token:j})})]})}),jsxRuntimeExports.jsx(Td,{width:"20%",minWidth:"200px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(AddressPill,{address:parseContractPkh(j.contract)})}),jsxRuntimeExports.jsx(Td,{width:"15%",minWidth:"160px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(Heading,{size:"sm",children:tokenPrettyAmount(j.balance,j,{showSymbol:!1})})}),jsxRuntimeExports.jsx(Td,{textAlign:"right",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(SendButton,{onClick:()=>$(jsxRuntimeExports.jsx(FormPage,{sender:a,token:j}))})})]},fullId(j))})})})})]})},TokensPage=()=>{const{accountsFilter:a,selectedAccounts:_}=useAccountsFilter(),$=useGetAccountAllTokens(),j=_.map(et=>[et,$(et.address.pkh)]).filter(([,et])=>et.length>0);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Tokens"}),a,j.length===0?jsxRuntimeExports.jsx(NoTokens,{size:"lg"}):jsxRuntimeExports.jsx(Box,{overflowY:"auto",children:j.map(([et,tt])=>jsxRuntimeExports.jsx(AccountTokens,{account:et,tokens:tt},et.address.pkh))})]})},AppVersion=({isCollapsed:a,..._})=>{const $=a?packageInfo.version:`Umami v${packageInfo.version}`;return jsxRuntimeExports.jsx(Text,{color:colors.gray[450],..._,children:$})},CollapseMenuButton=({toggle:a,..._})=>jsxRuntimeExports.jsx(Center,{width:"44px",height:"44px",marginRight:"-14px",borderRadius:"4px",_hover:{background:colors.gray[800]},cursor:"pointer","data-testid":"collapse-menu-button",onClick:a,..._,children:jsxRuntimeExports.jsx(BurgerMenuIcon,{})}),useCollapseMenu=()=>{const[a,_]=reactExports.useState(!1),$=reactExports.useCallback(()=>{_(j=>!j)},[]);return{isCollapsed:a,toggle:$}},ORANGE="#F74F18",MakiLogo=a=>{const _=useSelectedNetwork();return jsxRuntimeExports.jsx(MakiIcon,{background:"white",borderRadius:"8px","data-testid":"maki-logo",fishColor:_.name==="mainnet"?ORANGE:"black",...a})},NetworkSelector=()=>{const a=useSelectedNetwork(),_=useAvailableNetworks(),$=useSelectNetwork(),{onOpen:j,onClose:et,isOpen:tt}=useDisclosure$1();return jsxRuntimeExports.jsxs(Popover,{isOpen:tt,onClose:et,onOpen:j,placement:"bottom-end",children:[jsxRuntimeExports.jsx(PopoverTrigger,{children:jsxRuntimeExports.jsxs(Button,{marginTop:"4px",color:colors.green,"data-testid":"network-selector",variant:"unstyled",children:[lodashExports.capitalize(a.name),tt?jsxRuntimeExports.jsx(ChevronUpIcon,{marginTop:"-2px",stroke:"currentcolor"}):jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginTop:"-2px",stroke:"currentcolor"})]})}),jsxRuntimeExports.jsx(PopoverContent,{width:"100px",marginTop:"-10px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],children:jsxRuntimeExports.jsx(PopoverBody,{padding:"4px 12px",children:jsxRuntimeExports.jsx(Flex,{flexDirection:"column",children:_.map((rt,nt)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{height:"34px",color:rt.name===a.name?colors.green:colors.gray[300],fontSize:"14px",fontWeight:400,textAlign:"right",_hover:{color:colors.greenL},onClick:()=>{$(rt.name),et()},variant:"unstyled",children:lodashExports.capitalize(rt.name)}),nt<_.length-1&&jsxRuntimeExports.jsx(Divider,{})]},rt.name))})})})]})},UpdateAppButton=()=>{const[a,_]=reactExports.useState(!1),$=window;reactExports.useEffect(()=>{$&&$.electronAPI&&$.electronAPI.onAppUpdateDownloaded(et=>_(!0))},[$]);const j=()=>{$&&$.electronAPI&&$.electronAPI.installAppUpdateAndQuit()};return a?jsxRuntimeExports.jsx(Box,{marginTop:"24px",marginBottom:"6px",children:jsxRuntimeExports.jsxs(Button,{justifyContent:"flex-start",width:"100%",height:"32px",paddingTop:"7px",paddingRight:"8px",paddingBottom:"7px",paddingLeft:"8px",color:colors.black,background:colors.green,_hover:{color:colors.black,background:colors.greenL},onClick:j,children:[jsxRuntimeExports.jsx(FlipForwardEnergy,{}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:"Update Umami"})]})}):null},SideNavbar=()=>{const{isCollapsed:a,toggle:_}=useCollapseMenu(),$=jsxRuntimeExports.jsx(CollapseMenuButton,{marginTop:a?0:"2px",marginRight:a?0:"-14px",toggle:_});return jsxRuntimeExports.jsxs(Flex,{alignItems:a?"center":"normal",flexDirection:"column",width:a?"80px":"236px",padding:a?"30px 20px":"30px",background:colors.gray[900],"data-testid":`side-navbar${a?"-collapsed":""}`,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"30px",children:a?$:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(MakiLogo,{width:"38px",height:"38px"}),jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(NetworkSelector,{}),$]})]})}),jsxRuntimeExports.jsx(Divider,{marginTop:"28px"})]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",flexDirection:"column",flex:1,children:[jsxRuntimeExports.jsxs(Box,{alignItems:a?"center":"normal",justifyContent:a?"space-around":"normal",display:a?"flex":"block",height:"100%",children:[!a&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(UpdateAppButton,{}),jsxRuntimeExports.jsx(TotalBalance,{})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(AccountsIcon,{}),isCollapsed:a,label:"Accounts",to:"/home"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(DiamondIcon,{}),isCollapsed:a,label:"NFTs",to:"/nfts"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(RefreshClockIcon,{width:"24px",height:"24px"}),isCollapsed:a,label:"Operations",to:"/operations"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(CoinIcon,{}),isCollapsed:a,label:"Tokens",to:"/tokens"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(BatchIcon,{}),isCollapsed:a,label:"Batch",to:"/batch"})]})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(MenuItem,{marginTop:"22px",icon:jsxRuntimeExports.jsx(AddressBookIcon,{}),isCollapsed:a,label:"Address Book",to:"/address-book"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(GearIcon,{}),isCollapsed:a,label:"Settings",to:"/settings"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(HelpIcon,{}),isCollapsed:a,label:"Help",to:"/help"}),jsxRuntimeExports.jsx(AppVersion,{marginTop:"24px",fontSize:"14px",textAlign:a?"center":"left",isCollapsed:a})]})]})]})},MenuItem=({icon:a,label:_,to:$,isCollapsed:j,...et})=>{const rt=useLocation().pathname.startsWith($);return jsxRuntimeExports.jsx(Link,{to:$,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"flex-start",width:j?"44px":"176px",marginBottom:"8px",padding:"10px",background:rt?colors.gray[600]:"transparent",borderRadius:"4px",_hover:{background:rt?colors.gray[600]:colors.gray[800]},cursor:"pointer",...et,children:[a,!j&&jsxRuntimeExports.jsx(Text,{marginLeft:"10px",size:"sm",children:_})]})})},TotalBalance=()=>{const a=useTotalBalance(),[_]=useMediaQuery("(max-height: 900px)");return jsxRuntimeExports.jsxs(Box,{marginTop:"24px",marginBottom:_?"30px":"100px","data-testid":"total-balance",children:[jsxRuntimeExports.jsx(Text,{marginBottom:"4px",size:"sm",children:"Balance"}),a&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:a.mutez,dollarBalance:a.usd})]})},withSideMenu=a=>jsxRuntimeExports.jsxs(Flex,{height:"100vh",children:[jsxRuntimeExports.jsx(SideNavbar,{}),jsxRuntimeExports.jsx(Box,{flex:1,overflowX:"hidden",height:"100%",background:"linear-gradient(180deg, rgba(0, 231, 182, 0.35) -41.53%, rgba(0, 231, 182, 0.00) 34.71%)",paddingX:"24px",children:a})]}),AccountsImage=""+new URL("accounts-DTYOez9Q.png",import.meta.url).href,BatchImage=""+new URL("batch-CoYFN9ox.png",import.meta.url).href,MultisigImage=""+new URL("multisig-GRRIvmJS.png",import.meta.url).href;var js={},Carousel$1={},lib={},reactSwipe={},hasRequiredReactSwipe;function requireReactSwipe(){return hasRequiredReactSwipe||(hasRequiredReactSwipe=1,function(a){(function(_,$){$(a,reactExports,propTypesExports)})(commonjsGlobal,function(_,$,j){Object.defineProperty(_,"__esModule",{value:!0}),_.setHasSupportToCaptureOption=yt;var et=rt($),tt=rt(j);function rt($t){return $t&&$t.__esModule?$t:{default:$t}}var nt=Object.assign||function($t){for(var Mt=1;Mt=0||Object.prototype.hasOwnProperty.call($t,Dt)&&(Bt[Dt]=$t[Dt]);return Bt}function st($t,Mt){if(!($t instanceof Mt))throw new TypeError("Cannot call a class as a function")}var ot=function(){function $t(Mt,Bt){for(var Dt=0;Dt0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return ht?$t:$t.capture}function Ct($t){if("touches"in $t){var Mt=$t.touches[0],Bt=Mt.pageX,Dt=Mt.pageY;return{x:Bt,y:Dt}}var zt=$t.screenX,Ot=$t.screenY;return{x:zt,y:Ot}}var Pt=function($t){ut(Mt,$t);function Mt(){var Bt;st(this,Mt);for(var Dt=arguments.length,zt=Array(Dt),Ot=0;Otzt&&this.props.onSwipeRight(1,Dt),this.movePosition.deltaY<-zt?this.props.onSwipeUp(1,Dt):this.movePosition.deltaY>zt&&this.props.onSwipeDown(1,Dt)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(Dt){this.swiper=Dt,this.props.innerRef(Dt)}},{key:"render",value:function(){var Dt=this.props;Dt.tagName;var zt=Dt.className,Ot=Dt.style,It=Dt.children;Dt.allowMouseEvents,Dt.onSwipeUp,Dt.onSwipeDown,Dt.onSwipeLeft,Dt.onSwipeRight,Dt.onSwipeStart,Dt.onSwipeMove,Dt.onSwipeEnd,Dt.innerRef,Dt.tolerance;var Lt=it(Dt,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return et.default.createElement(this.props.tagName,nt({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:zt,style:Ot},Lt),It)}}]),Mt}($.Component);Pt.displayName="ReactSwipe",Pt.propTypes={tagName:tt.default.string,className:tt.default.string,style:tt.default.object,children:tt.default.node,allowMouseEvents:tt.default.bool,onSwipeUp:tt.default.func,onSwipeDown:tt.default.func,onSwipeLeft:tt.default.func,onSwipeRight:tt.default.func,onSwipeStart:tt.default.func,onSwipeMove:tt.default.func,onSwipeEnd:tt.default.func,innerRef:tt.default.func,tolerance:tt.default.number.isRequired},Pt.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},_.default=Pt})}(reactSwipe)),reactSwipe}(function(a){(function(_,$){$(a,requireReactSwipe())})(commonjsGlobal,function(_,$){Object.defineProperty(_,"__esModule",{value:!0});var j=et($);function et(tt){return tt&&tt.__esModule?tt:{default:tt}}_.default=j.default})})(lib);var cssClasses={},classnames={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames diff --git a/index.html b/index.html index dcc7e83a34..6be0283e28 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ --> Umami - +